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,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Attribute = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
class Attribute {
constructor(params = {}) {
this.type = "";
this.values = [];
Object.assign(this, params);
}
}
exports.Attribute = Attribute;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })
], Attribute.prototype, "type", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any, repeated: "set" })
], Attribute.prototype, "values", void 0);
@@ -0,0 +1,24 @@
/*
* 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.
*/
/**
* Calls all functions in the order they were chained with the same arguments.
*/
export function chain(...callbacks: any[]): (...args: any[]) => void {
return (...args: any[]) => {
for (let callback of callbacks) {
if (typeof callback === 'function') {
callback(...args);
}
}
};
}
@@ -0,0 +1,500 @@
/**
* @fileoverview Disallow inherently non-interactive elements to be assigned
* interactive roles.
* @author Jesse Beach
* @author $AUTHOR
*/
// -----------------------------------------------------------------------------
// Requirements
// -----------------------------------------------------------------------------
import { RuleTester } from 'eslint';
import { configs } from '../../../src/index';
import parserOptionsMapper from '../../__util__/parserOptionsMapper';
import parsers from '../../__util__/helpers/parsers';
import rule from '../../../src/rules/no-noninteractive-element-to-interactive-role';
import ruleOptionsMapperFactory from '../../__util__/ruleOptionsMapperFactory';
// -----------------------------------------------------------------------------
// Tests
// -----------------------------------------------------------------------------
const ruleTester = new RuleTester();
const errorMessage = 'Non-interactive elements should not be assigned interactive roles.';
const expectedError = {
message: errorMessage,
type: 'JSXAttribute',
};
const ruleName = 'jsx-a11y/no-noninteractive-element-to-interactive-role';
const componentsSettings = {
'jsx-a11y': {
components: {
Article: 'article',
Input: 'input',
},
},
};
const alwaysValid = [
{ code: '<TestComponent onClick={doFoo} />' },
{ code: '<Button onClick={doFoo} />' },
/* Interactive elements */
{ code: '<a tabIndex="0" role="button" />' },
{ code: '<a href="http://x.y.z" role="button" />' },
{ code: '<a href="http://x.y.z" tabIndex="0" role="button" />' },
{ code: '<area role="button" />;' },
{ code: '<area role="menuitem" />;' },
{ code: '<button className="foo" role="button" />' },
{ code: '<body role="button" />;' },
{ code: '<frame role="button" />;' },
{ code: '<td role="button" />;' },
{ code: '<frame role="menuitem" />;' },
{ code: '<td role="menuitem" />;' },
/* All flavors of input */
{ code: '<input role="button" />' },
{ code: '<input type="button" role="button" />' },
{ code: '<input type="checkbox" role="button" />' },
{ code: '<input type="color" role="button" />' },
{ code: '<input type="date" role="button" />' },
{ code: '<input type="datetime" role="button" />' },
{ code: '<input type="datetime-local" role="button" />' },
{ code: '<input type="email" role="button" />' },
{ code: '<input type="file" role="button" />' },
{ code: '<input type="hidden" role="button" />' },
{ code: '<input type="image" role="button" />' },
{ code: '<input type="month" role="button" />' },
{ code: '<input type="number" role="button" />' },
{ code: '<input type="password" role="button" />' },
{ code: '<input type="radio" role="button" />' },
{ code: '<input type="range" role="button" />' },
{ code: '<input type="reset" role="button" />' },
{ code: '<input type="search" role="button" />' },
{ code: '<input type="submit" role="button" />' },
{ code: '<input type="tel" role="button" />' },
{ code: '<input type="text" role="button" />' },
{ code: '<input type="time" role="button" />' },
{ code: '<input type="url" role="button" />' },
{ code: '<input type="week" role="button" />' },
{ code: '<input type="hidden" role="img" />' },
/* End all flavors of input */
{ code: '<menuitem role="button" />;' },
{ code: '<option className="foo" role="button" />' },
{ code: '<select className="foo" role="button" />' },
{ code: '<textarea className="foo" role="button" />' },
{ code: '<tr role="button" />;' },
{ code: '<tr role="presentation" />;' },
/* Interactive elements */
{ code: '<a tabIndex="0" role="img" />' },
{ code: '<a href="http://x.y.z" role="img" />' },
{ code: '<a href="http://x.y.z" tabIndex="0" role="img" />' },
/* All flavors of input */
{ code: '<input role="img" />' },
{ code: '<input type="img" role="img" />' },
{ code: '<input type="checkbox" role="img" />' },
{ code: '<input type="color" role="img" />' },
{ code: '<input type="date" role="img" />' },
{ code: '<input type="datetime" role="img" />' },
{ code: '<input type="datetime-local" role="img" />' },
{ code: '<input type="email" role="img" />' },
{ code: '<input type="file" role="img" />' },
{ code: '<input type="hidden" role="button" />' },
{ code: '<input type="image" role="img" />' },
{ code: '<input type="month" role="img" />' },
{ code: '<input type="number" role="img" />' },
{ code: '<input type="password" role="img" />' },
{ code: '<input type="radio" role="img" />' },
{ code: '<input type="range" role="img" />' },
{ code: '<input type="reset" role="img" />' },
{ code: '<input type="search" role="img" />' },
{ code: '<input type="submit" role="img" />' },
{ code: '<input type="tel" role="img" />' },
{ code: '<input type="text" role="img" />' },
{ code: '<input type="time" role="img" />' },
{ code: '<input type="url" role="img" />' },
{ code: '<input type="week" role="img" />' },
/* End all flavors of input */
{ code: '<menuitem role="img" />;' },
{ code: '<option className="foo" role="img" />' },
{ code: '<select className="foo" role="img" />' },
{ code: '<textarea className="foo" role="img" />' },
{ code: '<tr role="img" />;' },
/* Interactive elements */
{ code: '<a tabIndex="0" role="listitem" />' },
{ code: '<a href="http://x.y.z" role="listitem" />' },
{ code: '<a href="http://x.y.z" tabIndex="0" role="listitem" />' },
/* All flavors of input */
{ code: '<input role="listitem" />' },
{ code: '<input type="listitem" role="listitem" />' },
{ code: '<input type="checkbox" role="listitem" />' },
{ code: '<input type="color" role="listitem" />' },
{ code: '<input type="date" role="listitem" />' },
{ code: '<input type="datetime" role="listitem" />' },
{ code: '<input type="datetime-local" role="listitem" />' },
{ code: '<input type="email" role="listitem" />' },
{ code: '<input type="file" role="listitem" />' },
{ code: '<input type="image" role="listitem" />' },
{ code: '<input type="month" role="listitem" />' },
{ code: '<input type="number" role="listitem" />' },
{ code: '<input type="password" role="listitem" />' },
{ code: '<input type="radio" role="listitem" />' },
{ code: '<input type="range" role="listitem" />' },
{ code: '<input type="reset" role="listitem" />' },
{ code: '<input type="search" role="listitem" />' },
{ code: '<input type="submit" role="listitem" />' },
{ code: '<input type="tel" role="listitem" />' },
{ code: '<input type="text" role="listitem" />' },
{ code: '<input type="time" role="listitem" />' },
{ code: '<input type="url" role="listitem" />' },
{ code: '<input type="week" role="listitem" />' },
/* End all flavors of input */
{ code: '<menuitem role="listitem" />;' },
{ code: '<option className="foo" role="listitem" />' },
{ code: '<select className="foo" role="listitem" />' },
{ code: '<textarea className="foo" role="listitem" />' },
{ code: '<tr role="listitem" />;' },
/* HTML elements with neither an interactive or non-interactive valence (static) */
{ code: '<acronym role="button" />;' },
{ code: '<applet role="button" />;' },
{ code: '<audio role="button" />;' },
{ code: '<b role="button" />;' },
{ code: '<base role="button" />;' },
{ code: '<bdi role="button" />;' },
{ code: '<bdo role="button" />;' },
{ code: '<big role="button" />;' },
{ code: '<blink role="button" />;' },
{ code: '<canvas role="button" />;' },
{ code: '<center role="button" />;' },
{ code: '<cite role="button" />;' },
{ code: '<col role="button" />;' },
{ code: '<colgroup role="button" />;' },
{ code: '<content role="button" />;' },
{ code: '<data role="button" />;' },
{ code: '<datalist role="button" />;' },
{ code: '<div role="button" />;' },
{ code: '<div className="foo" role="button" />;' },
{ code: '<div className="foo" {...props} role="button" />;' },
{ code: '<div aria-hidden role="button" />;' },
{ code: '<div aria-hidden={true} role="button" />;' },
{ code: '<div role="button" />;' },
{ code: '<div role={undefined} role="button" />;' },
{ code: '<div {...props} role="button" />;' },
{ code: '<div onKeyUp={() => void 0} aria-hidden={false} role="button" />;' },
{ code: '<embed role="button" />;' },
{ code: '<font role="button" />;' },
{ code: '<frameset role="button" />;' },
{ code: '<head role="button" />;' },
{ code: '<header role="button" />;' },
{ code: '<hgroup role="button" />;' },
{ code: '<i role="button" />;' },
{ code: '<kbd role="button" />;' },
{ code: '<keygen role="button" />;' },
{ code: '<link role="button" />;' },
{ code: '<map role="button" />;' },
{ code: '<meta role="button" />;' },
{ code: '<noembed role="button" />;' },
{ code: '<noscript role="button" />;' },
{ code: '<object role="button" />;' },
{ code: '<param role="button" />;' },
{ code: '<picture role="button" />;' },
{ code: '<q role="button" />;' },
{ code: '<rp role="button" />;' },
{ code: '<rt role="button" />;' },
{ code: '<rtc role="button" />;' },
{ code: '<s role="button" />;' },
{ code: '<samp role="button" />;' },
{ code: '<script role="button" />;' },
{ code: '<small role="button" />;' },
{ code: '<source role="button" />;' },
{ code: '<spacer role="button" />;' },
{ code: '<span role="button" />;' },
{ code: '<strike role="button" />;' },
{ code: '<style role="button" />;' },
{ code: '<summary role="button" />;' },
{ code: '<th role="button" />;' },
{ code: '<title role="button" />;' },
{ code: '<track role="button" />;' },
{ code: '<tt role="button" />;' },
{ code: '<u role="button" />;' },
{ code: '<var role="button" />;' },
{ code: '<video role="button" />;' },
{ code: '<wbr role="button" />;' },
{ code: '<xmp role="button" />;' },
/* HTML elements attributed with an interactive role */
{ code: '<div role="button" />;' },
{ code: '<div role="checkbox" />;' },
{ code: '<div role="columnheader" />;' },
{ code: '<div role="combobox" />;' },
{ code: '<div role="grid" />;' },
{ code: '<div role="gridcell" />;' },
{ code: '<div role="link" />;' },
{ code: '<div role="listbox" />;' },
{ code: '<div role="menu" />;' },
{ code: '<div role="menubar" />;' },
{ code: '<div role="menuitem" />;' },
{ code: '<div role="menuitemcheckbox" />;' },
{ code: '<div role="menuitemradio" />;' },
{ code: '<div role="option" />;' },
{ code: '<div role="progressbar" />;' },
{ code: '<div role="radio" />;' },
{ code: '<div role="radiogroup" />;' },
{ code: '<div role="row" />;' },
{ code: '<div role="rowheader" />;' },
{ code: '<div role="searchbox" />;' },
{ code: '<div role="slider" />;' },
{ code: '<div role="spinbutton" />;' },
{ code: '<div role="switch" />;' },
{ code: '<div role="tab" />;' },
{ code: '<div role="textbox" />;' },
{ code: '<div role="treeitem" />;' },
/* Presentation is a special case role that indicates intentional static semantics */
{ code: '<div role="presentation" />;' },
/* HTML elements attributed with an abstract role */
{ code: '<div role="command" />;' },
{ code: '<div role="composite" />;' },
{ code: '<div role="input" />;' },
{ code: '<div role="landmark" />;' },
{ code: '<div role="range" />;' },
{ code: '<div role="roletype" />;' },
{ code: '<div role="section" />;' },
{ code: '<div role="sectionhead" />;' },
{ code: '<div role="select" />;' },
{ code: '<div role="structure" />;' },
{ code: '<div role="tablist" />;' },
{ code: '<div role="toolbar" />;' },
{ code: '<div role="tree" />;' },
{ code: '<div role="treegrid" />;' },
{ code: '<div role="widget" />;' },
{ code: '<div role="window" />;' },
/* HTML elements with an inherent non-interactive role, assigned an
* interactive role. */
{ code: '<main role="listitem" />;' },
{ code: '<a role="listitem" />' },
{ code: '<a role="listitem" />;' },
{ code: '<a role="button" />' },
{ code: '<a role="button" />;' },
{ code: '<a role="menuitem" />' },
{ code: '<a role="menuitem" />;' },
{ code: '<area role="listitem" />;' },
{ code: '<article role="listitem" />;' },
{ code: '<article role="listitem" />;' },
{ code: '<dd role="listitem" />;' },
{ code: '<dfn role="listitem" />;' },
{ code: '<dt role="listitem" />;' },
{ code: '<fieldset role="listitem" />;' },
{ code: '<figure role="listitem" />;' },
{ code: '<form role="listitem" />;' },
{ code: '<frame role="listitem" />;' },
{ code: '<h1 role="listitem" />;' },
{ code: '<h2 role="listitem" />;' },
{ code: '<h3 role="listitem" />;' },
{ code: '<h4 role="listitem" />;' },
{ code: '<h5 role="listitem" />;' },
{ code: '<h6 role="listitem" />;' },
{ code: '<hr role="listitem" />;' },
{ code: '<img role="listitem" />;' },
{ code: '<li role="listitem" />;' },
{ code: '<li role="presentation" />;' },
{ code: '<nav role="listitem" />;' },
{ code: '<ol role="listitem" />;' },
{ code: '<table role="listitem" />;' },
{ code: '<tbody role="listitem" />;' },
{ code: '<td role="listitem" />;' },
{ code: '<tfoot role="listitem" />;' },
{ code: '<thead role="listitem" />;' },
{ code: '<ul role="listitem" />;' },
/* HTML elements attributed with a non-interactive role */
{ code: '<div role="alert" />;' },
{ code: '<div role="alertdialog" />;' },
{ code: '<div role="application" />;' },
{ code: '<div role="article" />;' },
{ code: '<div role="banner" />;' },
{ code: '<div role="cell" />;' },
{ code: '<div role="complementary" />;' },
{ code: '<div role="contentinfo" />;' },
{ code: '<div role="definition" />;' },
{ code: '<div role="dialog" />;' },
{ code: '<div role="directory" />;' },
{ code: '<div role="document" />;' },
{ code: '<div role="feed" />;' },
{ code: '<div role="figure" />;' },
{ code: '<div role="form" />;' },
{ code: '<div role="group" />;' },
{ code: '<div role="heading" />;' },
{ code: '<div role="img" />;' },
{ code: '<div role="list" />;' },
{ code: '<div role="listitem" />;' },
{ code: '<div role="log" />;' },
{ code: '<div role="main" />;' },
{ code: '<div role="marquee" />;' },
{ code: '<div role="math" />;' },
{ code: '<div role="navigation" />;' },
{ code: '<div role="note" />;' },
{ code: '<div role="region" />;' },
{ code: '<div role="rowgroup" />;' },
{ code: '<div role="search" />;' },
{ code: '<div role="separator" />;' },
{ code: '<div role="scrollbar" />;' },
{ code: '<div role="status" />;' },
{ code: '<div role="table" />;' },
{ code: '<div role="tabpanel" />;' },
{ code: '<div role="term" />;' },
{ code: '<div role="timer" />;' },
{ code: '<div role="tooltip" />;' },
{ code: '<ul role="list" />;' },
/* Custom components */
{ code: '<Article role="button" />' },
{ code: '<Input role="button" />', settings: componentsSettings },
];
const neverValid = [
/* HTML elements with an inherent non-interactive role, assigned an
* interactive role. */
{ code: '<address role="button" />;', errors: [expectedError] },
{ code: '<article role="button" />;', errors: [expectedError] },
{ code: '<aside role="button" />;', errors: [expectedError] },
{ code: '<blockquote role="button" />;', errors: [expectedError] },
{ code: '<br role="button" />;', errors: [expectedError] },
{ code: '<caption role="button" />;', errors: [expectedError] },
{ code: '<code role="button" />;', errors: [expectedError] },
{ code: '<dd role="button" />;', errors: [expectedError] },
{ code: '<del role="button" />;', errors: [expectedError] },
{ code: '<details role="button" />;', errors: [expectedError] },
{ code: '<dfn role="button" />;', errors: [expectedError] },
{ code: '<dir role="button" />;', errors: [expectedError] },
{ code: '<dl role="button" />;', errors: [expectedError] },
{ code: '<dt role="button" />;', errors: [expectedError] },
{ code: '<em role="button" />;', errors: [expectedError] },
{ code: '<fieldset role="button" />;', errors: [expectedError] },
{ code: '<figcaption role="button" />;', errors: [expectedError] },
{ code: '<figure role="button" />;', errors: [expectedError] },
{ code: '<footer role="button" />;', errors: [expectedError] },
{ code: '<form role="button" />;', errors: [expectedError] },
{ code: '<h1 role="button" />;', errors: [expectedError] },
{ code: '<h2 role="button" />;', errors: [expectedError] },
{ code: '<h3 role="button" />;', errors: [expectedError] },
{ code: '<h4 role="button" />;', errors: [expectedError] },
{ code: '<h5 role="button" />;', errors: [expectedError] },
{ code: '<h6 role="button" />;', errors: [expectedError] },
{ code: '<hr role="button" />;', errors: [expectedError] },
{ code: '<html role="button" />;', errors: [expectedError] },
{ code: '<iframe role="button" />;', errors: [expectedError] },
{ code: '<img role="button" />;', errors: [expectedError] },
{ code: '<ins role="button" />;', errors: [expectedError] },
{ code: '<label role="button" />;', errors: [expectedError] },
{ code: '<legend role="button" />;', errors: [expectedError] },
{ code: '<li role="button" />;', errors: [expectedError] },
{ code: '<main role="button" />;', errors: [expectedError] },
{ code: '<mark role="button" />;', errors: [expectedError] },
{ code: '<marquee role="button" />;', errors: [expectedError] },
{ code: '<menu role="button" />;', errors: [expectedError] },
{ code: '<meter role="button" />;', errors: [expectedError] },
{ code: '<nav role="button" />;', errors: [expectedError] },
{ code: '<ol role="button" />;', errors: [expectedError] },
{ code: '<optgroup role="button" />;', errors: [expectedError] },
{ code: '<output role="button" />;', errors: [expectedError] },
{ code: '<pre role="button" />;', errors: [expectedError] },
{ code: '<progress role="button" />;', errors: [expectedError] },
{ code: '<ruby role="button" />;', errors: [expectedError] },
{ code: '<strong role="button" />;', errors: [expectedError] },
{ code: '<sub role="button" />;', errors: [expectedError] },
{ code: '<sup role="button" />;', errors: [expectedError] },
{ code: '<table role="button" />;', errors: [expectedError] },
{ code: '<tbody role="button" />;', errors: [expectedError] },
{ code: '<tfoot role="button" />;', errors: [expectedError] },
{ code: '<thead role="button" />;', errors: [expectedError] },
{ code: '<time role="button" />;', errors: [expectedError] },
{ code: '<ul role="button" />;', errors: [expectedError] },
/* HTML elements with an inherent non-interactive role, assigned an
* interactive role. */
{ code: '<main role="menuitem" />;', errors: [expectedError] },
{ code: '<article role="menuitem" />;', errors: [expectedError] },
{ code: '<dd role="menuitem" />;', errors: [expectedError] },
{ code: '<dfn role="menuitem" />;', errors: [expectedError] },
{ code: '<dt role="menuitem" />;', errors: [expectedError] },
{ code: '<fieldset role="menuitem" />;', errors: [expectedError] },
{ code: '<figure role="menuitem" />;', errors: [expectedError] },
{ code: '<form role="menuitem" />;', errors: [expectedError] },
{ code: '<h1 role="menuitem" />;', errors: [expectedError] },
{ code: '<h2 role="menuitem" />;', errors: [expectedError] },
{ code: '<h3 role="menuitem" />;', errors: [expectedError] },
{ code: '<h4 role="menuitem" />;', errors: [expectedError] },
{ code: '<h5 role="menuitem" />;', errors: [expectedError] },
{ code: '<h6 role="menuitem" />;', errors: [expectedError] },
{ code: '<hr role="menuitem" />;', errors: [expectedError] },
{ code: '<img role="menuitem" />;', errors: [expectedError] },
{ code: '<nav role="menuitem" />;', errors: [expectedError] },
{ code: '<ol role="menuitem" />;', errors: [expectedError] },
{ code: '<p role="button" />;', errors: [expectedError] },
{ code: '<section role="button" aria-label="Aardvark" />;', errors: [expectedError] },
{ code: '<table role="menuitem" />;', errors: [expectedError] },
{ code: '<tbody role="menuitem" />;', errors: [expectedError] },
{ code: '<tfoot role="menuitem" />;', errors: [expectedError] },
{ code: '<thead role="menuitem" />;', errors: [expectedError] },
/* Custom components */
{ code: '<Article role="button" />', errors: [expectedError], settings: componentsSettings },
];
const recommendedOptions = (configs.recommended.rules[ruleName][1] || {});
ruleTester.run(`${ruleName}:recommended`, rule, {
valid: parsers.all([].concat(
...alwaysValid,
{ code: '<ul role="menu" />;' },
{ code: '<ul role="menubar" />;' },
{ code: '<ul role="radiogroup" />;' },
{ code: '<ul role="tablist" />;' },
{ code: '<ul role="tree" />;' },
{ code: '<ul role="treegrid" />;' },
{ code: '<ol role="menu" />;' },
{ code: '<ol role="menubar" />;' },
{ code: '<ol role="radiogroup" />;' },
{ code: '<ol role="tablist" />;' },
{ code: '<ol role="tree" />;' },
{ code: '<ol role="treegrid" />;' },
{ code: '<li role="tab" />;' },
{ code: '<li role="menuitem" />;' },
{ code: '<li role="menuitemcheckbox" />;' },
{ code: '<li role="menuitemradio" />;' },
{ code: '<li role="row" />;' },
{ code: '<li role="treeitem" />;' },
{ code: '<Component role="treeitem" />;' },
{ code: '<fieldset role="radiogroup" />;' },
{ code: '<fieldset role="presentation" />;' },
))
.map(ruleOptionsMapperFactory(recommendedOptions))
.map(parserOptionsMapper),
invalid: parsers.all([].concat(
...neverValid,
))
.map(ruleOptionsMapperFactory(recommendedOptions))
.map(parserOptionsMapper),
});
ruleTester.run(`${ruleName}:strict`, rule, {
valid: parsers.all([].concat(
...alwaysValid,
)).map(parserOptionsMapper),
invalid: parsers.all([].concat(
...neverValid,
{ code: '<ul role="menu" />;', errors: [expectedError] },
{ code: '<ul role="menubar" />;', errors: [expectedError] },
{ code: '<ul role="radiogroup" />;', errors: [expectedError] },
{ code: '<ul role="tablist" />;', errors: [expectedError] },
{ code: '<ul role="tree" />;', errors: [expectedError] },
{ code: '<ul role="treegrid" />;', errors: [expectedError] },
{ code: '<ol role="menu" />;', errors: [expectedError] },
{ code: '<ol role="menubar" />;', errors: [expectedError] },
{ code: '<ol role="radiogroup" />;', errors: [expectedError] },
{ code: '<ol role="tablist" />;', errors: [expectedError] },
{ code: '<ol role="tree" />;', errors: [expectedError] },
{ code: '<ol role="treegrid" />;', errors: [expectedError] },
{ code: '<li role="tab" />;', errors: [expectedError] },
{ code: '<li role="menuitem" />;', errors: [expectedError] },
{ code: '<li role="row" />;', errors: [expectedError] },
{ code: '<li role="treeitem" />;', errors: [expectedError] },
)).map(parserOptionsMapper),
});
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2017 Blaine Bublitz <blaine.bublitz@gmail.com>, Eric Schoffstall <yo@contra.io> and other contributors (Based on code from gulp-sourcemaps - ISC License - Copyright (c) 2014, Florian Reiterer)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,12 @@
'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.RemotePath = undefined;var _createClass = function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();var _resolve2 = require('eslint-module-utils/resolve');var _resolve3 = _interopRequireDefault(_resolve2);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}var
RemotePath = exports.RemotePath = function () {
function RemotePath(path, context) {_classCallCheck(this, RemotePath);
this.path = path;
this.context = context;
}_createClass(RemotePath, [{ key: 'resolve', value: function () {function resolve(
value) {
return _resolve3['default'].relative(value, this.path, this.context.settings);
}return resolve;}() }]);return RemotePath;}();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9leHBvcnRNYXAvcmVtb3RlUGF0aC5qcyJdLCJuYW1lcyI6WyJSZW1vdGVQYXRoIiwicGF0aCIsImNvbnRleHQiLCJ2YWx1ZSIsInJlc29sdmUiLCJyZWxhdGl2ZSIsInNldHRpbmdzIl0sIm1hcHBpbmdzIjoiK29CQUFBLHVEOztBQUVhQSxVLFdBQUFBLFU7QUFDWCxzQkFBWUMsSUFBWixFQUFrQkMsT0FBbEIsRUFBMkI7QUFDekIsU0FBS0QsSUFBTCxHQUFZQSxJQUFaO0FBQ0EsU0FBS0MsT0FBTCxHQUFlQSxPQUFmO0FBQ0QsRzs7QUFFT0MsVyxFQUFPO0FBQ2IsZUFBT0MscUJBQVFDLFFBQVIsQ0FBaUJGLEtBQWpCLEVBQXdCLEtBQUtGLElBQTdCLEVBQW1DLEtBQUtDLE9BQUwsQ0FBYUksUUFBaEQsQ0FBUDtBQUNELE8iLCJmaWxlIjoicmVtb3RlUGF0aC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCByZXNvbHZlIGZyb20gJ2VzbGludC1tb2R1bGUtdXRpbHMvcmVzb2x2ZSc7XG5cbmV4cG9ydCBjbGFzcyBSZW1vdGVQYXRoIHtcbiAgY29uc3RydWN0b3IocGF0aCwgY29udGV4dCkge1xuICAgIHRoaXMucGF0aCA9IHBhdGg7XG4gICAgdGhpcy5jb250ZXh0ID0gY29udGV4dDtcbiAgfVxuXG4gIHJlc29sdmUodmFsdWUpIHtcbiAgICByZXR1cm4gcmVzb2x2ZS5yZWxhdGl2ZSh2YWx1ZSwgdGhpcy5wYXRoLCB0aGlzLmNvbnRleHQuc2V0dGluZ3MpO1xuICB9XG59XG4iXX0=
@@ -0,0 +1,22 @@
"use strict";
const MS_IN_SECOND = 1e3;
const MS_IN_MINUTE = 6e4;
const MS_IN_HOUR = 36e5;
const MS_IN_DAY = 864e5;
const rangeOfUnits = [
"time",
"year",
"month",
"date",
"day",
"hour",
"minute",
"second",
"millisecond",
"utcOffset"
];
exports.MS_IN_DAY = MS_IN_DAY;
exports.MS_IN_HOUR = MS_IN_HOUR;
exports.MS_IN_MINUTE = MS_IN_MINUTE;
exports.MS_IN_SECOND = MS_IN_SECOND;
exports.rangeOfUnits = rangeOfUnits;
@@ -0,0 +1,81 @@
class TagPath{
constructor(pathStr){
let text = "";
let tName = "";
let pos;
let aName = "";
let aVal = "";
this.stack = []
for (let i = 0; i < pathStr.length; i++) {
let ch = pathStr[i];
if(ch === " ") {
if(text.length === 0) continue;
tName = text; text = "";
}else if(ch === "["){
if(tName.length === 0){
tName = text; text = "";
}
i++;
for (; i < pathStr.length; i++) {
ch = pathStr[i];
if(ch=== "=") continue;
else if(ch=== "]") {aName = text.trim(); text=""; break; i--;}
else if(ch === "'" || ch === '"'){
let attrEnd = pathStr.indexOf(ch,i+1);
aVal = pathStr.substring(i+1, attrEnd);
i = attrEnd;
}else{
text +=ch;
}
}
}else if(ch !== " " && text.length === 0 && tName.length > 0){//reading tagName
//save previous tag
this.stack.push(new TagPathNode(tName,pos,aName,aVal));
text = ch; tName = ""; aName = ""; aVal = "";
}else{
text+=ch;
}
}
//last tag in the path
if(tName.length >0 || text.length>0){
this.stack.push(new TagPathNode(text||tName,pos,aName,aVal));
}
}
match(tagStack,node){
if(this.stack[0].name !== "*"){
if(this.stack.length !== tagStack.length +1) return false;
//loop through tagPath and tagStack and match
for (let i = 0; i < this.tagStack.length; i++) {
if(!this.stack[i].match(tagStack[i])) return false;
}
}
if(!this.stack[this.stack.length - 1].match(node)) return false;
return true;
}
}
class TagPathNode{
constructor(name,position,attrName,attrVal){
this.name = name;
this.position = position;
this.attrName = attrName,
this.attrVal = attrVal;
}
match(node){
let matching = true;
matching = node.name === this.name;
if(this.position) matching = node.position === this.position;
if(this.attrName) matching = node.attrs[this.attrName !== undefined];
if(this.attrVal) matching = node.attrs[this.attrName !== this.attrVal];
return matching;
}
}
// console.log((new TagPath("* b[b]")).stack);
// console.log((new TagPath("a[a] b[b] c")).stack);
// console.log((new TagPath(" b [ b= 'cf sdadwa' ] a ")).stack);
@@ -0,0 +1 @@
module.exports={"aac":require("./features/aac"),"abortcontroller":require("./features/abortcontroller"),"ac3-ec3":require("./features/ac3-ec3"),"accelerometer":require("./features/accelerometer"),"addeventlistener":require("./features/addeventlistener"),"alternate-stylesheet":require("./features/alternate-stylesheet"),"ambient-light":require("./features/ambient-light"),"apng":require("./features/apng"),"array-find-index":require("./features/array-find-index"),"array-find":require("./features/array-find"),"array-flat":require("./features/array-flat"),"array-includes":require("./features/array-includes"),"arrow-functions":require("./features/arrow-functions"),"asmjs":require("./features/asmjs"),"async-clipboard":require("./features/async-clipboard"),"async-functions":require("./features/async-functions"),"atob-btoa":require("./features/atob-btoa"),"audio-api":require("./features/audio-api"),"audio":require("./features/audio"),"audiotracks":require("./features/audiotracks"),"autofocus":require("./features/autofocus"),"auxclick":require("./features/auxclick"),"av1":require("./features/av1"),"avif":require("./features/avif"),"background-attachment":require("./features/background-attachment"),"background-clip-text":require("./features/background-clip-text"),"background-img-opts":require("./features/background-img-opts"),"background-position-x-y":require("./features/background-position-x-y"),"background-repeat-round-space":require("./features/background-repeat-round-space"),"background-sync":require("./features/background-sync"),"battery-status":require("./features/battery-status"),"beacon":require("./features/beacon"),"beforeafterprint":require("./features/beforeafterprint"),"bigint":require("./features/bigint"),"blobbuilder":require("./features/blobbuilder"),"bloburls":require("./features/bloburls"),"border-image":require("./features/border-image"),"border-radius":require("./features/border-radius"),"broadcastchannel":require("./features/broadcastchannel"),"brotli":require("./features/brotli"),"calc":require("./features/calc"),"canvas-blending":require("./features/canvas-blending"),"canvas-text":require("./features/canvas-text"),"canvas":require("./features/canvas"),"ch-unit":require("./features/ch-unit"),"chacha20-poly1305":require("./features/chacha20-poly1305"),"channel-messaging":require("./features/channel-messaging"),"childnode-remove":require("./features/childnode-remove"),"classlist":require("./features/classlist"),"client-hints-dpr-width-viewport":require("./features/client-hints-dpr-width-viewport"),"clipboard":require("./features/clipboard"),"colr-v1":require("./features/colr-v1"),"colr":require("./features/colr"),"comparedocumentposition":require("./features/comparedocumentposition"),"console-basic":require("./features/console-basic"),"console-time":require("./features/console-time"),"const":require("./features/const"),"constraint-validation":require("./features/constraint-validation"),"contenteditable":require("./features/contenteditable"),"contentsecuritypolicy":require("./features/contentsecuritypolicy"),"contentsecuritypolicy2":require("./features/contentsecuritypolicy2"),"cookie-store-api":require("./features/cookie-store-api"),"cors":require("./features/cors"),"createimagebitmap":require("./features/createimagebitmap"),"credential-management":require("./features/credential-management"),"cross-document-view-transitions":require("./features/cross-document-view-transitions"),"cryptography":require("./features/cryptography"),"css-all":require("./features/css-all"),"css-anchor-positioning":require("./features/css-anchor-positioning"),"css-animation":require("./features/css-animation"),"css-any-link":require("./features/css-any-link"),"css-appearance":require("./features/css-appearance"),"css-at-counter-style":require("./features/css-at-counter-style"),"css-autofill":require("./features/css-autofill"),"css-backdrop-filter":require("./features/css-backdrop-filter"),"css-background-offsets":require("./features/css-background-offsets"),"css-backgroundblendmode":require("./features/css-backgroundblendmode"),"css-boxdecorationbreak":require("./features/css-boxdecorationbreak"),"css-boxshadow":require("./features/css-boxshadow"),"css-canvas":require("./features/css-canvas"),"css-caret-color":require("./features/css-caret-color"),"css-cascade-layers":require("./features/css-cascade-layers"),"css-cascade-scope":require("./features/css-cascade-scope"),"css-case-insensitive":require("./features/css-case-insensitive"),"css-clip-path":require("./features/css-clip-path"),"css-color-adjust":require("./features/css-color-adjust"),"css-color-function":require("./features/css-color-function"),"css-conic-gradients":require("./features/css-conic-gradients"),"css-container-queries-style":require("./features/css-container-queries-style"),"css-container-queries":require("./features/css-container-queries"),"css-container-query-units":require("./features/css-container-query-units"),"css-containment":require("./features/cssLine truncated
@@ -0,0 +1,118 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.findTruthinessAssertedArgument = findTruthinessAssertedArgument;
exports.findTypeGuardAssertedArgument = findTypeGuardAssertedArgument;
const utils_1 = require("@typescript-eslint/utils");
const ts = __importStar(require("typescript"));
/**
* Inspect a call expression to see if it's a call to an assertion function.
* If it is, return the node of the argument that is asserted.
*/
function findTruthinessAssertedArgument(services, node) {
// If the call looks like `assert(expr1, expr2, ...c, d, e, f)`, then we can
// only care if `expr1` or `expr2` is asserted, since anything that happens
// within or after a spread argument is out of scope to reason about.
const checkableArguments = [];
for (const argument of node.arguments) {
if (argument.type === utils_1.AST_NODE_TYPES.SpreadElement) {
break;
}
checkableArguments.push(argument);
}
// nothing to do
if (checkableArguments.length === 0) {
return undefined;
}
const checker = services.program.getTypeChecker();
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
const signature = checker.getResolvedSignature(tsNode);
if (signature == null) {
return undefined;
}
const firstTypePredicateResult = checker.getTypePredicateOfSignature(signature);
if (firstTypePredicateResult == null) {
return undefined;
}
const { kind, parameterIndex, type } = firstTypePredicateResult;
if (!(kind === ts.TypePredicateKind.AssertsIdentifier && type == null)) {
return undefined;
}
return checkableArguments.at(parameterIndex);
}
/**
* Inspect a call expression to see if it's a call to an assertion function.
* If it is, return the node of the argument that is asserted and other useful info.
*/
function findTypeGuardAssertedArgument(services, node) {
// If the call looks like `assert(expr1, expr2, ...c, d, e, f)`, then we can
// only care if `expr1` or `expr2` is asserted, since anything that happens
// within or after a spread argument is out of scope to reason about.
const checkableArguments = [];
for (const argument of node.arguments) {
if (argument.type === utils_1.AST_NODE_TYPES.SpreadElement) {
break;
}
checkableArguments.push(argument);
}
// nothing to do
if (checkableArguments.length === 0) {
return undefined;
}
const checker = services.program.getTypeChecker();
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
const callSignature = checker.getResolvedSignature(tsNode);
if (callSignature == null) {
return undefined;
}
const typePredicateInfo = checker.getTypePredicateOfSignature(callSignature);
if (typePredicateInfo == null) {
return undefined;
}
const { kind, parameterIndex, type } = typePredicateInfo;
if (!((kind === ts.TypePredicateKind.AssertsIdentifier ||
kind === ts.TypePredicateKind.Identifier) &&
type != null)) {
return undefined;
}
if (parameterIndex >= checkableArguments.length) {
return undefined;
}
return {
argument: checkableArguments[parameterIndex],
asserts: kind === ts.TypePredicateKind.AssertsIdentifier,
type,
};
}
@@ -0,0 +1,41 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
// This header prototypes the Pseudoconsole symbols from conpty.lib with their original names.
// This is required because we cannot import __imp_CreatePseudoConsole from a static library
// as it doesn't produce an import lib.
// We can't use an /ALTERNATENAME trick because it seems that that name is only resolved when the
// linker cannot otherwise find the symbol.
#pragma once
#include <consoleapi.h>
#ifndef CONPTY_IMPEXP
#define CONPTY_IMPEXP __declspec(dllimport)
#endif
#ifndef CONPTY_EXPORT
#ifdef __cplusplus
#define CONPTY_EXPORT extern "C" CONPTY_IMPEXP
#else
#define CONPTY_EXPORT extern CONPTY_IMPEXP
#endif
#endif
#define PSEUDOCONSOLE_RESIZE_QUIRK (2u)
#define PSEUDOCONSOLE_PASSTHROUGH_MODE (8u)
CONPTY_EXPORT HRESULT WINAPI ConptyCreatePseudoConsole(COORD size, HANDLE hInput, HANDLE hOutput, DWORD dwFlags, HPCON* phPC);
CONPTY_EXPORT HRESULT WINAPI ConptyCreatePseudoConsoleAsUser(HANDLE hToken, COORD size, HANDLE hInput, HANDLE hOutput, DWORD dwFlags, HPCON* phPC);
CONPTY_EXPORT HRESULT WINAPI ConptyResizePseudoConsole(HPCON hPC, COORD size);
CONPTY_EXPORT HRESULT WINAPI ConptyClearPseudoConsole(HPCON hPC);
CONPTY_EXPORT HRESULT WINAPI ConptyShowHidePseudoConsole(HPCON hPC, bool show);
CONPTY_EXPORT HRESULT WINAPI ConptyReparentPseudoConsole(HPCON hPC, HWND newParent);
CONPTY_EXPORT HRESULT WINAPI ConptyReleasePseudoConsole(HPCON hPC);
CONPTY_EXPORT VOID WINAPI ConptyClosePseudoConsole(HPCON hPC);
CONPTY_EXPORT VOID WINAPI ConptyClosePseudoConsoleTimeout(HPCON hPC, DWORD dwMilliseconds);
CONPTY_EXPORT HRESULT WINAPI ConptyPackPseudoConsole(HANDLE hServerProcess, HANDLE hRef, HANDLE hSignal, HPCON* phPC);
@@ -0,0 +1,32 @@
var baseProperty = require('./_baseProperty'),
basePropertyDeep = require('./_basePropertyDeep'),
isKey = require('./_isKey'),
toKey = require('./_toKey');
/**
* Creates a function that returns the value at `path` of a given object.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
* @example
*
* var objects = [
* { 'a': { 'b': 2 } },
* { 'a': { 'b': 1 } }
* ];
*
* _.map(objects, _.property('a.b'));
* // => [2, 1]
*
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
* // => [1, 2]
*/
function property(path) {
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
}
module.exports = property;
@@ -0,0 +1,18 @@
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(require("./core"), require("./md5"), require("./hmac"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./md5", "./hmac"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
return CryptoJS.HmacMD5;
}));
@@ -0,0 +1,22 @@
export {};
// lib.webworker has `WorkerNavigator` rather than `Navigator`, so conditionals use `onabort` instead of `onmessage`
type _Navigator = typeof globalThis extends { onabort: any } ? {} : Navigator;
interface Navigator {
readonly hardwareConcurrency: number;
readonly language: string;
readonly languages: readonly string[];
readonly platform: string;
readonly userAgent: string;
}
declare global {
interface Navigator extends _Navigator {}
var Navigator: typeof globalThis extends { onabort: any; Navigator: infer T } ? T : {
prototype: Navigator;
new(): Navigator;
};
// Needs conditional inference for lib.dom and lib.webworker compatibility
var navigator: typeof globalThis extends { onmessage: any; navigator: infer T } ? T : Navigator;
}
@@ -0,0 +1 @@
module.exports={C:{"46":0.00255,"47":0.00255,"50":0.00255,"56":0.00764,"58":0.00255,"61":0.00255,"62":0.00255,"63":0.00255,"64":0.00255,"66":0.00509,"68":0.00255,"72":0.01018,"79":0.00255,"80":0.00509,"84":0.00509,"89":0.00255,"108":0.00255,"114":0.00255,"115":0.02801,"117":0.00255,"120":0.00509,"127":0.01528,"128":0.01018,"131":0.00255,"132":0.00255,"133":0.00255,"135":0.00764,"138":0.00255,"140":0.02291,"141":0.01018,"142":0.02037,"143":0.46337,"144":0.36408,_:"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 48 49 51 52 53 54 55 57 59 60 65 67 69 70 71 73 74 75 76 77 78 81 82 83 85 86 87 88 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 109 110 111 112 113 116 118 119 121 122 123 124 125 126 129 130 134 136 137 139 145 146 147 3.5 3.6"},D:{"11":0.00255,"38":0.00255,"39":0.00255,"40":0.00255,"41":0.00255,"42":0.00255,"43":0.00255,"44":0.00255,"45":0.00255,"46":0.00255,"47":0.00255,"48":0.00255,"49":0.00509,"51":0.00255,"52":0.00255,"54":0.00255,"56":0.00255,"57":0.00255,"59":0.00509,"60":0.00255,"64":0.01273,"65":0.00255,"69":0.02291,"70":0.00255,"71":0.01018,"72":0.00509,"74":0.00764,"75":0.00255,"77":0.00255,"78":0.01273,"79":0.01528,"80":0.06874,"81":0.01018,"84":0.00255,"86":0.01782,"87":0.03564,"89":0.00255,"91":0.02546,"93":0.01273,"94":0.00509,"95":0.00255,"97":0.00509,"99":0.00255,"100":0.00255,"101":0.00255,"102":0.00255,"103":0.01018,"104":0.00255,"105":0.00255,"106":0.00255,"107":0.00255,"108":0.00509,"109":0.08911,"113":0.01273,"114":0.00509,"116":0.02546,"117":0.00509,"118":0.00255,"119":0.02801,"120":0.01782,"121":0.15021,"122":0.02291,"123":0.00509,"124":0.01018,"125":0.63141,"126":0.05347,"127":0.00255,"128":0.29024,"129":0.00255,"130":0.00509,"131":0.06874,"132":0.01528,"133":0.02801,"134":0.07383,"135":0.02801,"136":0.04074,"137":0.04837,"138":0.19859,"139":0.43282,"140":2.20484,"141":4.24927,"142":0.07129,_:"4 5 6 7 8 9 10 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 50 53 55 58 61 62 63 66 67 68 73 76 83 85 88 90 92 96 98 110 111 112 115 143 144 145"},F:{"45":0.01018,"64":0.00764,"79":0.02801,"90":0.00255,"91":0.00255,"92":0.04328,"95":0.01782,"98":0.00255,"108":0.00255,"115":0.00255,"117":0.01528,"118":0.01018,"119":0.00509,"120":0.08911,"121":0.00255,"122":0.79944,_:"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 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 86 87 88 89 93 94 96 97 99 100 101 102 103 104 105 106 107 109 110 111 112 113 114 116 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.02291,"13":0.00764,"14":0.00509,"15":0.00255,"16":0.00255,"17":0.02037,"18":0.11712,"84":0.02801,"85":0.00255,"86":0.00255,"89":0.03055,"90":0.05856,"92":0.08147,"95":0.00764,"100":0.04583,"109":0.00509,"112":0.00255,"114":0.07893,"119":0.00509,"121":0.00255,"122":0.02291,"123":0.00509,"125":0.00509,"127":0.00255,"128":0.00255,"129":0.00255,"130":0.00764,"131":0.00764,"133":0.04837,"134":0.01018,"135":0.02546,"136":0.00764,"137":0.01782,"138":0.0662,"139":0.05601,"140":0.59576,"141":2.46453,"142":0.00255,_:"79 80 81 83 87 88 91 93 94 96 97 98 99 101 102 103 104 105 106 107 108 110 111 113 115 116 117 118 120 124 126 132"},E:{"11":0.00509,"13":0.01528,_:"0 4 5 6 7 8 9 10 12 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 15.1 15.4 15.5 16.0 16.2 16.3 16.4 17.0 17.2 17.3 26.2","11.1":0.03819,"12.1":0.00255,"13.1":0.04328,"14.1":0.00764,"15.2-15.3":0.00255,"15.6":0.05601,"16.1":0.04074,"16.5":0.00255,"16.6":0.04074,"17.1":0.00255,"17.4":0.01273,"17.5":0.01273,"17.6":0.09929,"18.0":0.02037,"18.1":0.01273,"18.2":0.00255,"18.3":0.01273,"18.4":0.01018,"18.5-18.6":0.05856,"26.0":0.20623,"26.1":0.0942},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0009,"5.0-5.1":0,"6.0-6.1":0.00359,"7.0-7.1":0.00269,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00807,"10.0-10.2":0.0009,"10.3":0.01525,"11.0-11.2":0.226,"11.3-11.4":0.00538,"12.0-12.1":0.00179,"12.2-12.5":0.04394,"13.0-13.1":0,"13.2":0.00448,"13.3":0.00179,"13.4-13.7":0.00717,"14.0-14.4":0.01525,"14.5-14.8":0.01614,"15.0-15.1":0.01525,"15.2-15.3":0.01166,"15.4":0.01345,"15.5":0.01525,"15.6-15.8":0.1991,"16.0":0.02691,"16.1":0.05022,"16.2":0.02601,"16.3":0.04664,"16.4":0.01166,"16.5":0.02063,"16.6-16.7":0.26636,"17.0":0.01883,"17.1":0.0287,"17.2":0.02063,"17.3":0.03049,"17.4":0.05381,"17.5":0.09237,"17.6-17.7":0.23318,"18.0":0.05291,"18.1":0.10941,"18.2":0.05919,"18.3":0.19013,"18.4":0.09776,"18.5-18.6":4.98462,"26.0":0.61613,"26.1":0.02242},P:{"20":0.01014,"21":0.03041,"22":0.07097,"23":0.09124,"24":0.15207,"25":0.294,"26":0.13179,"27":0.40552,"28":2.26077,"29":0.0811,_:"4 5.0-5.4 6.2-6.4 8.2 9.2 10.1 12.0 13.0 15.0 17.0 18.0","7.2-7.4":0.0811,"11.1-11.2":0.01014,"14.0":0.01014,"16.0":0.01014,"19.0":0.05069},I:{"0":0.03722,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00002},K:{"0":0.97553,_:"10 11 12 11.1 Line truncated
@@ -0,0 +1 @@
{"name":"set-blocking","version":"2.0.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532122813,"integrity":"sha512-RLfxNL1RAbg7mXt7sE3OhjzQQXBKXgqhuOj80m5OIwqnhbalkIZ9tkfci8GHVypUN6NgPGZn99BaUPdv85R5vA==","mode":420,"size":985},"README.md":{"checkedAt":1794532122813,"integrity":"sha512-ekNSPBwfdkq97L4xDZYWyLD6JirfeFis6XoX/vaBb0v3m6gw65X/Wl0nw/Mbt1eDoT+szH+tDS/tDw6hyosUHQ==","mode":420,"size":1538},"index.js":{"checkedAt":1794532122813,"integrity":"sha512-f1IpiN5OdmUpWTYArcaUJVGkSpMz2PmIwnKZ8Ct+Y+OHc7OtPXO4BxNe8aWQPov/IjhF2JCP4AKORg3qgHWtFA==","mode":420,"size":252},"CHANGELOG.md":{"checkedAt":1794532122813,"integrity":"sha512-Xx9DKRGcW7ij0UjlHGugLpK4t4MSOOZREfv/IQVo+f/qyKG+2IL+eGmIluwZwtfXw6MpdR9gZ/J3f4xjXNu+gg==","mode":420,"size":718},"LICENSE.txt":{"checkedAt":1794532122813,"integrity":"sha512-EToPsaeTn1m/hKKaWONJhwqjvIWvra5CjWMax+yCWLrIN1/jFSLwPkhN68ViQwYDuut9KCVnGRQKJuxayn6RBA==","mode":420,"size":731}}}
@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.reflectionCreate = void 0;
const reflection_scalar_default_1 = require("./reflection-scalar-default");
const message_type_contract_1 = require("./message-type-contract");
/**
* Creates an instance of the generic message, using the field
* information.
*/
function reflectionCreate(type) {
/**
* This ternary can be removed in the next major version.
* The `Object.create()` code path utilizes a new `messagePrototype`
* property on the `IMessageType` which has this same `MESSAGE_TYPE`
* non-enumerable property on it. Doing it this way means that we only
* pay the cost of `Object.defineProperty()` once per `IMessageType`
* class of once per "instance". The falsy code path is only provided
* for backwards compatibility in cases where the runtime library is
* updated without also updating the generated code.
*/
const msg = type.messagePrototype
? Object.create(type.messagePrototype)
: Object.defineProperty({}, message_type_contract_1.MESSAGE_TYPE, { value: type });
for (let field of type.fields) {
let name = field.localName;
if (field.opt)
continue;
if (field.oneof)
msg[field.oneof] = { oneofKind: undefined };
else if (field.repeat)
msg[name] = [];
else
switch (field.kind) {
case "scalar":
msg[name] = reflection_scalar_default_1.reflectionScalarDefault(field.T, field.L);
break;
case "enum":
// we require 0 to be default value for all enums
msg[name] = 0;
break;
case "map":
msg[name] = {};
break;
}
}
return msg;
}
exports.reflectionCreate = reflectionCreate;
@@ -0,0 +1,10 @@
import type { TProperties } from '../object/index.mjs';
import { type TMappedResult } from '../mapped/index.mjs';
import { type TReadonlyWithFlag } from './readonly.mjs';
type TFromProperties<P extends TProperties, F extends boolean> = ({
[K2 in keyof P]: TReadonlyWithFlag<P[K2], F>;
});
type TFromMappedResult<R extends TMappedResult, F extends boolean> = (TFromProperties<R['properties'], F>);
export type TReadonlyFromMappedResult<R extends TMappedResult, F extends boolean, P extends TProperties = TFromMappedResult<R, F>> = (TMappedResult<P>);
export declare function ReadonlyFromMappedResult<R extends TMappedResult, F extends boolean, P extends TProperties = TFromMappedResult<R, F>>(R: R, F: F): TMappedResult<P>;
export {};
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from '../types.js';
import 'react';
declare const AlignRightBoldIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { AlignRightBoldIcon };
@@ -0,0 +1,208 @@
import type { $ZodCheck, $ZodStringFormats } from "./checks.cjs";
import { $constructor } from "./core.cjs";
import type { $ZodType } from "./schemas.cjs";
import * as util from "./util.cjs";
export interface $ZodIssueBase {
readonly code?: string;
readonly input?: unknown;
readonly path: PropertyKey[];
readonly message: string;
}
export interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {
readonly code: "invalid_type";
readonly expected: $ZodType["_zod"]["def"]["type"];
readonly input: Input;
}
export interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
readonly code: "too_big";
readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
readonly maximum: number | bigint;
readonly inclusive?: boolean;
readonly exact?: boolean;
readonly input: Input;
}
export interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
readonly code: "too_small";
readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
readonly minimum: number | bigint;
/** True if the allowable range includes the minimum */
readonly inclusive?: boolean;
/** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */
readonly exact?: boolean;
readonly input: Input;
}
export interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {
readonly code: "invalid_format";
readonly format: $ZodStringFormats | (string & {});
readonly pattern?: string;
readonly input: string;
}
export interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {
readonly code: "not_multiple_of";
readonly divisor: number;
readonly input: Input;
}
export interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {
readonly code: "unrecognized_keys";
readonly keys: string[];
readonly input: Record<string, unknown>;
}
export interface $ZodIssueInvalidUnion extends $ZodIssueBase {
readonly code: "invalid_union";
readonly errors: $ZodIssue[][];
readonly input: unknown;
}
export interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {
readonly code: "invalid_key";
readonly origin: "map" | "record";
readonly issues: $ZodIssue[];
readonly input: Input;
}
export interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {
readonly code: "invalid_element";
readonly origin: "map" | "set";
readonly key: unknown;
readonly issues: $ZodIssue[];
readonly input: Input;
}
export interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {
readonly code: "invalid_value";
readonly values: util.Primitive[];
readonly input: Input;
}
export interface $ZodIssueCustom extends $ZodIssueBase {
readonly code: "custom";
readonly params?: Record<string, any> | undefined;
readonly input: unknown;
}
export interface $ZodIssueStringCommonFormats extends $ZodIssueInvalidStringFormat {
format: Exclude<$ZodStringFormats, "regex" | "jwt" | "starts_with" | "ends_with" | "includes">;
}
export interface $ZodIssueStringInvalidRegex extends $ZodIssueInvalidStringFormat {
format: "regex";
pattern: string;
}
export interface $ZodIssueStringInvalidJWT extends $ZodIssueInvalidStringFormat {
format: "jwt";
algorithm?: string;
}
export interface $ZodIssueStringStartsWith extends $ZodIssueInvalidStringFormat {
format: "starts_with";
prefix: string;
}
export interface $ZodIssueStringEndsWith extends $ZodIssueInvalidStringFormat {
format: "ends_with";
suffix: string;
}
export interface $ZodIssueStringIncludes extends $ZodIssueInvalidStringFormat {
format: "includes";
includes: string;
}
export type $ZodStringFormatIssues = $ZodIssueStringCommonFormats | $ZodIssueStringInvalidRegex | $ZodIssueStringInvalidJWT | $ZodIssueStringStartsWith | $ZodIssueStringEndsWith | $ZodIssueStringIncludes;
export type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom;
export type $ZodIssueCode = $ZodIssue["code"];
export type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
type RawIssue<T extends $ZodIssueBase> = util.Flatten<util.MakePartial<T, "message" | "path"> & {
/** The input data */
readonly input?: unknown;
/** The schema or check that originated this issue. */
readonly inst?: $ZodType | $ZodCheck;
/** @deprecated Internal use only. If `true`, Zod will continue executing validation despite this issue. */
readonly continue?: boolean | undefined;
} & Record<string, any>>;
export interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {
(issue: $ZodRawIssue<T>): {
message: string;
} | string | undefined | null;
}
export interface $ZodError<T = unknown> extends Error {
type: T;
issues: $ZodIssue[];
_zod: {
output: T;
def: $ZodIssue[];
};
stack?: string;
name: string;
}
export declare const $ZodError: $constructor<$ZodError>;
interface $ZodRealError<T = any> extends $ZodError<T> {
}
export declare const $ZodRealError: $constructor<$ZodRealError>;
export type $ZodFlattenedError<T, U = string> = _FlattenedError<T, U>;
type _FlattenedError<T, U = string> = {
formErrors: U[];
fieldErrors: {
[P in keyof T]?: U[];
};
};
export declare function flattenError<T>(error: $ZodError<T>): _FlattenedError<T>;
export declare function flattenError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): _FlattenedError<T, U>;
type _ZodFormattedError<T, U = string> = T extends [any, ...any[]] ? {
[K in keyof T]?: $ZodFormattedError<T[K], U>;
} : T extends any[] ? {
[k: number]: $ZodFormattedError<T[number], U>;
} : T extends object ? util.Flatten<{
[K in keyof T]?: $ZodFormattedError<T[K], U>;
}> : any;
export type $ZodFormattedError<T, U = string> = {
_errors: U[];
} & util.Flatten<_ZodFormattedError<T, U>>;
export declare function formatError<T>(error: $ZodError<T>): $ZodFormattedError<T>;
export declare function formatError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;
export type $ZodErrorTree<T, U = string> = T extends [any, ...any[]] ? {
errors: U[];
items?: {
[K in keyof T]?: $ZodErrorTree<T[K], U>;
};
} : T extends any[] ? {
errors: U[];
items?: Array<$ZodErrorTree<T[number], U>>;
} : T extends object ? {
errors: U[];
properties?: {
[K in keyof T]?: $ZodErrorTree<T[K], U>;
};
} : {
errors: U[];
};
export declare function treeifyError<T>(error: $ZodError<T>): $ZodErrorTree<T>;
export declare function treeifyError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): $ZodErrorTree<T, U>;
/** Format a ZodError as a human-readable string in the following form.
*
* From
*
* ```ts
* ZodError {
* issues: [
* {
* expected: 'string',
* code: 'invalid_type',
* path: [ 'username' ],
* message: 'Invalid input: expected string'
* },
* {
* expected: 'number',
* code: 'invalid_type',
* path: [ 'favoriteNumbers', 1 ],
* message: 'Invalid input: expected number'
* }
* ];
* }
* ```
*
* to
*
* ```
* username
* ✖ Expected number, received string at "username
* favoriteNumbers[0]
* ✖ Invalid input: expected number
* ```
*/
export declare function toDotPath(path: (string | number | symbol)[]): string;
interface BaseError {
issues: $ZodIssueBase[];
}
export declare function prettifyError(error: BaseError): string;
export {};
@@ -0,0 +1,46 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = extractValueFromTemplateLiteral;
function sortStarts(a, b) {
return (a.range ? a.range[0] : a.start) - (b.range ? b.range[0] : b.start);
}
/**
* Returns the string value of a template literal object.
* Tries to build it as best as it can based on the passed
* prop. For instance `This is a ${prop}` will return 'This is a {prop}'.
*
* If the template literal builds to undefined (`${undefined}`), then
* this should return "undefined".
*/
function extractValueFromTemplateLiteral(value) {
var quasis = value.quasis,
expressions = value.expressions;
var partitions = quasis.concat(expressions);
return partitions.sort(sortStarts).map(function (_ref) {
var type = _ref.type,
_ref$value = _ref.value;
_ref$value = _ref$value === undefined ? {} : _ref$value;
var raw = _ref$value.raw,
name = _ref.name;
if (type === 'TemplateElement') {
return raw;
}
if (type === 'Identifier') {
return name === 'undefined' ? name : '{' + name + '}';
}
if (type.indexOf('Expression') > -1) {
return '{' + type + '}';
}
return '';
}).join('');
}
@@ -0,0 +1 @@
{"version":3,"file":"decrementPendingClassMetadataCount.js","sourceRoot":"","sources":["../../../../src/metadata/actions/decrementPendingClassMetadataCount.ts"],"names":[],"mappings":";;AAOA,gFAgBC;AAvBD,gFAA+E;AAE/E,wHAAqH;AACrH,6GAA0G;AAE1G,2FAAwF;AAExF,SAAgB,kCAAkC,CAChD,IAAY;IAEZ,OAAO,CAAC,QAA+C,EAAQ,EAAE;QAC/D,IACE,QAAQ,KAAK,SAAS;YACtB,QAAQ,CAAC,IAAI,KAAK,6DAA6B,CAAC,OAAO,EACvD,CAAC;YACD,IAAA,iDAAwB,EACtB,IAAI,EACJ,yEAAmC,EACnC,yEAAmC,EACnC,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,CAC7B,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["html.js"],"names":[],"mappings":"AAWA,qDAsTE"}
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/which-collection
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,13 @@
'use strict';
var test = require('tape');
var stringify = require('../');
test('custom comparison function', function (t) {
t.plan(1);
var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
var s = stringify(obj, function (a, b) {
return a.key < b.key ? 1 : -1;
});
t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}');
});
@@ -0,0 +1,89 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = timeout;
var _initialParams = require('./internal/initialParams.js');
var _initialParams2 = _interopRequireDefault(_initialParams);
var _wrapAsync = require('./internal/wrapAsync.js');
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Sets a time limit on an asynchronous function. If the function does not call
* its callback within the specified milliseconds, it will be called with a
* timeout error. The code property for the error object will be `'ETIMEDOUT'`.
*
* @name timeout
* @static
* @memberOf module:Utils
* @method
* @category Util
* @param {AsyncFunction} asyncFn - The async function to limit in time.
* @param {number} milliseconds - The specified time limit.
* @param {*} [info] - Any variable you want attached (`string`, `object`, etc)
* to timeout Error for more information..
* @returns {AsyncFunction} Returns a wrapped function that can be used with any
* of the control flow functions.
* Invoke this function with the same parameters as you would `asyncFunc`.
* @example
*
* function myFunction(foo, callback) {
* doAsyncTask(foo, function(err, data) {
* // handle errors
* if (err) return callback(err);
*
* // do some stuff ...
*
* // return processed data
* return callback(null, data);
* });
* }
*
* var wrapped = async.timeout(myFunction, 1000);
*
* // call `wrapped` as you would `myFunction`
* wrapped({ bar: 'bar' }, function(err, data) {
* // if `myFunction` takes < 1000 ms to execute, `err`
* // and `data` will have their expected values
*
* // else `err` will be an Error with the code 'ETIMEDOUT'
* });
*/
function timeout(asyncFn, milliseconds, info) {
var fn = (0, _wrapAsync2.default)(asyncFn);
return (0, _initialParams2.default)((args, callback) => {
var timedOut = false;
var timer;
function timeoutCallback() {
var name = asyncFn.name || 'anonymous';
var error = new Error('Callback function "' + name + '" timed out.');
error.code = 'ETIMEDOUT';
if (info) {
error.info = info;
}
timedOut = true;
callback(error);
}
args.push((...cbArgs) => {
if (!timedOut) {
callback(...cbArgs);
clearTimeout(timer);
}
});
// setup timer and call original function
timer = setTimeout(timeoutCallback, milliseconds);
fn(...args);
});
}
module.exports = exports.default;
@@ -0,0 +1 @@
{"version":3,"file":"isPrimitive.d.ts","sourceRoot":"","sources":["../../src/utils/isPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;yBAK1B,OAAO,OAAO,KAAG,KAAK,IAAI,SAAS;AAAnD,wBACmD"}
@@ -0,0 +1,259 @@
'use strict';
const EventEmitter = require('events');
const JSONB = require('json-buffer');
const loadStore = options => {
const adapters = {
redis: '@keyv/redis',
rediss: '@keyv/redis',
mongodb: '@keyv/mongo',
mongo: '@keyv/mongo',
sqlite: '@keyv/sqlite',
postgresql: '@keyv/postgres',
postgres: '@keyv/postgres',
mysql: '@keyv/mysql',
etcd: '@keyv/etcd',
offline: '@keyv/offline',
tiered: '@keyv/tiered',
};
if (options.adapter || options.uri) {
const adapter = options.adapter || /^[^:+]*/.exec(options.uri)[0];
return new (require(adapters[adapter]))(options);
}
return new Map();
};
const iterableAdapters = [
'sqlite',
'postgres',
'mysql',
'mongo',
'redis',
'tiered',
];
class Keyv extends EventEmitter {
constructor(uri, {emitErrors = true, ...options} = {}) {
super();
this.opts = {
namespace: 'keyv',
serialize: JSONB.stringify,
deserialize: JSONB.parse,
...((typeof uri === 'string') ? {uri} : uri),
...options,
};
if (!this.opts.store) {
const adapterOptions = {...this.opts};
this.opts.store = loadStore(adapterOptions);
}
if (this.opts.compression) {
const compression = this.opts.compression;
this.opts.serialize = compression.serialize.bind(compression);
this.opts.deserialize = compression.deserialize.bind(compression);
}
if (typeof this.opts.store.on === 'function' && emitErrors) {
this.opts.store.on('error', error => this.emit('error', error));
}
this.opts.store.namespace = this.opts.namespace;
const generateIterator = iterator => async function * () {
for await (const [key, raw] of typeof iterator === 'function'
? iterator(this.opts.store.namespace)
: iterator) {
const data = await this.opts.deserialize(raw);
if (this.opts.store.namespace && !key.includes(this.opts.store.namespace)) {
continue;
}
if (typeof data.expires === 'number' && Date.now() > data.expires) {
this.delete(key);
continue;
}
yield [this._getKeyUnprefix(key), data.value];
}
};
// Attach iterators
if (typeof this.opts.store[Symbol.iterator] === 'function' && this.opts.store instanceof Map) {
this.iterator = generateIterator(this.opts.store);
} else if (typeof this.opts.store.iterator === 'function' && this.opts.store.opts
&& this._checkIterableAdaptar()) {
this.iterator = generateIterator(this.opts.store.iterator.bind(this.opts.store));
}
}
_checkIterableAdaptar() {
return iterableAdapters.includes(this.opts.store.opts.dialect)
|| iterableAdapters.findIndex(element => this.opts.store.opts.url.includes(element)) >= 0;
}
_getKeyPrefix(key) {
return `${this.opts.namespace}:${key}`;
}
_getKeyPrefixArray(keys) {
return keys.map(key => `${this.opts.namespace}:${key}`);
}
_getKeyUnprefix(key) {
return key
.split(':')
.splice(1)
.join(':');
}
get(key, options) {
const {store} = this.opts;
const isArray = Array.isArray(key);
const keyPrefixed = isArray ? this._getKeyPrefixArray(key) : this._getKeyPrefix(key);
if (isArray && store.getMany === undefined) {
const promises = [];
for (const key of keyPrefixed) {
promises.push(Promise.resolve()
.then(() => store.get(key))
.then(data => (typeof data === 'string') ? this.opts.deserialize(data) : (this.opts.compression ? this.opts.deserialize(data) : data))
.then(data => {
if (data === undefined || data === null) {
return undefined;
}
if (typeof data.expires === 'number' && Date.now() > data.expires) {
return this.delete(key).then(() => undefined);
}
return (options && options.raw) ? data : data.value;
}),
);
}
return Promise.allSettled(promises)
.then(values => {
const data = [];
for (const value of values) {
data.push(value.value);
}
return data;
});
}
return Promise.resolve()
.then(() => isArray ? store.getMany(keyPrefixed) : store.get(keyPrefixed))
.then(data => (typeof data === 'string') ? this.opts.deserialize(data) : (this.opts.compression ? this.opts.deserialize(data) : data))
.then(data => {
if (data === undefined || data === null) {
return undefined;
}
if (isArray) {
return data.map((row, index) => {
if ((typeof row === 'string')) {
row = this.opts.deserialize(row);
}
if (row === undefined || row === null) {
return undefined;
}
if (typeof row.expires === 'number' && Date.now() > row.expires) {
this.delete(key[index]).then(() => undefined);
return undefined;
}
return (options && options.raw) ? row : row.value;
});
}
if (typeof data.expires === 'number' && Date.now() > data.expires) {
return this.delete(key).then(() => undefined);
}
return (options && options.raw) ? data : data.value;
});
}
set(key, value, ttl) {
const keyPrefixed = this._getKeyPrefix(key);
if (typeof ttl === 'undefined') {
ttl = this.opts.ttl;
}
if (ttl === 0) {
ttl = undefined;
}
const {store} = this.opts;
return Promise.resolve()
.then(() => {
const expires = (typeof ttl === 'number') ? (Date.now() + ttl) : null;
if (typeof value === 'symbol') {
this.emit('error', 'symbol cannot be serialized');
}
value = {value, expires};
return this.opts.serialize(value);
})
.then(value => store.set(keyPrefixed, value, ttl))
.then(() => true);
}
delete(key) {
const {store} = this.opts;
if (Array.isArray(key)) {
const keyPrefixed = this._getKeyPrefixArray(key);
if (store.deleteMany === undefined) {
const promises = [];
for (const key of keyPrefixed) {
promises.push(store.delete(key));
}
return Promise.allSettled(promises)
.then(values => values.every(x => x.value === true));
}
return Promise.resolve()
.then(() => store.deleteMany(keyPrefixed));
}
const keyPrefixed = this._getKeyPrefix(key);
return Promise.resolve()
.then(() => store.delete(keyPrefixed));
}
clear() {
const {store} = this.opts;
return Promise.resolve()
.then(() => store.clear());
}
has(key) {
const keyPrefixed = this._getKeyPrefix(key);
const {store} = this.opts;
return Promise.resolve()
.then(async () => {
if (typeof store.has === 'function') {
return store.has(keyPrefixed);
}
const value = await store.get(keyPrefixed);
return value !== undefined;
});
}
disconnect() {
const {store} = this.opts;
if (typeof store.disconnect === 'function') {
return store.disconnect();
}
}
}
module.exports = Keyv;
@@ -0,0 +1,61 @@
// Hungarian [hu]
import dayjs from '../index';
var locale = {
name: 'hu',
weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'),
months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),
monthsShort: 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),
ordinal: function ordinal(n) {
return n + ".";
},
weekStart: 1,
relativeTime: {
future: '%s múlva',
past: '%s',
s: function s(_, _s, ___, isFuture) {
return "n\xE9h\xE1ny m\xE1sodperc" + (isFuture || _s ? '' : 'e');
},
m: function m(_, s, ___, isFuture) {
return "egy perc" + (isFuture || s ? '' : 'e');
},
mm: function mm(n, s, ___, isFuture) {
return n + " perc" + (isFuture || s ? '' : 'e');
},
h: function h(_, s, ___, isFuture) {
return "egy " + (isFuture || s ? 'óra' : 'órája');
},
hh: function hh(n, s, ___, isFuture) {
return n + " " + (isFuture || s ? 'óra' : 'órája');
},
d: function d(_, s, ___, isFuture) {
return "egy " + (isFuture || s ? 'nap' : 'napja');
},
dd: function dd(n, s, ___, isFuture) {
return n + " " + (isFuture || s ? 'nap' : 'napja');
},
M: function M(_, s, ___, isFuture) {
return "egy " + (isFuture || s ? 'hónap' : 'hónapja');
},
MM: function MM(n, s, ___, isFuture) {
return n + " " + (isFuture || s ? 'hónap' : 'hónapja');
},
y: function y(_, s, ___, isFuture) {
return "egy " + (isFuture || s ? 'év' : 'éve');
},
yy: function yy(n, s, ___, isFuture) {
return n + " " + (isFuture || s ? 'év' : 'éve');
}
},
formats: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'YYYY.MM.DD.',
LL: 'YYYY. MMMM D.',
LLL: 'YYYY. MMMM D. H:mm',
LLLL: 'YYYY. MMMM D., dddd H:mm'
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,17 @@
/**
* @import {Info, State} from 'mdast-util-to-markdown'
* @import {Paragraph, Parents} from 'mdast'
*/
/**
* @param {Paragraph} node
* @param {Parents | undefined} _
* @param {State} state
* @param {Info} info
* @returns {string}
*/
export function paragraph(node: Paragraph, _: Parents | undefined, state: State, info: Info): string;
import type { Paragraph } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
//# sourceMappingURL=paragraph.d.ts.map
@@ -0,0 +1,71 @@
var basePropertyOf = require('./_basePropertyOf');
/** Used to map Latin Unicode letters to basic Latin letters. */
var deburredLetters = {
// Latin-1 Supplement block.
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
'\xc7': 'C', '\xe7': 'c',
'\xd0': 'D', '\xf0': 'd',
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
'\xd1': 'N', '\xf1': 'n',
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
'\xc6': 'Ae', '\xe6': 'ae',
'\xde': 'Th', '\xfe': 'th',
'\xdf': 'ss',
// Latin Extended-A block.
'\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
'\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
'\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
'\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
'\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
'\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
'\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
'\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
'\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
'\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
'\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
'\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
'\u0134': 'J', '\u0135': 'j',
'\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
'\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
'\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
'\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
'\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
'\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
'\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
'\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
'\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
'\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
'\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
'\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
'\u0163': 't', '\u0165': 't', '\u0167': 't',
'\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
'\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
'\u0174': 'W', '\u0175': 'w',
'\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
'\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
'\u0132': 'IJ', '\u0133': 'ij',
'\u0152': 'Oe', '\u0153': 'oe',
'\u0149': "'n", '\u017f': 's'
};
/**
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
* letters to basic Latin letters.
*
* @private
* @param {string} letter The matched letter to deburr.
* @returns {string} Returns the deburred letter.
*/
var deburrLetter = basePropertyOf(deburredLetters);
module.exports = deburrLetter;
@@ -0,0 +1,29 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
module.exports = {
meta: {
docs: {
description: "disallow class declarations.",
category: "ES2015",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-classes.html",
},
fixable: null,
messages: {
forbidden: "ES2015 class declarations are forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"ClassDeclaration, ClassExpression"(node) {
context.report({ node, messageId: "forbidden" })
},
}
},
}
@@ -0,0 +1,47 @@
'use strict';
var keys = require('object-keys');
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
var toStr = Object.prototype.toString;
var concat = Array.prototype.concat;
var defineDataProperty = require('define-data-property');
var isFunction = function (fn) {
return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
};
var supportsDescriptors = require('has-property-descriptors')();
var defineProperty = function (object, name, value, predicate) {
if (name in object) {
if (predicate === true) {
if (object[name] === value) {
return;
}
} else if (!isFunction(predicate) || !predicate()) {
return;
}
}
if (supportsDescriptors) {
defineDataProperty(object, name, value, true);
} else {
defineDataProperty(object, name, value);
}
};
var defineProperties = function (object, map) {
var predicates = arguments.length > 2 ? arguments[2] : {};
var props = keys(map);
if (hasSymbols) {
props = concat.call(props, Object.getOwnPropertySymbols(map));
}
for (var i = 0; i < props.length; i += 1) {
defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
}
};
defineProperties.supportsDescriptors = !!supportsDescriptors;
module.exports = defineProperties;
@@ -0,0 +1,20 @@
import { PluginFunc } from 'dayjs/esm'
declare const plugin: PluginFunc
export = plugin
interface DayjsObject {
years: number
months: number
date: number
hours: number
minutes: number
seconds: number
milliseconds: number
}
declare module 'dayjs/esm' {
interface Dayjs {
toObject(): DayjsObject
}
}
@@ -0,0 +1,899 @@
flf2a$ 4 3 14 0 10 0 1920
SmShadow by Glenn Chappell 4/93 -- based on Small
Includes ISO Latin-1
figlet release 2.1 -- 12 Aug 1994
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
Modified by Paul Burton <solution@earthlink.net> 12/96 to include new parameter
supported by FIGlet and FIGWin. May also be slightly modified for better use
of new full-width/kern/smush alternatives, but default output is NOT changed.
$$@
$$@
$$@
$$@@
|$@
_|$@
_)$@
@@
| )$@
V V$ @
@
@@
| |$ @
_ |_ |_|$@
_ |_ |_|$@
_| _|$ @@
|$ @
(_-<$@
_ _/$@
_|$ @@
_) /$ @
/$ @
_/ _)$@
@@
_|$ @
_| _|$@
\____|$ @
@@
)$@
/$ @
@
@@
/$@
|$ @
|$ @
\_\$@@
\ \$ @
|$@
|$@
_/$ @@
\ \ /$ @
_ _|$@
_/ _\$ @
@@
|$ @
__ __|$@
_|$ @
@@
@
@
)$@
/$ @@
@
____|$@
@
@@
@
@
_)$@
@@
/$@
/$ @
_/$ @
@@
\$ @
( |$@
\__/$ @
@@
_ |$@
|$@
_|$@
@@
_ )$@
/$ @
___|$@
@@
__ /$@
_ \$@
___/$@
@@
| |$ @
__ _|$@
_|$ @
@@
__|$@
__ \$@
___/$@
@@
/$ @
_ \$@
\___/$@
@@
__ /$@
/$ @
_/$ @
@@
_ )$@
_ \$@
\___/$@
@@
_ \$@
\_ /$@
_/$ @
@@
_)$@
@
_)$@
@@
_)$@
@
)$@
/$ @@
/$@
< <$ @
\_\$@
@@
@
____|$@
____|$@
@@
\ \$ @
> >$@
_/$ @
@@
__ \$@
_/$@
_)$ @
@@
__ \$ @
/ _` |$@
\__,_|$@
\____/$ @@
\$ @
_ \$ @
_/ _\$@
@@
_ )$@
_ \$@
___/$@
@@
__|$@
($ @
\___|$@
@@
_ \$ @
| |$@
___/$ @
@@
__|$@
_|$ @
___|$@
@@
__|$@
_|$ @
_|$ @
@@
__|$@
(_ |$@
\___|$@
@@
| |$@
__ |$@
_| _|$@
@@
_ _|$@
|$ @
___|$@
@@
|$@
\ |$@
\__/$ @
@@
| /$@
. <$ @
_|\_\$@
@@
|$ @
|$ @
____|$@
@@
\ |$@
|\/ |$@
_| _|$@
@@
\ |$@
. |$@
_|\_|$@
@@
_ \$ @
( |$@
\___/$ @
@@
_ \$@
__/$@
_|$ @
@@
_ \$ @
( |$@
\__\_\$@
@@
_ \$@
/$@
_|_\$@
@@
__|$@
\__ \$@
____/$@
@@
__ __|$@
|$ @
_|$ @
@@
| |$@
| |$@
\__/$ @
@@
\ \ /$@
\ \ /$ @
\_/$ @
@@
\ \ /$@
\ \ \ /$ @
\_/\_/$ @
@@
\ \ /$@
> <$ @
_/\_\$@
@@
\ \ /$@
\ /$ @
_|$ @
@@
__ /$@
/$ @
____|$@
@@
_|$@
|$ @
|$ @
__|$@@
\ \$ @
\ \$ @
\_\$@
@@
_ |$@
|$@
|$@
__|$@@
\$ @
/\|$@
@
@@
@
@
@
____|$@@
)$@
\|$@
@
@@
@
_` |$@
\__,_|$@
@@
|$ @
_ \$@
_.__/$@
@@
@
_|$@
\__|$@
@@
|$@
_` |$@
\__,_|$@
@@
@
-_)$@
\___|$@
@@
_|$@
_|$@
_|$ @
@@
@
_` |$@
\__, |$@
____/$ @@
|$ @
\$ @
_| _|$@
@@
_)$@
|$@
_|$@
@@
_)$@
|$@
|$@
__/$ @@
|$ @
| /$@
_\_\$@
@@
|$@
|$@
_|$@
@@
@
` \$ @
_|_|_|$@
@@
@
\$ @
_| _|$@
@@
@
_ \$@
\___/$@
@@
@
_ \$@
.__/$@
_|$ @@
@
_` |$@
\__, |$@
_|$@@
@
_|$@
_|$ @
@@
@
(_-<$@
___/$@
@@
|$ @
_|$@
\__|$@
@@
@
| |$@
\_,_|$@
@@
@
\ \ /$@
\_/$ @
@@
@
\ \ \ /$@
\_/\_/$ @
@@
@
\ \ /$@
_\_\$@
@@
@
| |$@
\_, |$@
___/$ @@
@
_ /$@
___|$@
@@
/$@
_ |$ @
|$ @
\_\$@@
|$@
|$@
|$@
_|$@@
\ \$ @
|_$@
|$ @
_/$ @@
\ |$@
/\/$ @
@
@@
_) \_)$@
_ \$ @
/ _\$@
@@
_) _)$@
__ \$@
\____/$@
@@
_) _)$@
| |$@
\__/$ @
@@
_) _)$@
_` |$@
\__,_|$@
@@
_) _)$@
_ \$@
\___/$@
@@
_) _)$@
| |$@
\_,_|$@
@@
_ \$@
|< <$@
|__/$@
_|$ @@
160 NO-BREAK SPACE
$$@
$$@
$$@
$$@@
161 INVERTED EXCLAMATION MARK
_)$@
|$@
_|$@
@@
162 CENT SIGN
|$ @
_)$@
\ _)$@
|$ @@
163 POUND SIGN
_\$ @
_ _|$ @
_,___|$@
@@
164 CURRENCY SIGN
\ . /$@
_ \$@
\/ /$@
@@
165 YEN SIGN
\ \ /$ @
__ __|$@
__ __|$@
_|$ @@
166 BROKEN BAR
|$@
_|$@
|$@
_|$@@
167 SECTION SIGN
_)$@
\ \$ @
\ \/$ @
__/$ @@
168 DIAERESIS
_) _)$@
@
@
@@
169 COPYRIGHT SIGN
\$ @
_| \$@
\ \__| /$@
\____/$ @@
170 FEMININE ORDINAL INDICATOR
_` |$@
\__,_|$@
_____|$@
@@
171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
/ /$@
< < <$ @
\_\_\$@
@@
172 NOT SIGN
____ |$@
_|$@
@
@@
173 SOFT HYPHEN
@
___|$@
@
@@
174 REGISTERED SIGN
\$ @
-) \$@
\ |\\ /$@
\____/$ @@
175 MACRON
___|$@
@
@
@@
176 DEGREE SIGN
.\$@
\_/$@
@
@@
177 PLUS-MINUS SIGN
|$ @
_ _|$@
_|$ @
_____|$@@
178 SUPERSCRIPT TWO
_ )$@
__|$@
@
@@
179 SUPERSCRIPT THREE
_ /$@
__)$@
@
@@
180 ACUTE ACCENT
_/$@
@
@
@@
181 MICRO SIGN
@
| |$@
.,_|$@
_|$ @@
182 PILCROW SIGN
|$@
\_ | |$@
_|_|$@
@@
183 MIDDLE DOT
@
_)$@
@
@@
184 CEDILLA
@
@
@
_)$@@
185 SUPERSCRIPT ONE
_ |$@
_|$@
@
@@
186 MASCULINE ORDINAL INDICATOR
_ \$@
\___/$@
____|$@
@@
187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
\ \ \$ @
> > >$@
_/_/$ @
@@
188 VULGAR FRACTION ONE QUARTER
_ | /$ @
_| /_' |$@
_/ _|$@
@@
189 VULGAR FRACTION ONE HALF
_ | /$ @
_| /_ )$@
_/ __|$@
@@
190 VULGAR FRACTION THREE QUARTERS
_ / /$ @
__) /_' |$@
_/ _|$@
@@
191 INVERTED QUESTION MARK
_)$ @
/$ @
\___|$@
@@
192 LATIN CAPITAL LETTER A WITH GRAVE
\_\$ @
--\$ @
_/\_\$@
@@
193 LATIN CAPITAL LETTER A WITH ACUTE
_/$ @
--\$ @
_/\_\$@
@@
194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
/\\$ @
--\$ @
_/\_\$@
@@
195 LATIN CAPITAL LETTER A WITH TILDE
/ _/$ @
--\$ @
_/\_\$@
@@
196 LATIN CAPITAL LETTER A WITH DIAERESIS
_) \_)$@
_ \$ @
/ _\$@
@@
197 LATIN CAPITAL LETTER A WITH RING ABOVE
( )$ @
_ \$ @
_/ _\$@
@@
198 LATIN CAPITAL LETTER AE
, __|$@
_ _|$ @
_/ ___|$@
@@
199 LATIN CAPITAL LETTER C WITH CEDILLA
|$@
($ @
\___|$@
_)$ @@
200 LATIN CAPITAL LETTER E WITH GRAVE
\_\$@
-<$@
__<$@
@@
201 LATIN CAPITAL LETTER E WITH ACUTE
_/$@
-<$@
__<$@
@@
202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX
/\\$@
-<$@
__<$@
@@
203 LATIN CAPITAL LETTER E WITH DIAERESIS
_) _)$@
-<$ @
__<$ @
@@
204 LATIN CAPITAL LETTER I WITH GRAVE
\_\$ @
_ _|$@
___|$@
@@
205 LATIN CAPITAL LETTER I WITH ACUTE
_/$ @
_ _|$@
___|$@
@@
206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX
/\\$ @
_ _|$@
___|$@
@@
207 LATIN CAPITAL LETTER I WITH DIAERESIS
_) _)$@
_ _|$ @
___|$ @
@@
208 LATIN CAPITAL LETTER ETH
_ \$ @
_ _| |$@
___/$ @
@@
209 LATIN CAPITAL LETTER N WITH TILDE
/ _/$@
\ |$@
_|\_|$@
@@
210 LATIN CAPITAL LETTER O WITH GRAVE
\_\$ @
__ \$@
\____/$@
@@
211 LATIN CAPITAL LETTER O WITH ACUTE
_/$ @
__ \$@
\____/$@
@@
212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
/\\$ @
__ \$@
\____/$@
@@
213 LATIN CAPITAL LETTER O WITH TILDE
/ _/$ @
__ \$@
\____/$@
@@
214 LATIN CAPITAL LETTER O WITH DIAERESIS
_) _)$@
__ \$@
\____/$@
@@
215 MULTIPLICATION SIGN
\ \$@
, '$@
\/\/$@
@@
216 LATIN CAPITAL LETTER O WITH STROKE
_ /\$ @
( / |$@
\_/__/$ @
@@
217 LATIN CAPITAL LETTER U WITH GRAVE
\_\$ @
| |$@
\__/$ @
@@
218 LATIN CAPITAL LETTER U WITH ACUTE
_/$ @
| |$@
\__/$ @
@@
219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX
/\\$ @
| |$@
\__/$ @
@@
220 LATIN CAPITAL LETTER U WITH DIAERESIS
_) _)$@
| |$@
\__/$ @
@@
221 LATIN CAPITAL LETTER Y WITH ACUTE
_/$ @
\ \ /$@
_|$ @
@@
222 LATIN CAPITAL LETTER THORN
|$ @
-_)$@
_|$ @
@@
223 LATIN SMALL LETTER SHARP S
_ \$@
|< <$@
|__/$@
_|$ @@
224 LATIN SMALL LETTER A WITH GRAVE
\_\$ @
_` |$@
\__,_|$@
@@
225 LATIN SMALL LETTER A WITH ACUTE
_/$ @
_` |$@
\__,_|$@
@@
226 LATIN SMALL LETTER A WITH CIRCUMFLEX
/\\$ @
_` |$@
\__,_|$@
@@
227 LATIN SMALL LETTER A WITH TILDE
/ _/$ @
_` |$@
\__,_|$@
@@
228 LATIN SMALL LETTER A WITH DIAERESIS
_) _)$@
_` |$@
\__,_|$@
@@
229 LATIN SMALL LETTER A WITH RING ABOVE
( )$ @
_` |$@
\__,_|$@
@@
230 LATIN SMALL LETTER AE
@
_` -_)$@
\__,___|$@
@@
231 LATIN SMALL LETTER C WITH CEDILLA
@
_|$@
\__|$@
_)$@@
232 LATIN SMALL LETTER E WITH GRAVE
\_\$ @
-_)$@
\___|$@
@@
233 LATIN SMALL LETTER E WITH ACUTE
_/$ @
-_)$@
\___|$@
@@
234 LATIN SMALL LETTER E WITH CIRCUMFLEX
/\\$ @
-_)$@
\___|$@
@@
235 LATIN SMALL LETTER E WITH DIAERESIS
_) _)$@
-_)$ @
\___|$ @
@@
236 LATIN SMALL LETTER I WITH GRAVE
\_\$@
|$@
_|$@
@@
237 LATIN SMALL LETTER I WITH ACUTE
_/$@
|$@
_|$@
@@
238 LATIN SMALL LETTER I WITH CIRCUMFLEX
/\\$@
|$ @
_|$ @
@@
239 LATIN SMALL LETTER I WITH DIAERESIS
_) _)$@
|$ @
_|$ @
@@
240 LATIN SMALL LETTER ETH
, \'$@
_` |$@
\___/$ @
@@
241 LATIN SMALL LETTER N WITH TILDE
/ _/$ @
' \$ @
_| _|$@
@@
242 LATIN SMALL LETTER O WITH GRAVE
\_\$ @
_ \$@
\___/$@
@@
243 LATIN SMALL LETTER O WITH ACUTE
_/$ @
_ \$@
\___/$@
@@
244 LATIN SMALL LETTER O WITH CIRCUMFLEX
/\\$ @
_ \$@
\___/$@
@@
245 LATIN SMALL LETTER O WITH TILDE
/ _/$@
_ \$@
\___/$@
@@
246 LATIN SMALL LETTER O WITH DIAERESIS
_) _)$@
_ \$@
\___/$@
@@
247 DIVISION SIGN
_)$ @
___|$@
_)$ @
@@
248 LATIN SMALL LETTER O WITH STROKE
@
/\$@
\_/_/$@
@@
249 LATIN SMALL LETTER U WITH GRAVE
\_\$ @
| |$@
\_,_|$@
@@
250 LATIN SMALL LETTER U WITH ACUTE
_/$ @
| |$@
\_,_|$@
@@
251 LATIN SMALL LETTER U WITH CIRCUMFLEX
/\\$ @
| |$@
\_,_|$@
@@
252 LATIN SMALL LETTER U WITH DIAERESIS
_) _)$@
| |$@
\_,_|$@
@@
253 LATIN SMALL LETTER Y WITH ACUTE
_/$ @
| |$@
\_, |$@
___/$ @@
254 LATIN SMALL LETTER THORN
|$ @
'_ \$@
.__/$@
_|$ @@
255 LATIN SMALL LETTER Y WITH DIAERESIS
_) _)$@
| |$@
\_, |$@
___/$ @@
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L M G N O P 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","322":"r s t"},C:{"1":"0 1 2 3 4 5 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 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 0C 1C","578":"u v"},D:{"1":"0 1 2 3 4 5 u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q","322":"r s t"},E:{"1":"G 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","2":"J ZB K D E F A 2C ZC 3C 4C 5C 6C","132":"B C L M aC NC OC 7C 8C"},F:{"1":"0 1 2 3 4 5 h i j k l m n o p q r s t u v w x y z","2":"6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d FD GD HD ID NC uC JD OC","322":"e f g"},G:{"1":"dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","2":"E ZC KD vC LD MD ND OD PD QD RD","132":"SD TD UD VD WD XD YD ZD aD bD cD"},H:{"2":"hD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"2":"A B"},O:{"2":"PC"},P:{"1":"8 9 AB BB CB DB EB FB","2":"6 7 J oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"2":"zD"},R:{"2":"0D"},S:{"2":"1D 2D"}},B:4,C:"CSS color() function",D:true};
@@ -0,0 +1,16 @@
import { GeneralNames } from "../general_names";
import { GeneralName } from "../general_name";
/**
* ```asn1
* id-ce-subjectAltName OBJECT IDENTIFIER ::= { id-ce 17 }
* ```
*/
export declare const id_ce_subjectAltName = "2.5.29.17";
/**
* ```asn1
* SubjectAltName ::= GeneralNames
* ```
*/
export declare class SubjectAlternativeName extends GeneralNames {
constructor(items?: GeneralName[]);
}
@@ -0,0 +1,5 @@
import { Linter } from 'eslint';
declare const recommendedConfig: Linter.FlatConfig;
export = recommendedConfig;
@@ -0,0 +1,2 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactWindow={},e.React)}(this,(function(e,t){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)}var a=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function l(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(o=e[r],n=t[r],!(o===n||a(o)&&a(n)))return!1;var o,n;return!0}function s(e,t){var r;void 0===t&&(t=l);var o,n=[],i=!1;return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return i&&r===this&&t(a,n)||(o=e.apply(this,a),i=!0,r=this,n=a),o}}var c="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function u(e){cancelAnimationFrame(e.id)}function d(e,t){var r=c();var o={id:requestAnimationFrame((function n(){c()-r>=t?e.call(null):o.id=requestAnimationFrame(n)}))};return o}var f=-1;function h(e){if(void 0===e&&(e=!1),-1===f||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),f=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return f}var p=null;function m(e){if(void 0===e&&(e=!1),null===p||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var o=document.createElement("div"),n=o.style;return n.width="100px",n.height="100px",t.appendChild(o),document.body.appendChild(t),t.scrollLeft>0?p="positive-descending":(t.scrollLeft=1,p=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),p}return p}var v=function(e){var t=e.columnIndex;e.data;return e.rowIndex+":"+t},g=null,w=null,S=null;function I(e){var n,a=e.getColumnOffset,l=e.getColumnStartIndexForOffset,c=e.getColumnStopIndexForStartIndex,f=e.getColumnWidth,p=e.getEstimatedTotalHeight,g=e.getEstimatedTotalWidth,w=e.getOffsetForColumnAndAlignment,S=e.getOffsetForRowAndAlignment,I=e.getRowHeight,y=e.getRowOffset,x=e.getRowStartIndexForOffset,C=e.getRowStopIndexForStartIndex,_=e.initInstanceProps,b=e.shouldResetStyleCacheOnItemSizeChange,R=e.validateProps;return(n=function(e){function n(t){var r;return(r=e.call(this,t)||this)._instanceProps=_(r.props,o(r)),r._resetIsScrollingTimeoutId=null,r._outerRef=void 0,r.state={instance:o(r),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof r.props.initialScrollLeft?r.props.initialScrollLeft:0,scrollTop:"number"==typeof r.props.initialScrollTop?r.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},r._callOnItemsRendered=void 0,r._callOnItemsRendered=s((function(e,t,o,n,i,a,l,s){return r.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:o,overscanRowStopIndex:n,visibleColumnStartIndex:i,visibleColumnStopIndex:a,visibleRowStartIndex:l,visibleRowStopIndex:s})})),r._callOnScroll=void 0,r._callOnScroll=s((function(e,t,o,n,i){return r.props.onScroll({horizontalScrollDirection:o,scrollLeft:e,scrollTop:t,verticalScrollDirection:n,scrollUpdateWasRequested:i})})),r._getItemStyle=void 0,r._getItemStyle=function(e,t){var o,n=r.props,i=n.columnWidth,l=n.direction,s=n.rowHeight,c=r._getItemStyleCache(b&&i,b&&l,b&&s),u=e+":"+t;if(c.hasOwnProperty(u))o=c[u];else{var d=a(r.props,t,r._instanceProps),h="rtl"===l;c[u]=o={position:"absolute",left:h?void 0:d,right:h?d:void 0,top:y(r.props,e,r._instanceProps),height:I(r.props,e,r._instanceProps),width:f(r.props,t,r._instanceProps)}}return o},r._getItemStyleCache=void 0,r._getItemStyleCache=s((function(e,t,r){return{}})),r._onScroll=function(e){var t=e.currentTarget,o=t.clientHeight,n=t.clientWidth,i=t.scrollLeft,a=t.scrollTop,l=t.scrollHeight,s=t.scrollWidth;r.setState((function(e){if(e.scrollLeft===i&&e.scrollTop===a)return null;var t=r.props.direction,c=i;if("rtl"===t)switch(m()){case"negative":c=-i;break;case"positive-descending":c=s-n-i}c=Math.max(0,Math.min(c,s-n));var u=Math.max(0,Math.min(a,l-o));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<i?"forward":"backward",scrollLeft:c,scrollTop:u,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resLine truncated
//# sourceMappingURL=index-dev.umd.js.map
@@ -0,0 +1,53 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
/// <reference lib="es2015.symbol" />
/// <reference lib="es2015.iterable" />
interface SymbolConstructor {
/**
* A method that returns the default async iterator for an object. Called by the semantics of
* the for-await-of statement.
*/
readonly asyncIterator: unique symbol;
}
interface AsyncIterator<T, TReturn = any, TNext = any> {
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
next(...[value]: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
return?(value?: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;
throw?(e?: any): Promise<IteratorResult<T, TReturn>>;
}
interface AsyncIterable<T, TReturn = any, TNext = any> {
[Symbol.asyncIterator](): AsyncIterator<T, TReturn, TNext>;
}
/**
* Describes a user-defined {@link AsyncIterator} that is also async iterable.
*/
interface AsyncIterableIterator<T, TReturn = any, TNext = any> extends AsyncIterator<T, TReturn, TNext> {
[Symbol.asyncIterator](): AsyncIterableIterator<T, TReturn, TNext>;
}
/**
* Describes an {@link AsyncIterator} produced by the runtime that inherits from the intrinsic `AsyncIterator.prototype`.
*/
interface AsyncIteratorObject<T, TReturn = unknown, TNext = unknown> extends AsyncIterator<T, TReturn, TNext> {
[Symbol.asyncIterator](): AsyncIteratorObject<T, TReturn, TNext>;
}
@@ -0,0 +1,81 @@
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "LocalizedStringDictionary", () => $f80be5fd4d03dda9$export$c17fa47878dc55b6);
/*
* Copyright 2022 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.
*/ const $f80be5fd4d03dda9$var$localeSymbol = Symbol.for('react-aria.i18n.locale');
const $f80be5fd4d03dda9$var$stringsSymbol = Symbol.for('react-aria.i18n.strings');
let $f80be5fd4d03dda9$var$cachedGlobalStrings = undefined;
class $f80be5fd4d03dda9$export$c17fa47878dc55b6 {
/** Returns a localized string for the given key and locale. */ getStringForLocale(key, locale) {
let strings = this.getStringsForLocale(locale);
let string = strings[key];
if (!string) throw new Error(`Could not find intl message ${key} in ${locale} locale`);
return string;
}
/** Returns all localized strings for the given locale. */ getStringsForLocale(locale) {
let strings = this.strings[locale];
if (!strings) {
strings = $f80be5fd4d03dda9$var$getStringsForLocale(locale, this.strings, this.defaultLocale);
this.strings[locale] = strings;
}
return strings;
}
static getGlobalDictionaryForPackage(packageName) {
if (typeof window === 'undefined') return null;
let locale = window[$f80be5fd4d03dda9$var$localeSymbol];
if ($f80be5fd4d03dda9$var$cachedGlobalStrings === undefined) {
let globalStrings = window[$f80be5fd4d03dda9$var$stringsSymbol];
if (!globalStrings) return null;
$f80be5fd4d03dda9$var$cachedGlobalStrings = {};
for(let pkg in globalStrings)$f80be5fd4d03dda9$var$cachedGlobalStrings[pkg] = new $f80be5fd4d03dda9$export$c17fa47878dc55b6({
[locale]: globalStrings[pkg]
}, locale);
}
let dictionary = $f80be5fd4d03dda9$var$cachedGlobalStrings === null || $f80be5fd4d03dda9$var$cachedGlobalStrings === void 0 ? void 0 : $f80be5fd4d03dda9$var$cachedGlobalStrings[packageName];
if (!dictionary) throw new Error(`Strings for package "${packageName}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);
return dictionary;
}
constructor(messages, defaultLocale = 'en-US'){
// Clone messages so we don't modify the original object.
// Filter out entries with falsy values which may have been caused by applying optimize-locales-plugin.
this.strings = Object.fromEntries(Object.entries(messages).filter(([, v])=>v));
this.defaultLocale = defaultLocale;
}
}
function $f80be5fd4d03dda9$var$getStringsForLocale(locale, strings, defaultLocale = 'en-US') {
// If there is an exact match, use it.
if (strings[locale]) return strings[locale];
// Attempt to find the closest match by language.
// For example, if the locale is fr-CA (French Canadian), but there is only
// an fr-FR (France) set of strings, use that.
// This could be replaced with Intl.LocaleMatcher once it is supported.
// https://github.com/tc39/proposal-intl-localematcher
let language = $f80be5fd4d03dda9$var$getLanguage(locale);
if (strings[language]) return strings[language];
for(let key in strings){
if (key.startsWith(language + '-')) return strings[key];
}
// Nothing close, use english.
return strings[defaultLocale];
}
function $f80be5fd4d03dda9$var$getLanguage(locale) {
// @ts-ignore
if (Intl.Locale) // @ts-ignore
return new Intl.Locale(locale).language;
return locale.split('-')[0];
}
//# sourceMappingURL=LocalizedStringDictionary.main.js.map
@@ -0,0 +1,114 @@
// Copyright (c) 2011-2015 Ryan Prichard
//
// 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.
#ifndef INPUT_MAP_H
#define INPUT_MAP_H
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include "SimplePool.h"
#include "../shared/WinptyAssert.h"
class InputMap {
public:
struct Key {
uint16_t virtualKey;
uint32_t unicodeChar;
uint16_t keyState;
std::string toString() const;
};
private:
struct Node;
struct Branch {
Branch() {
memset(&children, 0, sizeof(children));
}
Node *children[256];
};
struct Node {
Node() : childCount(0) {
Key zeroKey = { 0, 0, 0 };
key = zeroKey;
}
Key key;
int childCount;
enum { kTinyCount = 8 };
union {
Branch *branch;
struct {
unsigned char values[kTinyCount];
Node *children[kTinyCount];
} tiny;
} u;
bool hasKey() const {
return key.virtualKey != 0 || key.unicodeChar != 0;
}
};
private:
SimplePool<Node, 256> m_nodePool;
SimplePool<Branch, 8> m_branchPool;
Node m_root;
public:
void set(const char *encoding, int encodingLen, const Key &key);
int lookupKey(const char *input, int inputSize,
Key &keyOut, bool &incompleteOut) const;
void dumpInputMap() const;
private:
Node *getChild(Node &node, unsigned char ch) {
return const_cast<Node*>(getChild(static_cast<const Node&>(node), ch));
}
const Node *getChild(const Node &node, unsigned char ch) const {
if (node.childCount <= Node::kTinyCount) {
for (int i = 0; i < node.childCount; ++i) {
if (node.u.tiny.values[i] == ch) {
return node.u.tiny.children[i];
}
}
return NULL;
} else {
return node.u.branch->children[ch];
}
}
void setHelper(Node &node, const char *encoding, int encodingLen, const Key &key);
Node &getOrCreateChild(Node &node, unsigned char ch);
void dumpInputMapHelper(const Node &node, std::string &encoding) const;
};
const InputMap::Key kKeyZero = { 0, 0, 0 };
void dumpInputMap(InputMap &inputMap);
#endif // INPUT_MAP_H
@@ -0,0 +1,71 @@
{
"name": "micromark-util-types",
"version": "2.0.2",
"description": "micromark utility with a couple of typescript types",
"license": "MIT",
"keywords": [
"micromark",
"util",
"utility",
"typescript",
"types"
],
"repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-util-types",
"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": [
"index.d.ts.map",
"index.d.ts",
"index.js"
],
"exports": "./index.js",
"xo": {
"envs": [
"shared-node-browser"
],
"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"
]
}
}
],
"prettier": true,
"rules": {
"unicorn/text-encoding-identifier-case": "off"
}
}
}
@@ -0,0 +1,6 @@
import { InstanceBinding } from '../../binding/models/InstanceBinding';
import { InstanceBindingNode } from '../../planning/models/InstanceBindingNode';
import { ResolutionParams } from '../models/ResolutionParams';
import { Resolved } from '../models/Resolved';
export declare function resolveInstanceBindingNodeFromConstructorParams<TActivated, TBinding extends InstanceBinding<TActivated> = InstanceBinding<TActivated>>(setInstanceProperties: (params: ResolutionParams, instance: Record<string | symbol, unknown>, node: InstanceBindingNode) => void | Promise<void>): (constructorValues: unknown[], params: ResolutionParams, node: InstanceBindingNode<TBinding>) => Resolved<TActivated>;
//# sourceMappingURL=resolveInstanceBindingNodeFromConstructorParams.d.ts.map
@@ -0,0 +1,625 @@
import {disableTextSelection as $14c0b72509d70225$export$16a4697467175487, restoreTextSelection as $14c0b72509d70225$export$b0d6fa1ab32e3295} from "./textSelection.module.js";
import {PressResponderContext as $ae1eeba8b9eafd08$export$5165eccb35aaadb5} from "./context.module.js";
import {_ as $7mdmh$_} from "@swc/helpers/_/_class_private_field_get";
import {_ as $7mdmh$_1} from "@swc/helpers/_/_class_private_field_init";
import {_ as $7mdmh$_2} from "@swc/helpers/_/_class_private_field_set";
import {mergeProps as $7mdmh$mergeProps, useSyncRef as $7mdmh$useSyncRef, useGlobalListeners as $7mdmh$useGlobalListeners, useEffectEvent as $7mdmh$useEffectEvent, getOwnerDocument as $7mdmh$getOwnerDocument, chain as $7mdmh$chain, isMac as $7mdmh$isMac, openLink as $7mdmh$openLink, isVirtualClick as $7mdmh$isVirtualClick, focusWithoutScrolling as $7mdmh$focusWithoutScrolling, isVirtualPointerEvent as $7mdmh$isVirtualPointerEvent, getOwnerWindow as $7mdmh$getOwnerWindow} from "@react-aria/utils";
import {useContext as $7mdmh$useContext, useState as $7mdmh$useState, useRef as $7mdmh$useRef, useMemo as $7mdmh$useMemo, useEffect as $7mdmh$useEffect} from "react";
/*
* 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 $f6c31cce2adf654f$var$usePressResponderContext(props) {
// Consume context from <PressResponder> and merge with props.
let context = (0, $7mdmh$useContext)((0, $ae1eeba8b9eafd08$export$5165eccb35aaadb5));
if (context) {
let { register: register, ...contextProps } = context;
props = (0, $7mdmh$mergeProps)(contextProps, props);
register();
}
(0, $7mdmh$useSyncRef)(context, props.ref);
return props;
}
var $f6c31cce2adf654f$var$_shouldStopPropagation = /*#__PURE__*/ new WeakMap();
class $f6c31cce2adf654f$var$PressEvent {
continuePropagation() {
(0, $7mdmh$_2)(this, $f6c31cce2adf654f$var$_shouldStopPropagation, false);
}
get shouldStopPropagation() {
return (0, $7mdmh$_)(this, $f6c31cce2adf654f$var$_shouldStopPropagation);
}
constructor(type, pointerType, originalEvent, state){
(0, $7mdmh$_1)(this, $f6c31cce2adf654f$var$_shouldStopPropagation, {
writable: true,
value: void 0
});
(0, $7mdmh$_2)(this, $f6c31cce2adf654f$var$_shouldStopPropagation, true);
var _state_target;
let currentTarget = (_state_target = state === null || state === void 0 ? void 0 : state.target) !== null && _state_target !== void 0 ? _state_target : originalEvent.currentTarget;
const rect = currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.getBoundingClientRect();
let x, y = 0;
let clientX, clientY = null;
if (originalEvent.clientX != null && originalEvent.clientY != null) {
clientX = originalEvent.clientX;
clientY = originalEvent.clientY;
}
if (rect) {
if (clientX != null && clientY != null) {
x = clientX - rect.left;
y = clientY - rect.top;
} else {
x = rect.width / 2;
y = rect.height / 2;
}
}
this.type = type;
this.pointerType = pointerType;
this.target = originalEvent.currentTarget;
this.shiftKey = originalEvent.shiftKey;
this.metaKey = originalEvent.metaKey;
this.ctrlKey = originalEvent.ctrlKey;
this.altKey = originalEvent.altKey;
this.x = x;
this.y = y;
}
}
const $f6c31cce2adf654f$var$LINK_CLICKED = Symbol('linkClicked');
function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
let { onPress: onPress, onPressChange: onPressChange, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, isDisabled: isDisabled, isPressed: isPressedProp, preventFocusOnPress: preventFocusOnPress, shouldCancelOnPointerExit: shouldCancelOnPointerExit, allowTextSelectionOnPress: allowTextSelectionOnPress, // eslint-disable-next-line @typescript-eslint/no-unused-vars
ref: _, ...domProps } = $f6c31cce2adf654f$var$usePressResponderContext(props);
let [isPressed, setPressed] = (0, $7mdmh$useState)(false);
let ref = (0, $7mdmh$useRef)({
isPressed: false,
ignoreEmulatedMouseEvents: false,
ignoreClickAfterPress: false,
didFirePressStart: false,
isTriggeringEvent: false,
activePointerId: null,
target: null,
isOverTarget: false,
pointerType: null
});
let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners } = (0, $7mdmh$useGlobalListeners)();
let triggerPressStart = (0, $7mdmh$useEffectEvent)((originalEvent, pointerType)=>{
let state = ref.current;
if (isDisabled || state.didFirePressStart) return false;
let shouldStopPropagation = true;
state.isTriggeringEvent = true;
if (onPressStart) {
let event = new $f6c31cce2adf654f$var$PressEvent('pressstart', pointerType, originalEvent);
onPressStart(event);
shouldStopPropagation = event.shouldStopPropagation;
}
if (onPressChange) onPressChange(true);
state.isTriggeringEvent = false;
state.didFirePressStart = true;
setPressed(true);
return shouldStopPropagation;
});
let triggerPressEnd = (0, $7mdmh$useEffectEvent)((originalEvent, pointerType, wasPressed = true)=>{
let state = ref.current;
if (!state.didFirePressStart) return false;
state.ignoreClickAfterPress = true;
state.didFirePressStart = false;
state.isTriggeringEvent = true;
let shouldStopPropagation = true;
if (onPressEnd) {
let event = new $f6c31cce2adf654f$var$PressEvent('pressend', pointerType, originalEvent);
onPressEnd(event);
shouldStopPropagation = event.shouldStopPropagation;
}
if (onPressChange) onPressChange(false);
setPressed(false);
if (onPress && wasPressed && !isDisabled) {
let event = new $f6c31cce2adf654f$var$PressEvent('press', pointerType, originalEvent);
onPress(event);
shouldStopPropagation && (shouldStopPropagation = event.shouldStopPropagation);
}
state.isTriggeringEvent = false;
return shouldStopPropagation;
});
let triggerPressUp = (0, $7mdmh$useEffectEvent)((originalEvent, pointerType)=>{
let state = ref.current;
if (isDisabled) return false;
if (onPressUp) {
state.isTriggeringEvent = true;
let event = new $f6c31cce2adf654f$var$PressEvent('pressup', pointerType, originalEvent);
onPressUp(event);
state.isTriggeringEvent = false;
return event.shouldStopPropagation;
}
return true;
});
let cancel = (0, $7mdmh$useEffectEvent)((e)=>{
let state = ref.current;
if (state.isPressed && state.target) {
if (state.isOverTarget && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
state.isPressed = false;
state.isOverTarget = false;
state.activePointerId = null;
state.pointerType = null;
removeAllGlobalListeners();
if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
}
});
let cancelOnPointerExit = (0, $7mdmh$useEffectEvent)((e)=>{
if (shouldCancelOnPointerExit) cancel(e);
});
let pressProps = (0, $7mdmh$useMemo)(()=>{
let state = ref.current;
let pressProps = {
onKeyDown (e) {
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && e.currentTarget.contains(e.target)) {
var _state_metaKeyEvents;
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(e.target, e.key)) e.preventDefault();
// If the event is repeating, it may have started on a different element
// after which focus moved to the current element. Ignore these events and
// only handle the first key down event.
let shouldStopPropagation = true;
if (!state.isPressed && !e.repeat) {
state.target = e.currentTarget;
state.isPressed = true;
shouldStopPropagation = triggerPressStart(e, 'keyboard');
// Focus may move before the key up event, so register the event on the document
// instead of the same element where the key down event occurred. Make it capturing so that it will trigger
// before stopPropagation from useKeyboard on a child element may happen and thus we can still call triggerPress for the parent element.
let originalTarget = e.currentTarget;
let pressUp = (e)=>{
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e, originalTarget) && !e.repeat && originalTarget.contains(e.target) && state.target) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard');
};
addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'keyup', (0, $7mdmh$chain)(pressUp, onKeyUp), true);
}
if (shouldStopPropagation) e.stopPropagation();
// Keep track of the keydown events that occur while the Meta (e.g. Command) key is held.
// macOS has a bug where keyup events are not fired while the Meta key is down.
// When the Meta key itself is released we will get an event for that, and we'll act as if
// all of these other keys were released as well.
// https://bugs.chromium.org/p/chromium/issues/detail?id=1393524
// https://bugs.webkit.org/show_bug.cgi?id=55291
// https://bugzilla.mozilla.org/show_bug.cgi?id=1299553
if (e.metaKey && (0, $7mdmh$isMac)()) (_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.set(e.key, e.nativeEvent);
} else if (e.key === 'Meta') state.metaKeyEvents = new Map();
},
onClick (e) {
if (e && !e.currentTarget.contains(e.target)) return;
if (e && e.button === 0 && !state.isTriggeringEvent && !(0, $7mdmh$openLink).isOpening) {
let shouldStopPropagation = true;
if (isDisabled) e.preventDefault();
// If triggered from a screen reader or by using element.click(),
// trigger as if it were a keyboard click.
if (!state.ignoreClickAfterPress && !state.ignoreEmulatedMouseEvents && !state.isPressed && (state.pointerType === 'virtual' || (0, $7mdmh$isVirtualClick)(e.nativeEvent))) {
// Ensure the element receives focus (VoiceOver on iOS does not do this)
if (!isDisabled && !preventFocusOnPress) (0, $7mdmh$focusWithoutScrolling)(e.currentTarget);
let stopPressStart = triggerPressStart(e, 'virtual');
let stopPressUp = triggerPressUp(e, 'virtual');
let stopPressEnd = triggerPressEnd(e, 'virtual');
shouldStopPropagation = stopPressStart && stopPressUp && stopPressEnd;
}
state.ignoreEmulatedMouseEvents = false;
state.ignoreClickAfterPress = false;
if (shouldStopPropagation) e.stopPropagation();
}
}
};
let onKeyUp = (e)=>{
var _state_metaKeyEvents;
if (state.isPressed && state.target && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, state.target)) {
var _state_metaKeyEvents1;
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(e.target, e.key)) e.preventDefault();
let target = e.target;
triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard', state.target.contains(target));
removeAllGlobalListeners();
// If a link was triggered with a key other than Enter, open the URL ourselves.
// This means the link has a role override, and the default browser behavior
// only applies when using the Enter key.
if (e.key !== 'Enter' && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) && state.target.contains(target) && !e[$f6c31cce2adf654f$var$LINK_CLICKED]) {
// Store a hidden property on the event so we only trigger link click once,
// even if there are multiple usePress instances attached to the element.
e[$f6c31cce2adf654f$var$LINK_CLICKED] = true;
(0, $7mdmh$openLink)(state.target, e, false);
}
state.isPressed = false;
(_state_metaKeyEvents1 = state.metaKeyEvents) === null || _state_metaKeyEvents1 === void 0 ? void 0 : _state_metaKeyEvents1.delete(e.key);
} else if (e.key === 'Meta' && ((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.size)) {
var _state_target;
// If we recorded keydown events that occurred while the Meta key was pressed,
// and those haven't received keyup events already, fire keyup events ourselves.
// See comment above for more info about the macOS bug causing this.
let events = state.metaKeyEvents;
state.metaKeyEvents = undefined;
for (let event of events.values())(_state_target = state.target) === null || _state_target === void 0 ? void 0 : _state_target.dispatchEvent(new KeyboardEvent('keyup', event));
}
};
if (typeof PointerEvent !== 'undefined') {
pressProps.onPointerDown = (e)=>{
// Only handle left clicks, and ignore events that bubbled through portals.
if (e.button !== 0 || !e.currentTarget.contains(e.target)) return;
// iOS safari fires pointer events from VoiceOver with incorrect coordinates/target.
// Ignore and let the onClick handler take care of it instead.
// https://bugs.webkit.org/show_bug.cgi?id=222627
// https://bugs.webkit.org/show_bug.cgi?id=223202
if ((0, $7mdmh$isVirtualPointerEvent)(e.nativeEvent)) {
state.pointerType = 'virtual';
return;
}
// Due to browser inconsistencies, especially on mobile browsers, we prevent
// default on pointer down and handle focusing the pressable element ourselves.
if ($f6c31cce2adf654f$var$shouldPreventDefaultDown(e.currentTarget)) e.preventDefault();
state.pointerType = e.pointerType;
let shouldStopPropagation = true;
if (!state.isPressed) {
state.isPressed = true;
state.isOverTarget = true;
state.activePointerId = e.pointerId;
state.target = e.currentTarget;
if (!isDisabled && !preventFocusOnPress) (0, $7mdmh$focusWithoutScrolling)(e.currentTarget);
if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$16a4697467175487)(state.target);
shouldStopPropagation = triggerPressStart(e, state.pointerType);
addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'pointermove', onPointerMove, false);
addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'pointerup', onPointerUp, false);
addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'pointercancel', onPointerCancel, false);
}
if (shouldStopPropagation) e.stopPropagation();
};
pressProps.onMouseDown = (e)=>{
if (!e.currentTarget.contains(e.target)) return;
if (e.button === 0) {
// Chrome and Firefox on touch Windows devices require mouse down events
// to be canceled in addition to pointer events, or an extra asynchronous
// focus event will be fired.
if ($f6c31cce2adf654f$var$shouldPreventDefaultDown(e.currentTarget)) e.preventDefault();
e.stopPropagation();
}
};
pressProps.onPointerUp = (e)=>{
// iOS fires pointerup with zero width and height, so check the pointerType recorded during pointerdown.
if (!e.currentTarget.contains(e.target) || state.pointerType === 'virtual') return;
// Only handle left clicks
// Safari on iOS sometimes fires pointerup events, even
// when the touch isn't over the target, so double check.
if (e.button === 0 && $f6c31cce2adf654f$var$isOverTarget(e, e.currentTarget)) triggerPressUp(e, state.pointerType || e.pointerType);
};
// Safari on iOS < 13.2 does not implement pointerenter/pointerleave events correctly.
// Use pointer move events instead to implement our own hit testing.
// See https://bugs.webkit.org/show_bug.cgi?id=199803
let onPointerMove = (e)=>{
if (e.pointerId !== state.activePointerId) return;
if (state.target && $f6c31cce2adf654f$var$isOverTarget(e, state.target)) {
if (!state.isOverTarget && state.pointerType != null) {
state.isOverTarget = true;
triggerPressStart($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
}
} else if (state.target && state.isOverTarget && state.pointerType != null) {
state.isOverTarget = false;
triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
cancelOnPointerExit(e);
}
};
let onPointerUp = (e)=>{
if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) {
if ($f6c31cce2adf654f$var$isOverTarget(e, state.target) && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
else if (state.isOverTarget && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
state.isPressed = false;
state.isOverTarget = false;
state.activePointerId = null;
state.pointerType = null;
removeAllGlobalListeners();
if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
// Prevent subsequent touchend event from triggering onClick on unrelated elements on Android. See below.
// Both 'touch' and 'pen' pointerTypes trigger onTouchEnd, but 'mouse' does not.
if ('ontouchend' in state.target && e.pointerType !== 'mouse') addGlobalListener(state.target, 'touchend', onTouchEnd, {
once: true
});
}
};
// This is a workaround for an Android Chrome/Firefox issue where click events are fired on an incorrect element
// if the original target is removed during onPointerUp (before onClick).
// https://github.com/adobe/react-spectrum/issues/1513
// https://issues.chromium.org/issues/40732224
// Note: this event must be registered directly on the element, not via React props in order to work.
// https://github.com/facebook/react/issues/9809
let onTouchEnd = (e)=>{
// Don't preventDefault if we actually want the default (e.g. submit/link click).
if ($f6c31cce2adf654f$var$shouldPreventDefaultUp(e.currentTarget)) e.preventDefault();
};
let onPointerCancel = (e)=>{
cancel(e);
};
pressProps.onDragStart = (e)=>{
if (!e.currentTarget.contains(e.target)) return;
// Safari does not call onPointerCancel when a drag starts, whereas Chrome and Firefox do.
cancel(e);
};
} else {
pressProps.onMouseDown = (e)=>{
// Only handle left clicks
if (e.button !== 0 || !e.currentTarget.contains(e.target)) return;
// Due to browser inconsistencies, especially on mobile browsers, we prevent
// default on mouse down and handle focusing the pressable element ourselves.
if ($f6c31cce2adf654f$var$shouldPreventDefaultDown(e.currentTarget)) e.preventDefault();
if (state.ignoreEmulatedMouseEvents) {
e.stopPropagation();
return;
}
state.isPressed = true;
state.isOverTarget = true;
state.target = e.currentTarget;
state.pointerType = (0, $7mdmh$isVirtualClick)(e.nativeEvent) ? 'virtual' : 'mouse';
if (!isDisabled && !preventFocusOnPress) (0, $7mdmh$focusWithoutScrolling)(e.currentTarget);
let shouldStopPropagation = triggerPressStart(e, state.pointerType);
if (shouldStopPropagation) e.stopPropagation();
addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'mouseup', onMouseUp, false);
};
pressProps.onMouseEnter = (e)=>{
if (!e.currentTarget.contains(e.target)) return;
let shouldStopPropagation = true;
if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
state.isOverTarget = true;
shouldStopPropagation = triggerPressStart(e, state.pointerType);
}
if (shouldStopPropagation) e.stopPropagation();
};
pressProps.onMouseLeave = (e)=>{
if (!e.currentTarget.contains(e.target)) return;
let shouldStopPropagation = true;
if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
state.isOverTarget = false;
shouldStopPropagation = triggerPressEnd(e, state.pointerType, false);
cancelOnPointerExit(e);
}
if (shouldStopPropagation) e.stopPropagation();
};
pressProps.onMouseUp = (e)=>{
if (!e.currentTarget.contains(e.target)) return;
if (!state.ignoreEmulatedMouseEvents && e.button === 0) triggerPressUp(e, state.pointerType || 'mouse');
};
let onMouseUp = (e)=>{
// Only handle left clicks
if (e.button !== 0) return;
state.isPressed = false;
removeAllGlobalListeners();
if (state.ignoreEmulatedMouseEvents) {
state.ignoreEmulatedMouseEvents = false;
return;
}
if (state.target && $f6c31cce2adf654f$var$isOverTarget(e, state.target) && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
else if (state.target && state.isOverTarget && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
state.isOverTarget = false;
};
pressProps.onTouchStart = (e)=>{
if (!e.currentTarget.contains(e.target)) return;
let touch = $f6c31cce2adf654f$var$getTouchFromEvent(e.nativeEvent);
if (!touch) return;
state.activePointerId = touch.identifier;
state.ignoreEmulatedMouseEvents = true;
state.isOverTarget = true;
state.isPressed = true;
state.target = e.currentTarget;
state.pointerType = 'touch';
// Due to browser inconsistencies, especially on mobile browsers, we prevent default
// on the emulated mouse event and handle focusing the pressable element ourselves.
if (!isDisabled && !preventFocusOnPress) (0, $7mdmh$focusWithoutScrolling)(e.currentTarget);
if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$16a4697467175487)(state.target);
let shouldStopPropagation = triggerPressStart($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
if (shouldStopPropagation) e.stopPropagation();
addGlobalListener((0, $7mdmh$getOwnerWindow)(e.currentTarget), 'scroll', onScroll, true);
};
pressProps.onTouchMove = (e)=>{
if (!e.currentTarget.contains(e.target)) return;
if (!state.isPressed) {
e.stopPropagation();
return;
}
let touch = $f6c31cce2adf654f$var$getTouchById(e.nativeEvent, state.activePointerId);
let shouldStopPropagation = true;
if (touch && $f6c31cce2adf654f$var$isOverTarget(touch, e.currentTarget)) {
if (!state.isOverTarget && state.pointerType != null) {
state.isOverTarget = true;
shouldStopPropagation = triggerPressStart($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
}
} else if (state.isOverTarget && state.pointerType != null) {
state.isOverTarget = false;
shouldStopPropagation = triggerPressEnd($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType, false);
cancelOnPointerExit($f6c31cce2adf654f$var$createTouchEvent(state.target, e));
}
if (shouldStopPropagation) e.stopPropagation();
};
pressProps.onTouchEnd = (e)=>{
if (!e.currentTarget.contains(e.target)) return;
if (!state.isPressed) {
e.stopPropagation();
return;
}
let touch = $f6c31cce2adf654f$var$getTouchById(e.nativeEvent, state.activePointerId);
let shouldStopPropagation = true;
if (touch && $f6c31cce2adf654f$var$isOverTarget(touch, e.currentTarget) && state.pointerType != null) {
triggerPressUp($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
shouldStopPropagation = triggerPressEnd($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
} else if (state.isOverTarget && state.pointerType != null) shouldStopPropagation = triggerPressEnd($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType, false);
if (shouldStopPropagation) e.stopPropagation();
state.isPressed = false;
state.activePointerId = null;
state.isOverTarget = false;
state.ignoreEmulatedMouseEvents = true;
if (state.target && !allowTextSelectionOnPress) (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
removeAllGlobalListeners();
};
pressProps.onTouchCancel = (e)=>{
if (!e.currentTarget.contains(e.target)) return;
e.stopPropagation();
if (state.isPressed) cancel($f6c31cce2adf654f$var$createTouchEvent(state.target, e));
};
let onScroll = (e)=>{
if (state.isPressed && e.target.contains(state.target)) cancel({
currentTarget: state.target,
shiftKey: false,
ctrlKey: false,
metaKey: false,
altKey: false
});
};
pressProps.onDragStart = (e)=>{
if (!e.currentTarget.contains(e.target)) return;
cancel(e);
};
}
return pressProps;
}, [
addGlobalListener,
isDisabled,
preventFocusOnPress,
removeAllGlobalListeners,
allowTextSelectionOnPress,
cancel,
cancelOnPointerExit,
triggerPressEnd,
triggerPressStart,
triggerPressUp
]);
// Remove user-select: none in case component unmounts immediately after pressStart
(0, $7mdmh$useEffect)(()=>{
return ()=>{
var _ref_current_target;
if (!allowTextSelectionOnPress) // eslint-disable-next-line react-hooks/exhaustive-deps
(0, $14c0b72509d70225$export$b0d6fa1ab32e3295)((_ref_current_target = ref.current.target) !== null && _ref_current_target !== void 0 ? _ref_current_target : undefined);
};
}, [
allowTextSelectionOnPress
]);
return {
isPressed: isPressedProp || isPressed,
pressProps: (0, $7mdmh$mergeProps)(domProps, pressProps)
};
}
function $f6c31cce2adf654f$var$isHTMLAnchorLink(target) {
return target.tagName === 'A' && target.hasAttribute('href');
}
function $f6c31cce2adf654f$var$isValidKeyboardEvent(event, currentTarget) {
const { key: key, code: code } = event;
const element = currentTarget;
const role = element.getAttribute('role');
// Accessibility for keyboards. Space and Enter only.
// "Spacebar" is for IE 11
return (key === 'Enter' || key === ' ' || key === 'Spacebar' || code === 'Space') && !(element instanceof (0, $7mdmh$getOwnerWindow)(element).HTMLInputElement && !$f6c31cce2adf654f$var$isValidInputKey(element, key) || element instanceof (0, $7mdmh$getOwnerWindow)(element).HTMLTextAreaElement || element.isContentEditable) && // Links should only trigger with Enter key
!((role === 'link' || !role && $f6c31cce2adf654f$var$isHTMLAnchorLink(element)) && key !== 'Enter');
}
function $f6c31cce2adf654f$var$getTouchFromEvent(event) {
const { targetTouches: targetTouches } = event;
if (targetTouches.length > 0) return targetTouches[0];
return null;
}
function $f6c31cce2adf654f$var$getTouchById(event, pointerId) {
const changedTouches = event.changedTouches;
for(let i = 0; i < changedTouches.length; i++){
const touch = changedTouches[i];
if (touch.identifier === pointerId) return touch;
}
return null;
}
function $f6c31cce2adf654f$var$createTouchEvent(target, e) {
let clientX = 0;
let clientY = 0;
if (e.targetTouches && e.targetTouches.length === 1) {
clientX = e.targetTouches[0].clientX;
clientY = e.targetTouches[0].clientY;
}
return {
currentTarget: target,
shiftKey: e.shiftKey,
ctrlKey: e.ctrlKey,
metaKey: e.metaKey,
altKey: e.altKey,
clientX: clientX,
clientY: clientY
};
}
function $f6c31cce2adf654f$var$createEvent(target, e) {
let clientX = e.clientX;
let clientY = e.clientY;
return {
currentTarget: target,
shiftKey: e.shiftKey,
ctrlKey: e.ctrlKey,
metaKey: e.metaKey,
altKey: e.altKey,
clientX: clientX,
clientY: clientY
};
}
function $f6c31cce2adf654f$var$getPointClientRect(point) {
let offsetX = 0;
let offsetY = 0;
if (point.width !== undefined) offsetX = point.width / 2;
else if (point.radiusX !== undefined) offsetX = point.radiusX;
if (point.height !== undefined) offsetY = point.height / 2;
else if (point.radiusY !== undefined) offsetY = point.radiusY;
return {
top: point.clientY - offsetY,
right: point.clientX + offsetX,
bottom: point.clientY + offsetY,
left: point.clientX - offsetX
};
}
function $f6c31cce2adf654f$var$areRectanglesOverlapping(a, b) {
// check if they cannot overlap on x axis
if (a.left > b.right || b.left > a.right) return false;
// check if they cannot overlap on y axis
if (a.top > b.bottom || b.top > a.bottom) return false;
return true;
}
function $f6c31cce2adf654f$var$isOverTarget(point, target) {
let rect = target.getBoundingClientRect();
let pointRect = $f6c31cce2adf654f$var$getPointClientRect(point);
return $f6c31cce2adf654f$var$areRectanglesOverlapping(rect, pointRect);
}
function $f6c31cce2adf654f$var$shouldPreventDefaultDown(target) {
// We cannot prevent default if the target is a draggable element.
return !(target instanceof HTMLElement) || !target.hasAttribute('draggable');
}
function $f6c31cce2adf654f$var$shouldPreventDefaultUp(target) {
if (target instanceof HTMLInputElement) return false;
if (target instanceof HTMLButtonElement) return target.type !== 'submit' && target.type !== 'reset';
if ($f6c31cce2adf654f$var$isHTMLAnchorLink(target)) return false;
return true;
}
function $f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(target, key) {
if (target instanceof HTMLInputElement) return !$f6c31cce2adf654f$var$isValidInputKey(target, key);
return $f6c31cce2adf654f$var$shouldPreventDefaultUp(target);
}
const $f6c31cce2adf654f$var$nonTextInputTypes = new Set([
'checkbox',
'radio',
'range',
'color',
'file',
'image',
'button',
'submit',
'reset'
]);
function $f6c31cce2adf654f$var$isValidInputKey(target, key) {
// Only space should toggle checkboxes and radios, not enter.
return target.type === 'checkbox' || target.type === 'radio' ? key === ' ' : $f6c31cce2adf654f$var$nonTextInputTypes.has(target.type);
}
export {$f6c31cce2adf654f$export$45712eceda6fad21 as usePress};
//# sourceMappingURL=usePress.module.js.map
@@ -0,0 +1 @@
{"version":3,"file":"no-nodejs-modules.js","sourceRoot":"","sources":["../../src/rules/no-nodejs-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAQzE,eAAe,UAAU,CAAwB;IAC/C,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,iCAAiC;SAC/C;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,KAAK,EAAE;wBACL,IAAI,EAAE,OAAO;wBACb,WAAW,EAAE,IAAI;wBACjB,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;yBACf;qBACF;iBACF;gBACD,oBAAoB,EAAE,KAAK;aAC5B;SACF;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,uDAAuD;SACjE;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QACxC,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,EAAE,CAAA;QAEnC,OAAO,aAAa,CAClB,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;YACf,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAA;YAC/B,IACE,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;gBAC7B,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC,KAAK,SAAS,EAC7C,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,SAAS,EAAE,SAAS;oBACpB,IAAI,EAAE;wBACJ,UAAU;qBACX;iBACF,CAAC,CAAA;YACJ,CAAC;QACH,CAAC,EACD,EAAE,QAAQ,EAAE,IAAI,EAAE,CACnB,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,45 @@
/*
* 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.
*/
export class Point {
/** The x-coordinate of the point. */
x: number;
/** The y-coordinate of the point. */
y: number;
constructor(x = 0, y = 0) {
this.x = x;
this.y = y;
}
/**
* Returns a copy of this point.
*/
copy(): Point {
return new Point(this.x, this.y);
}
/**
* Checks if two points are equal.
*/
equals(point: Point): boolean {
return this.x === point.x && this.y === point.y;
}
/**
* Returns true if this point is the origin.
*/
isOrigin(): boolean {
return this.x === 0 && this.y === 0;
}
}
@@ -0,0 +1,227 @@
/**
* @author Yusuke Iinuma
* See LICENSE file in root directory for full license.
*/
"use strict"
const {
getStringIfConstant,
getPropertyName,
} = require("@eslint-community/eslint-utils")
const { subset, Range } = require("semver")
const getConfiguredNodeVersion = require("../util/get-configured-node-version")
const stripImportPathParams = require("../util/strip-import-path-params")
const {
NodeBuiltinModules,
} = require("../unsupported-features/node-builtins.js")
/**
* @typedef { 'import' | 'require' | 'getBuiltinModule' } ModuleStyle
*/
/**
* @param {string} name The name of the node module
* @returns {boolean}
*/
function isBuiltin(name) {
return Object.hasOwn(NodeBuiltinModules, name)
}
const messageId = "preferNodeProtocol"
const supportedRangeForEsm = new Range("^12.20.0 || >= 14.13.1")
const supportedRangeForCjs = new Range("^14.18.0 || >= 16.0.0")
/**
* @param {import('estree').Node} [node]
* @returns {node is import('estree').Literal}
*/
function isStringLiteral(node) {
return node?.type === "Literal" && typeof node.type === "string"
}
/**
* @param {import('eslint').Rule.RuleContext} context
* @param {ModuleStyle} moduleStyle
* @returns {boolean}
*/
function isEnablingThisRule(context, moduleStyle) {
// The availability of `process.getBuiltinModule()` means that `node:` protocol is supported.
if (moduleStyle === "getBuiltinModule") {
return true
}
const version = getConfiguredNodeVersion(context)
// Only check Node.js version because this rule is meaningless if configured Node.js version doesn't match semver range.
if (!subset(version, supportedRangeForEsm)) {
return false
}
// Only check when using `require`
if (moduleStyle === "require" && !subset(version, supportedRangeForCjs)) {
return false
}
return true
}
/**
* @param {import('estree').Node} node
* @returns {boolean}
**/
function isValidRequireArgument(node) {
const rawName = getStringIfConstant(node)
if (typeof rawName !== "string") {
return false
}
const name = stripImportPathParams(rawName)
if (!isBuiltin(name)) {
return false
}
return true
}
/**
* @param {import('estree').Node | null | undefined} node
* @param {import('eslint').Rule.RuleContext} context
* @param {ModuleStyle} moduleStyle
*/
function validate(node, context, moduleStyle) {
if (node == null) {
return
}
if (!isEnablingThisRule(context, moduleStyle)) {
return
}
if (!isStringLiteral(node)) {
return
}
if (
(moduleStyle === "require" || moduleStyle === "getBuiltinModule") &&
!isValidRequireArgument(node)
) {
return
}
if (
!("value" in node) ||
typeof node.value !== "string" ||
node.value.startsWith("node:") ||
!isBuiltin(node.value) ||
!isBuiltin(`node:${node.value}`)
) {
return
}
context.report({
node,
messageId,
data: {
moduleName: node.value,
},
fix(fixer) {
const firstCharacterIndex = (node?.range?.[0] ?? 0) + 1
return fixer.replaceTextRange(
[firstCharacterIndex, firstCharacterIndex],
"node:"
)
},
})
}
/**
* @param {import('estree').Expression | import('estree').Super} node
*/
function isProcess(node) {
if (node.type === "Identifier" && node.name === "process") {
return true
}
if (node.type === "MemberExpression") {
if (getPropertyName(node) !== "process") {
return false
}
return (
node.object.type === "Identifier" &&
node.object.name === "globalThis"
)
}
return false
}
/** @type {import('./rule-module').RuleModule} */
module.exports = {
meta: {
docs: {
description:
"enforce using the `node:` protocol when importing Node.js builtin modules.",
recommended: false,
url: "https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-node-protocol.md",
},
fixable: "code",
messages: {
[messageId]: "Prefer `node:{{moduleName}}` over `{{moduleName}}`.",
},
schema: [
{
type: "object",
properties: {
version: getConfiguredNodeVersion.schema,
},
additionalProperties: false,
},
],
type: "suggestion",
},
create(context) {
return {
CallExpression(node) {
if (node.type !== "CallExpression") {
return
}
if (
!node.optional &&
node.arguments.length === 1 &&
node.callee.type === "Identifier" &&
node.callee.name === "require"
) {
return validate(node.arguments[0], context, "require")
}
if (
node.arguments.length >= 1 &&
node.callee.type === "MemberExpression" &&
isProcess(node.callee.object) &&
getPropertyName(node.callee) === "getBuiltinModule"
) {
return validate(
node.arguments[0],
context,
"getBuiltinModule"
)
}
},
ExportAllDeclaration(node) {
return validate(node.source, context, "import")
},
ExportNamedDeclaration(node) {
return validate(node.source, context, "import")
},
ImportDeclaration(node) {
return validate(node.source, context, "import")
},
ImportExpression(node) {
return validate(node.source, context, "import")
},
}
},
}
@@ -0,0 +1,539 @@
/**
* Copyright (c) 2018 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { DomRendererRowFactory, RowCss } from 'browser/renderer/dom/DomRendererRowFactory';
import { WidthCache } from 'browser/renderer/dom/WidthCache';
import { INVERTED_DEFAULT_COLOR } from 'browser/renderer/shared/Constants';
import { createRenderDimensions } from 'browser/renderer/shared/RendererUtils';
import { createSelectionRenderModel } from 'browser/renderer/shared/SelectionRenderModel';
import { IRenderDimensions, IRenderer, IRequestRedrawEvent, ISelectionRenderModel } from 'browser/renderer/shared/Types';
import { ICharSizeService, ICoreBrowserService, IThemeService } from 'browser/services/Services';
import { ILinkifier2, ILinkifierEvent, ITerminal, ReadonlyColorSet } from 'browser/Types';
import { color } from 'common/Color';
import { EventEmitter } from 'common/EventEmitter';
import { Disposable, toDisposable } from 'common/Lifecycle';
import { IBufferService, IInstantiationService, IOptionsService } from 'common/services/Services';
const TERMINAL_CLASS_PREFIX = 'xterm-dom-renderer-owner-';
const ROW_CONTAINER_CLASS = 'xterm-rows';
const FG_CLASS_PREFIX = 'xterm-fg-';
const BG_CLASS_PREFIX = 'xterm-bg-';
const FOCUS_CLASS = 'xterm-focus';
const SELECTION_CLASS = 'xterm-selection';
let nextTerminalId = 1;
/**
* A fallback renderer for when canvas is slow. This is not meant to be
* particularly fast or feature complete, more just stable and usable for when
* canvas is not an option.
*/
export class DomRenderer extends Disposable implements IRenderer {
private _rowFactory: DomRendererRowFactory;
private _terminalClass: number = nextTerminalId++;
private _themeStyleElement!: HTMLStyleElement;
private _dimensionsStyleElement!: HTMLStyleElement;
private _rowContainer: HTMLElement;
private _rowElements: HTMLElement[] = [];
private _selectionContainer: HTMLElement;
private _widthCache: WidthCache;
private _selectionRenderModel: ISelectionRenderModel = createSelectionRenderModel();
public dimensions: IRenderDimensions;
public readonly onRequestRedraw = this.register(new EventEmitter<IRequestRedrawEvent>()).event;
constructor(
private readonly _terminal: ITerminal,
private readonly _document: Document,
private readonly _element: HTMLElement,
private readonly _screenElement: HTMLElement,
private readonly _viewportElement: HTMLElement,
private readonly _helperContainer: HTMLElement,
private readonly _linkifier2: ILinkifier2,
@IInstantiationService instantiationService: IInstantiationService,
@ICharSizeService private readonly _charSizeService: ICharSizeService,
@IOptionsService private readonly _optionsService: IOptionsService,
@IBufferService private readonly _bufferService: IBufferService,
@ICoreBrowserService private readonly _coreBrowserService: ICoreBrowserService,
@IThemeService private readonly _themeService: IThemeService
) {
super();
this._rowContainer = this._document.createElement('div');
this._rowContainer.classList.add(ROW_CONTAINER_CLASS);
this._rowContainer.style.lineHeight = 'normal';
this._rowContainer.setAttribute('aria-hidden', 'true');
this._refreshRowElements(this._bufferService.cols, this._bufferService.rows);
this._selectionContainer = this._document.createElement('div');
this._selectionContainer.classList.add(SELECTION_CLASS);
this._selectionContainer.setAttribute('aria-hidden', 'true');
this.dimensions = createRenderDimensions();
this._updateDimensions();
this.register(this._optionsService.onOptionChange(() => this._handleOptionsChanged()));
this.register(this._themeService.onChangeColors(e => this._injectCss(e)));
this._injectCss(this._themeService.colors);
this._rowFactory = instantiationService.createInstance(DomRendererRowFactory, document);
this._element.classList.add(TERMINAL_CLASS_PREFIX + this._terminalClass);
this._screenElement.appendChild(this._rowContainer);
this._screenElement.appendChild(this._selectionContainer);
this.register(this._linkifier2.onShowLinkUnderline(e => this._handleLinkHover(e)));
this.register(this._linkifier2.onHideLinkUnderline(e => this._handleLinkLeave(e)));
this.register(toDisposable(() => {
this._element.classList.remove(TERMINAL_CLASS_PREFIX + this._terminalClass);
// Outside influences such as React unmounts may manipulate the DOM before our disposal.
// https://github.com/xtermjs/xterm.js/issues/2960
this._rowContainer.remove();
this._selectionContainer.remove();
this._widthCache.dispose();
this._themeStyleElement.remove();
this._dimensionsStyleElement.remove();
}));
this._widthCache = new WidthCache(this._document, this._helperContainer);
this._widthCache.setFont(
this._optionsService.rawOptions.fontFamily,
this._optionsService.rawOptions.fontSize,
this._optionsService.rawOptions.fontWeight,
this._optionsService.rawOptions.fontWeightBold
);
this._setDefaultSpacing();
}
private _updateDimensions(): void {
const dpr = this._coreBrowserService.dpr;
this.dimensions.device.char.width = this._charSizeService.width * dpr;
this.dimensions.device.char.height = Math.ceil(this._charSizeService.height * dpr);
this.dimensions.device.cell.width = this.dimensions.device.char.width + Math.round(this._optionsService.rawOptions.letterSpacing);
this.dimensions.device.cell.height = Math.floor(this.dimensions.device.char.height * this._optionsService.rawOptions.lineHeight);
this.dimensions.device.char.left = 0;
this.dimensions.device.char.top = 0;
this.dimensions.device.canvas.width = this.dimensions.device.cell.width * this._bufferService.cols;
this.dimensions.device.canvas.height = this.dimensions.device.cell.height * this._bufferService.rows;
this.dimensions.css.canvas.width = Math.round(this.dimensions.device.canvas.width / dpr);
this.dimensions.css.canvas.height = Math.round(this.dimensions.device.canvas.height / dpr);
this.dimensions.css.cell.width = this.dimensions.css.canvas.width / this._bufferService.cols;
this.dimensions.css.cell.height = this.dimensions.css.canvas.height / this._bufferService.rows;
for (const element of this._rowElements) {
element.style.width = `${this.dimensions.css.canvas.width}px`;
element.style.height = `${this.dimensions.css.cell.height}px`;
element.style.lineHeight = `${this.dimensions.css.cell.height}px`;
// Make sure rows don't overflow onto following row
element.style.overflow = 'hidden';
}
if (!this._dimensionsStyleElement) {
this._dimensionsStyleElement = this._document.createElement('style');
this._screenElement.appendChild(this._dimensionsStyleElement);
}
const styles =
`${this._terminalSelector} .${ROW_CONTAINER_CLASS} span {` +
` display: inline-block;` + // TODO: find workaround for inline-block (creates ~20% render penalty)
` height: 100%;` +
` vertical-align: top;` +
`}`;
this._dimensionsStyleElement.textContent = styles;
this._selectionContainer.style.height = this._viewportElement.style.height;
this._screenElement.style.width = `${this.dimensions.css.canvas.width}px`;
this._screenElement.style.height = `${this.dimensions.css.canvas.height}px`;
}
private _injectCss(colors: ReadonlyColorSet): void {
if (!this._themeStyleElement) {
this._themeStyleElement = this._document.createElement('style');
this._screenElement.appendChild(this._themeStyleElement);
}
// Base CSS
let styles =
`${this._terminalSelector} .${ROW_CONTAINER_CLASS} {` +
` color: ${colors.foreground.css};` +
` font-family: ${this._optionsService.rawOptions.fontFamily};` +
` font-size: ${this._optionsService.rawOptions.fontSize}px;` +
` font-kerning: none;` +
` white-space: pre` +
`}`;
styles +=
`${this._terminalSelector} .${ROW_CONTAINER_CLASS} .xterm-dim {` +
` color: ${color.multiplyOpacity(colors.foreground, 0.5).css};` +
`}`;
// Text styles
styles +=
`${this._terminalSelector} span:not(.${RowCss.BOLD_CLASS}) {` +
` font-weight: ${this._optionsService.rawOptions.fontWeight};` +
`}` +
`${this._terminalSelector} span.${RowCss.BOLD_CLASS} {` +
` font-weight: ${this._optionsService.rawOptions.fontWeightBold};` +
`}` +
`${this._terminalSelector} span.${RowCss.ITALIC_CLASS} {` +
` font-style: italic;` +
`}`;
// Blink animation
const blinkAnimationUnderlineId = `blink_underline_${this._terminalClass}`;
const blinkAnimationBarId = `blink_bar_${this._terminalClass}`;
const blinkAnimationBlockId = `blink_block_${this._terminalClass}`;
styles +=
`@keyframes ${blinkAnimationUnderlineId} {` +
` 50% {` +
` border-bottom-style: hidden;` +
` }` +
`}`;
styles +=
`@keyframes ${blinkAnimationBarId} {` +
` 50% {` +
` box-shadow: none;` +
` }` +
`}`;
styles +=
`@keyframes ${blinkAnimationBlockId} {` +
` 0% {` +
` background-color: ${colors.cursor.css};` +
` color: ${colors.cursorAccent.css};` +
` }` +
` 50% {` +
` background-color: inherit;` +
` color: ${colors.cursor.css};` +
` }` +
`}`;
// Cursor
styles +=
`${this._terminalSelector} .${ROW_CONTAINER_CLASS}.${FOCUS_CLASS} .${RowCss.CURSOR_CLASS}.${RowCss.CURSOR_BLINK_CLASS}.${RowCss.CURSOR_STYLE_UNDERLINE_CLASS} {` +
` animation: ${blinkAnimationUnderlineId} 1s step-end infinite;` +
`}` +
`${this._terminalSelector} .${ROW_CONTAINER_CLASS}.${FOCUS_CLASS} .${RowCss.CURSOR_CLASS}.${RowCss.CURSOR_BLINK_CLASS}.${RowCss.CURSOR_STYLE_BAR_CLASS} {` +
` animation: ${blinkAnimationBarId} 1s step-end infinite;` +
`}` +
`${this._terminalSelector} .${ROW_CONTAINER_CLASS}.${FOCUS_CLASS} .${RowCss.CURSOR_CLASS}.${RowCss.CURSOR_BLINK_CLASS}.${RowCss.CURSOR_STYLE_BLOCK_CLASS} {` +
` animation: ${blinkAnimationBlockId} 1s step-end infinite;` +
`}` +
// !important helps fix an issue where the cursor will not render on top of the selection,
// however it's very hard to fix this issue and retain the blink animation without the use of
// !important. So this edge case fails when cursor blink is on.
`${this._terminalSelector} .${ROW_CONTAINER_CLASS} .${RowCss.CURSOR_CLASS}.${RowCss.CURSOR_STYLE_BLOCK_CLASS} {` +
` background-color: ${colors.cursor.css};` +
` color: ${colors.cursorAccent.css};` +
`}` +
`${this._terminalSelector} .${ROW_CONTAINER_CLASS} .${RowCss.CURSOR_CLASS}.${RowCss.CURSOR_STYLE_BLOCK_CLASS}:not(.${RowCss.CURSOR_BLINK_CLASS}) {` +
` background-color: ${colors.cursor.css} !important;` +
` color: ${colors.cursorAccent.css} !important;` +
`}` +
`${this._terminalSelector} .${ROW_CONTAINER_CLASS} .${RowCss.CURSOR_CLASS}.${RowCss.CURSOR_STYLE_OUTLINE_CLASS} {` +
` outline: 1px solid ${colors.cursor.css};` +
` outline-offset: -1px;` +
`}` +
`${this._terminalSelector} .${ROW_CONTAINER_CLASS} .${RowCss.CURSOR_CLASS}.${RowCss.CURSOR_STYLE_BAR_CLASS} {` +
` box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${colors.cursor.css} inset;` +
`}` +
`${this._terminalSelector} .${ROW_CONTAINER_CLASS} .${RowCss.CURSOR_CLASS}.${RowCss.CURSOR_STYLE_UNDERLINE_CLASS} {` +
` border-bottom: 1px ${colors.cursor.css};` +
` border-bottom-style: solid;` +
` height: calc(100% - 1px);` +
`}`;
// Selection
styles +=
`${this._terminalSelector} .${SELECTION_CLASS} {` +
` position: absolute;` +
` top: 0;` +
` left: 0;` +
` z-index: 1;` +
` pointer-events: none;` +
`}` +
`${this._terminalSelector}.focus .${SELECTION_CLASS} div {` +
` position: absolute;` +
` background-color: ${colors.selectionBackgroundOpaque.css};` +
`}` +
`${this._terminalSelector} .${SELECTION_CLASS} div {` +
` position: absolute;` +
` background-color: ${colors.selectionInactiveBackgroundOpaque.css};` +
`}`;
// Colors
for (const [i, c] of colors.ansi.entries()) {
styles +=
`${this._terminalSelector} .${FG_CLASS_PREFIX}${i} { color: ${c.css}; }` +
`${this._terminalSelector} .${FG_CLASS_PREFIX}${i}.${RowCss.DIM_CLASS} { color: ${color.multiplyOpacity(c, 0.5).css}; }` +
`${this._terminalSelector} .${BG_CLASS_PREFIX}${i} { background-color: ${c.css}; }`;
}
styles +=
`${this._terminalSelector} .${FG_CLASS_PREFIX}${INVERTED_DEFAULT_COLOR} { color: ${color.opaque(colors.background).css}; }` +
`${this._terminalSelector} .${FG_CLASS_PREFIX}${INVERTED_DEFAULT_COLOR}.${RowCss.DIM_CLASS} { color: ${color.multiplyOpacity(color.opaque(colors.background), 0.5).css}; }` +
`${this._terminalSelector} .${BG_CLASS_PREFIX}${INVERTED_DEFAULT_COLOR} { background-color: ${colors.foreground.css}; }`;
this._themeStyleElement.textContent = styles;
}
/**
* default letter spacing
* Due to rounding issues in dimensions dpr calc glyph might render
* slightly too wide or too narrow. The method corrects the stacking offsets
* by applying a default letter-spacing for all chars.
* The value gets passed to the row factory to avoid setting this value again
* (render speedup is roughly 10%).
*/
private _setDefaultSpacing(): void {
// measure same char as in CharSizeService to get the base deviation
const spacing = this.dimensions.css.cell.width - this._widthCache.get('W', false, false);
this._rowContainer.style.letterSpacing = `${spacing}px`;
this._rowFactory.defaultSpacing = spacing;
}
public handleDevicePixelRatioChange(): void {
this._updateDimensions();
this._widthCache.clear();
this._setDefaultSpacing();
}
private _refreshRowElements(cols: number, rows: number): void {
// Add missing elements
for (let i = this._rowElements.length; i <= rows; i++) {
const row = this._document.createElement('div');
this._rowContainer.appendChild(row);
this._rowElements.push(row);
}
// Remove excess elements
while (this._rowElements.length > rows) {
this._rowContainer.removeChild(this._rowElements.pop()!);
}
}
public handleResize(cols: number, rows: number): void {
this._refreshRowElements(cols, rows);
this._updateDimensions();
this.handleSelectionChanged(this._selectionRenderModel.selectionStart, this._selectionRenderModel.selectionEnd, this._selectionRenderModel.columnSelectMode);
}
public handleCharSizeChanged(): void {
this._updateDimensions();
this._widthCache.clear();
this._setDefaultSpacing();
}
public handleBlur(): void {
this._rowContainer.classList.remove(FOCUS_CLASS);
this.renderRows(0, this._bufferService.rows - 1);
}
public handleFocus(): void {
this._rowContainer.classList.add(FOCUS_CLASS);
this.renderRows(this._bufferService.buffer.y, this._bufferService.buffer.y);
}
public handleSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {
// Remove all selections
this._selectionContainer.replaceChildren();
this._rowFactory.handleSelectionChanged(start, end, columnSelectMode);
this.renderRows(0, this._bufferService.rows - 1);
// Selection does not exist
if (!start || !end) {
return;
}
this._selectionRenderModel.update(this._terminal, start, end, columnSelectMode);
// Translate from buffer position to viewport position
const viewportStartRow = this._selectionRenderModel.viewportStartRow;
const viewportEndRow = this._selectionRenderModel.viewportEndRow;
const viewportCappedStartRow = this._selectionRenderModel.viewportCappedStartRow;
const viewportCappedEndRow = this._selectionRenderModel.viewportCappedEndRow;
// No need to draw the selection
if (viewportCappedStartRow >= this._bufferService.rows || viewportCappedEndRow < 0) {
return;
}
// Create the selections
const documentFragment = this._document.createDocumentFragment();
if (columnSelectMode) {
const isXFlipped = start[0] > end[0];
documentFragment.appendChild(
this._createSelectionElement(viewportCappedStartRow, isXFlipped ? end[0] : start[0], isXFlipped ? start[0] : end[0], viewportCappedEndRow - viewportCappedStartRow + 1)
);
} else {
// Draw first row
const startCol = viewportStartRow === viewportCappedStartRow ? start[0] : 0;
const endCol = viewportCappedStartRow === viewportEndRow ? end[0] : this._bufferService.cols;
documentFragment.appendChild(this._createSelectionElement(viewportCappedStartRow, startCol, endCol));
// Draw middle rows
const middleRowsCount = viewportCappedEndRow - viewportCappedStartRow - 1;
documentFragment.appendChild(this._createSelectionElement(viewportCappedStartRow + 1, 0, this._bufferService.cols, middleRowsCount));
// Draw final row
if (viewportCappedStartRow !== viewportCappedEndRow) {
// Only draw viewportEndRow if it's not the same as viewporttartRow
const endCol = viewportEndRow === viewportCappedEndRow ? end[0] : this._bufferService.cols;
documentFragment.appendChild(this._createSelectionElement(viewportCappedEndRow, 0, endCol));
}
}
this._selectionContainer.appendChild(documentFragment);
}
/**
* Creates a selection element at the specified position.
* @param row The row of the selection.
* @param colStart The start column.
* @param colEnd The end columns.
*/
private _createSelectionElement(row: number, colStart: number, colEnd: number, rowCount: number = 1): HTMLElement {
const element = this._document.createElement('div');
const left = colStart * this.dimensions.css.cell.width;
let width = this.dimensions.css.cell.width * (colEnd - colStart);
if (left + width > this.dimensions.css.canvas.width) {
width = this.dimensions.css.canvas.width - left;
}
element.style.height = `${rowCount * this.dimensions.css.cell.height}px`;
element.style.top = `${row * this.dimensions.css.cell.height}px`;
element.style.left = `${left}px`;
element.style.width = `${width}px`;
return element;
}
public handleCursorMove(): void {
// No-op, the cursor is drawn when rows are drawn
}
private _handleOptionsChanged(): void {
// Force a refresh
this._updateDimensions();
// Refresh CSS
this._injectCss(this._themeService.colors);
// update spacing cache
this._widthCache.setFont(
this._optionsService.rawOptions.fontFamily,
this._optionsService.rawOptions.fontSize,
this._optionsService.rawOptions.fontWeight,
this._optionsService.rawOptions.fontWeightBold
);
this._setDefaultSpacing();
}
public clear(): void {
for (const e of this._rowElements) {
/**
* NOTE: This used to be `e.innerText = '';` but that doesn't work when using `jsdom` and
* `@testing-library/react`
*
* references:
* - https://github.com/testing-library/react-testing-library/issues/1146
* - https://github.com/jsdom/jsdom/issues/1245
*/
e.replaceChildren();
}
}
public renderRows(start: number, end: number): void {
const buffer = this._bufferService.buffer;
const cursorAbsoluteY = buffer.ybase + buffer.y;
const cursorX = Math.min(buffer.x, this._bufferService.cols - 1);
const cursorBlink = this._optionsService.rawOptions.cursorBlink;
const cursorStyle = this._optionsService.rawOptions.cursorStyle;
const cursorInactiveStyle = this._optionsService.rawOptions.cursorInactiveStyle;
for (let y = start; y <= end; y++) {
const row = y + buffer.ydisp;
const rowElement = this._rowElements[y];
const lineData = buffer.lines.get(row);
if (!rowElement || !lineData) {
break;
}
rowElement.replaceChildren(
...this._rowFactory.createRow(
lineData,
row,
row === cursorAbsoluteY,
cursorStyle,
cursorInactiveStyle,
cursorX,
cursorBlink,
this.dimensions.css.cell.width,
this._widthCache,
-1,
-1
)
);
}
}
private get _terminalSelector(): string {
return `.${TERMINAL_CLASS_PREFIX}${this._terminalClass}`;
}
private _handleLinkHover(e: ILinkifierEvent): void {
this._setCellUnderline(e.x1, e.x2, e.y1, e.y2, e.cols, true);
}
private _handleLinkLeave(e: ILinkifierEvent): void {
this._setCellUnderline(e.x1, e.x2, e.y1, e.y2, e.cols, false);
}
private _setCellUnderline(x: number, x2: number, y: number, y2: number, cols: number, enabled: boolean): void {
/**
* NOTE: The linkifier may send out of viewport y-values if:
* - negative y-value: the link started at a higher line
* - y-value >= maxY: the link ends at a line below viewport
*
* For negative y-values we can simply adjust x = 0,
* as higher up link start means, that everything from
* (0,0) is a link under top-down-left-right char progression
*
* Additionally there might be a small chance of out-of-sync x|y-values
* from a race condition of render updates vs. link event handler execution:
* - (sync) resize: chances terminal buffer in sync, schedules render update async
* - (async) link handler race condition: new buffer metrics, but still on old render state
* - (async) render update: brings term metrics and render state back in sync
*/
// clip coords into viewport
if (y < 0) x = 0;
if (y2 < 0) x2 = 0;
const maxY = this._bufferService.rows - 1;
y = Math.max(Math.min(y, maxY), 0);
y2 = Math.max(Math.min(y2, maxY), 0);
cols = Math.min(cols, this._bufferService.cols);
const buffer = this._bufferService.buffer;
const cursorAbsoluteY = buffer.ybase + buffer.y;
const cursorX = Math.min(buffer.x, cols - 1);
const cursorBlink = this._optionsService.rawOptions.cursorBlink;
const cursorStyle = this._optionsService.rawOptions.cursorStyle;
const cursorInactiveStyle = this._optionsService.rawOptions.cursorInactiveStyle;
// refresh rows within link range
for (let i = y; i <= y2; ++i) {
const row = i + buffer.ydisp;
const rowElement = this._rowElements[i];
const bufferline = buffer.lines.get(row);
if (!rowElement || !bufferline) {
break;
}
rowElement.replaceChildren(
...this._rowFactory.createRow(
bufferline,
row,
row === cursorAbsoluteY,
cursorStyle,
cursorInactiveStyle,
cursorX,
cursorBlink,
this.dimensions.css.cell.width,
this._widthCache,
enabled ? (i === y ? x : 0) : -1,
enabled ? ((i === y2 ? x2 : cols) - 1) : -1
)
);
}
}
}
@@ -0,0 +1 @@
{"name":"@codemirror/search","version":"6.5.11","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532110732,"integrity":"sha512-93AnA94LXftw4iulmPgONmsxHTOmEXXVnuDgrubQugXHDb6+kqBYV3LU04W4nfNUBsUNOpHH1CYTncof2riVDg==","mode":420,"size":1118},"dist/index.cjs":{"checkedAt":1794532110732,"integrity":"sha512-ym4n2iHj1WJ9caA82JMfCsAaYLblBDoNAiqAjIrnAaD364TOcHUJCKFm6hvl8e/6tsza4U2/f4PRGmDNfOf9fQ==","mode":420,"size":49627},"dist/index.d.cts":{"checkedAt":1794532110732,"integrity":"sha512-rUBBG0wiFxI+Htt3Z95MqzlfDqIFbWfVnbokI43HZibKnXRw0ncK6yM+nZ/J3drscnQ6+t6o1Npvq5gjV4ExYg==","mode":420,"size":12304},"dist/index.js":{"checkedAt":1794532110733,"integrity":"sha512-RuzoaePjpYTwhZMBbkB9l8zOKXKuULVtqj2amoNzorW7HFZGIKDj2Xj/C26WeJIHpAG3/4QZSy6bbPnnt/++mA==","mode":420,"size":49034},"package.json":{"checkedAt":1794532110733,"integrity":"sha512-yUfFhs8rBatqqUwkAtAlTsfRBfqGBsf+oTKBC+85538cIw/4pNMGPlteE0MKA8gLnntwkM9WnXS78KX2i0Ftow==","mode":420,"size":917},"CHANGELOG.md":{"checkedAt":1794532110733,"integrity":"sha512-D2Olj5L8U2OpUMyxMk+m/4mLHrDrAbuKkKeHE53hCohGO2H8u7DUO4HyLNxRgpvDAMoUfzA49q4WUYkPtv1fKg==","mode":420,"size":8823},"README.md":{"checkedAt":1794532110733,"integrity":"sha512-v0r9rtgaJbpAe/gHRxV9OYsso+9vCRkDmtUiMUk9ZqPByucSoV/oaMnP0UsejW7F05+y8OwFDcnBPtsIHbGcBA==","mode":420,"size":1014},"dist/index.d.ts":{"checkedAt":1794532110732,"integrity":"sha512-rUBBG0wiFxI+Htt3Z95MqzlfDqIFbWfVnbokI43HZibKnXRw0ncK6yM+nZ/J3drscnQ6+t6o1Npvq5gjV4ExYg==","mode":420,"size":12304},".github/workflows/dispatch.yml":{"checkedAt":1794532110733,"integrity":"sha512-m1oo9FDcj8HyBMn9j8PAdgJGReOxejwknSt0WhQByhphBMTHHlS1n9+UPCgcv631fi+EwCNIv0+z6VZAl52zag==","mode":420,"size":415}}}
@@ -0,0 +1,555 @@
// Type definitions for postcss-selector-parser 2.2.3
// Definitions by: Chris Eppstein <chris@eppsteins.net>
/*~ Note that ES6 modules cannot directly export callable functions.
*~ This file should be imported using the CommonJS-style:
*~ import x = require('someLibrary');
*~
*~ Refer to the documentation to understand common
*~ workarounds for this limitation of ES6 modules.
*/
/*~ This declaration specifies that the function
*~ is the exported object from the file
*/
export = parser;
// A type that's T but not U.
type Diff<T, U> = T extends U ? never : T;
// TODO: Conditional types in TS 1.8 will really clean this up.
declare function parser(): parser.Processor<never>;
declare function parser<Transform>(processor: parser.AsyncProcessor<Transform>): parser.Processor<Transform, never>;
declare function parser(processor: parser.AsyncProcessor<void>): parser.Processor<never, never>;
declare function parser<Transform>(processor: parser.SyncProcessor<Transform>): parser.Processor<Transform>;
declare function parser(processor: parser.SyncProcessor<void>): parser.Processor<never>;
declare function parser<Transform>(processor?: parser.SyncProcessor<Transform> | parser.AsyncProcessor<Transform>): parser.Processor<Transform>;
/*~ If you want to expose types from your module as well, you can
*~ place them in this block. Often you will want to describe the
*~ shape of the return type of the function; that type should
*~ be declared in here, as this example shows.
*/
declare namespace parser {
/* copied from postcss -- so we don't need to add a dependency */
type ErrorOptions = {
plugin?: string;
word?: string;
index?: number
};
/* the bits we use of postcss.Rule, copied from postcss -- so we don't need to add a dependency */
type PostCSSRuleNode = {
selector: string
/**
* @returns postcss.CssSyntaxError but it's a complex object, caller
* should cast to it if they have a dependency on postcss.
*/
error(message: string, options?: ErrorOptions): Error;
};
/** Accepts a string */
type Selectors = string | PostCSSRuleNode
type ProcessorFn<ReturnType = void> = (root: parser.Root) => ReturnType;
type SyncProcessor<Transform = void> = ProcessorFn<Transform>;
type AsyncProcessor<Transform = void> = ProcessorFn<PromiseLike<Transform>>;
const TAG: "tag";
const STRING: "string";
const SELECTOR: "selector";
const ROOT: "root";
const PSEUDO: "pseudo";
const NESTING: "nesting";
const ID: "id";
const COMMENT: "comment";
const COMBINATOR: "combinator";
const CLASS: "class";
const ATTRIBUTE: "attribute";
const UNIVERSAL: "universal";
interface NodeTypes {
tag: Tag,
string: String,
selector: Selector,
root: Root,
pseudo: Pseudo,
nesting: Nesting,
id: Identifier,
comment: Comment,
combinator: Combinator,
class: ClassName,
attribute: Attribute,
universal: Universal
}
type Node = NodeTypes[keyof NodeTypes];
function isNode(node: any): node is Node;
interface Options {
/**
* Preserve whitespace when true. Default: false;
*/
lossless: boolean;
/**
* When true and a postcss.Rule is passed, set the result of
* processing back onto the rule when done. Default: false.
*/
updateSelector: boolean;
}
class Processor<
TransformType = never,
SyncSelectorsType extends Selectors | never = Selectors
> {
res: Root;
readonly result: String;
ast(selectors: Selectors, options?: Partial<Options>): Promise<Root>;
astSync(selectors: SyncSelectorsType, options?: Partial<Options>): Root;
transform(selectors: Selectors, options?: Partial<Options>): Promise<TransformType>;
transformSync(selectors: SyncSelectorsType, options?: Partial<Options>): TransformType;
process(selectors: Selectors, options?: Partial<Options>): Promise<string>;
processSync(selectors: SyncSelectorsType, options?: Partial<Options>): string;
}
interface ParserOptions {
css: string;
error: (message: string, options: ErrorOptions) => Error;
options: Options;
}
class Parser {
input: ParserOptions;
lossy: boolean;
position: number;
root: Root;
selectors: string;
current: Selector;
constructor(input: ParserOptions);
/**
* Raises an error, if the processor is invoked on
* a postcss Rule node, a better error message is raised.
*/
error(message: string, options?: ErrorOptions): void;
}
interface NodeSource {
start?: {
line: number,
column: number
},
end?: {
line: number,
column: number
}
}
interface SpaceAround {
before: string;
after: string;
}
interface Spaces extends SpaceAround {
[spaceType: string]: string | Partial<SpaceAround> | undefined;
}
interface NodeOptions<Value = string> {
value: Value;
spaces?: Partial<Spaces>;
source?: NodeSource;
sourceIndex?: number;
}
interface Base<
Value extends string | undefined = string,
ParentType extends Container | undefined = Container | undefined
> {
type: keyof NodeTypes;
parent: ParentType;
value: Value;
spaces: Spaces;
source?: NodeSource;
sourceIndex: number;
rawSpaceBefore: string;
rawSpaceAfter: string;
remove(): Node;
replaceWith(...nodes: Node[]): Node;
next(): Node | undefined;
prev(): Node | undefined;
clone(opts?: {[override: string]:any}): this;
/**
* Return whether this node includes the character at the position of the given line and column.
* Returns undefined if the nodes lack sufficient source metadata to determine the position.
* @param line 1-index based line number relative to the start of the selector.
* @param column 1-index based column number relative to the start of the selector.
*/
isAtPosition(line: number, column: number): boolean | undefined;
/**
* Some non-standard syntax doesn't follow normal escaping rules for css,
* this allows the escaped value to be specified directly, allowing illegal characters to be
* directly inserted into css output.
* @param name the property to set
* @param value the unescaped value of the property
* @param valueEscaped optional. the escaped value of the property.
*/
setPropertyAndEscape(name: string, value: any, valueEscaped: string): void;
/**
* When you want a value to passed through to CSS directly. This method
* deletes the corresponding raw value causing the stringifier to fallback
* to the unescaped value.
* @param name the property to set.
* @param value The value that is both escaped and unescaped.
*/
setPropertyWithoutEscape(name: string, value: any): void;
/**
* Some non-standard syntax doesn't follow normal escaping rules for css.
* This allows non standard syntax to be appended to an existing property
* by specifying the escaped value. By specifying the escaped value,
* illegal characters are allowed to be directly inserted into css output.
* @param {string} name the property to set
* @param {any} value the unescaped value of the property
* @param {string} valueEscaped optional. the escaped value of the property.
*/
appendToPropertyAndEscape(name: string, value: any, valueEscaped: string): void;
toString(): string;
}
interface ContainerOptions extends NodeOptions {
nodes?: Array<Node>;
}
interface Container<
Value extends string | undefined = string,
Child extends Node = Node
> extends Base<Value> {
nodes: Array<Child>;
append(selector: Child): this;
prepend(selector: Child): this;
at(index: number): Child;
/**
* Return the most specific node at the line and column number given.
* The source location is based on the original parsed location, locations aren't
* updated as selector nodes are mutated.
*
* Note that this location is relative to the location of the first character
* of the selector, and not the location of the selector in the overall document
* when used in conjunction with postcss.
*
* If not found, returns undefined.
* @param line The line number of the node to find. (1-based index)
* @param col The column number of the node to find. (1-based index)
*/
atPosition(line: number, column: number): Child;
index(child: Child): number;
readonly first: Child;
readonly last: Child;
readonly length: number;
removeChild(child: Child): this;
removeAll(): this;
empty(): this;
insertAfter(oldNode: Child, newNode: Child): this;
insertBefore(oldNode: Child, newNode: Child): this;
each(callback: (node: Child, index: number) => boolean | void): boolean | undefined;
walk(
callback: (node: Node, index: number) => boolean | void
): boolean | undefined;
walkAttributes(
callback: (node: Attribute) => boolean | void
): boolean | undefined;
walkClasses(
callback: (node: ClassName) => boolean | void
): boolean | undefined;
walkCombinators(
callback: (node: Combinator) => boolean | void
): boolean | undefined;
walkComments(
callback: (node: Comment) => boolean | void
): boolean | undefined;
walkIds(
callback: (node: Identifier) => boolean | void
): boolean | undefined;
walkNesting(
callback: (node: Nesting) => boolean | void
): boolean | undefined;
walkPseudos(
callback: (node: Pseudo) => boolean | void
): boolean | undefined;
walkTags(callback: (node: Tag) => boolean | void): boolean | undefined;
split(callback: (node: Child) => boolean): [Child[], Child[]];
map<T>(callback: (node: Child) => T): T[];
reduce(
callback: (
previousValue: Child,
currentValue: Child,
currentIndex: number,
array: readonly Child[]
) => Child
): Child;
reduce(
callback: (
previousValue: Child,
currentValue: Child,
currentIndex: number,
array: readonly Child[]
) => Child,
initialValue: Child
): Child;
reduce<T>(
callback: (
previousValue: T,
currentValue: Child,
currentIndex: number,
array: readonly Child[]
) => T,
initialValue: T
): T;
every(callback: (node: Child) => boolean): boolean;
some(callback: (node: Child) => boolean): boolean;
filter(callback: (node: Child) => boolean): Child[];
sort(callback: (nodeA: Child, nodeB: Child) => number): Child[];
toString(): string;
}
function isContainer(node: any): node is Root | Selector | Pseudo;
interface NamespaceOptions<Value extends string | undefined = string> extends NodeOptions<Value> {
namespace?: string | true;
}
interface Namespace<Value extends string | undefined = string> extends Base<Value> {
/** alias for namespace */
ns: string | true;
/**
* namespace prefix.
*/
namespace: string | true;
/**
* If a namespace exists, prefix the value provided with it, separated by |.
*/
qualifiedName(value: string): string;
/**
* A string representing the namespace suitable for output.
*/
readonly namespaceString: string;
}
function isNamespace(node: any): node is Attribute | Tag;
interface Root extends Container<undefined, Selector> {
type: "root";
/**
* Raises an error, if the processor is invoked on
* a postcss Rule node, a better error message is raised.
*/
error(message: string, options?: ErrorOptions): Error;
nodeAt(line: number, column: number): Node
}
function root(opts: ContainerOptions): Root;
function isRoot(node: any): node is Root;
interface _Selector<S> extends Container<string, Diff<Node, S>> {
type: "selector";
}
type Selector = _Selector<Selector>;
function selector(opts: ContainerOptions): Selector;
function isSelector(node: any): node is Selector;
interface CombinatorRaws {
value?: string;
spaces?: {
before?: string;
after?: string;
};
}
interface Combinator extends Base {
type: "combinator";
raws?: CombinatorRaws;
}
function combinator(opts: NodeOptions): Combinator;
function isCombinator(node: any): node is Combinator;
interface ClassName extends Base {
type: "class";
}
function className(opts: NamespaceOptions): ClassName;
function isClassName(node: any): node is ClassName;
type AttributeOperator = "=" | "~=" | "|=" | "^=" | "$=" | "*=";
type QuoteMark = '"' | "'" | null;
interface PreferredQuoteMarkOptions {
quoteMark?: QuoteMark;
preferCurrentQuoteMark?: boolean;
}
interface SmartQuoteMarkOptions extends PreferredQuoteMarkOptions {
smart?: boolean;
}
interface AttributeOptions extends NamespaceOptions<string | undefined> {
attribute: string;
operator?: AttributeOperator;
insensitive?: boolean;
quoteMark?: QuoteMark;
/** @deprecated Use quoteMark instead. */
quoted?: boolean;
spaces?: {
before?: string;
after?: string;
attribute?: Partial<SpaceAround>;
operator?: Partial<SpaceAround>;
value?: Partial<SpaceAround>;
insensitive?: Partial<SpaceAround>;
}
raws: {
unquoted?: string;
attribute?: string;
operator?: string;
value?: string;
insensitive?: string;
spaces?: {
attribute?: Partial<Spaces>;
operator?: Partial<Spaces>;
value?: Partial<Spaces>;
insensitive?: Partial<Spaces>;
}
};
}
interface Attribute extends Namespace<string | undefined> {
type: "attribute";
attribute: string;
operator?: AttributeOperator;
insensitive?: boolean;
quoteMark: QuoteMark;
quoted?: boolean;
spaces: {
before: string;
after: string;
attribute?: Partial<Spaces>;
operator?: Partial<Spaces>;
value?: Partial<Spaces>;
insensitive?: Partial<Spaces>;
}
raws: {
/** @deprecated The attribute value is unquoted, use that instead.. */
unquoted?: string;
attribute?: string;
operator?: string;
/** The value of the attribute with quotes and escapes. */
value?: string;
insensitive?: string;
spaces?: {
attribute?: Partial<Spaces>;
operator?: Partial<Spaces>;
value?: Partial<Spaces>;
insensitive?: Partial<Spaces>;
}
};
/**
* The attribute name after having been qualified with a namespace.
*/
readonly qualifiedAttribute: string;
/**
* The case insensitivity flag or an empty string depending on whether this
* attribute is case insensitive.
*/
readonly insensitiveFlag : 'i' | '';
/**
* Returns the attribute's value quoted such that it would be legal to use
* in the value of a css file. The original value's quotation setting
* used for stringification is left unchanged. See `setValue(value, options)`
* if you want to control the quote settings of a new value for the attribute or
* `set quoteMark(mark)` if you want to change the quote settings of the current
* value.
*
* You can also change the quotation used for the current value by setting quoteMark.
**/
getQuotedValue(options?: SmartQuoteMarkOptions): string;
/**
* Set the unescaped value with the specified quotation options. The value
* provided must not include any wrapping quote marks -- those quotes will
* be interpreted as part of the value and escaped accordingly.
* @param value
*/
setValue(value: string, options?: SmartQuoteMarkOptions): void;
/**
* Intelligently select a quoteMark value based on the value's contents. If
* the value is a legal CSS ident, it will not be quoted. Otherwise a quote
* mark will be picked that minimizes the number of escapes.
*
* If there's no clear winner, the quote mark from these options is used,
* then the source quote mark (this is inverted if `preferCurrentQuoteMark` is
* true). If the quoteMark is unspecified, a double quote is used.
**/
smartQuoteMark(options: PreferredQuoteMarkOptions): QuoteMark;
/**
* Selects the preferred quote mark based on the options and the current quote mark value.
* If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)`
* instead.
*/
preferredQuoteMark(options: PreferredQuoteMarkOptions): QuoteMark
/**
* returns the offset of the attribute part specified relative to the
* start of the node of the output string.
*
* * "ns" - alias for "namespace"
* * "namespace" - the namespace if it exists.
* * "attribute" - the attribute name
* * "attributeNS" - the start of the attribute or its namespace
* * "operator" - the match operator of the attribute
* * "value" - The value (string or identifier)
* * "insensitive" - the case insensitivity flag;
* @param part One of the possible values inside an attribute.
* @returns -1 if the name is invalid or the value doesn't exist in this attribute.
*/
offsetOf(part: "ns" | "namespace" | "attribute" | "attributeNS" | "operator" | "value" | "insensitive"): number;
}
function attribute(opts: AttributeOptions): Attribute;
function isAttribute(node: any): node is Attribute;
interface Pseudo extends Container<string, Selector> {
type: "pseudo";
}
function pseudo(opts: ContainerOptions): Pseudo;
/**
* Checks whether the node is the Pseudo subtype of node.
*/
function isPseudo(node: any): node is Pseudo;
/**
* Checks whether the node is, specifically, a pseudo element instead of
* pseudo class.
*/
function isPseudoElement(node: any): node is Pseudo;
/**
* Checks whether the node is, specifically, a pseudo class instead of
* pseudo element.
*/
function isPseudoClass(node: any): node is Pseudo;
interface Tag extends Namespace {
type: "tag";
}
function tag(opts: NamespaceOptions): Tag;
function isTag(node: any): node is Tag;
interface Comment extends Base {
type: "comment";
}
function comment(opts: NodeOptions): Comment;
function isComment(node: any): node is Comment;
interface Identifier extends Base {
type: "id";
}
function id(opts: any): Identifier;
function isIdentifier(node: any): node is Identifier;
interface Nesting extends Base {
type: "nesting";
}
function nesting(opts?: any): Nesting;
function isNesting(node: any): node is Nesting;
interface String extends Base {
type: "string";
}
function string(opts: NodeOptions): String;
function isString(node: any): node is String;
interface Universal extends Base {
type: "universal";
}
function universal(opts?: NamespaceOptions): Universal;
function isUniversal(node: any): node is Universal;
}
@@ -0,0 +1 @@
{"version":3,"file":"lifecycleMethods.d.ts","sourceRoot":"","sources":["lifecycleMethods.js"],"names":[],"mappings":""}
@@ -0,0 +1 @@
{"name":"esrecurse","version":"4.3.0","requiresBuild":false,"files":{".babelrc":{"checkedAt":1794532094279,"integrity":"sha512-d8UlecYZSwJ676aj97lw/LWqdKl+fjNtjVLeQSp9v9fK8dMJGDzb6uEUU4AlfJuB4EN4/7keo58xmRnd07zHRA==","mode":420,"size":30},"esrecurse.js":{"checkedAt":1794532094279,"integrity":"sha512-nnG/Cn30O2dqg4Utoub8y/U1ZPmWSp5U9hQkvVR3BodFWwcH+BF0fmbMdj/Za82VOjlyj9b8gB3gq5V8rftFYg==","mode":420,"size":4230},"gulpfile.babel.js":{"checkedAt":1794532094279,"integrity":"sha512-jEV04bitNLA3ZaOMxnEvw+AYExV56hGgrptuKQUgUNV9I+vO4tB2AF0zkgwcQoD4HuqaWEAXb/f4MNwwFayO9g==","mode":420,"size":3000},"package.json":{"checkedAt":1794532094279,"integrity":"sha512-AFnoWbV4NQpPMVyk4qdx3WBRC40L4kGb9bhAVEXHBO2Kpmkzi9oDhow665cgxMROiSVvr9emg5kgLy799ALqzw==","mode":493,"size":1165},"README.md":{"checkedAt":1794532094279,"integrity":"sha512-o8IUunf49hUHLW9D3RLrC9rlCI4nudxdWU4oNNQAvWeyirdZbCcN1Jldu3VNJSbi45S1ZaRhVv4ptDgmCsYmYA==","mode":420,"size":5102}}}
@@ -0,0 +1,8 @@
'use strict';
var Type = require('../type');
module.exports = new Type('tag:yaml.org,2002:str', {
kind: 'scalar',
construct: function (data) { return data !== null ? data : ''; }
});
@@ -0,0 +1,54 @@
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "Layout", () => $ac14d65a0ec196dd$export$c84671f46d6a1ca);
/*
* 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.
*/ class $ac14d65a0ec196dd$export$c84671f46d6a1ca {
/**
* Returns whether the layout should invalidate in response to
* visible rectangle changes. By default, it only invalidates
* when the virtualizer's size changes. Return true always
* to make the layout invalidate while scrolling (e.g. sticky headers).
*/ shouldInvalidate(newRect, oldRect) {
// By default, invalidate when the size changes
return newRect.width !== oldRect.width || newRect.height !== oldRect.height;
}
/**
* Returns whether the layout should invalidate when the layout options change.
* By default it invalidates when the object identity changes. Override this
* method to optimize layout updates based on specific option changes.
*/ shouldInvalidateLayoutOptions(newOptions, oldOptions) {
return newOptions !== oldOptions;
}
/**
* This method allows the layout to perform any pre-computation
* it needs to in order to prepare LayoutInfos for retrieval.
* Called by the virtualizer before `getVisibleLayoutInfos`
* or `getLayoutInfo` are called.
*/ update(invalidationContext) {}
/** @private */ getItemRect(key) {
var _this_getLayoutInfo;
var _this_getLayoutInfo_rect;
return (_this_getLayoutInfo_rect = (_this_getLayoutInfo = this.getLayoutInfo(key)) === null || _this_getLayoutInfo === void 0 ? void 0 : _this_getLayoutInfo.rect) !== null && _this_getLayoutInfo_rect !== void 0 ? _this_getLayoutInfo_rect : null;
}
/** @private */ getVisibleRect() {
return this.virtualizer.visibleRect;
}
constructor(){
/** The Virtualizer the layout is currently attached to. */ this.virtualizer = null;
}
}
//# sourceMappingURL=Layout.main.js.map
@@ -0,0 +1,16 @@
import { GeneralNames } from "../general_names";
import { GeneralName } from "../general_name";
/**
* ```asn1
* id-ce-issuerAltName OBJECT IDENTIFIER ::= { id-ce 18 }
* ```
*/
export declare const id_ce_issuerAltName = "2.5.29.18";
/**
* ```asn1
* IssuerAltName ::= GeneralNames
* ```
*/
export declare class IssueAlternativeName extends GeneralNames {
constructor(items?: GeneralName[]);
}
@@ -0,0 +1,8 @@
import type { TSESTree } from '@typescript-eslint/types';
import type { ScopeManager } from '../ScopeManager';
import type { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
export declare class FunctionTypeScope extends ScopeBase<ScopeType.functionType, TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSFunctionType | TSESTree.TSMethodSignature, Scope> {
constructor(scopeManager: ScopeManager, upperScope: FunctionTypeScope['upper'], block: FunctionTypeScope['block']);
}
@@ -0,0 +1,17 @@
// @flow
// Pulled from react-compat
// https://github.com/developit/preact-compat/blob/7c5de00e7c85e2ffd011bf3af02899b63f699d3a/src/index.js#L349
export default function shallowDiffers(prev: Object, next: Object): boolean {
for (let attribute in prev) {
if (!(attribute in next)) {
return true;
}
}
for (let attribute in next) {
if (prev[attribute] !== next[attribute]) {
return true;
}
}
return false;
}
@@ -0,0 +1,23 @@
import {isScrollable as $cc38e7bd3fc7b213$export$2bb74740c4e19def} from "./isScrollable.mjs";
/*
* 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 $62d8ded9296f3872$export$cfa2225e87938781(node, checkForOverflow) {
let scrollableNode = node;
if ((0, $cc38e7bd3fc7b213$export$2bb74740c4e19def)(scrollableNode, checkForOverflow)) scrollableNode = scrollableNode.parentElement;
while(scrollableNode && !(0, $cc38e7bd3fc7b213$export$2bb74740c4e19def)(scrollableNode, checkForOverflow))scrollableNode = scrollableNode.parentElement;
return scrollableNode || document.scrollingElement || document.documentElement;
}
export {$62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent};
//# sourceMappingURL=getScrollParent.module.js.map
@@ -0,0 +1,3 @@
'use strict';
module.exports = require('es-object-atoms/RequireObjectCoercible');
@@ -0,0 +1,21 @@
'use strict';
var $TypeError = require('es-errors/type');
var ToInt32 = require('../ToInt32');
var ToUint32 = require('../ToUint32');
// https://262.ecma-international.org/11.0/#sec-numeric-types-number-unsignedRightShift
module.exports = function NumberUnsignedRightShift(x, y) {
if (typeof x !== 'number' || typeof y !== 'number') {
throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers');
}
var lnum = ToInt32(x);
var rnum = ToUint32(y);
var shiftCount = rnum & 0x1F;
return lnum >>> shiftCount;
};
@@ -0,0 +1,81 @@
# Tiny CBOR
[![](https://img.shields.io/github/actions/workflow/status/levischuck/tiny-cbor/build.yaml?branch=main&style=flat-square)](https://github.com/LeviSchuck/tiny-cbor/actions)
[![](https://img.shields.io/codecov/c/gh/levischuck/tiny-cbor?style=flat-square)](https://codecov.io/gh/levischuck/tiny-cbor)
[![](https://img.shields.io/github/v/tag/levischuck/tiny-cbor?label=npm&logo=npm&style=flat-square)](https://www.npmjs.com/package/@levischuck/tiny-cbor)
[![](https://img.shields.io/jsr/v/%40levischuck/tiny-cbor?style=flat-square&logo=jsr&label=JSR)](https://jsr.io/@levischuck/tiny-cbor)
[![](https://img.shields.io/github/license/levischuck/tiny-cbor?style=flat-square)](https://github.com/LeviSchuck/tiny-cbor/blob/main/LICENSE.txt)
![](https://img.shields.io/bundlephobia/min/%40levischuck/tiny-cbor?style=flat-square)
This minimal generic library decodes and encodes most useful CBOR structures
into simple JavaScript structures:
- Maps with keys as `string`s or `number`s with `CBORType` values as a `Map`
- Arrays of `CBORType` values
- integers as `number`s
- float32 and float64 as `number`s
- float16 `NaN`, `Infinity`, `-Infinity`
- `string`s
- byte strings as `Uint8Array`
- booleans
- `null` and `undefined`
- tags as `CBORTag(tag, value)`
## Limitations
This implementation does not support:
- indefinite length maps, arrays, text strings, or byte strings.
- half precision floating point numbers
- integers outside the range of `[-9007199254740991, 9007199254740991]`, see
[Number.MAX_SAFE_INTEGER](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)
- native output to JSON
- does not support generic objects, only `Map`s
This implementation has the following constraints:
- Map keys may only be strings or numbers
- Tags are not interpreted
## Behavior
Maps that have duplicate keys will throw an error during decoding. Decoding data
that is incomplete will throw an error during decoding.
## Example
```ts
// NPM
// import { decodeCBOR } from "@levischuck/tiny-cbor";
// or JSR
// import { decodeCBOR } from "jsr:@levischuck/tiny-cbor";
import { decodeCBOR } from "./index.ts";
// Get your bytes somehow, directly or with decodeBase64 / decodeHex (available through @levischuck/tiny-encodings)
const HELLO_WORLD_BYTES = new Uint8Array([
107, // String wih length 11
104, // h
101, // e
108, // l
108, // l
111, // o
32, // Space
119, // w
111, // o
114, // r
108, // l
100, // d
]);
const helloWorld = decodeCBOR(HELLO_WORLD_BYTES);
if ("hello world" == helloWorld) {
console.log("Success!");
}
```
## Where to get it
This library is available on
[NPM](https://www.npmjs.com/package/@levischuck/tiny-cbor) and
[JSR](https://jsr.io/@levischuck/tiny-cbor).
This library is no longer automatically published to Deno's Third Party Modules.
Newer versions may appear on deno.land/x, but do not work.
@@ -0,0 +1,200 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const scope_manager_1 = require("@typescript-eslint/scope-manager");
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
var AllowedType;
(function (AllowedType) {
AllowedType[AllowedType["Number"] = 0] = "Number";
AllowedType[AllowedType["String"] = 1] = "String";
AllowedType[AllowedType["Unknown"] = 2] = "Unknown";
})(AllowedType || (AllowedType = {}));
exports.default = (0, util_1.createRule)({
name: 'no-mixed-enums',
meta: {
type: 'problem',
docs: {
description: 'Disallow enums from having both number and string members',
recommended: 'strict',
requiresTypeChecking: true,
},
messages: {
mixed: `Mixing number and string enums can be confusing.`,
},
schema: [],
},
defaultOptions: [],
create(context) {
const parserServices = (0, util_1.getParserServices)(context);
const typeChecker = parserServices.program.getTypeChecker();
function collectNodeDefinitions(node) {
const { name } = node.id;
const found = {
imports: [],
previousSibling: undefined,
};
let scope = context.sourceCode.getScope(node);
for (const definition of scope.upper?.set.get(name)?.defs ?? []) {
if (definition.node.type === utils_1.AST_NODE_TYPES.TSEnumDeclaration &&
definition.node.range[0] < node.range[0] &&
definition.node.body.members.length > 0) {
found.previousSibling = definition.node;
break;
}
}
while (scope) {
scope.set.get(name)?.defs.forEach(definition => {
if (definition.type === scope_manager_1.DefinitionType.ImportBinding) {
found.imports.push(definition.node);
}
});
scope = scope.upper;
}
return found;
}
function getAllowedTypeForNode(node) {
return tsutils.isTypeFlagSet(typeChecker.getTypeAtLocation(node), ts.TypeFlags.StringLike)
? AllowedType.String
: AllowedType.Number;
}
function getTypeFromImported(imported) {
const type = typeChecker.getTypeAtLocation(parserServices.esTreeNodeToTSNodeMap.get(imported));
const valueDeclaration = type.getSymbol()?.valueDeclaration;
if (!valueDeclaration ||
!ts.isEnumDeclaration(valueDeclaration) ||
valueDeclaration.members.length === 0) {
return undefined;
}
return getAllowedTypeForNode(valueDeclaration.members[0]);
}
function getMemberType(member) {
if (!member.initializer) {
return AllowedType.Number;
}
switch (member.initializer.type) {
case utils_1.AST_NODE_TYPES.Literal:
switch (typeof member.initializer.value) {
case 'number':
return AllowedType.Number;
case 'string':
return AllowedType.String;
default:
return AllowedType.Unknown;
}
case utils_1.AST_NODE_TYPES.TemplateLiteral:
return AllowedType.String;
default:
return getAllowedTypeForNode(parserServices.esTreeNodeToTSNodeMap.get(member.initializer));
}
}
function getDesiredTypeForDefinition(node) {
const { imports, previousSibling } = collectNodeDefinitions(node);
// Case: Merged ambiently via module augmentation
// import { MyEnum } from 'other-module';
// declare module 'other-module' {
// enum MyEnum { A }
// }
for (const imported of imports) {
const typeFromImported = getTypeFromImported(imported);
if (typeFromImported != null) {
return typeFromImported;
}
}
// Case: Multiple enum declarations in the same file
// enum MyEnum { A }
// enum MyEnum { B }
if (previousSibling) {
return getMemberType(previousSibling.body.members[0]);
}
// Case: Namespace declaration merging
// namespace MyNamespace {
// export enum MyEnum { A }
// }
// namespace MyNamespace {
// export enum MyEnum { B }
// }
if (node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration &&
node.parent.parent.type === utils_1.AST_NODE_TYPES.TSModuleBlock) {
// https://github.com/typescript-eslint/typescript-eslint/issues/8352
// TODO: We don't need to dip into the TypeScript type checker here!
// Merged namespaces must all exist in the same file.
// We could instead compare this file's nodes to find the merges.
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.id);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const declarations = typeChecker
.getSymbolAtLocation(tsNode)
.getDeclarations();
const [{ initializer }] = declarations[0]
.members;
return initializer &&
tsutils.isTypeFlagSet(typeChecker.getTypeAtLocation(initializer), ts.TypeFlags.StringLike)
? AllowedType.String
: AllowedType.Number;
}
// Finally, we default to the type of the first enum member
return getMemberType(node.body.members[0]);
}
return {
TSEnumDeclaration(node) {
if (!node.body.members.length) {
return;
}
let desiredType = getDesiredTypeForDefinition(node);
if (desiredType === ts.TypeFlags.Unknown) {
return;
}
for (const member of node.body.members) {
const currentType = getMemberType(member);
if (currentType === AllowedType.Unknown) {
return;
}
if (currentType === AllowedType.Number) {
desiredType ??= currentType;
}
if (currentType !== desiredType) {
context.report({
node: member.initializer ?? member,
messageId: 'mixed',
});
return;
}
}
},
};
},
});
@@ -0,0 +1,30 @@
"use strict";
function _class_apply_descriptor_update(receiver, descriptor) {
if (descriptor.set) {
if (!descriptor.get) throw new TypeError("attempted to read set only private field");
if (!("__destrWrapper" in descriptor)) {
descriptor.__destrWrapper = {
set value(v) {
descriptor.set.call(receiver, v);
},
get value() {
return descriptor.get.call(receiver);
}
};
}
return descriptor.__destrWrapper;
} else {
if (!descriptor.writable) {
// This should only throw in strict mode, but class bodies are
// always strict and private fields can only be used inside
// class bodies.
throw new TypeError("attempted to set read only private field");
}
return descriptor;
}
}
exports._ = _class_apply_descriptor_update;
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F wC","33":"A B"},B:{"1":"0 1 2 3 4 5 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","33":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 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","33":"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 0C 1C"},D:{"1":"0 1 2 3 4 5 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","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"},E:{"33":"J ZB K D E F A B C L M G 2C ZC 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED"},F:{"1":"0 1 2 3 4 5 mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C 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"},G:{"33":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"2":"hD"},I:{"1":"I","33":"TC J iD jD kD lD vC mD nD"},J:{"33":"D A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"33":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB pD qD rD sD aC tD uD vD wD xD QC RC SC yD","33":"J oD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"2D","33":"1D"}},B:5,C:"CSS user-select: none",D:true};
@@ -0,0 +1,325 @@
/**
* @fileoverview enforce or disallow capitalization of the first letter of a comment
* @author Kevin Partington
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const DEFAULT_IGNORE_PATTERN = astUtils.COMMENTS_IGNORE_PATTERN,
WHITESPACE = /\s/gu,
MAYBE_URL = /^\s*[^:/?#\s]+:\/\/[^?#]/u, // TODO: Combine w/ max-len pattern?
LETTER_PATTERN = /\p{L}/u;
/*
* Base schema body for defining the basic capitalization rule, ignorePattern,
* and ignoreInlineComments values.
* This can be used in a few different ways in the actual schema.
*/
const SCHEMA_BODY = {
type: "object",
properties: {
ignorePattern: {
type: "string",
},
ignoreInlineComments: {
type: "boolean",
},
ignoreConsecutiveComments: {
type: "boolean",
},
},
additionalProperties: false,
};
const DEFAULTS = {
ignorePattern: "",
ignoreInlineComments: false,
ignoreConsecutiveComments: false,
};
/**
* Get normalized options for either block or line comments from the given
* user-provided options.
* - If the user-provided options is just a string, returns a normalized
* set of options using default values for all other options.
* - If the user-provided options is an object, then a normalized option
* set is returned. Options specified in overrides will take priority
* over options specified in the main options object, which will in
* turn take priority over the rule's defaults.
* @param {Object|string} rawOptions The user-provided options.
* @param {string} which Either "line" or "block".
* @returns {Object} The normalized options.
*/
function getNormalizedOptions(rawOptions, which) {
return Object.assign({}, DEFAULTS, rawOptions[which] || rawOptions);
}
/**
* Get normalized options for block and line comments.
* @param {Object|string} rawOptions The user-provided options.
* @returns {Object} An object with "Line" and "Block" keys and corresponding
* normalized options objects.
*/
function getAllNormalizedOptions(rawOptions = {}) {
return {
Line: getNormalizedOptions(rawOptions, "line"),
Block: getNormalizedOptions(rawOptions, "block"),
};
}
/**
* Creates a regular expression for each ignorePattern defined in the rule
* options.
*
* This is done in order to avoid invoking the RegExp constructor repeatedly.
* @param {Object} normalizedOptions The normalized rule options.
* @returns {void}
*/
function createRegExpForIgnorePatterns(normalizedOptions) {
Object.keys(normalizedOptions).forEach(key => {
const ignorePatternStr = normalizedOptions[key].ignorePattern;
if (ignorePatternStr) {
const regExp = RegExp(`^\\s*(?:${ignorePatternStr})`, "u");
normalizedOptions[key].ignorePatternRegExp = regExp;
}
});
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"Enforce or disallow capitalization of the first letter of a comment",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/capitalized-comments",
},
fixable: "code",
schema: [
{ enum: ["always", "never"] },
{
oneOf: [
SCHEMA_BODY,
{
type: "object",
properties: {
line: SCHEMA_BODY,
block: SCHEMA_BODY,
},
additionalProperties: false,
},
],
},
],
messages: {
unexpectedLowercaseComment:
"Comments should not begin with a lowercase character.",
unexpectedUppercaseComment:
"Comments should not begin with an uppercase character.",
},
},
create(context) {
const capitalize = context.options[0] || "always",
normalizedOptions = getAllNormalizedOptions(context.options[1]),
sourceCode = context.sourceCode;
createRegExpForIgnorePatterns(normalizedOptions);
//----------------------------------------------------------------------
// Helpers
//----------------------------------------------------------------------
/**
* Checks whether a comment is an inline comment.
*
* For the purpose of this rule, a comment is inline if:
* 1. The comment is preceded by a token on the same line; and
* 2. The command is followed by a token on the same line.
*
* Note that the comment itself need not be single-line!
*
* Also, it follows from this definition that only block comments can
* be considered as possibly inline. This is because line comments
* would consume any following tokens on the same line as the comment.
* @param {ASTNode} comment The comment node to check.
* @returns {boolean} True if the comment is an inline comment, false
* otherwise.
*/
function isInlineComment(comment) {
const previousToken = sourceCode.getTokenBefore(comment, {
includeComments: true,
}),
nextToken = sourceCode.getTokenAfter(comment, {
includeComments: true,
});
return Boolean(
previousToken &&
nextToken &&
comment.loc.start.line === previousToken.loc.end.line &&
comment.loc.end.line === nextToken.loc.start.line,
);
}
/**
* Determine if a comment follows another comment.
* @param {ASTNode} comment The comment to check.
* @returns {boolean} True if the comment follows a valid comment.
*/
function isConsecutiveComment(comment) {
const previousTokenOrComment = sourceCode.getTokenBefore(comment, {
includeComments: true,
});
return Boolean(
previousTokenOrComment &&
["Block", "Line"].includes(previousTokenOrComment.type),
);
}
/**
* Check a comment to determine if it is valid for this rule.
* @param {ASTNode} comment The comment node to process.
* @param {Object} options The options for checking this comment.
* @returns {boolean} True if the comment is valid, false otherwise.
*/
function isCommentValid(comment, options) {
// 1. Check for default ignore pattern.
if (DEFAULT_IGNORE_PATTERN.test(comment.value)) {
return true;
}
// 2. Check for custom ignore pattern.
const commentWithoutAsterisks = comment.value.replace(/\*/gu, "");
if (
options.ignorePatternRegExp &&
options.ignorePatternRegExp.test(commentWithoutAsterisks)
) {
return true;
}
// 3. Check for inline comments.
if (options.ignoreInlineComments && isInlineComment(comment)) {
return true;
}
// 4. Is this a consecutive comment (and are we tolerating those)?
if (
options.ignoreConsecutiveComments &&
isConsecutiveComment(comment)
) {
return true;
}
// 5. Does the comment start with a possible URL?
if (MAYBE_URL.test(commentWithoutAsterisks)) {
return true;
}
// 6. Is the initial word character a letter?
const commentWordCharsOnly = commentWithoutAsterisks.replace(
WHITESPACE,
"",
);
if (commentWordCharsOnly.length === 0) {
return true;
}
// Get the first Unicode character (1 or 2 code units).
const [firstWordChar] = commentWordCharsOnly;
if (!LETTER_PATTERN.test(firstWordChar)) {
return true;
}
// 7. Check the case of the initial word character.
const isUppercase =
firstWordChar !== firstWordChar.toLocaleLowerCase(),
isLowercase =
firstWordChar !== firstWordChar.toLocaleUpperCase();
if (capitalize === "always" && isLowercase) {
return false;
}
if (capitalize === "never" && isUppercase) {
return false;
}
return true;
}
/**
* Process a comment to determine if it needs to be reported.
* @param {ASTNode} comment The comment node to process.
* @returns {void}
*/
function processComment(comment) {
const options = normalizedOptions[comment.type],
commentValid = isCommentValid(comment, options);
if (!commentValid) {
const messageId =
capitalize === "always"
? "unexpectedLowercaseComment"
: "unexpectedUppercaseComment";
context.report({
node: null, // Intentionally using loc instead
loc: comment.loc,
messageId,
fix(fixer) {
const match = comment.value.match(LETTER_PATTERN);
const char = match[0];
// Offset match.index by 2 to account for the first 2 characters that start the comment (// or /*)
const charIndex = comment.range[0] + match.index + 2;
return fixer.replaceTextRange(
[charIndex, charIndex + char.length],
capitalize === "always"
? char.toLocaleUpperCase()
: char.toLocaleLowerCase(),
);
},
});
}
}
//----------------------------------------------------------------------
// Public
//----------------------------------------------------------------------
return {
Program() {
const comments = sourceCode.getAllComments();
comments
.filter(token => token.type !== "Shebang")
.forEach(processComment);
},
};
},
};
@@ -0,0 +1,8 @@
declare function useMap<K, T>(initialValue?: Iterable<readonly [K, T]>): readonly [Map<K, T>, {
readonly set: (this: unknown, key: K, entry: T) => void;
readonly setAll: (this: unknown, newMap: Iterable<readonly [K, T]>) => void;
readonly remove: (this: unknown, key: K) => void;
readonly reset: (this: unknown) => void;
readonly get: (this: unknown, key: K) => T | undefined;
}];
export default useMap;
@@ -0,0 +1,54 @@
var test = require('tape');
var resolve = require('../');
var path = require('path');
test('shadowed core modules still return core module', function (t) {
t.plan(2);
resolve('util', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) {
t.ifError(err);
t.equal(res, 'util');
});
});
test('shadowed core modules still return core module [sync]', function (t) {
t.plan(1);
var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core') });
t.equal(res, 'util');
});
test('shadowed core modules return shadow when appending `/`', function (t) {
t.plan(2);
resolve('util/', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) {
t.ifError(err);
t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
});
});
test('shadowed core modules return shadow when appending `/` [sync]', function (t) {
t.plan(1);
var res = resolve.sync('util/', { basedir: path.join(__dirname, 'shadowed_core') });
t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
});
test('shadowed core modules return shadow with `includeCoreModules: false`', function (t) {
t.plan(2);
resolve('util', { basedir: path.join(__dirname, 'shadowed_core'), includeCoreModules: false }, function (err, res) {
t.ifError(err);
t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
});
});
test('shadowed core modules return shadow with `includeCoreModules: false` [sync]', function (t) {
t.plan(1);
var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core'), includeCoreModules: false });
t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
});
@@ -0,0 +1,51 @@
export type Formatter = (input: string | number | null | undefined) => string
export interface Colors {
isColorSupported: boolean
reset: Formatter
bold: Formatter
dim: Formatter
italic: Formatter
underline: Formatter
inverse: Formatter
hidden: Formatter
strikethrough: Formatter
black: Formatter
red: Formatter
green: Formatter
yellow: Formatter
blue: Formatter
magenta: Formatter
cyan: Formatter
white: Formatter
gray: Formatter
bgBlack: Formatter
bgRed: Formatter
bgGreen: Formatter
bgYellow: Formatter
bgBlue: Formatter
bgMagenta: Formatter
bgCyan: Formatter
bgWhite: Formatter
blackBright: Formatter
redBright: Formatter
greenBright: Formatter
yellowBright: Formatter
blueBright: Formatter
magentaBright: Formatter
cyanBright: Formatter
whiteBright: Formatter
bgBlackBright: Formatter
bgRedBright: Formatter
bgGreenBright: Formatter
bgYellowBright: Formatter
bgBlueBright: Formatter
bgMagentaBright: Formatter
bgCyanBright: Formatter
bgWhiteBright: Formatter
}
@@ -0,0 +1 @@
{"name":"lru-cache","version":"5.1.1","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532117245,"integrity":"sha512-AWGEHoRNt0yEBc8gjP6U2muF981GUesY7gCv5D6+iMba4pUBKG8h5Tn0wXMQ1dO1Dauq/oDSgKZfJVEF7M0Buw==","mode":420,"size":776},"index.js":{"checkedAt":1794532117245,"integrity":"sha512-9xK3IVCUhbh6gQgCpI7vHE69BidtDijNTwBnHnbjwPn6G7+HLaLJP7WzvPgUYmTAy8jQmv2OO5qkqS+QHfEeeg==","mode":420,"size":8186},"LICENSE":{"checkedAt":1794532089714,"integrity":"sha512-P6dI5Z+zrwxSk1MIRPqpYG2ScYNkidLIATQXd50QzBgBh/XmcEd/nsd9NB4O9k6rfc+4dsY5DwJ7xvhpoS0PRg==","mode":420,"size":765},"README.md":{"checkedAt":1794532117245,"integrity":"sha512-IM3wLlYJEzSNb50qW2EswRH6qpzUSjn5Mzh52nfqHHbFGRaFVge5c7q7Eb6vtUmbuLM7VVPGdPQJsClsQx6nOA==","mode":420,"size":5987}}}
@@ -0,0 +1,226 @@
/*
Copyright (c) 2011 Google Inc. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
gyp.xclangspec
GYP language specification for Xcode 3
There is not much documentation available regarding the format
of .xclangspec files. As a starting point, see for instance the
outdated documentation at:
http://maxao.free.fr/xcode-plugin-interface/specifications.html
and the files in:
/Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources/
Place this file in directory:
~/Library/Application Support/Developer/Shared/Xcode/Specifications/
*/
(
{
Identifier = "xcode.lang.gyp.keyword";
Syntax = {
Words = (
"and",
"or",
"<!",
"<",
);
Type = "xcode.syntax.keyword";
};
},
{
Identifier = "xcode.lang.gyp.target.declarator";
Syntax = {
Words = (
"'target_name'",
);
Type = "xcode.syntax.identifier.type";
};
},
{
Identifier = "xcode.lang.gyp.string.singlequote";
Syntax = {
IncludeRules = (
"xcode.lang.string",
"xcode.lang.gyp.keyword",
"xcode.lang.number",
);
Start = "'";
End = "'";
};
},
{
Identifier = "xcode.lang.gyp.comma";
Syntax = {
Words = ( ",", );
};
},
{
Identifier = "xcode.lang.gyp";
Description = "GYP Coloring";
BasedOn = "xcode.lang.simpleColoring";
IncludeInMenu = YES;
Name = "GYP";
Syntax = {
Tokenizer = "xcode.lang.gyp.lexer.toplevel";
IncludeRules = (
"xcode.lang.gyp.dictionary",
);
Type = "xcode.syntax.plain";
};
},
// The following rule returns tokens to the other rules
{
Identifier = "xcode.lang.gyp.lexer";
Syntax = {
IncludeRules = (
"xcode.lang.gyp.comment",
"xcode.lang.string",
'xcode.lang.gyp.targetname.declarator',
"xcode.lang.gyp.string.singlequote",
"xcode.lang.number",
"xcode.lang.gyp.comma",
);
};
},
{
Identifier = "xcode.lang.gyp.lexer.toplevel";
Syntax = {
IncludeRules = (
"xcode.lang.gyp.comment",
);
};
},
{
Identifier = "xcode.lang.gyp.assignment";
Syntax = {
Tokenizer = "xcode.lang.gyp.lexer";
Rules = (
"xcode.lang.gyp.assignment.lhs",
":",
"xcode.lang.gyp.assignment.rhs",
);
};
},
{
Identifier = "xcode.lang.gyp.target.declaration";
Syntax = {
Tokenizer = "xcode.lang.gyp.lexer";
Rules = (
"xcode.lang.gyp.target.declarator",
":",
"xcode.lang.gyp.target.name",
);
};
},
{
Identifier = "xcode.lang.gyp.target.name";
Syntax = {
Tokenizer = "xcode.lang.gyp.lexer";
Rules = (
"xcode.lang.gyp.string.singlequote",
);
Type = "xcode.syntax.definition.function";
};
},
{
Identifier = "xcode.lang.gyp.assignment.lhs";
Syntax = {
Tokenizer = "xcode.lang.gyp.lexer";
Rules = (
"xcode.lang.gyp.string.singlequote",
);
Type = "xcode.syntax.identifier.type";
};
},
{
Identifier = "xcode.lang.gyp.assignment.rhs";
Syntax = {
Tokenizer = "xcode.lang.gyp.lexer";
Rules = (
"xcode.lang.gyp.string.singlequote?",
"xcode.lang.gyp.array?",
"xcode.lang.gyp.dictionary?",
"xcode.lang.number?",
);
};
},
{
Identifier = "xcode.lang.gyp.dictionary";
Syntax = {
Tokenizer = "xcode.lang.gyp.lexer";
Start = "{";
End = "}";
Foldable = YES;
Recursive = YES;
IncludeRules = (
"xcode.lang.gyp.target.declaration",
"xcode.lang.gyp.assignment",
);
};
},
{
Identifier = "xcode.lang.gyp.array";
Syntax = {
Tokenizer = "xcode.lang.gyp.lexer";
Start = "[";
End = "]";
Foldable = YES;
Recursive = YES;
IncludeRules = (
"xcode.lang.gyp.array",
"xcode.lang.gyp.dictionary",
"xcode.lang.gyp.string.singlequote",
);
};
},
{
Identifier = "xcode.lang.gyp.todo.mark";
Syntax = {
StartChars = "T";
Match = (
"^\(TODO\(.*\):[ \t]+.*\)$", // include "TODO: " in the markers list
);
// This is the order of captures. All of the match strings above need the same order.
CaptureTypes = (
"xcode.syntax.mark"
);
Type = "xcode.syntax.comment";
};
},
{
Identifier = "xcode.lang.gyp.comment";
BasedOn = "xcode.lang.comment"; // for text macros
Syntax = {
Start = "#";
End = "\n";
IncludeRules = (
"xcode.lang.url",
"xcode.lang.url.mail",
"xcode.lang.comment.mark",
"xcode.lang.gyp.todo.mark",
);
Type = "xcode.syntax.comment";
};
},
)
@@ -0,0 +1,13 @@
/**
* @returns {Preprocessor}
* Preprocess a value.
*/
export function preprocess(): Preprocessor;
/**
* Preprocess a value.
*/
export type Preprocessor = (value: Value, encoding?: Encoding | null | undefined, end?: boolean | null | undefined) => Array<Chunk>;
import type { Value } from 'micromark-util-types';
import type { Encoding } from 'micromark-util-types';
import type { Chunk } from 'micromark-util-types';
//# sourceMappingURL=preprocess.d.ts.map
@@ -0,0 +1,47 @@
"use strict";
var RevocationInfoChoices_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RevocationInfoChoices = exports.RevocationInfoChoice = exports.OtherRevocationInfoFormat = exports.id_ri_scvp = exports.id_ri_ocsp_response = exports.id_ri = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const asn1_x509_1 = require("@peculiar/asn1-x509");
exports.id_ri = `${asn1_x509_1.id_pkix}.16`;
exports.id_ri_ocsp_response = `${exports.id_ri}.2`;
exports.id_ri_scvp = `${exports.id_ri}.4`;
class OtherRevocationInfoFormat {
constructor(params = {}) {
this.otherRevInfoFormat = "";
this.otherRevInfo = new ArrayBuffer(0);
Object.assign(this, params);
}
}
exports.OtherRevocationInfoFormat = OtherRevocationInfoFormat;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })
], OtherRevocationInfoFormat.prototype, "otherRevInfoFormat", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any })
], OtherRevocationInfoFormat.prototype, "otherRevInfo", void 0);
let RevocationInfoChoice = class RevocationInfoChoice {
constructor(params = {}) {
this.other = new OtherRevocationInfoFormat();
Object.assign(this, params);
}
};
exports.RevocationInfoChoice = RevocationInfoChoice;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: OtherRevocationInfoFormat, context: 1, implicit: true })
], RevocationInfoChoice.prototype, "other", void 0);
exports.RevocationInfoChoice = RevocationInfoChoice = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })
], RevocationInfoChoice);
let RevocationInfoChoices = RevocationInfoChoices_1 = class RevocationInfoChoices extends asn1_schema_1.AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, RevocationInfoChoices_1.prototype);
}
};
exports.RevocationInfoChoices = RevocationInfoChoices;
exports.RevocationInfoChoices = RevocationInfoChoices = RevocationInfoChoices_1 = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Set, itemType: RevocationInfoChoice })
], RevocationInfoChoices);
@@ -0,0 +1,6 @@
import { PlanBindingNode } from '../../planning/models/PlanBindingNode';
export interface PlanServiceNodeBindingRemovedResult {
bindingNodeRemoved: PlanBindingNode | undefined;
isContextFreeBinding: boolean;
}
//# sourceMappingURL=PlanServiceNodeBindingRemovedResult.d.ts.map
@@ -0,0 +1,50 @@
'use strict';
var Scalar = require('../../nodes/Scalar.js');
var stringifyNumber = require('../../stringify/stringifyNumber.js');
const floatNaN = {
identify: value => typeof value === 'number',
default: true,
tag: 'tag:yaml.org,2002:float',
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
resolve: (str) => str.slice(-3).toLowerCase() === 'nan'
? NaN
: str[0] === '-'
? Number.NEGATIVE_INFINITY
: Number.POSITIVE_INFINITY,
stringify: stringifyNumber.stringifyNumber
};
const floatExp = {
identify: value => typeof value === 'number',
default: true,
tag: 'tag:yaml.org,2002:float',
format: 'EXP',
test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
resolve: (str) => parseFloat(str.replace(/_/g, '')),
stringify(node) {
const num = Number(node.value);
return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);
}
};
const float = {
identify: value => typeof value === 'number',
default: true,
tag: 'tag:yaml.org,2002:float',
test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
resolve(str) {
const node = new Scalar.Scalar(parseFloat(str.replace(/_/g, '')));
const dot = str.indexOf('.');
if (dot !== -1) {
const f = str.substring(dot + 1).replace(/_/g, '');
if (f[f.length - 1] === '0')
node.minFractionDigits = f.length;
}
return node;
},
stringify: stringifyNumber.stringifyNumber
};
exports.float = float;
exports.floatExp = floatExp;
exports.floatNaN = floatNaN;
@@ -0,0 +1,40 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _tokenizer = require('../parser/tokenizer');
var _types = require('../parser/tokenizer/types');
const EMPTY_DECLARATION_INFO = {
typeDeclarations: new Set(),
valueDeclarations: new Set(),
}; exports.EMPTY_DECLARATION_INFO = EMPTY_DECLARATION_INFO;
/**
* Get all top-level identifiers that should be preserved when exported in TypeScript.
*
* Examples:
* - If an identifier is declared as `const x`, then `export {x}` should be preserved.
* - If it's declared as `type x`, then `export {x}` should be removed.
* - If it's declared as both `const x` and `type x`, then the export should be preserved.
* - Classes and enums should be preserved (even though they also introduce types).
* - Imported identifiers should be preserved since we don't have enough information to
* rule them out. --isolatedModules disallows re-exports, which catches errors here.
*/
function getDeclarationInfo(tokens) {
const typeDeclarations = new Set();
const valueDeclarations = new Set();
for (let i = 0; i < tokens.tokens.length; i++) {
const token = tokens.tokens[i];
if (token.type === _types.TokenType.name && _tokenizer.isTopLevelDeclaration.call(void 0, token)) {
if (token.isType) {
typeDeclarations.add(tokens.identifierNameForToken(token));
} else {
valueDeclarations.add(tokens.identifierNameForToken(token));
}
}
}
return {typeDeclarations, valueDeclarations};
} exports.default = getDeclarationInfo;
@@ -0,0 +1,29 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var hasPropertyDescriptors = require('has-property-descriptors')();
var $TypeError = require('es-errors/type');
var $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);
var iterProto = require('iterator.prototype');
var callBound = require('call-bound');
var $isPrototypeOf = callBound('Object.prototype.isPrototypeOf');
var $Iterator = typeof Iterator === 'function' ? Iterator : function Iterator() {
if (
!(this instanceof Iterator)
|| this.constructor === Iterator
|| !$isPrototypeOf(Iterator, this.constructor)
) {
throw new $TypeError('`Iterator` can not be called or constructed directly');
}
};
if ($Iterator.prototype !== iterProto) {
$Iterator.prototype = iterProto;
}
$defineProperty($Iterator, 'prototype', { writable: false });
module.exports = $Iterator;
@@ -0,0 +1,97 @@
let FractionJs = require('fraction.js')
let Prefixer = require('./prefixer')
let utils = require('./utils')
const REGEXP = /(min|max)-resolution\s*:\s*\d*\.?\d+(dppx|dpcm|dpi|x)/gi
const SPLIT = /(min|max)-resolution(\s*:\s*)(\d*\.?\d+)(dppx|dpcm|dpi|x)/i
class Resolution extends Prefixer {
/**
* Remove prefixed queries
*/
clean(rule) {
if (!this.bad) {
this.bad = []
for (let prefix of this.prefixes) {
this.bad.push(this.prefixName(prefix, 'min'))
this.bad.push(this.prefixName(prefix, 'max'))
}
}
rule.params = utils.editList(rule.params, queries => {
return queries.filter(query => this.bad.every(i => !query.includes(i)))
})
}
/**
* Return prefixed query name
*/
prefixName(prefix, name) {
if (prefix === '-moz-') {
return name + '--moz-device-pixel-ratio'
} else {
return prefix + name + '-device-pixel-ratio'
}
}
/**
* Return prefixed query
*/
prefixQuery(prefix, name, colon, value, units) {
value = new FractionJs(value)
// 1dpcm = 2.54dpi
// 1dppx = 96dpi
if (units === 'dpi') {
value = value.div(96)
} else if (units === 'dpcm') {
value = value.mul(2.54).div(96)
}
value = value.simplify()
if (prefix === '-o-') {
value = value.n + '/' + value.d
}
return this.prefixName(prefix, name) + colon + value
}
/**
* Add prefixed queries
*/
process(rule) {
let parent = this.parentPrefix(rule)
let prefixes = parent ? [parent] : this.prefixes
rule.params = utils.editList(rule.params, (origin, prefixed) => {
for (let query of origin) {
if (
!query.includes('min-resolution') &&
!query.includes('max-resolution')
) {
prefixed.push(query)
continue
}
for (let prefix of prefixes) {
let processed = query.replace(REGEXP, str => {
let parts = str.match(SPLIT)
return this.prefixQuery(
prefix,
parts[1],
parts[2],
parts[3],
parts[4]
)
})
prefixed.push(processed)
}
prefixed.push(query)
}
return utils.uniq(prefixed)
})
}
}
module.exports = Resolution
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,+DAA4D;AAkBnD,0FAlBA,qBAAS,OAkBA;AAhBlB,mGAAgG;AAgBrD,2GAhBlC,uDAA0B,OAgBkC;AAdrE,mFAAgF;AAc5D,sGAdX,6CAAqB,OAcW"}
@@ -0,0 +1,29 @@
import type { Document } from '../doc/Document';
import type { FlowScalar } from '../parse/cst';
import type { StringifyContext } from '../stringify/stringify';
import type { Range } from './Node';
import { NodeBase } from './Node';
import type { Scalar } from './Scalar';
import type { ToJSContext } from './toJS';
import type { YAMLMap } from './YAMLMap';
import type { YAMLSeq } from './YAMLSeq';
export declare namespace Alias {
interface Parsed extends Alias {
range: Range;
srcToken?: FlowScalar & {
type: 'alias';
};
}
}
export declare class Alias extends NodeBase {
source: string;
anchor?: never;
constructor(source: string);
/**
* Resolve the value of this alias within `doc`, finding the last
* instance of the `source` anchor before this node.
*/
resolve(doc: Document, ctx?: ToJSContext): Scalar | YAMLMap | YAMLSeq | undefined;
toJSON(_arg?: unknown, ctx?: ToJSContext): unknown;
toString(ctx?: StringifyContext, _onComment?: () => void, _onChompKeep?: () => void): string;
}
@@ -0,0 +1,228 @@
'use strict';
module.exports = function generate_custom(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 $errorKeyword;
var $data = 'data' + ($dataLvl || '');
var $valid = 'valid' + $lvl;
var $errs = 'errs__' + $lvl;
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 $rule = this,
$definition = 'definition' + $lvl,
$rDef = $rule.definition,
$closingBraces = '';
var $compile, $inline, $macro, $ruleValidate, $validateCode;
if ($isData && $rDef.$data) {
$validateCode = 'keywordValidate' + $lvl;
var $validateSchema = $rDef.validateSchema;
out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;';
} else {
$ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);
if (!$ruleValidate) return;
$schemaValue = 'validate.schema' + $schemaPath;
$validateCode = $ruleValidate.code;
$compile = $rDef.compile;
$inline = $rDef.inline;
$macro = $rDef.macro;
}
var $ruleErrs = $validateCode + '.errors',
$i = 'i' + $lvl,
$ruleErr = 'ruleErr' + $lvl,
$asyncKeyword = $rDef.async;
if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema');
if (!($inline || $macro)) {
out += '' + ($ruleErrs) + ' = null;';
}
out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
if ($isData && $rDef.$data) {
$closingBraces += '}';
out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { ';
if ($validateSchema) {
$closingBraces += '}';
out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { ';
}
}
if ($inline) {
if ($rDef.statements) {
out += ' ' + ($ruleValidate.validate) + ' ';
} else {
out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; ';
}
} else if ($macro) {
var $it = it.util.copy(it);
var $closingBraces = '';
$it.level++;
var $nextValid = 'valid' + $it.level;
$it.schema = $ruleValidate.validate;
$it.schemaPath = '';
var $wasComposite = it.compositeRule;
it.compositeRule = $it.compositeRule = true;
var $code = it.validate($it).replace(/validate\.schema/g, $validateCode);
it.compositeRule = $it.compositeRule = $wasComposite;
out += ' ' + ($code);
} else {
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = '';
out += ' ' + ($validateCode) + '.call( ';
if (it.opts.passContext) {
out += 'this';
} else {
out += 'self';
}
if ($compile || $rDef.schema === false) {
out += ' , ' + ($data) + ' ';
} else {
out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' ';
}
out += ' , (dataPath || \'\')';
if (it.errorPath != '""') {
out += ' + ' + (it.errorPath);
}
var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
$parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) ';
var def_callRuleValidate = out;
out = $$outStack.pop();
if ($rDef.errors === false) {
out += ' ' + ($valid) + ' = ';
if ($asyncKeyword) {
out += 'await ';
}
out += '' + (def_callRuleValidate) + '; ';
} else {
if ($asyncKeyword) {
$ruleErrs = 'customErrors' + $lvl;
out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } ';
} else {
out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; ';
}
}
}
if ($rDef.modifying) {
out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];';
}
out += '' + ($closingBraces);
if ($rDef.valid) {
if ($breakOnError) {
out += ' if (true) { ';
}
} else {
out += ' if ( ';
if ($rDef.valid === undefined) {
out += ' !';
if ($macro) {
out += '' + ($nextValid);
} else {
out += '' + ($valid);
}
} else {
out += ' ' + (!$rDef.valid) + ' ';
}
out += ') { ';
$errorKeyword = $rule.keyword;
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = '';
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = ''; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } ';
if (it.opts.messages !== false) {
out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' ';
}
if (it.opts.verbose) {
out += ' , schema: validate.schema' + ($schemaPath) + ' , 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++; ';
}
var def_customError = out;
out = $$outStack.pop();
if ($inline) {
if ($rDef.errors) {
if ($rDef.errors != 'full') {
out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } ';
if (it.opts.verbose) {
out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
}
out += ' } ';
}
} else {
if ($rDef.errors === false) {
out += ' ' + (def_customError) + ' ';
} else {
out += ' if (' + ($errs) + ' == errors) { ' + (def_customError) + ' } else { for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } ';
if (it.opts.verbose) {
out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
}
out += ' } } ';
}
}
} else if ($macro) {
out += ' var err = '; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } ';
if (it.opts.messages !== false) {
out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' ';
}
if (it.opts.verbose) {
out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError(vErrors); ';
} else {
out += ' validate.errors = vErrors; return false; ';
}
}
} else {
if ($rDef.errors === false) {
out += ' ' + (def_customError) + ' ';
} else {
out += ' if (Array.isArray(' + ($ruleErrs) + ')) { if (vErrors === null) vErrors = ' + ($ruleErrs) + '; else vErrors = vErrors.concat(' + ($ruleErrs) + '); errors = vErrors.length; for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; ';
if (it.opts.verbose) {
out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
}
out += ' } } else { ' + (def_customError) + ' } ';
}
}
out += ' } ';
if ($breakOnError) {
out += ' else { ';
}
}
return out;
}
@@ -0,0 +1,31 @@
import {GridKeyboardDelegate as $d1c300d9c497e402$export$de9feff04fda126e} from "./GridKeyboardDelegate.mjs";
import {useGrid as $83c6e2eafa584c67$export$f6b86a04e5d66d90} from "./useGrid.mjs";
import {useGridRowGroup as $e45487f8ba1cbdbf$export$d3037f5d3f3e51bf} from "./useGridRowGroup.mjs";
import {useGridRow as $4159a7a9cbb0cc18$export$96357d5a73f686fa} from "./useGridRow.mjs";
import {useGridCell as $ab90dcbc1b5466d0$export$c7e10bfc0c59f67c} from "./useGridCell.mjs";
import {useGridSelectionCheckbox as $7cb39d07f245a780$export$70e2eed1a92976ad} from "./useGridSelectionCheckbox.mjs";
import {useHighlightSelectionDescription as $5b9b5b5723db6ae1$export$be42ebdab07ae4c2} from "./useHighlightSelectionDescription.mjs";
import {useGridSelectionAnnouncement as $92599c3fd427b763$export$137e594ef3218a10} from "./useGridSelectionAnnouncement.mjs";
/*
* 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.
*/
export {$d1c300d9c497e402$export$de9feff04fda126e as GridKeyboardDelegate, $83c6e2eafa584c67$export$f6b86a04e5d66d90 as useGrid, $e45487f8ba1cbdbf$export$d3037f5d3f3e51bf as useGridRowGroup, $4159a7a9cbb0cc18$export$96357d5a73f686fa as useGridRow, $ab90dcbc1b5466d0$export$c7e10bfc0c59f67c as useGridCell, $7cb39d07f245a780$export$70e2eed1a92976ad as useGridSelectionCheckbox, $5b9b5b5723db6ae1$export$be42ebdab07ae4c2 as useHighlightSelectionDescription, $92599c3fd427b763$export$137e594ef3218a10 as useGridSelectionAnnouncement};
//# sourceMappingURL=module.js.map
@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultNumberOption = DefaultNumberOption;
/**
* https://tc39.es/ecma402/#sec-defaultnumberoption
* @param val
* @param min
* @param max
* @param fallback
*/
function DefaultNumberOption(inputVal, min, max, fallback) {
if (inputVal === undefined) {
// @ts-expect-error
return fallback;
}
var val = Number(inputVal);
if (isNaN(val) || val < min || val > max) {
throw new RangeError("".concat(val, " is outside of range [").concat(min, ", ").concat(max, "]"));
}
return Math.floor(val);
}
@@ -0,0 +1,31 @@
import { OneBotAction } from '../../action/OneBotAction';
import { Static } from '@sinclair/typebox';
export declare const DoGroupAlbumCommentPayloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
album_id: import("@sinclair/typebox").TString;
lloc: import("@sinclair/typebox").TString;
content: import("@sinclair/typebox").TString;
}>;
export type DoGroupAlbumCommentPayload = Static<typeof DoGroupAlbumCommentPayloadSchema>;
export declare class DoGroupAlbumComment extends OneBotAction<DoGroupAlbumCommentPayload, any> {
actionName: "do_group_album_comment";
actionSummary: string;
actionTags: string[];
payloadExample: {
group_id: string;
album_id: string;
lloc: string;
content: string;
};
returnExample: {
result: {};
};
payloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
album_id: import("@sinclair/typebox").TString;
lloc: import("@sinclair/typebox").TString;
content: import("@sinclair/typebox").TString;
}>;
returnSchema: import("@sinclair/typebox").TAny;
_handle(payload: DoGroupAlbumCommentPayload): Promise<unknown>;
}
@@ -0,0 +1,105 @@
import {useUNSAFE_PortalContext as $96b38030c423d352$export$9fc1347d4195ccb3} from "./PortalProvider.mjs";
import $4AOtR$react, {useContext as $4AOtR$useContext, useState as $4AOtR$useState, useMemo as $4AOtR$useMemo, useEffect as $4AOtR$useEffect} from "react";
import $4AOtR$reactdom from "react-dom";
import {useIsSSR as $4AOtR$useIsSSR} from "@react-aria/ssr";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $f57aed4a881a3485$var$Context = /*#__PURE__*/ (0, $4AOtR$react).createContext(null);
function $f57aed4a881a3485$export$178405afcd8c5eb(props) {
let { children: children } = props;
let parent = (0, $4AOtR$useContext)($f57aed4a881a3485$var$Context);
let [modalCount, setModalCount] = (0, $4AOtR$useState)(0);
let context = (0, $4AOtR$useMemo)(()=>({
parent: parent,
modalCount: modalCount,
addModal () {
setModalCount((count)=>count + 1);
if (parent) parent.addModal();
},
removeModal () {
setModalCount((count)=>count - 1);
if (parent) parent.removeModal();
}
}), [
parent,
modalCount
]);
return /*#__PURE__*/ (0, $4AOtR$react).createElement($f57aed4a881a3485$var$Context.Provider, {
value: context
}, children);
}
function $f57aed4a881a3485$export$d9aaed4c3ece1bc0() {
let context = (0, $4AOtR$useContext)($f57aed4a881a3485$var$Context);
return {
modalProviderProps: {
'aria-hidden': context && context.modalCount > 0 ? true : undefined
}
};
}
/**
* Creates a root node that will be aria-hidden if there are other modals open.
*/ function $f57aed4a881a3485$var$OverlayContainerDOM(props) {
let { modalProviderProps: modalProviderProps } = $f57aed4a881a3485$export$d9aaed4c3ece1bc0();
return /*#__PURE__*/ (0, $4AOtR$react).createElement("div", {
"data-overlay-container": true,
...props,
...modalProviderProps
});
}
function $f57aed4a881a3485$export$bf688221f59024e5(props) {
return /*#__PURE__*/ (0, $4AOtR$react).createElement($f57aed4a881a3485$export$178405afcd8c5eb, null, /*#__PURE__*/ (0, $4AOtR$react).createElement($f57aed4a881a3485$var$OverlayContainerDOM, props));
}
function $f57aed4a881a3485$export$b47c3594eab58386(props) {
let isSSR = (0, $4AOtR$useIsSSR)();
let { portalContainer: portalContainer = isSSR ? null : document.body, ...rest } = props;
let { getContainer: getContainer } = (0, $96b38030c423d352$export$9fc1347d4195ccb3)();
if (!props.portalContainer && getContainer) portalContainer = getContainer();
(0, $4AOtR$react).useEffect(()=>{
if (portalContainer === null || portalContainer === void 0 ? void 0 : portalContainer.closest('[data-overlay-container]')) throw new Error('An OverlayContainer must not be inside another container. Please change the portalContainer prop.');
}, [
portalContainer
]);
if (!portalContainer) return null;
let contents = /*#__PURE__*/ (0, $4AOtR$react).createElement($f57aed4a881a3485$export$bf688221f59024e5, rest);
return /*#__PURE__*/ (0, $4AOtR$reactdom).createPortal(contents, portalContainer);
}
function $f57aed4a881a3485$export$33ffd74ebf07f060(options) {
// Add aria-hidden to all parent providers on mount, and restore on unmount.
let context = (0, $4AOtR$useContext)($f57aed4a881a3485$var$Context);
if (!context) throw new Error('Modal is not contained within a provider');
(0, $4AOtR$useEffect)(()=>{
if ((options === null || options === void 0 ? void 0 : options.isDisabled) || !context || !context.parent) return;
// The immediate context is from the provider containing this modal, so we only
// want to trigger aria-hidden on its parents not on the modal provider itself.
context.parent.addModal();
return ()=>{
if (context && context.parent) context.parent.removeModal();
};
}, [
context,
context.parent,
options === null || options === void 0 ? void 0 : options.isDisabled
]);
return {
modalProps: {
'data-ismodal': !(options === null || options === void 0 ? void 0 : options.isDisabled)
}
};
}
export {$f57aed4a881a3485$export$178405afcd8c5eb as ModalProvider, $f57aed4a881a3485$export$d9aaed4c3ece1bc0 as useModalProvider, $f57aed4a881a3485$export$bf688221f59024e5 as OverlayProvider, $f57aed4a881a3485$export$b47c3594eab58386 as OverlayContainer, $f57aed4a881a3485$export$33ffd74ebf07f060 as useModal};
//# sourceMappingURL=useModal.module.js.map
@@ -0,0 +1,19 @@
import { useRef } from 'react';
export var createUpdateEffect = function (hook) { return function (effect, deps) {
var isMounted = useRef(false);
// for react-refresh
hook(function () {
return function () {
isMounted.current = false;
};
}, []);
hook(function () {
if (!isMounted.current) {
isMounted.current = true;
}
else {
return effect();
}
}, deps);
}; };
export default createUpdateEffect;
@@ -0,0 +1,19 @@
'use strict';
var test = require('tape');
var names = require('../');
test('typed array names', function (t) {
for (var i = 0; i < names.length; i++) {
var name = names[i];
t.equal(typeof name, 'string', 'is string');
t.equal(names.indexOf(name), i, 'is unique (from start)');
t.equal(names.lastIndexOf(name), i, 'is unique (from end)');
t.match(typeof global[name], /^(?:function|undefined)$/, 'is a global function, or `undefined`');
}
t.end();
});
@@ -0,0 +1 @@
{"name":"form-data","version":"4.0.4","requiresBuild":false,"files":{"License":{"checkedAt":1794532111322,"integrity":"sha512-ZwZnQAboeW6eFxNLi/xa0UoNS0hFYPA1H9UUK+nr8Tgc3zi0XfaWnQRhi8+4axH6BzVJbmv0iLC4G+jhEaYlJQ==","mode":420,"size":1118},"lib/browser.js":{"checkedAt":1794532111322,"integrity":"sha512-9iz2Ah94htUfXe2v2E4rcot9eEP4+i9GBDkWLgJIDqDQWJAnG7lxhtHSZCV9hYk+K0KostsGpkG6S+V79svgMQ==","mode":420,"size":117},"lib/form_data.js":{"checkedAt":1794532111323,"integrity":"sha512-4XHkI6dGXgMX+703SmKNjyj5yibO08g4lxRlGMpLSrESxk76B/F9W3nnPdqOPoFaviZNy1uzPgb9Ye1VGy7FfA==","mode":420,"size":14606},"lib/populate.js":{"checkedAt":1794532111323,"integrity":"sha512-lCDDeA6mJp4BI7JREGHGjBc/bDGBY4tLEKvBe6+D/K6Nz+zb02mAlYJ+d+/jB2O3d8T9FpSLHVivuR8hu8xovw==","mode":420,"size":232},"package.json":{"checkedAt":1794532111323,"integrity":"sha512-iWiv2WoB6Uvmxej3madEYFwZ3NNsatJzl+lxcT7bpiIVDMGu0qKvfjhyZ4JVgvl4ht7I/gkKjuvFXbhwO/daRg==","mode":420,"size":3006},"CHANGELOG.md":{"checkedAt":1794532111323,"integrity":"sha512-FCWXZsDAsfGu7nbTzxBxJiwEE1UwZpfLu58TOhBEnpmqmfw57gF+OoVmCHO3aHc0rteE5O5GlTgWESl2y2HCHw==","mode":420,"size":43231},"README.md":{"checkedAt":1794532111323,"integrity":"sha512-ymw+QSYYD5o08AcmLaFfqpn5yu9K6EnDl/jiVcjO8UN0NcLPfN0YoiL87knCpBVNGhXd11Q0E5sn9Plr95+zsA==","mode":420,"size":12034},"index.d.ts":{"checkedAt":1794532111324,"integrity":"sha512-XzXlSLMANQmmyqtmj8OvHbvzt7Wn+wrZZdvSelPZJSIiQQsQP8NcGhBJx4/z4ixwDay45wGqbKv0LdqqC1OcGA==","mode":420,"size":1825}}}
@@ -0,0 +1,13 @@
// warning: extremely hot code path.
// This has been meticulously optimized for use
// within npm install on large package trees.
// Do not edit without careful benchmarking.
module.exports = str => {
let i = str.length - 1
let slashesStart = -1
while (i > -1 && str.charAt(i) === '/') {
slashesStart = i
i--
}
return slashesStart === -1 ? str : str.slice(0, slashesStart)
}
@@ -0,0 +1,532 @@
/**
* @fileoverview Performs validity check on anchor hrefs. Warns when anchors are used as buttons.
* @author Almero Steyn
*/
// -----------------------------------------------------------------------------
// Requirements
// -----------------------------------------------------------------------------
import { RuleTester } from 'eslint';
import parserOptionsMapper from '../../__util__/parserOptionsMapper';
import parsers from '../../__util__/helpers/parsers';
import rule from '../../../src/rules/anchor-is-valid';
// -----------------------------------------------------------------------------
// Tests
// -----------------------------------------------------------------------------
const ruleTester = new RuleTester();
const preferButtonErrorMessage = 'Anchor used as a button. Anchors are primarily expected to navigate. Use the button element instead. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md';
const noHrefErrorMessage = 'The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md';
const invalidHrefErrorMessage = 'The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md';
const preferButtonexpectedError = {
message: preferButtonErrorMessage,
type: 'JSXOpeningElement',
};
const noHrefexpectedError = {
message: noHrefErrorMessage,
type: 'JSXOpeningElement',
};
const invalidHrefexpectedError = {
message: invalidHrefErrorMessage,
type: 'JSXOpeningElement',
};
const components = [{
components: ['Anchor', 'Link'],
}];
const specialLink = [{
specialLink: ['hrefLeft', 'hrefRight'],
}];
const noHrefAspect = [{
aspects: ['noHref'],
}];
const invalidHrefAspect = [{
aspects: ['invalidHref'],
}];
const preferButtonAspect = [{
aspects: ['preferButton'],
}];
const noHrefInvalidHrefAspect = [{
aspects: ['noHref', 'invalidHref'],
}];
const noHrefPreferButtonAspect = [{
aspects: ['noHref', 'preferButton'],
}];
const preferButtonInvalidHrefAspect = [{
aspects: ['preferButton', 'invalidHref'],
}];
const componentsAndSpecialLink = [{
components: ['Anchor'],
specialLink: ['hrefLeft'],
}];
const componentsAndSpecialLinkAndInvalidHrefAspect = [{
components: ['Anchor'],
specialLink: ['hrefLeft'],
aspects: ['invalidHref'],
}];
const componentsAndSpecialLinkAndNoHrefAspect = [{
components: ['Anchor'],
specialLink: ['hrefLeft'],
aspects: ['noHref'],
}];
const componentsSettings = {
'jsx-a11y': {
components: {
Anchor: 'a',
Link: 'a',
},
},
};
ruleTester.run('anchor-is-valid', rule, {
valid: parsers.all([].concat(
// DEFAULT ELEMENT 'a' TESTS
{ code: '<Anchor />' },
{ code: '<a {...props} />' },
{ code: '<a href="foo" />' },
{ code: '<a href={foo} />' },
{ code: '<a href="/foo" />' },
{ code: '<a href="https://foo.bar.com" />' },
{ code: '<div href="foo" />' },
{ code: '<a href="javascript" />' },
{ code: '<a href="javascriptFoo" />' },
{ code: '<a href={`#foo`}/>' },
{ code: '<a href={"foo"}/>' },
{ code: '<a href={"javascript"}/>' },
{ code: '<a href={`#javascript`}/>' },
{ code: '<a href="#foo" />' },
{ code: '<a href="#javascript" />' },
{ code: '<a href="#javascriptFoo" />' },
{ code: '<UX.Layout>test</UX.Layout>' },
{ code: '<a href={this} />' },
// CUSTOM ELEMENT TEST FOR ARRAY OPTION
{ code: '<Anchor {...props} />', options: components },
{ code: '<Anchor href="foo" />', options: components },
{ code: '<Anchor href={foo} />', options: components },
{ code: '<Anchor href="/foo" />', options: components },
{ code: '<Anchor href="https://foo.bar.com" />', options: components },
{ code: '<div href="foo" />', options: components },
{ code: '<Anchor href={`#foo`}/>', options: components },
{ code: '<Anchor href={"foo"}/>', options: components },
{ code: '<Anchor href="#foo" />', options: components },
{ code: '<Link {...props} />', options: components },
{ code: '<Link href="foo" />', options: components },
{ code: '<Link href={foo} />', options: components },
{ code: '<Link href="/foo" />', options: components },
{ code: '<Link href="https://foo.bar.com" />', options: components },
{ code: '<div href="foo" />', options: components },
{ code: '<Link href={`#foo`}/>', options: components },
{ code: '<Link href={"foo"}/>', options: components },
{ code: '<Link href="#foo" />', options: components },
{ code: '<Link href="#foo" />', settings: componentsSettings },
// CUSTOM PROP TESTS
{ code: '<a {...props} />', options: specialLink },
{ code: '<a hrefLeft="foo" />', options: specialLink },
{ code: '<a hrefLeft={foo} />', options: specialLink },
{ code: '<a hrefLeft="/foo" />', options: specialLink },
{ code: '<a hrefLeft="https://foo.bar.com" />', options: specialLink },
{ code: '<div hrefLeft="foo" />', options: specialLink },
{ code: '<a hrefLeft={`#foo`}/>', options: specialLink },
{ code: '<a hrefLeft={"foo"}/>', options: specialLink },
{ code: '<a hrefLeft="#foo" />', options: specialLink },
{ code: '<UX.Layout>test</UX.Layout>', options: specialLink },
{ code: '<a hrefRight={this} />', options: specialLink },
{ code: '<a {...props} />', options: specialLink },
{ code: '<a hrefRight="foo" />', options: specialLink },
{ code: '<a hrefRight={foo} />', options: specialLink },
{ code: '<a hrefRight="/foo" />', options: specialLink },
{ code: '<a hrefRight="https://foo.bar.com" />', options: specialLink },
{ code: '<div hrefRight="foo" />', options: specialLink },
{ code: '<a hrefRight={`#foo`}/>', options: specialLink },
{ code: '<a hrefRight={"foo"}/>', options: specialLink },
{ code: '<a hrefRight="#foo" />', options: specialLink },
{ code: '<UX.Layout>test</UX.Layout>', options: specialLink },
{ code: '<a hrefRight={this} />', options: specialLink },
// CUSTOM BOTH COMPONENTS AND SPECIALLINK TESTS
{ code: '<Anchor {...props} />', options: componentsAndSpecialLink },
{ code: '<Anchor hrefLeft="foo" />', options: componentsAndSpecialLink },
{ code: '<Anchor hrefLeft={foo} />', options: componentsAndSpecialLink },
{ code: '<Anchor hrefLeft="/foo" />', options: componentsAndSpecialLink },
{ code: '<Anchor hrefLeft="https://foo.bar.com" />', options: componentsAndSpecialLink },
{ code: '<div hrefLeft="foo" />', options: componentsAndSpecialLink },
{ code: '<Anchor hrefLeft={`#foo`}/>', options: componentsAndSpecialLink },
{ code: '<Anchor hrefLeft={"foo"}/>', options: componentsAndSpecialLink },
{ code: '<Anchor hrefLeft="#foo" />', options: componentsAndSpecialLink },
{ code: '<UX.Layout>test</UX.Layout>', options: componentsAndSpecialLink },
// WITH ONCLICK
// DEFAULT ELEMENT 'a' TESTS
{ code: '<a {...props} onClick={() => void 0} />' },
{ code: '<a href="foo" onClick={() => void 0} />' },
{ code: '<a href={foo} onClick={() => void 0} />' },
{ code: '<a href="/foo" onClick={() => void 0} />' },
{ code: '<a href="https://foo.bar.com" onClick={() => void 0} />' },
{ code: '<div href="foo" onClick={() => void 0} />' },
{ code: '<a href={`#foo`} onClick={() => void 0} />' },
{ code: '<a href={"foo"} onClick={() => void 0} />' },
{ code: '<a href="#foo" onClick={() => void 0} />' },
{ code: '<a href={this} onClick={() => void 0} />' },
// CUSTOM ELEMENT TEST FOR ARRAY OPTION
{ code: '<Anchor {...props} onClick={() => void 0} />', options: components },
{ code: '<Anchor href="foo" onClick={() => void 0} />', options: components },
{ code: '<Anchor href={foo} onClick={() => void 0} />', options: components },
{ code: '<Anchor href="/foo" onClick={() => void 0} />', options: components },
{ code: '<Anchor href="https://foo.bar.com" onClick={() => void 0} />', options: components },
{ code: '<Anchor href={`#foo`} onClick={() => void 0} />', options: components },
{ code: '<Anchor href={"foo"} onClick={() => void 0} />', options: components },
{ code: '<Anchor href="#foo" onClick={() => void 0} />', options: components },
{ code: '<Link {...props} onClick={() => void 0} />', options: components },
{ code: '<Link href="foo" onClick={() => void 0} />', options: components },
{ code: '<Link href={foo} onClick={() => void 0} />', options: components },
{ code: '<Link href="/foo" onClick={() => void 0} />', options: components },
{ code: '<Link href="https://foo.bar.com" onClick={() => void 0} />', options: components },
{ code: '<div href="foo" onClick={() => void 0} />', options: components },
{ code: '<Link href={`#foo`} onClick={() => void 0} />', options: components },
{ code: '<Link href={"foo"} onClick={() => void 0} />', options: components },
{ code: '<Link href="#foo" onClick={() => void 0} />', options: components },
// CUSTOM PROP TESTS
{ code: '<a {...props} onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefLeft="foo" onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefLeft={foo} onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefLeft="/foo" onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefLeft href="https://foo.bar.com" onClick={() => void 0} />', options: specialLink },
{ code: '<div hrefLeft="foo" onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefLeft={`#foo`} onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefLeft={"foo"} onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefLeft="#foo" onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefRight={this} onClick={() => void 0} />', options: specialLink },
{ code: '<a {...props} onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefRight="foo" onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefRight={foo} onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefRight="/foo" onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefRight href="https://foo.bar.com" onClick={() => void 0} />', options: specialLink },
{ code: '<div hrefRight="foo" onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefRight={`#foo`} onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefRight={"foo"} onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefRight="#foo" onClick={() => void 0} />', options: specialLink },
{ code: '<a hrefRight={this} onClick={() => void 0} />', options: specialLink },
// CUSTOM BOTH COMPONENTS AND SPECIALLINK TESTS
{ code: '<Anchor {...props} onClick={() => void 0} />', options: componentsAndSpecialLink },
{ code: '<Anchor hrefLeft="foo" onClick={() => void 0} />', options: componentsAndSpecialLink },
{ code: '<Anchor hrefLeft={foo} onClick={() => void 0} />', options: componentsAndSpecialLink },
{ code: '<Anchor hrefLeft="/foo" onClick={() => void 0} />', options: componentsAndSpecialLink },
{
code: '<Anchor hrefLeft href="https://foo.bar.com" onClick={() => void 0} />',
options: componentsAndSpecialLink,
},
{ code: '<Anchor hrefLeft={`#foo`} onClick={() => void 0} />', options: componentsAndSpecialLink },
{ code: '<Anchor hrefLeft={"foo"} onClick={() => void 0} />', options: componentsAndSpecialLink },
{ code: '<Anchor hrefLeft="#foo" onClick={() => void 0} />', options: componentsAndSpecialLink },
// WITH ASPECTS TESTS
// NO HREF
{ code: '<a />', options: invalidHrefAspect },
{ code: '<a href={undefined} />', options: invalidHrefAspect },
{ code: '<a href={null} />', options: invalidHrefAspect },
{ code: '<a />', options: preferButtonAspect },
{ code: '<a href={undefined} />', options: preferButtonAspect },
{ code: '<a href={null} />', options: preferButtonAspect },
{ code: '<a />', options: preferButtonInvalidHrefAspect },
{ code: '<a href={undefined} />', options: preferButtonInvalidHrefAspect },
{ code: '<a href={null} />', options: preferButtonInvalidHrefAspect },
// INVALID HREF
{ code: '<a href="" />;', options: preferButtonAspect },
{ code: '<a href="#" />', options: preferButtonAspect },
{ code: '<a href={"#"} />', options: preferButtonAspect },
{ code: '<a href="javascript:void(0)" />', options: preferButtonAspect },
{ code: '<a href={"javascript:void(0)"} />', options: preferButtonAspect },
{ code: '<a href="" />;', options: noHrefAspect },
{ code: '<a href="#" />', options: noHrefAspect },
{ code: '<a href={"#"} />', options: noHrefAspect },
{ code: '<a href="javascript:void(0)" />', options: noHrefAspect },
{ code: '<a href={"javascript:void(0)"} />', options: noHrefAspect },
{ code: '<a href="" />;', options: noHrefPreferButtonAspect },
{ code: '<a href="#" />', options: noHrefPreferButtonAspect },
{ code: '<a href={"#"} />', options: noHrefPreferButtonAspect },
{ code: '<a href="javascript:void(0)" />', options: noHrefPreferButtonAspect },
{ code: '<a href={"javascript:void(0)"} />', options: noHrefPreferButtonAspect },
// SHOULD BE BUTTON
{ code: '<a onClick={() => void 0} />', options: invalidHrefAspect },
{ code: '<a href="#" onClick={() => void 0} />', options: noHrefAspect },
{ code: '<a href="javascript:void(0)" onClick={() => void 0} />', options: noHrefAspect },
{
code: '<a href={"javascript:void(0)"} onClick={() => void 0} />',
options: noHrefAspect,
},
// CUSTOM COMPONENTS AND SPECIAL LINK AND ASPECT
{ code: '<Anchor hrefLeft={undefined} />', options: componentsAndSpecialLinkAndInvalidHrefAspect },
{ code: '<Anchor hrefLeft={null} />', options: componentsAndSpecialLinkAndInvalidHrefAspect },
)).map(parserOptionsMapper),
invalid: parsers.all([].concat(
// DEFAULT ELEMENT 'a' TESTS
// NO HREF
{ code: '<a />', errors: [noHrefexpectedError] },
{ code: '<a href={undefined} />', errors: [noHrefexpectedError] },
{ code: '<a href={null} />', errors: [noHrefexpectedError] },
// INVALID HREF
{ code: '<a href="" />;', errors: [invalidHrefexpectedError] },
{ code: '<a href="#" />', errors: [invalidHrefexpectedError] },
{ code: '<a href={"#"} />', errors: [invalidHrefexpectedError] },
{ code: '<a href="javascript:void(0)" />', errors: [invalidHrefexpectedError] },
{ code: '<a href={"javascript:void(0)"} />', errors: [invalidHrefexpectedError] },
// SHOULD BE BUTTON
{ code: '<a onClick={() => void 0} />', errors: [preferButtonexpectedError] },
{ code: '<a href="#" onClick={() => void 0} />', errors: [preferButtonexpectedError] },
{ code: '<a href="javascript:void(0)" onClick={() => void 0} />', errors: [preferButtonexpectedError] },
{
code: '<a href={"javascript:void(0)"} onClick={() => void 0} />',
errors: [preferButtonexpectedError],
},
// CUSTOM ELEMENT TEST FOR ARRAY OPTION
// NO HREF
{ code: '<Link />', errors: [noHrefexpectedError], options: components },
{ code: '<Link href={undefined} />', errors: [noHrefexpectedError], options: components },
{ code: '<Link href={null} />', errors: [noHrefexpectedError], options: components },
// INVALID HREF
{ code: '<Link href="" />', errors: [invalidHrefexpectedError], options: components },
{ code: '<Link href="#" />', errors: [invalidHrefexpectedError], options: components },
{ code: '<Link href={"#"} />', errors: [invalidHrefexpectedError], options: components },
{ code: '<Link href="javascript:void(0)" />', errors: [invalidHrefexpectedError], options: components },
{ code: '<Link href={"javascript:void(0)"} />', errors: [invalidHrefexpectedError], options: components },
{ code: '<Anchor href="" />', errors: [invalidHrefexpectedError], options: components },
{ code: '<Anchor href="#" />', errors: [invalidHrefexpectedError], options: components },
{ code: '<Anchor href={"#"} />', errors: [invalidHrefexpectedError], options: components },
{ code: '<Anchor href="javascript:void(0)" />', errors: [invalidHrefexpectedError], options: components },
{ code: '<Anchor href={"javascript:void(0)"} />', errors: [invalidHrefexpectedError], options: components },
// SHOULD BE BUTTON
{ code: '<Link onClick={() => void 0} />', errors: [preferButtonexpectedError], options: components },
{ code: '<Link href="#" onClick={() => void 0} />', errors: [preferButtonexpectedError], options: components },
{
code: '<Link href="javascript:void(0)" onClick={() => void 0} />',
errors: [preferButtonexpectedError],
options: components,
},
{
code: '<Link href={"javascript:void(0)"} onClick={() => void 0} />',
errors: [preferButtonexpectedError],
options: components,
},
{ code: '<Anchor onClick={() => void 0} />', errors: [preferButtonexpectedError], options: components },
{ code: '<Anchor href="#" onClick={() => void 0} />', errors: [preferButtonexpectedError], options: components },
{
code: '<Anchor href="javascript:void(0)" onClick={() => void 0} />',
errors: [preferButtonexpectedError],
options: components,
},
{
code: '<Anchor href={"javascript:void(0)"} onClick={() => void 0} />',
errors: [preferButtonexpectedError],
options: components,
},
{
code: '<Link href="#" onClick={() => void 0} />',
errors: [preferButtonexpectedError],
settings: componentsSettings,
},
// CUSTOM PROP TESTS
// NO HREF
{ code: '<a hrefLeft={undefined} />', errors: [noHrefexpectedError], options: specialLink },
{ code: '<a hrefLeft={null} />', errors: [noHrefexpectedError], options: specialLink },
// INVALID HREF
{ code: '<a hrefLeft="" />;', errors: [invalidHrefexpectedError], options: specialLink },
{ code: '<a hrefLeft="#" />', errors: [invalidHrefexpectedError], options: specialLink },
{ code: '<a hrefLeft={"#"} />', errors: [invalidHrefexpectedError], options: specialLink },
{ code: '<a hrefLeft="javascript:void(0)" />', errors: [invalidHrefexpectedError], options: specialLink },
{ code: '<a hrefLeft={"javascript:void(0)"} />', errors: [invalidHrefexpectedError], options: specialLink },
// SHOULD BE BUTTON
{ code: '<a hrefLeft="#" onClick={() => void 0} />', errors: [preferButtonexpectedError], options: specialLink },
{
code: '<a hrefLeft="javascript:void(0)" onClick={() => void 0} />',
errors: [preferButtonexpectedError],
options: specialLink,
},
{
code: '<a hrefLeft={"javascript:void(0)"} onClick={() => void 0} />',
errors: [preferButtonexpectedError],
options: specialLink,
},
// CUSTOM BOTH COMPONENTS AND SPECIAL LINK TESTS
// NO HREF
{ code: '<Anchor Anchor={undefined} />', errors: [noHrefexpectedError], options: componentsAndSpecialLink },
{ code: '<Anchor hrefLeft={null} />', errors: [noHrefexpectedError], options: componentsAndSpecialLink },
// INVALID HREF
{ code: '<Anchor hrefLeft="" />;', errors: [invalidHrefexpectedError], options: componentsAndSpecialLink },
{ code: '<Anchor hrefLeft="#" />', errors: [invalidHrefexpectedError], options: componentsAndSpecialLink },
{ code: '<Anchor hrefLeft={"#"} />', errors: [invalidHrefexpectedError], options: componentsAndSpecialLink },
{
code: '<Anchor hrefLeft="javascript:void(0)" />',
errors: [invalidHrefexpectedError],
options: componentsAndSpecialLink,
},
{
code: '<Anchor hrefLeft={"javascript:void(0)"} />',
errors: [invalidHrefexpectedError],
options: componentsAndSpecialLink,
},
// SHOULD BE BUTTON
{
code: '<Anchor hrefLeft="#" onClick={() => void 0} />',
errors: [preferButtonexpectedError],
options: componentsAndSpecialLink,
},
{
code: '<Anchor hrefLeft="javascript:void(0)" onClick={() => void 0} />',
errors: [preferButtonexpectedError],
options: componentsAndSpecialLink,
},
{
code: '<Anchor hrefLeft={"javascript:void(0)"} onClick={() => void 0} />',
errors: [preferButtonexpectedError],
options: componentsAndSpecialLink,
},
// WITH ASPECTS TESTS
// NO HREF
{ code: '<a />', options: noHrefAspect, errors: [noHrefexpectedError] },
{ code: '<a />', options: noHrefPreferButtonAspect, errors: [noHrefexpectedError] },
{ code: '<a />', options: noHrefInvalidHrefAspect, errors: [noHrefexpectedError] },
{ code: '<a href={undefined} />', options: noHrefAspect, errors: [noHrefexpectedError] },
{ code: '<a href={undefined} />', options: noHrefPreferButtonAspect, errors: [noHrefexpectedError] },
{ code: '<a href={undefined} />', options: noHrefInvalidHrefAspect, errors: [noHrefexpectedError] },
{ code: '<a href={null} />', options: noHrefAspect, errors: [noHrefexpectedError] },
{ code: '<a href={null} />', options: noHrefPreferButtonAspect, errors: [noHrefexpectedError] },
{ code: '<a href={null} />', options: noHrefInvalidHrefAspect, errors: [noHrefexpectedError] },
// INVALID HREF
{ code: '<a href="" />;', options: invalidHrefAspect, errors: [invalidHrefexpectedError] },
{ code: '<a href="" />;', options: noHrefInvalidHrefAspect, errors: [invalidHrefexpectedError] },
{ code: '<a href="" />;', options: preferButtonInvalidHrefAspect, errors: [invalidHrefexpectedError] },
{ code: '<a href="#" />;', options: invalidHrefAspect, errors: [invalidHrefexpectedError] },
{ code: '<a href="#" />;', options: noHrefInvalidHrefAspect, errors: [invalidHrefexpectedError] },
{ code: '<a href="#" />;', options: preferButtonInvalidHrefAspect, errors: [invalidHrefexpectedError] },
{ code: '<a href={"#"} />;', options: invalidHrefAspect, errors: [invalidHrefexpectedError] },
{ code: '<a href={"#"} />;', options: noHrefInvalidHrefAspect, errors: [invalidHrefexpectedError] },
{ code: '<a href={"#"} />;', options: preferButtonInvalidHrefAspect, errors: [invalidHrefexpectedError] },
{ code: '<a href="javascript:void(0)" />;', options: invalidHrefAspect, errors: [invalidHrefexpectedError] },
{ code: '<a href="javascript:void(0)" />;', options: noHrefInvalidHrefAspect, errors: [invalidHrefexpectedError] },
{
code: '<a href="javascript:void(0)" />;',
options: preferButtonInvalidHrefAspect,
errors: [invalidHrefexpectedError],
},
{ code: '<a href={"javascript:void(0)"} />;', options: invalidHrefAspect, errors: [invalidHrefexpectedError] },
{ code: '<a href={"javascript:void(0)"} />;', options: noHrefInvalidHrefAspect, errors: [invalidHrefexpectedError] },
{
code: '<a href={"javascript:void(0)"} />;',
options: preferButtonInvalidHrefAspect,
errors: [invalidHrefexpectedError],
},
// SHOULD BE BUTTON
{ code: '<a onClick={() => void 0} />', options: preferButtonAspect, errors: [preferButtonexpectedError] },
{
code: '<a onClick={() => void 0} />',
options: preferButtonInvalidHrefAspect,
errors: [preferButtonexpectedError],
},
{ code: '<a onClick={() => void 0} />', options: noHrefPreferButtonAspect, errors: [preferButtonexpectedError] },
{ code: '<a onClick={() => void 0} />', options: noHrefAspect, errors: [noHrefexpectedError] },
{ code: '<a onClick={() => void 0} />', options: noHrefInvalidHrefAspect, errors: [noHrefexpectedError] },
{ code: '<a href="#" onClick={() => void 0} />', options: preferButtonAspect, errors: [preferButtonexpectedError] },
{
code: '<a href="#" onClick={() => void 0} />',
options: noHrefPreferButtonAspect,
errors: [preferButtonexpectedError],
},
{
code: '<a href="#" onClick={() => void 0} />',
options: preferButtonInvalidHrefAspect,
errors: [preferButtonexpectedError],
},
{ code: '<a href="#" onClick={() => void 0} />', options: invalidHrefAspect, errors: [invalidHrefexpectedError] },
{
code: '<a href="#" onClick={() => void 0} />',
options: noHrefInvalidHrefAspect,
errors: [invalidHrefexpectedError],
},
{
code: '<a href="javascript:void(0)" onClick={() => void 0} />',
options: preferButtonAspect,
errors: [preferButtonexpectedError],
},
{
code: '<a href="javascript:void(0)" onClick={() => void 0} />',
options: noHrefPreferButtonAspect,
errors: [preferButtonexpectedError],
},
{
code: '<a href="javascript:void(0)" onClick={() => void 0} />',
options: preferButtonInvalidHrefAspect,
errors: [preferButtonexpectedError],
},
{
code: '<a href="javascript:void(0)" onClick={() => void 0} />',
options: invalidHrefAspect,
errors: [invalidHrefexpectedError],
},
{
code: '<a href="javascript:void(0)" onClick={() => void 0} />',
options: noHrefInvalidHrefAspect,
errors: [invalidHrefexpectedError],
},
{
code: '<a href={"javascript:void(0)"} onClick={() => void 0} />',
options: preferButtonAspect,
errors: [preferButtonexpectedError],
},
{
code: '<a href={"javascript:void(0)"} onClick={() => void 0} />',
options: noHrefPreferButtonAspect,
errors: [preferButtonexpectedError],
},
{
code: '<a href={"javascript:void(0)"} onClick={() => void 0} />',
options: preferButtonInvalidHrefAspect,
errors: [preferButtonexpectedError],
},
{
code: '<a href={"javascript:void(0)"} onClick={() => void 0} />',
options: invalidHrefAspect,
errors: [invalidHrefexpectedError],
},
{
code: '<a href={"javascript:void(0)"} onClick={() => void 0} />',
options: noHrefInvalidHrefAspect,
errors: [invalidHrefexpectedError],
},
// CUSTOM COMPONENTS AND SPECIAL LINK AND ASPECT
{
code: '<Anchor hrefLeft={undefined} />',
options: componentsAndSpecialLinkAndNoHrefAspect,
errors: [noHrefexpectedError],
},
{
code: '<Anchor hrefLeft={null} />',
options: componentsAndSpecialLinkAndNoHrefAspect,
errors: [noHrefexpectedError],
},
)).map(parserOptionsMapper),
});
@@ -0,0 +1,21 @@
/*
* 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.
*/
export {useListBox} from './useListBox';
export {useOption} from './useOption';
export {useListBoxSection} from './useListBoxSection';
export {listData, getItemId} from './utils';
export type {AriaListBoxProps} from '@react-types/listbox';
export type {AriaListBoxOptions, ListBoxAria} from './useListBox';
export type {AriaOptionProps, OptionAria} from './useOption';
export type {AriaListBoxSectionProps, ListBoxSectionAria} from './useListBoxSection';
@@ -0,0 +1,184 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
function getRussianPlural(count: number, one: string, few: string, many: string): string {
const absCount = Math.abs(count);
const lastDigit = absCount % 10;
const lastTwoDigits = absCount % 100;
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
return many;
}
if (lastDigit === 1) {
return one;
}
if (lastDigit >= 2 && lastDigit <= 4) {
return few;
}
return many;
}
interface RussianSizable {
unit: {
one: string;
few: string;
many: string;
};
verb: string;
}
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, RussianSizable> = {
string: {
unit: {
one: "символ",
few: "символа",
many: "символов",
},
verb: "иметь",
},
file: {
unit: {
one: "байт",
few: "байта",
many: "байт",
},
verb: "иметь",
},
array: {
unit: {
one: "элемент",
few: "элемента",
many: "элементов",
},
verb: "иметь",
},
set: {
unit: {
one: "элемент",
few: "элемента",
many: "элементов",
},
verb: "иметь",
},
};
function getSizing(origin: string): RussianSizable | null {
return Sizable[origin] ?? null;
}
const parsedType = (data: any): string => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "число";
}
case "object": {
if (Array.isArray(data)) {
return "массив";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "ввод",
email: "email адрес",
url: "URL",
emoji: "эмодзи",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO дата и время",
date: "ISO дата",
time: "ISO время",
duration: "ISO длительность",
ipv4: "IPv4 адрес",
ipv6: "IPv6 адрес",
cidrv4: "IPv4 диапазон",
cidrv6: "IPv6 диапазон",
base64: "строка в формате base64",
base64url: "строка в формате base64url",
json_string: "JSON строка",
e164: "номер E.164",
jwt: "JWT",
template_literal: "ввод",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Неверный ввод: ожидалось ${issue.expected}, получено ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1) return `Неверный ввод: ожидалось ${util.stringifyPrimitive(issue.values[0])}`;
return `Неверный вариант: ожидалось одно из ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
const maxValue = Number(issue.maximum);
const unit = getRussianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет иметь ${adj}${issue.maximum.toString()} ${unit}`;
}
return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
const minValue = Number(issue.minimum);
const unit = getRussianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет иметь ${adj}${issue.minimum.toString()} ${unit}`;
}
return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") return `Неверная строка: должна начинаться с "${_issue.prefix}"`;
if (_issue.format === "ends_with") return `Неверная строка: должна заканчиваться на "${_issue.suffix}"`;
if (_issue.format === "includes") return `Неверная строка: должна содержать "${_issue.includes}"`;
if (_issue.format === "regex") return `Неверная строка: должна соответствовать шаблону ${_issue.pattern}`;
return `Неверный ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Неверное число: должно быть кратным ${issue.divisor}`;
case "unrecognized_keys":
return `Нераспознанн${issue.keys.length > 1 ? "ые" : "ый"} ключ${issue.keys.length > 1 ? "и" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Неверный ключ в ${issue.origin}`;
case "invalid_union":
return "Неверные входные данные";
case "invalid_element":
return `Неверное значение в ${issue.origin}`;
default:
return `Неверные входные данные`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -0,0 +1,24 @@
"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.es2016_array_include = void 0;
const base_config_1 = require("./base-config");
exports.es2016_array_include = {
libs: [],
variables: [
['Array', base_config_1.TYPE],
['ReadonlyArray', base_config_1.TYPE],
['Int8Array', base_config_1.TYPE],
['Uint8Array', base_config_1.TYPE],
['Uint8ClampedArray', base_config_1.TYPE],
['Int16Array', base_config_1.TYPE],
['Uint16Array', base_config_1.TYPE],
['Int32Array', base_config_1.TYPE],
['Uint32Array', base_config_1.TYPE],
['Float32Array', base_config_1.TYPE],
['Float64Array', base_config_1.TYPE],
],
};
@@ -0,0 +1,53 @@
import {useLabel as $d191a55c9702f145$export$8467354a121f1b9f} from "./useLabel.mjs";
import {useSlotId as $2kC82$useSlotId, mergeProps as $2kC82$mergeProps} from "@react-aria/utils";
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $2baaea4c71418dea$export$294aa081a6c6f55d(props) {
let { description: description, errorMessage: errorMessage, isInvalid: isInvalid, validationState: validationState } = props;
let { labelProps: labelProps, fieldProps: fieldProps } = (0, $d191a55c9702f145$export$8467354a121f1b9f)(props);
let descriptionId = (0, $2kC82$useSlotId)([
Boolean(description),
Boolean(errorMessage),
isInvalid,
validationState
]);
let errorMessageId = (0, $2kC82$useSlotId)([
Boolean(description),
Boolean(errorMessage),
isInvalid,
validationState
]);
fieldProps = (0, $2kC82$mergeProps)(fieldProps, {
'aria-describedby': [
descriptionId,
// Use aria-describedby for error message because aria-errormessage is unsupported using VoiceOver or NVDA. See https://github.com/adobe/react-spectrum/issues/1346#issuecomment-740136268
errorMessageId,
props['aria-describedby']
].filter(Boolean).join(' ') || undefined
});
return {
labelProps: labelProps,
fieldProps: fieldProps,
descriptionProps: {
id: descriptionId
},
errorMessageProps: {
id: errorMessageId
}
};
}
export {$2baaea4c71418dea$export$294aa081a6c6f55d as useField};
//# sourceMappingURL=useField.module.js.map
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,oBAAoB,CAAC,gFAAiE,CAAC;AAC3G","sources":["packages/@react-aria/menu/intl/sv-SE.json"],"sourcesContent":["{\n \"longPressMessage\": \"Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn\"\n}\n"],"names":[],"version":3,"file":"sv-SE.main.js.map"}
@@ -0,0 +1,3 @@
import CryptoJS = require("./index");
export = CryptoJS.HmacSHA3;
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more