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

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

No files matched your search

@@ -0,0 +1,56 @@
/**
* @import {CompileContext, Handle, HtmlExtension, Token} from 'micromark-util-types'
*/
import {sanitizeUri} from 'micromark-util-sanitize-uri'
/**
* Create an HTML extension for `micromark` to support GitHub autolink literal
* when serializing to HTML.
*
* @returns {HtmlExtension}
* Extension for `micromark` that can be passed in `htmlExtensions` to
* support GitHub autolink literal when serializing to HTML.
*/
export function gfmAutolinkLiteralHtml() {
return {
exit: {literalAutolinkEmail, literalAutolinkHttp, literalAutolinkWww}
}
}
/**
* @this {CompileContext}
* @type {Handle}
*/
function literalAutolinkWww(token) {
anchorFromToken.call(this, token, 'http://')
}
/**
* @this {CompileContext}
* @type {Handle}
*/
function literalAutolinkEmail(token) {
anchorFromToken.call(this, token, 'mailto:')
}
/**
* @this {CompileContext}
* @type {Handle}
*/
function literalAutolinkHttp(token) {
anchorFromToken.call(this, token)
}
/**
* @this CompileContext
* @param {Token} token
* @param {string | null | undefined} [protocol]
* @returns {undefined}
*/
function anchorFromToken(token, protocol) {
const url = this.sliceSerialize(token)
this.tag('<a href="' + sanitizeUri((protocol || '') + url) + '">')
this.raw(this.encode(url))
this.tag('</a>')
}
@@ -0,0 +1 @@
{"version":3,"file":"decode.js","sourceRoot":"","sources":["../../src/decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAExE,IAAW,SAaV;AAbD,WAAW,SAAS;IAChB,wCAAQ,CAAA;IACR,0CAAS,CAAA;IACT,8CAAW,CAAA;IACX,0CAAS,CAAA;IACT,0CAAS,CAAA;I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,EAAE,EAAE,CAAC,CAAC;gBACvD,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YAC3C,CAAC;QACL,CAAC;QAED,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;QAEvD,OAAO,CAAC,CAAC,CAAC;IACd,CAAC;IAED;;;;;;;;OAQG;IACK,mBAAmB,CAAC,KAAa,EAAE,MAAc;QACrD,MAAM,UAAU,GAAG,MAAM,CAAC;QAE1B,OAAO,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YAC3B,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACtC,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjB,MAAM,IAAILine truncated
@@ -0,0 +1,166 @@
/**
* Copyright (c) 2022 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { isNode } from 'common/Platform';
interface ITaskQueue {
/**
* Adds a task to the queue which will run in a future idle callback.
* To avoid perceivable stalls on the mainthread, tasks with heavy workload
* should split their work into smaller pieces and return `true` to get
* called again until the work is done (on falsy return value).
*/
enqueue(task: () => boolean | void): void;
/**
* Flushes the queue, running all remaining tasks synchronously.
*/
flush(): void;
/**
* Clears any remaining tasks from the queue, these will not be run.
*/
clear(): void;
}
interface ITaskDeadline {
timeRemaining(): number;
}
type CallbackWithDeadline = (deadline: ITaskDeadline) => void;
abstract class TaskQueue implements ITaskQueue {
private _tasks: (() => boolean | void)[] = [];
private _idleCallback?: number;
private _i = 0;
protected abstract _requestCallback(callback: CallbackWithDeadline): number;
protected abstract _cancelCallback(identifier: number): void;
public enqueue(task: () => boolean | void): void {
this._tasks.push(task);
this._start();
}
public flush(): void {
while (this._i < this._tasks.length) {
if (!this._tasks[this._i]()) {
this._i++;
}
}
this.clear();
}
public clear(): void {
if (this._idleCallback) {
this._cancelCallback(this._idleCallback);
this._idleCallback = undefined;
}
this._i = 0;
this._tasks.length = 0;
}
private _start(): void {
if (!this._idleCallback) {
this._idleCallback = this._requestCallback(this._process.bind(this));
}
}
private _process(deadline: ITaskDeadline): void {
this._idleCallback = undefined;
let taskDuration = 0;
let longestTask = 0;
let lastDeadlineRemaining = deadline.timeRemaining();
let deadlineRemaining = 0;
while (this._i < this._tasks.length) {
taskDuration = Date.now();
if (!this._tasks[this._i]()) {
this._i++;
}
// other than performance.now, Date.now might not be stable (changes on wall clock changes),
// this is not an issue here as a clock change during a short running task is very unlikely
// in case it still happened and leads to negative duration, simply assume 1 msec
taskDuration = Math.max(1, Date.now() - taskDuration);
longestTask = Math.max(taskDuration, longestTask);
// Guess the following task will take a similar time to the longest task in this batch, allow
// additional room to try avoid exceeding the deadline
deadlineRemaining = deadline.timeRemaining();
if (longestTask * 1.5 > deadlineRemaining) {
// Warn when the time exceeding the deadline is over 20ms, if this happens in practice the
// task should be split into sub-tasks to ensure the UI remains responsive.
if (lastDeadlineRemaining - taskDuration < -20) {
console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(lastDeadlineRemaining - taskDuration))}ms`);
}
this._start();
return;
}
lastDeadlineRemaining = deadlineRemaining;
}
this.clear();
}
}
/**
* A queue of that runs tasks over several tasks via setTimeout, trying to maintain above 60 frames
* per second. The tasks will run in the order they are enqueued, but they will run some time later,
* and care should be taken to ensure they're non-urgent and will not introduce race conditions.
*/
export class PriorityTaskQueue extends TaskQueue {
protected _requestCallback(callback: CallbackWithDeadline): number {
return setTimeout(() => callback(this._createDeadline(16)));
}
protected _cancelCallback(identifier: number): void {
clearTimeout(identifier);
}
private _createDeadline(duration: number): ITaskDeadline {
const end = Date.now() + duration;
return {
timeRemaining: () => Math.max(0, end - Date.now())
};
}
}
class IdleTaskQueueInternal extends TaskQueue {
protected _requestCallback(callback: IdleRequestCallback): number {
return requestIdleCallback(callback);
}
protected _cancelCallback(identifier: number): void {
cancelIdleCallback(identifier);
}
}
/**
* A queue of that runs tasks over several idle callbacks, trying to respect the idle callback's
* deadline given by the environment. The tasks will run in the order they are enqueued, but they
* will run some time later, and care should be taken to ensure they're non-urgent and will not
* introduce race conditions.
*
* This reverts to a {@link PriorityTaskQueue} if the environment does not support idle callbacks.
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
export const IdleTaskQueue = (!isNode && 'requestIdleCallback' in window) ? IdleTaskQueueInternal : PriorityTaskQueue;
/**
* An object that tracks a single debounced task that will run on the next idle frame. When called
* multiple times, only the last set task will run.
*/
export class DebouncedIdleTask {
private _queue: ITaskQueue;
constructor() {
this._queue = new IdleTaskQueue();
}
public set(task: () => boolean | void): void {
this._queue.clear();
this._queue.enqueue(task);
}
public flush(): void {
this._queue.flush();
}
}
@@ -0,0 +1,97 @@
"use client";
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/scroll-shadow.tsx
var scroll_shadow_exports = {};
__export(scroll_shadow_exports, {
default: () => scroll_shadow_default
});
module.exports = __toCommonJS(scroll_shadow_exports);
var import_system2 = require("@heroui/system");
// src/use-scroll-shadow.ts
var import_system = require("@heroui/system");
var import_theme = require("@heroui/theme");
var import_react_utils = require("@heroui/react-utils");
var import_use_data_scroll_overflow = require("@heroui/use-data-scroll-overflow");
var import_react = require("react");
var import_shared_utils = require("@heroui/shared-utils");
function useScrollShadow(originalProps) {
var _a;
const [props, variantProps] = (0, import_system.mapPropsVariants)(originalProps, import_theme.scrollShadow.variantKeys);
const {
ref,
as,
children,
className,
style,
size = 40,
offset = 0,
visibility = "auto",
isEnabled = true,
onVisibilityChange,
...otherProps
} = props;
const Component = as || "div";
const domRef = (0, import_react_utils.useDOMRef)(ref);
(0, import_use_data_scroll_overflow.useDataScrollOverflow)({
domRef,
offset,
visibility,
isEnabled,
onVisibilityChange,
updateDeps: [children],
overflowCheck: (_a = originalProps.orientation) != null ? _a : "vertical"
});
const styles = (0, import_react.useMemo)(
() => (0, import_theme.scrollShadow)({
...variantProps,
className
}),
[(0, import_shared_utils.objectToDeps)(variantProps), className]
);
const getBaseProps = (props2 = {}) => {
var _a2;
return {
ref: domRef,
className: styles,
"data-orientation": (_a2 = originalProps.orientation) != null ? _a2 : "vertical",
style: {
"--scroll-shadow-size": `${size}px`,
...style,
...props2.style
},
...otherProps,
...props2
};
};
return { Component, styles, domRef, children, getBaseProps };
}
// src/scroll-shadow.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var ScrollShadow = (0, import_system2.forwardRef)((props, ref) => {
const { Component, children, getBaseProps } = useScrollShadow({ ...props, ref });
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ...getBaseProps(), children });
});
ScrollShadow.displayName = "HeroUI.ScrollShadow";
var scroll_shadow_default = ScrollShadow;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {});
@@ -0,0 +1,202 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
var _tslib = require("tslib");
var _react = require("react");
var _isDev = _interopRequireDefault(require("../utils/isDev"));
var useDynamicList = function useDynamicList(initialList) {
if (initialList === void 0) {
initialList = [];
}
var counterRef = (0, _react.useRef)(-1);
var keyList = (0, _react.useRef)([]);
var setKey = (0, _react.useCallback)(function (index) {
counterRef.current += 1;
keyList.current.splice(index, 0, counterRef.current);
}, []);
var _a = (0, _tslib.__read)((0, _react.useState)(function () {
initialList.forEach(function (_, index) {
setKey(index);
});
return initialList;
}), 2),
list = _a[0],
setList = _a[1];
var resetList = (0, _react.useCallback)(function (newList) {
keyList.current = [];
setList(function () {
newList.forEach(function (_, index) {
setKey(index);
});
return newList;
});
}, []);
var insert = (0, _react.useCallback)(function (index, item) {
setList(function (l) {
var temp = (0, _tslib.__spreadArray)([], (0, _tslib.__read)(l), false);
temp.splice(index, 0, item);
setKey(index);
return temp;
});
}, []);
var getKey = (0, _react.useCallback)(function (index) {
return keyList.current[index];
}, []);
var getIndex = (0, _react.useCallback)(function (key) {
return keyList.current.findIndex(function (ele) {
return ele === key;
});
}, []);
var merge = (0, _react.useCallback)(function (index, items) {
setList(function (l) {
var temp = (0, _tslib.__spreadArray)([], (0, _tslib.__read)(l), false);
items.forEach(function (_, i) {
setKey(index + i);
});
temp.splice.apply(temp, (0, _tslib.__spreadArray)([index, 0], (0, _tslib.__read)(items), false));
return temp;
});
}, []);
var replace = (0, _react.useCallback)(function (index, item) {
setList(function (l) {
var temp = (0, _tslib.__spreadArray)([], (0, _tslib.__read)(l), false);
temp[index] = item;
return temp;
});
}, []);
var remove = (0, _react.useCallback)(function (index) {
setList(function (l) {
var temp = (0, _tslib.__spreadArray)([], (0, _tslib.__read)(l), false);
temp.splice(index, 1);
// remove keys if necessary
try {
keyList.current.splice(index, 1);
} catch (e) {
console.error(e);
}
return temp;
});
}, []);
var batchRemove = (0, _react.useCallback)(function (indexes) {
if (!Array.isArray(indexes)) {
if (_isDev["default"]) {
console.error("`indexes` parameter of `batchRemove` function expected to be an array, but got \"".concat((0, _typeof2["default"])(indexes), "\"."));
}
return;
}
if (!indexes.length) {
return;
}
setList(function (prevList) {
var newKeyList = [];
var newList = prevList.filter(function (item, index) {
var shouldKeep = !indexes.includes(index);
if (shouldKeep) {
newKeyList.push(getKey(index));
}
return shouldKeep;
});
keyList.current = newKeyList;
return newList;
});
}, []);
var move = (0, _react.useCallback)(function (oldIndex, newIndex) {
if (oldIndex === newIndex) {
return;
}
setList(function (l) {
var newList = (0, _tslib.__spreadArray)([], (0, _tslib.__read)(l), false);
var temp = newList.filter(function (_, index) {
return index !== oldIndex;
});
temp.splice(newIndex, 0, newList[oldIndex]);
// move keys if necessary
try {
var keyTemp = keyList.current.filter(function (_, index) {
return index !== oldIndex;
});
keyTemp.splice(newIndex, 0, keyList.current[oldIndex]);
keyList.current = keyTemp;
} catch (e) {
console.error(e);
}
return temp;
});
}, []);
var push = (0, _react.useCallback)(function (item) {
setList(function (l) {
setKey(l.length);
return l.concat([item]);
});
}, []);
var pop = (0, _react.useCallback)(function () {
// remove keys if necessary
try {
keyList.current = keyList.current.slice(0, keyList.current.length - 1);
} catch (e) {
console.error(e);
}
setList(function (l) {
return l.slice(0, l.length - 1);
});
}, []);
var unshift = (0, _react.useCallback)(function (item) {
setList(function (l) {
setKey(0);
return [item].concat(l);
});
}, []);
var shift = (0, _react.useCallback)(function () {
// remove keys if necessary
try {
keyList.current = keyList.current.slice(1, keyList.current.length);
} catch (e) {
console.error(e);
}
setList(function (l) {
return l.slice(1, l.length);
});
}, []);
var sortList = (0, _react.useCallback)(function (result) {
return result.map(function (item, index) {
return {
key: index,
item: item
};
}) // add index into obj
.sort(function (a, b) {
return getIndex(a.key) - getIndex(b.key);
}) // sort based on the index of table
.filter(function (item) {
return !!item.item;
}) // remove undefined(s)
.map(function (item) {
return item.item;
});
},
// retrive the data
[]);
return {
list: list,
insert: insert,
merge: merge,
replace: replace,
remove: remove,
batchRemove: batchRemove,
getKey: getKey,
getIndex: getIndex,
move: move,
push: push,
pop: pop,
unshift: unshift,
shift: shift,
sortList: sortList,
resetList: resetList
};
};
var _default = exports["default"] = useDynamicList;
@@ -0,0 +1 @@
{"name":"node-gyp","version":"9.4.1","requiresBuild":false,"files":{"gyp/.flake8":{"checkedAt":1794532120621,"integrity":"sha512-Q521Wwxc24ti2dlMexuyZXz9nDvTsYUWSc7qYMOclx+Xnk6iu7cSXd56tznLPyN/e6a03aDqVrkiOw+lv/xDdg==","mode":420,"size":121},"gyp/AUTHORS":{"checkedAt":1794532120621,"integrity":"sha512-uYcA6iGiMiHiFbBGpt/CT6cUYXcdFL5bPKTk/eUyAnwtsk+Oce53uthM46V89rP7n8pzGBI/U7/jNCVBCAIqWw==","mode":420,"size":514},"gyp/gyp":{"checkedAt":1794532120621,"integrity":"sha512-sj95hhPXkFXKefEYzJOLfiadGgoxaoAiED5AlwJR9h2Fw/j+eJL1K79OAoqbBNbYcfhi5t3aAuwEcI3q6RLVeQ==","mode":493,"size":240},"gyp/LICENSE":{"checkedAt":1794532120621,"integrity":"sha512-mt/hljcSed2bfMzP36/E+Kufk/1FgqDG+79MUt++ST+C276arpETwa/nOuX0Cstt59tXSlyk54LrePs37qyRcw==","mode":420,"size":1537},"LICENSE":{"checkedAt":1794532120621,"integrity":"sha512-YTUClbksN7rfFIgm/yXOFAS036EAiHjmSyDZyTCm3YAbqCaafqhajyHBFdfE5LzMIx0koFqIz8gOx8pCugPpXQ==","mode":420,"size":1102},"gyp/tools/emacs/README":{"checkedAt":1794532120622,"integrity":"sha512-fnVDwXuorxv+FLjO408FAnDORyPCPu4icrO7M0LPA8yA9xmgx5g/o/O4s0SZ0L7G3dUT1ytfWepxiC+KAPYcAA==","mode":420,"size":410},"gyp/tools/README":{"checkedAt":1794532120622,"integrity":"sha512-zuJ4hHQjYW4QHyfBDoGAZS3aA4fks3WjxRycUhEopA6D/6WyRnTcgxxzdux1kuR4qwgMUGveQRrLRKSjqyjrFA==","mode":420,"size":838},"gyp/tools/Xcode/README":{"checkedAt":1794532120622,"integrity":"sha512-tIOA83IiBlHQwKYadxe9K1M8fEBRVdFBsDWOb8FNYv3oXdrdeNQAgBA4eLQfCSJIqJvN57viapBLiWgcw9TKCw==","mode":420,"size":289},"gyp/gyp.bat":{"checkedAt":1794532120622,"integrity":"sha512-zXzWYZIj+9/qURg5dDG+eiaj38Hm1lPUBGDCn7HPH5lmLWYhFJdkqqNHCSycv0/87jdBXWhighpc7ltRzo2ndw==","mode":493,"size":201},"gyp/data/win/large-pdb-shim.cc":{"checkedAt":1794532120622,"integrity":"sha512-PzUTPv0HQSRtoBA4aeQvqL2tXMpvCDhKB0QbEdBoeCnQu5oXYWT7VE/wpXoIxSW4q9YYZ35CAItXhfu1nGj/4A==","mode":420,"size":653},"src/win_delay_load_hook.cc":{"checkedAt":1794532120622,"integrity":"sha512-GkFMqjICJCC8FyVaxncENmLwG9kjKdn33/VdQVSX0WkJBTt19BiWkLWEWrBS94zHfCpNtMdqM89VNAt8LX5Njw==","mode":420,"size":872},"lib/Find-VisualStudio.cs":{"checkedAt":1794532120622,"integrity":"sha512-OgzdEMo8Ak8nH1aXo6FEf+nH6PsAvW3fbV80dZ+RSP0v5362//0YI9d/5D4O3Myk2M/3AUa2nUXDms98tqURdQ==","mode":420,"size":7931},"gyp/tools/emacs/gyp-tests.el":{"checkedAt":1794532120622,"integrity":"sha512-P6x1+QXqem8FcOSndkimJs5LJIScfufCSPVFc+JrivPkdPN/07+0ZhsEsLVD7+WCbqZTmFEeVkhOVnEMSAZ42A==","mode":420,"size":2182},"gyp/tools/emacs/gyp.el":{"checkedAt":1794532120623,"integrity":"sha512-PO42Jkvw6AYjl8P7S14wL4I+4tg78urvIVEfxCV8thUHemcMadDZY1JVefi154MJGeSRy1vCvkKA1zrTQiBSlw==","mode":420,"size":12181},"gyp/tools/emacs/testdata/media.gyp.fontified":{"checkedAt":1794532120623,"integrity":"sha512-kgYcWpH3l1xZlzh3m9cQ0dfsRZlHAUZMrs6p4X1FANVKppM2UJZssZMLMZn+rUVluIMeZwwNJZMKLlCTbX+UPw==","mode":420,"size":162854},"gyp/tools/emacs/testdata/media.gyp":{"checkedAt":1794532120623,"integrity":"sha512-AAYVO80MPqKq5gctLFL4QaWt+2Y6Kfz2q1xo8tPkal6X0YJI5PH3rcJv7MILnk01sS/aQ/ACiTMVCRMka57y3w==","mode":420,"size":37163},"addon.gypi":{"checkedAt":1794532120623,"integrity":"sha512-p8xFkx1opOMWzbNaw6ZDLjNgfD7zvHRXOEQYrydIYpzOsduC72j1NOSzIq0vQcahhBKeTVAZ5TCulflUwvBlXw==","mode":420,"size":5940},"test/fixtures/nodedir/include/node/config.gypi":{"checkedAt":1794532120623,"integrity":"sha512-SSVDOUiyxEPKz8FYAPTXOZHOj2Lm80/WKccRnUSEkKDCzGzQiBMD/orBPiw2KhFVTpvdd1HxWNPnv+cQ3Yl9XA==","mode":420,"size":78},"lib/build.js":{"checkedAt":1794532120624,"integrity":"sha512-a84h2pAv9lra0rvAQW8byUgAUIFCoeBJLb34KnYT+gG+amNjRrj+P+8zQCpamkeUmXBC3VuqP6vv49hTtu60PA==","mode":420,"size":5898},"test/fixtures/certs.js":{"checkedAt":1794532120624,"integrity":"sha512-VBHUwcB3145Zs022aAn0jqe3uhI0Egcs/nyfYQ3FijEwdGy84Jnn14E0Yy86U4a7BsI7RR+bXR7RQVEzwa4kmw==","mode":420,"size":8451},"lib/clean.js":{"checkedAt":1794532120624,"integrity":"sha512-mt1InmeCYOkK62anb+MR66hok5jXxZaQq2zdePV9ThQKS/Ui90Lpfys2PyheK2adaf6iasKr/o0z+7NFZPJCaw==","mode":420,"size":355},"test/common.js":{"checkedAt":1794532120624,"integrity":"sha512-y1lgUWJ+Zf7ymdxWYqaywsVk7X2Kx+IkOxVev0VBmgOBnSHhACFSzBN+yjXjonU6+aJEO6gI7RzGAc+JjTdC/Q==","mode":420,"size":112},"lib/configure.js":{"checkedAt":1794532120624,"integrity":"sha512-/wat30AierZGlPCuxZ5eD46WyVkHCavqU6bqUpuVBjFKjpBsI6oYV7coPqSoIxYMj3Zz0ieRRKsnWmhMODoUVw==","mode":420,"size":12356},"lib/create-config-gypi.js":{"checkedAt":1794532120624,"integrity":"sha512-3VzCVdpjyig+8lWQY3tOHAyGSFXH+F9LJ8GE/vupNqMH0fn9joZrmVxZtzK7CVqVhFYQR9DWb1VcxL+Ve0FrUA==","mode":420,"size":4698},"lib/find-node-directory.js":{"checkedAt":1794532120625,"integrity":"sha512-N75TgkVKW3Mev2jaeAtvHgAGjAZ7VPwMvOe+fIo7GJLloeUoFjlZuNIV1vgYqD7mbdZHXXftySWRH9AU8Pdq0Q==","mode":420,"size":2373},"lib/find-python.js":{"checkedAt":1794532120625,"integrity":"sha512-ejhIMjDjYz7S8frOCshQZafarTPGjKCbYav4ZXv4sgJeWiOiio3tJt6Vzu/gk9dJ1EKTxpFB8Unu5dGO8STDsQ==","mode":420,"size":12133},"lib/find-visualstudio.js":{"checkedAt":1794532120625,"integrity":"sha512-xJwg1XjMxHdRk/BJbUfD/P5t8segIY3FYCsdSPW1DAwomAE8UuBslUARSDE+zfb/lyU0e90odLine truncated
@@ -0,0 +1,218 @@
import { DOMAttributes, PressEvents, RefObject, FocusableElement, FocusEvents, HoverEvents, KeyboardEvents, MoveEvents, ScrollEvents, LongPressEvent } from "@react-types/shared";
import React, { ReactElement, ReactNode, FocusEvent } from "react";
export interface PressProps extends PressEvents {
/** Whether the target is in a controlled press state (e.g. an overlay it triggers is open). */
isPressed?: boolean;
/** Whether the press events should be disabled. */
isDisabled?: boolean;
/** Whether the target should not receive focus on press. */
preventFocusOnPress?: boolean;
/**
* Whether press events should be canceled when the pointer leaves the target while pressed.
* By default, this is `false`, which means if the pointer returns back over the target while
* still pressed, onPressStart will be fired again. If set to `true`, the press is canceled
* when the pointer leaves the target and onPressStart will not be fired if the pointer returns.
*/
shouldCancelOnPointerExit?: boolean;
/** Whether text selection should be enabled on the pressable element. */
allowTextSelectionOnPress?: boolean;
}
export interface PressHookProps extends PressProps {
/** A ref to the target element. */
ref?: RefObject<Element | null>;
}
export interface PressResult {
/** Whether the target is currently pressed. */
isPressed: boolean;
/** Props to spread on the target element. */
pressProps: DOMAttributes;
}
/**
* Handles press interactions across mouse, touch, keyboard, and screen readers.
* It normalizes behavior across browsers and platforms, and handles many nuances
* of dealing with pointer and keyboard events.
*/
export function usePress(props: PressHookProps): PressResult;
interface PressableProps extends PressProps {
children: ReactElement<DOMAttributes, string>;
}
export const Pressable: React.ForwardRefExoticComponent<PressableProps & React.RefAttributes<HTMLElement>>;
interface PressResponderProps extends PressProps {
children: ReactNode;
}
export const PressResponder: React.ForwardRefExoticComponent<PressResponderProps & React.RefAttributes<FocusableElement>>;
export function ClearPressResponder({ children }: {
children: ReactNode;
}): React.JSX.Element;
export interface FocusProps<Target = FocusableElement> extends FocusEvents<Target> {
/** Whether the focus events should be disabled. */
isDisabled?: boolean;
}
export interface FocusResult<Target = FocusableElement> {
/** Props to spread onto the target element. */
focusProps: DOMAttributes<Target>;
}
/**
* Handles focus events for the immediate target.
* Focus events on child elements will be ignored.
*/
export function useFocus<Target extends FocusableElement = FocusableElement>(props: FocusProps<Target>): FocusResult<Target>;
export type Modality = 'keyboard' | 'pointer' | 'virtual';
export type FocusVisibleHandler = (isFocusVisible: boolean) => void;
export interface FocusVisibleProps {
/** Whether the element is a text input. */
isTextInput?: boolean;
/** Whether the element will be auto focused. */
autoFocus?: boolean;
}
export interface FocusVisibleResult {
/** Whether keyboard focus is visible globally. */
isFocusVisible: boolean;
}
/**
* EXPERIMENTAL
* Adds a window (i.e. iframe) to the list of windows that are being tracked for focus visible.
*
* Sometimes apps render portions of their tree into an iframe. In this case, we cannot accurately track if the focus
* is visible because we cannot see interactions inside the iframe. If you have this in your application's architecture,
* then this function will attach event listeners inside the iframe. You should call `addWindowFocusTracking` with an
* element from inside the window you wish to add. We'll retrieve the relevant elements based on that.
* Note, you do not need to call this for the default window, as we call it for you.
*
* When you are ready to stop listening, but you do not wish to unmount the iframe, you may call the cleanup function
* returned by `addWindowFocusTracking`. Otherwise, when you unmount the iframe, all listeners and state will be cleaned
* up automatically for you.
*
* @param element @default document.body - The element provided will be used to get the window to add.
* @returns A function to remove the event listeners and cleanup the state.
*/
export function addWindowFocusTracking(element?: HTMLElement | null): () => void;
/**
* If true, keyboard focus is visible.
*/
export function isFocusVisible(): boolean;
export function getInteractionModality(): Modality | null;
export function setInteractionModality(modality: Modality): void;
/**
* Keeps state of the current modality.
*/
export function useInteractionModality(): Modality | null;
/**
* Manages focus visible state for the page, and subscribes individual components for updates.
*/
export function useFocusVisible(props?: FocusVisibleProps): FocusVisibleResult;
/**
* Listens for trigger change and reports if focus is visible (i.e., modality is not pointer).
*/
export function useFocusVisibleListener(fn: FocusVisibleHandler, deps: ReadonlyArray<any>, opts?: {
isTextInput?: boolean;
}): void;
export interface FocusWithinProps {
/** Whether the focus within events should be disabled. */
isDisabled?: boolean;
/** Handler that is called when the target element or a descendant receives focus. */
onFocusWithin?: (e: FocusEvent) => void;
/** Handler that is called when the target element and all descendants lose focus. */
onBlurWithin?: (e: FocusEvent) => void;
/** Handler that is called when the the focus within state changes. */
onFocusWithinChange?: (isFocusWithin: boolean) => void;
}
export interface FocusWithinResult {
/** Props to spread onto the target element. */
focusWithinProps: DOMAttributes;
}
/**
* Handles focus events for the target and its descendants.
*/
export function useFocusWithin(props: FocusWithinProps): FocusWithinResult;
export interface HoverProps extends HoverEvents {
/** Whether the hover events should be disabled. */
isDisabled?: boolean;
}
export interface HoverResult {
/** Props to spread on the target element. */
hoverProps: DOMAttributes;
isHovered: boolean;
}
/**
* Handles pointer hover interactions for an element. Normalizes behavior
* across browsers and platforms, and ignores emulated mouse events on touch devices.
*/
export function useHover(props: HoverProps): HoverResult;
export interface InteractOutsideProps {
ref: RefObject<Element | null>;
onInteractOutside?: (e: PointerEvent) => void;
onInteractOutsideStart?: (e: PointerEvent) => void;
/** Whether the interact outside events should be disabled. */
isDisabled?: boolean;
}
/**
* Example, used in components like Dialogs and Popovers so they can close
* when a user clicks outside them.
*/
export function useInteractOutside(props: InteractOutsideProps): void;
export interface KeyboardProps extends KeyboardEvents {
/** Whether the keyboard events should be disabled. */
isDisabled?: boolean;
}
export interface KeyboardResult {
/** Props to spread onto the target element. */
keyboardProps: DOMAttributes;
}
/**
* Handles keyboard interactions for a focusable element.
*/
export function useKeyboard(props: KeyboardProps): KeyboardResult;
export interface MoveResult {
/** Props to spread on the target element. */
moveProps: DOMAttributes;
}
/**
* Handles move interactions across mouse, touch, and keyboard, including dragging with
* the mouse or touch, and using the arrow keys. Normalizes behavior across browsers and
* platforms, and ignores emulated mouse events on touch devices.
*/
export function useMove(props: MoveEvents): MoveResult;
export interface ScrollWheelProps extends ScrollEvents {
/** Whether the scroll listener should be disabled. */
isDisabled?: boolean;
}
export function useScrollWheel(props: ScrollWheelProps, ref: RefObject<HTMLElement | null>): void;
export interface LongPressProps {
/** Whether long press events should be disabled. */
isDisabled?: boolean;
/** Handler that is called when a long press interaction starts. */
onLongPressStart?: (e: LongPressEvent) => void;
/**
* Handler that is called when a long press interaction ends, either
* over the target or when the pointer leaves the target.
*/
onLongPressEnd?: (e: LongPressEvent) => void;
/**
* Handler that is called when the threshold time is met while
* the press is over the target.
*/
onLongPress?: (e: LongPressEvent) => void;
/**
* The amount of time in milliseconds to wait before triggering a long press.
* @default 500ms
*/
threshold?: number;
/**
* A description for assistive techology users indicating that a long press
* action is available, e.g. "Long press to open menu".
*/
accessibilityDescription?: string;
}
export interface LongPressResult {
/** Props to spread on the target element. */
longPressProps: DOMAttributes;
}
/**
* Handles long press interactions across mouse and touch devices. Supports a customizable time threshold,
* accessibility description, and normalizes behavior across browsers and devices.
*/
export function useLongPress(props: LongPressProps): LongPressResult;
export type { PressEvent, PressEvents, MoveStartEvent, MoveMoveEvent, MoveEndEvent, MoveEvents, HoverEvent, HoverEvents, FocusEvents, KeyboardEvents } from '@react-types/shared';
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,12 @@
import { type COSEALG, type COSEPublicKey } from '../../cose.js';
import type { Uint8Array_ } from '../../../types/index.js';
/**
* Verify signatures with their public key. Supports EC2 and RSA public keys.
*/
export declare function verify(opts: {
cosePublicKey: COSEPublicKey;
signature: Uint8Array_;
data: Uint8Array_;
shaHashOverride?: COSEALG;
}): Promise<boolean>;
//# sourceMappingURL=verify.d.ts.map
@@ -0,0 +1,54 @@
import React from "react";
import Dropzone from "../../";
export default class Accept extends React.Component {
state = {
accepted: [],
rejected: [],
};
render() {
return (
<section>
<div className="dropzone">
<Dropzone
accept={{
"image/*": [".jpeg", ".png"],
}}
onDrop={(accepted, rejected) => {
this.setState({ accepted, rejected });
}}
>
{({ getRootProps }) => (
<div {...getRootProps()}>
<p>
Try dropping some files here, or click to select files to
upload.
</p>
<p>Only *.jpeg and *.png images will be accepted</p>
</div>
)}
</Dropzone>
</div>
<aside>
<h2>Accepted files</h2>
<ul>
{this.state.accepted.map((f) => (
<li key={f.name}>
{f.name} - {f.size} bytes
</li>
))}
</ul>
<h2>Rejected files</h2>
<ul>
{this.state.rejected.map((f) => (
<li key={f.name}>
{f.name} - {f.size} bytes
</li>
))}
</ul>
</aside>
</section>
);
}
}
@@ -0,0 +1,122 @@
//
// 2015-09-25
// I measured these limits on the size of a single ReadConsoleOutputW call.
// The limit seems to more-or-less disppear with Windows 8, which is the first
// OS to stop using ALPCs for console I/O. My guess is that the new I/O
// method does not use the 64KiB shared memory buffer that the ALPC method
// uses.
//
// I'm guessing the remaining difference between Windows 8/8.1 and Windows 10
// might be related to the 32-vs-64-bitness.
//
// Client OSs
//
// Windows XP 32-bit VM ==> up to 13304 characters
// - 13304x1 works, but 13305x1 fails instantly
// Windows 7 32-bit VM ==> between 16-17 thousand characters
// - 16000x1 works, 17000x1 fails instantly
// - 163x100 *crashes* conhost.exe but leaves VeryLargeRead.exe running
// Windows 8 32-bit VM ==> between 240-250 million characters
// - 10000x24000 works, but 10000x25000 does not
// Windows 8.1 32-bit VM ==> between 240-250 million characters
// - 10000x24000 works, but 10000x25000 does not
// Windows 10 64-bit VM ==> no limit (tested to 576 million characters)
// - 24000x24000 works
// - `ver` reports [Version 10.0.10240], conhost.exe and ConhostV1.dll are
// 10.0.10240.16384 for file and product version. ConhostV2.dll is
// 10.0.10240.16391 for file and product version.
//
// Server OSs
//
// Windows Server 2008 64-bit VM ==> 14300-14400 characters
// - 14300x1 works, 14400x1 fails instantly
// - This OS does not have conhost.exe.
// - `ver` reports [Version 6.0.6002]
// Windows Server 2008 R2 64-bit VM ==> 15600-15700 characters
// - 15600x1 works, 15700x1 fails instantly
// - This OS has conhost.exe, and procexp.exe reveals console ALPC ports in
// use in conhost.exe.
// - `ver` reports [Version 6.1.7601], conhost.exe is 6.1.7601.23153 for file
// and product version.
// Windows Server 2012 64-bit VM ==> at least 100 million characters
// - 10000x10000 works (VM had only 1GiB of RAM, so I skipped larger tests)
// - This OS has Windows 8's task manager and procexp.exe reveals the same
// lack of ALPC ports and the same \Device\ConDrv\* files as Windows 8.
// - `ver` reports [Version 6.2.9200], conhost.exe is 6.2.9200.16579 for file
// and product version.
//
// To summarize:
//
// client-OS server-OS notes
// ---------------------------------------------------------------------------
// XP Server 2008 CSRSS, small reads
// 7 Server 2008 R2 ALPC-to-conhost, small reads
// 8, 8.1 Server 2012 new I/O interface, large reads allowed
// 10 <no server OS yet> enhanced console w/rewrapping
//
// (Presumably, Win2K, Vista, and Win2K3 behave the same as XP. conhost.exe
// was announced as a Win7 feature.)
//
#include <windows.h>
#include <assert.h>
#include <vector>
#include "TestUtil.cc"
int main(int argc, char *argv[]) {
long long width = 9000;
long long height = 9000;
assert(argc >= 1);
if (argc == 4) {
width = atoi(argv[2]);
height = atoi(argv[3]);
} else {
if (argc == 3) {
width = atoi(argv[1]);
height = atoi(argv[2]);
}
wchar_t args[1024];
swprintf(args, 1024, L"CHILD %lld %lld", width, height);
startChildProcess(args);
return 0;
}
const HANDLE conout = GetStdHandle(STD_OUTPUT_HANDLE);
setWindowPos(0, 0, 1, 1);
setBufferSize(width, height);
setWindowPos(0, 0, std::min(80LL, width), std::min(50LL, height));
setCursorPos(0, 0);
printf("A");
fflush(stdout);
setCursorPos(width - 2, height - 1);
printf("B");
fflush(stdout);
trace("sizeof(CHAR_INFO) = %d", (int)sizeof(CHAR_INFO));
trace("Allocating buffer...");
CHAR_INFO *buffer = new CHAR_INFO[width * height];
assert(buffer != NULL);
memset(&buffer[0], 0, sizeof(CHAR_INFO));
memset(&buffer[width * height - 2], 0, sizeof(CHAR_INFO));
COORD bufSize = { width, height };
COORD bufCoord = { 0, 0 };
SMALL_RECT readRegion = { 0, 0, width - 1, height - 1 };
trace("ReadConsoleOutputW: calling...");
BOOL success = ReadConsoleOutputW(conout, buffer, bufSize, bufCoord, &readRegion);
trace("ReadConsoleOutputW: success=%d", success);
assert(buffer[0].Char.UnicodeChar == L'A');
assert(buffer[width * height - 2].Char.UnicodeChar == L'B');
trace("Top-left and bottom-right characters read successfully!");
Sleep(30000);
delete [] buffer;
return 0;
}
@@ -0,0 +1,23 @@
import type { TSchema, SchemaOptions } from '../schema/index';
import type { Static } from '../static/index';
import type { Ensure } from '../helpers/index';
import type { TReadonlyOptional } from '../readonly-optional/index';
import type { TReadonly } from '../readonly/index';
import type { TOptional } from '../optional/index';
import { Kind } from '../symbols/index';
type StaticReturnType<U extends TSchema, P extends unknown[]> = Static<U, P>;
type StaticParameter<T extends TSchema, P extends unknown[]> = T extends TReadonlyOptional<T> ? [Readonly<Static<T, P>>?] : T extends TReadonly<T> ? [Readonly<Static<T, P>>] : T extends TOptional<T> ? [Static<T, P>?] : [
Static<T, P>
];
type StaticParameters<T extends TSchema[], P extends unknown[], Acc extends unknown[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? StaticParameters<R, P, [...Acc, ...StaticParameter<L, P>]> : Acc);
type StaticConstructor<T extends TSchema[], U extends TSchema, P extends unknown[]> = Ensure<new (...param: StaticParameters<T, P>) => StaticReturnType<U, P>>;
export interface TConstructor<T extends TSchema[] = TSchema[], U extends TSchema = TSchema> extends TSchema {
[Kind]: 'Constructor';
static: StaticConstructor<T, U, this['params']>;
type: 'Constructor';
parameters: T;
returns: U;
}
/** `[JavaScript]` Creates a Constructor type */
export declare function Constructor<T extends TSchema[], U extends TSchema>(parameters: [...T], returns: U, options?: SchemaOptions): TConstructor<T, U>;
export {};
@@ -0,0 +1 @@
{"version":3,"file":"visit.js","sourceRoot":"","sources":["../../src/utils/visit.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,KAAK,CACnB,IAAmB,EACnB,IAGQ,EACR,WAIC;IAED,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACnB,OAAM;IACR,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;IACtB,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,CAAA;IACjC,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,CAAA;IACf,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9B,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAM;IACR,CAAC;IAED,KAAK,MAAM,SAAS,IAAI,WAAW,EAAE,CAAC;QACpC,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YAC5C,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,EAAE,CAAC;gBAC3D,SAAQ;YACV,CAAC;YACD,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAA;QAChC,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,IAAI,OAAO,CAAC,CAAA;IAExC,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,CAAA;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,67 @@
import { ParserOptions, TransformOptions } from "@babel/core";
import { Plugin, ResolvedConfig } from "vite";
//#region src/index.d.ts
interface Options {
include?: string | RegExp | Array<string | RegExp>;
exclude?: string | RegExp | Array<string | RegExp>;
/**
* Control where the JSX factory is imported from.
* https://esbuild.github.io/api/#jsx-import-source
* @default 'react'
*/
jsxImportSource?: string;
/**
* Note: Skipping React import with classic runtime is not supported from v4
* @default "automatic"
*/
jsxRuntime?: 'classic' | 'automatic';
/**
* Babel configuration applied in both dev and prod.
*/
babel?: BabelOptions | ((id: string, options: {
ssr?: boolean;
}) => BabelOptions);
/**
* React Fast Refresh runtime URL prefix.
* Useful in a module federation context to enable HMR by specifying
* the host application URL in the Vite config of a remote application.
* @example
* reactRefreshHost: 'http://localhost:3000'
*/
reactRefreshHost?: string;
/**
* If set, disables the recommendation to use `@vitejs/plugin-react-oxc`
*/
disableOxcRecommendation?: boolean;
}
type BabelOptions = Omit<TransformOptions, 'ast' | 'filename' | 'root' | 'sourceFileName' | 'sourceMaps' | 'inputSourceMap'>;
/**
* The object type used by the `options` passed to plugins with
* an `api.reactBabel` method.
*/
interface ReactBabelOptions extends BabelOptions {
plugins: Extract<BabelOptions['plugins'], any[]>;
presets: Extract<BabelOptions['presets'], any[]>;
overrides: Extract<BabelOptions['overrides'], any[]>;
parserOpts: ParserOptions & {
plugins: Extract<ParserOptions['plugins'], any[]>;
};
}
type ReactBabelHook = (babelConfig: ReactBabelOptions, context: ReactBabelHookContext, config: ResolvedConfig) => void;
type ReactBabelHookContext = {
ssr: boolean;
id: string;
};
type ViteReactPluginApi = {
/**
* Manipulate the Babel options of `@vitejs/plugin-react`
*/
reactBabel?: ReactBabelHook;
};
declare function viteReact(opts?: Options): Plugin[];
declare namespace viteReact {
var preambleCode: string;
}
//#endregion
export { BabelOptions, Options, ReactBabelOptions, ViteReactPluginApi, viteReact as default };
@@ -0,0 +1,50 @@
'use strict';
var hasOwn = require('hasown');
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var IsCallable = require('./IsCallable');
var ToBoolean = require('./ToBoolean');
// https://262.ecma-international.org/5.1/#sec-8.10.5
module.exports = function ToPropertyDescriptor(Obj) {
if (!isObject(Obj)) {
throw new $TypeError('ToPropertyDescriptor requires an object');
}
var desc = {};
if (hasOwn(Obj, 'enumerable')) {
desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);
}
if (hasOwn(Obj, 'configurable')) {
desc['[[Configurable]]'] = ToBoolean(Obj.configurable);
}
if (hasOwn(Obj, 'value')) {
desc['[[Value]]'] = Obj.value;
}
if (hasOwn(Obj, 'writable')) {
desc['[[Writable]]'] = ToBoolean(Obj.writable);
}
if (hasOwn(Obj, 'get')) {
var getter = Obj.get;
if (typeof getter !== 'undefined' && !IsCallable(getter)) {
throw new $TypeError('getter must be a function');
}
desc['[[Get]]'] = getter;
}
if (hasOwn(Obj, 'set')) {
var setter = Obj.set;
if (typeof setter !== 'undefined' && !IsCallable(setter)) {
throw new $TypeError('setter must be a function');
}
desc['[[Set]]'] = setter;
}
if ((hasOwn(desc, '[[Get]]') || hasOwn(desc, '[[Set]]')) && (hasOwn(desc, '[[Value]]') || hasOwn(desc, '[[Writable]]'))) {
throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
}
return desc;
};
@@ -0,0 +1,46 @@
/**
* common.js: Internal helper and utility functions for winston.
*
* (C) 2010 Charlie Robbins
* MIT LICENCE
*/
'use strict';
const { format } = require('util');
/**
* Set of simple deprecation notices and a way to expose them for a set of
* properties.
* @type {Object}
* @private
*/
exports.warn = {
deprecated(prop) {
return () => {
throw new Error(format('{ %s } was removed in winston@3.0.0.', prop));
};
},
useFormat(prop) {
return () => {
throw new Error([
format('{ %s } was removed in winston@3.0.0.', prop),
'Use a custom winston.format = winston.format(function) instead.'
].join('\n'));
};
},
forFunctions(obj, type, props) {
props.forEach(prop => {
obj[prop] = exports.warn[type](prop);
});
},
forProperties(obj, type, props) {
props.forEach(prop => {
const notice = exports.warn[type](prop);
Object.defineProperty(obj, prop, {
get: notice,
set: notice
});
});
}
};
@@ -0,0 +1,686 @@
# Minimal
0
==>
Script(ExpressionStatement(Number))
# Strings
"A string with \"double\" and 'single' quotes";
'A string with "double" and \'single\' quotes';
'\\';
"\\";
'A string with new \
line';
==>
Script(ExpressionStatement(String(Escape,Escape)),
ExpressionStatement(String(Escape,Escape)),
ExpressionStatement(String(Escape)),
ExpressionStatement(String(Escape)),
ExpressionStatement(String(Escape)))
# Numbers
101;
3.14;
3.14e+1;
0x1ABCDEFabcdef;
0o7632157312;
0b1010101001;
1e+3;
==>
Script(
ExpressionStatement(Number),
ExpressionStatement(Number),
ExpressionStatement(Number),
ExpressionStatement(Number),
ExpressionStatement(Number),
ExpressionStatement(Number),
ExpressionStatement(Number))
# Identifiers
theVar;
theVar2;
$_;
é象𫝄;
últimaVez;
県;
==>
Script(
ExpressionStatement(VariableName),
ExpressionStatement(VariableName),
ExpressionStatement(VariableName),
ExpressionStatement(VariableName),
ExpressionStatement(VariableName),
ExpressionStatement(VariableName))
# RegExps
/one\\/;
/one/g;
/one/i;
/one/gim;
/on\/e/gim;
/on[^/]afe/gim;
/[\]/]/;
==>
Script(
ExpressionStatement(RegExp),
ExpressionStatement(RegExp),
ExpressionStatement(RegExp),
ExpressionStatement(RegExp),
ExpressionStatement(RegExp),
ExpressionStatement(RegExp),
ExpressionStatement(RegExp))
# Arrays
[];
[ "item1" ];
[ "item1", ];
[ "item1", item2 ];
[ , item2 ];
[ item2 = 5 ];
[ a, ...b, c ];
==>
Script(
ExpressionStatement(ArrayExpression),
ExpressionStatement(ArrayExpression(String)),
ExpressionStatement(ArrayExpression(String)),
ExpressionStatement(ArrayExpression(String,VariableName)),
ExpressionStatement(ArrayExpression(VariableName)),
ExpressionStatement(ArrayExpression(AssignmentExpression(VariableName,Equals,Number))),
ExpressionStatement(ArrayExpression(VariableName, Spread, VariableName, VariableName)))
# Functions
[
function() {},
function(arg1, ...arg2) {
arg2;
},
function stuff() {},
function trailing(a,) {},
function trailing(a,b,) {}
]
==>
Script(ExpressionStatement(ArrayExpression(
FunctionExpression(function,ParamList,Block),
FunctionExpression(function,ParamList(VariableDefinition,Spread,VariableDefinition), Block(ExpressionStatement(VariableName))),
FunctionExpression(function,VariableDefinition,ParamList,Block),
FunctionExpression(function,VariableDefinition,ParamList(VariableDefinition), Block),
FunctionExpression(function,VariableDefinition,ParamList(VariableDefinition,VariableDefinition),Block))))
# Arrow functions
a => 1;
() => 2;
(d, e) => 3;
(f, g,) => {
return h;
};
async () => 4;
==>
Script(
ExpressionStatement(ArrowFunction(ParamList(VariableDefinition),Arrow,Number)),
ExpressionStatement(ArrowFunction(ParamList,Arrow,Number)),
ExpressionStatement(ArrowFunction(ParamList(VariableDefinition,VariableDefinition),Arrow,Number)),
ExpressionStatement(ArrowFunction(ParamList(VariableDefinition,VariableDefinition),Arrow,Block(ReturnStatement(return,VariableName)))),
ExpressionStatement(ArrowFunction(async,ParamList,Arrow,Number)))
# Arrow function followed by comma
({
a: () => 1,
b: "x"
})
==>
Script(ExpressionStatement(ParenthesizedExpression(ObjectExpression(
Property(PropertyDefinition,ArrowFunction(ParamList,Arrow,Number)),
Property(PropertyDefinition,String)))))
# Long potential arrow function
(assign = [to, from], from = assign[0], to = assign[1]);
==>
Script(ExpressionStatement(ParenthesizedExpression(SequenceExpression(
AssignmentExpression(VariableName,Equals,ArrayExpression(VariableName,VariableName)),
AssignmentExpression(VariableName,Equals,MemberExpression(VariableName,Number)),
AssignmentExpression(VariableName,Equals,MemberExpression(VariableName,Number))))))
# Ternary operator
condition ? case1 : case2;
x.y = some.condition ? 2**x : 1 - 2;
==>
Script(
ExpressionStatement(ConditionalExpression(VariableName,LogicOp,VariableName,LogicOp,VariableName)),
ExpressionStatement(AssignmentExpression(
MemberExpression(VariableName,PropertyName),Equals,
ConditionalExpression(
MemberExpression(VariableName,PropertyName),LogicOp,
BinaryExpression(Number,ArithOp,VariableName),LogicOp,
BinaryExpression(Number,ArithOp,Number)))))
# Type operators
typeof x;
x instanceof String;
==>
Script(ExpressionStatement(UnaryExpression(typeof,VariableName)),
ExpressionStatement(BinaryExpression(VariableName,instanceof,VariableName)))
# Delete
delete thing['prop'];
true ? delete thing.prop : null;
==>
Script(
ExpressionStatement(UnaryExpression(delete,MemberExpression(VariableName,String))),
ExpressionStatement(ConditionalExpression(BooleanLiteral,LogicOp,
UnaryExpression(delete,MemberExpression(VariableName,PropertyName)),LogicOp,null)))
# Void
a = void b();
==>
Script(ExpressionStatement(AssignmentExpression(VariableName,Equals,UnaryExpression(void,CallExpression(VariableName,ArgList)))))
# Augmented assignment
s |= 1;
t %= 2;
w ^= 3;
x += 4;
y.z *= 5;
z += 1;
a >>= 1;
b >>>= 1;
c <<= 1;
==>
Script(
ExpressionStatement(AssignmentExpression(VariableName,UpdateOp,Number)),
ExpressionStatement(AssignmentExpression(VariableName,UpdateOp,Number)),
ExpressionStatement(AssignmentExpression(VariableName,UpdateOp,Number)),
ExpressionStatement(AssignmentExpression(VariableName,UpdateOp,Number)),
ExpressionStatement(AssignmentExpression(MemberExpression(VariableName,PropertyName),UpdateOp,Number)),
ExpressionStatement(AssignmentExpression(VariableName,UpdateOp,Number)),
ExpressionStatement(AssignmentExpression(VariableName,UpdateOp,Number)),
ExpressionStatement(AssignmentExpression(VariableName,UpdateOp,Number)),
ExpressionStatement(AssignmentExpression(VariableName,UpdateOp,Number)))
# Operator precedence
a <= b && c >= d;
a.b = c ? d : e;
a && b(c) && d;
a && new b(c) && d;
typeof a == b && c instanceof d;
==>
Script(
ExpressionStatement(BinaryExpression(BinaryExpression(VariableName,CompareOp,VariableName),LogicOp,
BinaryExpression(VariableName,CompareOp,VariableName))),
ExpressionStatement(AssignmentExpression(MemberExpression(VariableName,PropertyName),Equals,
ConditionalExpression(VariableName,LogicOp,VariableName,LogicOp,VariableName))),
ExpressionStatement(BinaryExpression(BinaryExpression(VariableName,LogicOp,CallExpression(VariableName,ArgList(VariableName))),LogicOp,
VariableName)),
ExpressionStatement(BinaryExpression(BinaryExpression(VariableName,LogicOp,NewExpression(new,VariableName,ArgList(VariableName))),LogicOp,
VariableName)),
ExpressionStatement(BinaryExpression(BinaryExpression(UnaryExpression(typeof,VariableName),CompareOp,VariableName),LogicOp,
BinaryExpression(VariableName,instanceof,VariableName))))
# Rest args
foo(...rest);
==>
Script(ExpressionStatement(CallExpression(VariableName,ArgList(Spread,VariableName))))
# Forward slashes after parenthesized expressions
(foo - bar) / baz;
if (foo - bar) /baz/;
(this.a() / this.b() - 1) / 2;
==>
Script(
ExpressionStatement(BinaryExpression(ParenthesizedExpression(BinaryExpression(VariableName,ArithOp,VariableName)),ArithOp,VariableName)),
IfStatement(if,ParenthesizedExpression(BinaryExpression(VariableName,ArithOp,VariableName)),
ExpressionStatement(RegExp)),
ExpressionStatement(BinaryExpression(ParenthesizedExpression(
BinaryExpression(
BinaryExpression(
CallExpression(MemberExpression(this,PropertyName),ArgList),ArithOp,
CallExpression(MemberExpression(this,PropertyName),ArgList)),ArithOp,Number)),ArithOp,Number)))
# Yield expressions
yield db.users.where('[endpoint+email]');
yield* a;
yield [22];
==>
Script(
ExpressionStatement(YieldExpression(yield,
CallExpression(MemberExpression(MemberExpression(VariableName,PropertyName),PropertyName),ArgList(String)))),
ExpressionStatement(YieldExpression(yield,Star,VariableName)),
ExpressionStatement(YieldExpression(yield,ArrayExpression(Number))))
# Template strings
`one line`;
`multi
line`;
`multi
${2 + 2}
hello
${1, 2}
line`;
`$$$$`;
`$`;
`$$$$${ async }`;
`\\\``;
`one${`two${`three`}`}`;
f`hi${there}`;
==>
Script(
ExpressionStatement(TemplateString),
ExpressionStatement(TemplateString),
ExpressionStatement(TemplateString(
Interpolation(InterpolationStart,BinaryExpression(Number,ArithOp,Number),InterpolationEnd),
Interpolation(InterpolationStart,SequenceExpression(Number,Number),InterpolationEnd))),
ExpressionStatement(TemplateString),
ExpressionStatement(TemplateString),
ExpressionStatement(TemplateString(Interpolation(InterpolationStart,VariableName,InterpolationEnd))),
ExpressionStatement(TemplateString(Escape,Escape)),
ExpressionStatement(TemplateString(Interpolation(InterpolationStart,TemplateString(
Interpolation(InterpolationStart,TemplateString,InterpolationEnd)),InterpolationEnd))),
ExpressionStatement(TaggedTemplateExpression(VariableName,TemplateString(
Interpolation(InterpolationStart,VariableName,InterpolationEnd)))))
# Atoms
this;
null;
undefined;
true;
false;
==>
Script(
ExpressionStatement(this),
ExpressionStatement(null),
ExpressionStatement(VariableName),
ExpressionStatement(BooleanLiteral),
ExpressionStatement(BooleanLiteral))
# Objects
foo({},
{ a: "b" },
{ c: "d", "e": f, 1: 2 },
{
g,
[methodName]() {}
},
{b, get},
{a,});
==>
Script(ExpressionStatement(CallExpression(VariableName,ArgList(
ObjectExpression,
ObjectExpression(Property(PropertyDefinition,String)),
ObjectExpression(Property(PropertyDefinition,String),Property(String,VariableName),Property(Number,Number)),
ObjectExpression(Property(PropertyDefinition),Property(VariableName,ParamList,Block)),
ObjectExpression(Property(PropertyDefinition),Property(PropertyDefinition)),
ObjectExpression(Property(PropertyDefinition))))))
# Method definitions
({
foo: true,
add(a, b) {
return a + b;
},
get bar() { return c; },
set bar(a) { c = a; },
*barGenerator() { yield c; },
get() { return 1; }
});
==>
Script(ExpressionStatement(ParenthesizedExpression(ObjectExpression(
Property(PropertyDefinition,BooleanLiteral),
Property(PropertyDefinition,ParamList(VariableDefinition,VariableDefinition),
Block(ReturnStatement(return,BinaryExpression(VariableName,ArithOp,VariableName)))),
Property(get,PropertyDefinition,ParamList,Block(ReturnStatement(return,VariableName))),
Property(set,PropertyDefinition,ParamList(VariableDefinition),
Block(ExpressionStatement(AssignmentExpression(VariableName,Equals,VariableName)))),
Property(Star,PropertyDefinition,ParamList,Block(ExpressionStatement(YieldExpression(yield,VariableName)))),
Property(PropertyDefinition,ParamList,Block(ReturnStatement(return,Number)))))))
# Keyword property names
({
finally() {},
catch() {},
get: function () {},
set() {},
static: true,
async: true,
});
==>
Script(ExpressionStatement(ParenthesizedExpression(ObjectExpression(
Property(PropertyDefinition,ParamList,Block),
Property(PropertyDefinition,ParamList,Block),
Property(PropertyDefinition,FunctionExpression(function,ParamList,Block)),
Property(PropertyDefinition,ParamList,Block),
Property(PropertyDefinition,BooleanLiteral),
Property(PropertyDefinition,BooleanLiteral)))))
# Generator functions
[
function *() {},
function *generateStuff(arg1, arg2) {
yield;
yield arg2;
}
];
==>
Script(ExpressionStatement(ArrayExpression(
FunctionExpression(function,Star,ParamList,Block),
FunctionExpression(function,Star,VariableDefinition,ParamList(VariableDefinition,VariableDefinition),Block(
ExpressionStatement(VariableName),
ExpressionStatement(YieldExpression(yield,VariableName)))))))
# Member expressions
x.someProperty;
x?.other;
x[someVariable];
f()["some-string"];
return returned.promise().done(a).fail(b);
==>
Script(
ExpressionStatement(MemberExpression(VariableName,PropertyName)),
ExpressionStatement(MemberExpression(VariableName,PropertyName)),
ExpressionStatement(MemberExpression(VariableName,VariableName)),
ExpressionStatement(MemberExpression(CallExpression(VariableName,ArgList),String)),
ReturnStatement(return,CallExpression(MemberExpression(CallExpression(MemberExpression(CallExpression(
MemberExpression(VariableName,PropertyName),ArgList),PropertyName),ArgList(VariableName)),PropertyName),ArgList(VariableName))))
# Callback chain
return this.map(function (a) {
return a.b;
})
// a comment
.filter(function (c) {
return 2;
});
==>
Script(ReturnStatement(return,CallExpression(MemberExpression(CallExpression(MemberExpression(this,PropertyName),
ArgList(FunctionExpression(function,ParamList(VariableDefinition),Block(ReturnStatement(return,MemberExpression(VariableName,PropertyName)))))),
LineComment,PropertyName),ArgList(FunctionExpression(function,ParamList(VariableDefinition),Block(ReturnStatement(return,Number)))))))
# Function calls
x.someMethod(arg1, "arg2");
(function(x, y) {
}(a, b));
f(new foo.bar(1), 2);
==>
Script(
ExpressionStatement(CallExpression(MemberExpression(VariableName,PropertyName),ArgList(VariableName,String))),
ExpressionStatement(ParenthesizedExpression(CallExpression(FunctionExpression(function,ParamList(VariableDefinition,VariableDefinition),Block),
ArgList(VariableName,VariableName)))),
ExpressionStatement(CallExpression(VariableName,ArgList(NewExpression(new,MemberExpression(VariableName,PropertyName),ArgList(Number)),Number))))
# Constructor calls
new foo(1);
new module.Klass(1, "two");
new Thing;
==>
Script(
ExpressionStatement(NewExpression(new,VariableName,ArgList(Number))),
ExpressionStatement(NewExpression(new,MemberExpression(VariableName,PropertyName),ArgList(Number,String))),
ExpressionStatement(NewExpression(new,VariableName)))
# Await Expressions
await asyncFunction();
await asyncPromise;
==>
Script(
ExpressionStatement(AwaitExpression(await,CallExpression(VariableName,ArgList))),
ExpressionStatement(AwaitExpression(await,VariableName)))
# Numeric operators
i++;
i--;
i + j * 3 - j % 5;
2 ** i * 3;
2 * i ** 3;
+x;
-x;
==>
Script(
ExpressionStatement(PostfixExpression(VariableName,ArithOp)),
ExpressionStatement(PostfixExpression(VariableName,ArithOp)),
ExpressionStatement(BinaryExpression(BinaryExpression(VariableName,ArithOp,BinaryExpression(VariableName,ArithOp,Number)),ArithOp,BinaryExpression(VariableName,ArithOp,Number))),
ExpressionStatement(BinaryExpression(BinaryExpression(Number,ArithOp,VariableName),ArithOp,Number)),
ExpressionStatement(BinaryExpression(Number,ArithOp,BinaryExpression(VariableName,ArithOp,Number))),
ExpressionStatement(UnaryExpression(ArithOp,VariableName)),
ExpressionStatement(UnaryExpression(ArithOp,VariableName)))
# Boolean operators
i || j;
i && j;
i ?? j;
!a && !b || !c && !d;
==>
Script(
ExpressionStatement(BinaryExpression(VariableName,LogicOp,VariableName)),
ExpressionStatement(BinaryExpression(VariableName,LogicOp,VariableName)),
ExpressionStatement(BinaryExpression(VariableName,LogicOp,VariableName)),
ExpressionStatement(BinaryExpression(BinaryExpression(UnaryExpression(LogicOp,VariableName),LogicOp,
UnaryExpression(LogicOp,VariableName)),LogicOp,BinaryExpression(UnaryExpression(LogicOp,VariableName),LogicOp,
UnaryExpression(LogicOp,VariableName)))))
# Bitwise operators
i >> j;
i >>> j;
i << j;
i & j;
i | j;
~i ^ ~j;
==>
Script(
ExpressionStatement(BinaryExpression(VariableName,BitOp,VariableName)),
ExpressionStatement(BinaryExpression(VariableName,BitOp,VariableName)),
ExpressionStatement(BinaryExpression(VariableName,BitOp,VariableName)),
ExpressionStatement(BinaryExpression(VariableName,BitOp,VariableName)),
ExpressionStatement(BinaryExpression(VariableName,BitOp,VariableName)),
ExpressionStatement(BinaryExpression(UnaryExpression(BitOp,VariableName),BitOp,UnaryExpression(BitOp,VariableName))))
# Relational operators
x < y;
x <= y;
x == y;
x === y;
x != y;
x !== y;
x > y;
x >= y;
==>
Script(
ExpressionStatement(BinaryExpression(VariableName,CompareOp,VariableName)),
ExpressionStatement(BinaryExpression(VariableName,CompareOp,VariableName)),
ExpressionStatement(BinaryExpression(VariableName,CompareOp,VariableName)),
ExpressionStatement(BinaryExpression(VariableName,CompareOp,VariableName)),
ExpressionStatement(BinaryExpression(VariableName,CompareOp,VariableName)),
ExpressionStatement(BinaryExpression(VariableName,CompareOp,VariableName)),
ExpressionStatement(BinaryExpression(VariableName,CompareOp,VariableName)),
ExpressionStatement(BinaryExpression(VariableName,CompareOp,VariableName)))
# Word operators
x in y;
x instanceof y;
!x instanceof y;
==>
Script(
ExpressionStatement(BinaryExpression(VariableName,in,VariableName)),
ExpressionStatement(BinaryExpression(VariableName,instanceof,VariableName)),
ExpressionStatement(BinaryExpression(UnaryExpression(LogicOp,VariableName),instanceof,VariableName)))
# Assignments
x = 0;
x.y = 0;
x["y"] = 0;
async = 0;
[a, b = 2] = foo;
({a, b, ...d} = c);
==>
Script(
ExpressionStatement(AssignmentExpression(VariableName,Equals,Number)),
ExpressionStatement(AssignmentExpression(MemberExpression(VariableName,PropertyName),Equals,Number)),
ExpressionStatement(AssignmentExpression(MemberExpression(VariableName,String),Equals,Number)),
ExpressionStatement(AssignmentExpression(VariableName,Equals,Number)),
ExpressionStatement(AssignmentExpression(ArrayPattern(VariableDefinition,VariableDefinition,Equals,Number),Equals,VariableName)),
ExpressionStatement(ParenthesizedExpression(AssignmentExpression(ObjectPattern(
PatternProperty(PropertyName),PatternProperty(PropertyName),PatternProperty(Spread,VariableDefinition)),Equals,VariableName))))
# Comma operator
a = 1, b = 2;
c = {d: (3, 4 + 5)};
==>
Script(
ExpressionStatement(SequenceExpression(AssignmentExpression(VariableName,Equals,Number),AssignmentExpression(VariableName,Equals,Number))),
ExpressionStatement(AssignmentExpression(VariableName,Equals,ObjectExpression(
Property(PropertyDefinition,ParenthesizedExpression(SequenceExpression(Number,BinaryExpression(Number,ArithOp,Number))))))))
# Punctuation
(foo(1, 2), bar);
==>
Script(ExpressionStatement(ParenthesizedExpression(
"(",SequenceExpression(CallExpression(VariableName,ArgList("(",Number,Number,")")),",",VariableName),")")))
# Doesn't choke on unfinished ternary operator
1?1
==>
Script(ExpressionStatement(ConditionalExpression(Number,LogicOp,Number,⚠)))
# Can handle unterminated template literals
`f
==>
Script(ExpressionStatement(TemplateString(⚠)))
# Ternary with leading-dot number
a?.2:.3
==>
Script(ExpressionStatement(ConditionalExpression(VariableName,LogicOp,Number,LogicOp,Number)))
@@ -0,0 +1,50 @@
import {isElementVisible as $7d2416ea0959daaa$export$e989c0fffaa6b27a} from "./isElementVisible.mjs";
/*
* Copyright 2025 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 $b4b717babfbb907b$var$focusableElements = [
'input:not([disabled]):not([type=hidden])',
'select:not([disabled])',
'textarea:not([disabled])',
'button:not([disabled])',
'a[href]',
'area[href]',
'summary',
'iframe',
'object',
'embed',
'audio[controls]',
'video[controls]',
'[contenteditable]:not([contenteditable^="false"])',
'permission'
];
const $b4b717babfbb907b$var$FOCUSABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';
$b4b717babfbb907b$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
const $b4b717babfbb907b$var$TABBABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
function $b4b717babfbb907b$export$4c063cf1350e6fed(element) {
return element.matches($b4b717babfbb907b$var$FOCUSABLE_ELEMENT_SELECTOR) && (0, $7d2416ea0959daaa$export$e989c0fffaa6b27a)(element) && !$b4b717babfbb907b$var$isInert(element);
}
function $b4b717babfbb907b$export$bebd5a1431fec25d(element) {
return element.matches($b4b717babfbb907b$var$TABBABLE_ELEMENT_SELECTOR) && (0, $7d2416ea0959daaa$export$e989c0fffaa6b27a)(element) && !$b4b717babfbb907b$var$isInert(element);
}
function $b4b717babfbb907b$var$isInert(element) {
let node = element;
while(node != null){
if (node instanceof node.ownerDocument.defaultView.HTMLElement && node.inert) return true;
node = node.parentElement;
}
return false;
}
export {$b4b717babfbb907b$export$4c063cf1350e6fed as isFocusable, $b4b717babfbb907b$export$bebd5a1431fec25d as isTabbable};
//# sourceMappingURL=isFocusable.module.js.map
@@ -0,0 +1 @@
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AA+BM,SAAS,0CAAQ,KAAsB,EAAE,GAAuC;IACrF,IAAI,eACF,cAAc,cACd,OAAO,gBACP,YAAY,cACZ,UAAU,EACV,aAAa;IACb,SAAS,iBAAiB,cAC1B,UAAU,EACV,GAAG,YACJ,GAAG;IAEJ,IAAI,YAA2B,CAAC;IAChC,IAAI,gBAAgB,KAClB,YAAY;QACV,MAAM;QACN,UAAU,CAAC,aAAa,IAAI;IAC9B;IAEF,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;iBAAC;sBAAS;oBAAc;oBAAY;aAAY;IAAG;IAC1F,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,YAAY;QAAC,WAAW;IAAI;IAC1D,IAAI,sBAAsB,CAAA,GAAA,iBAAS,EAAE,gBAAgB;IACrD,IAAI,SAAS,CAAA,GAAA,gBAAQ;IACrB,IAAI,kBAAkB,CAAA,GAAA,mBAAW,EAAE;IAEnC,OAAO;mBACL;QACA,WAAW,CAAA,GAAA,iBAAS,EAAE,UAAU,iBAAiB;YAC/C,GAAG,mBAAmB;YACtB,GAAG,SAAS;YACZ,iBAAiB,cAAc;YAC/B,gBAAgB,KAAK,CAAC,eAAe;YACrC,SAAS,CAAC;oBACR;iBAAA,sBAAA,WAAW,OAAO,cAAlB,0CAAA,yBAAA,YAAqB;gBACrB,IAAI,mBAAmB;oBACrB,kBAAkB;oBAClB,QAAQ,IAAI,CAAC;gBACf;gBAEA,mGAAmG;gBACnG,IACE,CAAC,OAAO,QAAQ,IAChB,EAAE,aAAa,YAAY,qBAC3B,EAAE,aAAa,CAAC,IAAI,IACpB,0FAA0F;gBAC1F,CAAC,EAAE,kBAAkB,MACrB,CAAA,GAAA,2BAAmB,EAAE,EAAE,aAAa,EAAE,MACtC,MAAM,IAAI,EACV;oBACA,EAAE,cAAc;oBAChB,OAAO,IAAI,CAAC,EAAE,aAAa,EAAE,GAAG,MAAM,IAAI,EAAE,MAAM,aAAa;gBACjE;YACF;QACF;IACF;AACF","sources":["packages/@react-aria/link/src/useLink.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLinkProps} from '@react-types/link';\nimport {DOMAttributes, FocusableElement, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, shouldClientNavigate, useLinkProps, useRouter} from '@react-aria/utils';\nimport React from 'react';\nimport {useFocusable} from '@react-aria/focus';\nimport {usePress} from '@react-aria/interactions';\n\nexport interface AriaLinkOptions extends AriaLinkProps {\n /** Whether the link is disabled. */\n isDisabled?: boolean,\n /**\n * The HTML element used to render the link, e.g. 'a', or 'span'.\n * @default 'a'\n */\n elementType?: string\n}\n\nexport interface LinkAria {\n /** Props for the link element. */\n linkProps: DOMAttributes,\n /** Whether the link is currently pressed. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a link component.\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport function useLink(props: AriaLinkOptions, ref: RefObject<FocusableElement | null>): LinkAria {\n let {\n elementType = 'a',\n onPress,\n onPressStart,\n onPressEnd,\n // @ts-ignore\n onClick: deprecatedOnClick,\n isDisabled,\n ...otherProps\n } = props;\n\n let linkProps: DOMAttributes = {};\n if (elementType !== 'a') {\n linkProps = {\n role: 'link',\n tabIndex: !isDisabled ? 0 : undefined\n };\n }\n let {focusableProps} = useFocusable(props, ref);\n let {pressProps, isPressed} = usePress({onPress, onPressStart, onPressEnd, isDisabled, ref});\n let domProps = filterDOMProps(otherProps, {labelable: true});\n let interactionHandlers = mergeProps(focusableProps, pressProps);\n let router = useRouter();\n let routerLinkProps = useLinkProps(props);\n\n return {\n isPressed, // Used to indicate press state for visual\n linkProps: mergeProps(domProps, routerLinkProps, {\n ...interactionHandlers,\n ...linkProps,\n 'aria-disabled': isDisabled || undefined,\n 'aria-current': props['aria-current'],\n onClick: (e: React.MouseEvent<HTMLAnchorElement>) => {\n pressProps.onClick?.(e);\n if (deprecatedOnClick) {\n deprecatedOnClick(e);\n console.warn('onClick is deprecated, please use onPress');\n }\n\n // If a custom router is provided, prevent default and forward if this link should client navigate.\n if (\n !router.isNative &&\n e.currentTarget instanceof HTMLAnchorElement &&\n e.currentTarget.href &&\n // If props are applied to a router Link component, it may have already prevented default.\n !e.isDefaultPrevented() &&\n shouldClientNavigate(e.currentTarget, e) &&\n props.href\n ) {\n e.preventDefault();\n router.open(e.currentTarget, e, props.href, props.routerOptions);\n }\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"useLink.module.js.map"}
@@ -0,0 +1,171 @@
import { DiffOptions } from '@vitest/utils/diff';
import { F as File, T as Test, S as Suite, J as TaskResultPack, C as TaskEventPack, L as TestAnnotation, P as TestContext, I as ImportDuration, v as SequenceHooks, w as SequenceSetupFiles } from './hooks.d-C0RE9A6t.js';
export { A as AfterAllListener, l as AfterEachListener, B as BeforeAllListener, m as BeforeEachListener, n as Fixture, p as FixtureFn, q as FixtureOptions, r as Fixtures, s as InferFixturesTypes, O as OnTestFailedHandler, t as OnTestFinishedHandler, R as RunMode, u as RuntimeContext, e as SuiteAPI, f as SuiteCollector, x as SuiteFactory, a as SuiteHooks, c as Task, y as TaskBase, z as TaskCustomOptions, D as TaskHook, E as TaskMeta, G as TaskPopulated, H as TaskResult, K as TaskState, b as TaskUpdateEvent, d as TestAPI, M as TestAnnotationLocation, N as TestAttachment, Q as TestFunction, U as TestOptions, V as Use } from './hooks.d-C0RE9A6t.js';
import '@vitest/utils';
/**
* This is a subset of Vitest config that's required for the runner to work.
*/
interface VitestRunnerConfig {
root: string;
setupFiles: string[];
name?: string;
passWithNoTests: boolean;
testNamePattern?: RegExp;
allowOnly?: boolean;
sequence: {
shuffle?: boolean;
concurrent?: boolean;
seed: number;
hooks: SequenceHooks;
setupFiles: SequenceSetupFiles;
};
chaiConfig?: {
truncateThreshold?: number;
};
maxConcurrency: number;
testTimeout: number;
hookTimeout: number;
retry: number;
includeTaskLocation?: boolean;
diffOptions?: DiffOptions;
}
/**
* Possible options to run a single file in a test.
*/
interface FileSpecification {
filepath: string;
testLocations: number[] | undefined;
}
type VitestRunnerImportSource = "collect" | "setup";
interface VitestRunnerConstructor {
new (config: VitestRunnerConfig): VitestRunner;
}
type CancelReason = "keyboard-input" | "test-failure" | (string & Record<string, never>);
interface VitestRunner {
/**
* First thing that's getting called before actually collecting and running tests.
*/
onBeforeCollect?: (paths: string[]) => unknown;
/**
* Called after the file task was created but not collected yet.
*/
onCollectStart?: (file: File) => unknown;
/**
* Called after collecting tests and before "onBeforeRun".
*/
onCollected?: (files: File[]) => unknown;
/**
* Called when test runner should cancel next test runs.
* Runner should listen for this method and mark tests and suites as skipped in
* "onBeforeRunSuite" and "onBeforeRunTask" when called.
*/
cancel?: (reason: CancelReason) => unknown;
/**
* Called before running a single test. Doesn't have "result" yet.
*/
onBeforeRunTask?: (test: Test) => unknown;
/**
* Called before actually running the test function. Already has "result" with "state" and "startTime".
*/
onBeforeTryTask?: (test: Test, options: {
retry: number;
repeats: number;
}) => unknown;
/**
* When the task has finished running, but before cleanup hooks are called
*/
onTaskFinished?: (test: Test) => unknown;
/**
* Called after result and state are set.
*/
onAfterRunTask?: (test: Test) => unknown;
/**
* Called right after running the test function. Doesn't have new state yet. Will not be called, if the test function throws.
*/
onAfterTryTask?: (test: Test, options: {
retry: number;
repeats: number;
}) => unknown;
/**
* Called after the retry resolution happend. Unlike `onAfterTryTask`, the test now has a new state.
* All `after` hooks were also called by this point.
*/
onAfterRetryTask?: (test: Test, options: {
retry: number;
repeats: number;
}) => unknown;
/**
* Called before running a single suite. Doesn't have "result" yet.
*/
onBeforeRunSuite?: (suite: Suite) => unknown;
/**
* Called after running a single suite. Has state and result.
*/
onAfterRunSuite?: (suite: Suite) => unknown;
/**
* If defined, will be called instead of usual Vitest suite partition and handling.
* "before" and "after" hooks will not be ignored.
*/
runSuite?: (suite: Suite) => Promise<void>;
/**
* If defined, will be called instead of usual Vitest handling. Useful, if you have your custom test function.
* "before" and "after" hooks will not be ignored.
*/
runTask?: (test: Test) => Promise<void>;
/**
* Called, when a task is updated. The same as "onTaskUpdate" in a reporter, but this is running in the same thread as tests.
*/
onTaskUpdate?: (task: TaskResultPack[], events: TaskEventPack[]) => Promise<void>;
/**
* Called when annotation is added via the `context.annotate` method.
*/
onTestAnnotate?: (test: Test, annotation: TestAnnotation) => Promise<TestAnnotation>;
/**
* Called before running all tests in collected paths.
*/
onBeforeRunFiles?: (files: File[]) => unknown;
/**
* Called right after running all tests in collected paths.
*/
onAfterRunFiles?: (files: File[]) => unknown;
/**
* Called when new context for a test is defined. Useful if you want to add custom properties to the context.
* If you only want to define custom context, consider using "beforeAll" in "setupFiles" instead.
*
* @see https://vitest.dev/advanced/runner#your-task-function
*/
extendTaskContext?: (context: TestContext) => TestContext;
/**
* Called when test and setup files are imported. Can be called in two situations: when collecting tests and when importing setup files.
*/
importFile: (filepath: string, source: VitestRunnerImportSource) => unknown;
/**
* Function that is called when the runner attempts to get the value when `test.extend` is used with `{ injected: true }`
*/
injectValue?: (key: string) => unknown;
/**
* Gets the time spent importing each individual non-externalized file that Vitest collected.
*/
getImportDurations?: () => Record<string, ImportDuration>;
/**
* Publicly available configuration.
*/
config: VitestRunnerConfig;
/**
* The name of the current pool. Can affect how stack trace is inferred on the server side.
*/
pool?: string;
/**
* Return the worker context for fixtures specified with `scope: 'worker'`
*/
getWorkerContext?: () => Record<string, unknown>;
onCleanupWorkerContext?: (cleanup: () => unknown) => void;
/** @private */
_currentTaskStartTime?: number;
/** @private */
_currentTaskTimeout?: number;
}
export { File, ImportDuration, SequenceHooks, SequenceSetupFiles, Suite, TaskEventPack, TaskResultPack, Test, TestAnnotation, TestContext };
export type { CancelReason, FileSpecification, VitestRunner, VitestRunnerConfig, VitestRunnerConstructor, VitestRunnerImportSource };
@@ -0,0 +1,12 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2022_object = void 0;
const base_config_1 = require("./base-config");
exports.es2022_object = {
libs: [],
variables: [['ObjectConstructor', base_config_1.TYPE]],
};
@@ -0,0 +1,98 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const DescriptionFileUtils = require("./DescriptionFileUtils");
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
module.exports = class DescriptionFilePlugin {
/**
* @param {string | ResolveStepHook} source source
* @param {string[]} filenames filenames
* @param {boolean} pathIsFile pathIsFile
* @param {string | ResolveStepHook} target target
*/
constructor(source, filenames, pathIsFile, target) {
this.source = source;
this.filenames = filenames;
this.pathIsFile = pathIsFile;
this.target = target;
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
const target = resolver.ensureHook(this.target);
resolver
.getHook(this.source)
.tapAsync(
"DescriptionFilePlugin",
(request, resolveContext, callback) => {
const { path } = request;
if (!path) return callback();
const directory = this.pathIsFile
? DescriptionFileUtils.cdUp(path)
: path;
if (!directory) return callback();
DescriptionFileUtils.loadDescriptionFile(
resolver,
directory,
this.filenames,
request.descriptionFilePath
? {
path: request.descriptionFilePath,
content: request.descriptionFileData,
directory:
/** @type {string} */
(request.descriptionFileRoot),
}
: undefined,
resolveContext,
(err, result) => {
if (err) return callback(err);
if (!result) {
if (resolveContext.log) {
resolveContext.log(
`No description file found in ${directory} or above`,
);
}
return callback();
}
const relativePath = `.${path
.slice(result.directory.length)
.replace(/\\/g, "/")}`;
/** @type {ResolveRequest} */
const obj = {
...request,
descriptionFilePath: result.path,
descriptionFileData: result.content,
descriptionFileRoot: result.directory,
relativePath,
};
resolver.doResolve(
target,
obj,
`using description file: ${result.path} (relative path: ${relativePath})`,
resolveContext,
(err, result) => {
if (err) return callback(err);
// Don't allow other processing
if (result === undefined) return callback(null, null);
callback(null, result);
},
);
},
);
},
);
}
};
@@ -0,0 +1,29 @@
'use strict';
var $TypeError = require('es-errors/type');
var CreateIteratorResultObject = require('./CreateIteratorResultObject');
var GeneratorValidate = require('./GeneratorValidate');
var SLOT = require('internal-slot');
// https://262.ecma-international.org/16.0/#sec-generatorresume
module.exports = function GeneratorResume(generator, value, generatorBrand) {
var state = GeneratorValidate(generator, generatorBrand); // step 1
if (state === 'COMPLETED') {
return CreateIteratorResultObject(void undefined, true); // step 2
}
if (state !== 'SUSPENDED-START' && state !== 'SUSPENDED-YIELD') {
throw new $TypeError('Assertion failed: generator state is unexpected: ' + state); // step 3
}
var genContext = SLOT.get(generator, '[[GeneratorContext]]');
SLOT.set(generator, '[[GeneratorState]]', 'EXECUTING'); // step 7
var result = genContext(value); // steps 5-6, 8-10
return result;
};
@@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).EventEmitter3=t()}(this,(function(){"use strict";var e={};return function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,r,s,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var c=new o(r,s||e,i),f=n?n+t:t;return e._events[f]?e._events[f].fn?e._events[f]=[e._events[f],c]:e._events[f].push(c):(e._events[f]=c,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function c(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),c.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},c.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,s=r.length,i=new Array(s);o<s;o++)i[o]=r[o].fn;return i},c.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},c.prototype.emit=function(e,t,r,o,s,i){var c=n?n+e:e;if(!this._events[c])return!1;var f,u,a=this._events[c],l=arguments.length;if(a.fn){switch(a.once&&this.removeListener(e,a.fn,void 0,!0),l){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,t),!0;case 3:return a.fn.call(a.context,t,r),!0;case 4:return a.fn.call(a.context,t,r,o),!0;case 5:return a.fn.call(a.context,t,r,o,s),!0;case 6:return a.fn.call(a.context,t,r,o,s,i),!0}for(u=1,f=new Array(l-1);u<l;u++)f[u-1]=arguments[u];a.fn.apply(a.context,f)}else{var p,v=a.length;for(u=0;u<v;u++)switch(a[u].once&&this.removeListener(e,a[u].fn,void 0,!0),l){case 1:a[u].fn.call(a[u].context);break;case 2:a[u].fn.call(a[u].context,t);break;case 3:a[u].fn.call(a[u].context,t,r);break;case 4:a[u].fn.call(a[u].context,t,r,o);break;default:if(!f)for(p=1,f=new Array(l-1);p<l;p++)f[p-1]=arguments[p];a[u].fn.apply(a[u].context,f)}}return!0},c.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,r,o){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return i(this,s),this;var c=this._events[s];if(c.fn)c.fn!==t||o&&!c.once||r&&c.context!==r||i(this,s);else{for(var f=0,u=[],a=c.length;f<a;f++)(c[f].fn!==t||o&&!c[f].once||r&&c[f].context!==r)&&u.push(c[f]);u.length?this._events[s]=1===u.length?u[0]:u:i(this,s)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&i(this,t)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c}({get exports(){return e},set exports(t){e=t}}),e}));//# sourceMappingURL=eventemitter3.umd.min.js.map
@@ -0,0 +1,151 @@
import { lowerCamelCase } from "./lower-camel-case";
/**
* Scalar value types. This is a subset of field types declared by protobuf
* enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE
* are omitted, but the numerical values are identical.
*/
export var ScalarType;
(function (ScalarType) {
// 0 is reserved for errors.
// Order is weird for historical reasons.
ScalarType[ScalarType["DOUBLE"] = 1] = "DOUBLE";
ScalarType[ScalarType["FLOAT"] = 2] = "FLOAT";
// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
// negative values are likely.
ScalarType[ScalarType["INT64"] = 3] = "INT64";
ScalarType[ScalarType["UINT64"] = 4] = "UINT64";
// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
// negative values are likely.
ScalarType[ScalarType["INT32"] = 5] = "INT32";
ScalarType[ScalarType["FIXED64"] = 6] = "FIXED64";
ScalarType[ScalarType["FIXED32"] = 7] = "FIXED32";
ScalarType[ScalarType["BOOL"] = 8] = "BOOL";
ScalarType[ScalarType["STRING"] = 9] = "STRING";
// Tag-delimited aggregate.
// Group type is deprecated and not supported in proto3. However, Proto3
// implementations should still be able to parse the group wire format and
// treat group fields as unknown fields.
// TYPE_GROUP = 10,
// TYPE_MESSAGE = 11, // Length-delimited aggregate.
// New in version 2.
ScalarType[ScalarType["BYTES"] = 12] = "BYTES";
ScalarType[ScalarType["UINT32"] = 13] = "UINT32";
// TYPE_ENUM = 14,
ScalarType[ScalarType["SFIXED32"] = 15] = "SFIXED32";
ScalarType[ScalarType["SFIXED64"] = 16] = "SFIXED64";
ScalarType[ScalarType["SINT32"] = 17] = "SINT32";
ScalarType[ScalarType["SINT64"] = 18] = "SINT64";
})(ScalarType || (ScalarType = {}));
/**
* JavaScript representation of 64 bit integral types. Equivalent to the
* field option "jstype".
*
* By default, protobuf-ts represents 64 bit types as `bigint`.
*
* You can change the default behaviour by enabling the plugin parameter
* `long_type_string`, which will represent 64 bit types as `string`.
*
* Alternatively, you can change the behaviour for individual fields
* with the field option "jstype":
*
* ```protobuf
* uint64 my_field = 1 [jstype = JS_STRING];
* uint64 other_field = 2 [jstype = JS_NUMBER];
* ```
*/
export var LongType;
(function (LongType) {
/**
* Use JavaScript `bigint`.
*
* Field option `[jstype = JS_NORMAL]`.
*/
LongType[LongType["BIGINT"] = 0] = "BIGINT";
/**
* Use JavaScript `string`.
*
* Field option `[jstype = JS_STRING]`.
*/
LongType[LongType["STRING"] = 1] = "STRING";
/**
* Use JavaScript `number`.
*
* Large values will loose precision.
*
* Field option `[jstype = JS_NUMBER]`.
*/
LongType[LongType["NUMBER"] = 2] = "NUMBER";
})(LongType || (LongType = {}));
/**
* Protobuf 2.1.0 introduced packed repeated fields.
* Setting the field option `[packed = true]` enables packing.
*
* In proto3, all repeated fields are packed by default.
* Setting the field option `[packed = false]` disables packing.
*
* Packed repeated fields are encoded with a single tag,
* then a length-delimiter, then the element values.
*
* Unpacked repeated fields are encoded with a tag and
* value for each element.
*
* `bytes` and `string` cannot be packed.
*/
export var RepeatType;
(function (RepeatType) {
/**
* The field is not repeated.
*/
RepeatType[RepeatType["NO"] = 0] = "NO";
/**
* The field is repeated and should be packed.
* Invalid for `bytes` and `string`, they cannot be packed.
*/
RepeatType[RepeatType["PACKED"] = 1] = "PACKED";
/**
* The field is repeated but should not be packed.
* The only valid repeat type for repeated `bytes` and `string`.
*/
RepeatType[RepeatType["UNPACKED"] = 2] = "UNPACKED";
})(RepeatType || (RepeatType = {}));
/**
* Turns PartialFieldInfo into FieldInfo.
*/
export function normalizeFieldInfo(field) {
var _a, _b, _c, _d;
field.localName = (_a = field.localName) !== null && _a !== void 0 ? _a : lowerCamelCase(field.name);
field.jsonName = (_b = field.jsonName) !== null && _b !== void 0 ? _b : lowerCamelCase(field.name);
field.repeat = (_c = field.repeat) !== null && _c !== void 0 ? _c : RepeatType.NO;
field.opt = (_d = field.opt) !== null && _d !== void 0 ? _d : (field.repeat ? false : field.oneof ? false : field.kind == "message");
return field;
}
/**
* Read custom field options from a generated message type.
*
* @deprecated use readFieldOption()
*/
export function readFieldOptions(messageType, fieldName, extensionName, extensionType) {
var _a;
const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options;
return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : undefined;
}
export function readFieldOption(messageType, fieldName, extensionName, extensionType) {
var _a;
const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options;
if (!options) {
return undefined;
}
const optionVal = options[extensionName];
if (optionVal === undefined) {
return optionVal;
}
return extensionType ? extensionType.fromJson(optionVal) : optionVal;
}
export function readMessageOption(messageType, extensionName, extensionType) {
const options = messageType.options;
const optionVal = options[extensionName];
if (optionVal === undefined) {
return optionVal;
}
return extensionType ? extensionType.fromJson(optionVal) : optionVal;
}
@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var docAfterwordRole = {
abstract: false,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author'],
prohibitedProps: [],
props: {
'aria-disabled': null,
'aria-errormessage': null,
'aria-expanded': null,
'aria-haspopup': null,
'aria-invalid': null
},
relatedConcepts: [{
concept: {
name: 'afterword [EPUB-SSV]'
},
module: 'EPUB'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'structure', 'section', 'landmark']]
};
var _default = exports.default = docAfterwordRole;
@@ -0,0 +1,117 @@
'use strict';
const isPlainObject = require('is-plain-obj');
const arrify = require('arrify');
const kindOf = require('kind-of');
const push = (obj, prop, value) => {
if (!obj[prop]) {
obj[prop] = [];
}
obj[prop].push(value);
};
const insert = (obj, prop, key, value) => {
if (!obj[prop]) {
obj[prop] = {};
}
obj[prop][key] = value;
};
const prettyPrint = output => {
return Array.isArray(output) ?
`[${output.map(prettyPrint).join(', ')}]` :
kindOf(output) === 'string' ? JSON.stringify(output) : output;
};
const resolveType = value => {
if (Array.isArray(value) && value.length > 0) {
const [element] = value;
return `${kindOf(element)}-array`;
}
return kindOf(value);
};
const normalizeExpectedType = (type, defaultValue) => {
const inferredType = type === 'array' ? 'string-array' : type;
if (arrayTypes.includes(inferredType) && Array.isArray(defaultValue) && defaultValue.length === 0) {
return 'array';
}
return inferredType;
};
const passthroughOptions = ['stopEarly', 'unknown', '--'];
const primitiveTypes = ['string', 'boolean', 'number'];
const arrayTypes = primitiveTypes.map(t => `${t}-array`);
const availableTypes = [...primitiveTypes, 'array', ...arrayTypes];
const buildOptions = options => {
options = options || {};
const result = {};
passthroughOptions.forEach(key => {
if (options[key]) {
result[key] = options[key];
}
});
Object.keys(options).forEach(key => {
let value = options[key];
if (key === 'arguments') {
key = '_';
}
// If short form is used
// convert it to long form
// e.g. { 'name': 'string' }
if (typeof value === 'string') {
value = {type: value};
}
if (isPlainObject(value)) {
const props = value;
const {type} = props;
if (type) {
if (!availableTypes.includes(type)) {
throw new TypeError(`Expected type of "${key}" to be one of ${prettyPrint(availableTypes)}, got ${prettyPrint(type)}`);
}
if (arrayTypes.includes(type)) {
const [elementType] = type.split('-');
push(result, 'array', {key, [elementType]: true});
} else {
push(result, type, key);
}
}
if ({}.hasOwnProperty.call(props, 'default')) {
const {default: defaultValue} = props;
const defaultType = resolveType(defaultValue);
const expectedType = normalizeExpectedType(type, defaultValue);
if (expectedType && expectedType !== defaultType) {
throw new TypeError(`Expected "${key}" default value to be of type "${expectedType}", got ${prettyPrint(defaultType)}`);
}
insert(result, 'default', key, defaultValue);
}
arrify(props.alias).forEach(alias => {
insert(result, 'alias', alias, key);
});
}
});
return result;
};
module.exports = buildOptions;
module.exports.default = buildOptions;
@@ -0,0 +1,11 @@
export function cloneDeep(value) {
if (Array.isArray(value)) {
return value.map((child) => cloneDeep(child))
}
if (typeof value === 'object' && value !== null) {
return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, cloneDeep(v)]))
}
return value
}
@@ -0,0 +1,24 @@
export default function negateValue(value) {
value = `${value}`
if (value === '0') {
return '0'
}
// Flip sign of numbers
if (/^[+-]?(\d+|\d*\.\d+)(e[+-]?\d+)?(%|\w+)?$/.test(value)) {
return value.replace(/^[+-]?/, (sign) => (sign === '-' ? '' : '-'))
}
// What functions we support negating numeric values for
// var() isn't inherently a numeric function but we support it anyway
// The trigonometric functions are omitted because you'll need to use calc(…) with them _anyway_
// to produce generally useful results and that will be covered already
let numericFunctions = ['var', 'calc', 'min', 'max', 'clamp']
for (const fn of numericFunctions) {
if (value.includes(`${fn}(`)) {
return `calc(${value} * -1)`
}
}
}
@@ -0,0 +1,38 @@
import { ServiceIdentifier } from '@inversifyjs/common';
import { Cloneable } from '../../common/models/Cloneable';
import { OneToManyMapStar, OneToManyMapStartSpec } from '../../common/models/OneToManyMapStar';
import { AutobindOptions } from '../models/AutobindOptions';
import { Binding } from '../models/Binding';
declare enum BindingRelationKind {
id = "id",
moduleId = "moduleId",
serviceId = "serviceId"
}
export interface BindingRelation {
[BindingRelationKind.id]: number;
[BindingRelationKind.moduleId]?: number;
[BindingRelationKind.serviceId]: ServiceIdentifier;
}
export declare class OneToManyBindingMapStar extends OneToManyMapStar<Binding<unknown>, BindingRelation> {
protected _buildNewInstance(spec: OneToManyMapStartSpec<BindingRelation>): this;
protected _cloneModel(model: Binding<unknown>): Binding<unknown>;
}
export declare class BindingService implements Cloneable<BindingService> {
#private;
private constructor();
static build(getParent: () => BindingService | undefined, autobindOptions?: AutobindOptions): BindingService;
clone(): BindingService;
get<TResolved>(serviceIdentifier: ServiceIdentifier): Iterable<Binding<TResolved>> | undefined;
getChained<TResolved>(serviceIdentifier: ServiceIdentifier): Generator<Binding<TResolved>, void, unknown>;
getBoundServices(): Iterable<ServiceIdentifier>;
getById<TResolved>(id: number): Iterable<Binding<TResolved>> | undefined;
getByModuleId<TResolved>(moduleId: number): Iterable<Binding<TResolved>> | undefined;
getNonParentBindings<TResolved>(serviceId: ServiceIdentifier): Iterable<Binding<TResolved>> | undefined;
getNonParentBoundServices(): Iterable<ServiceIdentifier>;
removeById(id: number): void;
removeAllByModuleId(moduleId: number): void;
removeAllByServiceId(serviceId: ServiceIdentifier): void;
set<TInstance>(binding: Binding<TInstance>): void;
}
export {};
//# sourceMappingURL=BindingService.d.ts.map
@@ -0,0 +1,66 @@
import { CreateType } from '../create/type.mjs';
import { Discard } from '../discard/discard.mjs';
import { Computed } from '../computed/index.mjs';
import { Intersect } from '../intersect/index.mjs';
import { Literal } from '../literal/index.mjs';
import { Object } from '../object/index.mjs';
import { Union } from '../union/index.mjs';
import { IndexPropertyKeys } from '../indexed/index.mjs';
import { TransformKind } from '../symbols/symbols.mjs';
// ------------------------------------------------------------------
// Guards
// ------------------------------------------------------------------
import { IsMappedKey, IsMappedResult, IsIntersect, IsUnion, IsObject, IsSchema, IsLiteralValue, IsRef } from '../guard/kind.mjs';
import { IsArray as IsArrayValue } from '../guard/value.mjs';
// ------------------------------------------------------------------
// Infrastructure
// ------------------------------------------------------------------
import { PickFromMappedKey } from './pick-from-mapped-key.mjs';
import { PickFromMappedResult } from './pick-from-mapped-result.mjs';
function FromIntersect(types, propertyKeys) {
return types.map((type) => PickResolve(type, propertyKeys));
}
// prettier-ignore
function FromUnion(types, propertyKeys) {
return types.map((type) => PickResolve(type, propertyKeys));
}
// prettier-ignore
function FromProperties(properties, propertyKeys) {
const result = {};
for (const K2 of propertyKeys)
if (K2 in properties)
result[K2] = properties[K2];
return result;
}
// prettier-ignore
function FromObject(Type, keys, properties) {
const options = Discard(Type, [TransformKind, '$id', 'required', 'properties']);
const mappedProperties = FromProperties(properties, keys);
return Object(mappedProperties, options);
}
// prettier-ignore
function UnionFromPropertyKeys(propertyKeys) {
const result = propertyKeys.reduce((result, key) => IsLiteralValue(key) ? [...result, Literal(key)] : result, []);
return Union(result);
}
// prettier-ignore
function PickResolve(type, propertyKeys) {
return (IsIntersect(type) ? Intersect(FromIntersect(type.allOf, propertyKeys)) :
IsUnion(type) ? Union(FromUnion(type.anyOf, propertyKeys)) :
IsObject(type) ? FromObject(type, propertyKeys, type.properties) :
Object({}));
}
/** `[Json]` Constructs a type whose keys are picked from the given type */
// prettier-ignore
export function Pick(type, key, options) {
const typeKey = IsArrayValue(key) ? UnionFromPropertyKeys(key) : key;
const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
const isTypeRef = IsRef(type);
const isKeyRef = IsRef(key);
return (IsMappedResult(type) ? PickFromMappedResult(type, propertyKeys, options) :
IsMappedKey(key) ? PickFromMappedKey(type, key, options) :
(isTypeRef && isKeyRef) ? Computed('Pick', [type, typeKey], options) :
(!isTypeRef && isKeyRef) ? Computed('Pick', [type, typeKey], options) :
(isTypeRef && !isKeyRef) ? Computed('Pick', [type, typeKey], options) :
CreateType({ ...PickResolve(type, propertyKeys), ...options }));
}
@@ -0,0 +1,97 @@
/**
* Single-use utility classes to provide functionality to the {@link Glob}
* methods.
*
* @module
*/
import { Minipass } from 'minipass';
import { Path } from 'path-scurry';
import { IgnoreLike } from './ignore.js';
import { Pattern } from './pattern.js';
import { Processor } from './processor.js';
export interface GlobWalkerOpts {
absolute?: boolean;
allowWindowsEscape?: boolean;
cwd?: string | URL;
dot?: boolean;
dotRelative?: boolean;
follow?: boolean;
ignore?: string | string[] | IgnoreLike;
mark?: boolean;
matchBase?: boolean;
maxDepth?: number;
nobrace?: boolean;
nocase?: boolean;
nodir?: boolean;
noext?: boolean;
noglobstar?: boolean;
platform?: NodeJS.Platform;
posix?: boolean;
realpath?: boolean;
root?: string;
stat?: boolean;
signal?: AbortSignal;
windowsPathsNoEscape?: boolean;
withFileTypes?: boolean;
includeChildMatches?: boolean;
}
export type GWOFileTypesTrue = GlobWalkerOpts & {
withFileTypes: true;
};
export type GWOFileTypesFalse = GlobWalkerOpts & {
withFileTypes: false;
};
export type GWOFileTypesUnset = GlobWalkerOpts & {
withFileTypes?: undefined;
};
export type Result<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Path : O extends GWOFileTypesFalse ? string : O extends GWOFileTypesUnset ? string : Path | string;
export type Matches<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Set<Path> : O extends GWOFileTypesFalse ? Set<string> : O extends GWOFileTypesUnset ? Set<string> : Set<Path | string>;
export type MatchStream<O extends GlobWalkerOpts> = Minipass<Result<O>, Result<O>>;
/**
* basic walking utilities that all the glob walker types use
*/
export declare abstract class GlobUtil<O extends GlobWalkerOpts = GlobWalkerOpts> {
#private;
path: Path;
patterns: Pattern[];
opts: O;
seen: Set<Path>;
paused: boolean;
aborted: boolean;
signal?: AbortSignal;
maxDepth: number;
includeChildMatches: boolean;
constructor(patterns: Pattern[], path: Path, opts: O);
pause(): void;
resume(): void;
onResume(fn: () => any): void;
matchCheck(e: Path, ifDir: boolean): Promise<Path | undefined>;
matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined;
matchCheckSync(e: Path, ifDir: boolean): Path | undefined;
abstract matchEmit(p: Result<O>): void;
abstract matchEmit(p: string | Path): void;
matchFinish(e: Path, absolute: boolean): void;
match(e: Path, absolute: boolean, ifDir: boolean): Promise<void>;
matchSync(e: Path, absolute: boolean, ifDir: boolean): void;
walkCB(target: Path, patterns: Pattern[], cb: () => any): void;
walkCB2(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
walkCB3(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
walkCBSync(target: Path, patterns: Pattern[], cb: () => any): void;
walkCB2Sync(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
walkCB3Sync(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
}
export declare class GlobWalker<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
matches: Set<Result<O>>;
constructor(patterns: Pattern[], path: Path, opts: O);
matchEmit(e: Result<O>): void;
walk(): Promise<Set<Result<O>>>;
walkSync(): Set<Result<O>>;
}
export declare class GlobStream<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
results: Minipass<Result<O>, Result<O>>;
constructor(patterns: Pattern[], path: Path, opts: O);
matchEmit(e: Result<O>): void;
stream(): MatchStream<O>;
streamSync(): MatchStream<O>;
}
//# sourceMappingURL=walker.d.ts.map
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isProvider = void 0;
const class_provider_1 = require("./class-provider");
const value_provider_1 = require("./value-provider");
const token_provider_1 = require("./token-provider");
const factory_provider_1 = require("./factory-provider");
function isProvider(provider) {
return (class_provider_1.isClassProvider(provider) ||
value_provider_1.isValueProvider(provider) ||
token_provider_1.isTokenProvider(provider) ||
factory_provider_1.isFactoryProvider(provider));
}
exports.isProvider = isProvider;
@@ -0,0 +1,244 @@
/**
* @import {
* Code,
* InitialConstruct,
* Initializer,
* Resolver,
* State,
* TokenizeContext
* } from 'micromark-util-types'
*/
import {ok as assert} from 'devlop'
import {codes, constants, types} from 'micromark-util-symbol'
export const resolver = {resolveAll: createResolver()}
export const string = initializeFactory('string')
export const text = initializeFactory('text')
/**
* @param {'string' | 'text'} field
* Field.
* @returns {InitialConstruct}
* Construct.
*/
function initializeFactory(field) {
return {
resolveAll: createResolver(
field === 'text' ? resolveAllLineSuffixes : undefined
),
tokenize: initializeText
}
/**
* @this {TokenizeContext}
* Context.
* @type {Initializer}
*/
function initializeText(effects) {
const self = this
const constructs = this.parser.constructs[field]
const text = effects.attempt(constructs, start, notText)
return start
/** @type {State} */
function start(code) {
return atBreak(code) ? text(code) : notText(code)
}
/** @type {State} */
function notText(code) {
if (code === codes.eof) {
effects.consume(code)
return
}
effects.enter(types.data)
effects.consume(code)
return data
}
/** @type {State} */
function data(code) {
if (atBreak(code)) {
effects.exit(types.data)
return text(code)
}
// Data.
effects.consume(code)
return data
}
/**
* @param {Code} code
* Code.
* @returns {boolean}
* Whether the code is a break.
*/
function atBreak(code) {
if (code === codes.eof) {
return true
}
const list = constructs[code]
let index = -1
if (list) {
// Always populated by defaults.
assert(Array.isArray(list), 'expected `disable.null` to be populated')
while (++index < list.length) {
const item = list[index]
if (!item.previous || item.previous.call(self, self.previous)) {
return true
}
}
}
return false
}
}
}
/**
* @param {Resolver | undefined} [extraResolver]
* Resolver.
* @returns {Resolver}
* Resolver.
*/
function createResolver(extraResolver) {
return resolveAllText
/** @type {Resolver} */
function resolveAllText(events, context) {
let index = -1
/** @type {number | undefined} */
let enter
// A rather boring computation (to merge adjacent `data` events) which
// improves mm performance by 29%.
while (++index <= events.length) {
if (enter === undefined) {
if (events[index] && events[index][1].type === types.data) {
enter = index
index++
}
} else if (!events[index] || events[index][1].type !== types.data) {
// Don’t do anything if there is one data token.
if (index !== enter + 2) {
events[enter][1].end = events[index - 1][1].end
events.splice(enter + 2, index - enter - 2)
index = enter + 2
}
enter = undefined
}
}
return extraResolver ? extraResolver(events, context) : events
}
}
/**
* A rather ugly set of instructions which again looks at chunks in the input
* stream.
* The reason to do this here is that it is *much* faster to parse in reverse.
* And that we can’t hook into `null` to split the line suffix before an EOF.
* To do: figure out if we can make this into a clean utility, or even in core.
* As it will be useful for GFMs literal autolink extension (and maybe even
* tables?)
*
* @type {Resolver}
*/
function resolveAllLineSuffixes(events, context) {
let eventIndex = 0 // Skip first.
while (++eventIndex <= events.length) {
if (
(eventIndex === events.length ||
events[eventIndex][1].type === types.lineEnding) &&
events[eventIndex - 1][1].type === types.data
) {
const data = events[eventIndex - 1][1]
const chunks = context.sliceStream(data)
let index = chunks.length
let bufferIndex = -1
let size = 0
/** @type {boolean | undefined} */
let tabs
while (index--) {
const chunk = chunks[index]
if (typeof chunk === 'string') {
bufferIndex = chunk.length
while (chunk.charCodeAt(bufferIndex - 1) === codes.space) {
size++
bufferIndex--
}
if (bufferIndex) break
bufferIndex = -1
}
// Number
else if (chunk === codes.horizontalTab) {
tabs = true
size++
} else if (chunk === codes.virtualSpace) {
// Empty
} else {
// Replacement character, exit.
index++
break
}
}
// Allow final trailing whitespace.
if (context._contentTypeTextTrailing && eventIndex === events.length) {
size = 0
}
if (size) {
const token = {
type:
eventIndex === events.length ||
tabs ||
size < constants.hardBreakPrefixSizeMin
? types.lineSuffix
: types.hardBreakTrailing,
start: {
_bufferIndex: index
? bufferIndex
: data.start._bufferIndex + bufferIndex,
_index: data.start._index + index,
line: data.end.line,
column: data.end.column - size,
offset: data.end.offset - size
},
end: {...data.end}
}
data.end = {...token.start}
if (data.start.offset === data.end.offset) {
Object.assign(data, token)
} else {
events.splice(
eventIndex,
0,
['enter', token, context],
['exit', token, context]
)
eventIndex += 2
}
}
eventIndex++
}
}
return events
}
@@ -0,0 +1,100 @@
var NonStandardAuthorizationList_1;
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes, OctetString, } from "@peculiar/asn1-schema";
import { AuthorizationList, SecurityLevel, Version } from "./key_description";
let NonStandardAuthorization = class NonStandardAuthorization extends AuthorizationList {
};
NonStandardAuthorization = __decorate([
AsnType({ type: AsnTypeTypes.Choice })
], NonStandardAuthorization);
export { NonStandardAuthorization };
let NonStandardAuthorizationList = NonStandardAuthorizationList_1 = class NonStandardAuthorizationList extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, NonStandardAuthorizationList_1.prototype);
}
findProperty(key) {
const prop = this.find((o) => key in o);
if (prop) {
return prop[key];
}
return undefined;
}
};
NonStandardAuthorizationList = NonStandardAuthorizationList_1 = __decorate([
AsnType({ type: AsnTypeTypes.Sequence, itemType: NonStandardAuthorization })
], NonStandardAuthorizationList);
export { NonStandardAuthorizationList };
export class NonStandardKeyDescription {
get keyMintVersion() {
return this.keymasterVersion;
}
set keyMintVersion(value) {
this.keymasterVersion = value;
}
get keyMintSecurityLevel() {
return this.keymasterSecurityLevel;
}
set keyMintSecurityLevel(value) {
this.keymasterSecurityLevel = value;
}
get hardwareEnforced() {
return this.teeEnforced;
}
set hardwareEnforced(value) {
this.teeEnforced = value;
}
constructor(params = {}) {
this.attestationVersion = Version.KM4;
this.attestationSecurityLevel = SecurityLevel.software;
this.keymasterVersion = 0;
this.keymasterSecurityLevel = SecurityLevel.software;
this.attestationChallenge = new OctetString();
this.uniqueId = new OctetString();
this.softwareEnforced = new NonStandardAuthorizationList();
this.teeEnforced = new NonStandardAuthorizationList();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.Integer })
], NonStandardKeyDescription.prototype, "attestationVersion", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Enumerated })
], NonStandardKeyDescription.prototype, "attestationSecurityLevel", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Integer })
], NonStandardKeyDescription.prototype, "keymasterVersion", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Enumerated })
], NonStandardKeyDescription.prototype, "keymasterSecurityLevel", void 0);
__decorate([
AsnProp({ type: OctetString })
], NonStandardKeyDescription.prototype, "attestationChallenge", void 0);
__decorate([
AsnProp({ type: OctetString })
], NonStandardKeyDescription.prototype, "uniqueId", void 0);
__decorate([
AsnProp({ type: NonStandardAuthorizationList })
], NonStandardKeyDescription.prototype, "softwareEnforced", void 0);
__decorate([
AsnProp({ type: NonStandardAuthorizationList })
], NonStandardKeyDescription.prototype, "teeEnforced", void 0);
let NonStandardKeyMintKeyDescription = class NonStandardKeyMintKeyDescription extends NonStandardKeyDescription {
constructor(params = {}) {
if ("keymasterVersion" in params && !("keyMintVersion" in params)) {
params.keyMintVersion = params.keymasterVersion;
}
if ("keymasterSecurityLevel" in params && !("keyMintSecurityLevel" in params)) {
params.keyMintSecurityLevel = params.keymasterSecurityLevel;
}
if ("teeEnforced" in params && !("hardwareEnforced" in params)) {
params.hardwareEnforced = params.teeEnforced;
}
super(params);
}
};
NonStandardKeyMintKeyDescription = __decorate([
AsnType({ type: AsnTypeTypes.Sequence })
], NonStandardKeyMintKeyDescription);
export { NonStandardKeyMintKeyDescription };
@@ -0,0 +1,241 @@
/**
* Copyright (c) 2016 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { ICircularList } from 'common/Types';
import { EventEmitter } from 'common/EventEmitter';
import { Disposable } from 'common/Lifecycle';
export interface IInsertEvent {
index: number;
amount: number;
}
export interface IDeleteEvent {
index: number;
amount: number;
}
/**
* Represents a circular list; a list with a maximum size that wraps around when push is called,
* overriding values at the start of the list.
*/
export class CircularList<T> extends Disposable implements ICircularList<T> {
protected _array: (T | undefined)[];
private _startIndex: number;
private _length: number;
public readonly onDeleteEmitter = this.register(new EventEmitter<IDeleteEvent>());
public readonly onDelete = this.onDeleteEmitter.event;
public readonly onInsertEmitter = this.register(new EventEmitter<IInsertEvent>());
public readonly onInsert = this.onInsertEmitter.event;
public readonly onTrimEmitter = this.register(new EventEmitter<number>());
public readonly onTrim = this.onTrimEmitter.event;
constructor(
private _maxLength: number
) {
super();
this._array = new Array<T>(this._maxLength);
this._startIndex = 0;
this._length = 0;
}
public get maxLength(): number {
return this._maxLength;
}
public set maxLength(newMaxLength: number) {
// There was no change in maxLength, return early.
if (this._maxLength === newMaxLength) {
return;
}
// Reconstruct array, starting at index 0. Only transfer values from the
// indexes 0 to length.
const newArray = new Array<T | undefined>(newMaxLength);
for (let i = 0; i < Math.min(newMaxLength, this.length); i++) {
newArray[i] = this._array[this._getCyclicIndex(i)];
}
this._array = newArray;
this._maxLength = newMaxLength;
this._startIndex = 0;
}
public get length(): number {
return this._length;
}
public set length(newLength: number) {
if (newLength > this._length) {
for (let i = this._length; i < newLength; i++) {
this._array[i] = undefined;
}
}
this._length = newLength;
}
/**
* Gets the value at an index.
*
* Note that for performance reasons there is no bounds checking here, the index reference is
* circular so this should always return a value and never throw.
* @param index The index of the value to get.
* @returns The value corresponding to the index.
*/
public get(index: number): T | undefined {
return this._array[this._getCyclicIndex(index)];
}
/**
* Sets the value at an index.
*
* Note that for performance reasons there is no bounds checking here, the index reference is
* circular so this should always return a value and never throw.
* @param index The index to set.
* @param value The value to set.
*/
public set(index: number, value: T | undefined): void {
this._array[this._getCyclicIndex(index)] = value;
}
/**
* Pushes a new value onto the list, wrapping around to the start of the array, overriding index 0
* if the maximum length is reached.
* @param value The value to push onto the list.
*/
public push(value: T): void {
this._array[this._getCyclicIndex(this._length)] = value;
if (this._length === this._maxLength) {
this._startIndex = ++this._startIndex % this._maxLength;
this.onTrimEmitter.fire(1);
} else {
this._length++;
}
}
/**
* Advance ringbuffer index and return current element for recycling.
* Note: The buffer must be full for this method to work.
* @throws When the buffer is not full.
*/
public recycle(): T {
if (this._length !== this._maxLength) {
throw new Error('Can only recycle when the buffer is full');
}
this._startIndex = ++this._startIndex % this._maxLength;
this.onTrimEmitter.fire(1);
return this._array[this._getCyclicIndex(this._length - 1)]!;
}
/**
* Ringbuffer is at max length.
*/
public get isFull(): boolean {
return this._length === this._maxLength;
}
/**
* Removes and returns the last value on the list.
* @returns The popped value.
*/
public pop(): T | undefined {
return this._array[this._getCyclicIndex(this._length-- - 1)];
}
/**
* Deletes and/or inserts items at a particular index (in that order). Unlike
* Array.prototype.splice, this operation does not return the deleted items as a new array in
* order to save creating a new array. Note that this operation may shift all values in the list
* in the worst case.
* @param start The index to delete and/or insert.
* @param deleteCount The number of elements to delete.
* @param items The items to insert.
*/
public splice(start: number, deleteCount: number, ...items: T[]): void {
// Delete items
if (deleteCount) {
for (let i = start; i < this._length - deleteCount; i++) {
this._array[this._getCyclicIndex(i)] = this._array[this._getCyclicIndex(i + deleteCount)];
}
this._length -= deleteCount;
this.onDeleteEmitter.fire({ index: start, amount: deleteCount });
}
// Add items
for (let i = this._length - 1; i >= start; i--) {
this._array[this._getCyclicIndex(i + items.length)] = this._array[this._getCyclicIndex(i)];
}
for (let i = 0; i < items.length; i++) {
this._array[this._getCyclicIndex(start + i)] = items[i];
}
if (items.length) {
this.onInsertEmitter.fire({ index: start, amount: items.length });
}
// Adjust length as needed
if (this._length + items.length > this._maxLength) {
const countToTrim = (this._length + items.length) - this._maxLength;
this._startIndex += countToTrim;
this._length = this._maxLength;
this.onTrimEmitter.fire(countToTrim);
} else {
this._length += items.length;
}
}
/**
* Trims a number of items from the start of the list.
* @param count The number of items to remove.
*/
public trimStart(count: number): void {
if (count > this._length) {
count = this._length;
}
this._startIndex += count;
this._length -= count;
this.onTrimEmitter.fire(count);
}
public shiftElements(start: number, count: number, offset: number): void {
if (count <= 0) {
return;
}
if (start < 0 || start >= this._length) {
throw new Error('start argument out of range');
}
if (start + offset < 0) {
throw new Error('Cannot shift elements in list beyond index 0');
}
if (offset > 0) {
for (let i = count - 1; i >= 0; i--) {
this.set(start + i + offset, this.get(start + i));
}
const expandListBy = (start + count + offset) - this._length;
if (expandListBy > 0) {
this._length += expandListBy;
while (this._length > this._maxLength) {
this._length--;
this._startIndex++;
this.onTrimEmitter.fire(1);
}
}
} else {
for (let i = 0; i < count; i++) {
this.set(start + i + offset, this.get(start + i));
}
}
}
/**
* Gets the cyclic index for the specified regular index. The cyclic index can then be used on the
* backing array to get the element associated with the regular index.
* @param index The regular index.
* @returns The cyclic index.
*/
private _getCyclicIndex(index: number): number {
return (this._startIndex + index) % this._maxLength;
}
}
@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Optional = Optional;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
const index_2 = require("../discard/index");
const optional_from_mapped_result_1 = require("./optional-from-mapped-result");
const kind_1 = require("../guard/kind");
function RemoveOptional(schema) {
return (0, type_1.CreateType)((0, index_2.Discard)(schema, [index_1.OptionalKind]));
}
function AddOptional(schema) {
return (0, type_1.CreateType)({ ...schema, [index_1.OptionalKind]: 'Optional' });
}
// prettier-ignore
function OptionalWithFlag(schema, F) {
return (F === false
? RemoveOptional(schema)
: AddOptional(schema));
}
/** `[Json]` Creates a Optional property */
function Optional(schema, enable) {
const F = enable ?? true;
return (0, kind_1.IsMappedResult)(schema) ? (0, optional_from_mapped_result_1.OptionalFromMappedResult)(schema, F) : OptionalWithFlag(schema, F);
}
@@ -0,0 +1,141 @@
/**
* @typedef {import('mdast').ListItem} ListItem
* @typedef {import('mdast').Paragraph} Paragraph
* @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
* @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
* @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
* @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
* @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
*/
import {ok as assert} from 'devlop'
import {defaultHandlers} from 'mdast-util-to-markdown'
/**
* Create an extension for `mdast-util-from-markdown` to enable GFM task
* list items in markdown.
*
* @returns {FromMarkdownExtension}
* Extension for `mdast-util-from-markdown` to enable GFM task list items.
*/
export function gfmTaskListItemFromMarkdown() {
return {
exit: {
taskListCheckValueChecked: exitCheck,
taskListCheckValueUnchecked: exitCheck,
paragraph: exitParagraphWithTaskListItem
}
}
}
/**
* Create an extension for `mdast-util-to-markdown` to enable GFM task list
* items in markdown.
*
* @returns {ToMarkdownExtension}
* Extension for `mdast-util-to-markdown` to enable GFM task list items.
*/
export function gfmTaskListItemToMarkdown() {
return {
unsafe: [{atBreak: true, character: '-', after: '[:|-]'}],
handlers: {listItem: listItemWithTaskListItem}
}
}
/**
* @this {CompileContext}
* @type {FromMarkdownHandle}
*/
function exitCheck(token) {
// We’re always in a paragraph, in a list item.
const node = this.stack[this.stack.length - 2]
assert(node.type === 'listItem')
node.checked = token.type === 'taskListCheckValueChecked'
}
/**
* @this {CompileContext}
* @type {FromMarkdownHandle}
*/
function exitParagraphWithTaskListItem(token) {
const parent = this.stack[this.stack.length - 2]
if (
parent &&
parent.type === 'listItem' &&
typeof parent.checked === 'boolean'
) {
const node = this.stack[this.stack.length - 1]
assert(node.type === 'paragraph')
const head = node.children[0]
if (head && head.type === 'text') {
const siblings = parent.children
let index = -1
/** @type {Paragraph | undefined} */
let firstParaghraph
while (++index < siblings.length) {
const sibling = siblings[index]
if (sibling.type === 'paragraph') {
firstParaghraph = sibling
break
}
}
if (firstParaghraph === node) {
// Must start with a space or a tab.
head.value = head.value.slice(1)
if (head.value.length === 0) {
node.children.shift()
} else if (
node.position &&
head.position &&
typeof head.position.start.offset === 'number'
) {
head.position.start.column++
head.position.start.offset++
node.position.start = Object.assign({}, head.position.start)
}
}
}
}
this.exit(token)
}
/**
* @type {ToMarkdownHandle}
* @param {ListItem} node
*/
function listItemWithTaskListItem(node, parent, state, info) {
const head = node.children[0]
const checkable =
typeof node.checked === 'boolean' && head && head.type === 'paragraph'
const checkbox = '[' + (node.checked ? 'x' : ' ') + '] '
const tracker = state.createTracker(info)
if (checkable) {
tracker.move(checkbox)
}
let value = defaultHandlers.listItem(node, parent, state, {
...info,
...tracker.current()
})
if (checkable) {
value = value.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, check)
}
return value
/**
* @param {string} $0
* @returns {string}
*/
function check($0) {
return $0 + checkbox
}
}
@@ -0,0 +1,94 @@
aproba
======
A ridiculously light-weight function argument validator
```
var validate = require("aproba")
function myfunc(a, b, c) {
// `a` must be a string, `b` a number, `c` a function
validate('SNF', arguments) // [a,b,c] is also valid
}
myfunc('test', 23, function () {}) // ok
myfunc(123, 23, function () {}) // type error
myfunc('test', 23) // missing arg error
myfunc('test', 23, function () {}, true) // too many args error
```
Valid types are:
| type | description
| :--: | :----------
| * | matches any type
| A | `Array.isArray` OR an `arguments` object
| S | typeof == string
| N | typeof == number
| F | typeof == function
| O | typeof == object and not type A and not type E
| B | typeof == boolean
| E | `instanceof Error` OR `null` **(special: see below)**
| Z | == `null`
Validation failures throw one of three exception types, distinguished by a
`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`.
If you pass in an invalid type then it will throw with a code of
`EUNKNOWNTYPE`.
If an **error** argument is found and is not null then the remaining
arguments are optional. That is, if you say `ESO` then that's like using a
non-magical `E` in: `E|ESO|ZSO`.
### But I have optional arguments?!
You can provide more than one signature by separating them with pipes `|`.
If any signature matches the arguments then they'll be considered valid.
So for example, say you wanted to write a signature for
`fs.createWriteStream`. The docs for it describe it thusly:
```
fs.createWriteStream(path[, options])
```
This would be a signature of `SO|S`. That is, a string and and object, or
just a string.
Now, if you read the full `fs` docs, you'll see that actually path can ALSO
be a buffer. And options can be a string, that is:
```
path <String> | <Buffer>
options <String> | <Object>
```
To reproduce this you have to fully enumerate all of the possible
combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The
awkwardness is a feature: It reminds you of the complexity you're adding to
your API when you do this sort of thing.
### Browser support
This has no dependencies and should work in browsers, though you'll have
noisier stack traces.
### Why this exists
I wanted a very simple argument validator. It needed to do two things:
1. Be more concise and easier to use than assertions
2. Not encourage an infinite bikeshed of DSLs
This is why types are specified by a single character and there's no such
thing as an optional argument.
This is not intended to validate user data. This is specifically about
asserting the interface of your functions.
If you need greater validation, I encourage you to write them by hand or
look elsewhere.
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020
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,126 @@
"use client";
// src/overlays/ariaHideOutside.ts
var refCountMap = /* @__PURE__ */ new WeakMap();
var observerStack = [];
function ariaHideOutside(targets, root = document.body) {
let visibleNodes = new Set(targets);
let hiddenNodes = /* @__PURE__ */ new Set();
let walk = (root2) => {
for (let element of root2.querySelectorAll(
"[data-live-announcer], [data-react-aria-top-layer]"
)) {
visibleNodes.add(element);
}
let acceptNode = (node) => {
if (visibleNodes.has(node) || node.parentElement && hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute("role") !== "row") {
return NodeFilter.FILTER_REJECT;
}
for (let target of visibleNodes) {
if (node.contains(target)) {
return NodeFilter.FILTER_SKIP;
}
}
return NodeFilter.FILTER_ACCEPT;
};
let walker = document.createTreeWalker(root2, NodeFilter.SHOW_ELEMENT, { acceptNode });
let acceptRoot = acceptNode(root2);
if (acceptRoot === NodeFilter.FILTER_ACCEPT) {
hide(root2);
}
if (acceptRoot !== NodeFilter.FILTER_REJECT) {
let node = walker.nextNode();
while (node != null) {
hide(node);
node = walker.nextNode();
}
}
};
let hide = (node) => {
var _a;
let refCount = (_a = refCountMap.get(node)) != null ? _a : 0;
if (node.getAttribute("aria-hidden") === "true" && refCount === 0) {
return;
}
if (refCount === 0) {
node.setAttribute("aria-hidden", "true");
}
hiddenNodes.add(node);
refCountMap.set(node, refCount + 1);
};
if (observerStack.length) {
observerStack[observerStack.length - 1].disconnect();
}
walk(root);
let observer = new MutationObserver((changes) => {
for (let change of changes) {
if (change.type !== "childList" || change.addedNodes.length === 0) {
continue;
}
if (![...visibleNodes, ...hiddenNodes].some((node) => node.contains(change.target))) {
for (let node of change.removedNodes) {
if (node instanceof Element) {
visibleNodes.delete(node);
hiddenNodes.delete(node);
}
}
for (let node of change.addedNodes) {
if ((node instanceof HTMLElement || node instanceof SVGElement) && (node.dataset.liveAnnouncer === "true" || node.dataset.reactAriaTopLayer === "true")) {
visibleNodes.add(node);
} else if (node instanceof Element) {
walk(node);
}
}
}
}
});
observer.observe(root, { childList: true, subtree: true });
let observerWrapper = {
visibleNodes,
hiddenNodes,
observe() {
observer.observe(root, { childList: true, subtree: true });
},
disconnect() {
observer.disconnect();
}
};
observerStack.push(observerWrapper);
return () => {
observer.disconnect();
for (let node of hiddenNodes) {
let count = refCountMap.get(node);
if (count == null) {
continue;
}
if (count === 1) {
node.removeAttribute("aria-hidden");
refCountMap.delete(node);
} else {
refCountMap.set(node, count - 1);
}
}
if (observerWrapper === observerStack[observerStack.length - 1]) {
observerStack.pop();
if (observerStack.length) {
observerStack[observerStack.length - 1].observe();
}
} else {
observerStack.splice(observerStack.indexOf(observerWrapper), 1);
}
};
}
function keepVisible(element) {
let observer = observerStack[observerStack.length - 1];
if (observer && !observer.visibleNodes.has(element)) {
observer.visibleNodes.add(element);
return () => {
observer.visibleNodes.delete(element);
};
}
}
export {
ariaHideOutside,
keepVisible
};
@@ -0,0 +1,51 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/children.ts
var children_exports = {};
__export(children_exports, {
getValidChildren: () => getValidChildren,
pickChildren: () => pickChildren
});
module.exports = __toCommonJS(children_exports);
var import_react = require("react");
function getValidChildren(children) {
return import_react.Children.toArray(children).filter(
(child) => (0, import_react.isValidElement)(child)
);
}
var pickChildren = (children, targetChild) => {
var _a;
let target = [];
const withoutTargetChildren = (_a = import_react.Children.map(children, (item) => {
if (!(0, import_react.isValidElement)(item)) return item;
if (item.type === targetChild) {
target.push(item);
return null;
}
return item;
})) == null ? void 0 : _a.filter(Boolean);
const targetChildren = target.length >= 0 ? target : void 0;
return [withoutTargetChildren, targetChildren];
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getValidChildren,
pickChildren
});
@@ -0,0 +1,14 @@
import { ClassAttributor, Scope, StyleAttributor } from 'parchment';
const config = {
scope: Scope.INLINE,
whitelist: ['serif', 'monospace']
};
const FontClass = new ClassAttributor('font', 'ql-font', config);
class FontStyleAttributor extends StyleAttributor {
value(node) {
return super.value(node).replace(/["']/g, '');
}
}
const FontStyle = new FontStyleAttributor('font', 'font-family', config);
export { FontStyle, FontClass };
//# sourceMappingURL=font.js.map
@@ -0,0 +1 @@
{"version":3,"file":"bundle-cjs.js","sources":["../../src/src/lib/class-group-utils.ts","../../src/src/lib/lru-cache.ts","../../src/src/lib/parse-class-name.ts","../../src/src/lib/config-utils.ts","../../src/src/lib/merge-classlist.ts","../../src/src/lib/tw-join.ts","../../src/src/lib/create-tailwind-merge.ts","../../src/src/lib/from-theme.ts","../../src/src/lib/validators.ts","../../src/src/lib/default-config.ts","../../src/src/lib/merge-configs.ts","../../src/src/lib/extend-tailwind-merge.ts","../../src/src/lib/tw-merge.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["CLASS_PART_SEPARATOR","createClassGroupUtils","config","classMap","createClassMap","conflictingClassGroups","conflictingClassGroupModifiers","getClassGroupId","className","classParts","split","length","shift","getGroupRecursive","getGroupIdForArbitraryProperty","getConflictingClassGroupIds","classGroupId","hasPostfixModifier","conflicts","concat","classPartObject","_classPartObject$vali","currentClassPart","nextClassPartObject","nextPart","get","classGroupFromNextClassPart","slice","undefined","validators","classRest","join","find","_ref","validator","arbitraryPropertyRegex","test","arbitraryPropertyClassName","exec","property","substring","indexOf","theme","prefix","Map","prefixedClassGroupEntries","getPrefixedClassGroupEntries","Object","entries","classGroups","forEach","_ref2","classGroup","processClassesRecursively","classDefinition","classPartObjectToEdit","getPart","isThemeGetter","push","_ref3","key","path","currentClassPartObject","pathPart","has","set","func","classGroupEntries","map","_ref4","prefixedClassGroup","fromEntries","_ref5","value","createLruCache","maxCacheSize","cacheSize","cache","previousCache","update","IMPORTANT_MODIFIER","createParseClassName","separator","experimentalParseClassName","isSeparatorSingleCharacter","firstSeparatorCharacter","separatorLength","parseClassName","modifiers","bracketDepth","modifierStart","postfixModifierPosition","index","currentCharacter","baseClassNameWithImportantModifier","hasImportantModifier","startsWith","baseClassName","maybePostfixModifierPosition","sortModifiers","sortedModifiers","unsortedModifiers","modifier","isArbitraryVariant","apply","sort","createConfigUtils","_extends","SPLIT_CLASSES_REGEX","mergeClassList","classList","configUtils","classGroupsInConflict","classNames","trim","result","originalClassName","_parseClassName","Boolean","variantModifier","modifierId","classId","includes","conflictGroups","i","group","twJoin","argument","resolvedValue","string","arguments","toValue","mix","k","createTailwindMerge","createConfigFirst","_len","createConfigRest","Array","_key","cacheGet","cacheSet","functionToCall","initTailwindMerge","reduce","previousConfig","createConfigCurrent","tailwindMerge","cachedResult","callTailwindMerge","fromTheme","themeGetter","arbitraryValueRegex","fractionRegex","stringLengths","Set","tshirtUnitRegex","lengthUnitRegex","colorFunctionRegex","shadowRegex","imageRegex","isLength","isNumber","isArbitraryLength","getIsArbitraryValue","isLengthOnly","Number","isNaN","isArbitraryNumber","isInteger","isPercent","endsWith","isArbitraryValue","isTshirtSize","sizeLabels","isArbitrarySize","isNever","isArbitraryPosition","imageLabels","isArbitraryImage","isImage","isArbitraryShadow","isShadow","isAny","label","testValue","getDefaultConfig","colors","spacing","blur","brightness","borderColor","borderRadius","borderSpacing","borderWidth","contrast","grayscale","hueRotate","invert","gap","gradientColorStops","gradientColorStopPositions","inset","margin","opacity","padding","saturate","scale","sepia","skew","space","translate","getOverscroll","getOverflow","getSpacingWithAutoAndArbitrary","getSpacingWithArbitrary","getLengthWithEmptyAndArbitrary","getNumberWithAutoAndArbitrary","getPositions","getLineStyles","getBlendModes","getAlign","getZeroAndEmpty","getBreaks","getNumberAndArbitrary","aspect","container","columns","box","display","clear","isolation","object","overflow","overscroll","position","start","end","top","right","bottom","left","visibility","z","basis","flex","grow","shrink","order","col","span","row","justify","content","items","self","p","px","py","ps","pe","pt","pr","pb","pl","m","mx","my","ms","me","mt","mr","mb","ml","w","screen","h","size","text","font","tracking","leading","list","placeholder","decoration","indent","align","whitespace","hyphens","bg","repeat","from","via","to","rounded","border","divide","outline","ring","shadow","filter","table","caption","transition","duration","ease","delay","animate","transform","rotate","origin","accent","appearance","cursor","caret","resize","scroll","snap","touch","select","fill","stroke","sr","mergeConfigs","baseConfig","_ref6","_ref6$extend","extend","_ref6$override","override","overrideProperty","configKey","overrideConfigProperties","mergeConfigProperties","baseObject","overrideKey","overrideValue","overrideObject","mergeObject","mergeValue","extendTLine truncated
@@ -0,0 +1,28 @@
// Copyright (c) 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 DEFAULT_INPUT_MAP_H
#define DEFAULT_INPUT_MAP_H
class InputMap;
void addDefaultEntriesToInputMap(InputMap &inputMap);
#endif // DEFAULT_INPUT_MAP_H
@@ -0,0 +1,450 @@
/**
* @fileoverview Rule to flag `else` after a `return` in `if`
* @author Ian Christian Myers
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
const FixTracker = require("./utils/fix-tracker");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [{ allowElseIf: true }],
docs: {
description:
"Disallow `else` blocks after `return` statements in `if` statements",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/no-else-return",
},
schema: [
{
type: "object",
properties: {
allowElseIf: {
type: "boolean",
},
},
additionalProperties: false,
},
],
fixable: "code",
messages: {
unexpected: "Unnecessary 'else' after 'return'.",
},
},
create(context) {
const [{ allowElseIf }] = context.options;
const sourceCode = context.sourceCode;
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Checks whether the given names can be safely used to declare block-scoped variables
* in the given scope. Name collisions can produce redeclaration syntax errors,
* or silently change references and modify behavior of the original code.
*
* This is not a generic function. In particular, it is assumed that the scope is a function scope or
* a function's inner scope, and that the names can be valid identifiers in the given scope.
* @param {string[]} names Array of variable names.
* @param {eslint-scope.Scope} scope Function scope or a function's inner scope.
* @returns {boolean} True if all names can be safely declared, false otherwise.
*/
function isSafeToDeclare(names, scope) {
if (names.length === 0) {
return true;
}
const functionScope = scope.variableScope;
/*
* If this is a function scope, scope.variables will contain parameters, implicit variables such as "arguments",
* all function-scoped variables ('var'), and block-scoped variables defined in the scope.
* If this is an inner scope, scope.variables will contain block-scoped variables defined in the scope.
*
* Redeclaring any of these would cause a syntax error, except for the implicit variables.
*/
const declaredVariables = scope.variables.filter(
({ defs }) => defs.length > 0,
);
if (declaredVariables.some(({ name }) => names.includes(name))) {
return false;
}
// Redeclaring a catch variable would also cause a syntax error.
if (scope !== functionScope && scope.upper.type === "catch") {
if (
scope.upper.variables.some(({ name }) =>
names.includes(name),
)
) {
return false;
}
}
/*
* Redeclaring an implicit variable, such as "arguments", would not cause a syntax error.
* However, if the variable was used, declaring a new one with the same name would change references
* and modify behavior.
*/
const usedImplicitVariables = scope.variables.filter(
({ defs, references }) =>
defs.length === 0 && references.length > 0,
);
if (
usedImplicitVariables.some(({ name }) => names.includes(name))
) {
return false;
}
/*
* Declaring a variable with a name that was already used to reference a variable from an upper scope
* would change references and modify behavior.
*/
if (scope.through.some(t => names.includes(t.identifier.name))) {
return false;
}
/*
* If the scope is an inner scope (not the function scope), an uninitialized `var` variable declared inside
* the scope node (directly or in one of its descendants) is neither declared nor 'through' in the scope.
*
* For example, this would be a syntax error "Identifier 'a' has already been declared":
* function foo() { if (bar) { let a; if (baz) { var a; } } }
*/
if (scope !== functionScope) {
const scopeNodeRange = scope.block.range;
const variablesToCheck = functionScope.variables.filter(
({ name }) => names.includes(name),
);
if (
variablesToCheck.some(v =>
v.defs.some(
({ node: { range } }) =>
scopeNodeRange[0] <= range[0] &&
range[1] <= scopeNodeRange[1],
),
)
) {
return false;
}
}
return true;
}
/**
* Checks whether the removal of `else` and its braces is safe from variable name collisions.
* @param {Node} node The 'else' node.
* @param {eslint-scope.Scope} scope The scope in which the node and the whole 'if' statement is.
* @returns {boolean} True if it is safe, false otherwise.
*/
function isSafeFromNameCollisions(node, scope) {
if (node.type === "FunctionDeclaration") {
// Conditional function declaration. Scope and hoisting are unpredictable, different engines work differently.
return false;
}
if (node.type !== "BlockStatement") {
return true;
}
const elseBlockScope = scope.childScopes.find(
({ block }) => block === node,
);
if (!elseBlockScope) {
// ecmaVersion < 6, `else` block statement cannot have its own scope, no possible collisions.
return true;
}
/*
* elseBlockScope is supposed to merge into its upper scope. elseBlockScope.variables array contains
* only block-scoped variables (such as let and const variables or class and function declarations)
* defined directly in the elseBlockScope. These are exactly the only names that could cause collisions.
*/
const namesToCheck = elseBlockScope.variables.map(
({ name }) => name,
);
return isSafeToDeclare(namesToCheck, scope);
}
/**
* Display the context report if rule is violated
* @param {Node} elseNode The 'else' node
* @returns {void}
*/
function displayReport(elseNode) {
const currentScope = sourceCode.getScope(elseNode.parent);
context.report({
node: elseNode,
messageId: "unexpected",
fix(fixer) {
if (!isSafeFromNameCollisions(elseNode, currentScope)) {
return null;
}
const startToken = sourceCode.getFirstToken(elseNode);
const elseToken = sourceCode.getTokenBefore(startToken);
const source = sourceCode.getText(elseNode);
const lastIfToken = sourceCode.getTokenBefore(elseToken);
let fixedSource, firstTokenOfElseBlock;
if (
startToken.type === "Punctuator" &&
startToken.value === "{"
) {
firstTokenOfElseBlock =
sourceCode.getTokenAfter(startToken);
} else {
firstTokenOfElseBlock = startToken;
}
/*
* If the if block does not have curly braces and does not end in a semicolon
* and the else block starts with (, [, /, +, ` or -, then it is not
* safe to remove the else keyword, because ASI will not add a semicolon
* after the if block
*/
const ifBlockMaybeUnsafe =
elseNode.parent.consequent.type !== "BlockStatement" &&
lastIfToken.value !== ";";
const elseBlockUnsafe = /^[([/+`-]/u.test(
firstTokenOfElseBlock.value,
);
if (ifBlockMaybeUnsafe && elseBlockUnsafe) {
return null;
}
const endToken = sourceCode.getLastToken(elseNode);
const lastTokenOfElseBlock =
sourceCode.getTokenBefore(endToken);
if (lastTokenOfElseBlock.value !== ";") {
const nextToken = sourceCode.getTokenAfter(endToken);
const nextTokenUnsafe =
nextToken && /^[([/+`-]/u.test(nextToken.value);
const nextTokenOnSameLine =
nextToken &&
nextToken.loc.start.line ===
lastTokenOfElseBlock.loc.start.line;
/*
* If the else block contents does not end in a semicolon,
* and the else block starts with (, [, /, +, ` or -, then it is not
* safe to remove the else block, because ASI will not add a semicolon
* after the remaining else block contents
*/
if (
nextTokenUnsafe ||
(nextTokenOnSameLine && nextToken.value !== "}")
) {
return null;
}
}
if (
startToken.type === "Punctuator" &&
startToken.value === "{"
) {
fixedSource = source.slice(1, -1);
} else {
fixedSource = source;
}
/*
* Extend the replacement range to include the entire
* function to avoid conflicting with no-useless-return.
* https://github.com/eslint/eslint/issues/8026
*
* Also, to avoid name collisions between two else blocks.
*/
return new FixTracker(fixer, sourceCode)
.retainEnclosingFunction(elseNode)
.replaceTextRange(
[elseToken.range[0], elseNode.range[1]],
fixedSource,
);
},
});
}
/**
* Check to see if the node is a ReturnStatement
* @param {Node} node The node being evaluated
* @returns {boolean} True if node is a return
*/
function checkForReturn(node) {
return node.type === "ReturnStatement";
}
/**
* Naive return checking, does not iterate through the whole
* BlockStatement because we make the assumption that the ReturnStatement
* will be the last node in the body of the BlockStatement.
* @param {Node} node The consequent/alternate node
* @returns {boolean} True if it has a return
*/
function naiveHasReturn(node) {
if (node.type === "BlockStatement") {
const body = node.body,
lastChildNode = body.at(-1);
return lastChildNode && checkForReturn(lastChildNode);
}
return checkForReturn(node);
}
/**
* Check to see if the node is valid for evaluation,
* meaning it has an else.
* @param {Node} node The node being evaluated
* @returns {boolean} True if the node is valid
*/
function hasElse(node) {
return node.alternate && node.consequent;
}
/**
* If the consequent is an IfStatement, check to see if it has an else
* and both its consequent and alternate path return, meaning this is
* a nested case of rule violation. If-Else not considered currently.
* @param {Node} node The consequent node
* @returns {boolean} True if this is a nested rule violation
*/
function checkForIf(node) {
return (
node.type === "IfStatement" &&
hasElse(node) &&
naiveHasReturn(node.alternate) &&
naiveHasReturn(node.consequent)
);
}
/**
* Check the consequent/body node to make sure it is not
* a ReturnStatement or an IfStatement that returns on both
* code paths.
* @param {Node} node The consequent or body node
* @returns {boolean} `true` if it is a Return/If node that always returns.
*/
function checkForReturnOrIf(node) {
return checkForReturn(node) || checkForIf(node);
}
/**
* Check whether a node returns in every codepath.
* @param {Node} node The node to be checked
* @returns {boolean} `true` if it returns on every codepath.
*/
function alwaysReturns(node) {
if (node.type === "BlockStatement") {
// If we have a BlockStatement, check each consequent body node.
return node.body.some(checkForReturnOrIf);
}
/*
* If not a block statement, make sure the consequent isn't a
* ReturnStatement or an IfStatement with returns on both paths.
*/
return checkForReturnOrIf(node);
}
/**
* Check the if statement, but don't catch else-if blocks.
* @returns {void}
* @param {Node} node The node for the if statement to check
* @private
*/
function checkIfWithoutElse(node) {
const parent = node.parent;
/*
* Fixing this would require splitting one statement into two, so no error should
* be reported if this node is in a position where only one statement is allowed.
*/
if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) {
return;
}
const consequents = [];
let alternate;
for (
let currentNode = node;
currentNode.type === "IfStatement";
currentNode = currentNode.alternate
) {
if (!currentNode.alternate) {
return;
}
consequents.push(currentNode.consequent);
alternate = currentNode.alternate;
}
if (consequents.every(alwaysReturns)) {
displayReport(alternate);
}
}
/**
* Check the if statement
* @returns {void}
* @param {Node} node The node for the if statement to check
* @private
*/
function checkIfWithElse(node) {
const parent = node.parent;
/*
* Fixing this would require splitting one statement into two, so no error should
* be reported if this node is in a position where only one statement is allowed.
*/
if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) {
return;
}
const alternate = node.alternate;
if (alternate && alwaysReturns(node.consequent)) {
displayReport(alternate);
}
}
//--------------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------------
return {
"IfStatement:exit": allowElseIf
? checkIfWithoutElse
: checkIfWithElse,
};
},
};
@@ -0,0 +1,47 @@
Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/lodash/lodash
The following license applies to all parts of this software except as
documented below:
====
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.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.
@@ -0,0 +1,68 @@
[
"389-exception",
"Asterisk-exception",
"Autoconf-exception-2.0",
"Autoconf-exception-3.0",
"Autoconf-exception-generic",
"Autoconf-exception-generic-3.0",
"Autoconf-exception-macro",
"Bison-exception-1.24",
"Bison-exception-2.2",
"Bootloader-exception",
"Classpath-exception-2.0",
"CLISP-exception-2.0",
"cryptsetup-OpenSSL-exception",
"DigiRule-FOSS-exception",
"eCos-exception-2.0",
"Fawkes-Runtime-exception",
"FLTK-exception",
"fmt-exception",
"Font-exception-2.0",
"freertos-exception-2.0",
"GCC-exception-2.0",
"GCC-exception-2.0-note",
"GCC-exception-3.1",
"Gmsh-exception",
"GNAT-exception",
"GNOME-examples-exception",
"GNU-compiler-exception",
"gnu-javamail-exception",
"GPL-3.0-interface-exception",
"GPL-3.0-linking-exception",
"GPL-3.0-linking-source-exception",
"GPL-CC-1.0",
"GStreamer-exception-2005",
"GStreamer-exception-2008",
"i2p-gpl-java-exception",
"KiCad-libraries-exception",
"LGPL-3.0-linking-exception",
"libpri-OpenH323-exception",
"Libtool-exception",
"Linux-syscall-note",
"LLGPL",
"LLVM-exception",
"LZMA-exception",
"mif-exception",
"OCaml-LGPL-linking-exception",
"OCCT-exception-1.0",
"OpenJDK-assembly-exception-1.0",
"openvpn-openssl-exception",
"PS-or-PDF-font-exception-20170817",
"QPL-1.0-INRIA-2004-exception",
"Qt-GPL-exception-1.0",
"Qt-LGPL-exception-1.1",
"Qwt-exception-1.0",
"SANE-exception",
"SHL-2.0",
"SHL-2.1",
"stunnel-exception",
"SWI-exception",
"Swift-exception",
"Texinfo-exception",
"u-boot-exception-2.0",
"UBDL-exception",
"Universal-FOSS-exception-1.0",
"vsftpd-openssl-exception",
"WxWindows-exception-3.1",
"x11vnc-openssl-exception"
]
@@ -0,0 +1,8 @@
module.exports = function () {
// see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
var origPrepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = function (_, stack) { return stack; };
var stack = (new Error()).stack;
Error.prepareStackTrace = origPrepareStackTrace;
return stack[2].getFileName();
};
@@ -0,0 +1 @@
{"version":3,"names":["_initializerDefineProperty","target","property","descriptor","context","Object","defineProperty","enumerable","configurable","writable","value","initializer","call"],"sources":["../../src/helpers/initializerDefineProperty.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\ninterface DescriptorWithInitializer extends PropertyDescriptor {\n initializer?: () => any;\n}\n\nexport default function _initializerDefineProperty<T>(\n target: T,\n property: PropertyKey,\n descriptor: DescriptorWithInitializer | undefined,\n context: DecoratorContext,\n): void {\n if (!descriptor) return;\n\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer\n ? descriptor.initializer.call(context)\n : void 0,\n });\n}\n"],"mappings":";;;;;;AAMe,SAASA,0BAA0BA,CAChDC,MAAS,EACTC,QAAqB,EACrBC,UAAiD,EACjDC,OAAyB,EACnB;EACN,IAAI,CAACD,UAAU,EAAE;EAEjBE,MAAM,CAACC,cAAc,CAACL,MAAM,EAAEC,QAAQ,EAAE;IACtCK,UAAU,EAAEJ,UAAU,CAACI,UAAU;IACjCC,YAAY,EAAEL,UAAU,CAACK,YAAY;IACrCC,QAAQ,EAAEN,UAAU,CAACM,QAAQ;IAC7BC,KAAK,EAAEP,UAAU,CAACQ,WAAW,GACzBR,UAAU,CAACQ,WAAW,CAACC,IAAI,CAACR,OAAO,CAAC,GACpC,KAAK;EACX,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,19 @@
# @babel/helper-compilation-targets
> Helper functions on Babel compilation targets
See our website [@babel/helper-compilation-targets](https://babeljs.io/docs/babel-helper-compilation-targets) for more information.
## Install
Using npm:
```sh
npm install --save @babel/helper-compilation-targets
```
or using yarn:
```sh
yarn add @babel/helper-compilation-targets
```
@@ -0,0 +1 @@
{"mappings":";;;AAiBA,iCAA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E,MAAM,IAAI,CAAA;CACpB;AAED;;;GAGG;AACH,uCAAuC,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,oBAAoB,GAAG,mBAAmB,CAsCnH;ACpED,YAAY,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC","sources":["packages/@react-stately/menu/src/packages/@react-stately/menu/src/useMenuTriggerState.ts","packages/@react-stately/menu/src/packages/@react-stately/menu/src/useSubmenuTriggerState.ts","packages/@react-stately/menu/src/packages/@react-stately/menu/src/index.ts","packages/@react-stately/menu/src/index.ts"],"sourcesContent":[null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useMenuTriggerState} from './useMenuTriggerState';\nexport {useSubmenuTriggerState} from './useSubmenuTriggerState';\n\nexport type {MenuTriggerProps} from '@react-types/menu';\nexport type {MenuTriggerState, RootMenuTriggerState} from './useMenuTriggerState';\nexport type {SubmenuTriggerProps, SubmenuTriggerState} from './useSubmenuTriggerState';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -0,0 +1,5 @@
import type { ZodErrorMap } from "./ZodError.cjs";
import defaultErrorMap from "./locales/en.cjs";
export { defaultErrorMap };
export declare function setErrorMap(map: ZodErrorMap): void;
export declare function getErrorMap(): ZodErrorMap;
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var ListBoxOptionRole = {
relatedConcepts: [{
module: 'ARIA',
concept: {
name: 'option'
}
}, {
module: 'HTML',
concept: {
name: 'option'
}
}],
type: 'widget'
};
var _default = ListBoxOptionRole;
exports.default = _default;
@@ -0,0 +1 @@
{"name":"natural-compare","version":"1.4.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532094934,"integrity":"sha512-Zkj2zqSNFWw8jNvBPm1PKrqFLjHj3cWrZDoMxdftZS8c6bLfvwuxPbkgQi8mkNThu8+MEjJ778OAKCbllOKGGA==","mode":436,"size":992},"README.md":{"checkedAt":1794532094934,"integrity":"sha512-NIJxLrGlabNm6NvuHFBmruxbtuCM4wT9nwEUXgTWSF9MvtXPQpJzj4T1s27BJKiwyGbghfoP7v1ypYIpyX1fEg==","mode":436,"size":3352},"index.js":{"checkedAt":1794532094934,"integrity":"sha512-4IVCVk/PbyfM/W7Vi3qNkQSHpxYWIh/JN9ZYfFQmPJ/zNurZlSpt5Y/ojrbMmXa/yaAy1pYVp6IJ9fi4AaMS+g==","mode":436,"size":1303}}}
@@ -0,0 +1 @@
{"version":3,"file":"GetSingleServicePlanOptions.d.ts","sourceRoot":"","sources":["../../../../src/planning/models/GetSingleServicePlanOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACrE,UAAU,EAAE,KAAK,CAAC;CACnB"}
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _table = _interopRequireDefault(require("./table"));
var _struct = _interopRequireDefault(require("./struct"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @file maxp 表
* @author mengke01(kekee000@gmail.com)
*/
var _default = exports.default = _table.default.create('maxp', [['version', _struct.default.Fixed], ['numGlyphs', _struct.default.Uint16], ['maxPoints', _struct.default.Uint16], ['maxContours', _struct.default.Uint16], ['maxCompositePoints', _struct.default.Uint16], ['maxCompositeContours', _struct.default.Uint16], ['maxZones', _struct.default.Uint16], ['maxTwilightPoints', _struct.default.Uint16], ['maxStorage', _struct.default.Uint16], ['maxFunctionDefs', _struct.default.Uint16], ['maxInstructionDefs', _struct.default.Uint16], ['maxStackElements', _struct.default.Uint16], ['maxSizeOfInstructions', _struct.default.Uint16], ['maxComponentElements', _struct.default.Uint16], ['maxComponentDepth', _struct.default.Int16]], {
write: function write(writer, ttf) {
_table.default.write.call(this, writer, ttf.support);
return writer;
},
size: function size() {
return 32;
}
});
@@ -0,0 +1,159 @@
// Original autotracking implementation source:
// - https://gist.github.com/pzuraq/79bf862e0f8cd9521b79c4b6eccdc4f9
// Additional references:
// - https://www.pzuraq.com/blog/how-autotracking-works
// - https://v5.chriskrycho.com/journal/autotracking-elegant-dx-via-cutting-edge-cs/
import type { EqualityFn } from '../types'
import { assertIsFunction } from '../utils'
// The global revision clock. Every time state changes, the clock increments.
export let $REVISION = 0
// The current dependency tracker. Whenever we compute a cache, we create a Set
// to track any dependencies that are used while computing. If no cache is
// computing, then the tracker is null.
let CURRENT_TRACKER: Set<Cell<any> | TrackingCache> | null = null
// Storage represents a root value in the system - the actual state of our app.
export class Cell<T> {
revision = $REVISION
_value: T
_lastValue: T
_isEqual: EqualityFn = tripleEq
constructor(initialValue: T, isEqual: EqualityFn = tripleEq) {
this._value = this._lastValue = initialValue
this._isEqual = isEqual
}
// Whenever a storage value is read, it'll add itself to the current tracker if
// one exists, entangling its state with that cache.
get value() {
CURRENT_TRACKER?.add(this)
return this._value
}
// Whenever a storage value is updated, we bump the global revision clock,
// assign the revision for this storage to the new value, _and_ we schedule a
// rerender. This is important, and it's what makes autotracking _pull_
// based. We don't actively tell the caches which depend on the storage that
// anything has happened. Instead, we recompute the caches when needed.
set value(newValue) {
if (this.value === newValue) return
this._value = newValue
this.revision = ++$REVISION
}
}
function tripleEq(a: unknown, b: unknown) {
return a === b
}
// Caches represent derived state in the system. They are ultimately functions
// that are memoized based on what state they use to produce their output,
// meaning they will only rerun IFF a storage value that could affect the output
// has changed. Otherwise, they'll return the cached value.
export class TrackingCache {
_cachedValue: any
_cachedRevision = -1
_deps: any[] = []
hits = 0
fn: () => any
constructor(fn: () => any) {
this.fn = fn
}
clear() {
this._cachedValue = undefined
this._cachedRevision = -1
this._deps = []
this.hits = 0
}
get value() {
// When getting the value for a Cache, first we check all the dependencies of
// the cache to see what their current revision is. If the current revision is
// greater than the cached revision, then something has changed.
if (this.revision > this._cachedRevision) {
const { fn } = this
// We create a new dependency tracker for this cache. As the cache runs
// its function, any Storage or Cache instances which are used while
// computing will be added to this tracker. In the end, it will be the
// full list of dependencies that this Cache depends on.
const currentTracker = new Set<Cell<any>>()
const prevTracker = CURRENT_TRACKER
CURRENT_TRACKER = currentTracker
// try {
this._cachedValue = fn()
// } finally {
CURRENT_TRACKER = prevTracker
this.hits++
this._deps = Array.from(currentTracker)
// Set the cached revision. This is the current clock count of all the
// dependencies. If any dependency changes, this number will be less
// than the new revision.
this._cachedRevision = this.revision
// }
}
// If there is a current tracker, it means another Cache is computing and
// using this one, so we add this one to the tracker.
CURRENT_TRACKER?.add(this)
// Always return the cached value.
return this._cachedValue
}
get revision() {
// The current revision is the max of all the dependencies' revisions.
return Math.max(...this._deps.map(d => d.revision), 0)
}
}
export function getValue<T>(cell: Cell<T>): T {
if (!(cell instanceof Cell)) {
console.warn('Not a valid cell! ', cell)
}
return cell.value
}
type CellValue<T extends Cell<unknown>> = T extends Cell<infer U> ? U : never
export function setValue<T extends Cell<unknown>>(
storage: T,
value: CellValue<T>
): void {
if (!(storage instanceof Cell)) {
throw new TypeError(
'setValue must be passed a tracked store created with `createStorage`.'
)
}
storage.value = storage._lastValue = value
}
export function createCell<T = unknown>(
initialValue: T,
isEqual: EqualityFn = tripleEq
): Cell<T> {
return new Cell(initialValue, isEqual)
}
export function createCache<T = unknown>(fn: () => T): TrackingCache {
assertIsFunction(
fn,
'the first parameter to `createCache` must be a function'
)
return new TrackingCache(fn)
}
@@ -0,0 +1,3 @@
# @react-types/tooltip
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.
@@ -0,0 +1 @@
{"version":3,"file":"removeServiceNodeBindingIfContextFree.d.ts","sourceRoot":"","sources":["../../../../src/planning/actions/removeServiceNodeBindingIfContextFree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAEvD,OAAO,EAEL,0BAA0B,EAC3B,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAG1F,OAAO,EAAE,mCAAmC,EAAE,MAAM,2DAA2D,CAAC;AAGhH,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;;;;;;GAOG;AACH,wBAAgB,qCAAqC,CACnD,WAAW,EAAE,eAAe,EAC5B,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EACzB,sBAAsB,EAAE,yBAAyB,CAAC,0BAA0B,CAAC,EAC7E,gBAAgB,EAAE,OAAO,GACxB,mCAAmC,CAyDrC"}
@@ -0,0 +1,35 @@
import baseSet from './_baseSet.js';
/**
* Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
* it's created. Arrays are created for missing index properties while objects
* are created for all other missing properties. Use `_.setWith` to customize
* `path` creation.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @returns {Object} Returns `object`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.set(object, 'a[0].b.c', 4);
* console.log(object.a[0].b.c);
* // => 4
*
* _.set(object, ['x', '0', 'y', 'z'], 5);
* console.log(object.x[0].y.z);
* // => 5
*/
function set(object, path, value) {
return object == null ? object : baseSet(object, path, value);
}
export default set;
@@ -0,0 +1,28 @@
// src/link.tsx
import { jsx, jsxs } from "react/jsx-runtime";
var LinkIcon = (props) => /* @__PURE__ */ jsxs(
"svg",
{
"aria-hidden": "true",
fill: "none",
focusable: "false",
height: "1em",
shapeRendering: "geometricPrecision",
stroke: "currentColor",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.5",
viewBox: "0 0 24 24",
width: "1em",
...props,
children: [
/* @__PURE__ */ jsx("path", { d: "M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6" }),
/* @__PURE__ */ jsx("path", { d: "M15 3h6v6" }),
/* @__PURE__ */ jsx("path", { d: "M10 14L21 3" })
]
}
);
export {
LinkIcon
};
@@ -0,0 +1,139 @@
# is-decimal
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
Check if a character is a decimal.
## Contents
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`isDecimal(character|code)`](#isdecimalcharactercode)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This is a function that checks if a given character is an ASCII decimal.
## When should I use this?
Not often, as it’s relatively simple to do yourself.
This package exists because it’s needed in several related packages, at which
point it becomes useful to defer to one shared function.
## Install
This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:
```sh
npm install is-decimal
```
In Deno with [Skypack][]:
```js
import {isDecimal} from 'https://cdn.skypack.dev/is-decimal@2?dts'
```
In browsers with [Skypack][]:
```html
<script type="module">
import {isDecimal} from 'https://cdn.skypack.dev/is-decimal@2?min'
</script>
```
## Use
```js
import {isDecimal} from 'is-decimal'
isDecimal('0') // => true
isDecimal('9') // => true
isDecimal('a') // => false
isDecimal('💩') // => false
```
## API
This package exports the following identifiers: `isDecimal`.
There is no default export.
### `isDecimal(character|code)`
Check whether the given character code (`number`), or the character code at the
first position (`string`), is decimal.
## Types
This package is fully typed with [TypeScript][].
## Compatibility
This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
It also works in Deno and modern browsers.
## Security
This package is safe.
## Related
* [`wooorm/is-alphabetical`](https://github.com/wooorm/is-alphabetical)
* [`wooorm/is-hexadecimal`](https://github.com/wooorm/is-hexadecimal)
* [`wooorm/is-whitespace-character`](https://github.com/wooorm/is-whitespace-character)
* [`wooorm/is-word-character`](https://github.com/wooorm/is-word-character)
## Contribute
Yes please!
See [How to Contribute to Open Source][contribute].
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://github.com/wooorm/is-decimal/workflows/main/badge.svg
[build]: https://github.com/wooorm/is-decimal/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-decimal.svg
[coverage]: https://codecov.io/github/wooorm/is-decimal
[downloads-badge]: https://img.shields.io/npm/dm/is-decimal.svg
[downloads]: https://www.npmjs.com/package/is-decimal
[size-badge]: https://img.shields.io/bundlephobia/minzip/is-decimal.svg
[size]: https://bundlephobia.com/result?p=is-decimal
[npm]: https://docs.npmjs.com/cli/install
[skypack]: https://www.skypack.dev
[license]: license
[author]: https://wooorm.com
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[typescript]: https://www.typescriptlang.org
[contribute]: https://opensource.guide/how-to-contribute/
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 Cody Olsen
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,39 @@
/**
* @file maxp 表
* @author mengke01(kekee000@gmail.com)
*/
import table from './table';
import struct from './struct';
export default table.create(
'maxp',
[
['version', struct.Fixed],
['numGlyphs', struct.Uint16],
['maxPoints', struct.Uint16],
['maxContours', struct.Uint16],
['maxCompositePoints', struct.Uint16],
['maxCompositeContours', struct.Uint16],
['maxZones', struct.Uint16],
['maxTwilightPoints', struct.Uint16],
['maxStorage', struct.Uint16],
['maxFunctionDefs', struct.Uint16],
['maxInstructionDefs', struct.Uint16],
['maxStackElements', struct.Uint16],
['maxSizeOfInstructions', struct.Uint16],
['maxComponentElements', struct.Uint16],
['maxComponentDepth', struct.Int16]
],
{
write(writer, ttf) {
table.write.call(this, writer, ttf.support);
return writer;
},
size() {
return 32;
}
}
);
@@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<ellipse class="ql-fill" cx="10.5" cy="14" rx="2.5" ry="2"></ellipse>
<path class="ql-stroke" d="M12,14V3c0,1.5,3,2.021,3,5"></path>
<path class="ql-fill" d="M7,4A5,5,0,0,0,7,14a3.191,3.191,0,0,1,3-2.957V5.023A4.955,4.955,0,0,0,7,4ZM4.06,8.412a0.5,0.5,0,0,1-.49.4,0.485,0.485,0,0,1-.1-0.01,0.5,0.5,0,0,1-.393-0.588A3.98,3.98,0,0,1,6.216,5.079a0.5,0.5,0,0,1,.2.98A2.985,2.985,0,0,0,4.06,8.412ZM7,10A1,1,0,1,1,8,9,1,1,0,0,1,7,10Z"></path>
</svg>

After

Width:  |  Height:  |  Size: 475 B

@@ -0,0 +1,18 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./module"), exports);
@@ -0,0 +1,77 @@
/*
* 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.
*/ // We store a global list of elements that are currently transitioning,
// mapped to a set of CSS properties that are transitioning for that element.
// This is necessary rather than a simple count of transitions because of browser
// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather
// than one or the other. So we need to track what's actually transitioning so that
// we can ignore these duplicate events.
let $bbed8b41f857bcc0$var$transitionsByElement = new Map();
// A list of callbacks to call once there are no transitioning elements.
let $bbed8b41f857bcc0$var$transitionCallbacks = new Set();
function $bbed8b41f857bcc0$var$setupGlobalEvents() {
if (typeof window === 'undefined') return;
function isTransitionEvent(event) {
return 'propertyName' in event;
}
let onTransitionStart = (e)=>{
if (!isTransitionEvent(e) || !e.target) return;
// Add the transitioning property to the list for this element.
let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
if (!transitions) {
transitions = new Set();
$bbed8b41f857bcc0$var$transitionsByElement.set(e.target, transitions);
// The transitioncancel event must be registered on the element itself, rather than as a global
// event. This enables us to handle when the node is deleted from the document while it is transitioning.
// In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
e.target.addEventListener('transitioncancel', onTransitionEnd, {
once: true
});
}
transitions.add(e.propertyName);
};
let onTransitionEnd = (e)=>{
if (!isTransitionEvent(e) || !e.target) return;
// Remove property from list of transitioning properties.
let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
if (!properties) return;
properties.delete(e.propertyName);
// If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.
if (properties.size === 0) {
e.target.removeEventListener('transitioncancel', onTransitionEnd);
$bbed8b41f857bcc0$var$transitionsByElement.delete(e.target);
}
// If no transitioning elements, call all of the queued callbacks.
if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) {
for (let cb of $bbed8b41f857bcc0$var$transitionCallbacks)cb();
$bbed8b41f857bcc0$var$transitionCallbacks.clear();
}
};
document.body.addEventListener('transitionrun', onTransitionStart);
document.body.addEventListener('transitionend', onTransitionEnd);
}
if (typeof document !== 'undefined') {
if (document.readyState !== 'loading') $bbed8b41f857bcc0$var$setupGlobalEvents();
else document.addEventListener('DOMContentLoaded', $bbed8b41f857bcc0$var$setupGlobalEvents);
}
function $bbed8b41f857bcc0$export$24490316f764c430(fn) {
// Wait one frame to see if an animation starts, e.g. a transition on mount.
requestAnimationFrame(()=>{
// If no transitions are running, call the function immediately.
// Otherwise, add it to a list of callbacks to run at the end of the animation.
if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) fn();
else $bbed8b41f857bcc0$var$transitionCallbacks.add(fn);
});
}
export {$bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition};
//# sourceMappingURL=runAfterTransition.module.js.map
@@ -0,0 +1,65 @@
const bufLength = 1024 * 16;
// Provide a fallback for older environments.
const td =
typeof TextDecoder !== 'undefined'
? /* #__PURE__ */ new TextDecoder()
: typeof Buffer !== 'undefined'
? {
decode(buf: Uint8Array): string {
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
return out.toString();
},
}
: {
decode(buf: Uint8Array): string {
let out = '';
for (let i = 0; i < buf.length; i++) {
out += String.fromCharCode(buf[i]);
}
return out;
},
};
export class StringWriter {
pos = 0;
private out = '';
private buffer = new Uint8Array(bufLength);
write(v: number): void {
const { buffer } = this;
buffer[this.pos++] = v;
if (this.pos === bufLength) {
this.out += td.decode(buffer);
this.pos = 0;
}
}
flush(): string {
const { buffer, out, pos } = this;
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
}
}
export class StringReader {
pos = 0;
declare private buffer: string;
constructor(buffer: string) {
this.buffer = buffer;
}
next(): number {
return this.buffer.charCodeAt(this.pos++);
}
peek(): number {
return this.buffer.charCodeAt(this.pos);
}
indexOf(char: string): number {
const { buffer, pos } = this;
const idx = buffer.indexOf(char, pos);
return idx === -1 ? buffer.length : idx;
}
}
@@ -0,0 +1,25 @@
import { Block, Tokens } from '../primitives.js';
export type Stringifier = (block: Block) => string;
function join(tokens: Tokens): string {
return (
tokens.start +
tokens.delimiter +
tokens.postDelimiter +
tokens.tag +
tokens.postTag +
tokens.type +
tokens.postType +
tokens.name +
tokens.postName +
tokens.description +
tokens.end +
tokens.lineEnd
);
}
export default function getStringifier(): Stringifier {
return (block: Block): string =>
block.source.map(({ tokens }) => join(tokens)).join('\n');
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"O P","2":"C L M G N","257":"0 1 2 3 4 5 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"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 0C 1C","257":"0 1 2 3 4 5 pB rB sB tB uB vB wB yB zB 0B 1B 2B 3B UC VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","1281":"qB xB 4B"},D:{"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","257":"0 1 2 3 4 5 vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","388":"pB qB rB sB tB uB"},E:{"2":"J ZB K 2C ZC 3C 4C","514":"D E F A B C L M G 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC","4609":"SC nC oC pC qC rC sC tC DD ED","6660":"dC eC fC gC hC BD RC iC jC kC lC mC CD"},F:{"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 FD GD HD ID NC uC JD OC","16":"iB jB kB lB mB","257":"0 1 2 3 4 5 nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{"2":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC","8196":"gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"2":"hD"},I:{"2":"TC J I 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:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"2":"0D"},S:{"257":"1D 2D"}},B:5,C:"Push API",D:true};
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.unmanaged = unmanaged;
const decrementPendingClassMetadataCount_1 = require("../actions/decrementPendingClassMetadataCount");
const buildUnmanagedMetadataFromMaybeClassElementMetadata_1 = require("../calculations/buildUnmanagedMetadataFromMaybeClassElementMetadata");
const injectBase_1 = require("./injectBase");
function unmanaged() {
const updateMetadata = (0, buildUnmanagedMetadataFromMaybeClassElementMetadata_1.buildUnmanagedMetadataFromMaybeClassElementMetadata)();
return (0, injectBase_1.injectBase)(updateMetadata, decrementPendingClassMetadataCount_1.decrementPendingClassMetadataCount);
}
//# sourceMappingURL=unmanaged.js.map
@@ -0,0 +1 @@
{"name":"@react-types/accordion","version":"3.0.0-alpha.26","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532107179,"integrity":"sha512-cil7stSp3ik41Hdv2Dj+GMcbvUfs1q+MZ2Yte0804py9i6oJJN/diCiIr/brcQOZ5ZqwAI6dgaHA7l8FZheQBw==","mode":420,"size":11335},"package.json":{"checkedAt":1794532107179,"integrity":"sha512-bg6Iedh+89t75lfr3pn0twZ8jE2GQRf9/N6jZpCdJQIp2x+1hyteBPZY/rgr/4YZ5939WSxn6ubjjfVyDjssQA==","mode":420,"size":536},"README.md":{"checkedAt":1794532107179,"integrity":"sha512-LJwhxsiHdO0YCN6ChMzbG0xkKl4WnfWePwx3hinlJHIfZY3qpRnuVQyRJIU0pwa9DprE2LvbvoOJ7JAOM3FjWg==","mode":420,"size":140},"src/index.d.ts":{"checkedAt":1794532107180,"integrity":"sha512-V4erIUF42BcIitYwEIO4W1p6++h4DQ91LnGXhCteW19z/NYJ1jwX7BkOSbgOjMWRGt34b7dB7AJA6qKNM/JTYw==","mode":420,"size":945}}}
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Ruben Bridgewater
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,5 @@
var convert = require('./convert'),
func = convert('method', require('../method'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,107 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// 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.
'use strict';
var tape = require('tape');
var path = require('../');
// Test thrown TypeErrors
var typeErrorTests = [true, false, 7, null, {}, undefined, [], NaN];
function fail(t, fn) {
var args = [].slice.call(arguments, 1);
t.throws(function () {
fn.apply(null, args);
}, TypeError);
}
tape('path.posix TypeErrors', function (t) {
typeErrorTests.forEach(function (test) {
fail(t, path.posix.join, test);
fail(t, path.posix.resolve, test);
fail(t, path.posix.normalize, test);
fail(t, path.posix.isAbsolute, test);
fail(t, path.posix.relative, test, 'foo');
fail(t, path.posix.relative, 'foo', test);
fail(t, path.posix.parse, test);
fail(t, path.posix.dirname, test);
fail(t, path.posix.basename, test);
fail(t, path.posix.extname, test);
// undefined is a valid value as the second argument to basename
if (test !== undefined) {
fail(t, path.posix.basename, 'foo', test);
}
});
t.end();
});
tape('path.win32 TypeErrors', { skip: true }, function (t) {
typeErrorTests.forEach(function (test) {
fail(t, path.win32.join, test);
fail(t, path.win32.resolve, test);
fail(t, path.win32.normalize, test);
fail(t, path.win32.isAbsolute, test);
fail(t, path.win32.relative, test, 'foo');
fail(t, path.win32.relative, 'foo', test);
fail(t, path.win32.parse, test);
fail(t, path.win32.dirname, test);
fail(t, path.win32.basename, test);
fail(t, path.win32.extname, test);
// undefined is a valid value as the second argument to basename
if (test !== undefined) {
fail(t, path.win32.basename, 'foo', test);
}
});
t.end();
});
// path.sep tests
tape('path.win32.sep', { skip: true }, function (t) {
// windows
t.strictEqual(path.win32.sep, '\\');
t.end();
});
tape('path.posix.sep', function (t) {
// posix
t.strictEqual(path.posix.sep, '/');
t.end();
});
// path.delimiter tests
tape('path.win32.delimiter', { skip: true }, function (t) {
// windows
t.strictEqual(path.win32.delimiter, ';');
t.end();
});
tape('path.posix.delimiter', function (t) {
// posix
t.strictEqual(path.posix.delimiter, ':');
t.end();
});
tape('path', function (t) {
t.strictEqual(path, path.posix);
t.end();
});
@@ -0,0 +1,10 @@
function _objectWithoutPropertiesLoose(r, e) {
if (null == r) return {};
var t = {};
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
if (-1 !== e.indexOf(n)) continue;
t[n] = r[n];
}
return t;
}
export { _objectWithoutPropertiesLoose as default };
@@ -0,0 +1 @@
{"mapp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aria/overlays/src/usePreventScroll.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain, getScrollParent, isIOS, isScrollable, useLayoutEffect, willLine truncated
@@ -0,0 +1,118 @@
const {readPiExp} = require("./XmlPartReader");
function readCdata(parser){
//<![ are already read till this point
let str = parser.source.readStr(6); //CDATA[
parser.source.updateBufferBoundary(6);
if(str !== "CDATA[") throw new Error(`Invalid CDATA expression at ${parser.source.line}:${parser.source.cols}`);
let text = parser.source.readUpto("]]>");
parser.outputBuilder.addCdata(text);
}
function readPiTag(parser){
//<? are already read till this point
let tagExp = readPiExp(parser, "?>");
if(!tagExp) throw new Error("Invalid Pi Tag expression.");
if (tagExp.tagName === "?xml") {//TODO: test if tagName is just xml
parser.outputBuilder.addDeclaration();
} else {
parser.outputBuilder.addPi("?"+tagExp.tagName);
}
}
function readComment(parser){
//<!- are already read till this point
let ch = parser.source.readCh();
if(ch !== "-") throw new Error(`Invalid comment expression at ${parser.source.line}:${parser.source.cols}`);
let text = parser.source.readUpto("-->");
parser.outputBuilder.addComment(text);
}
const DOCTYPE_tags = {
"EL":/^EMENT\s+([^\s>]+)\s+(ANY|EMPTY|\(.+\)\s*$)/m,
"AT":/^TLIST\s+[^\s]+\s+[^\s]+\s+[^\s]+\s+[^\s]+\s+$/m,
"NO":/^TATION.+$/m
}
function readDocType(parser){
//<!D are already read till this point
let str = parser.source.readStr(6); //OCTYPE
parser.source.updateBufferBoundary(6);
if(str !== "OCTYPE") throw new Error(`Invalid DOCTYPE expression at ${parser.source.line}:${parser.source.cols}`);
let hasBody = false, lastch = "";
while(parser.source.canRead()){
//TODO: use readChAt like used in partReader
let ch = parser.source.readCh();
if(hasBody){
if (ch === '<') { //Determine the tag type
let str = parser.source.readStr(2);
parser.source.updateBufferBoundary(2);
if(str === "EN"){ //ENTITY
let str = parser.source.readStr(4);
parser.source.updateBufferBoundary(4);
if(str !== "TITY") throw new Error("Invalid DOCTYPE ENTITY expression");
registerEntity(parser);
}else if(str === "!-") {//comment
readComment(parser);
}else{ //ELEMENT, ATTLIST, NOTATION
let dTagExp = parser.source.readUpto(">");
const regx = DOCTYPE_tags[str];
if(regx){
const match = dTagExp.match(regx);
if(!match) throw new Error("Invalid DOCTYPE");
}else throw new Error("Invalid DOCTYPE");
}
}else if( ch === '>' && lastch === "]"){//end of doctype
return;
}
}else if( ch === '>'){//end of doctype
return;
}else if( ch === '['){
hasBody = true;
}else{
lastch = ch;
}
}//End While loop
}
function registerEntity(parser){
//read Entity
let attrBoundary="";
let name ="", val ="";
while(source.canRead()){
let ch = source.readCh();
if(attrBoundary){
if (ch === attrBoundary){
val = text;
text = ""
}
}else if(ch === " " || ch === "\t"){
if(!name){
name = text.trimStart();
text = "";
}
}else if (ch === '"' || ch === "'") {//start of attrBoundary
attrBoundary = ch;
}else if(ch === ">"){
parser.entityParser.addExternalEntity(name,val);
return;
}else{
text+=ch;
}
}
}
module.exports = {
readCdata: readCdata,
readComment:readComment,
readDocType:readDocType,
readPiTag:readPiTag
}
@@ -0,0 +1,20 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./omit-from-mapped-key"), exports);
__exportStar(require("./omit-from-mapped-result"), exports);
__exportStar(require("./omit"), exports);
@@ -0,0 +1,20 @@
'use strict';
var define = require('define-properties');
var shimUnscopables = require('es-shim-unscopables');
var getPolyfill = require('./polyfill');
module.exports = function shimFlatMap() {
var polyfill = getPolyfill();
define(
Array.prototype,
{ flatMap: polyfill },
{ flatMap: function () { return Array.prototype.flatMap !== polyfill; } }
);
shimUnscopables('flatMap');
return polyfill;
};
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,eAAe,SACpB,MAAM,GAAG,GAAG,gBACL,MAAM,KAClB,MAsCF,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,eAAe,SACpB,MAAM,GAAG,GAAG,gBACL,MAAM,QAEiD,CAAA"}
@@ -0,0 +1,10 @@
'use strict';
var ToUint16 = require('./ToUint16');
// https://262.ecma-international.org/6.0/#sec-toint16
module.exports = function ToInt16(argument) {
var int16bit = ToUint16(argument);
return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit;
};
@@ -0,0 +1,13 @@
import {isAlphabetical} from 'is-alphabetical'
import {isDecimal} from 'is-decimal'
/**
* Check if the given character code, or the character code at the first
* character, is alphanumerical.
*
* @param {string|number} character
* @returns {boolean} Whether `character` is alphanumerical.
*/
export function isAlphanumerical(character) {
return isAlphabetical(character) || isDecimal(character)
}
@@ -0,0 +1,145 @@
'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _path = require('path');var path = _interopRequireWildcard(_path);
var _contextCompat = require('eslint-module-utils/contextCompat');
var _builder = require('../exportMap/builder');var _builder2 = _interopRequireDefault(_builder);
var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;} else {var newObj = {};if (obj != null) {for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];}}newObj['default'] = obj;return newObj;}}
module.exports = {
meta: {
type: 'problem',
docs: {
category: 'Static analysis',
description: 'Ensure named imports correspond to a named export in the remote file.',
url: (0, _docsUrl2['default'])('named') },
schema: [
{
type: 'object',
properties: {
commonjs: {
type: 'boolean' } },
additionalProperties: false }] },
create: function () {function create(context) {
var options = context.options[0] || {};
function checkSpecifiers(key, type, node) {
// ignore local exports and type imports/exports
if (
node.source == null ||
node.importKind === 'type' ||
node.importKind === 'typeof' ||
node.exportKind === 'type')
{
return;
}
if (!node.specifiers.some(function (im) {return im.type === type;})) {
return; // no named imports/exports
}
var imports = _builder2['default'].get(node.source.value, context);
if (imports == null || imports.parseGoal === 'ambiguous') {
return;
}
if (imports.errors.length) {
imports.reportErrors(context, node);
return;
}
node.specifiers.forEach(function (im) {
if (
im.type !== type
// ignore type imports
|| im.importKind === 'type' || im.importKind === 'typeof')
{
return;
}
var name = im[key].name || im[key].value;
var deepLookup = imports.hasDeep(name);
if (!deepLookup.found) {
if (deepLookup.path.length > 1) {
var deepPath = deepLookup.path.
map(function (i) {return path.relative(path.dirname((0, _contextCompat.getPhysicalFilename)(context)), i.path);}).
join(' -> ');
context.report(im[key], String(name) + ' not found via ' + String(deepPath));
} else {
context.report(im[key], String(name) + ' not found in \'' + String(node.source.value) + '\'');
}
}
});
}
function checkRequire(node) {
if (
!options.commonjs ||
node.type !== 'VariableDeclarator'
// return if it's not an object destructure or it's an empty object destructure
|| !node.id || node.id.type !== 'ObjectPattern' || node.id.properties.length === 0
// return if there is no call expression on the right side
|| !node.init || node.init.type !== 'CallExpression')
{
return;
}
var call = node.init;var _call$arguments = _slicedToArray(
call.arguments, 1),source = _call$arguments[0];
var variableImports = node.id.properties;
var variableExports = _builder2['default'].get(source.value, context);
if (
// return if it's not a commonjs require statement
call.callee.type !== 'Identifier' || call.callee.name !== 'require' || call.arguments.length !== 1
// return if it's not a string source
|| source.type !== 'Literal' ||
variableExports == null ||
variableExports.parseGoal === 'ambiguous')
{
return;
}
if (variableExports.errors.length) {
variableExports.reportErrors(context, node);
return;
}
variableImports.forEach(function (im) {
if (im.type !== 'Property' || !im.key || im.key.type !== 'Identifier') {
return;
}
var deepLookup = variableExports.hasDeep(im.key.name);
if (!deepLookup.found) {
if (deepLookup.path.length > 1) {
var deepPath = deepLookup.path.
map(function (i) {return path.relative(path.dirname((0, _contextCompat.getFilename)(context)), i.path);}).
join(' -> ');
context.report(im.key, String(im.key.name) + ' not found via ' + String(deepPath));
} else {
context.report(im.key, String(im.key.name) + ' not found in \'' + String(source.value) + '\'');
}
}
});
}
return {
ImportDeclaration: checkSpecifiers.bind(null, 'imported', 'ImportSpecifier'),
ExportNamedDeclaration: checkSpecifiers.bind(null, 'local', 'ExportSpecifier'),
VariableDeclarator: checkRequire };
}return create;}() };
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uYW1lZC5qcyJdLCJuYW1lcyI6WyJwYXRoIiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlI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DLHdCQUFnQmpCLE9BQWhCLENBQXdCLFVBQVVULEVBQVYsRUFBYztBQUNwQyxjQUFJQSxHQUFHcEIsSUFBSCxLQUFZLFVBQVosSUFBMEIsQ0FBQ29CLEdBQUdQLEdBQTlCLElBQXFDTyxHQUFHUCxHQUFILENBQU9iLElBQVAsS0FBZ0IsWUFBekQsRUFBdUU7QUFDckU7QUFDRDs7QUFFRCxjQUFNK0IsYUFBYWdCLGdCQUFnQmYsT0FBaEIsQ0FBd0JaLEdBQUdQLEdBQUgsQ0FBT2lCLElBQS9CLENBQW5COztBQUVBLGNBQUksQ0FBQ0MsV0FBV0UsS0FBaEIsRUFBdUI7QUFDckIsZ0JBQUlGLFdBQVduQyxJQUFYLENBQWdCK0IsTUFBaEIsR0FBeUIsQ0FBN0IsRUFBZ0M7QUFDOUIsa0JBQU1PLFdBQVdILFdBQVduQyxJQUFYO0FBQ2R1QyxpQkFEYyxDQUNWLFVBQUNDLENBQUQsVUFBT3hDLEtBQUt5QyxRQUFMLENBQWN6QyxLQUFLMEMsT0FBTCxDQUFhLGdDQUFZNUIsT0FBWixLine truncated
@@ -0,0 +1,454 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = path2contours;
var _bezierCubic2Q = _interopRequireDefault(require("../../math/bezierCubic2Q2"));
var _getArc = _interopRequireDefault(require("../../graphics/getArc"));
var _parseParams = _interopRequireDefault(require("./parseParams"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @file svg path转换为轮廓
* @author mengke01(kekee000@gmail.com)
*/
/**
* 三次贝塞尔曲线,转二次贝塞尔曲线
*
* @param {Array} cubicList 三次曲线数组
* @param {Array} contour 当前解析后的轮廓数组
* @return {Array} 当前解析后的轮廓数组
*/
function cubic2Points(cubicList, contour) {
var i;
var l;
var q2List = [];
cubicList.forEach(function (c) {
var list = (0, _bezierCubic2Q.default)(c[0], c[1], c[2], c[3]);
for (i = 0, l = list.length; i < l; i++) {
q2List.push(list[i]);
}
});
var q2;
var prevq2;
for (i = 0, l = q2List.length; i < l; i++) {
q2 = q2List[i];
if (i === 0) {
contour.push({
x: q2[1].x,
y: q2[1].y
});
contour.push({
x: q2[2].x,
y: q2[2].y,
onCurve: true
});
} else {
prevq2 = q2List[i - 1];
// 检查是否存在切线点
if (prevq2[1].x + q2[1].x === 2 * q2[0].x && prevq2[1].y + q2[1].y === 2 * q2[0].y) {
contour.pop();
}
contour.push({
x: q2[1].x,
y: q2[1].y
});
contour.push({
x: q2[2].x,
y: q2[2].y,
onCurve: true
});
}
}
contour.push({
x: q2[2].x,
y: q2[2].y,
onCurve: true
});
return contour;
}
/**
* svg 命令数组转轮廓
*
* @param {Array} segments svg 命令数组
* @return {Array} 轮廓数组
*/
function segments2Contours(segments) {
// 解析segments
var contours = [];
var contour = [];
var prevX = 0;
var prevY = 0;
var segment;
var args;
var cmd;
var relative;
var q;
var ql;
var px;
var py;
var cubicList;
var p1;
var p2;
var c1;
var c2;
var prevCubicC1; // 三次贝塞尔曲线前一个控制点,用于绘制`s`命令
for (var i = 0, l = segments.length; i < l; i++) {
segment = segments[i];
cmd = segment.cmd;
relative = segment.relative;
args = segment.args;
if (args && !args.length && cmd !== 'Z') {
console.warn('`' + cmd + '` command args empty!');
continue;
}
if (cmd === 'Z') {
contours.push(contour);
contour = [];
} else if (cmd === 'M' || cmd === 'L') {
if (args.length % 2) {
throw new Error('`M` command error:' + args.join(','));
}
// 这里可能会连续绘制,最后一个是终点
if (relative) {
px = prevX;
py = prevY;
} else {
px = 0;
py = 0;
}
for (q = 0, ql = args.length; q < ql; q += 2) {
if (relative) {
px += args[q];
py += args[q + 1];
} else {
px = args[q];
py = args[q + 1];
}
contour.push({
x: px,
y: py,
onCurve: true
});
}
prevX = px;
prevY = py;
} else if (cmd === 'H') {
if (relative) {
prevX += args[0];
} else {
prevX = args[0];
}
contour.push({
x: prevX,
y: prevY,
onCurve: true
});
} else if (cmd === 'V') {
if (relative) {
prevY += args[0];
} else {
prevY = args[0];
}
contour.push({
x: prevX,
y: prevY,
onCurve: true
});
}
// 二次贝塞尔
else if (cmd === 'Q') {
// 这里可能会连续绘制,最后一个是终点
if (relative) {
px = prevX;
py = prevY;
} else {
px = 0;
py = 0;
}
for (q = 0, ql = args.length; q < ql; q += 4) {
contour.push({
x: px + args[q],
y: py + args[q + 1]
});
contour.push({
x: px + args[q + 2],
y: py + args[q + 3],
onCurve: true
});
if (relative) {
px += args[q + 2];
py += args[q + 3];
} else {
px = 0;
py = 0;
}
}
if (relative) {
prevX = px;
prevY = py;
} else {
prevX = args[ql - 2];
prevY = args[ql - 1];
}
}
// 二次贝塞尔平滑
else if (cmd === 'T') {
// 这里需要移除上一个曲线的终点
var last = contour.pop();
var pc = contour[contour.length - 1];
if (!pc) {
pc = last;
}
contour.push(pc = {
x: 2 * last.x - pc.x,
y: 2 * last.y - pc.y
});
px = prevX;
py = prevY;
for (q = 0, ql = args.length - 2; q < ql; q += 2) {
if (relative) {
px += args[q];
py += args[q + 1];
} else {
px = args[q];
py = args[q + 1];
}
last = {
x: px,
y: py
};
contour.push(pc = {
x: 2 * last.x - pc.x,
y: 2 * last.y - pc.y
});
}
if (relative) {
prevX = px + args[ql];
prevY = py + args[ql + 1];
} else {
prevX = args[ql];
prevY = args[ql + 1];
}
contour.push({
x: prevX,
y: prevY,
onCurve: true
});
}
// 三次贝塞尔
else if (cmd === 'C') {
if (args.length % 6) {
throw new Error('`C` command params error:' + args.join(','));
}
// 这里可能会连续绘制,最后一个是终点
cubicList = [];
if (relative) {
px = prevX;
py = prevY;
} else {
px = 0;
py = 0;
}
p1 = {
x: prevX,
y: prevY
};
for (q = 0, ql = args.length; q < ql; q += 6) {
c1 = {
x: px + args[q],
y: py + args[q + 1]
};
c2 = {
x: px + args[q + 2],
y: py + args[q + 3]
};
p2 = {
x: px + args[q + 4],
y: py + args[q + 5]
};
cubicList.push([p1, c1, c2, p2]);
p1 = p2;
if (relative) {
px += args[q + 4];
py += args[q + 5];
} else {
px = 0;
py = 0;
}
}
if (relative) {
prevX = px;
prevY = py;
} else {
prevX = args[ql - 2];
prevY = args[ql - 1];
}
cubic2Points(cubicList, contour);
prevCubicC1 = cubicList[cubicList.length - 1][2];
}
// 三次贝塞尔平滑
else if (cmd === 'S') {
if (args.length % 4) {
throw new Error('`S` command params error:' + args.join(','));
}
// 这里可能会连续绘制,最后一个是终点
cubicList = [];
if (relative) {
px = prevX;
py = prevY;
} else {
px = 0;
py = 0;
}
// 这里需要移除上一个曲线的终点
p1 = contour.pop();
if (!prevCubicC1) {
prevCubicC1 = p1;
}
c1 = {
x: 2 * p1.x - prevCubicC1.x,
y: 2 * p1.y - prevCubicC1.y
};
for (q = 0, ql = args.length; q < ql; q += 4) {
c2 = {
x: px + args[q],
y: py + args[q + 1]
};
p2 = {
x: px + args[q + 2],
y: py + args[q + 3]
};
cubicList.push([p1, c1, c2, p2]);
p1 = p2;
c1 = {
x: 2 * p1.x - c2.x,
y: 2 * p1.y - c2.y
};
if (relative) {
px += args[q + 2];
py += args[q + 3];
} else {
px = 0;
py = 0;
}
}
if (relative) {
prevX = px;
prevY = py;
} else {
prevX = args[ql - 2];
prevY = args[ql - 1];
}
cubic2Points(cubicList, contour);
prevCubicC1 = cubicList[cubicList.length - 1][2];
}
// 求弧度, rx, ry, angle, largeArc, sweep, ex, ey
else if (cmd === 'A') {
if (args.length % 7) {
throw new Error('arc command params error:' + args.join(','));
}
for (q = 0, ql = args.length; q < ql; q += 7) {
var ex = args[q + 5];
var ey = args[q + 6];
if (relative) {
ex = prevX + ex;
ey = prevY + ey;
}
var path = (0, _getArc.default)(args[q], args[q + 1], args[q + 2], args[q + 3], args[q + 4], {
x: prevX,
y: prevY
}, {
x: ex,
y: ey
});
if (path && path.length > 1) {
for (var r = 1, rl = path.length; r < rl; r++) {
contour.push(path[r]);
}
}
prevX = ex;
prevY = ey;
}
}
}
return contours;
}
/**
* svg path转轮廓
*
* @param {string} path svg的path字符串
* @return {Array} 转换后的轮廓
*/
function path2contours(path) {
if (!path || !path.length) {
return null;
}
path = path.trim();
// 修正头部不为`m`的情况
if (path[0] !== 'M' && path[0] !== 'm') {
path = 'M 0 0' + path;
}
// 修复中间没有结束符`z`的情况
path = path.replace(/(\d+)\s*(m|$)/gi, '$1z$2');
// 获取segments
var segments = [];
var cmd;
var relative = false;
var lastIndex;
var args;
for (var i = 0, l = path.length; i < l; i++) {
var c = path[i].toUpperCase();
var r = c !== path[i];
switch (c) {
case 'M':
/* jshint -W086 */
if (i === 0) {
cmd = c;
lastIndex = 1;
break;
}
// eslint-disable-next-line no-fallthrough
case 'Q':
case 'T':
case 'C':
case 'S':
case 'H':
case 'V':
case 'L':
case 'A':
case 'Z':
if (cmd === 'Z') {
segments.push({
cmd: 'Z'
});
} else {
args = path.slice(lastIndex, i);
segments.push({
cmd: cmd,
relative: relative,
args: (0, _parseParams.default)(args)
});
}
cmd = c;
relative = r;
lastIndex = i + 1;
break;
}
}
segments.push({
cmd: 'Z'
});
return segments2Contours(segments);
}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=getExtendedProperties.spec.d.ts.map
@@ -0,0 +1,162 @@
/**
* @fileoverview Prefer exact proptype definitions
*/
'use strict';
const Components = require('../util/Components');
const docsUrl = require('../util/docsUrl');
const astUtil = require('../util/ast');
const propsUtil = require('../util/props');
const propWrapperUtil = require('../util/propWrapper');
const variableUtil = require('../util/variable');
const report = require('../util/report');
const getText = require('../util/eslint').getText;
// -----------------------------------------------------------------------------
// Rule Definition
// -----------------------------------------------------------------------------
const messages = {
propTypes: 'Component propTypes should be exact by using {{exactPropWrappers}}.',
flow: 'Component flow props should be set with exact objects.',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Prefer exact proptype definitions',
category: 'Possible Errors',
recommended: false,
url: docsUrl('prefer-exact-props'),
},
messages,
schema: [],
},
create: Components.detect((context, components, utils) => {
const typeAliases = {};
const exactWrappers = propWrapperUtil.getExactPropWrapperFunctions(context);
function getPropTypesErrorMessage() {
const formattedWrappers = propWrapperUtil.formatPropWrapperFunctions(exactWrappers);
const message = exactWrappers.size > 1 ? `one of ${formattedWrappers}` : formattedWrappers;
return { exactPropWrappers: message };
}
function isNonExactObjectTypeAnnotation(node) {
return (
node
&& node.type === 'ObjectTypeAnnotation'
&& node.properties.length > 0
&& !node.exact
);
}
function hasNonExactObjectTypeAnnotation(node) {
const typeAnnotation = node.typeAnnotation;
return (
typeAnnotation
&& typeAnnotation.typeAnnotation
&& isNonExactObjectTypeAnnotation(typeAnnotation.typeAnnotation)
);
}
function hasGenericTypeAnnotation(node) {
const typeAnnotation = node.typeAnnotation;
return (
typeAnnotation
&& typeAnnotation.typeAnnotation
&& typeAnnotation.typeAnnotation.type === 'GenericTypeAnnotation'
);
}
function isNonEmptyObjectExpression(node) {
return (
node
&& node.type === 'ObjectExpression'
&& node.properties.length > 0
);
}
function isNonExactPropWrapperFunction(node) {
return (
astUtil.isCallExpression(node)
&& !propWrapperUtil.isExactPropWrapperFunction(context, getText(context, node.callee))
);
}
function reportPropTypesError(node) {
report(context, messages.propTypes, 'propTypes', {
node,
data: getPropTypesErrorMessage(),
});
}
function reportFlowError(node) {
report(context, messages.flow, 'flow', {
node,
});
}
return {
TypeAlias(node) {
// working around an issue with eslint@3 and babel-eslint not finding the TypeAlias in scope
typeAliases[node.id.name] = node;
},
'ClassProperty, PropertyDefinition'(node) {
if (!propsUtil.isPropTypesDeclaration(node)) {
return;
}
if (hasNonExactObjectTypeAnnotation(node)) {
reportFlowError(node);
} else if (exactWrappers.size > 0 && isNonEmptyObjectExpression(node.value)) {
reportPropTypesError(node);
} else if (exactWrappers.size > 0 && isNonExactPropWrapperFunction(node.value)) {
reportPropTypesError(node);
}
},
Identifier(node) {
if (!utils.getStatelessComponent(node.parent)) {
return;
}
if (hasNonExactObjectTypeAnnotation(node)) {
reportFlowError(node);
} else if (hasGenericTypeAnnotation(node)) {
const identifier = node.typeAnnotation.typeAnnotation.id.name;
const typeAlias = typeAliases[identifier];
const propsDefinition = typeAlias ? typeAlias.right : null;
if (isNonExactObjectTypeAnnotation(propsDefinition)) {
reportFlowError(node);
}
}
},
MemberExpression(node) {
if (!propsUtil.isPropTypesDeclaration(node) || exactWrappers.size === 0) {
return;
}
const right = node.parent.right;
if (isNonEmptyObjectExpression(right)) {
reportPropTypesError(node);
} else if (isNonExactPropWrapperFunction(right)) {
reportPropTypesError(node);
} else if (right.type === 'Identifier') {
const identifier = right.name;
const propsDefinition = variableUtil.findVariableByName(context, node, identifier);
if (isNonEmptyObjectExpression(propsDefinition)) {
reportPropTypesError(node);
} else if (isNonExactPropWrapperFunction(propsDefinition)) {
reportPropTypesError(node);
}
}
},
};
}),
};
@@ -0,0 +1,153 @@
/**
* This feature allows the distribution of a Node.js application conveniently to a
* system that does not have Node.js installed.
*
* Node.js supports the creation of [single executable applications](https://github.com/nodejs/single-executable) by allowing
* the injection of a blob prepared by Node.js, which can contain a bundled script,
* into the `node` binary. During start up, the program checks if anything has been
* injected. If the blob is found, it executes the script in the blob. Otherwise
* Node.js operates as it normally does.
*
* The single executable application feature currently only supports running a
* single embedded script using the `CommonJS` module system.
*
* Users can create a single executable application from their bundled script
* with the `node` binary itself and any tool which can inject resources into the
* binary.
*
* Here are the steps for creating a single executable application using one such
* tool, [postject](https://github.com/nodejs/postject):
*
* 1. Create a JavaScript file:
* ```bash
* echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js
* ```
* 2. Create a configuration file building a blob that can be injected into the
* single executable application (see `Generating single executable preparation blobs` for details):
* ```bash
* echo '{ "main": "hello.js", "output": "sea-prep.blob" }' > sea-config.json
* ```
* 3. Generate the blob to be injected:
* ```bash
* node --experimental-sea-config sea-config.json
* ```
* 4. Create a copy of the `node` executable and name it according to your needs:
* * On systems other than Windows:
* ```bash
* cp $(command -v node) hello
* ```
* * On Windows:
* ```text
* node -e "require('fs').copyFileSync(process.execPath, 'hello.exe')"
* ```
* The `.exe` extension is necessary.
* 5. Remove the signature of the binary (macOS and Windows only):
* * On macOS:
* ```bash
* codesign --remove-signature hello
* ```
* * On Windows (optional):
* [signtool](https://learn.microsoft.com/en-us/windows/win32/seccrypto/signtool) can be used from the installed [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/).
* If this step is
* skipped, ignore any signature-related warning from postject.
* ```powershell
* signtool remove /s hello.exe
* ```
* 6. Inject the blob into the copied binary by running `postject` with
* the following options:
* * `hello` / `hello.exe` \- The name of the copy of the `node` executable
* created in step 4.
* * `NODE_SEA_BLOB` \- The name of the resource / note / section in the binary
* where the contents of the blob will be stored.
* * `sea-prep.blob` \- The name of the blob created in step 1.
* * `--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2` \- The [fuse](https://www.electronjs.org/docs/latest/tutorial/fuses) used by the Node.js project to detect if a file has been
* injected.
* * `--macho-segment-name NODE_SEA` (only needed on macOS) - The name of the
* segment in the binary where the contents of the blob will be
* stored.
* To summarize, here is the required command for each platform:
* * On Linux:
* ```bash
* npx postject hello NODE_SEA_BLOB sea-prep.blob \
* --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
* ```
* * On Windows - PowerShell:
* ```powershell
* npx postject hello.exe NODE_SEA_BLOB sea-prep.blob `
* --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
* ```
* * On Windows - Command Prompt:
* ```text
* npx postject hello.exe NODE_SEA_BLOB sea-prep.blob ^
* --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
* ```
* * On macOS:
* ```bash
* npx postject hello NODE_SEA_BLOB sea-prep.blob \
* --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \
* --macho-segment-name NODE_SEA
* ```
* 7. Sign the binary (macOS and Windows only):
* * On macOS:
* ```bash
* codesign --sign - hello
* ```
* * On Windows (optional):
* A certificate needs to be present for this to work. However, the unsigned
* binary would still be runnable.
* ```powershell
* signtool sign /fd SHA256 hello.exe
* ```
* 8. Run the binary:
* * On systems other than Windows
* ```console
* $ ./hello world
* Hello, world!
* ```
* * On Windows
* ```console
* $ .\hello.exe world
* Hello, world!
* ```
* @since v19.7.0, v18.16.0
* @experimental
* @see [source](https://github.com/nodejs/node/blob/v22.x/src/node_sea.cc)
*/
declare module "node:sea" {
type AssetKey = string;
/**
* @since v20.12.0
* @return Whether this script is running inside a single-executable application.
*/
function isSea(): boolean;
/**
* This method can be used to retrieve the assets configured to be bundled into the
* single-executable application at build time.
* An error is thrown when no matching asset can be found.
* @since v20.12.0
*/
function getAsset(key: AssetKey): ArrayBuffer;
function getAsset(key: AssetKey, encoding: string): string;
/**
* Similar to `sea.getAsset()`, but returns the result in a [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob).
* An error is thrown when no matching asset can be found.
* @since v20.12.0
*/
function getAssetAsBlob(key: AssetKey, options?: {
type: string;
}): Blob;
/**
* This method can be used to retrieve the assets configured to be bundled into the
* single-executable application at build time.
* An error is thrown when no matching asset can be found.
*
* Unlike `sea.getRawAsset()` or `sea.getAssetAsBlob()`, this method does not
* return a copy. Instead, it returns the raw asset bundled inside the executable.
*
* For now, users should avoid writing to the returned array buffer. If the
* injected section is not marked as writable or not aligned properly,
* writes to the returned array buffer is likely to result in a crash.
* @since v20.12.0
*/
function getRawAsset(key: AssetKey): ArrayBuffer;
}
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2015_symbol_wellknown: LibDefinition;
@@ -0,0 +1 @@
{"name":"type-is","version":"2.0.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532088693,"integrity":"sha512-68E3wBwT2p2Q/UEXKbEMsV5rfqPzGmud0j0Kdprv5hy+pzaMNmmLDVYuhdygjryqWZlvllMpWhx5JSy6PaPTrQ==","mode":420,"size":1172},"index.js":{"checkedAt":1794532089500,"integrity":"sha512-yhxOXvtXVyaiAkvYSJR+/aEcNWeW7ODDjdiz8jr217I5rcph3saHAAYirYztytIfa20UTeCx4vrDWlQ+pbzDBA==","mode":420,"size":5493},"package.json":{"checkedAt":1794532089500,"integrity":"sha512-oI+cSDE+abJBvN8XyRH5e3VfvzfHlJ3D/EXOU9EPCE8hGUtochcBmIzFkMir31rTzcGF38o4h38/Kh597BXkjA==","mode":420,"size":1236},"HISTORY.md":{"checkedAt":1794532089501,"integrity":"sha512-8fyGtiX5crU5mEhBjKiWG0xAT95ZB/KfWnzKMcXW91dutntDi4S0VDCTDE4rpnwfYlfkaJEr+YVE30qIYwCm5A==","mode":420,"size":6864},"README.md":{"checkedAt":1794532089501,"integrity":"sha512-R32IqMrhxAIHgTIoJZPAYd/S9489ixb49DHZia48XIw2sd1KPgsVZ+oq0W4OTBPjOQvipIAc/QOr8eZHXatu5A==","mode":420,"size":6504}}}
@@ -0,0 +1,50 @@
# get-proto <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
Robustly get the [[Prototype]] of an object. Uses the best available method.
## Getting started
```sh
npm install --save get-proto
```
## Usage/Examples
```js
const assert = require('assert');
const getProto = require('get-proto');
const a = { a: 1, b: 2, [Symbol.toStringTag]: 'foo' };
const b = { c: 3, __proto__: a };
assert.equal(getProto(b), a);
assert.equal(getProto(a), Object.prototype);
assert.equal(getProto({ __proto__: null }), null);
```
## Tests
Clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/get-proto
[npm-version-svg]: https://versionbadg.es/ljharb/get-proto.svg
[deps-svg]: https://david-dm.org/ljharb/get-proto.svg
[deps-url]: https://david-dm.org/ljharb/get-proto
[dev-deps-svg]: https://david-dm.org/ljharb/get-proto/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/get-proto#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/get-proto.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/get-proto.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/get-proto.svg
[downloads-url]: https://npm-stat.com/charts.html?package=get-proto
[codecov-image]: https://codecov.io/gh/ljharb/get-proto/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/get-proto/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/get-proto
[actions-url]: https://github.com/ljharb/get-proto/actions
@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var paragraphRole = {
abstract: false,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['prohibited'],
prohibitedProps: ['aria-label', 'aria-labelledby'],
props: {},
relatedConcepts: [{
concept: {
name: 'p'
},
module: 'HTML'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'structure', 'section']]
};
var _default = exports.default = paragraphRole;
@@ -0,0 +1,108 @@
"use client";
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/use-avatar-group.ts
var use_avatar_group_exports = {};
__export(use_avatar_group_exports, {
useAvatarGroup: () => useAvatarGroup
});
module.exports = __toCommonJS(use_avatar_group_exports);
var import_theme = require("@heroui/theme");
var import_react_utils = require("@heroui/react-utils");
var import_shared_utils = require("@heroui/shared-utils");
var import_react_utils2 = require("@heroui/react-utils");
var import_react = require("react");
function useAvatarGroup(props = {}) {
const {
as,
ref,
max = 5,
total,
size,
color,
radius,
children,
isBordered,
isDisabled,
isGrid,
renderCount,
className,
classNames,
...otherProps
} = props;
const domRef = (0, import_react_utils.useDOMRef)(ref);
const Component = as || "div";
const context = (0, import_react.useMemo)(
() => ({
size,
color,
radius,
isGrid,
isBordered,
isDisabled
}),
[size, color, radius, isGrid, isBordered, isDisabled]
);
const slots = (0, import_react.useMemo)(() => (0, import_theme.avatarGroup)({ className, isGrid }), [className, isGrid]);
const validChildren = (0, import_react_utils2.getValidChildren)(children);
const childrenWithinMax = max ? validChildren.slice(0, max) : validChildren;
const remainingCount = total ? total : max != null ? validChildren.length - max : -1;
const clones = childrenWithinMax.map((child, index) => {
const isFirstAvatar = index === 0;
const isLastAvatar = index === childrenWithinMax.length - 1;
const childProps = {
className: (0, import_shared_utils.clsx)(
isFirstAvatar ? "ms-0" : !isGrid ? "-ms-2" : "",
isLastAvatar && remainingCount < 1 ? "hover:-translate-x-0" : ""
)
};
return (0, import_react.cloneElement)(child, (0, import_shared_utils.compact)(childProps));
});
const getAvatarGroupProps = () => {
return {
ref: domRef,
className: slots.base({
class: (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.base, className)
}),
role: "group",
...otherProps
};
};
const getAvatarGroupCountProps = () => {
return {
className: slots.count({
class: classNames == null ? void 0 : classNames.count
})
};
};
return {
Component,
context,
remainingCount,
clones,
renderCount,
getAvatarGroupProps,
getAvatarGroupCountProps
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
useAvatarGroup
});
@@ -0,0 +1,48 @@
import { importType, createRule, moduleVisitor } from '../utils/index.js';
export default createRule({
name: 'no-nodejs-modules',
meta: {
type: 'suggestion',
docs: {
category: 'Module systems',
description: 'Forbid Node.js builtin modules.',
},
schema: [
{
type: 'object',
properties: {
allow: {
type: 'array',
uniqueItems: true,
items: {
type: 'string',
},
},
},
additionalProperties: false,
},
],
messages: {
builtin: 'Do not import Node.js builtin module "{{moduleName}}"',
},
},
defaultOptions: [],
create(context) {
const options = context.options[0] || {};
const allowed = options.allow || [];
return moduleVisitor((source, node) => {
const moduleName = source.value;
if (!allowed.includes(moduleName) &&
importType(moduleName, context) === 'builtin') {
context.report({
node,
messageId: 'builtin',
data: {
moduleName,
},
});
}
}, { commonjs: true });
},
});
//# sourceMappingURL=no-nodejs-modules.js.map
@@ -0,0 +1 @@
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAqCM,SAAS,0CAA+B,KAAmB;IAChE,IAAI,oBACF,gBAAgB,EACjB,GAAG;IAEJ,IAAI,CAAC,cAAc,gBAAgB,GAAG,CAAA,GAAA,yBAAiB,EACrD,MAAM,YAAY,GAAG,IAAI,IAAI,MAAM,YAAY,IAAI,WACnD,MAAM,mBAAmB,GAAG,IAAI,IAAI,MAAM,mBAAmB,IAAI,IAAI,OACrE;IAGF,IAAI,iBAAiB,CAAA,GAAA,gCAAwB,EAAE;IAC/C,IAAI,eAAe,CAAA,GAAA,cAAM,EAAE,IACzB,MAAM,YAAY,GAAG,IAAI,IAAI,MAAM,YAAY,IAAI,IAAI,OACvD;QAAC,MAAM,YAAY;KAAC;IAEtB,IAAI,OAAO,CAAA,GAAA,oBAAY,EAAE,OAAO,CAAA,GAAA,kBAAU,EAAE,CAAA,QAAS,IAAI,CAAA,GAAA,yCAAa,EAAE,OAAO;0BAAC;QAAY,IAAI;QAAC;KAAa,GAAG;IAEjH,iEAAiE;IACjE,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,eAAe,UAAU,IAAI,QAAQ,CAAC,KAAK,OAAO,CAAC,eAAe,UAAU,GAC9E,eAAe,aAAa,CAAC;IAEjC,uDAAuD;IACvD,GAAG;QAAC;QAAM,eAAe,UAAU;KAAC;IAEpC,IAAI,WAAW,CAAC;QACd,gBAAgB,gCAAU,cAAc;IAC1C;IAEA,OAAO;QACL,YAAY;sBACZ;sBACA;QACA,WAAW;yBACX;QACA,kBAAkB,IAAI,CAAA,GAAA,uBAAe,EAAE,MAAM;IAC/C;AACF;AAEA,SAAS,gCAAU,GAAa,EAAE,GAAQ;IACxC,IAAI,MAAM,IAAI,IAAI;IAClB,IAAI,IAAI,GAAG,CAAC,MACV,IAAI,MAAM,CAAC;SAEX,IAAI,GAAG,CAAC;IAGV,OAAO;AACT","sources":["packages/@react-stately/tree/src/useTreeState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, CollectionStateBase, DisabledBehavior, Expandable, Key, MultipleSelection, Node} from '@react-types/shared';\nimport {SelectionManager, useMultipleSelectionState} from '@react-stately/selection';\nimport {TreeCollection} from './TreeCollection';\nimport {useCallback, useEffect, useMemo} from 'react';\nimport {useCollection} from '@react-stately/collections';\nimport {useControlledState} from '@react-stately/utils';\n\nexport interface TreeProps<T> extends CollectionStateBase<T>, Expandable, MultipleSelection {\n /** Whether `disabledKeys` applies to all interactions, or only selection. */\n disabledBehavior?: DisabledBehavior\n}\nexport interface TreeState<T> {\n /** A collection of items in the tree. */\n readonly collection: Collection<Node<T>>,\n\n /** A set of keys for items that are disabled. */\n readonly disabledKeys: Set<Key>,\n\n /** A set of keys for items that are expanded. */\n readonly expandedKeys: Set<Key>,\n\n /** Toggles the expanded state for an item by its key. */\n toggleKey(key: Key): void,\n\n /** Replaces the set of expanded keys. */\n setExpandedKeys(keys: Set<Key>): void,\n\n /** A selection manager to read and update multiple selection state. */\n readonly selectionManager: SelectionManager\n}\n\n/**\n * Provides state management for tree-like components. Handles building a collection\n * of items from props, item expanded state, and manages multiple selection state.\n */\nexport function useTreeState<T extends object>(props: TreeProps<T>): TreeState<T> {\n let {\n onExpandedChange\n } = props;\n\n let [expandedKeys, setExpandedKeys] = useControlledState(\n props.expandedKeys ? new Set(props.expandedKeys) : undefined,\n props.defaultExpandedKeys ? new Set(props.defaultExpandedKeys) : new Set(),\n onExpandedChange\n );\n\n let selectionState = useMultipleSelectionState(props);\n let disabledKeys = useMemo(() =>\n props.disabledKeys ? new Set(props.disabledKeys) : new Set<Key>()\n , [props.disabledKeys]);\n\n let tree = useCollection(props, useCallback(nodes => new TreeCollection(nodes, {expandedKeys}), [expandedKeys]), null);\n\n // Reset focused key if that item is deleted from the collection.\n useEffect(() => {\n if (selectionState.focusedKey != null && !tree.getItem(selectionState.focusedKey)) {\n selectionState.setFocusedKey(null);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [tree, selectionState.focusedKey]);\n\n let onToggle = (key: Key) => {\n setExpandedKeys(toggleKey(expandedKeys, key));\n };\n\n return {\n collection: tree,\n expandedKeys,\n disabledKeys,\n toggleKey: onToggle,\n setExpandedKeys,\n selectionManager: new SelectionManager(tree, selectionState)\n };\n}\n\nfunction toggleKey(set: Set<Key>, key: Key): Set<Key> {\n let res = new Set(set);\n if (res.has(key)) {\n res.delete(key);\n } else {\n res.add(key);\n }\n\n return res;\n}\n"],"names":[],"version":3,"file":"useTreeState.module.js.map"}
@@ -0,0 +1,22 @@
export default function buildMediaQuery(screens) {
screens = Array.isArray(screens) ? screens : [screens]
return screens
.map((screen) => {
let values = screen.values.map((screen) => {
if (screen.raw !== undefined) {
return screen.raw
}
return [
screen.min && `(min-width: ${screen.min})`,
screen.max && `(max-width: ${screen.max})`,
]
.filter(Boolean)
.join(' and ')
})
return screen.not ? `not all and ${values}` : values
})
.join(', ')
}
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more