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,124 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {GridState, useGridState} from '@react-stately/grid';
import {TableCollection as ITableCollection, TableBodyProps, TableHeaderProps} from '@react-types/table';
import {Key, Node, SelectionMode, Sortable, SortDescriptor, SortDirection} from '@react-types/shared';
import {MultipleSelectionState, MultipleSelectionStateProps} from '@react-stately/selection';
import {ReactElement, useCallback, useMemo, useState} from 'react';
import {TableCollection} from './TableCollection';
import {useCollection} from '@react-stately/collections';
export interface TableState<T> extends GridState<T, ITableCollection<T>> {
/** A collection of rows and columns in the table. */
collection: ITableCollection<T>,
/** Whether the row selection checkboxes should be displayed. */
showSelectionCheckboxes: boolean,
/** The current sorted column and direction. */
sortDescriptor: SortDescriptor | null,
/** Calls the provided onSortChange handler with the provided column key and sort direction. */
sort(columnKey: Key, direction?: 'ascending' | 'descending'): void,
/** Whether keyboard navigation is disabled, such as when the arrow keys should be handled by a component within a cell. */
isKeyboardNavigationDisabled: boolean,
/** Set whether keyboard navigation is disabled, such as when the arrow keys should be handled by a component within a cell. */
setKeyboardNavigationDisabled: (val: boolean) => void
}
export interface CollectionBuilderContext<T> {
showSelectionCheckboxes: boolean,
showDragButtons: boolean,
selectionMode: SelectionMode,
columns: Node<T>[]
}
export interface TableStateProps<T> extends MultipleSelectionStateProps, Sortable {
/** The elements that make up the table. Includes the TableHeader, TableBody, Columns, and Rows. */
children?: [ReactElement<TableHeaderProps<T>>, ReactElement<TableBodyProps<T>>],
/** A list of row keys to disable. */
disabledKeys?: Iterable<Key>,
/** A pre-constructed collection to use instead of building one from items and children. */
collection?: ITableCollection<T>,
/** Whether the row selection checkboxes should be displayed. */
showSelectionCheckboxes?: boolean,
/** Whether the row drag button should be displayed.
* @private
*/
showDragButtons?: boolean,
/** @private - do not use unless you know what you're doing. */
UNSAFE_selectionState?: MultipleSelectionState
}
const OPPOSITE_SORT_DIRECTION = {
ascending: 'descending' as SortDirection,
descending: 'ascending' as SortDirection
};
/**
* Provides state management for a table component. Handles building a collection
* of columns and rows from props. In addition, it tracks row selection and manages sort order changes.
*/
export function useTableState<T extends object>(props: TableStateProps<T>): TableState<T> {
let [isKeyboardNavigationDisabled, setKeyboardNavigationDisabled] = useState(false);
let {selectionMode = 'none', showSelectionCheckboxes, showDragButtons} = props;
let context = useMemo(() => ({
showSelectionCheckboxes: showSelectionCheckboxes && selectionMode !== 'none',
showDragButtons: showDragButtons,
selectionMode,
columns: []
// eslint-disable-next-line react-hooks/exhaustive-deps
}), [props.children, showSelectionCheckboxes, selectionMode, showDragButtons]);
let collection = useCollection<T, ITableCollection<T>>(
props,
useCallback((nodes) => new TableCollection(nodes, null, context), [context]),
context
);
let {disabledKeys, selectionManager} = useGridState({
...props,
collection,
disabledBehavior: props.disabledBehavior || 'selection'
});
return {
collection,
disabledKeys,
selectionManager,
showSelectionCheckboxes: props.showSelectionCheckboxes || false,
sortDescriptor: props.sortDescriptor ?? null,
isKeyboardNavigationDisabled: collection.size === 0 || isKeyboardNavigationDisabled,
setKeyboardNavigationDisabled,
sort(columnKey: Key, direction?: 'ascending' | 'descending') {
props.onSortChange?.({
column: columnKey,
direction: direction ?? (props.sortDescriptor?.column === columnKey
? OPPOSITE_SORT_DIRECTION[props.sortDescriptor.direction]
: 'ascending')
});
}
};
}
/**
* Filters a collection using the provided filter function and returns a new TableState.
*/
export function UNSTABLE_useFilteredTableState<T extends object>(state: TableState<T>, filterFn: ((nodeValue: string, node: Node<T>) => boolean) | null | undefined): TableState<T> {
let collection = useMemo(() => filterFn ? state.collection.filter!(filterFn) : state.collection, [state.collection, filterFn]) as ITableCollection<T>;
let selectionManager = state.selectionManager.withCollection(collection);
// TODO: handle focus key reset? That logic is in useGridState
return {
...state,
collection,
selectionManager
};
}
@@ -0,0 +1,39 @@
import baseFlatten from './_baseFlatten.js';
import baseIteratee from './_baseIteratee.js';
import baseRest from './_baseRest.js';
import baseUniq from './_baseUniq.js';
import isArrayLikeObject from './isArrayLikeObject.js';
import last from './last.js';
/**
* This method is like `_.union` except that it accepts `iteratee` which is
* invoked for each element of each `arrays` to generate the criterion by
* which uniqueness is computed. Result values are chosen from the first
* array in which the value occurs. The iteratee is invoked with one argument:
* (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.unionBy([2.1], [1.2, 2.3], Math.floor);
* // => [2.1, 1.2]
*
* // The `_.property` iteratee shorthand.
* _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
var unionBy = baseRest(function(arrays) {
var iteratee = last(arrays);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2));
});
export default unionBy;
@@ -0,0 +1,19 @@
/**
* @import {State} from 'mdast-util-to-markdown'
* @import {FlowChildren, FlowParents, TrackFields} from '../types.js'
*/
/**
* @param {FlowParents} parent
* Parent of flow nodes.
* @param {State} state
* Info passed around about the current state.
* @param {TrackFields} info
* Info on where we are in the document we are generating.
* @returns {string}
* Serialized children, joined by (blank) lines.
*/
export function containerFlow(parent: FlowParents, state: State, info: TrackFields): string;
import type { FlowParents } from '../types.js';
import type { State } from 'mdast-util-to-markdown';
import type { TrackFields } from '../types.js';
//# sourceMappingURL=container-flow.d.ts.map
@@ -0,0 +1,22 @@
export default class boolParser{
constructor(trueList, falseList){
if(trueList)
this.trueList = trueList;
else
this.trueList = ["true"];
if(falseList)
this.falseList = falseList;
else
this.falseList = ["false"];
}
parse(val){
if (typeof val === 'string') {
//TODO: performance: don't convert
const temp = val.toLowerCase();
if(this.trueList.indexOf(temp) !== -1) return true;
else if(this.falseList.indexOf(temp) !== -1 ) return false;
}
return val;
}
}
@@ -0,0 +1 @@
{"name":"@swc/types","version":"0.1.25","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532090301,"integrity":"sha512-KaPDXQ2136OHVOndmkddqkbv1GN5ZYnhNh8e8hMxQvlVBX/zNsnxtxAlibYw3tQShhgxEXhr3es2jhLUEJMERg==","mode":420,"size":10836},"assumptions.js":{"checkedAt":1794532090301,"integrity":"sha512-f2XGQDoj2T+xSOglmwEtZVKrO/8Xj0p9ap2c7A9gQp/BiZ45tLyozAivx12afHv9sT/DcspjyF6yKwNV601gAA==","mode":420,"size":77},"index.js":{"checkedAt":1794532090301,"integrity":"sha512-f2XGQDoj2T+xSOglmwEtZVKrO/8Xj0p9ap2c7A9gQp/BiZ45tLyozAivx12afHv9sT/DcspjyF6yKwNV601gAA==","mode":420,"size":77},"package.json":{"checkedAt":1794532090302,"integrity":"sha512-vGzJYYQj+1pvtkTog8Gigcwl6MTo2Y4e/CqvAOmJKfxMTsb5t1xF8V2cQOIEnX+XbqrECrUngWWAHCh1sxwhhw==","mode":420,"size":930},"README.md":{"checkedAt":1794532090302,"integrity":"sha512-2WQNq9iJxO/HQ3QTRuWUE4s9FDfj3PHuezy0ZGRfwpsciAd/342m47fd0tXFyklqwh1+IKd80F3jizqIivgq9g==","mode":420,"size":219},"assumptions.d.ts":{"checkedAt":1794532090302,"integrity":"sha512-wotIHaBIlsENzQpVaS+Fio3cbbCWFxF9UIFiBI54WwJ/81hV1eZwH6UJGwGQNbCdgbzMpBw4sM8A9dfujEDO2A==","mode":420,"size":2647},"index.d.ts":{"checkedAt":1794532090302,"integrity":"sha512-spxPD8OgBXD9URghvM8mFHsy3lc5aWSgBrX8Y4RPHyL+A8BXHmJiEgNR3B58ImVm4UE+X83Ceg1toUrnUTh+CQ==","mode":420,"size":64064}}}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"6 7 8 9 xC TC J ZB K D E F A B C L M G N O P aB AB 0C 1C"},D:{"1":"0 1 2 3 4 5 qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB"},E:{"1":"E F A B C L M G 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","2":"J ZB K D 2C ZC 3C 4C"},F:{"1":"0 1 2 3 4 5 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB FD GD HD ID NC uC JD OC"},G:{"1":"E OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","2":"ZC KD vC LD MD ND"},H:{"2":"hD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"},J:{"2":"D","16":"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 AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD","2":"J"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:6,C:"Array.prototype.findIndex",D:true};
@@ -0,0 +1,24 @@
# @heroui/switch
The Switch component is used as an alternative between checked and not checked states.
Please refer to the [documentation](https://heroui.com/docs/components/switch) for more information.
## Installation
```sh
yarn add @heroui/switch
# or
npm i @heroui/switch
```
## Contribution
Yes please! See the
[contributing guidelines](https://github.com/frontio-ai/heroui/blob/master/CONTRIBUTING.md)
for details.
## License
This project is licensed under the terms of the
[MIT license](https://github.com/frontio-ai/heroui/blob/master/LICENSE).
@@ -0,0 +1,80 @@
"use client";
// src/use-button-group.ts
import { buttonGroup } from "@heroui/theme";
import { mapPropsVariants, useProviderContext } from "@heroui/system";
import { useDOMRef } from "@heroui/react-utils";
import { useMemo, useCallback } from "react";
import { objectToDeps } from "@heroui/shared-utils";
function useButtonGroup(originalProps) {
var _a, _b;
const globalContext = useProviderContext();
const [props, variantProps] = mapPropsVariants(originalProps, buttonGroup.variantKeys);
const {
ref,
as,
children,
color = "default",
size = "md",
variant = "solid",
radius,
isDisabled = false,
isIconOnly = false,
disableRipple = (_a = globalContext == null ? void 0 : globalContext.disableRipple) != null ? _a : false,
disableAnimation = (_b = globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false,
className,
...otherProps
} = props;
const Component = as || "div";
const domRef = useDOMRef(ref);
const classNames = useMemo(
() => buttonGroup({
...variantProps,
className
}),
[objectToDeps(variantProps), className]
);
const context = useMemo(
() => ({
size,
color,
variant,
radius,
isIconOnly,
isDisabled,
disableAnimation,
disableRipple,
fullWidth: !!(originalProps == null ? void 0 : originalProps.fullWidth)
}),
[
size,
color,
variant,
radius,
isDisabled,
isIconOnly,
disableAnimation,
disableRipple,
originalProps == null ? void 0 : originalProps.fullWidth
]
);
const getButtonGroupProps = useCallback(
() => ({
role: "group",
...otherProps
}),
[otherProps]
);
return {
Component,
children,
domRef,
context,
classNames,
getButtonGroupProps
};
}
export {
useButtonGroup
};
@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const BasicLayout = require("./BasicLayout.js");
const ConsoleAppender = require("./ConsoleAppender.js");
const Level = require("./Level.js");
const LogFactory = require("./LogFactory.js");
const Logger = require("./Logger.js");
const PatternLayout = require("./PatternLayout.js");
const basicLogPrefix = require("./basicLogPrefix.js");
const compilePattern = require("./compilePattern.js");
const formatMessage = require("./formatMessage.js");
const normalizeLevel = require("./normalizeLevel.js");
const pad = require("./pad.js");
exports.BasicLayout = BasicLayout;
exports.ConsoleAppender = ConsoleAppender;
exports.Level = Level;
exports.LogFactory = LogFactory;
exports.Logger = Logger;
exports.PatternLayout = PatternLayout;
exports.basicLogPrefix = basicLogPrefix;
exports.compilePattern = compilePattern;
exports.formatMessage = formatMessage;
exports.normalizeLevel = normalizeLevel;
exports.pad = pad;
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=BindingService.spec.d.ts.map
@@ -0,0 +1,34 @@
# Empty Array
[ ]
==>
JsonText(Array)
# Array With One Value
["One is the loneliest number"]
==>
JsonText(Array(String))
# Array With Multiple Values
[
"The more the merrier",
1e5,
true,
{ },
["I'm", "nested"]
]
==>
JsonText(Array(
String,
Number,
True,
Object,
Array(String,String)))
@@ -0,0 +1,178 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {FocusableElement} from '@react-types/shared';
import {focusWithoutScrolling, getOwnerWindow, isFocusable, useEffectEvent, useLayoutEffect} from '@react-aria/utils';
import {FocusEvent as ReactFocusEvent, SyntheticEvent, useCallback, useRef} from 'react';
// Turn a native event into a React synthetic event.
export function createSyntheticEvent<E extends SyntheticEvent>(nativeEvent: Event): E {
let event = nativeEvent as any as E;
event.nativeEvent = nativeEvent;
event.isDefaultPrevented = () => event.defaultPrevented;
// cancelBubble is technically deprecated in the spec, but still supported in all browsers.
event.isPropagationStopped = () => (event as any).cancelBubble;
event.persist = () => {};
return event;
}
export function setEventTarget(event: Event, target: Element): void {
Object.defineProperty(event, 'target', {value: target});
Object.defineProperty(event, 'currentTarget', {value: target});
}
export function useSyntheticBlurEvent<Target extends Element = Element>(onBlur: (e: ReactFocusEvent<Target>) => void): (e: ReactFocusEvent<Target>) => void {
let stateRef = useRef({
isFocused: false,
observer: null as MutationObserver | null
});
// Clean up MutationObserver on unmount. See below.
useLayoutEffect(() => {
const state = stateRef.current;
return () => {
if (state.observer) {
state.observer.disconnect();
state.observer = null;
}
};
}, []);
let dispatchBlur = useEffectEvent((e: ReactFocusEvent<Target>) => {
onBlur?.(e);
});
// This function is called during a React onFocus event.
return useCallback((e: ReactFocusEvent<Target>) => {
// React does not fire onBlur when an element is disabled. https://github.com/facebook/react/issues/9142
// Most browsers fire a native focusout event in this case, except for Firefox. In that case, we use a
// MutationObserver to watch for the disabled attribute, and dispatch these events ourselves.
// For browsers that do, focusout fires before the MutationObserver, so onBlur should not fire twice.
if (
e.target instanceof HTMLButtonElement ||
e.target instanceof HTMLInputElement ||
e.target instanceof HTMLTextAreaElement ||
e.target instanceof HTMLSelectElement
) {
stateRef.current.isFocused = true;
let target = e.target;
let onBlurHandler: EventListenerOrEventListenerObject | null = (e) => {
stateRef.current.isFocused = false;
if (target.disabled) {
// For backward compatibility, dispatch a (fake) React synthetic event.
let event = createSyntheticEvent<ReactFocusEvent<Target>>(e);
dispatchBlur(event);
}
// We no longer need the MutationObserver once the target is blurred.
if (stateRef.current.observer) {
stateRef.current.observer.disconnect();
stateRef.current.observer = null;
}
};
target.addEventListener('focusout', onBlurHandler, {once: true});
stateRef.current.observer = new MutationObserver(() => {
if (stateRef.current.isFocused && target.disabled) {
stateRef.current.observer?.disconnect();
let relatedTargetEl = target === document.activeElement ? null : document.activeElement;
target.dispatchEvent(new FocusEvent('blur', {relatedTarget: relatedTargetEl}));
target.dispatchEvent(new FocusEvent('focusout', {bubbles: true, relatedTarget: relatedTargetEl}));
}
});
stateRef.current.observer.observe(target, {attributes: true, attributeFilter: ['disabled']});
}
}, [dispatchBlur]);
}
export let ignoreFocusEvent = false;
/**
* This function prevents the next focus event fired on `target`, without using `event.preventDefault()`.
* It works by waiting for the series of focus events to occur, and reverts focus back to where it was before.
* It also makes these events mostly non-observable by using a capturing listener on the window and stopping propagation.
*/
export function preventFocus(target: FocusableElement | null): (() => void) | undefined {
// The browser will focus the nearest focusable ancestor of our target.
while (target && !isFocusable(target)) {
target = target.parentElement;
}
let window = getOwnerWindow(target);
let activeElement = window.document.activeElement as FocusableElement | null;
if (!activeElement || activeElement === target) {
return;
}
ignoreFocusEvent = true;
let isRefocusing = false;
let onBlur = (e: FocusEvent) => {
if (e.target === activeElement || isRefocusing) {
e.stopImmediatePropagation();
}
};
let onFocusOut = (e: FocusEvent) => {
if (e.target === activeElement || isRefocusing) {
e.stopImmediatePropagation();
// If there was no focusable ancestor, we don't expect a focus event.
// Re-focus the original active element here.
if (!target && !isRefocusing) {
isRefocusing = true;
focusWithoutScrolling(activeElement);
cleanup();
}
}
};
let onFocus = (e: FocusEvent) => {
if (e.target === target || isRefocusing) {
e.stopImmediatePropagation();
}
};
let onFocusIn = (e: FocusEvent) => {
if (e.target === target || isRefocusing) {
e.stopImmediatePropagation();
if (!isRefocusing) {
isRefocusing = true;
focusWithoutScrolling(activeElement);
cleanup();
}
}
};
window.addEventListener('blur', onBlur, true);
window.addEventListener('focusout', onFocusOut, true);
window.addEventListener('focusin', onFocusIn, true);
window.addEventListener('focus', onFocus, true);
let cleanup = () => {
cancelAnimationFrame(raf);
window.removeEventListener('blur', onBlur, true);
window.removeEventListener('focusout', onFocusOut, true);
window.removeEventListener('focusin', onFocusIn, true);
window.removeEventListener('focus', onFocus, true);
ignoreFocusEvent = false;
isRefocusing = false;
};
let raf = requestAnimationFrame(cleanup);
return cleanup;
}
@@ -0,0 +1 @@
{"name":"character-reference-invalid","version":"2.0.1","requiresBuild":false,"files":{"license":{"checkedAt":1794532112874,"integrity":"sha512-00mBaAegOXNJDyksTMrytYh98gH+v/fruetGXfLv5IVYnw8WD5PgOTOdM0A7q244DNs0Ynq8gFk4JA6SWxIdbA==","mode":420,"size":1099},"index.js":{"checkedAt":1794532114511,"integrity":"sha512-MQ8uA+DougHUQh/Te9RAmWwSQIotih1j7dX561u2D8EAWeB40awHuIImBU3hnfaIS7nQvtf2W0VimTR17XDQiQ==","mode":420,"size":558},"package.json":{"checkedAt":1794532114511,"integrity":"sha512-9TLF4zdZuXG5ZrwGI8mAaiCKUXVG0aGYiwXQ0tVb/n4mArcLRx4dgq4MZFwWDuJlaTAxcpuygWiO2jWaynW7fg==","mode":420,"size":2233},"readme.md":{"checkedAt":1794532114511,"integrity":"sha512-t9XbqRoah/k0TufdNYPe9TXopF3b1WdT81UXPptkaLpHetdhEh4XV6/NtxXh7uXh9HaeiT41NOfihVzrNeGvHQ==","mode":420,"size":4341},"index.d.ts":{"checkedAt":1794532114511,"integrity":"sha512-Az0z9OYa8xT/VdOHaa9srusbZhsixgUsdm7dmSb6LP5SAy7XNg4o6psgEI8ZQvpjFJUIoYEgfJ8NQ/PDKA7JHQ==","mode":420,"size":197}}}
@@ -0,0 +1,2 @@
/** Specialized deep immutable value. Applies freeze recursively to the given value */
export declare function Immutable(value: unknown): unknown;
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var MarkRole = {
relatedConcepts: [{
module: 'HTML',
concept: {
name: 'mark'
}
}],
type: 'structure'
};
var _default = MarkRole;
exports.default = _default;
@@ -0,0 +1,142 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DocumentPosition = void 0;
exports.removeSubsets = removeSubsets;
exports.compareDocumentPosition = compareDocumentPosition;
exports.uniqueSort = uniqueSort;
var domhandler_1 = require("domhandler");
/**
* Given an array of nodes, remove any member that is contained by another
* member.
*
* @category Helpers
* @param nodes Nodes to filter.
* @returns Remaining nodes that aren't contained by other nodes.
*/
function removeSubsets(nodes) {
var idx = nodes.length;
/*
* Check if each node (or one of its ancestors) is already contained in the
* array.
*/
while (--idx >= 0) {
var node = nodes[idx];
/*
* Remove the node if it is not unique.
* We are going through the array from the end, so we only
* have to check nodes that preceed the node under consideration in the array.
*/
if (idx > 0 && nodes.lastIndexOf(node, idx - 1) >= 0) {
nodes.splice(idx, 1);
continue;
}
for (var ancestor = node.parent; ancestor; ancestor = ancestor.parent) {
if (nodes.includes(ancestor)) {
nodes.splice(idx, 1);
break;
}
}
}
return nodes;
}
/**
* @category Helpers
* @see {@link http://dom.spec.whatwg.org/#dom-node-comparedocumentposition}
*/
var DocumentPosition;
(function (DocumentPosition) {
DocumentPosition[DocumentPosition["DISCONNECTED"] = 1] = "DISCONNECTED";
DocumentPosition[DocumentPosition["PRECEDING"] = 2] = "PRECEDING";
DocumentPosition[DocumentPosition["FOLLOWING"] = 4] = "FOLLOWING";
DocumentPosition[DocumentPosition["CONTAINS"] = 8] = "CONTAINS";
DocumentPosition[DocumentPosition["CONTAINED_BY"] = 16] = "CONTAINED_BY";
})(DocumentPosition || (exports.DocumentPosition = DocumentPosition = {}));
/**
* Compare the position of one node against another node in any other document,
* returning a bitmask with the values from {@link DocumentPosition}.
*
* Document order:
* > There is an ordering, document order, defined on all the nodes in the
* > document corresponding to the order in which the first character of the
* > XML representation of each node occurs in the XML representation of the
* > document after expansion of general entities. Thus, the document element
* > node will be the first node. Element nodes occur before their children.
* > Thus, document order orders element nodes in order of the occurrence of
* > their start-tag in the XML (after expansion of entities). The attribute
* > nodes of an element occur after the element and before its children. The
* > relative order of attribute nodes is implementation-dependent.
*
* Source:
* http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order
*
* @category Helpers
* @param nodeA The first node to use in the comparison
* @param nodeB The second node to use in the comparison
* @returns A bitmask describing the input nodes' relative position.
*
* See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for
* a description of these values.
*/
function compareDocumentPosition(nodeA, nodeB) {
var aParents = [];
var bParents = [];
if (nodeA === nodeB) {
return 0;
}
var current = (0, domhandler_1.hasChildren)(nodeA) ? nodeA : nodeA.parent;
while (current) {
aParents.unshift(current);
current = current.parent;
}
current = (0, domhandler_1.hasChildren)(nodeB) ? nodeB : nodeB.parent;
while (current) {
bParents.unshift(current);
current = current.parent;
}
var maxIdx = Math.min(aParents.length, bParents.length);
var idx = 0;
while (idx < maxIdx && aParents[idx] === bParents[idx]) {
idx++;
}
if (idx === 0) {
return DocumentPosition.DISCONNECTED;
}
var sharedParent = aParents[idx - 1];
var siblings = sharedParent.children;
var aSibling = aParents[idx];
var bSibling = bParents[idx];
if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {
if (sharedParent === nodeB) {
return DocumentPosition.FOLLOWING | DocumentPosition.CONTAINED_BY;
}
return DocumentPosition.FOLLOWING;
}
if (sharedParent === nodeA) {
return DocumentPosition.PRECEDING | DocumentPosition.CONTAINS;
}
return DocumentPosition.PRECEDING;
}
/**
* Sort an array of nodes based on their relative position in the document,
* removing any duplicate nodes. If the array contains nodes that do not belong
* to the same document, sort order is unspecified.
*
* @category Helpers
* @param nodes Array of DOM nodes.
* @returns Collection of unique nodes, sorted in document order.
*/
function uniqueSort(nodes) {
nodes = nodes.filter(function (node, i, arr) { return !arr.includes(node, i + 1); });
nodes.sort(function (a, b) {
var relative = compareDocumentPosition(a, b);
if (relative & DocumentPosition.PRECEDING) {
return -1;
}
else if (relative & DocumentPosition.FOLLOWING) {
return 1;
}
return 0;
});
return nodes;
}
//# sourceMappingURL=helpers.js.map
@@ -0,0 +1,470 @@
<wiki:toc/>
----
= Quick-start Guide =
== Hashers ==
=== The Hasher Algorithms ===
==== MD5 ====
MD5 is a widely used hash function. It's been used in a variety of security applications and is also commonly used to check the integrity of files. Though, MD5 is not collision resistant, and it isn't suitable for applications like SSL certificates or digital signatures that rely on this property.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/md5.js"></script>
<script>
var hash = CryptoJS.MD5("Message");
</script>
}}}
==== SHA-1 ====
The SHA hash functions were designed by the National Security Agency (NSA). SHA-1 is the most established of the existing SHA hash functions, and it's used in a variety of security applications and protocols. Though, SHA-1's collision resistance has been weakening as new attacks are discovered or improved.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/sha1.js"></script>
<script>
var hash = CryptoJS.SHA1("Message");
</script>
}}}
==== SHA-2 ====
SHA-256 is one of the four variants in the SHA-2 set. It isn't as widely used as SHA-1, though it appears to provide much better security.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/sha256.js"></script>
<script>
var hash = CryptoJS.SHA256("Message");
</script>
}}}
SHA-512 is largely identical to SHA-256 but operates on 64-bit words rather than 32.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/sha512.js"></script>
<script>
var hash = CryptoJS.SHA512("Message");
</script>
}}}
CryptoJS also supports SHA-224 and SHA-384, which are largely identical but truncated versions of SHA-256 and SHA-512 respectively.
==== SHA-3 ====
SHA-3 is the winner of a five-year competition to select a new cryptographic hash algorithm where 64 competing designs were evaluated.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/sha3.js"></script>
<script>
var hash = CryptoJS.SHA3("Message");
</script>
}}}
SHA-3 can be configured to output hash lengths of one of 224, 256, 384, or 512 bits. The default is 512 bits.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/sha3.js"></script>
<script>
var hash = CryptoJS.SHA3("Message", { outputLength: 512 });
var hash = CryptoJS.SHA3("Message", { outputLength: 384 });
var hash = CryptoJS.SHA3("Message", { outputLength: 256 });
var hash = CryptoJS.SHA3("Message", { outputLength: 224 });
</script>
}}}
==== RIPEMD-160 ====
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/ripemd160.js"></script>
<script>
var hash = CryptoJS.RIPEMD160("Message");
</script>
}}}
=== The Hasher Input ===
The hash algorithms accept either strings or instances of CryptoJS.lib.WordArray. A WordArray object represents an array of 32-bit words. When you pass a string, it's automatically converted to a WordArray encoded as UTF-8.
=== The Hasher Output ===
The hash you get back isn't a string yet. It's a WordArray object. When you use a WordArray object in a string context, it's automatically converted to a hex string.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/sha256.js"></script>
<script>
var hash = CryptoJS.SHA256("Message");
alert(typeof hash); // object
alert(hash); // 2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91
</script>
}}}
You can convert a WordArray object to other formats by explicitly calling the toString method and passing an encoder.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/sha256.js"></script>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/components/enc-base64-min.js"></script>
<script>
var hash = CryptoJS.SHA256("Message");
alert(hash.toString(CryptoJS.enc.Base64)); // L3dmip37+NWEi57rSnFFypTG7ZI25Kdz9tyvpRMrL5E=
alert(hash.toString(CryptoJS.enc.Latin1)); // /wf��ûøÕ���ëJqEÊ�Æí�6ä§söܯ¥+/�
alert(hash.toString(CryptoJS.enc.Hex)); // 2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91
</script>
}}}
=== Progressive Hashing ===
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/sha256.js"></script>
<script>
var sha256 = CryptoJS.algo.SHA256.create();
sha256.update("Message Part 1");
sha256.update("Message Part 2");
sha256.update("Message Part 3");
var hash = sha256.finalize();
</script>
}}}
== HMAC ==
Keyed-hash message authentication codes (HMAC) is a mechanism for message authentication using cryptographic hash functions.
HMAC can be used in combination with any iterated cryptographic hash function.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/hmac-md5.js"></script>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/hmac-sha1.js"></script>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/hmac-sha256.js"></script>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/hmac-sha512.js"></script>
<script>
var hash = CryptoJS.HmacMD5("Message", "Secret Passphrase");
var hash = CryptoJS.HmacSHA1("Message", "Secret Passphrase");
var hash = CryptoJS.HmacSHA256("Message", "Secret Passphrase");
var hash = CryptoJS.HmacSHA512("Message", "Secret Passphrase");
</script>
}}}
=== Progressive HMAC Hashing ===
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/hmac-sha256.js"></script>
<script>
var hmac = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, "Secret Passphrase");
hmac.update("Message Part 1");
hmac.update("Message Part 2");
hmac.update("Message Part 3");
var hash = hmac.finalize();
</script>
}}}
== PBKDF2 ==
PBKDF2 is a password-based key derivation function. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.
A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/pbkdf2.js"></script>
<script>
var salt = CryptoJS.lib.WordArray.random(128/8);
var key128Bits = CryptoJS.PBKDF2("Secret Passphrase", salt, { keySize: 128/32 });
var key256Bits = CryptoJS.PBKDF2("Secret Passphrase", salt, { keySize: 256/32 });
var key512Bits = CryptoJS.PBKDF2("Secret Passphrase", salt, { keySize: 512/32 });
var key512Bits1000Iterations = CryptoJS.PBKDF2("Secret Passphrase", salt, { keySize: 512/32, iterations: 1000 });
</script>
}}}
== Ciphers ==
=== The Cipher Algorithms ===
==== AES ====
The Advanced Encryption Standard (AES) is a U.S. Federal Information Processing Standard (FIPS). It was selected after a 5-year process where 15 competing designs were evaluated.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/aes.js"></script>
<script>
var encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase");
var decrypted = CryptoJS.AES.decrypt(encrypted, "Secret Passphrase");
</script>
}}}
CryptoJS supports AES-128, AES-192, and AES-256. It will pick the variant by the size of the key you pass in. If you use a passphrase, then it will generate a 256-bit key.
==== DES, Triple DES ====
DES is a previously dominant algorithm for encryption, and was published as an official Federal Information Processing Standard (FIPS). DES is now considered to be insecure due to the small key size.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/tripledes.js"></script>
<script>
var encrypted = CryptoJS.DES.encrypt("Message", "Secret Passphrase");
var decrypted = CryptoJS.DES.decrypt(encrypted, "Secret Passphrase");
</script>
}}}
Triple DES applies DES three times to each block to increase the key size. The algorithm is believed to be secure in this form.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/tripledes.js"></script>
<script>
var encrypted = CryptoJS.TripleDES.encrypt("Message", "Secret Passphrase");
var decrypted = CryptoJS.TripleDES.decrypt(encrypted, "Secret Passphrase");
</script>
}}}
==== Rabbit ====
Rabbit is a high-performance stream cipher and a finalist in the eSTREAM Portfolio. It is one of the four designs selected after a 3 1/2-year process where 22 designs were evaluated.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/rabbit.js"></script>
<script>
var encrypted = CryptoJS.Rabbit.encrypt("Message", "Secret Passphrase");
var decrypted = CryptoJS.Rabbit.decrypt(encrypted, "Secret Passphrase");
</script>
}}}
==== RC4, RC4Drop ====
RC4 is a widely-used stream cipher. It's used in popular protocols such as SSL and WEP. Although remarkable for its simplicity and speed, the algorithm's history doesn't inspire confidence in its security.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/rc4.js"></script>
<script>
var encrypted = CryptoJS.RC4.encrypt("Message", "Secret Passphrase");
var decrypted = CryptoJS.RC4.decrypt(encrypted, "Secret Passphrase");
</script>
}}}
It was discovered that the first few bytes of keystream are strongly non-random and leak information about the key. We can defend against this attack by discarding the initial portion of the keystream. This modified algorithm is traditionally called RC4-drop.
By default, 192 words (768 bytes) are dropped, but you can configure the algorithm to drop any number of words.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/rc4.js"></script>
<script>
var encrypted = CryptoJS.RC4Drop.encrypt("Message", "Secret Passphrase");
var encrypted = CryptoJS.RC4Drop.encrypt("Message", "Secret Passphrase", { drop: 3072/4 });
var decrypted = CryptoJS.RC4Drop.decrypt(encrypted, "Secret Passphrase", { drop: 3072/4 });
</script>
}}}
=== Custom Key and IV ===
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/aes.js"></script>
<script>
var key = CryptoJS.enc.Hex.parse('000102030405060708090a0b0c0d0e0f');
var iv = CryptoJS.enc.Hex.parse('101112131415161718191a1b1c1d1e1f');
var encrypted = CryptoJS.AES.encrypt("Message", key, { iv: iv });
</script>
}}}
=== Block Modes and Padding ===
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/aes.js"></script>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/components/mode-cfb-min.js"></script>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/components/pad-ansix923-min.js"></script>
<script>
var encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase", { mode: CryptoJS.mode.CFB, padding: CryptoJS.pad.AnsiX923 });
</script>
}}}
CryptoJS supports the following modes:
* CBC (the default)
* CFB
* CTR
* OFB
* ECB
And CryptoJS supports the following padding schemes:
* Pkcs7 (the default)
* Iso97971
* AnsiX923
* Iso10126
* ZeroPadding
* NoPadding
=== The Cipher Input ===
For the plaintext message, the cipher algorithms accept either strings or instances of CryptoJS.lib.WordArray.
For the key, when you pass a string, it's treated as a passphrase and used to derive an actual key and IV. Or you can pass a WordArray that represents the actual key. If you pass the actual key, you must also pass the actual IV.
For the ciphertext, the cipher algorithms accept either strings or instances of CryptoJS.lib.CipherParams. A CipherParams object represents a collection of parameters such as the IV, a salt, and the raw ciphertext itself. When you pass a string, it's automatically converted to a CipherParams object according to a configurable format strategy.
=== The Cipher Output ===
The plaintext you get back after decryption is a WordArray object. See Hashers' Output for more detail.
The ciphertext you get back after encryption isn't a string yet. It's a CipherParams object. A CipherParams object gives you access to all the parameters used during encryption. When you use a CipherParams object in a string context, it's automatically converted to a string according to a format strategy. The default is an OpenSSL-compatible format.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/aes.js"></script>
<script>
var encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase");
alert(encrypted.key); // 74eb593087a982e2a6f5dded54ecd96d1fd0f3d44a58728cdcd40c55227522223
alert(encrypted.iv); // 7781157e2629b094f0e3dd48c4d786115
alert(encrypted.salt); // 7a25f9132ec6a8b34
alert(encrypted.ciphertext); // 73e54154a15d1beeb509d9e12f1e462a0
alert(encrypted); // U2FsdGVkX1+iX5Ey7GqLND5UFUoV0b7rUJ2eEvHkYqA=
</script>
}}}
You can define your own formats in order to be compatible with other crypto implementations. A format is an object with two methods—stringify and parse—that converts between CipherParams objects and ciphertext strings.
Here's how you might write a JSON formatter:
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/aes.js"></script>
<script>
var JsonFormatter = {
stringify: function (cipherParams) {
// create json object with ciphertext
var jsonObj = {
ct: cipherParams.ciphertext.toString(CryptoJS.enc.Base64)
};
// optionally add iv and salt
if (cipherParams.iv) {
jsonObj.iv = cipherParams.iv.toString();
}
if (cipherParams.salt) {
jsonObj.s = cipherParams.salt.toString();
}
// stringify json object
return JSON.stringify(jsonObj);
},
parse: function (jsonStr) {
// parse json string
var jsonObj = JSON.parse(jsonStr);
// extract ciphertext from json object, and create cipher params object
var cipherParams = CryptoJS.lib.CipherParams.create({
ciphertext: CryptoJS.enc.Base64.parse(jsonObj.ct)
});
// optionally extract iv and salt
if (jsonObj.iv) {
cipherParams.iv = CryptoJS.enc.Hex.parse(jsonObj.iv)
}
if (jsonObj.s) {
cipherParams.salt = CryptoJS.enc.Hex.parse(jsonObj.s)
}
return cipherParams;
}
};
var encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase", { format: JsonFormatter });
alert(encrypted); // {"ct":"tZ4MsEnfbcDOwqau68aOrQ==","iv":"8a8c8fd8fe33743d3638737ea4a00698","s":"ba06373c8f57179c"}
var decrypted = CryptoJS.AES.decrypt(encrypted, "Secret Passphrase", { format: JsonFormatter });
alert(decrypted.toString(CryptoJS.enc.Utf8)); // Message
</script>
}}}
=== Progressive Ciphering ===
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/aes.js"></script>
<script>
var key = CryptoJS.enc.Hex.parse('000102030405060708090a0b0c0d0e0f');
var iv = CryptoJS.enc.Hex.parse('101112131415161718191a1b1c1d1e1f');
var aesEncryptor = CryptoJS.algo.AES.createEncryptor(key, { iv: iv });
var ciphertextPart1 = aesEncryptor.process("Message Part 1");
var ciphertextPart2 = aesEncryptor.process("Message Part 2");
var ciphertextPart3 = aesEncryptor.process("Message Part 3");
var ciphertextPart4 = aesEncryptor.finalize();
var aesDecryptor = CryptoJS.algo.AES.createDecryptor(key, { iv: iv });
var plaintextPart1 = aesDecryptor.process(ciphertextPart1);
var plaintextPart2 = aesDecryptor.process(ciphertextPart2);
var plaintextPart3 = aesDecryptor.process(ciphertextPart3);
var plaintextPart4 = aesDecryptor.process(ciphertextPart4);
var plaintextPart5 = aesDecryptor.finalize();
</script>
}}}
=== Interoperability ===
==== With OpenSSL ====
Encrypt with OpenSSL:
{{{
openssl enc -aes-256-cbc -in infile -out outfile -pass pass:"Secret Passphrase" -e -base64
}}}
Decrypt with CryptoJS:
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/rollups/aes.js"></script>
<script>
var decrypted = CryptoJS.AES.decrypt(openSSLEncrypted, "Secret Passphrase");
</script>
}}}
== Encoders ==
CryptoJS can convert from encoding formats such as Base64, Latin1 or Hex to WordArray objects and vica versa.
{{{
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/components/core-min.js"></script>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/components/enc-utf16-min.js"></script>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/components/enc-base64-min.js"></script>
<script>
var words = CryptoJS.enc.Base64.parse('SGVsbG8sIFdvcmxkIQ==');
var base64 = CryptoJS.enc.Base64.stringify(words);
var words = CryptoJS.enc.Latin1.parse('Hello, World!');
var latin1 = CryptoJS.enc.Latin1.stringify(words);
var words = CryptoJS.enc.Hex.parse('48656c6c6f2c20576f726c6421');
var hex = CryptoJS.enc.Hex.stringify(words);
var words = CryptoJS.enc.Utf8.parse('𤭢');
var utf8 = CryptoJS.enc.Utf8.stringify(words);
var words = CryptoJS.enc.Utf16.parse('Hello, World!');
var utf16 = CryptoJS.enc.Utf16.stringify(words);
var words = CryptoJS.enc.Utf16LE.parse('Hello, World!');
var utf16 = CryptoJS.enc.Utf16LE.stringify(words);
</script>
}}}
@@ -0,0 +1,301 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var src_exports = {};
__export(src_exports, {
DOMEventNames: () => DOMEventNames,
DOMPropNames: () => DOMPropNames,
filterDOMProps: () => filterDOMProps,
getValidChildren: () => getValidChildren,
pickChildren: () => pickChildren,
renderFn: () => renderFn
});
module.exports = __toCommonJS(src_exports);
// src/children.ts
var import_react = require("react");
function getValidChildren(children) {
return import_react.Children.toArray(children).filter(
(child) => (0, import_react.isValidElement)(child)
);
}
var pickChildren = (children, targetChild) => {
var _a;
let target = [];
const withoutTargetChildren = (_a = import_react.Children.map(children, (item) => {
if (!(0, import_react.isValidElement)(item))
return item;
if (item.type === targetChild) {
target.push(item);
return null;
}
return item;
})) == null ? void 0 : _a.filter(Boolean);
const targetChildren = target.length >= 0 ? target : void 0;
return [withoutTargetChildren, targetChildren];
};
// src/dom-props.ts
var DOMPropNames = /* @__PURE__ */ new Set([
"id",
"type",
"style",
"title",
"role",
"tabIndex",
"htmlFor",
"width",
"height",
"abbr",
"accept",
"acceptCharset",
"accessKey",
"action",
"allowFullScreen",
"allowTransparency",
"alt",
"async",
"autoComplete",
"autoFocus",
"autoPlay",
"cellPadding",
"cellSpacing",
"challenge",
"charset",
"checked",
"cite",
"class",
"className",
"cols",
"colSpan",
"command",
"content",
"contentEditable",
"contextMenu",
"controls",
"coords",
"crossOrigin",
"data",
"dateTime",
"default",
"defer",
"dir",
"disabled",
"download",
"draggable",
"dropzone",
"encType",
"enterKeyHint",
"for",
"form",
"formAction",
"formEncType",
"formMethod",
"formNoValidate",
"formTarget",
"frameBorder",
"headers",
"hidden",
"high",
"href",
"hrefLang",
"httpEquiv",
"icon",
"inputMode",
"isMap",
"itemId",
"itemProp",
"itemRef",
"itemScope",
"itemType",
"kind",
"label",
"lang",
"list",
"loop",
"manifest",
"max",
"maxLength",
"media",
"mediaGroup",
"method",
"min",
"minLength",
"multiple",
"muted",
"name",
"noValidate",
"open",
"optimum",
"pattern",
"ping",
"placeholder",
"poster",
"preload",
"radioGroup",
"referrerPolicy",
"readOnly",
"rel",
"required",
"rows",
"rowSpan",
"sandbox",
"scope",
"scoped",
"scrolling",
"seamless",
"selected",
"shape",
"size",
"sizes",
"slot",
"sortable",
"span",
"spellCheck",
"src",
"srcDoc",
"srcSet",
"start",
"step",
"target",
"translate",
"typeMustMatch",
"useMap",
"value",
"wmode",
"wrap"
]);
var DOMEventNames = /* @__PURE__ */ new Set([
"onCopy",
"onCut",
"onPaste",
"onLoad",
"onError",
"onWheel",
"onScroll",
"onCompositionEnd",
"onCompositionStart",
"onCompositionUpdate",
"onKeyDown",
"onKeyPress",
"onKeyUp",
"onFocus",
"onBlur",
"onChange",
"onInput",
"onSubmit",
"onClick",
"onContextMenu",
"onDoubleClick",
"onDrag",
"onDragEnd",
"onDragEnter",
"onDragExit",
"onDragLeave",
"onDragOver",
"onDragStart",
"onDrop",
"onMouseDown",
"onMouseEnter",
"onMouseLeave",
"onMouseMove",
"onMouseOut",
"onMouseOver",
"onMouseUp",
"onPointerDown",
"onPointerEnter",
"onPointerLeave",
"onPointerUp",
"onSelect",
"onTouchCancel",
"onTouchEnd",
"onTouchMove",
"onTouchStart",
"onAnimationStart",
"onAnimationEnd",
"onAnimationIteration",
"onTransitionEnd"
]);
// src/filter-dom-props.ts
var propRe = /^(data-.*)$/;
var ariaRe = /^(aria-.*)$/;
var funcRe = /^(on[A-Z].*)$/;
function filterDOMProps(props, opts = {}) {
let {
labelable = true,
enabled = true,
propNames,
omitPropNames,
omitEventNames,
omitDataProps,
omitEventProps
} = opts;
let filteredProps = {};
if (!enabled) {
return props;
}
for (const prop in props) {
if (omitPropNames == null ? void 0 : omitPropNames.has(prop)) {
continue;
}
if ((omitEventNames == null ? void 0 : omitEventNames.has(prop)) && funcRe.test(prop)) {
continue;
}
if (funcRe.test(prop) && !DOMEventNames.has(prop)) {
continue;
}
if (omitDataProps && propRe.test(prop)) {
continue;
}
if (omitEventProps && funcRe.test(prop)) {
continue;
}
if (Object.prototype.hasOwnProperty.call(props, prop) && (DOMPropNames.has(prop) || labelable && ariaRe.test(prop) || (propNames == null ? void 0 : propNames.has(prop)) || propRe.test(prop)) || funcRe.test(prop)) {
filteredProps[prop] = props[prop];
}
}
return filteredProps;
}
// src/functions.ts
var React = __toESM(require("react"));
function renderFn({ Component, props, renderCustom }) {
if (renderCustom && typeof renderCustom === "function") {
return renderCustom(props);
} else {
return React.createElement(Component, props);
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
DOMEventNames,
DOMPropNames,
filterDOMProps,
getValidChildren,
pickChildren,
renderFn
});
@@ -0,0 +1,19 @@
import {useMenuTriggerState as $a28c903ee9ad8dc5$export$79fefeb1c2091ac3} from "./useMenuTriggerState.module.js";
import {useSubmenuTriggerState as $e5614764aa47eb35$export$cfc51cf86138bf98} from "./useSubmenuTriggerState.module.js";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
export {$a28c903ee9ad8dc5$export$79fefeb1c2091ac3 as useMenuTriggerState, $e5614764aa47eb35$export$cfc51cf86138bf98 as useSubmenuTriggerState};
//# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
{"version":3,"file":"uri.js","sourceRoot":"","sources":["../../src/uri.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAiDrD,MAAM,CAAC,MAAM,OAAO,GAAsC,EAAE,CAAC;AAE7D,MAAM,qBAAqB,GAAU;IACpC,MAAM,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,CAAQ,CAAC;IAEb,IAAI,CAAC,GAAG,EAAE;QAAE,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;SAC/C,IAAI,CAAC,GAAG,GAAG;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;SACpD,IAAI,CAAC,GAAG,IAAI;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;;QACxH,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,GAAG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ted, 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.
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
function isArray(arg) {
if (Array.isArray) {
return Array.isArray(arg);
}
return objectToString(arg) === '[object Array]';
}
exports.isArray = isArray;
function isBoolean(arg) {
return typeof arg === 'boolean';
}
exports.isBoolean = isBoolean;
function isNull(arg) {
return arg === null;
}
exports.isNull = isNull;
function isNullOrUndefined(arg) {
return arg == null;
}
exports.isNullOrUndefined = isNullOrUndefined;
function isNumber(arg) {
return typeof arg === 'number';
}
exports.isNumber = isNumber;
function isString(arg) {
return typeof arg === 'string';
}
exports.isString = isString;
function isSymbol(arg) {
return typeof arg === 'symbol';
}
exports.isSymbol = isSymbol;
function isUndefined(arg) {
return arg === void 0;
}
exports.isUndefined = isUndefined;
function isRegExp(re) {
return objectToString(re) === '[object RegExp]';
}
exports.isRegExp = isRegExp;
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
}
exports.isObject = isObject;
function isDate(d) {
return objectToString(d) === '[object Date]';
}
exports.isDate = isDate;
function isError(e) {
return (objectToString(e) === '[object Error]' || e instanceof Error);
}
exports.isError = isError;
function isFunction(arg) {
return typeof arg === 'function';
}
exports.isFunction = isFunction;
function isPrimitive(arg) {
return arg === null ||
typeof arg === 'boolean' ||
typeof arg === 'number' ||
typeof arg === 'string' ||
typeof arg === 'symbol' || // ES6 symbol
typeof arg === 'undefined';
}
exports.isPrimitive = isPrimitive;
exports.isBuffer = require('buffer').Buffer.isBuffer;
function objectToString(o) {
return Object.prototype.toString.call(o);
}
@@ -0,0 +1,17 @@
module.exports = extend
var hasOwnProperty = Object.prototype.hasOwnProperty;
function extend(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i]
for (var key in source) {
if (hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
}
@@ -0,0 +1,48 @@
npm run build
npm run doc
npm i
git clone --depth=10 --branch=master git@github.com:lodash-archive/lodash-cli.git ./node_modules/lodash-cli
mkdir -p ./node_modules/lodash-cli/node_modules/lodash; cd $_; cp ../../../../lodash.js ./lodash.js; cp ../../../../package.json ./package.json
cd ../../; npm i --production; cd ../../
node ./node_modules/lodash-cli/bin/lodash core exports=node -o ./npm-package/core.js
node ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./npm-package
cp lodash.js npm-package/lodash.js
cp dist/lodash.min.js npm-package/lodash.min.js
cp LICENSE npm-package/LICENSE
1. Clone two repos
Bump lodash version in package.json, readme, package=locak, lodash.js
npm run build
npm run doc
2. update mappings in ldoash-cli
3. copy ldoash into lodash-cli node modules and package json.
node ./node_modules/lodash-cli/bin/lodash core exports=node -o ./npm-package/core.js
node ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./npm-package
1. Clone the two repositories:
```sh
$ git clone https://github.com/lodash/lodash.git
$ git clone https://github.com/bnjmnt4n/lodash-cli.git
```
2. Update lodash-cli to accomdate changes in lodash source. This can typically involve adding new function dependency mappings in lib/mappings.js. Sometimes, additional changes might be needed for more involved functions.
3. In the lodash repository, update references to the lodash version in README.md, lodash.js, package.jsona nd package-lock.json
4. Run:
```sh
npm run build
npm run doc
node ../lodash-cli/bin/lodash core -o ./dist/lodash.core.js
```
5. Add a commit and tag the release
mkdir ../lodash-temp
cp lodash.js dist/lodash.min.js dist/lodash.core.js dist/lodash.core.min.js ../lodash-temp/
node ../lodash-cli/bin/lodash modularize exports=node -o .
cp ../lodash-temp/lodash.core.js core.js
cp ../lodash-temp/lodash.core.min.js core.min.js
cp ../lodash-temp/lodash.js lodash.js
cp ../lodash-temp/lodash.min.js lodash.min.js
❯ node ../lodash-cli/bin/lodash modularize exports=es -o .
@@ -0,0 +1,76 @@
var $lIlxZ$reactariautils = require("@react-aria/utils");
var $lIlxZ$reactariafocus = require("@react-aria/focus");
var $lIlxZ$reactariainteractions = require("@react-aria/interactions");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useButton", () => $988353faa005faf8$export$ea18c227d4417cc3);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $988353faa005faf8$export$ea18c227d4417cc3(props, ref) {
let { elementType: elementType = 'button', isDisabled: isDisabled, onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, onPressChange: onPressChange, preventFocusOnPress: preventFocusOnPress, allowFocusWhenDisabled: // @ts-ignore - undocumented
allowFocusWhenDisabled, // @ts-ignore
onClick: deprecatedOnClick, href: href, target: target, rel: rel, type: type = 'button' } = props;
let additionalProps;
if (elementType === 'button') additionalProps = {
type: type,
disabled: isDisabled
};
else additionalProps = {
role: 'button',
tabIndex: isDisabled ? undefined : 0,
href: elementType === 'a' && !isDisabled ? href : undefined,
target: elementType === 'a' ? target : undefined,
type: elementType === 'input' ? type : undefined,
disabled: elementType === 'input' ? isDisabled : undefined,
'aria-disabled': !isDisabled || elementType === 'input' ? undefined : isDisabled,
rel: elementType === 'a' ? rel : undefined
};
let { pressProps: pressProps, isPressed: isPressed } = (0, $lIlxZ$reactariainteractions.usePress)({
onPressStart: onPressStart,
onPressEnd: onPressEnd,
onPressChange: onPressChange,
onPress: onPress,
onPressUp: onPressUp,
isDisabled: isDisabled,
preventFocusOnPress: preventFocusOnPress,
ref: ref
});
let { focusableProps: focusableProps } = (0, $lIlxZ$reactariafocus.useFocusable)(props, ref);
if (allowFocusWhenDisabled) focusableProps.tabIndex = isDisabled ? -1 : focusableProps.tabIndex;
let buttonProps = (0, $lIlxZ$reactariautils.mergeProps)(focusableProps, pressProps, (0, $lIlxZ$reactariautils.filterDOMProps)(props, {
labelable: true
}));
return {
isPressed: isPressed,
buttonProps: (0, $lIlxZ$reactariautils.mergeProps)(additionalProps, buttonProps, {
'aria-haspopup': props['aria-haspopup'],
'aria-expanded': props['aria-expanded'],
'aria-controls': props['aria-controls'],
'aria-pressed': props['aria-pressed'],
onClick: (e)=>{
if (deprecatedOnClick) {
deprecatedOnClick(e);
console.warn('onClick is deprecated, please use onPress');
}
}
})
};
}
//# sourceMappingURL=useButton.main.js.map
@@ -0,0 +1,36 @@
import { OneBotAction } from '../../action/OneBotAction';
import { Static } from '@sinclair/typebox';
export declare const SetGroupPortraitPayloadSchema: import("@sinclair/typebox").TObject<{
file: import("@sinclair/typebox").TString;
group_id: import("@sinclair/typebox").TString;
}>;
export type SetGroupPortraitPayload = Static<typeof SetGroupPortraitPayloadSchema>;
declare const ReturnSchema: import("@sinclair/typebox").TObject<{
result: import("@sinclair/typebox").TNumber;
errMsg: import("@sinclair/typebox").TString;
}>;
export type ReturnType = Static<typeof ReturnSchema>;
export default class SetGroupPortrait extends OneBotAction<SetGroupPortraitPayload, ReturnType> {
actionName: "set_group_portrait";
payloadSchema: import("@sinclair/typebox").TObject<{
file: import("@sinclair/typebox").TString;
group_id: import("@sinclair/typebox").TString;
}>;
returnSchema: import("@sinclair/typebox").TObject<{
result: import("@sinclair/typebox").TNumber;
errMsg: import("@sinclair/typebox").TString;
}>;
actionSummary: string;
actionDescription: string;
actionTags: string[];
payloadExample: {
group_id: string;
file: string;
};
returnExample: {
result: number;
errMsg: string;
};
_handle(payload: SetGroupPortraitPayload): Promise<ReturnType>;
}
export {};
@@ -0,0 +1,68 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Intrinsic = Intrinsic;
const type_1 = require("../create/type");
const index_1 = require("../template-literal/index");
const intrinsic_from_mapped_key_1 = require("./intrinsic-from-mapped-key");
const index_2 = require("../literal/index");
const index_3 = require("../union/index");
// ------------------------------------------------------------------
// TypeGuard
// ------------------------------------------------------------------
const kind_1 = require("../guard/kind");
// ------------------------------------------------------------------
// Apply
// ------------------------------------------------------------------
function ApplyUncapitalize(value) {
const [first, rest] = [value.slice(0, 1), value.slice(1)];
return [first.toLowerCase(), rest].join('');
}
function ApplyCapitalize(value) {
const [first, rest] = [value.slice(0, 1), value.slice(1)];
return [first.toUpperCase(), rest].join('');
}
function ApplyUppercase(value) {
return value.toUpperCase();
}
function ApplyLowercase(value) {
return value.toLowerCase();
}
function FromTemplateLiteral(schema, mode, options) {
// note: template literals require special runtime handling as they are encoded in string patterns.
// This diverges from the mapped type which would otherwise map on the template literal kind.
const expression = (0, index_1.TemplateLiteralParseExact)(schema.pattern);
const finite = (0, index_1.IsTemplateLiteralExpressionFinite)(expression);
if (!finite)
return { ...schema, pattern: FromLiteralValue(schema.pattern, mode) };
const strings = [...(0, index_1.TemplateLiteralExpressionGenerate)(expression)];
const literals = strings.map((value) => (0, index_2.Literal)(value));
const mapped = FromRest(literals, mode);
const union = (0, index_3.Union)(mapped);
return (0, index_1.TemplateLiteral)([union], options);
}
// prettier-ignore
function FromLiteralValue(value, mode) {
return (typeof value === 'string' ? (mode === 'Uncapitalize' ? ApplyUncapitalize(value) :
mode === 'Capitalize' ? ApplyCapitalize(value) :
mode === 'Uppercase' ? ApplyUppercase(value) :
mode === 'Lowercase' ? ApplyLowercase(value) :
value) : value.toString());
}
// prettier-ignore
function FromRest(T, M) {
return T.map(L => Intrinsic(L, M));
}
/** Applies an intrinsic string manipulation to the given type. */
function Intrinsic(schema, mode, options = {}) {
// prettier-ignore
return (
// Intrinsic-Mapped-Inference
(0, kind_1.IsMappedKey)(schema) ? (0, intrinsic_from_mapped_key_1.IntrinsicFromMappedKey)(schema, mode, options) :
// Standard-Inference
(0, kind_1.IsTemplateLiteral)(schema) ? FromTemplateLiteral(schema, mode, options) :
(0, kind_1.IsUnion)(schema) ? (0, index_3.Union)(FromRest(schema.anyOf, mode), options) :
(0, kind_1.IsLiteral)(schema) ? (0, index_2.Literal)(FromLiteralValue(schema.const, mode), options) :
// Default Type
(0, type_1.CreateType)(schema, options));
}
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,kEAAkE;AAClE,2DAA2D;AAC3D,yDAAyD;AACzD,kHAAkH;;;AAiBlH,oGAAoG;AACpG,iFAAiF;AACjF,sDAAsD;AACtD,IAAI,wDAAkC;AACtC,IAAI,mCAAa;AAEjB,SAAS;IACP,wDAAkC;IAElC,wFAAwF;IACxF,sFAAsF;IACtF,wFAAwF;IACxF,oEAAoE;IACpE,WAAW;QACT,wDAAkC;IACpC,GAAG;AACL;AAEA,SAAS,+CAAyB,CAAe;IAC/C,IAAI,EAAE,WAAW,KAAK,SACpB;AAEJ;AAEA,SAAS;IACP,IAAI,OAAO,aAAa,aACtB;IAGF,IAAI,qCAAe,GAAG;QACpB,IAAI,OAAO,iBAAiB,aAC1B,SAAS,gBAAgB,CAAC,aAAa;aAClC,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,QAClC,SAAS,gBAAgB,CAAC,YAAY;IAE1C;IAEA;IACA,OAAO;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eAAe,MAAM,MAAM;QAAA,GAAG,MAAM,WAAW;IAEpE,uDAAuD;IACvD,GAAG;QAAC;KAAW;IAEf,OAAO;oBACL;mBACA;IACF;AACF","sources":["packages/@react-aria/interactions/src/useHover.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\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {DOMAttributes, HoverEvents} from '@react-types/shared';\nimport {getOwnerDocument, nodeContains, useGlobalListeners} from '@react-aria/utils';\nimport {useEffect, useMemo, useRef, useState} from 'react';\n\nexport interface HoverProps extends HoverEvents {\n /** Whether the hover events should be disabled. */\n isDisabled?: boolean\n}\n\nexport interface HoverResult {\n /** Props to spread on the target element. */\n hoverProps: DOMAttributes,\n isHovered: boolean\n}\n\n// iOS fires onPointerEnter twice: once with pointerType=\"touch\" and again with pointerType=\"mouse\".\n// We want to ignore these emulated events so they do not trigger hover behavior.\n// See https://bugs.webkit.org/show_bug.cgi?id=214609.\nlet globalIgnoreEmulatedMouseEvents = false;\nlet hoverCount = 0;\n\nfunction setGlobalIgnoreEmulatedMouseEvents() {\n globalIgnoreEmulatedMouseEvents = true;\n\n // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n // the distant future because a user previously touched the eleLine truncated
@@ -0,0 +1,46 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils")
const { getSourceCode } = require("eslint-compat-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Number.MIN_SAFE_INTEGER` property.",
category: "ES2015",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-number-minsafeinteger.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' property is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"(program) {
const sourceCode = getSourceCode(context)
const tracker = new ReferenceTracker(
sourceCode.getScope(program),
)
for (const { node, path } of tracker.iterateGlobalReferences({
Number: {
MIN_SAFE_INTEGER: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1,798 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuoteType = void 0;
const decode_1 = require("entities/decode");
var CharCodes;
(function (CharCodes) {
CharCodes[CharCodes["Tab"] = 9] = "Tab";
CharCodes[CharCodes["NewLine"] = 10] = "NewLine";
CharCodes[CharCodes["FormFeed"] = 12] = "FormFeed";
CharCodes[CharCodes["CarriageReturn"] = 13] = "CarriageReturn";
CharCodes[CharCodes["Space"] = 32] = "Space";
CharCodes[CharCodes["ExclamationMark"] = 33] = "ExclamationMark";
CharCodes[CharCodes["Number"] = 35] = "Number";
CharCodes[CharCodes["Amp"] = 38] = "Amp";
CharCodes[CharCodes["SingleQuote"] = 39] = "SingleQuote";
CharCodes[CharCodes["DoubleQuote"] = 34] = "DoubleQuote";
CharCodes[CharCodes["Dash"] = 45] = "Dash";
CharCodes[CharCodes["Slash"] = 47] = "Slash";
CharCodes[CharCodes["Zero"] = 48] = "Zero";
CharCodes[CharCodes["Nine"] = 57] = "Nine";
CharCodes[CharCodes["Semi"] = 59] = "Semi";
CharCodes[CharCodes["Lt"] = 60] = "Lt";
CharCodes[CharCodes["Eq"] = 61] = "Eq";
CharCodes[CharCodes["Gt"] = 62] = "Gt";
CharCodes[CharCodes["Questionmark"] = 63] = "Questionmark";
CharCodes[CharCodes["UpperA"] = 65] = "UpperA";
CharCodes[CharCodes["LowerA"] = 97] = "LowerA";
CharCodes[CharCodes["UpperF"] = 70] = "UpperF";
CharCodes[CharCodes["LowerF"] = 102] = "LowerF";
CharCodes[CharCodes["UpperZ"] = 90] = "UpperZ";
CharCodes[CharCodes["LowerZ"] = 122] = "LowerZ";
CharCodes[CharCodes["LowerX"] = 120] = "LowerX";
CharCodes[CharCodes["OpeningSquareBracket"] = 91] = "OpeningSquareBracket";
})(CharCodes || (CharCodes = {}));
/** All the states the tokenizer can be in. */
var State;
(function (State) {
State[State["Text"] = 1] = "Text";
State[State["BeforeTagName"] = 2] = "BeforeTagName";
State[State["InTagName"] = 3] = "InTagName";
State[State["InSelfClosingTag"] = 4] = "InSelfClosingTag";
State[State["BeforeClosingTagName"] = 5] = "BeforeClosingTagName";
State[State["InClosingTagName"] = 6] = "InClosingTagName";
State[State["AfterClosingTagName"] = 7] = "AfterClosingTagName";
// Attributes
State[State["BeforeAttributeName"] = 8] = "BeforeAttributeName";
State[State["InAttributeName"] = 9] = "InAttributeName";
State[State["AfterAttributeName"] = 10] = "AfterAttributeName";
State[State["BeforeAttributeValue"] = 11] = "BeforeAttributeValue";
State[State["InAttributeValueDq"] = 12] = "InAttributeValueDq";
State[State["InAttributeValueSq"] = 13] = "InAttributeValueSq";
State[State["InAttributeValueNq"] = 14] = "InAttributeValueNq";
// Declarations
State[State["BeforeDeclaration"] = 15] = "BeforeDeclaration";
State[State["InDeclaration"] = 16] = "InDeclaration";
// Processing instructions
State[State["InProcessingInstruction"] = 17] = "InProcessingInstruction";
// Comments & CDATA
State[State["BeforeComment"] = 18] = "BeforeComment";
State[State["CDATASequence"] = 19] = "CDATASequence";
State[State["InSpecialComment"] = 20] = "InSpecialComment";
State[State["InCommentLike"] = 21] = "InCommentLike";
// Special tags
State[State["BeforeSpecialS"] = 22] = "BeforeSpecialS";
State[State["BeforeSpecialT"] = 23] = "BeforeSpecialT";
State[State["SpecialStartSequence"] = 24] = "SpecialStartSequence";
State[State["InSpecialTag"] = 25] = "InSpecialTag";
State[State["InEntity"] = 26] = "InEntity";
})(State || (State = {}));
function isWhitespace(c) {
return (c === CharCodes.Space ||
c === CharCodes.NewLine ||
c === CharCodes.Tab ||
c === CharCodes.FormFeed ||
c === CharCodes.CarriageReturn);
}
function isEndOfTagSection(c) {
return c === CharCodes.Slash || c === CharCodes.Gt || isWhitespace(c);
}
function isASCIIAlpha(c) {
return ((c >= CharCodes.LowerA && c <= CharCodes.LowerZ) ||
(c >= CharCodes.UpperA && c <= CharCodes.UpperZ));
}
var QuoteType;
(function (QuoteType) {
QuoteType[QuoteType["NoValue"] = 0] = "NoValue";
QuoteType[QuoteType["Unquoted"] = 1] = "Unquoted";
QuoteType[QuoteType["Single"] = 2] = "Single";
QuoteType[QuoteType["Double"] = 3] = "Double";
})(QuoteType || (exports.QuoteType = QuoteType = {}));
/**
* Sequences used to match longer strings.
*
* We don't have `Script`, `Style`, or `Title` here. Instead, we re-use the *End
* sequences with an increased offset.
*/
const Sequences = {
Cdata: new Uint8Array([0x43, 0x44, 0x41, 0x54, 0x41, 0x5b]), // CDATA[
CdataEnd: new Uint8Array([0x5d, 0x5d, 0x3e]), // ]]>
CommentEnd: new Uint8Array([0x2d, 0x2d, 0x3e]), // `-->`
ScriptEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74]), // `</script`
StyleEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x74, 0x79, 0x6c, 0x65]), // `</style`
TitleEnd: new Uint8Array([0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65]), // `</title`
TextareaEnd: new Uint8Array([
0x3c, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x61, 0x72, 0x65, 0x61,
]), // `</textarea`
XmpEnd: new Uint8Array([0x3c, 0x2f, 0x78, 0x6d, 0x70]), // `</xmp`
};
class Tokenizer {
constructor({ xmlMode = false, decodeEntities = true, }, cbs) {
this.cbs = cbs;
/** The current state the tokenizer is in. */
this.state = State.Text;
/** The read buffer. */
this.buffer = "";
/** The beginning of the section that is currently being read. */
this.sectionStart = 0;
/** The index within the buffer that we are currently looking at. */
this.index = 0;
/** The start of the last entity. */
this.entityStart = 0;
/** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
this.baseState = State.Text;
/** For special parsing behavior inside of script and style tags. */
this.isSpecial = false;
/** Indicates whether the tokenizer has been paused. */
this.running = true;
/** The offset of the current buffer. */
this.offset = 0;
this.currentSequence = undefined;
this.sequenceIndex = 0;
this.xmlMode = xmlMode;
this.decodeEntities = decodeEntities;
this.entityDecoder = new decode_1.EntityDecoder(xmlMode ? decode_1.xmlDecodeTree : decode_1.htmlDecodeTree, (cp, consumed) => this.emitCodePoint(cp, consumed));
}
reset() {
this.state = State.Text;
this.buffer = "";
this.sectionStart = 0;
this.index = 0;
this.baseState = State.Text;
this.currentSequence = undefined;
this.running = true;
this.offset = 0;
}
write(chunk) {
this.offset += this.buffer.length;
this.buffer = chunk;
this.parse();
}
end() {
if (this.running)
this.finish();
}
pause() {
this.running = false;
}
resume() {
this.running = true;
if (this.index < this.buffer.length + this.offset) {
this.parse();
}
}
stateText(c) {
if (c === CharCodes.Lt ||
(!this.decodeEntities && this.fastForwardTo(CharCodes.Lt))) {
if (this.index > this.sectionStart) {
this.cbs.ontext(this.sectionStart, this.index);
}
this.state = State.BeforeTagName;
this.sectionStart = this.index;
}
else if (this.decodeEntities && c === CharCodes.Amp) {
this.startEntity();
}
}
stateSpecialStartSequence(c) {
const isEnd = this.sequenceIndex === this.currentSequence.length;
const isMatch = isEnd
? // If we are at the end of the sequence, make sure the tag name has ended
isEndOfTagSection(c)
: // Otherwise, do a case-insensitive comparison
(c | 0x20) === this.currentSequence[this.sequenceIndex];
if (!isMatch) {
this.isSpecial = false;
}
else if (!isEnd) {
this.sequenceIndex++;
return;
}
this.sequenceIndex = 0;
this.state = State.InTagName;
this.stateInTagName(c);
}
/** Look for an end tag. For <title> tags, also decode entities. */
stateInSpecialTag(c) {
if (this.sequenceIndex === this.currentSequence.length) {
if (c === CharCodes.Gt || isWhitespace(c)) {
const endOfText = this.index - this.currentSequence.length;
if (this.sectionStart < endOfText) {
// Spoof the index so that reported locations match up.
const actualIndex = this.index;
this.index = endOfText;
this.cbs.ontext(this.sectionStart, endOfText);
this.index = actualIndex;
}
this.isSpecial = false;
this.sectionStart = endOfText + 2; // Skip over the `</`
this.stateInClosingTagName(c);
return; // We are done; skip the rest of the function.
}
this.sequenceIndex = 0;
}
if ((c | 0x20) === this.currentSequence[this.sequenceIndex]) {
this.sequenceIndex += 1;
}
else if (this.sequenceIndex === 0) {
if (this.currentSequence === Sequences.TitleEnd) {
// We have to parse entities in <title> tags.
if (this.decodeEntities && c === CharCodes.Amp) {
this.startEntity();
}
}
else if (this.fastForwardTo(CharCodes.Lt)) {
// Outside of <title> tags, we can fast-forward.
this.sequenceIndex = 1;
}
}
else {
// If we see a `<`, set the sequence index to 1; useful for eg. `<</script>`.
this.sequenceIndex = Number(c === CharCodes.Lt);
}
}
stateCDATASequence(c) {
if (c === Sequences.Cdata[this.sequenceIndex]) {
if (++this.sequenceIndex === Sequences.Cdata.length) {
this.state = State.InCommentLike;
this.currentSequence = Sequences.CdataEnd;
this.sequenceIndex = 0;
this.sectionStart = this.index + 1;
}
}
else {
this.sequenceIndex = 0;
this.state = State.InDeclaration;
this.stateInDeclaration(c); // Reconsume the character
}
}
/**
* When we wait for one specific character, we can speed things up
* by skipping through the buffer until we find it.
*
* @returns Whether the character was found.
*/
fastForwardTo(c) {
while (++this.index < this.buffer.length + this.offset) {
if (this.buffer.charCodeAt(this.index - this.offset) === c) {
return true;
}
}
/*
* We increment the index at the end of the `parse` loop,
* so set it to `buffer.length - 1` here.
*
* TODO: Refactor `parse` to increment index before calling states.
*/
this.index = this.buffer.length + this.offset - 1;
return false;
}
/**
* Comments and CDATA end with `-->` and `]]>`.
*
* Their common qualities are:
* - Their end sequences have a distinct character they start with.
* - That character is then repeated, so we have to check multiple repeats.
* - All characters but the start character of the sequence can be skipped.
*/
stateInCommentLike(c) {
if (c === this.currentSequence[this.sequenceIndex]) {
if (++this.sequenceIndex === this.currentSequence.length) {
if (this.currentSequence === Sequences.CdataEnd) {
this.cbs.oncdata(this.sectionStart, this.index, 2);
}
else {
this.cbs.oncomment(this.sectionStart, this.index, 2);
}
this.sequenceIndex = 0;
this.sectionStart = this.index + 1;
this.state = State.Text;
}
}
else if (this.sequenceIndex === 0) {
// Fast-forward to the first character of the sequence
if (this.fastForwardTo(this.currentSequence[0])) {
this.sequenceIndex = 1;
}
}
else if (c !== this.currentSequence[this.sequenceIndex - 1]) {
// Allow long sequences, eg. --->, ]]]>
this.sequenceIndex = 0;
}
}
/**
* HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.
*
* XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).
* We allow anything that wouldn't end the tag.
*/
isTagStartChar(c) {
return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);
}
startSpecial(sequence, offset) {
this.isSpecial = true;
this.currentSequence = sequence;
this.sequenceIndex = offset;
this.state = State.SpecialStartSequence;
}
stateBeforeTagName(c) {
if (c === CharCodes.ExclamationMark) {
this.state = State.BeforeDeclaration;
this.sectionStart = this.index + 1;
}
else if (c === CharCodes.Questionmark) {
this.state = State.InProcessingInstruction;
this.sectionStart = this.index + 1;
}
else if (this.isTagStartChar(c)) {
const lower = c | 0x20;
this.sectionStart = this.index;
if (this.xmlMode) {
this.state = State.InTagName;
}
else if (lower === Sequences.ScriptEnd[2]) {
this.state = State.BeforeSpecialS;
}
else if (lower === Sequences.TitleEnd[2] ||
lower === Sequences.XmpEnd[2]) {
this.state = State.BeforeSpecialT;
}
else {
this.state = State.InTagName;
}
}
else if (c === CharCodes.Slash) {
this.state = State.BeforeClosingTagName;
}
else {
this.state = State.Text;
this.stateText(c);
}
}
stateInTagName(c) {
if (isEndOfTagSection(c)) {
this.cbs.onopentagname(this.sectionStart, this.index);
this.sectionStart = -1;
this.state = State.BeforeAttributeName;
this.stateBeforeAttributeName(c);
}
}
stateBeforeClosingTagName(c) {
if (isWhitespace(c)) {
// Ignore
}
else if (c === CharCodes.Gt) {
this.state = State.Text;
}
else {
this.state = this.isTagStartChar(c)
? State.InClosingTagName
: State.InSpecialComment;
this.sectionStart = this.index;
}
}
stateInClosingTagName(c) {
if (c === CharCodes.Gt || isWhitespace(c)) {
this.cbs.onclosetag(this.sectionStart, this.index);
this.sectionStart = -1;
this.state = State.AfterClosingTagName;
this.stateAfterClosingTagName(c);
}
}
stateAfterClosingTagName(c) {
// Skip everything until ">"
if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
this.state = State.Text;
this.sectionStart = this.index + 1;
}
}
stateBeforeAttributeName(c) {
if (c === CharCodes.Gt) {
this.cbs.onopentagend(this.index);
if (this.isSpecial) {
this.state = State.InSpecialTag;
this.sequenceIndex = 0;
}
else {
this.state = State.Text;
}
this.sectionStart = this.index + 1;
}
else if (c === CharCodes.Slash) {
this.state = State.InSelfClosingTag;
}
else if (!isWhitespace(c)) {
this.state = State.InAttributeName;
this.sectionStart = this.index;
}
}
stateInSelfClosingTag(c) {
if (c === CharCodes.Gt) {
this.cbs.onselfclosingtag(this.index);
this.state = State.Text;
this.sectionStart = this.index + 1;
this.isSpecial = false; // Reset special state, in case of self-closing special tags
}
else if (!isWhitespace(c)) {
this.state = State.BeforeAttributeName;
this.stateBeforeAttributeName(c);
}
}
stateInAttributeName(c) {
if (c === CharCodes.Eq || isEndOfTagSection(c)) {
this.cbs.onattribname(this.sectionStart, this.index);
this.sectionStart = this.index;
this.state = State.AfterAttributeName;
this.stateAfterAttributeName(c);
}
}
stateAfterAttributeName(c) {
if (c === CharCodes.Eq) {
this.state = State.BeforeAttributeValue;
}
else if (c === CharCodes.Slash || c === CharCodes.Gt) {
this.cbs.onattribend(QuoteType.NoValue, this.sectionStart);
this.sectionStart = -1;
this.state = State.BeforeAttributeName;
this.stateBeforeAttributeName(c);
}
else if (!isWhitespace(c)) {
this.cbs.onattribend(QuoteType.NoValue, this.sectionStart);
this.state = State.InAttributeName;
this.sectionStart = this.index;
}
}
stateBeforeAttributeValue(c) {
if (c === CharCodes.DoubleQuote) {
this.state = State.InAttributeValueDq;
this.sectionStart = this.index + 1;
}
else if (c === CharCodes.SingleQuote) {
this.state = State.InAttributeValueSq;
this.sectionStart = this.index + 1;
}
else if (!isWhitespace(c)) {
this.sectionStart = this.index;
this.state = State.InAttributeValueNq;
this.stateInAttributeValueNoQuotes(c); // Reconsume token
}
}
handleInAttributeValue(c, quote) {
if (c === quote ||
(!this.decodeEntities && this.fastForwardTo(quote))) {
this.cbs.onattribdata(this.sectionStart, this.index);
this.sectionStart = -1;
this.cbs.onattribend(quote === CharCodes.DoubleQuote
? QuoteType.Double
: QuoteType.Single, this.index + 1);
this.state = State.BeforeAttributeName;
}
else if (this.decodeEntities && c === CharCodes.Amp) {
this.startEntity();
}
}
stateInAttributeValueDoubleQuotes(c) {
this.handleInAttributeValue(c, CharCodes.DoubleQuote);
}
stateInAttributeValueSingleQuotes(c) {
this.handleInAttributeValue(c, CharCodes.SingleQuote);
}
stateInAttributeValueNoQuotes(c) {
if (isWhitespace(c) || c === CharCodes.Gt) {
this.cbs.onattribdata(this.sectionStart, this.index);
this.sectionStart = -1;
this.cbs.onattribend(QuoteType.Unquoted, this.index);
this.state = State.BeforeAttributeName;
this.stateBeforeAttributeName(c);
}
else if (this.decodeEntities && c === CharCodes.Amp) {
this.startEntity();
}
}
stateBeforeDeclaration(c) {
if (c === CharCodes.OpeningSquareBracket) {
this.state = State.CDATASequence;
this.sequenceIndex = 0;
}
else {
this.state =
c === CharCodes.Dash
? State.BeforeComment
: State.InDeclaration;
}
}
stateInDeclaration(c) {
if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
this.cbs.ondeclaration(this.sectionStart, this.index);
this.state = State.Text;
this.sectionStart = this.index + 1;
}
}
stateInProcessingInstruction(c) {
if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
this.cbs.onprocessinginstruction(this.sectionStart, this.index);
this.state = State.Text;
this.sectionStart = this.index + 1;
}
}
stateBeforeComment(c) {
if (c === CharCodes.Dash) {
this.state = State.InCommentLike;
this.currentSequence = Sequences.CommentEnd;
// Allow short comments (eg. <!-->)
this.sequenceIndex = 2;
this.sectionStart = this.index + 1;
}
else {
this.state = State.InDeclaration;
}
}
stateInSpecialComment(c) {
if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
this.cbs.oncomment(this.sectionStart, this.index, 0);
this.state = State.Text;
this.sectionStart = this.index + 1;
}
}
stateBeforeSpecialS(c) {
const lower = c | 0x20;
if (lower === Sequences.ScriptEnd[3]) {
this.startSpecial(Sequences.ScriptEnd, 4);
}
else if (lower === Sequences.StyleEnd[3]) {
this.startSpecial(Sequences.StyleEnd, 4);
}
else {
this.state = State.InTagName;
this.stateInTagName(c); // Consume the token again
}
}
stateBeforeSpecialT(c) {
const lower = c | 0x20;
switch (lower) {
case Sequences.TitleEnd[3]: {
this.startSpecial(Sequences.TitleEnd, 4);
break;
}
case Sequences.TextareaEnd[3]: {
this.startSpecial(Sequences.TextareaEnd, 4);
break;
}
case Sequences.XmpEnd[3]: {
this.startSpecial(Sequences.XmpEnd, 4);
break;
}
default: {
this.state = State.InTagName;
this.stateInTagName(c); // Consume the token again
}
}
}
startEntity() {
this.baseState = this.state;
this.state = State.InEntity;
this.entityStart = this.index;
this.entityDecoder.startEntity(this.xmlMode
? decode_1.DecodingMode.Strict
: this.baseState === State.Text ||
this.baseState === State.InSpecialTag
? decode_1.DecodingMode.Legacy
: decode_1.DecodingMode.Attribute);
}
stateInEntity() {
const length = this.entityDecoder.write(this.buffer, this.index - this.offset);
// If `length` is positive, we are done with the entity.
if (length >= 0) {
this.state = this.baseState;
if (length === 0) {
this.index = this.entityStart;
}
}
else {
// Mark buffer as consumed.
this.index = this.offset + this.buffer.length - 1;
}
}
/**
* Remove data that has already been consumed from the buffer.
*/
cleanup() {
// If we are inside of text or attributes, emit what we already have.
if (this.running && this.sectionStart !== this.index) {
if (this.state === State.Text ||
(this.state === State.InSpecialTag && this.sequenceIndex === 0)) {
this.cbs.ontext(this.sectionStart, this.index);
this.sectionStart = this.index;
}
else if (this.state === State.InAttributeValueDq ||
this.state === State.InAttributeValueSq ||
this.state === State.InAttributeValueNq) {
this.cbs.onattribdata(this.sectionStart, this.index);
this.sectionStart = this.index;
}
}
}
shouldContinue() {
return this.index < this.buffer.length + this.offset && this.running;
}
/**
* Iterates through the buffer, calling the function corresponding to the current state.
*
* States that are more likely to be hit are higher up, as a performance improvement.
*/
parse() {
while (this.shouldContinue()) {
const c = this.buffer.charCodeAt(this.index - this.offset);
switch (this.state) {
case State.Text: {
this.stateText(c);
break;
}
case State.SpecialStartSequence: {
this.stateSpecialStartSequence(c);
break;
}
case State.InSpecialTag: {
this.stateInSpecialTag(c);
break;
}
case State.CDATASequence: {
this.stateCDATASequence(c);
break;
}
case State.InAttributeValueDq: {
this.stateInAttributeValueDoubleQuotes(c);
break;
}
case State.InAttributeName: {
this.stateInAttributeName(c);
break;
}
case State.InCommentLike: {
this.stateInCommentLike(c);
break;
}
case State.InSpecialComment: {
this.stateInSpecialComment(c);
break;
}
case State.BeforeAttributeName: {
this.stateBeforeAttributeName(c);
break;
}
case State.InTagName: {
this.stateInTagName(c);
break;
}
case State.InClosingTagName: {
this.stateInClosingTagName(c);
break;
}
case State.BeforeTagName: {
this.stateBeforeTagName(c);
break;
}
case State.AfterAttributeName: {
this.stateAfterAttributeName(c);
break;
}
case State.InAttributeValueSq: {
this.stateInAttributeValueSingleQuotes(c);
break;
}
case State.BeforeAttributeValue: {
this.stateBeforeAttributeValue(c);
break;
}
case State.BeforeClosingTagName: {
this.stateBeforeClosingTagName(c);
break;
}
case State.AfterClosingTagName: {
this.stateAfterClosingTagName(c);
break;
}
case State.BeforeSpecialS: {
this.stateBeforeSpecialS(c);
break;
}
case State.BeforeSpecialT: {
this.stateBeforeSpecialT(c);
break;
}
case State.InAttributeValueNq: {
this.stateInAttributeValueNoQuotes(c);
break;
}
case State.InSelfClosingTag: {
this.stateInSelfClosingTag(c);
break;
}
case State.InDeclaration: {
this.stateInDeclaration(c);
break;
}
case State.BeforeDeclaration: {
this.stateBeforeDeclaration(c);
break;
}
case State.BeforeComment: {
this.stateBeforeComment(c);
break;
}
case State.InProcessingInstruction: {
this.stateInProcessingInstruction(c);
break;
}
case State.InEntity: {
this.stateInEntity();
break;
}
}
this.index++;
}
this.cleanup();
}
finish() {
if (this.state === State.InEntity) {
this.entityDecoder.end();
this.state = this.baseState;
}
this.handleTrailingData();
this.cbs.onend();
}
/** Handle any trailing data. */
handleTrailingData() {
const endIndex = this.buffer.length + this.offset;
// If there is no remaining data, we are done.
if (this.sectionStart >= endIndex) {
return;
}
if (this.state === State.InCommentLike) {
if (this.currentSequence === Sequences.CdataEnd) {
this.cbs.oncdata(this.sectionStart, endIndex, 0);
}
else {
this.cbs.oncomment(this.sectionStart, endIndex, 0);
}
}
else if (this.state === State.InTagName ||
this.state === State.BeforeAttributeName ||
this.state === State.BeforeAttributeValue ||
this.state === State.AfterAttributeName ||
this.state === State.InAttributeName ||
this.state === State.InAttributeValueSq ||
this.state === State.InAttributeValueDq ||
this.state === State.InAttributeValueNq ||
this.state === State.InClosingTagName) {
/*
* If we are currently in an opening or closing tag, us not calling the
* respective callback signals that the tag should be ignored.
*/
}
else {
this.cbs.ontext(this.sectionStart, endIndex);
}
}
emitCodePoint(cp, consumed) {
if (this.baseState !== State.Text &&
this.baseState !== State.InSpecialTag) {
if (this.sectionStart < this.entityStart) {
this.cbs.onattribdata(this.sectionStart, this.entityStart);
}
this.sectionStart = this.entityStart + consumed;
this.index = this.sectionStart - 1;
this.cbs.onattribentity(cp);
}
else {
if (this.sectionStart < this.entityStart) {
this.cbs.ontext(this.sectionStart, this.entityStart);
}
this.sectionStart = this.entityStart + consumed;
this.index = this.sectionStart - 1;
this.cbs.ontextentity(cp, this.sectionStart);
}
}
}
exports.default = Tokenizer;
//# sourceMappingURL=Tokenizer.js.map
@@ -0,0 +1 @@
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["schema.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH,yBAAyB;AACzB;IACE;;;;;;;;;OASG;IACH,sBATW,UAAU,CAAC,UAAU,CAAC,UAEtB,UAAU,CAAC,QAAQ,CAAC,UAEpB,KAAK,GAAG,SAAS,EAY3B;IANC,+BAAoB;IACpB,8DAAwB;IAGtB,yBAAkB;CAGvB;2BAvB6C,sBAAsB;0CAAtB,sBAAsB"}
@@ -0,0 +1,37 @@
"use client";
import {
useModalContext
} from "./chunk-UX6VCJJD.mjs";
// src/modal-header.tsx
import { useEffect } from "react";
import { forwardRef } from "@heroui/system";
import { useDOMRef } from "@heroui/react-utils";
import { clsx } from "@heroui/shared-utils";
import { jsx } from "react/jsx-runtime";
var ModalHeader = forwardRef((props, ref) => {
const { as, children, className, ...otherProps } = props;
const { slots, classNames, headerId, setHeaderMounted } = useModalContext();
const domRef = useDOMRef(ref);
const Component = as || "header";
useEffect(() => {
setHeaderMounted(true);
return () => setHeaderMounted(false);
}, [setHeaderMounted]);
return /* @__PURE__ */ jsx(
Component,
{
ref: domRef,
className: slots.header({ class: clsx(classNames == null ? void 0 : classNames.header, className) }),
id: headerId,
...otherProps,
children
}
);
});
ModalHeader.displayName = "HeroUI.ModalHeader";
var modal_header_default = ModalHeader;
export {
modal_header_default
};
@@ -0,0 +1,84 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var babel_1 = require("prettier/plugins/babel");
var flow_1 = require("prettier/plugins/flow");
var html_1 = require("prettier/plugins/html");
var typescript_1 = require("prettier/plugins/typescript");
var default_processor_1 = require("./preprocessors/default-processor");
var svelte_preprocessor_1 = require("./preprocessors/svelte-preprocessor");
var vue_preprocessor_1 = require("./preprocessors/vue-preprocessor");
var create_svelte_parsers_1 = require("./utils/create-svelte-parsers");
var svelteParsers = (0, create_svelte_parsers_1.createSvelteParsers)();
var options = {
importOrder: {
type: 'path',
category: 'Global',
array: true,
default: [{ value: [] }],
description: 'Provide an order to sort imports.',
},
importOrderCaseInsensitive: {
type: 'boolean',
category: 'Global',
default: false,
description: 'Provide a case sensitivity boolean flag',
},
importOrderParserPlugins: {
type: 'path',
category: 'Global',
array: true,
// By default, we add ts and jsx as parsers but if users define something
// we take that option
default: [{ value: ['typescript', 'jsx'] }],
description: 'Provide a list of plugins for special syntax',
},
importOrderSeparation: {
type: 'boolean',
category: 'Global',
default: false,
description: 'Should imports be separated by new line?',
},
importOrderGroupNamespaceSpecifiers: {
type: 'boolean',
category: 'Global',
default: false,
description: 'Should namespace specifiers be grouped at the top of their group?',
},
importOrderSortSpecifiers: {
type: 'boolean',
category: 'Global',
default: false,
description: 'Should specifiers be sorted?',
},
importOrderSideEffects: {
type: 'boolean',
category: 'Global',
default: true,
description: 'Should side effects be sorted?',
},
importOrderImportAttributesKeyword: {
type: 'string',
category: 'Global',
default: 'with',
description: 'Provide a keyword for import attributes',
},
};
module.exports = {
parsers: __assign({ babel: __assign(__assign({}, babel_1.parsers.babel), { preprocess: default_processor_1.defaultPreprocessor }), flow: __assign(__assign({}, flow_1.parsers.flow), { preprocess: default_processor_1.defaultPreprocessor }), typescript: __assign(__assign({}, typescript_1.parsers.typescript), { preprocess: default_processor_1.defaultPreprocessor }), vue: __assign(__assign({}, html_1.parsers.vue), { preprocess: vue_preprocessor_1.vuePreprocessor }) }, (svelteParsers.parsers
? {
svelte: __assign(__assign({}, svelteParsers.parsers.svelte), { preprocess: svelte_preprocessor_1.sveltePreprocessor }),
}
: {})),
options: options,
};
@@ -0,0 +1,205 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.tests = void 0;
var path_1 = require("path");
var filesystem_1 = require("../../filesystem");
var defaultExtensionsWhenRunningInTsNode = [
".js",
".json",
".node",
".ts",
".tsx",
];
exports.tests = [
{
name: "should locate path that matches with star and exists",
absoluteBaseUrl: "/root/",
paths: {
"lib/*": ["location/*"],
},
existingFiles: [(0, path_1.join)("/root", "location", "mylib", "index.ts")],
requestedModule: "lib/mylib",
expectedPath: (0, path_1.dirname)((0, path_1.join)("/root", "location", "mylib", "index.ts")),
extensions: defaultExtensionsWhenRunningInTsNode,
},
{
name: "should resolve to correct path when many are specified",
absoluteBaseUrl: "/root/",
paths: {
"lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"],
},
existingFiles: [(0, path_1.join)("/root", "location", "mylib", "index.ts")],
requestedModule: "lib/mylib",
extensions: [".ts"],
expectedPath: (0, path_1.dirname)((0, path_1.join)("/root", "location", "mylib", "index.ts")),
},
{
name: "should locate path that matches with star and prioritize pattern with longest prefix",
absoluteBaseUrl: "/root/",
paths: {
"*": ["location/*"],
"lib/*": ["location/*"],
},
existingFiles: [
(0, path_1.join)("/root", "location", "lib", "mylib", "index.ts"),
(0, path_1.join)("/root", "location", "mylib", "index.ts"),
],
requestedModule: "lib/mylib",
expectedPath: (0, path_1.dirname)((0, path_1.join)("/root", "location", "mylib", "index.ts")),
extensions: defaultExtensionsWhenRunningInTsNode,
},
{
name: "should locate path that matches with star and exists with extension",
absoluteBaseUrl: "/root/",
paths: { "lib/*": ["location/*"] },
existingFiles: [(0, path_1.join)("/root", "location", "mylib.myext")],
requestedModule: "lib/mylib",
extensions: [".js", ".myext"],
expectedPath: (0, filesystem_1.removeExtension)((0, path_1.join)("/root", "location", "mylib.myext")),
},
{
name: "should resolve request with extension specified",
absoluteBaseUrl: "/root/",
paths: { "lib/*": ["location/*"] },
existingFiles: [(0, path_1.join)("/root", "location", "test.jpg")],
requestedModule: "lib/test.jpg",
expectedPath: (0, path_1.join)("/root", "location", "test.jpg"),
extensions: defaultExtensionsWhenRunningInTsNode,
},
{
name: "should locate path that matches without star and exists",
absoluteBaseUrl: "/root/",
paths: {
"lib/foo": ["location/foo"],
},
existingFiles: [(0, path_1.join)("/root", "location", "foo.ts")],
requestedModule: "lib/foo",
expectedPath: (0, filesystem_1.removeExtension)((0, path_1.join)("/root", "location", "foo.ts")),
extensions: defaultExtensionsWhenRunningInTsNode,
},
{
name: "should resolve to parent folder when filename is in subfolder",
absoluteBaseUrl: "/root/",
paths: { "lib/*": ["location/*"] },
existingFiles: [(0, path_1.join)("/root", "location", "mylib", "index.ts")],
requestedModule: "lib/mylib",
expectedPath: (0, path_1.dirname)((0, path_1.join)("/root", "location", "mylib", "index.ts")),
extensions: defaultExtensionsWhenRunningInTsNode,
},
{
name: "should resolve from main field in package.json",
absoluteBaseUrl: "/root/",
paths: { "lib/*": ["location/*"] },
existingFiles: [(0, path_1.join)("/root", "location", "mylib", "kalle.ts")],
packageJson: { main: "./kalle.ts" },
requestedModule: "lib/mylib",
expectedPath: (0, path_1.join)("/root", "location", "mylib", "kalle.ts"),
extensions: defaultExtensionsWhenRunningInTsNode,
},
{
name: "should resolve from main field in package.json (js)",
absoluteBaseUrl: "/root",
paths: { "lib/*": ["location/*"] },
existingFiles: [(0, path_1.join)("/root", "location", "mylib.js", "kalle.js")],
packageJson: { main: "./kalle.js" },
requestedModule: "lib/mylib.js",
extensions: [".ts", ".js"],
expectedPath: (0, path_1.join)("/root", "location", "mylib.js", "kalle.js"),
},
{
name: "should resolve from list of fields by priority in package.json",
absoluteBaseUrl: "/root/",
paths: { "lib/*": ["location/*"] },
mainFields: ["missing", "browser", "main"],
packageJson: { main: "./main.js", browser: "./browser.js" },
existingFiles: [
(0, path_1.join)("/root", "location", "mylibjs", "main.js"),
(0, path_1.join)("/root", "location", "mylibjs", "browser.js"), // browserFilePath
],
extensions: [".ts", ".js"],
requestedModule: "lib/mylibjs",
expectedPath: (0, path_1.join)("/root", "location", "mylibjs", "browser.js"),
},
{
name: "should ignore field mappings to missing files in package.json",
absoluteBaseUrl: "/root/",
paths: { "lib/*": ["location/*"] },
mainFields: ["browser", "main"],
existingFiles: [(0, path_1.join)("/root", "location", "mylibjs", "kalle.js")],
requestedModule: "lib/mylibjs",
packageJson: {
main: "./kalle.js",
browser: "./nope.js",
},
extensions: [".ts", ".js"],
expectedPath: (0, path_1.join)("/root", "location", "mylibjs", "kalle.js"),
},
{
name: "should ignore advanced field mappings in package.json",
absoluteBaseUrl: "/root/",
paths: { "lib/*": ["location/*"] },
existingFiles: [
(0, path_1.join)("/root", "location", "mylibjs", "kalle.js"),
(0, path_1.join)("/root", "location", "mylibjs", "browser.js"),
],
requestedModule: "lib/mylibjs",
packageJson: {
main: "./kalle.js",
browser: { mylibjs: "./browser.js", "./kalle.js": "./browser.js" },
},
extensions: [".ts", ".js"],
expectedPath: (0, path_1.join)("/root", "location", "mylibjs", "kalle.js"),
},
{
name: "should resolve to with the help of baseUrl when not explicitly set",
absoluteBaseUrl: "/root/",
paths: {},
existingFiles: [(0, path_1.join)("/root", "mylib", "index.ts")],
requestedModule: "mylib",
expectedPath: (0, path_1.dirname)((0, path_1.join)("/root", "mylib", "index.ts")),
extensions: defaultExtensionsWhenRunningInTsNode,
},
{
name: "should not resolve with the help of baseUrl when asked not to",
absoluteBaseUrl: "/root/",
paths: {},
addMatchAll: false,
existingFiles: [(0, path_1.join)("/root", "mylib", "index.ts")],
requestedModule: "mylib",
expectedPath: undefined,
extensions: defaultExtensionsWhenRunningInTsNode,
},
{
name: "should not locate path that does not match",
absoluteBaseUrl: "/root/",
paths: { "lib/*": ["location/*"] },
existingFiles: [(0, path_1.join)("root", "location", "mylib")],
requestedModule: "mylib",
expectedPath: undefined,
extensions: defaultExtensionsWhenRunningInTsNode,
},
{
name: "should not resolve typings file (index.d.ts)",
absoluteBaseUrl: "/root/",
paths: {
"lib/*": ["location/*"],
},
existingFiles: [(0, path_1.join)("/root", "location", "mylib", "index.d.ts")],
requestedModule: "lib/mylib",
expectedPath: undefined,
extensions: defaultExtensionsWhenRunningInTsNode,
},
{
name: "should resolve main file with cjs file extension",
absoluteBaseUrl: "/root/",
paths: {},
existingFiles: [(0, path_1.join)("/root", "mylib", "index.cjs")],
packageJson: {
main: "./index.cjs",
},
requestedModule: "mylib",
expectedPath: (0, path_1.join)("/root", "mylib", "index.cjs"),
extensions: defaultExtensionsWhenRunningInTsNode,
},
];
//# sourceMappingURL=match-path-data.js.map
@@ -0,0 +1,21 @@
{
"name": "@react-types/button",
"version": "3.10.1",
"description": "Spectrum UI components in React",
"license": "Apache-2.0",
"types": "src/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/adobe/react-spectrum"
},
"dependencies": {
"@react-types/shared": "^3.26.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
},
"publishConfig": {
"access": "public"
},
"gitHead": "71f0ef23053f9e03ee7e97df736e8b083e006849"
}
@@ -0,0 +1,344 @@
import {epochFromDate as $11d87f3f76e88657$export$bd4fb2bc8bb06fb, fromAbsolute as $11d87f3f76e88657$export$1b96692a1ba042ac, toAbsolute as $11d87f3f76e88657$export$5107c82f94518f5c, toCalendar as $11d87f3f76e88657$export$b4a036af3fc0b032, toCalendarDateTime as $11d87f3f76e88657$export$b21e0b124e224484} from "./conversion.module.js";
import {GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from "./GregorianCalendar.module.js";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $735220c2d4774dd3$var$ONE_HOUR = 3600000;
function $735220c2d4774dd3$export$e16d8520af44a096(date, duration) {
let mutableDate = date.copy();
let days = 'hour' in mutableDate ? $735220c2d4774dd3$var$addTimeFields(mutableDate, duration) : 0;
$735220c2d4774dd3$var$addYears(mutableDate, duration.years || 0);
if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date);
mutableDate.month += duration.months || 0;
$735220c2d4774dd3$var$balanceYearMonth(mutableDate);
$735220c2d4774dd3$var$constrainMonthDay(mutableDate);
mutableDate.day += (duration.weeks || 0) * 7;
mutableDate.day += duration.days || 0;
mutableDate.day += days;
$735220c2d4774dd3$var$balanceDay(mutableDate);
if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);
// Constrain in case adding ended up with a date outside the valid range for the calendar system.
// The behavior here is slightly different than when constraining in the `set` function in that
// we adjust smaller fields to their minimum/maximum values rather than constraining each field
// individually. This matches the general behavior of `add` vs `set` regarding how fields are balanced.
if (mutableDate.year < 1) {
mutableDate.year = 1;
mutableDate.month = 1;
mutableDate.day = 1;
}
let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);
if (mutableDate.year > maxYear) {
var _mutableDate_calendar_isInverseEra, _mutableDate_calendar;
let isInverseEra = (_mutableDate_calendar_isInverseEra = (_mutableDate_calendar = mutableDate.calendar).isInverseEra) === null || _mutableDate_calendar_isInverseEra === void 0 ? void 0 : _mutableDate_calendar_isInverseEra.call(_mutableDate_calendar, mutableDate);
mutableDate.year = maxYear;
mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);
mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);
}
if (mutableDate.month < 1) {
mutableDate.month = 1;
mutableDate.day = 1;
}
let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);
if (mutableDate.month > maxMonth) {
mutableDate.month = maxMonth;
mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);
}
mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));
return mutableDate;
}
function $735220c2d4774dd3$var$addYears(date, years) {
var _date_calendar_isInverseEra, _date_calendar;
if ((_date_calendar_isInverseEra = (_date_calendar = date.calendar).isInverseEra) === null || _date_calendar_isInverseEra === void 0 ? void 0 : _date_calendar_isInverseEra.call(_date_calendar, date)) years = -years;
date.year += years;
}
function $735220c2d4774dd3$var$balanceYearMonth(date) {
while(date.month < 1){
$735220c2d4774dd3$var$addYears(date, -1);
date.month += date.calendar.getMonthsInYear(date);
}
let monthsInYear = 0;
while(date.month > (monthsInYear = date.calendar.getMonthsInYear(date))){
date.month -= monthsInYear;
$735220c2d4774dd3$var$addYears(date, 1);
}
}
function $735220c2d4774dd3$var$balanceDay(date) {
while(date.day < 1){
date.month--;
$735220c2d4774dd3$var$balanceYearMonth(date);
date.day += date.calendar.getDaysInMonth(date);
}
while(date.day > date.calendar.getDaysInMonth(date)){
date.day -= date.calendar.getDaysInMonth(date);
date.month++;
$735220c2d4774dd3$var$balanceYearMonth(date);
}
}
function $735220c2d4774dd3$var$constrainMonthDay(date) {
date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));
date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));
}
function $735220c2d4774dd3$export$c4e2ecac49351ef2(date) {
if (date.calendar.constrainDate) date.calendar.constrainDate(date);
date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));
$735220c2d4774dd3$var$constrainMonthDay(date);
}
function $735220c2d4774dd3$export$3e2544e88a25bff8(duration) {
let inverseDuration = {};
for(let key in duration)if (typeof duration[key] === 'number') inverseDuration[key] = -duration[key];
return inverseDuration;
}
function $735220c2d4774dd3$export$4e2d2ead65e5f7e3(date, duration) {
return $735220c2d4774dd3$export$e16d8520af44a096(date, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
}
function $735220c2d4774dd3$export$adaa4cf7ef1b65be(date, fields) {
let mutableDate = date.copy();
if (fields.era != null) mutableDate.era = fields.era;
if (fields.year != null) mutableDate.year = fields.year;
if (fields.month != null) mutableDate.month = fields.month;
if (fields.day != null) mutableDate.day = fields.day;
$735220c2d4774dd3$export$c4e2ecac49351ef2(mutableDate);
return mutableDate;
}
function $735220c2d4774dd3$export$e5d5e1c1822b6e56(value, fields) {
let mutableValue = value.copy();
if (fields.hour != null) mutableValue.hour = fields.hour;
if (fields.minute != null) mutableValue.minute = fields.minute;
if (fields.second != null) mutableValue.second = fields.second;
if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
$735220c2d4774dd3$export$7555de1e070510cb(mutableValue);
return mutableValue;
}
function $735220c2d4774dd3$var$balanceTime(time) {
time.second += Math.floor(time.millisecond / 1000);
time.millisecond = $735220c2d4774dd3$var$nonNegativeMod(time.millisecond, 1000);
time.minute += Math.floor(time.second / 60);
time.second = $735220c2d4774dd3$var$nonNegativeMod(time.second, 60);
time.hour += Math.floor(time.minute / 60);
time.minute = $735220c2d4774dd3$var$nonNegativeMod(time.minute, 60);
let days = Math.floor(time.hour / 24);
time.hour = $735220c2d4774dd3$var$nonNegativeMod(time.hour, 24);
return days;
}
function $735220c2d4774dd3$export$7555de1e070510cb(time) {
time.millisecond = Math.max(0, Math.min(time.millisecond, 1000));
time.second = Math.max(0, Math.min(time.second, 59));
time.minute = Math.max(0, Math.min(time.minute, 59));
time.hour = Math.max(0, Math.min(time.hour, 23));
}
function $735220c2d4774dd3$var$nonNegativeMod(a, b) {
let result = a % b;
if (result < 0) result += b;
return result;
}
function $735220c2d4774dd3$var$addTimeFields(time, duration) {
time.hour += duration.hours || 0;
time.minute += duration.minutes || 0;
time.second += duration.seconds || 0;
time.millisecond += duration.milliseconds || 0;
return $735220c2d4774dd3$var$balanceTime(time);
}
function $735220c2d4774dd3$export$7ed87b6bc2506470(time, duration) {
let res = time.copy();
$735220c2d4774dd3$var$addTimeFields(res, duration);
return res;
}
function $735220c2d4774dd3$export$fe34d3a381cd7501(time, duration) {
return $735220c2d4774dd3$export$7ed87b6bc2506470(time, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
}
function $735220c2d4774dd3$export$d52ced6badfb9a4c(value, field, amount, options) {
let mutable = value.copy();
switch(field){
case 'era':
{
let eras = value.calendar.getEras();
let eraIndex = eras.indexOf(value.era);
if (eraIndex < 0) throw new Error('Invalid era: ' + value.era);
eraIndex = $735220c2d4774dd3$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options === null || options === void 0 ? void 0 : options.round);
mutable.era = eras[eraIndex];
// Constrain the year and other fields within the era, so the era doesn't change when we balance below.
$735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
break;
}
case 'year':
var _mutable_calendar_isInverseEra, _mutable_calendar;
if ((_mutable_calendar_isInverseEra = (_mutable_calendar = mutable.calendar).isInverseEra) === null || _mutable_calendar_isInverseEra === void 0 ? void 0 : _mutable_calendar_isInverseEra.call(_mutable_calendar, mutable)) amount = -amount;
// The year field should not cycle within the era as that can cause weird behavior affecting other fields.
// We need to also allow values < 1 so that decrementing goes to the previous era. If we get -Infinity back
// we know we wrapped around after reaching 9999 (the maximum), so set the year back to 1.
mutable.year = $735220c2d4774dd3$var$cycleValue(value.year, amount, -Infinity, 9999, options === null || options === void 0 ? void 0 : options.round);
if (mutable.year === -Infinity) mutable.year = 1;
if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);
break;
case 'month':
mutable.month = $735220c2d4774dd3$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options === null || options === void 0 ? void 0 : options.round);
break;
case 'day':
mutable.day = $735220c2d4774dd3$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options === null || options === void 0 ? void 0 : options.round);
break;
default:
throw new Error('Unsupported field ' + field);
}
if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);
$735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
return mutable;
}
function $735220c2d4774dd3$export$dd02b3e0007dfe28(value, field, amount, options) {
let mutable = value.copy();
switch(field){
case 'hour':
{
let hours = value.hour;
let min = 0;
let max = 23;
if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
let isPM = hours >= 12;
min = isPM ? 12 : 0;
max = isPM ? 23 : 11;
}
mutable.hour = $735220c2d4774dd3$var$cycleValue(hours, amount, min, max, options === null || options === void 0 ? void 0 : options.round);
break;
}
case 'minute':
mutable.minute = $735220c2d4774dd3$var$cycleValue(value.minute, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
break;
case 'second':
mutable.second = $735220c2d4774dd3$var$cycleValue(value.second, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
break;
case 'millisecond':
mutable.millisecond = $735220c2d4774dd3$var$cycleValue(value.millisecond, amount, 0, 999, options === null || options === void 0 ? void 0 : options.round);
break;
default:
throw new Error('Unsupported field ' + field);
}
return mutable;
}
function $735220c2d4774dd3$var$cycleValue(value, amount, min, max, round = false) {
if (round) {
value += Math.sign(amount);
if (value < min) value = max;
let div = Math.abs(amount);
if (amount > 0) value = Math.ceil(value / div) * div;
else value = Math.floor(value / div) * div;
if (value > max) value = min;
} else {
value += amount;
if (value < min) value = max - (min - value - 1);
else if (value > max) value = min + (value - max - 1);
}
return value;
}
function $735220c2d4774dd3$export$96b1d28349274637(dateTime, duration) {
let ms;
if (duration.years != null && duration.years !== 0 || duration.months != null && duration.months !== 0 || duration.weeks != null && duration.weeks !== 0 || duration.days != null && duration.days !== 0) {
let res = $735220c2d4774dd3$export$e16d8520af44a096((0, $11d87f3f76e88657$export$b21e0b124e224484)(dateTime), {
years: duration.years,
months: duration.months,
weeks: duration.weeks,
days: duration.days
});
// Changing the date may change the timezone offset, so we need to recompute
// using the 'compatible' disambiguation.
ms = (0, $11d87f3f76e88657$export$5107c82f94518f5c)(res, dateTime.timeZone);
} else // Otherwise, preserve the offset of the original date.
ms = (0, $11d87f3f76e88657$export$bd4fb2bc8bb06fb)(dateTime) - dateTime.offset;
// Perform time manipulation in milliseconds rather than on the original time fields to account for DST.
// For example, adding one hour during a DST transition may result in the hour field staying the same or
// skipping an hour. This results in the offset field changing value instead of the specified field.
ms += duration.milliseconds || 0;
ms += (duration.seconds || 0) * 1000;
ms += (duration.minutes || 0) * 60000;
ms += (duration.hours || 0) * 3600000;
let res = (0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone);
return (0, $11d87f3f76e88657$export$b4a036af3fc0b032)(res, dateTime.calendar);
}
function $735220c2d4774dd3$export$6814caac34ca03c7(dateTime, duration) {
return $735220c2d4774dd3$export$96b1d28349274637(dateTime, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
}
function $735220c2d4774dd3$export$9a297d111fc86b79(dateTime, field, amount, options) {
// For date fields, we want the time to remain consistent and the UTC offset to potentially change to account for DST changes.
// For time fields, we want the time to change by the amount given. This may result in the hour field staying the same, but the UTC
// offset changing in the case of a backward DST transition, or skipping an hour in the case of a forward DST transition.
switch(field){
case 'hour':
{
let min = 0;
let max = 23;
if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
let isPM = dateTime.hour >= 12;
min = isPM ? 12 : 0;
max = isPM ? 23 : 11;
}
// The minimum and maximum hour may be affected by daylight saving time.
// For example, it might jump forward at midnight, and skip 1am.
// Or it might end at midnight and repeat the 11pm hour. To handle this, we get
// the possible absolute times for the min and max, and find the maximum range
// that is within the current day.
let plainDateTime = (0, $11d87f3f76e88657$export$b21e0b124e224484)(dateTime);
let minDate = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
hour: min
}), new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());
let minAbsolute = [
(0, $11d87f3f76e88657$export$5107c82f94518f5c)(minDate, dateTime.timeZone, 'earlier'),
(0, $11d87f3f76e88657$export$5107c82f94518f5c)(minDate, dateTime.timeZone, 'later')
].filter((ms)=>(0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone).day === minDate.day)[0];
let maxDate = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
hour: max
}), new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());
let maxAbsolute = [
(0, $11d87f3f76e88657$export$5107c82f94518f5c)(maxDate, dateTime.timeZone, 'earlier'),
(0, $11d87f3f76e88657$export$5107c82f94518f5c)(maxDate, dateTime.timeZone, 'later')
].filter((ms)=>(0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone).day === maxDate.day).pop();
// Since hours may repeat, we need to operate on the absolute time in milliseconds.
// This is done in hours from the Unix epoch so that cycleValue works correctly,
// and then converted back to milliseconds.
let ms = (0, $11d87f3f76e88657$export$bd4fb2bc8bb06fb)(dateTime) - dateTime.offset;
let hours = Math.floor(ms / $735220c2d4774dd3$var$ONE_HOUR);
let remainder = ms % $735220c2d4774dd3$var$ONE_HOUR;
ms = $735220c2d4774dd3$var$cycleValue(hours, amount, Math.floor(minAbsolute / $735220c2d4774dd3$var$ONE_HOUR), Math.floor(maxAbsolute / $735220c2d4774dd3$var$ONE_HOUR), options === null || options === void 0 ? void 0 : options.round) * $735220c2d4774dd3$var$ONE_HOUR + remainder;
// Now compute the new timezone offset, and convert the absolute time back to local time.
return (0, $11d87f3f76e88657$export$b4a036af3fc0b032)((0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);
}
case 'minute':
case 'second':
case 'millisecond':
// @ts-ignore
return $735220c2d4774dd3$export$dd02b3e0007dfe28(dateTime, field, amount, options);
case 'era':
case 'year':
case 'month':
case 'day':
{
let res = $735220c2d4774dd3$export$d52ced6badfb9a4c((0, $11d87f3f76e88657$export$b21e0b124e224484)(dateTime), field, amount, options);
let ms = (0, $11d87f3f76e88657$export$5107c82f94518f5c)(res, dateTime.timeZone);
return (0, $11d87f3f76e88657$export$b4a036af3fc0b032)((0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);
}
default:
throw new Error('Unsupported field ' + field);
}
}
function $735220c2d4774dd3$export$31b5430eb18be4f8(dateTime, fields, disambiguation) {
// Set the date/time fields, and recompute the UTC offset to account for DST changes.
// We also need to validate by converting back to a local time in case hours are skipped during forward DST transitions.
let plainDateTime = (0, $11d87f3f76e88657$export$b21e0b124e224484)(dateTime);
let res = $735220c2d4774dd3$export$e5d5e1c1822b6e56($735220c2d4774dd3$export$adaa4cf7ef1b65be(plainDateTime, fields), fields);
// If the resulting plain date time values are equal, return the original time.
// We don't want to change the offset when setting the time to the same value.
if (res.compare(plainDateTime) === 0) return dateTime;
let ms = (0, $11d87f3f76e88657$export$5107c82f94518f5c)(res, dateTime.timeZone, disambiguation);
return (0, $11d87f3f76e88657$export$b4a036af3fc0b032)((0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);
}
export {$735220c2d4774dd3$export$e16d8520af44a096 as add, $735220c2d4774dd3$export$c4e2ecac49351ef2 as constrain, $735220c2d4774dd3$export$3e2544e88a25bff8 as invertDuration, $735220c2d4774dd3$export$4e2d2ead65e5f7e3 as subtract, $735220c2d4774dd3$export$adaa4cf7ef1b65be as set, $735220c2d4774dd3$export$e5d5e1c1822b6e56 as setTime, $735220c2d4774dd3$export$7555de1e070510cb as constrainTime, $735220c2d4774dd3$export$7ed87b6bc2506470 as addTime, $735220c2d4774dd3$export$fe34d3a381cd7501 as subtractTime, $735220c2d4774dd3$export$d52ced6badfb9a4c as cycleDate, $735220c2d4774dd3$export$dd02b3e0007dfe28 as cycleTime, $735220c2d4774dd3$export$96b1d28349274637 as addZoned, $735220c2d4774dd3$export$6814caac34ca03c7 as subtractZoned, $735220c2d4774dd3$export$9a297d111fc86b79 as cycleZoned, $735220c2d4774dd3$export$31b5430eb18be4f8 as setZoned};
//# sourceMappingURL=manipulation.module.js.map
@@ -0,0 +1,3 @@
declare const _exports: Record<string, "off">;
export = _exports;
//# sourceMappingURL=ts-redundant.d.ts.map
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,cAAc,CAAC;IAC1E,qBAAqB,CAAC,wFAAgE,CAAC;IACvF,UAAU,CAAC,UAAU,CAAC;IACtB,eAAe,CAAC,0BAA0B,CAAC;IAC3C,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,uCAAiC,CAAC;YAAE,KAAK,IAAM,CAAC,YAAY,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,UAAU,CAAC;YAAE,OAAO,IAAM,CAAC,2BAAqB,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,GAAG;QAAA,GAAG,CAAC,CAAC;IAC9P,gBAAgB,CAAC,OAAS,CAAC,YAAY,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;AACvD","sources":["packages/@react-aria/grid/intl/lt-LT.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} nepasirinkta.\",\n \"longPressToSelect\": \"Norėdami įjungti pasirinkimo režimą, paspauskite ir palaikykite.\",\n \"select\": \"Pasirinkti\",\n \"selectedAll\": \"Pasirinkti visi elementai.\",\n \"selectedCount\": \"{count, plural, =0 {Nepasirinktas nė vienas elementas} one {Pasirinktas # elementas} other {Pasirinkta elementų: #}}.\",\n \"selectedItem\": \"Pasirinkta: {item}.\"\n}\n"],"names":[],"version":3,"file":"lt-LT.main.js.map"}
@@ -0,0 +1,77 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.reflectionEquals = void 0;
const reflection_info_1 = require("./reflection-info");
/**
* Determines whether two message of the same type have the same field values.
* Checks for deep equality, traversing repeated fields, oneof groups, maps
* and messages recursively.
* Will also return true if both messages are `undefined`.
*/
function reflectionEquals(info, a, b) {
if (a === b)
return true;
if (!a || !b)
return false;
for (let field of info.fields) {
let localName = field.localName;
let val_a = field.oneof ? a[field.oneof][localName] : a[localName];
let val_b = field.oneof ? b[field.oneof][localName] : b[localName];
switch (field.kind) {
case "enum":
case "scalar":
let t = field.kind == "enum" ? reflection_info_1.ScalarType.INT32 : field.T;
if (!(field.repeat
? repeatedPrimitiveEq(t, val_a, val_b)
: primitiveEq(t, val_a, val_b)))
return false;
break;
case "map":
if (!(field.V.kind == "message"
? repeatedMsgEq(field.V.T(), objectValues(val_a), objectValues(val_b))
: repeatedPrimitiveEq(field.V.kind == "enum" ? reflection_info_1.ScalarType.INT32 : field.V.T, objectValues(val_a), objectValues(val_b))))
return false;
break;
case "message":
let T = field.T();
if (!(field.repeat
? repeatedMsgEq(T, val_a, val_b)
: T.equals(val_a, val_b)))
return false;
break;
}
}
return true;
}
exports.reflectionEquals = reflectionEquals;
const objectValues = Object.values;
function primitiveEq(type, a, b) {
if (a === b)
return true;
if (type !== reflection_info_1.ScalarType.BYTES)
return false;
let ba = a;
let bb = b;
if (ba.length !== bb.length)
return false;
for (let i = 0; i < ba.length; i++)
if (ba[i] != bb[i])
return false;
return true;
}
function repeatedPrimitiveEq(type, a, b) {
if (a.length !== b.length)
return false;
for (let i = 0; i < a.length; i++)
if (!primitiveEq(type, a[i], b[i]))
return false;
return true;
}
function repeatedMsgEq(type, a, b) {
if (a.length !== b.length)
return false;
for (let i = 0; i < a.length; i++)
if (!type.equals(a[i], b[i]))
return false;
return true;
}
@@ -0,0 +1,50 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const vitest_1 = require("vitest");
const __1 = require("../..");
(0, vitest_1.describe)('Issue 1416', () => {
(0, vitest_1.it)('should allow providing default values on optional bindings', async () => {
let Test1 = class Test1 {
onDestroyMock = vitest_1.vitest.fn();
destroy() {
this.onDestroyMock();
}
};
tslib_1.__decorate([
(0, __1.preDestroy)(),
tslib_1.__metadata("design:type", Function),
tslib_1.__metadata("design:paramtypes", []),
tslib_1.__metadata("design:returntype", void 0)
], Test1.prototype, "destroy", null);
Test1 = tslib_1.__decorate([
(0, __1.injectable)()
], Test1);
let Test2 = class Test2 {
destroy() { }
};
Test2 = tslib_1.__decorate([
(0, __1.injectable)()
], Test2);
let Test3 = class Test3 {
destroy() { }
};
Test3 = tslib_1.__decorate([
(0, __1.injectable)()
], Test3);
const container = new __1.Container({ defaultScope: 'Singleton' });
container.bind(Test1).toSelf();
container.bind(Test2).toService(Test1);
container.bind(Test3).toService(Test1);
const test1 = container.get(Test1);
container.get(Test2);
container.get(Test3);
await Promise.all([
container.unbind(Test1),
container.unbind(Test2),
container.unbind(Test3),
]);
(0, vitest_1.expect)(test1.onDestroyMock).toHaveBeenCalledTimes(1);
});
});
//# sourceMappingURL=issue_1416.test.js.map
@@ -0,0 +1,2 @@
import type { Token } from '../parse/cst';
export declare function containsNewline(key: Token | null | undefined): boolean | null;
@@ -0,0 +1,27 @@
const { Argument } = require('./lib/argument.js');
const { Command } = require('./lib/command.js');
const { CommanderError, InvalidArgumentError } = require('./lib/error.js');
const { Help } = require('./lib/help.js');
const { Option } = require('./lib/option.js');
// @ts-check
/**
* Expose the root command.
*/
exports = module.exports = new Command();
exports.program = exports; // More explicit access to global command.
// Implicit export of createArgument, createCommand, and createOption.
/**
* Expose classes
*/
exports.Argument = Argument;
exports.Command = Command;
exports.CommanderError = CommanderError;
exports.Help = Help;
exports.InvalidArgumentError = InvalidArgumentError;
exports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated
exports.Option = Option;
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isNode;
var _index = require("../definitions/index.js");
function isNode(node) {
return !!(node && _index.VISITOR_KEYS[node.type]);
}
//# sourceMappingURL=isNode.js.map
@@ -0,0 +1,9 @@
'use strict';
var util = require('./util');
module.exports = SchemaObject;
function SchemaObject(obj) {
util.copy(obj, this);
}
@@ -0,0 +1,6 @@
import { CreateType } from '../create/type.mjs';
import { Kind } from '../symbols/index.mjs';
/** `[Json]` Creates a Unsafe type that will infers as the generic argument T */
export function Unsafe(options = {}) {
return CreateType({ [Kind]: options[Kind] ?? 'Unsafe' }, options);
}
@@ -0,0 +1,64 @@
"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-skeleton.ts
var use_skeleton_exports = {};
__export(use_skeleton_exports, {
useSkeleton: () => useSkeleton
});
module.exports = __toCommonJS(use_skeleton_exports);
var import_system = require("@heroui/system");
var import_theme = require("@heroui/theme");
var import_shared_utils = require("@heroui/shared-utils");
var import_react = require("react");
var import_system2 = require("@heroui/system");
function useSkeleton(originalProps) {
var _a, _b;
const globalContext = (0, import_system2.useProviderContext)();
const [props, variantProps] = (0, import_system.mapPropsVariants)(originalProps, import_theme.skeleton.variantKeys);
const { as, children, isLoaded = false, className, classNames, ...otherProps } = props;
const Component = as || "div";
const disableAnimation = (_b = (_a = originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;
const slots = (0, import_react.useMemo)(
() => (0, import_theme.skeleton)({
...variantProps,
disableAnimation
}),
[(0, import_shared_utils.objectToDeps)(variantProps), disableAnimation, children]
);
const baseStyles = (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.base, className);
const getSkeletonProps = (props2 = {}) => {
return {
"data-loaded": (0, import_shared_utils.dataAttr)(isLoaded),
className: slots.base({ class: (0, import_shared_utils.clsx)(baseStyles, props2 == null ? void 0 : props2.className) }),
...otherProps
};
};
const getContentProps = (props2 = {}) => {
return {
className: slots.content({ class: (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.content, props2 == null ? void 0 : props2.className) })
};
};
return { Component, children, slots, classNames, getSkeletonProps, getContentProps };
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
useSkeleton
});
@@ -0,0 +1 @@
{"version":3,"file":"ScopedBinding.js","sourceRoot":"","sources":["../../../../src/binding/models/ScopedBinding.ts"],"names":[],"mappings":""}
@@ -0,0 +1,733 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _xhtml = require('../parser/plugins/jsx/xhtml'); var _xhtml2 = _interopRequireDefault(_xhtml);
var _tokenizer = require('../parser/tokenizer');
var _types = require('../parser/tokenizer/types');
var _charcodes = require('../parser/util/charcodes');
var _getJSXPragmaInfo = require('../util/getJSXPragmaInfo'); var _getJSXPragmaInfo2 = _interopRequireDefault(_getJSXPragmaInfo);
var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer);
class JSXTransformer extends _Transformer2.default {
// State for calculating the line number of each JSX tag in development.
__init() {this.lastLineNumber = 1}
__init2() {this.lastIndex = 0}
// In development, variable name holding the name of the current file.
__init3() {this.filenameVarName = null}
// Mapping of claimed names for imports in the automatic transform, e,g.
// {jsx: "_jsx"}. This determines which imports to generate in the prefix.
__init4() {this.esmAutomaticImportNameResolutions = {}}
// When automatically adding imports in CJS mode, we store the variable name
// holding the imported CJS module so we can require it in the prefix.
__init5() {this.cjsAutomaticModuleNameResolutions = {}}
constructor(
rootTransformer,
tokens,
importProcessor,
nameManager,
options,
) {
super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.importProcessor = importProcessor;this.nameManager = nameManager;this.options = options;JSXTransformer.prototype.__init.call(this);JSXTransformer.prototype.__init2.call(this);JSXTransformer.prototype.__init3.call(this);JSXTransformer.prototype.__init4.call(this);JSXTransformer.prototype.__init5.call(this);;
this.jsxPragmaInfo = _getJSXPragmaInfo2.default.call(void 0, options);
this.isAutomaticRuntime = options.jsxRuntime === "automatic";
this.jsxImportSource = options.jsxImportSource || "react";
}
process() {
if (this.tokens.matches1(_types.TokenType.jsxTagStart)) {
this.processJSXTag();
return true;
}
return false;
}
getPrefixCode() {
let prefix = "";
if (this.filenameVarName) {
prefix += `const ${this.filenameVarName} = ${JSON.stringify(this.options.filePath || "")};`;
}
if (this.isAutomaticRuntime) {
if (this.importProcessor) {
// CJS mode: emit require statements for all modules that were referenced.
for (const [path, resolvedName] of Object.entries(this.cjsAutomaticModuleNameResolutions)) {
prefix += `var ${resolvedName} = require("${path}");`;
}
} else {
// ESM mode: consolidate and emit import statements for referenced names.
const {createElement: createElementResolution, ...otherResolutions} =
this.esmAutomaticImportNameResolutions;
if (createElementResolution) {
prefix += `import {createElement as ${createElementResolution}} from "${this.jsxImportSource}";`;
}
const importSpecifiers = Object.entries(otherResolutions)
.map(([name, resolvedName]) => `${name} as ${resolvedName}`)
.join(", ");
if (importSpecifiers) {
const importPath =
this.jsxImportSource + (this.options.production ? "/jsx-runtime" : "/jsx-dev-runtime");
prefix += `import {${importSpecifiers}} from "${importPath}";`;
}
}
}
return prefix;
}
processJSXTag() {
const {jsxRole, start} = this.tokens.currentToken();
// Calculate line number information at the very start (if in development
// mode) so that the information is guaranteed to be queried in token order.
const elementLocationCode = this.options.production ? null : this.getElementLocationCode(start);
if (this.isAutomaticRuntime && jsxRole !== _tokenizer.JSXRole.KeyAfterPropSpread) {
this.transformTagToJSXFunc(elementLocationCode, jsxRole);
} else {
this.transformTagToCreateElement(elementLocationCode);
}
}
getElementLocationCode(firstTokenStart) {
const lineNumber = this.getLineNumberForIndex(firstTokenStart);
return `lineNumber: ${lineNumber}`;
}
/**
* Get the line number for this source position. This is calculated lazily and
* must be called in increasing order by index.
*/
getLineNumberForIndex(index) {
const code = this.tokens.code;
while (this.lastIndex < index && this.lastIndex < code.length) {
if (code[this.lastIndex] === "\n") {
this.lastLineNumber++;
}
this.lastIndex++;
}
return this.lastLineNumber;
}
/**
* Convert the current JSX element to a call to jsx, jsxs, or jsxDEV. This is
* the primary transformation for the automatic transform.
*
* Example:
* <div a={1} key={2}>Hello{x}</div>
* becomes
* jsxs('div', {a: 1, children: ["Hello", x]}, 2)
*/
transformTagToJSXFunc(elementLocationCode, jsxRole) {
const isStatic = jsxRole === _tokenizer.JSXRole.StaticChildren;
// First tag is always jsxTagStart.
this.tokens.replaceToken(this.getJSXFuncInvocationCode(isStatic));
let keyCode = null;
if (this.tokens.matches1(_types.TokenType.jsxTagEnd)) {
// Fragment syntax.
this.tokens.replaceToken(`${this.getFragmentCode()}, {`);
this.processAutomaticChildrenAndEndProps(jsxRole);
} else {
// Normal open tag or self-closing tag.
this.processTagIntro();
this.tokens.appendCode(", {");
keyCode = this.processProps(true);
if (this.tokens.matches2(_types.TokenType.slash, _types.TokenType.jsxTagEnd)) {
// Self-closing tag, no children to add, so close the props.
this.tokens.appendCode("}");
} else if (this.tokens.matches1(_types.TokenType.jsxTagEnd)) {
// Tag with children.
this.tokens.removeToken();
this.processAutomaticChildrenAndEndProps(jsxRole);
} else {
throw new Error("Expected either /> or > at the end of the tag.");
}
// If a key was present, move it to its own arg. Note that moving code
// like this will cause line numbers to get out of sync within the JSX
// element if the key expression has a newline in it. This is unfortunate,
// but hopefully should be rare.
if (keyCode) {
this.tokens.appendCode(`, ${keyCode}`);
}
}
if (!this.options.production) {
// If the key wasn't already added, add it now so we can correctly set
// positional args for jsxDEV.
if (keyCode === null) {
this.tokens.appendCode(", void 0");
}
this.tokens.appendCode(`, ${isStatic}, ${this.getDevSource(elementLocationCode)}, this`);
}
// We're at the close-tag or the end of a self-closing tag, so remove
// everything else and close the function call.
this.tokens.removeInitialToken();
while (!this.tokens.matches1(_types.TokenType.jsxTagEnd)) {
this.tokens.removeToken();
}
this.tokens.replaceToken(")");
}
/**
* Convert the current JSX element to a createElement call. In the classic
* runtime, this is the only case. In the automatic runtime, this is called
* as a fallback in some situations.
*
* Example:
* <div a={1} key={2}>Hello{x}</div>
* becomes
* React.createElement('div', {a: 1, key: 2}, "Hello", x)
*/
transformTagToCreateElement(elementLocationCode) {
// First tag is always jsxTagStart.
this.tokens.replaceToken(this.getCreateElementInvocationCode());
if (this.tokens.matches1(_types.TokenType.jsxTagEnd)) {
// Fragment syntax.
this.tokens.replaceToken(`${this.getFragmentCode()}, null`);
this.processChildren(true);
} else {
// Normal open tag or self-closing tag.
this.processTagIntro();
this.processPropsObjectWithDevInfo(elementLocationCode);
if (this.tokens.matches2(_types.TokenType.slash, _types.TokenType.jsxTagEnd)) {
// Self-closing tag; no children to process.
} else if (this.tokens.matches1(_types.TokenType.jsxTagEnd)) {
// Tag with children and a close-tag; process the children as args.
this.tokens.removeToken();
this.processChildren(true);
} else {
throw new Error("Expected either /> or > at the end of the tag.");
}
}
// We're at the close-tag or the end of a self-closing tag, so remove
// everything else and close the function call.
this.tokens.removeInitialToken();
while (!this.tokens.matches1(_types.TokenType.jsxTagEnd)) {
this.tokens.removeToken();
}
this.tokens.replaceToken(")");
}
/**
* Get the code for the relevant function for this context: jsx, jsxs,
* or jsxDEV. The following open-paren is included as well.
*
* These functions are only used for the automatic runtime, so they are always
* auto-imported, but the auto-import will be either CJS or ESM based on the
* target module format.
*/
getJSXFuncInvocationCode(isStatic) {
if (this.options.production) {
if (isStatic) {
return this.claimAutoImportedFuncInvocation("jsxs", "/jsx-runtime");
} else {
return this.claimAutoImportedFuncInvocation("jsx", "/jsx-runtime");
}
} else {
return this.claimAutoImportedFuncInvocation("jsxDEV", "/jsx-dev-runtime");
}
}
/**
* Return the code to use for the createElement function, e.g.
* `React.createElement`, including the following open-paren.
*
* This is the main function to use for the classic runtime. For the
* automatic runtime, this function is used as a fallback function to
* preserve behavior when there is a prop spread followed by an explicit
* key. In that automatic runtime case, the function should be automatically
* imported.
*/
getCreateElementInvocationCode() {
if (this.isAutomaticRuntime) {
return this.claimAutoImportedFuncInvocation("createElement", "");
} else {
const {jsxPragmaInfo} = this;
const resolvedPragmaBaseName = this.importProcessor
? this.importProcessor.getIdentifierReplacement(jsxPragmaInfo.base) || jsxPragmaInfo.base
: jsxPragmaInfo.base;
return `${resolvedPragmaBaseName}${jsxPragmaInfo.suffix}(`;
}
}
/**
* Return the code to use as the component when compiling a shorthand
* fragment, e.g. `React.Fragment`.
*
* This may be called from either the classic or automatic runtime, and
* the value should be auto-imported for the automatic runtime.
*/
getFragmentCode() {
if (this.isAutomaticRuntime) {
return this.claimAutoImportedName(
"Fragment",
this.options.production ? "/jsx-runtime" : "/jsx-dev-runtime",
);
} else {
const {jsxPragmaInfo} = this;
const resolvedFragmentPragmaBaseName = this.importProcessor
? this.importProcessor.getIdentifierReplacement(jsxPragmaInfo.fragmentBase) ||
jsxPragmaInfo.fragmentBase
: jsxPragmaInfo.fragmentBase;
return resolvedFragmentPragmaBaseName + jsxPragmaInfo.fragmentSuffix;
}
}
/**
* Return code that invokes the given function.
*
* When the imports transform is enabled, use the CJSImportTransformer
* strategy of using `.call(void 0, ...` to avoid passing a `this` value in a
* situation that would otherwise look like a method call.
*/
claimAutoImportedFuncInvocation(funcName, importPathSuffix) {
const funcCode = this.claimAutoImportedName(funcName, importPathSuffix);
if (this.importProcessor) {
return `${funcCode}.call(void 0, `;
} else {
return `${funcCode}(`;
}
}
claimAutoImportedName(funcName, importPathSuffix) {
if (this.importProcessor) {
// CJS mode: claim a name for the module and mark it for import.
const path = this.jsxImportSource + importPathSuffix;
if (!this.cjsAutomaticModuleNameResolutions[path]) {
this.cjsAutomaticModuleNameResolutions[path] =
this.importProcessor.getFreeIdentifierForPath(path);
}
return `${this.cjsAutomaticModuleNameResolutions[path]}.${funcName}`;
} else {
// ESM mode: claim a name for this function and add it to the names that
// should be auto-imported when the prefix is generated.
if (!this.esmAutomaticImportNameResolutions[funcName]) {
this.esmAutomaticImportNameResolutions[funcName] = this.nameManager.claimFreeName(
`_${funcName}`,
);
}
return this.esmAutomaticImportNameResolutions[funcName];
}
}
/**
* Process the first part of a tag, before any props.
*/
processTagIntro() {
// Walk forward until we see one of these patterns:
// jsxName to start the first prop, preceded by another jsxName to end the tag name.
// jsxName to start the first prop, preceded by greaterThan to end the type argument.
// [open brace] to start the first prop.
// [jsxTagEnd] to end the open-tag.
// [slash, jsxTagEnd] to end the self-closing tag.
let introEnd = this.tokens.currentIndex() + 1;
while (
this.tokens.tokens[introEnd].isType ||
(!this.tokens.matches2AtIndex(introEnd - 1, _types.TokenType.jsxName, _types.TokenType.jsxName) &&
!this.tokens.matches2AtIndex(introEnd - 1, _types.TokenType.greaterThan, _types.TokenType.jsxName) &&
!this.tokens.matches1AtIndex(introEnd, _types.TokenType.braceL) &&
!this.tokens.matches1AtIndex(introEnd, _types.TokenType.jsxTagEnd) &&
!this.tokens.matches2AtIndex(introEnd, _types.TokenType.slash, _types.TokenType.jsxTagEnd))
) {
introEnd++;
}
if (introEnd === this.tokens.currentIndex() + 1) {
const tagName = this.tokens.identifierName();
if (startsWithLowerCase(tagName)) {
this.tokens.replaceToken(`'${tagName}'`);
}
}
while (this.tokens.currentIndex() < introEnd) {
this.rootTransformer.processToken();
}
}
/**
* Starting at the beginning of the props, add the props argument to
* React.createElement, including the comma before it.
*/
processPropsObjectWithDevInfo(elementLocationCode) {
const devProps = this.options.production
? ""
: `__self: this, __source: ${this.getDevSource(elementLocationCode)}`;
if (!this.tokens.matches1(_types.TokenType.jsxName) && !this.tokens.matches1(_types.TokenType.braceL)) {
if (devProps) {
this.tokens.appendCode(`, {${devProps}}`);
} else {
this.tokens.appendCode(`, null`);
}
return;
}
this.tokens.appendCode(`, {`);
this.processProps(false);
if (devProps) {
this.tokens.appendCode(` ${devProps}}`);
} else {
this.tokens.appendCode("}");
}
}
/**
* Transform the core part of the props, assuming that a { has already been
* inserted before us and that a } will be inserted after us.
*
* If extractKeyCode is true (i.e. when using any jsx... function), any prop
* named "key" has its code captured and returned rather than being emitted to
* the output code. This shifts line numbers, and emitting the code later will
* correct line numbers again. If no key is found or if extractKeyCode is
* false, this function returns null.
*/
processProps(extractKeyCode) {
let keyCode = null;
while (true) {
if (this.tokens.matches2(_types.TokenType.jsxName, _types.TokenType.eq)) {
// This is a regular key={value} or key="value" prop.
const propName = this.tokens.identifierName();
if (extractKeyCode && propName === "key") {
if (keyCode !== null) {
// The props list has multiple keys. Different implementations are
// inconsistent about what to do here: as of this writing, Babel and
// swc keep the *last* key and completely remove the rest, while
// TypeScript uses the *first* key and leaves the others as regular
// props. The React team collaborated with Babel on the
// implementation of this behavior, so presumably the Babel behavior
// is the one to use.
// Since we won't ever be emitting the previous key code, we need to
// at least emit its newlines here so that the line numbers match up
// in the long run.
this.tokens.appendCode(keyCode.replace(/[^\n]/g, ""));
}
// key
this.tokens.removeToken();
// =
this.tokens.removeToken();
const snapshot = this.tokens.snapshot();
this.processPropValue();
keyCode = this.tokens.dangerouslyGetAndRemoveCodeSinceSnapshot(snapshot);
// Don't add a comma
continue;
} else {
this.processPropName(propName);
this.tokens.replaceToken(": ");
this.processPropValue();
}
} else if (this.tokens.matches1(_types.TokenType.jsxName)) {
// This is a shorthand prop like <input disabled />.
const propName = this.tokens.identifierName();
this.processPropName(propName);
this.tokens.appendCode(": true");
} else if (this.tokens.matches1(_types.TokenType.braceL)) {
// This is prop spread, like <div {...getProps()}>, which we can pass
// through fairly directly as an object spread.
this.tokens.replaceToken("");
this.rootTransformer.processBalancedCode();
this.tokens.replaceToken("");
} else {
break;
}
this.tokens.appendCode(",");
}
return keyCode;
}
processPropName(propName) {
if (propName.includes("-")) {
this.tokens.replaceToken(`'${propName}'`);
} else {
this.tokens.copyToken();
}
}
processPropValue() {
if (this.tokens.matches1(_types.TokenType.braceL)) {
this.tokens.replaceToken("");
this.rootTransformer.processBalancedCode();
this.tokens.replaceToken("");
} else if (this.tokens.matches1(_types.TokenType.jsxTagStart)) {
this.processJSXTag();
} else {
this.processStringPropValue();
}
}
processStringPropValue() {
const token = this.tokens.currentToken();
const valueCode = this.tokens.code.slice(token.start + 1, token.end - 1);
const replacementCode = formatJSXTextReplacement(valueCode);
const literalCode = formatJSXStringValueLiteral(valueCode);
this.tokens.replaceToken(literalCode + replacementCode);
}
/**
* Starting in the middle of the props object literal, produce an additional
* prop for the children and close the object literal.
*/
processAutomaticChildrenAndEndProps(jsxRole) {
if (jsxRole === _tokenizer.JSXRole.StaticChildren) {
this.tokens.appendCode(" children: [");
this.processChildren(false);
this.tokens.appendCode("]}");
} else {
// The parser information tells us whether we will see a real child or if
// all remaining children (if any) will resolve to empty. If there are no
// non-empty children, don't emit a children prop at all, but still
// process children so that we properly transform the code into nothing.
if (jsxRole === _tokenizer.JSXRole.OneChild) {
this.tokens.appendCode(" children: ");
}
this.processChildren(false);
this.tokens.appendCode("}");
}
}
/**
* Transform children into a comma-separated list, which will be either
* arguments to createElement or array elements of a children prop.
*/
processChildren(needsInitialComma) {
let needsComma = needsInitialComma;
while (true) {
if (this.tokens.matches2(_types.TokenType.jsxTagStart, _types.TokenType.slash)) {
// Closing tag, so no more children.
return;
}
let didEmitElement = false;
if (this.tokens.matches1(_types.TokenType.braceL)) {
if (this.tokens.matches2(_types.TokenType.braceL, _types.TokenType.braceR)) {
// Empty interpolations and comment-only interpolations are allowed
// and don't create an extra child arg.
this.tokens.replaceToken("");
this.tokens.replaceToken("");
} else {
// Interpolated expression.
this.tokens.replaceToken(needsComma ? ", " : "");
this.rootTransformer.processBalancedCode();
this.tokens.replaceToken("");
didEmitElement = true;
}
} else if (this.tokens.matches1(_types.TokenType.jsxTagStart)) {
// Child JSX element
this.tokens.appendCode(needsComma ? ", " : "");
this.processJSXTag();
didEmitElement = true;
} else if (this.tokens.matches1(_types.TokenType.jsxText) || this.tokens.matches1(_types.TokenType.jsxEmptyText)) {
didEmitElement = this.processChildTextElement(needsComma);
} else {
throw new Error("Unexpected token when processing JSX children.");
}
if (didEmitElement) {
needsComma = true;
}
}
}
/**
* Turn a JSX text element into a string literal, or nothing at all if the JSX
* text resolves to the empty string.
*
* Returns true if a string literal is emitted, false otherwise.
*/
processChildTextElement(needsComma) {
const token = this.tokens.currentToken();
const valueCode = this.tokens.code.slice(token.start, token.end);
const replacementCode = formatJSXTextReplacement(valueCode);
const literalCode = formatJSXTextLiteral(valueCode);
if (literalCode === '""') {
this.tokens.replaceToken(replacementCode);
return false;
} else {
this.tokens.replaceToken(`${needsComma ? ", " : ""}${literalCode}${replacementCode}`);
return true;
}
}
getDevSource(elementLocationCode) {
return `{fileName: ${this.getFilenameVarName()}, ${elementLocationCode}}`;
}
getFilenameVarName() {
if (!this.filenameVarName) {
this.filenameVarName = this.nameManager.claimFreeName("_jsxFileName");
}
return this.filenameVarName;
}
} exports.default = JSXTransformer;
/**
* Spec for identifiers: https://tc39.github.io/ecma262/#prod-IdentifierStart.
*
* Really only treat anything starting with a-z as tag names. `_`, `$`, `é`
* should be treated as component names
*/
function startsWithLowerCase(s) {
const firstChar = s.charCodeAt(0);
return firstChar >= _charcodes.charCodes.lowercaseA && firstChar <= _charcodes.charCodes.lowercaseZ;
} exports.startsWithLowerCase = startsWithLowerCase;
/**
* Turn the given jsxText string into a JS string literal. Leading and trailing
* whitespace on lines is removed, except immediately after the open-tag and
* before the close-tag. Empty lines are completely removed, and spaces are
* added between lines after that.
*
* We use JSON.stringify to introduce escape characters as necessary, and trim
* the start and end of each line and remove blank lines.
*/
function formatJSXTextLiteral(text) {
let result = "";
let whitespace = "";
let isInInitialLineWhitespace = false;
let seenNonWhitespace = false;
for (let i = 0; i < text.length; i++) {
const c = text[i];
if (c === " " || c === "\t" || c === "\r") {
if (!isInInitialLineWhitespace) {
whitespace += c;
}
} else if (c === "\n") {
whitespace = "";
isInInitialLineWhitespace = true;
} else {
if (seenNonWhitespace && isInInitialLineWhitespace) {
result += " ";
}
result += whitespace;
whitespace = "";
if (c === "&") {
const {entity, newI} = processEntity(text, i + 1);
i = newI - 1;
result += entity;
} else {
result += c;
}
seenNonWhitespace = true;
isInInitialLineWhitespace = false;
}
}
if (!isInInitialLineWhitespace) {
result += whitespace;
}
return JSON.stringify(result);
}
/**
* Produce the code that should be printed after the JSX text string literal,
* with most content removed, but all newlines preserved and all spacing at the
* end preserved.
*/
function formatJSXTextReplacement(text) {
let numNewlines = 0;
let numSpaces = 0;
for (const c of text) {
if (c === "\n") {
numNewlines++;
numSpaces = 0;
} else if (c === " ") {
numSpaces++;
}
}
return "\n".repeat(numNewlines) + " ".repeat(numSpaces);
}
/**
* Format a string in the value position of a JSX prop.
*
* Use the same implementation as convertAttribute from
* babel-helper-builder-react-jsx.
*/
function formatJSXStringValueLiteral(text) {
let result = "";
for (let i = 0; i < text.length; i++) {
const c = text[i];
if (c === "\n") {
if (/\s/.test(text[i + 1])) {
result += " ";
while (i < text.length && /\s/.test(text[i + 1])) {
i++;
}
} else {
result += "\n";
}
} else if (c === "&") {
const {entity, newI} = processEntity(text, i + 1);
result += entity;
i = newI - 1;
} else {
result += c;
}
}
return JSON.stringify(result);
}
/**
* Starting at a &, see if there's an HTML entity (specified by name, decimal
* char code, or hex char code) and return it if so.
*
* Modified from jsxReadString in babel-parser.
*/
function processEntity(text, indexAfterAmpersand) {
let str = "";
let count = 0;
let entity;
let i = indexAfterAmpersand;
if (text[i] === "#") {
let radix = 10;
i++;
let numStart;
if (text[i] === "x") {
radix = 16;
i++;
numStart = i;
while (i < text.length && isHexDigit(text.charCodeAt(i))) {
i++;
}
} else {
numStart = i;
while (i < text.length && isDecimalDigit(text.charCodeAt(i))) {
i++;
}
}
if (text[i] === ";") {
const numStr = text.slice(numStart, i);
if (numStr) {
i++;
entity = String.fromCodePoint(parseInt(numStr, radix));
}
}
} else {
while (i < text.length && count++ < 10) {
const ch = text[i];
i++;
if (ch === ";") {
entity = _xhtml2.default.get(str);
break;
}
str += ch;
}
}
if (!entity) {
return {entity: "&", newI: indexAfterAmpersand};
}
return {entity, newI: i};
}
function isDecimalDigit(code) {
return code >= _charcodes.charCodes.digit0 && code <= _charcodes.charCodes.digit9;
}
function isHexDigit(code) {
return (
(code >= _charcodes.charCodes.digit0 && code <= _charcodes.charCodes.digit9) ||
(code >= _charcodes.charCodes.lowercaseA && code <= _charcodes.charCodes.lowercaseF) ||
(code >= _charcodes.charCodes.uppercaseA && code <= _charcodes.charCodes.uppercaseF)
);
}
@@ -0,0 +1,28 @@
import toString from './toString.js';
/**
* Converts `string`, as a whole, to upper case just like
* [String#toUpperCase](https://mdn.io/toUpperCase).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the upper cased string.
* @example
*
* _.toUpper('--foo-bar--');
* // => '--FOO-BAR--'
*
* _.toUpper('fooBar');
* // => 'FOOBAR'
*
* _.toUpper('__foo_bar__');
* // => '__FOO_BAR__'
*/
function toUpper(value) {
return toString(value).toUpperCase();
}
export default toUpper;
@@ -0,0 +1,48 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {ReactNode} from 'react';
export type LabelPosition = 'top' | 'side';
export type Alignment = 'start' | 'end';
export type NecessityIndicator = 'icon' | 'label';
export interface LabelableProps {
/** The content to display as the label. */
label?: ReactNode
}
export interface SpectrumLabelableProps extends LabelableProps {
/**
* The label's overall position relative to the element it is labeling.
* @default 'top'
*/
labelPosition?: LabelPosition,
/**
* The label's horizontal alignment relative to the element it is labeling.
* @default 'start'
*/
labelAlign?: Alignment,
/**
* Whether the required state should be shown as an icon or text.
* @default 'icon'
*/
necessityIndicator?: NecessityIndicator,
/**
* Whether the label is labeling a required field or group.
*/
isRequired?: boolean,
/**
* A ContextualHelp element to place next to the label.
*/
contextualHelp?: ReactNode
}
@@ -0,0 +1,107 @@
{
"name": "micromark-extension-gfm",
"version": "3.0.0",
"description": "micromark extension to support GFM (GitHub Flavored Markdown)",
"license": "MIT",
"keywords": [
"micromark",
"micromark-extension",
"table",
"strikethrough",
"tasklist",
"autolink",
"footnote",
"tagfilter",
"github",
"gfm",
"markdown",
"unified"
],
"repository": "micromark/micromark-extension-gfm",
"bugs": "https://github.com/micromark/micromark-extension-gfm/issues",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
},
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"sideEffects": false,
"type": "module",
"exports": "./index.js",
"files": [
"index.d.ts",
"index.js"
],
"dependencies": {
"micromark-extension-gfm-autolink-literal": "^2.0.0",
"micromark-extension-gfm-footnote": "^2.0.0",
"micromark-extension-gfm-strikethrough": "^2.0.0",
"micromark-extension-gfm-table": "^2.0.0",
"micromark-extension-gfm-tagfilter": "^2.0.0",
"micromark-extension-gfm-task-list-item": "^2.0.0",
"micromark-util-combine-extensions": "^2.0.0",
"micromark-util-types": "^2.0.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"c8": "^8.0.0",
"create-gfm-fixtures": "^1.0.0",
"hast-util-from-html": "^1.0.0",
"hast-util-select": "^5.0.0",
"hast-util-to-text": "^3.0.0",
"micromark": "^4.0.0",
"prettier": "^2.0.0",
"rehype": "^12.0.0",
"rehype-sort-attributes": "^4.0.0",
"remark-cli": "^11.0.0",
"remark-preset-wooorm": "^9.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"undici": "^5.0.0",
"xo": "^0.54.0"
},
"scripts": {
"prepack": "npm run build && npm run format",
"build": "tsc --build --clean && tsc --build && type-coverage",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"test-api-prod": "node --conditions production test/index.js",
"test-api-dev": "node --conditions development test/index.js",
"test-api": "npm run test-api-dev && npm run test-api-prod",
"test-coverage": "c8 --100 --reporter lcov npm run test-api",
"test": "npm run build && npm run format && npm run test-coverage"
},
"prettier": {
"bracketSpacing": false,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false
},
"remarkConfig": {
"plugins": [
"remark-preset-wooorm"
]
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
"ignoreCatch": true,
"strict": true
},
"xo": {
"prettier": true,
"overrides": [
{
"files": [
"{test,script}/**/*.js"
],
"rules": {
"no-await-in-loop": "off"
}
}
]
}
}
@@ -0,0 +1,9 @@
/**
* Configurable ways to encode characters as decimal references.
*
* @param {number} code
* @param {number} next
* @param {boolean|undefined} omit
* @returns {string}
*/
export function toDecimal(code: number, next: number, omit: boolean | undefined): string;
@@ -0,0 +1,6 @@
module.exports = {
"breadcrumbs": `Nar\u{161}ymo kelias`
};
//# sourceMappingURL=lt-LT.main.js.map
@@ -0,0 +1,224 @@
/**
* @fileoverview Rule to flag unnecessary bind calls
* @author Bence Dányi <bence@danyi.me>
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const SIDE_EFFECT_FREE_NODE_TYPES = new Set([
"Literal",
"Identifier",
"ThisExpression",
"FunctionExpression",
]);
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow unnecessary calls to `.bind()`",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-extra-bind",
},
schema: [],
fixable: "code",
messages: {
unexpected: "The function binding is unnecessary.",
},
},
create(context) {
const sourceCode = context.sourceCode;
let scopeInfo = null;
/**
* Checks if a node is free of side effects.
*
* This check is stricter than it needs to be, in order to keep the implementation simple.
* @param {ASTNode} node A node to check.
* @returns {boolean} True if the node is known to be side-effect free, false otherwise.
*/
function isSideEffectFree(node) {
return SIDE_EFFECT_FREE_NODE_TYPES.has(node.type);
}
/**
* Reports a given function node.
* @param {ASTNode} node A node to report. This is a FunctionExpression or
* an ArrowFunctionExpression.
* @returns {void}
*/
function report(node) {
const memberNode = node.parent;
const callNode =
memberNode.parent.type === "ChainExpression"
? memberNode.parent.parent
: memberNode.parent;
context.report({
node: callNode,
messageId: "unexpected",
loc: memberNode.property.loc,
fix(fixer) {
if (!isSideEffectFree(callNode.arguments[0])) {
return null;
}
/*
* The list of the first/last token pair of a removal range.
* This is two parts because closing parentheses may exist between the method name and arguments.
* E.g. `(function(){}.bind ) (obj)`
* ^^^^^ ^^^^^ < removal ranges
* E.g. `(function(){}?.['bind'] ) ?.(obj)`
* ^^^^^^^^^^ ^^^^^^^ < removal ranges
*/
const tokenPairs = [
[
// `.`, `?.`, or `[` token.
sourceCode.getTokenAfter(
memberNode.object,
astUtils.isNotClosingParenToken,
),
// property name or `]` token.
sourceCode.getLastToken(memberNode),
],
[
// `?.` or `(` token of arguments.
sourceCode.getTokenAfter(
memberNode,
astUtils.isNotClosingParenToken,
),
// `)` token of arguments.
sourceCode.getLastToken(callNode),
],
];
const firstTokenToRemove = tokenPairs[0][0];
const lastTokenToRemove = tokenPairs[1][1];
if (
sourceCode.commentsExistBetween(
firstTokenToRemove,
lastTokenToRemove,
)
) {
return null;
}
return tokenPairs.map(([start, end]) =>
fixer.removeRange([start.range[0], end.range[1]]),
);
},
});
}
/**
* Checks whether or not a given function node is the callee of `.bind()`
* method.
*
* e.g. `(function() {}.bind(foo))`
* @param {ASTNode} node A node to report. This is a FunctionExpression or
* an ArrowFunctionExpression.
* @returns {boolean} `true` if the node is the callee of `.bind()` method.
*/
function isCalleeOfBindMethod(node) {
if (!astUtils.isSpecificMemberAccess(node.parent, null, "bind")) {
return false;
}
// The node of `*.bind` member access.
const bindNode =
node.parent.parent.type === "ChainExpression"
? node.parent.parent
: node.parent;
return (
bindNode.parent.type === "CallExpression" &&
bindNode.parent.callee === bindNode &&
bindNode.parent.arguments.length === 1 &&
bindNode.parent.arguments[0].type !== "SpreadElement"
);
}
/**
* Adds a scope information object to the stack.
* @param {ASTNode} node A node to add. This node is a FunctionExpression
* or a FunctionDeclaration node.
* @returns {void}
*/
function enterFunction(node) {
scopeInfo = {
isBound: isCalleeOfBindMethod(node),
thisFound: false,
upper: scopeInfo,
};
}
/**
* Removes the scope information object from the top of the stack.
* At the same time, this reports the function node if the function has
* `.bind()` and the `this` keywords found.
* @param {ASTNode} node A node to remove. This node is a
* FunctionExpression or a FunctionDeclaration node.
* @returns {void}
*/
function exitFunction(node) {
if (scopeInfo.isBound && !scopeInfo.thisFound) {
report(node);
}
scopeInfo = scopeInfo.upper;
}
/**
* Reports a given arrow function if the function is callee of `.bind()`
* method.
* @param {ASTNode} node A node to report. This node is an
* ArrowFunctionExpression.
* @returns {void}
*/
function exitArrowFunction(node) {
if (isCalleeOfBindMethod(node)) {
report(node);
}
}
/**
* Set the mark as the `this` keyword was found in this scope.
* @returns {void}
*/
function markAsThisFound() {
if (scopeInfo) {
scopeInfo.thisFound = true;
}
}
return {
"ArrowFunctionExpression:exit": exitArrowFunction,
FunctionDeclaration: enterFunction,
"FunctionDeclaration:exit": exitFunction,
FunctionExpression: enterFunction,
"FunctionExpression:exit": exitFunction,
ThisExpression: markAsThisFound,
};
},
};
@@ -0,0 +1,47 @@
{
"name": "@types/mdast",
"version": "4.0.4",
"description": "TypeScript definitions for mdast",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast",
"license": "MIT",
"contributors": [
{
"name": "Christian Murphy",
"githubUsername": "ChristianMurphy",
"url": "https://github.com/ChristianMurphy"
},
{
"name": "Jun Lu",
"githubUsername": "lujun2",
"url": "https://github.com/lujun2"
},
{
"name": "Remco Haszing",
"githubUsername": "remcohaszing",
"url": "https://github.com/remcohaszing"
},
{
"name": "Titus Wormer",
"githubUsername": "wooorm",
"url": "https://github.com/wooorm"
},
{
"name": "Remco Haszing",
"githubUsername": "remcohaszing",
"url": "https://github.com/remcohaszing"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/mdast"
},
"scripts": {},
"dependencies": {
"@types/unist": "*"
},
"typesPublisherContentHash": "1599d3ca45533e9d9248231c90843306b49c07fe13ad94ebf7345da44d8fd4bd",
"typeScriptVersion": "4.7"
}
@@ -0,0 +1 @@
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AA0BM,MAAM;IAeX;;GAEC,GACD,IAAI,gBAA+B;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa;IACjC;IAEA;;GAEC,GACD,IAAI,yBAAkC;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,sBAAsB;IAC1C;IAEA;;GAEC,GACD,IAAI,oBAAuC;QACzC,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB;IACrC;IAEA;;GAEC,GACD,qBAAqB,iBAAoC,EAAQ;QAC/D,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC;IAClC;IAEA;;GAEC,GACD,IAAI,YAAqB;QACvB,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS;IAC7B;IAEA;;GAEC,GACD,WAAW,SAAkB,EAAQ;QACnC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;IACxB;IAEA;;GAEC,GACD,IAAI,aAAyB;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU;IAC9B;IAEA,6EAA6E,GAC7E,IAAI,qBAA2C;QAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,kBAAkB;IACtC;IAEA;;GAEC,GACD,cAAc,GAAe,EAAE,kBAAkC,EAAQ;QACvE,IAAI,OAAO,QAAQ,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,MACzC,IAAI,CAAC,KAAK,CAAC,aAAa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QACzB;QAGF,IAAI,YAAY,IAAI,CAAC,MAAM,CAAC;QAC5B,IAAI,aAAa,MACf;QAGF,IAAI,YAAY,IAAI,CAAC,aAAa,CAAC,aACLine truncated
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2024_sharedmemory: LibDefinition;
@@ -0,0 +1,44 @@
var baseFindKey = require('./_baseFindKey'),
baseForOwn = require('./_baseForOwn'),
baseIteratee = require('./_baseIteratee');
/**
* This method is like `_.find` except that it returns the key of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Object
* @param {Object} object The object to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {string|undefined} Returns the key of the matched element,
* else `undefined`.
* @example
*
* var users = {
* 'barney': { 'age': 36, 'active': true },
* 'fred': { 'age': 40, 'active': false },
* 'pebbles': { 'age': 1, 'active': true }
* };
*
* _.findKey(users, function(o) { return o.age < 40; });
* // => 'barney' (iteration order is not guaranteed)
*
* // The `_.matches` iteratee shorthand.
* _.findKey(users, { 'age': 1, 'active': true });
* // => 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findKey(users, ['active', false]);
* // => 'fred'
*
* // The `_.property` iteratee shorthand.
* _.findKey(users, 'active');
* // => 'barney'
*/
function findKey(object, predicate) {
return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn);
}
module.exports = findKey;
@@ -0,0 +1,18 @@
'use strict'
const os = require('os');
const path = require('path');
const spawn = require('child_process').spawn;
const gypArgs = ['rebuild'];
if (process.env.NODE_PTY_DEBUG) {
gypArgs.push('--debug');
}
const gypProcess = spawn(os.platform() === 'win32' ? 'node-gyp.cmd' : 'node-gyp', gypArgs, {
cwd: path.join(__dirname, '..'),
stdio: 'inherit'
});
gypProcess.on('exit', function (code) {
process.exit(code);
});
@@ -0,0 +1,210 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-invalid-void-type',
meta: {
type: 'problem',
docs: {
description: 'Disallow `void` type outside of generic or return types',
recommended: 'strict',
},
messages: {
invalidVoidForGeneric: '{{ generic }} may not have void as a type argument.',
invalidVoidNotReturn: 'void is only valid as a return type.',
invalidVoidNotReturnOrGeneric: 'void is only valid as a return type or generic type argument.',
invalidVoidNotReturnOrThisParam: 'void is only valid as return type or type of `this` parameter.',
invalidVoidNotReturnOrThisParamOrGeneric: 'void is only valid as a return type or generic type argument or the type of a `this` parameter.',
invalidVoidUnionConstituent: 'void is not valid as a constituent in a union type',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allowAsThisParameter: {
type: 'boolean',
description: 'Whether a `this` parameter of a function may be `void`.',
},
allowInGenericTypeArguments: {
description: 'Whether `void` can be used as a valid value for generic type parameters.',
oneOf: [
{
type: 'boolean',
description: 'Whether `void` can be used as a valid value for all generic type parameters.',
},
{
type: 'array',
description: 'Allowlist of types that may accept `void` as a generic type parameter.',
items: { type: 'string' },
minItems: 1,
},
],
},
},
},
],
},
defaultOptions: [
{ allowAsThisParameter: false, allowInGenericTypeArguments: true },
],
create(context, [{ allowAsThisParameter, allowInGenericTypeArguments }]) {
const validParents = [
utils_1.AST_NODE_TYPES.TSTypeAnnotation, //
];
const invalidGrandParents = [
utils_1.AST_NODE_TYPES.TSPropertySignature,
utils_1.AST_NODE_TYPES.CallExpression,
utils_1.AST_NODE_TYPES.PropertyDefinition,
utils_1.AST_NODE_TYPES.AccessorProperty,
utils_1.AST_NODE_TYPES.Identifier,
];
const validUnionMembers = [
utils_1.AST_NODE_TYPES.TSVoidKeyword,
utils_1.AST_NODE_TYPES.TSNeverKeyword,
];
if (allowInGenericTypeArguments === true) {
validParents.push(utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation);
}
/**
* @brief check if the given void keyword is used as a valid generic type
*
* reports if the type parametrized by void is not in the allowlist, or
* allowInGenericTypeArguments is false.
* no-op if the given void keyword is not used as generic type
*/
function checkGenericTypeArgument(node) {
// only matches T<..., void, ...>
// extra check for precaution
/* istanbul ignore next */
if (node.parent.type !== utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation ||
node.parent.parent.type !== utils_1.AST_NODE_TYPES.TSTypeReference) {
return;
}
// check allowlist
if (Array.isArray(allowInGenericTypeArguments)) {
const fullyQualifiedName = context.sourceCode
.getText(node.parent.parent.typeName)
.replaceAll(' ', '');
if (!allowInGenericTypeArguments
.map(s => s.replaceAll(' ', ''))
.includes(fullyQualifiedName)) {
context.report({
node,
messageId: 'invalidVoidForGeneric',
data: { generic: fullyQualifiedName },
});
}
return;
}
if (!allowInGenericTypeArguments) {
context.report({
node,
messageId: allowAsThisParameter
? 'invalidVoidNotReturnOrThisParam'
: 'invalidVoidNotReturn',
});
}
}
/**
* @brief checks if the generic type parameter defaults to void
*/
function checkDefaultVoid(node, parentNode) {
if (parentNode.default !== node) {
context.report({
node,
messageId: getNotReturnOrGenericMessageId(node),
});
}
}
/**
* @brief checks that a union containing void is valid
* @return true if every member of the union is specified as a valid type in
* validUnionMembers, or is a valid generic type parametrized by void
*/
function isValidUnionType(node) {
return node.types.every(member => validUnionMembers.includes(member.type) ||
// allows any T<..., void, ...> here, checked by checkGenericTypeArgument
(member.type === utils_1.AST_NODE_TYPES.TSTypeReference &&
member.typeArguments?.type ===
utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation &&
member.typeArguments.params
.map(param => param.type)
.includes(utils_1.AST_NODE_TYPES.TSVoidKeyword)));
}
return {
TSVoidKeyword(node) {
// checks T<..., void, ...> against specification of allowInGenericArguments option
if (node.parent.type === utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation &&
node.parent.parent.type === utils_1.AST_NODE_TYPES.TSTypeReference) {
checkGenericTypeArgument(node);
return;
}
// allow <T = void> if allowInGenericTypeArguments is specified, and report if the generic type parameter extends void
if (allowInGenericTypeArguments &&
node.parent.type === utils_1.AST_NODE_TYPES.TSTypeParameter &&
node.parent.default?.type === utils_1.AST_NODE_TYPES.TSVoidKeyword) {
checkDefaultVoid(node, node.parent);
return;
}
// union w/ void must contain types from validUnionMembers, or a valid generic void type
if (node.parent.type === utils_1.AST_NODE_TYPES.TSUnionType &&
isValidUnionType(node.parent)) {
return;
}
// using `void` as part of the return type of function overloading implementation
if (node.parent.type === utils_1.AST_NODE_TYPES.TSUnionType) {
const declaringFunction = getParentFunctionDeclarationNode(node.parent);
if (declaringFunction &&
(0, util_1.hasOverloadSignatures)(declaringFunction, context)) {
return;
}
}
// this parameter is ok to be void.
if (allowAsThisParameter &&
node.parent.type === utils_1.AST_NODE_TYPES.TSTypeAnnotation &&
node.parent.parent.type === utils_1.AST_NODE_TYPES.Identifier &&
node.parent.parent.name === 'this') {
return;
}
// default cases
if (validParents.includes(node.parent.type) &&
// https://github.com/typescript-eslint/typescript-eslint/issues/6225
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
!invalidGrandParents.includes(node.parent.parent.type)) {
return;
}
context.report({
node,
messageId: allowInGenericTypeArguments && allowAsThisParameter
? 'invalidVoidNotReturnOrThisParamOrGeneric'
: allowInGenericTypeArguments
? getNotReturnOrGenericMessageId(node)
: allowAsThisParameter
? 'invalidVoidNotReturnOrThisParam'
: 'invalidVoidNotReturn',
});
},
};
},
});
function getNotReturnOrGenericMessageId(node) {
return node.parent.type === utils_1.AST_NODE_TYPES.TSUnionType
? 'invalidVoidUnionConstituent'
: 'invalidVoidNotReturnOrGeneric';
}
function getParentFunctionDeclarationNode(node) {
let current = node.parent;
while (current) {
if (current.type === utils_1.AST_NODE_TYPES.FunctionDeclaration) {
return current;
}
if (current.type === utils_1.AST_NODE_TYPES.MethodDefinition &&
current.value.body != null) {
return current;
}
current = current.parent;
}
return null;
}
@@ -0,0 +1,9 @@
import { velocityPerSecond } from 'motion-utils';
const velocitySampleDuration = 5; // ms
function calcGeneratorVelocity(resolveValue, t, current) {
const prevT = Math.max(t - velocitySampleDuration, 0);
return velocityPerSecond(current - resolveValue(prevT), t - prevT);
}
export { calcGeneratorVelocity };
@@ -0,0 +1,218 @@
import { Collection, DisabledBehavior, FocusStrategy, Key, LongPressEvent, Node, PressEvent, Selection, SelectionBehavior, SelectionMode, MultipleSelection, LayoutDelegate } from "@react-types/shared";
export interface FocusState {
/** Whether the collection is currently focused. */
readonly isFocused: boolean;
/** Sets whether the collection is focused. */
setFocused(isFocused: boolean): void;
/** The current focused key in the collection. */
readonly focusedKey: Key | null;
/** Whether the first or last child of the focused key should receive focus. */
readonly childFocusStrategy: FocusStrategy | null;
/** Sets the focused key, and optionally, whether the first or last child of that key should receive focus. */
setFocusedKey(key: Key | null, child?: FocusStrategy): void;
}
export interface SingleSelectionState extends FocusState {
/** Whether the collection allows empty selection. */
readonly disallowEmptySelection?: boolean;
/** The currently selected key in the collection. */
readonly selectedKey: Key;
/** Sets the selected key in the collection. */
setSelectedKey(key: Key | null): void;
}
export interface MultipleSelectionState extends FocusState {
/** The type of selection that is allowed in the collection. */
readonly selectionMode: SelectionMode;
/** The selection behavior for the collection. */
readonly selectionBehavior: SelectionBehavior;
/** Sets the selection behavior for the collection. */
setSelectionBehavior(selectionBehavior: SelectionBehavior): void;
/** Whether the collection allows empty selection. */
readonly disallowEmptySelection: boolean;
/** The currently selected keys in the collection. */
readonly selectedKeys: Selection;
/** Sets the selected keys in the collection. */
setSelectedKeys(keys: Selection): void;
/** The currently disabled keys in the collection. */
readonly disabledKeys: Set<Key>;
/** Whether `disabledKeys` applies to selection, actions, or both. */
readonly disabledBehavior: DisabledBehavior;
}
export interface MultipleSelectionManager extends FocusState {
/** The type of selection that is allowed in the collection. */
readonly selectionMode: SelectionMode;
/** The selection behavior for the collection. */
readonly selectionBehavior: SelectionBehavior;
/** Whether the collection allows empty selection. */
readonly disallowEmptySelection?: boolean;
/** The currently selected keys in the collection. */
readonly selectedKeys: Set<Key>;
/** Whether the selection is empty. */
readonly isEmpty: boolean;
/** Whether all items in the collection are selected. */
readonly isSelectAll: boolean;
/** The first selected key in the collection. */
readonly firstSelectedKey: Key | null;
/** The last selected key in the collection. */
readonly lastSelectedKey: Key | null;
/** The currently disabled keys in the collection. */
readonly disabledKeys: Set<Key>;
/** Whether `disabledKeys` applies to selection, actions, or both. */
readonly disabledBehavior: DisabledBehavior;
/** Returns whether a key is selected. */
isSelected(key: Key): boolean;
/** Returns whether the current selection is equal to the given selection. */
isSelectionEqual(selection: Set<Key>): boolean;
/** Extends the selection to the given key. */
extendSelection(toKey: Key): void;
/** Toggles whether the given key is selected. */
toggleSelection(key: Key): void;
/** Replaces the selection with only the given key. */
replaceSelection(key: Key): void;
/** Replaces the selection with the given keys. */
setSelectedKeys(keys: Iterable<Key>): void;
/** Selects all items in the collection. */
selectAll(): void;
/** Removes all keys from the selection. */
clearSelection(): void;
/** Toggles between select all and an empty selection. */
toggleSelectAll(): void;
/**
* Toggles, replaces, or extends selection to the given key depending
* on the pointer event and collection's selection mode.
*/
select(key: Key, e?: PressEvent | LongPressEvent | PointerEvent): void;
/** Returns whether the given key can be selected. */
canSelectItem(key: Key): boolean;
/** Returns whether the given key is non-interactive, i.e. both selection and actions are disabled. */
isDisabled(key: Key): boolean;
/** Sets the selection behavior for the collection. */
setSelectionBehavior(selectionBehavior: SelectionBehavior): void;
/** Returns whether the given key is a hyperlink. */
isLink(key: Key): boolean;
/** Returns the props for the given item. */
getItemProps(key: Key): any;
/** The collection of nodes that the selection manager handles. */
collection: Collection<Node<unknown>>;
}
export interface MultipleSelectionStateProps extends MultipleSelection {
/** How multiple selection should behave in the collection. */
selectionBehavior?: SelectionBehavior;
/** Whether onSelectionChange should fire even if the new set of keys is the same as the last. */
allowDuplicateSelectionEvents?: boolean;
/** Whether `disabledKeys` applies to all interactions, or only selection. */
disabledBehavior?: DisabledBehavior;
}
/**
* Manages state for multiple selection and focus in a collection.
*/
export function useMultipleSelectionState(props: MultipleSelectionStateProps): MultipleSelectionState;
interface SelectionManagerOptions {
allowsCellSelection?: boolean;
layoutDelegate?: LayoutDelegate;
}
/**
* An interface for reading and updating multiple selection state.
*/
export class SelectionManager implements MultipleSelectionManager {
collection: Collection<Node<unknown>>;
constructor(collection: Collection<Node<unknown>>, state: MultipleSelectionState, options?: SelectionManagerOptions);
/**
* The type of selection that is allowed in the collection.
*/
get selectionMode(): SelectionMode;
/**
* Whether the collection allows empty selection.
*/
get disallowEmptySelection(): boolean;
/**
* The selection behavior for the collection.
*/
get selectionBehavior(): SelectionBehavior;
/**
* Sets the selection behavior for the collection.
*/
setSelectionBehavior(selectionBehavior: SelectionBehavior): void;
/**
* Whether the collection is currently focused.
*/
get isFocused(): boolean;
/**
* Sets whether the collection is focused.
*/
setFocused(isFocused: boolean): void;
/**
* The current focused key in the collection.
*/
get focusedKey(): Key | null;
/** Whether the first or last child of the focused key should receive focus. */
get childFocusStrategy(): FocusStrategy | null;
/**
* Sets the focused key.
*/
setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void;
/**
* The currently selected keys in the collection.
*/
get selectedKeys(): Set<Key>;
/**
* The raw selection value for the collection.
* Either 'all' for select all, or a set of keys.
*/
get rawSelection(): Selection;
/**
* Returns whether a key is selected.
*/
isSelected(key: Key): boolean;
/**
* Whether the selection is empty.
*/
get isEmpty(): boolean;
/**
* Whether all items in the collection are selected.
*/
get isSelectAll(): boolean;
get firstSelectedKey(): Key | null;
get lastSelectedKey(): Key | null;
get disabledKeys(): Set<Key>;
get disabledBehavior(): DisabledBehavior;
/**
* Extends the selection to the given key.
*/
extendSelection(toKey: Key): void;
/**
* Toggles whether the given key is selected.
*/
toggleSelection(key: Key): void;
/**
* Replaces the selection with only the given key.
*/
replaceSelection(key: Key): void;
/**
* Replaces the selection with the given keys.
*/
setSelectedKeys(keys: Iterable<Key>): void;
/**
* Selects all items in the collection.
*/
selectAll(): void;
/**
* Removes all keys from the selection.
*/
clearSelection(): void;
/**
* Toggles between select all and an empty selection.
*/
toggleSelectAll(): void;
select(key: Key, e?: PressEvent | LongPressEvent | PointerEvent): void;
/**
* Returns whether the current selection is equal to the given selection.
*/
isSelectionEqual(selection: Set<Key>): boolean;
canSelectItem(key: Key): boolean;
isDisabled(key: Key): boolean;
isLink(key: Key): boolean;
getItemProps(key: Key): any;
withCollection(collection: Collection<Node<unknown>>): SelectionManager;
}
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Variable = void 0;
const VariableBase_1 = require("./VariableBase");
/**
* A Variable represents a locally scoped identifier. These include arguments to functions.
*/
class Variable extends VariableBase_1.VariableBase {
/**
* `true` if the variable is valid in a type context, false otherwise
* @public
*/
get isTypeVariable() {
if (this.defs.length === 0) {
// we don't statically know whether this is a type or a value
return true;
}
return this.defs.some(def => def.isTypeDefinition);
}
/**
* `true` if the variable is valid in a value context, false otherwise
* @public
*/
get isValueVariable() {
if (this.defs.length === 0) {
// we don't statically know whether this is a type or a value
return true;
}
return this.defs.some(def => def.isVariableDefinition);
}
}
exports.Variable = Variable;
@@ -0,0 +1,28 @@
'use strict';
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var DefinePropertyOrThrow = require('./DefinePropertyOrThrow');
var isPropertyKey = require('../helpers/isPropertyKey');
// https://262.ecma-international.org/13.0/#sec-createnonenumerabledatapropertyorthrow
module.exports = function CreateNonEnumerableDataPropertyOrThrow(O, P, V) {
if (!isObject(O)) {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!isPropertyKey(P)) {
throw new $TypeError('Assertion failed: P is not a Property Key');
}
var newDesc = {
'[[Configurable]]': true,
'[[Enumerable]]': false,
'[[Value]]': V,
'[[Writable]]': true
};
return DefinePropertyOrThrow(O, P, newDesc);
};
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,mEAAa,CAAC;IACzE,qBAAqB,CAAC,2UAAuD,CAAC;IAC9E,UAAU,CAAC,wDAAQ,CAAC;IACpB,eAAe,CAAC,qKAA2B,CAAC;IAC5C,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,uIAAqB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,6FAAe,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,2GAAiB,CAAC;QAAA,GAAG,CAAC,CAAC;IACvO,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,4CAAQ,CAAC;AAClD","sources":["packages/@react-aria/grid/intl/bg-BG.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} не е избран.\",\n \"longPressToSelect\": \"Натиснете и задръжте за да влезете в избирателен режим.\",\n \"select\": \"Изберете\",\n \"selectedAll\": \"Всички елементи са избрани.\",\n \"selectedCount\": \"{count, plural, =0 {Няма избрани елементи} one {# избран елемент} other {# избрани елементи}}.\",\n \"selectedItem\": \"{item} избран.\"\n}\n"],"names":[],"version":3,"file":"bg-BG.main.js.map"}
@@ -0,0 +1,3 @@
declare const _exports: import('eslint').Rule.RuleModule;
export = _exports;
//# sourceMappingURL=hook-use-state.d.ts.map
@@ -0,0 +1,38 @@
var root = require('./_root'),
stubFalse = require('./stubFalse');
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
/**
* Checks if `value` is a buffer.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
* @example
*
* _.isBuffer(new Buffer(2));
* // => true
*
* _.isBuffer(new Uint8Array(2));
* // => false
*/
var isBuffer = nativeIsBuffer || stubFalse;
module.exports = isBuffer;
@@ -0,0 +1,50 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return getAllConfigs;
}
});
const _configfull = /*#__PURE__*/ _interop_require_default(require("../../stubs/config.full.js"));
const _featureFlags = require("../featureFlags");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function getAllConfigs(config) {
var _config_presets;
const configs = ((_config_presets = config === null || config === void 0 ? void 0 : config.presets) !== null && _config_presets !== void 0 ? _config_presets : [
_configfull.default
]).slice().reverse().flatMap((preset)=>getAllConfigs(preset instanceof Function ? preset() : preset));
const features = {
// Add experimental configs here...
respectDefaultRingColorOpacity: {
theme: {
ringColor: ({ theme })=>({
DEFAULT: "#3b82f67f",
...theme("colors")
})
}
},
disableColorOpacityUtilitiesByDefault: {
corePlugins: {
backgroundOpacity: false,
borderOpacity: false,
divideOpacity: false,
placeholderOpacity: false,
ringOpacity: false,
textOpacity: false
}
}
};
const experimentals = Object.keys(features).filter((feature)=>(0, _featureFlags.flagEnabled)(config, feature)).map((feature)=>features[feature]);
return [
config,
...experimentals,
...configs
];
}
@@ -0,0 +1,332 @@
/**
* @fileoverview A class of the code path.
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const CodePathState = require("./code-path-state");
const IdGenerator = require("./id-generator");
//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------
/**
* A code path.
*/
class CodePath {
/**
* Creates a new instance.
* @param {Object} options Options for the function (see below).
* @param {string} options.id An identifier.
* @param {string} options.origin The type of code path origin.
* @param {CodePath|null} options.upper The code path of the upper function scope.
* @param {Function} options.onLooped A callback function to notify looping.
*/
constructor({ id, origin, upper, onLooped }) {
/**
* The identifier of this code path.
* Rules use it to store additional information of each rule.
* @type {string}
*/
this.id = id;
/**
* The reason that this code path was started. May be "program",
* "function", "class-field-initializer", or "class-static-block".
* @type {string}
*/
this.origin = origin;
/**
* The code path of the upper function scope.
* @type {CodePath|null}
*/
this.upper = upper;
/**
* The code paths of nested function scopes.
* @type {CodePath[]}
*/
this.childCodePaths = [];
// Initializes internal state.
Object.defineProperty(this, "internal", {
value: new CodePathState(new IdGenerator(`${id}_`), onLooped),
});
// Adds this into `childCodePaths` of `upper`.
if (upper) {
upper.childCodePaths.push(this);
}
}
/**
* Gets the state of a given code path.
* @param {CodePath} codePath A code path to get.
* @returns {CodePathState} The state of the code path.
*/
static getState(codePath) {
return codePath.internal;
}
/**
* The initial code path segment. This is the segment that is at the head
* of the code path.
* This is a passthrough to the underlying `CodePathState`.
* @type {CodePathSegment}
*/
get initialSegment() {
return this.internal.initialSegment;
}
/**
* Final code path segments. These are the terminal (tail) segments in the
* code path, which is the combination of `returnedSegments` and `thrownSegments`.
* All segments in this array are reachable.
* This is a passthrough to the underlying `CodePathState`.
* @type {CodePathSegment[]}
*/
get finalSegments() {
return this.internal.finalSegments;
}
/**
* Final code path segments that represent normal completion of the code path.
* For functions, this means both explicit `return` statements and implicit returns,
* such as the last reachable segment in a function that does not have an
* explicit `return` as this implicitly returns `undefined`. For scripts,
* modules, class field initializers, and class static blocks, this means
* all lines of code have been executed.
* These segments are also present in `finalSegments`.
* This is a passthrough to the underlying `CodePathState`.
* @type {CodePathSegment[]}
*/
get returnedSegments() {
return this.internal.returnedForkContext;
}
/**
* Final code path segments that represent `throw` statements.
* This is a passthrough to the underlying `CodePathState`.
* These segments are also present in `finalSegments`.
* @type {CodePathSegment[]}
*/
get thrownSegments() {
return this.internal.thrownForkContext;
}
/**
* Traverses all segments in this code path.
*
* codePath.traverseSegments((segment, controller) => {
* // do something.
* });
*
* This method enumerates segments in order from the head.
*
* The `controller` argument has two methods:
*
* - `skip()` - skips the following segments in this branch
* - `break()` - skips all following segments in the traversal
*
* A note on the parameters: the `options` argument is optional. This means
* the first argument might be an options object or the callback function.
* @param {Object} [optionsOrCallback] Optional first and last segments to traverse.
* @param {CodePathSegment} [optionsOrCallback.first] The first segment to traverse.
* @param {CodePathSegment} [optionsOrCallback.last] The last segment to traverse.
* @param {Function} callback A callback function.
* @returns {void}
*/
traverseSegments(optionsOrCallback, callback) {
// normalize the arguments into a callback and options
let resolvedOptions;
let resolvedCallback;
if (typeof optionsOrCallback === "function") {
resolvedCallback = optionsOrCallback;
resolvedOptions = {};
} else {
resolvedOptions = optionsOrCallback || {};
resolvedCallback = callback;
}
// determine where to start traversing from based on the options
const startSegment =
resolvedOptions.first || this.internal.initialSegment;
const lastSegment = resolvedOptions.last;
// set up initial location information
let record;
let index;
let end;
let segment = null;
// segments that have already been visited during traversal
const visited = new Set();
// tracks the traversal steps
const stack = [[startSegment, 0]];
// segments that have been skipped during traversal
const skipped = new Set();
// indicates if we exited early from the traversal
let broken = false;
/**
* Maintains traversal state.
*/
const controller = {
/**
* Skip the following segments in this branch.
* @returns {void}
*/
skip() {
skipped.add(segment);
},
/**
* Stop traversal completely - do not traverse to any
* other segments.
* @returns {void}
*/
break() {
broken = true;
},
};
/**
* Checks if a given previous segment has been visited.
* @param {CodePathSegment} prevSegment A previous segment to check.
* @returns {boolean} `true` if the segment has been visited.
*/
function isVisited(prevSegment) {
return (
visited.has(prevSegment) ||
segment.isLoopedPrevSegment(prevSegment)
);
}
/**
* Checks if a given previous segment has been skipped.
* @param {CodePathSegment} prevSegment A previous segment to check.
* @returns {boolean} `true` if the segment has been skipped.
*/
function isSkipped(prevSegment) {
return (
skipped.has(prevSegment) ||
segment.isLoopedPrevSegment(prevSegment)
);
}
// the traversal
while (stack.length > 0) {
/*
* This isn't a pure stack. We use the top record all the time
* but don't always pop it off. The record is popped only if
* one of the following is true:
*
* 1) We have already visited the segment.
* 2) We have not visited *all* of the previous segments.
* 3) We have traversed past the available next segments.
*
* Otherwise, we just read the value and sometimes modify the
* record as we traverse.
*/
record = stack.at(-1);
segment = record[0];
index = record[1];
if (index === 0) {
// Skip if this segment has been visited already.
if (visited.has(segment)) {
stack.pop();
continue;
}
// Skip if all previous segments have not been visited.
if (
segment !== startSegment &&
segment.prevSegments.length > 0 &&
!segment.prevSegments.every(isVisited)
) {
stack.pop();
continue;
}
visited.add(segment);
// Skips the segment if all previous segments have been skipped.
const shouldSkip =
skipped.size > 0 &&
segment.prevSegments.length > 0 &&
segment.prevSegments.every(isSkipped);
/*
* If the most recent segment hasn't been skipped, then we call
* the callback, passing in the segment and the controller.
*/
if (!shouldSkip) {
resolvedCallback.call(this, segment, controller);
// exit if we're at the last segment
if (segment === lastSegment) {
controller.skip();
}
/*
* If the previous statement was executed, or if the callback
* called a method on the controller, we might need to exit the
* loop, so check for that and break accordingly.
*/
if (broken) {
break;
}
} else {
// If the most recent segment has been skipped, then mark it as skipped.
skipped.add(segment);
}
}
// Update the stack.
end = segment.nextSegments.length - 1;
if (index < end) {
/*
* If we haven't yet visited all of the next segments, update
* the current top record on the stack to the next index to visit
* and then push a record for the current segment on top.
*
* Setting the current top record's index lets us know how many
* times we've been here and ensures that the segment won't be
* reprocessed (because we only process segments with an index
* of 0).
*/
record[1] += 1;
stack.push([segment.nextSegments[index], 0]);
} else if (index === end) {
/*
* If we are at the last next segment, then reset the top record
* in the stack to next segment and set its index to 0 so it will
* be processed next.
*/
record[0] = segment.nextSegments[index];
record[1] = 0;
} else {
/*
* If index > end, that means we have no more segments that need
* processing. So, we pop that record off of the stack in order to
* continue traversing at the next level up.
*/
stack.pop();
}
}
}
}
module.exports = CodePath;
@@ -0,0 +1 @@
{"version":3,"file":"ContainerOptions.d.ts","sourceRoot":"","sources":["../../../../src/container/models/ContainerOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAChC"}
@@ -0,0 +1,31 @@
/// <reference types="node" />
import * as fsWalk from '@nodelib/fs.walk';
export type ErrnoException = NodeJS.ErrnoException;
export type Entry = fsWalk.Entry;
export type EntryItem = string | Entry;
export type Pattern = string;
export type PatternRe = RegExp;
export type PatternsGroup = Record<string, Pattern[]>;
export type ReaderOptions = fsWalk.Options & {
transform(entry: Entry): EntryItem;
deepFilter: DeepFilterFunction;
entryFilter: EntryFilterFunction;
errorFilter: ErrorFilterFunction;
fs: FileSystemAdapter;
stats: boolean;
};
export type ErrorFilterFunction = fsWalk.ErrorFilterFunction;
export type EntryFilterFunction = fsWalk.EntryFilterFunction;
export type DeepFilterFunction = fsWalk.DeepFilterFunction;
export type EntryTransformerFunction = (entry: Entry) => EntryItem;
export type MicromatchOptions = {
dot?: boolean;
matchBase?: boolean;
nobrace?: boolean;
nocase?: boolean;
noext?: boolean;
noglobstar?: boolean;
posix?: boolean;
strictSlashes?: boolean;
};
export type FileSystemAdapter = fsWalk.FileSystemAdapter;
@@ -0,0 +1 @@
{"version":3,"file":"history.js","names":["Scope","Module","Quill","History","DEFAULTS","delay","maxStack","userOnly","lastRecorded","ignoreChange","stack","undo","redo","currentRange","constructor","quill","options","on","events","EDITOR_CHANGE","eventName","value","oldValue","source","SELECTION_CHANGE","sources","SILENT","TEXT_CHANGE","USER","record","transform","transformRange","keyboard","addBinding","key","shortKey","bind","shiftKey","test","navigator","platform","root","addEventListener","event","inputType","preventDefault","change","dest","length","item","pop","base","getContents","inverseDelta","delta","invert","push","range","updateContents","restoreSelection","clear","cutoff","changeDelta","oldDelta","ops","undoDelta","undoRange","timestamp","Date","now","compose","shift","transformStack","stackItem","setSelection","index","getLastChangeIndex","scroll","remoteDelta","i","oldItem","splice","endsWithNewlineChange","lastOp","insert","endsWith","attributes","Object","keys","some","attr","query","BLOCK","deleteLength","reduce","op","delete","changeIndex","start","transformPosition","end","default"],"sources":["../../src/modules/history.ts"],"sourcesContent":["import { Scope } from 'parchment';\nimport type Delta from 'quill-delta';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type Scroll from '../blots/scroll.js';\nimport type { Range } from '../core/selection.js';\n\nexport interface HistoryOptions {\n userOnly: boolean;\n delay: number;\n maxStack: number;\n}\n\nexport interface StackItem {\n delta: Delta;\n range: Range | null;\n}\n\ninterface Stack {\n undo: StackItem[];\n redo: StackItem[];\n}\n\nclass History extends Module<HistoryOptions> {\n static DEFAULTS: HistoryOptions = {\n delay: 1000,\n maxStack: 100,\n userOnly: false,\n };\n\n lastRecorded = 0;\n ignoreChange = false;\n stack: Stack = { undo: [], redo: [] };\n currentRange: Range | null = null;\n\n constructor(quill: Quill, options: Partial<HistoryOptions>) {\n super(quill, options);\n this.quill.on(\n Quill.events.EDITOR_CHANGE,\n (eventName, value, oldValue, source) => {\n if (eventName === Quill.events.SELECTION_CHANGE) {\n if (value && source !== Quill.sources.SILENT) {\n this.currentRange = value;\n }\n } else if (eventName === Quill.events.TEXT_CHANGE) {\n if (!this.ignoreChange) {\n if (!this.options.userOnly || source === Quill.sources.USER) {\n this.record(value, oldValue);\n } else {\n this.transform(value);\n }\n }\n\n this.currentRange = transformRange(this.currentRange, value);\n }\n },\n );\n\n this.quill.keyboard.addBinding(\n { key: 'z', shortKey: true },\n this.undo.bind(this),\n );\n this.quill.keyboard.addBinding(\n { key: ['z', 'Z'], shortKey: true, shiftKey: true },\n this.redo.bind(this),\n );\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding(\n { key: 'y', shortKey: true },\n this.redo.bind(this),\n );\n }\n\n this.quill.root.addEventListener('beforeinput', (event) => {\n if (event.inputType === 'historyUndo') {\n this.undo();\n event.preventDefault();\n } else if (event.inputType === 'historyRedo') {\n this.redo();\n event.preventDefault();\n }\n });\n }\n\n change(source: 'undo' | 'redo', dest: 'redo' | 'undo') {\n if (this.stack[source].length === 0) return;\n const item = this.stack[source].pop();\n if (!item) return;\n const base = this.quill.getContents();\n const inverseDelta = item.delta.invert(base);\n this.stack[dest].push({\n delta: inverseDelta,\n range: transformRange(item.range, inverseDelta),\n });\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(item.delta, Quill.sources.USER);\n this.ignoreChange = false;\n\n this.restoreSelection(item);\n }\n\n clear() {\n this.stack = { undo: [], redo: [] };\n }\n\n cutoff() {\n this.lastRecorded = 0;\n }\n\n record(changeDelta: Delta, oldDelta: Delta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = changeDelta.invert(oldDelta);\n let undoRange = this.currentRange;\n const timestamp = Date.now();\n if (\n // @ts-expect-error Fix me later\n this.lastRecorded + this.options.delay > timestamp &&\n this.stack.undo.length > 0\n ) {\n const item = this.stack.undo.pop();\n if (item) {\n undoDelta = undoDelta.compose(item.delta);\n undoRange = item.range;\n }\n } else {\n this.lastRecorded = timestamp;\n }\n if (undoDelta.length() === 0) return;\n this.stack.undo.push({ delta: undoDelta, range: undoRange });\n // @ts-expect-error Fix me later\n if (this.stack.undo.length > this.options.maxStack) {\Line truncated
@@ -0,0 +1,100 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Ivan Kopeykin @vankop
*/
"use strict";
const forEachBail = require("./forEachBail");
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
/** @typedef {{ alias: string|string[], extension: string }} ExtensionAliasOption */
module.exports = class ExtensionAliasPlugin {
/**
* @param {string | ResolveStepHook} source source
* @param {ExtensionAliasOption} options options
* @param {string | ResolveStepHook} target target
*/
constructor(source, options, target) {
this.source = source;
this.options = options;
this.target = target;
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
const target = resolver.ensureHook(this.target);
const { extension, alias } = this.options;
resolver
.getHook(this.source)
.tapAsync("ExtensionAliasPlugin", (request, resolveContext, callback) => {
const requestPath = request.request;
if (!requestPath || !requestPath.endsWith(extension)) return callback();
const isAliasString = typeof alias === "string";
/**
* @param {string} alias extension alias
* @param {(err?: null | Error, result?: null|ResolveRequest) => void} callback callback
* @param {number=} index index
* @returns {void}
*/
const resolve = (alias, callback, index) => {
const newRequest = `${requestPath.slice(
0,
-extension.length,
)}${alias}`;
return resolver.doResolve(
target,
{
...request,
request: newRequest,
fullySpecified: true,
},
`aliased from extension alias with mapping '${extension}' to '${alias}'`,
resolveContext,
(err, result) => {
// Throw error if we are on the last alias (for multiple aliases) and it failed, always throw if we are not an array or we have only one alias
if (!isAliasString && index) {
if (index !== this.options.alias.length) {
if (resolveContext.log) {
resolveContext.log(
`Failed to alias from extension alias with mapping '${extension}' to '${alias}' for '${newRequest}': ${err}`,
);
}
return callback(null, result);
}
return callback(err, result);
}
callback(err, result);
},
);
};
/**
* @param {(null | Error)=} err error
* @param {(null | ResolveRequest)=} result result
* @returns {void}
*/
const stoppingCallback = (err, result) => {
if (err) return callback(err);
if (result) return callback(null, result);
// Don't allow other aliasing or raw request
return callback(null, null);
};
if (isAliasString) {
resolve(alias, stoppingCallback);
} else if (alias.length > 1) {
forEachBail(alias, resolve, stoppingCallback);
} else {
resolve(alias[0], stoppingCallback);
}
});
}
};
@@ -0,0 +1,228 @@
// These types are not exported, and are only used internally
/**
* Take in an unknown value and return one that is of type T
*/
type Converter<T> = (object: unknown) => T
type SequenceConverter<T> = (object: unknown, iterable?: IterableIterator<T>) => T[]
type RecordConverter<K extends string, V> = (object: unknown) => Record<K, V>
interface ConvertToIntOpts {
clamp?: boolean
enforceRange?: boolean
}
interface WebidlErrors {
exception (opts: { header: string, message: string }): TypeError
/**
* @description Throw an error when conversion from one type to another has failed
*/
conversionFailed (opts: {
prefix: string
argument: string
types: string[]
}): TypeError
/**
* @description Throw an error when an invalid argument is provided
*/
invalidArgument (opts: {
prefix: string
value: string
type: string
}): TypeError
}
interface WebidlUtil {
/**
* @see https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
*/
Type (object: unknown):
| 'Undefined'
| 'Boolean'
| 'String'
| 'Symbol'
| 'Number'
| 'BigInt'
| 'Null'
| 'Object'
/**
* @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
*/
ConvertToInt (
V: unknown,
bitLength: number,
signedness: 'signed' | 'unsigned',
opts?: ConvertToIntOpts
): number
/**
* @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
*/
IntegerPart (N: number): number
/**
* Stringifies {@param V}
*/
Stringify (V: any): string
/**
* Mark a value as uncloneable for Node.js.
* This is only effective in some newer Node.js versions.
*/
markAsUncloneable (V: any): void
}
interface WebidlConverters {
/**
* @see https://webidl.spec.whatwg.org/#es-DOMString
*/
DOMString (V: unknown, prefix: string, argument: string, opts?: {
legacyNullToEmptyString: boolean
}): string
/**
* @see https://webidl.spec.whatwg.org/#es-ByteString
*/
ByteString (V: unknown, prefix: string, argument: string): string
/**
* @see https://webidl.spec.whatwg.org/#es-USVString
*/
USVString (V: unknown): string
/**
* @see https://webidl.spec.whatwg.org/#es-boolean
*/
boolean (V: unknown): boolean
/**
* @see https://webidl.spec.whatwg.org/#es-any
*/
any <Value>(V: Value): Value
/**
* @see https://webidl.spec.whatwg.org/#es-long-long
*/
['long long'] (V: unknown): number
/**
* @see https://webidl.spec.whatwg.org/#es-unsigned-long-long
*/
['unsigned long long'] (V: unknown): number
/**
* @see https://webidl.spec.whatwg.org/#es-unsigned-long
*/
['unsigned long'] (V: unknown): number
/**
* @see https://webidl.spec.whatwg.org/#es-unsigned-short
*/
['unsigned short'] (V: unknown, opts?: ConvertToIntOpts): number
/**
* @see https://webidl.spec.whatwg.org/#idl-ArrayBuffer
*/
ArrayBuffer (V: unknown): ArrayBufferLike
ArrayBuffer (V: unknown, opts: { allowShared: false }): ArrayBuffer
/**
* @see https://webidl.spec.whatwg.org/#es-buffer-source-types
*/
TypedArray (
V: unknown,
TypedArray: NodeJS.TypedArray | ArrayBufferLike
): NodeJS.TypedArray | ArrayBufferLike
TypedArray (
V: unknown,
TypedArray: NodeJS.TypedArray | ArrayBufferLike,
opts?: { allowShared: false }
): NodeJS.TypedArray | ArrayBuffer
/**
* @see https://webidl.spec.whatwg.org/#es-buffer-source-types
*/
DataView (V: unknown, opts?: { allowShared: boolean }): DataView
/**
* @see https://webidl.spec.whatwg.org/#BufferSource
*/
BufferSource (
V: unknown,
opts?: { allowShared: boolean }
): NodeJS.TypedArray | ArrayBufferLike | DataView
['sequence<ByteString>']: SequenceConverter<string>
['sequence<sequence<ByteString>>']: SequenceConverter<string[]>
['record<ByteString, ByteString>']: RecordConverter<string, string>
[Key: string]: (...args: any[]) => unknown
}
export interface Webidl {
errors: WebidlErrors
util: WebidlUtil
converters: WebidlConverters
/**
* @description Performs a brand-check on {@param V} to ensure it is a
* {@param cls} object.
*/
brandCheck <Interface>(V: unknown, cls: Interface, opts?: { strict?: boolean }): asserts V is Interface
/**
* @see https://webidl.spec.whatwg.org/#es-sequence
* @description Convert a value, V, to a WebIDL sequence type.
*/
sequenceConverter <Type>(C: Converter<Type>): SequenceConverter<Type>
illegalConstructor (): never
/**
* @see https://webidl.spec.whatwg.org/#es-to-record
* @description Convert a value, V, to a WebIDL record type.
*/
recordConverter <K extends string, V>(
keyConverter: Converter<K>,
valueConverter: Converter<V>
): RecordConverter<K, V>
/**
* Similar to {@link Webidl.brandCheck} but allows skipping the check if third party
* interfaces are allowed.
*/
interfaceConverter <Interface>(cls: Interface): (
V: unknown,
opts?: { strict: boolean }
) => asserts V is typeof cls
// TODO(@KhafraDev): a type could likely be implemented that can infer the return type
// from the converters given?
/**
* Converts a value, V, to a WebIDL dictionary types. Allows limiting which keys are
* allowed, values allowed, optional and required keys. Auto converts the value to
* a type given a converter.
*/
dictionaryConverter (converters: {
key: string,
defaultValue?: () => unknown,
required?: boolean,
converter: (...args: unknown[]) => unknown,
allowedValues?: unknown[]
}[]): (V: unknown) => Record<string, unknown>
/**
* @see https://webidl.spec.whatwg.org/#idl-nullable-type
* @description allows a type, V, to be null
*/
nullableConverter <T>(
converter: Converter<T>
): (V: unknown) => ReturnType<typeof converter> | null
argumentLengthCheck (args: { length: number }, min: number, context: string): void
}
@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.verifyJWT = verifyJWT;
const convertX509PublicKeyToCOSE_js_1 = require("../helpers/convertX509PublicKeyToCOSE.js");
const index_js_1 = require("../helpers/iso/index.js");
const cose_js_1 = require("../helpers/cose.js");
const verifyEC2_js_1 = require("../helpers/iso/isoCrypto/verifyEC2.js");
const verifyRSA_js_1 = require("../helpers/iso/isoCrypto/verifyRSA.js");
/**
* Lightweight verification for FIDO MDS JWTs. Supports use of EC2 and RSA.
*
* If this ever needs to support more JWS algorithms, here's the list of them:
*
* https://www.rfc-editor.org/rfc/rfc7518.html#section-3.1
*
* (Pulled from https://www.rfc-editor.org/rfc/rfc7515#section-4.1.1)
*/
function verifyJWT(jwt, leafCert) {
const [header, payload, signature] = jwt.split('.');
const certCOSE = (0, convertX509PublicKeyToCOSE_js_1.convertX509PublicKeyToCOSE)(leafCert);
const data = index_js_1.isoUint8Array.fromUTF8String(`${header}.${payload}`);
const signatureBytes = index_js_1.isoBase64URL.toBuffer(signature);
if ((0, cose_js_1.isCOSEPublicKeyEC2)(certCOSE)) {
return (0, verifyEC2_js_1.verifyEC2)({
data,
signature: signatureBytes,
cosePublicKey: certCOSE,
shaHashOverride: cose_js_1.COSEALG.ES256,
});
}
else if ((0, cose_js_1.isCOSEPublicKeyRSA)(certCOSE)) {
return (0, verifyRSA_js_1.verifyRSA)({
data,
signature: signatureBytes,
cosePublicKey: certCOSE,
});
}
const kty = certCOSE.get(cose_js_1.COSEKEYS.kty);
throw new Error(`JWT verification with public key of kty ${kty} is not supported by this method`);
}
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContentInfo = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
class ContentInfo {
constructor(params = {}) {
this.contentType = "";
this.content = new ArrayBuffer(0);
Object.assign(this, params);
}
}
exports.ContentInfo = ContentInfo;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })
], ContentInfo.prototype, "contentType", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any, context: 0 })
], ContentInfo.prototype, "content", void 0);
@@ -0,0 +1,122 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "توکي", verb: "ولري" },
file: { unit: "بایټس", verb: "ولري" },
array: { unit: "توکي", verb: "ولري" },
set: { unit: "توکي", verb: "ولري" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "عدد";
}
case "object": {
if (Array.isArray(data)) {
return "ارې";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "ورودي",
email: "بریښنالیک",
url: "یو آر ال",
emoji: "ایموجي",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "نیټه او وخت",
date: "نېټه",
time: "وخت",
duration: "موده",
ipv4: "د IPv4 پته",
ipv6: "د IPv6 پته",
cidrv4: "د IPv4 ساحه",
cidrv6: "د IPv6 ساحه",
base64: "base64-encoded متن",
base64url: "base64url-encoded متن",
json_string: "JSON متن",
e164: "د E.164 شمېره",
jwt: "JWT",
template_literal: "ورودي",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `ناسم ورودي: باید ${issue.expected} وای, مګر ${parsedType(issue.input)} ترلاسه شو`;
case "invalid_value":
if (issue.values.length === 1) {
return `ناسم ورودي: باید ${util.stringifyPrimitive(issue.values[0])} وای`;
}
return `ناسم انتخاب: باید یو له ${util.joinValues(issue.values, "|")} څخه وای`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
return `ډیر لوی: ${issue.origin ?? "ارزښت"} باید ${adj}${issue.maximum.toString()} ${sizing.unit ?? "عنصرونه"} ولري`;
}
return `ډیر لوی: ${issue.origin ?? "ارزښت"} باید ${adj}${issue.maximum.toString()} وي`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `ډیر کوچنی: ${issue.origin} باید ${adj}${issue.minimum.toString()} ${sizing.unit} ولري`;
}
return `ډیر کوچنی: ${issue.origin} باید ${adj}${issue.minimum.toString()} وي`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `ناسم متن: باید د "${_issue.prefix}" سره پیل شي`;
}
if (_issue.format === "ends_with") {
return `ناسم متن: باید د "${_issue.suffix}" سره پای ته ورسيږي`;
}
if (_issue.format === "includes") {
return `ناسم متن: باید "${_issue.includes}" ولري`;
}
if (_issue.format === "regex") {
return `ناسم متن: باید د ${_issue.pattern} سره مطابقت ولري`;
}
return `${Nouns[_issue.format] ?? issue.format} ناسم دی`;
}
case "not_multiple_of":
return `ناسم عدد: باید د ${issue.divisor} مضرب وي`;
case "unrecognized_keys":
return `ناسم ${issue.keys.length > 1 ? "کلیډونه" : "کلیډ"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `ناسم کلیډ په ${issue.origin} کې`;
case "invalid_union":
return `ناسمه ورودي`;
case "invalid_element":
return `ناسم عنصر په ${issue.origin} کې`;
default:
return `ناسمه ورودي`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1,10 @@
import { PluginFunc } from 'dayjs'
declare const plugin: PluginFunc
export = plugin
declare module 'dayjs' {
interface Dayjs {
isLeapYear(): boolean
}
}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('intersectionWith', require('../intersectionWith'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var LabelRole = {
relatedConcepts: [{
module: 'HTML',
concept: {
name: 'label'
}
}],
type: 'structure'
};
var _default = LabelRole;
exports.default = _default;
@@ -0,0 +1,63 @@
'use strict';
var $TypeError = require('es-errors/type');
// var $BigInt = GetIntrinsic('%BigInt%', true);
// var $pow = require('math-intrinsics/pow');
// var BinaryAnd = require('./BinaryAnd');
// var BinaryOr = require('./BinaryOr');
// var BinaryXor = require('./BinaryXor');
// var modulo = require('./modulo');
// var zero = $BigInt && $BigInt(0);
// var negOne = $BigInt && $BigInt(-1);
// var two = $BigInt && $BigInt(2);
// https://262.ecma-international.org/11.0/#sec-bigintbitwiseop
module.exports = function BigIntBitwiseOp(op, x, y) {
if (op !== '&' && op !== '|' && op !== '^') {
throw new $TypeError('Assertion failed: `op` must be `&`, `|`, or `^`');
}
if (typeof x !== 'bigint' || typeof y !== 'bigint') {
throw new $TypeError('`x` and `y` must be BigInts');
}
if (op === '&') {
return x & y;
}
if (op === '|') {
return x | y;
}
return x ^ y;
/*
var result = zero;
var shift = 0;
while (x !== zero && x !== negOne && y !== zero && y !== negOne) {
var xDigit = modulo(x, two);
var yDigit = modulo(y, two);
if (op === '&') {
result += $pow(2, shift) * BinaryAnd(xDigit, yDigit);
} else if (op === '|') {
result += $pow(2, shift) * BinaryOr(xDigit, yDigit);
} else if (op === '^') {
result += $pow(2, shift) * BinaryXor(xDigit, yDigit);
}
shift += 1;
x = (x - xDigit) / two;
y = (y - yDigit) / two;
}
var tmp;
if (op === '&') {
tmp = BinaryAnd(modulo(x, two), modulo(y, two));
} else if (op === '|') {
tmp = BinaryAnd(modulo(x, two), modulo(y, two));
} else {
tmp = BinaryXor(modulo(x, two), modulo(y, two));
}
if (tmp !== 0) {
result -= $pow(2, shift);
}
return result;
*/
};
@@ -0,0 +1 @@
{"name":"safe-push-apply","version":"1.0.0","requiresBuild":false,"files":{".eslintrc":{"checkedAt":1794532097161,"integrity":"sha512-Zqu3KaP2qZFZz5Ab2VjMGWOxZA63BlwTv7Gw7QFIJ7VQCJPfUyxHeFZUmmucVKUtfaTUXfr+8idAEOWgBmh/Dw==","mode":420,"size":201},".nycrc":{"checkedAt":1794532097161,"integrity":"sha512-42sgwWzusJB1Dzhl78jX/Zg65Oi0HDDMOGXS/Uklv1kCYn4fHtRsD/JFPwdu+d40vome9XdUspzRWEQAcTGEeQ==","mode":420,"size":216},"LICENSE":{"checkedAt":1794532097161,"integrity":"sha512-is07hPOvqMb/nBpYq3dOozrsdwHAIrqPTTYhio0cA+gO8u4daS29Q9v1iDFTE3xeAA8RO5jaI9hw36tvcbeK+g==","mode":420,"size":1071},"index.js":{"checkedAt":1794532097161,"integrity":"sha512-xj7v6YVHqWA3DPkSbfixREVZsANFlNx+jK/5AwSQvT7lBDVX0Rb3FifRl8IA4l2JjPPokT0VUe19c+xEvmUEkA==","mode":420,"size":386},"test/index.js":{"checkedAt":1794532097161,"integrity":"sha512-bFEK+Zu2YY4RgbvkjD56H9ZFenJipo1kP25k6dVzVSdP3sB1g7GsQUczTrHoKfqdEB50dfGkedruV18wddkVoA==","mode":420,"size":730},"package.json":{"checkedAt":1794532097161,"integrity":"sha512-QqOulzRWIwA+5CgS1Jq76SF290Q0EHoDaZmXdbbmpSxtNGOGxds4C1Qph6wb6SQks5ICy559bsnZHGR6k4i5Ug==","mode":420,"size":2172},"tsconfig.json":{"checkedAt":1794532097161,"integrity":"sha512-fa2Zk3IIbRQSpZn45qY5IHkID0oGejF1G9bQ5kVV/m5VmvgS1ODCQ6zlums9zI3CsLX46x60x+jQb5w08gZj3w==","mode":420,"size":125},"CHANGELOG.md":{"checkedAt":1794532097162,"integrity":"sha512-KNSN3JOk5HKEylgSQVWPorOeMLXXUbs+Og32/7xcl6By4XGNcaCzEUNJAv4+BuVMXq7TylACCNcZIfqN4OXVSw==","mode":420,"size":810},"README.md":{"checkedAt":1794532097162,"integrity":"sha512-5T/FiT/32RBXtZwwqlAcm0NcNS4um5A4DrNzJhs3o8ADi6xlAskORGE3hqDiSbno3vxA/k3Pb57TKylEiBoiAQ==","mode":420,"size":2084},"index.d.ts":{"checkedAt":1794532097162,"integrity":"sha512-Qc6vaXFHFaaYUtmP58pIe4BRjL+E8inyqVTv6f3idPUGanLSRtxd+vU9RtLlQgIc+jYLMXZMgPy53NxJQi65iA==","mode":420,"size":119},".github/FUNDING.yml":{"checkedAt":1794532097162,"integrity":"sha512-GNWUhcibZZznlSO3CNKz7yLTpeIPnw/DQYEZRUIF4K88WXGQ+T0A2CnvNfCrB4BPMzSAf5VsA0uH9t2VQmGc1A==","mode":420,"size":586}}}
@@ -0,0 +1,4 @@
import { Either } from '@inversifyjs/common';
import { Resolved } from '../../resolution/models/Resolved';
export declare function cloneBindingCache<TActivated>(cache: Either<undefined, Resolved<TActivated>>): Either<undefined, Resolved<TActivated>>;
//# sourceMappingURL=cloneBindingCache.d.ts.map
@@ -0,0 +1 @@
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAkBM,MAAM,4CAA+E,IAAI","sources":["packages/@react-aria/grid/src/utils.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 type {GridCollection} from '@react-types/grid';\nimport type {GridState} from '@react-stately/grid';\nimport type {Key, KeyboardDelegate} from '@react-types/shared';\n\ninterface GridMapShared {\n keyboardDelegate: KeyboardDelegate,\n actions: {\n onRowAction?: (key: Key) => void,\n onCellAction?: (key: Key) => void\n },\n shouldSelectOnPressUp?: boolean\n}\n\n// Used to share:\n// keyboard delegate between useGrid and useGridCell\n// onRowAction/onCellAction across hooks\nexport const gridMap: WeakMap<GridState<unknown, GridCollection<unknown>>, GridMapShared> = new WeakMap<GridState<unknown, GridCollection<unknown>>, GridMapShared>();\n"],"names":[],"version":3,"file":"utils.main.js.map"}
@@ -0,0 +1 @@
{"version":3,"file":"quill.js","names":["merge","Parchment","Delta","Editor","Emitter","instances","logger","Module","Selection","Range","Composition","Theme","scrollRectIntoView","createRegistryWithFormats","debug","globalRegistry","Registry","ParentBlot","uiClass","Quill","DEFAULTS","bounds","modules","clipboard","keyboard","history","uploader","placeholder","readOnly","registry","theme","events","sources","version","imports","delta","parchment","limit","level","find","node","bubble","arguments","length","undefined","get","import","name","error","register","target","overwrite","attrName","blotName","Object","keys","forEach","key","path","warn","startsWith","constructor","container","options","expandConfig","html","innerHTML","trim","classList","add","set","root","addContainer","emitter","scrollBlotName","ScrollBlot","query","Error","scroll","editor","selection","composition","addModule","init","on","EDITOR_CHANGE","type","TEXT_CHANGE","toggle","isBlank","SCROLL_UPDATE","source","mutations","oldRange","lastRange","newRange","getRange","selectionInfo","modify","call","update","SCROLL_EMBED_UPDATE","blot","change","retain","offset","statics","USER","contents","convert","text","setContents","clear","setAttribute","disable","allowReadOnlyEdits","refNode","className","document","createElement","insertBefore","blur","setRange","deleteText","index","overload","enable","editReadOnly","modifier","value","enabled","focus","preventScroll","scrollSelectionIntoView","format","API","range","getSelection","Scope","BLOCK","formatLine","formatText","setSelection","SILENT","formats","getBounds","containerBounds","getBoundingClientRect","bottom","top","height","left","right","width","getContents","getLength","getFormat","getIndex","getLeaf","leaf","getLine","line","getLines","Number","MAX_VALUE","lines","getModule","getSemanticHTML","getHTML","getText","hasFocus","insertEmbed","embed","insertText","isEnabled","off","once","removeFormat","rect","scrollIntoView","console","delete1","applied","insertContents","delete2","compose","Math","max","setText","insert","updateContents","applyDelta","resolveSelector","selector","querySelector","expandModuleConfig","config","entries","reduce","expanded","_ref","omitUndefinedValuesFromOptions","obj","fromEntries","filter","entry","containerOrSelector","shouldUseDefaultTheme","quillModuleDefaults","quillDefaults","themeModuleDefaults","themeDefaults","userModuleOptions","toolbar","modulesWithDefaults","_ref2","moduleClass","shift","oldDelta","shiftRange","args","emit","lengthOrSource","start","end","transformPosition","map","pos","default"],"sources":["../../src/core/quill.ts"],"sourcesContent":["import { merge } from 'lodash-es';\nimport * as Parchment from 'parchment';\nimport type { Op } from 'quill-delta';\nimport Delta from 'quill-delta';\nimport type { BlockEmbed } from '../blots/block.js';\nimport type Block from '../blots/block.js';\nimport type Scroll from '../blots/scroll.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type Uploader from '../modules/uploader.js';\nimport Editor from './editor.js';\nimport Emitter from './emitter.js';\nimport type { EmitterSource } from './emitter.js';\nimport instances from './instances.js';\nimport logger from './logger.js';\nimport type { DebugLevel } from './logger.js';\nimport Module from './module.js';\nimport Selection, { Range } from './selection.js';\nimport type { Bounds } from './selection.js';\nimport Composition from './composition.js';\nimport Theme from './theme.js';\nimport type { ThemeConstructor } from './theme.js';\nimport scrollRectIntoView from './utils/scrollRectIntoView.js';\nimport type { Rect } from './utils/scrollRectIntoView.js';\nimport createRegistryWithFormats from './utils/createRegistryWithFormats.js';\n\nconst debug = logger('quill');\n\nconst globalRegistry = new Parchment.Registry();\nParchment.ParentBlot.uiClass = 'ql-ui';\n\n/**\n * Options for initializing a Quill instance\n */\nexport interface QuillOptions {\n theme?: string;\n debug?: DebugLevel | boolean;\n registry?: Parchment.Registry;\n /**\n * Whether to disable the editing\n * @default false\n */\n readOnly?: boolean;\n\n /**\n * Placeholder text to display when the editor is empty\n * @default \"\"\n */\n placeholder?: string;\n bounds?: HTMLElement | string | null;\n modules?: Record<string, unknown>;\n\n /**\n * A list of formats that are recognized and can exist within the editor contents.\n * `null` means all formats are allowed.\n * @default null\n */\n formats?: string[] | null;\n}\n\n/**\n * Similar to QuillOptions, but with all properties expanded to their default values,\n * and all selectors resolved to HTMLElements.\n */\nexport interface ExpandedQuillOptions\n extends Omit<QuillOptions, 'theme' | 'formats'> {\n theme: ThemeConstructor;\n registry: Parchment.Registry;\n container: HTLine truncated
@@ -0,0 +1,825 @@
export default `flf2a$ 8 7 20 -1 7
TUBULAR by Ron Fritz 8/94
Figlet Release 2.0
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
O~~@
O~~@
O~~@
O~ @
O~ @
@
O~~@
@@
O~ O~@
O~ O~@
@
@
@
@
@
@@
@
O~~ O~~ @
O~~~~~~ O~~~~@
O~~ O~~ @
O~~ O~~ @
O~~~~~~ O~~~~@
O~~ O~~ @
@@
O~~ @
O~ O~~ @
O~~ @
O~~ @
O~~@
O~~ O~~ @
O~~ @
@@
@
O~~ O~~ @
O~~ @
O~~ @
O~~ @
O~~ @
O~~ O~~ @
@@
O~ @
O~~ O~~@
O~~ @
O~~~ @
O~~ @
O~~ O~~@
O~ @
@@
O~~@
O~@
@
@
@
@
@
@@
O~~@
O~~ @
O~~ @
O~~ @
O~~ @
O~~ @
O~~@
@@
O~~ @
O~~ @
O~~@
O~~@
O~~@
O~~ @
O~~ @
@@
O~~ @
O~~ O~~ O~~@
O~ O~ O~~ @
O~~~~ O~~~~~~~@
O~ O~ O~~ @
O~~ O~~ O~~@
O~~ @
@@
@
O~~ @
O~~ @
O~~~ O~~~~~@
O~~ @
O~~ @
@
@@
@
@
@
@
@
@
O~~@
O~@@
@
@
@
O~~~~~@
@
@
@
@@
@
@
@
@
@
@
O~~@
@@
O~~@
O~~ @
O~~ @
O~~ @
O~~ @
O~~ @
O~~ @
@@
@
O~~ @
O~~ O~~ @
O~~ O~~ @
O~~ O~~@
O~~ O~~ @
O~~~ @
@@
@
O~~ @
O~~ @
O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
@
@
@
@@
@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,21 @@
/**
* @import {Options, State} from 'mdast-util-to-markdown'
*/
/**
* @param {State} state
* @returns {Exclude<Options['bulletOrdered'], null | undefined>}
*/
export function checkBulletOrdered(state) {
const marker = state.options.bulletOrdered || '.'
if (marker !== '.' && marker !== ')') {
throw new Error(
'Cannot serialize items with `' +
marker +
'` for `options.bulletOrdered`, expected `.` or `)`'
)
}
return marker
}
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,iEAAW,CAAC;IACvE,qBAAqB,CAAC,iNAAmC,CAAC;IAC1D,UAAU,CAAC,mCAAK,CAAC;IACjB,eAAe,CAAC,iIAAqB,CAAC;IACtC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,4GAAkB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,0DAAU,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,0DAAU,CAAC;QAAA,GAAG,CAAC,CAAC;IACxN,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,2CAAO,CAAC;AACjD","sources":["packages/@react-aria/grid/intl/ar-AE.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} غير المحدد\",\n \"longPressToSelect\": \"اضغط مطولًا للدخول إلى وضع التحديد.\",\n \"select\": \"تحديد\",\n \"selectedAll\": \"جميع العناصر المحددة.\",\n \"selectedCount\": \"{count, plural, =0 {لم يتم تحديد عناصر} one {# عنصر محدد} other {# عنصر محدد}}.\",\n \"selectedItem\": \"{item} المحدد\"\n}\n"],"names":[],"version":3,"file":"ar-AE.main.js.map"}
@@ -0,0 +1,43 @@
interface UIOptions {
width: number;
wrap?: boolean;
rows?: string[];
}
interface Column {
text: string;
width?: number;
align?: "right" | "left" | "center";
padding: number[];
border?: boolean;
}
interface ColumnArray extends Array<Column> {
span: boolean;
}
interface Line {
hidden?: boolean;
text: string;
span?: boolean;
}
declare class UI {
width: number;
wrap: boolean;
rows: ColumnArray[];
constructor(opts: UIOptions);
span(...args: ColumnArray): void;
resetOutput(): void;
div(...args: (Column | string)[]): ColumnArray;
private shouldApplyLayoutDSL;
private applyLayoutDSL;
private colFromString;
private measurePadding;
toString(): string;
rowToString(row: ColumnArray, lines: Line[]): Line[];
// if the full 'source' can render in
// the target line, do so.
private renderInline;
private rasterize;
private negatePadding;
private columnWidths;
}
declare function ui(opts: UIOptions): UI;
export { ui as default };
@@ -0,0 +1,31 @@
import type { TSESTree } from '../../ts-estree';
type IsSpecificTokenFunction<SpecificToken extends TSESTree.Token> = (token: TSESTree.Token) => token is SpecificToken;
type IsNotSpecificTokenFunction<SpecificToken extends TSESTree.Token> = (token: TSESTree.Token) => token is Exclude<TSESTree.Token, SpecificToken>;
type PunctuatorTokenWithValue<Value extends string> = {
value: Value;
} & TSESTree.PunctuatorToken;
type IsPunctuatorTokenWithValueFunction<Value extends string> = IsSpecificTokenFunction<PunctuatorTokenWithValue<Value>>;
type IsNotPunctuatorTokenWithValueFunction<Value extends string> = IsNotSpecificTokenFunction<PunctuatorTokenWithValue<Value>>;
export declare const isArrowToken: IsPunctuatorTokenWithValueFunction<"=>">;
export declare const isNotArrowToken: IsNotPunctuatorTokenWithValueFunction<"=>">;
export declare const isClosingBraceToken: IsPunctuatorTokenWithValueFunction<"}">;
export declare const isNotClosingBraceToken: IsNotPunctuatorTokenWithValueFunction<"}">;
export declare const isClosingBracketToken: IsPunctuatorTokenWithValueFunction<"]">;
export declare const isNotClosingBracketToken: IsNotPunctuatorTokenWithValueFunction<"]">;
export declare const isClosingParenToken: IsPunctuatorTokenWithValueFunction<")">;
export declare const isNotClosingParenToken: IsNotPunctuatorTokenWithValueFunction<")">;
export declare const isColonToken: IsPunctuatorTokenWithValueFunction<":">;
export declare const isNotColonToken: IsNotPunctuatorTokenWithValueFunction<":">;
export declare const isCommaToken: IsPunctuatorTokenWithValueFunction<",">;
export declare const isNotCommaToken: IsNotPunctuatorTokenWithValueFunction<",">;
export declare const isCommentToken: IsSpecificTokenFunction<TSESTree.Comment>;
export declare const isNotCommentToken: IsNotSpecificTokenFunction<TSESTree.Comment>;
export declare const isOpeningBraceToken: IsPunctuatorTokenWithValueFunction<"{">;
export declare const isNotOpeningBraceToken: IsNotPunctuatorTokenWithValueFunction<"{">;
export declare const isOpeningBracketToken: IsPunctuatorTokenWithValueFunction<"[">;
export declare const isNotOpeningBracketToken: IsNotPunctuatorTokenWithValueFunction<"[">;
export declare const isOpeningParenToken: IsPunctuatorTokenWithValueFunction<"(">;
export declare const isNotOpeningParenToken: IsNotPunctuatorTokenWithValueFunction<"(">;
export declare const isSemicolonToken: IsPunctuatorTokenWithValueFunction<";">;
export declare const isNotSemicolonToken: IsNotPunctuatorTokenWithValueFunction<";">;
export {};
@@ -0,0 +1,57 @@
import { D, W, Y } from '../../constant';
var isoWeekPrettyUnit = 'isoweek';
export default (function (o, c, d) {
var getYearFirstThursday = function getYearFirstThursday(year, isUtc) {
var yearFirstDay = (isUtc ? d.utc : d)().year(year).startOf(Y);
var addDiffDays = 4 - yearFirstDay.isoWeekday();
if (yearFirstDay.isoWeekday() > 4) {
addDiffDays += 7;
}
return yearFirstDay.add(addDiffDays, D);
};
var getCurrentWeekThursday = function getCurrentWeekThursday(ins) {
return ins.add(4 - ins.isoWeekday(), D);
};
var proto = c.prototype;
proto.isoWeekYear = function () {
var nowWeekThursday = getCurrentWeekThursday(this);
return nowWeekThursday.year();
};
proto.isoWeek = function (week) {
if (!this.$utils().u(week)) {
return this.add((week - this.isoWeek()) * 7, D);
}
var nowWeekThursday = getCurrentWeekThursday(this);
var diffWeekThursday = getYearFirstThursday(this.isoWeekYear(), this.$u);
return nowWeekThursday.diff(diffWeekThursday, W) + 1;
};
proto.isoWeekday = function (week) {
if (!this.$utils().u(week)) {
return this.day(this.day() % 7 ? week : week - 7);
}
return this.day() || 7;
};
var oldStartOf = proto.startOf;
proto.startOf = function (units, startOf) {
var utils = this.$utils();
var isStartOf = !utils.u(startOf) ? startOf : true;
var unit = utils.p(units);
if (unit === isoWeekPrettyUnit) {
return isStartOf ? this.date(this.date() - (this.isoWeekday() - 1)).startOf('day') : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf('day');
}
return oldStartOf.bind(this)(units, startOf);
};
});
@@ -0,0 +1,227 @@
import descriptionTokenizer from '../../src/parser/tokenizers/description.js';
import { seedSpec, seedTokens } from '../../src/util.js';
const sourceSingle = [
{
number: 1,
source: '...',
tokens: seedTokens({ description: ' one two ' }),
},
];
const sourceMultiple = [
{
number: 1,
source: '...',
tokens: seedTokens({ description: 'one two ' }),
},
{
number: 2,
source: '...',
tokens: seedTokens({ description: '' }),
},
{
number: 3,
source: '...',
tokens: seedTokens({ description: ' three four' }),
},
{
number: 4,
source: '...',
tokens: seedTokens({ description: '' }),
},
];
test('compact - single line', () => {
const tokenize = descriptionTokenizer('compact');
const input = seedSpec({ source: sourceSingle });
const output = seedSpec({ source: sourceSingle, description: 'one two' });
expect(tokenize(input)).toEqual(output);
});
test('compact - multiple lines', () => {
const tokenize = descriptionTokenizer('compact');
const input = seedSpec({ source: sourceMultiple });
const output = seedSpec({
source: sourceMultiple,
description: 'one two three four',
});
expect(tokenize(input)).toEqual(output);
});
test('preserve - multiple lines', () => {
const tokenize = descriptionTokenizer('preserve');
const input = seedSpec({ source: sourceMultiple });
const output = seedSpec({
source: sourceMultiple,
description: 'one two \n\n three four\n',
});
expect(tokenize(input)).toEqual(output);
});
test('preserve - one-liner', () => {
const tokenize = descriptionTokenizer('preserve');
const input = seedSpec({
source: [
{
number: 1,
source: '...',
tokens: seedTokens({
delimiter: '/**',
postDelimiter: ' ',
description: 'description',
end: '*/',
}),
},
],
});
const output = seedSpec({
description: 'description',
source: [
{
number: 1,
source: '...',
tokens: seedTokens({
delimiter: '/**',
postDelimiter: ' ',
description: 'description',
end: '*/',
}),
},
],
});
expect(tokenize(input)).toEqual(output);
});
test('preserve - leading empty lines', () => {
const source = [
{
number: 1,
source: '...',
tokens: seedTokens({ delimiter: '/**' }),
},
{
number: 2,
source: '...',
tokens: seedTokens(),
},
{
number: 3,
source: '...',
tokens: seedTokens({ description: ' line 1 ' }),
},
{
number: 4,
source: '...',
tokens: seedTokens({ description: ' line 2 ' }),
},
{
number: 5,
source: '...',
tokens: seedTokens({ description: '' }),
},
];
const tokenize = descriptionTokenizer('preserve');
const input = seedSpec({ source });
const output = seedSpec({
source,
description: '\n line 1 \n line 2 \n',
});
expect(tokenize(input)).toEqual(output);
});
test('preserve - leading type lines', () => {
const source = [
{
number: 1,
source: '...',
tokens: seedTokens({ delimiter: '/**' }),
},
{
number: 2,
source: '...',
tokens: seedTokens(),
},
{
number: 3,
source: '...',
tokens: seedTokens({ type: '{function(' }),
},
{
number: 4,
source: '...',
tokens: seedTokens({ type: ' number' }),
},
{
number: 5,
source: '...',
tokens: seedTokens({
type: ')}',
postType: ' ',
description: 'line 1 ',
}),
},
{
number: 6,
source: '...',
tokens: seedTokens({ description: ' line 2 ' }),
},
{
number: 7,
source: '...',
tokens: seedTokens({ description: '' }),
},
];
const tokenize = descriptionTokenizer('preserve');
const input = seedSpec({ source });
const output = seedSpec({
source,
description: 'line 1 \n line 2 \n',
});
expect(tokenize(input)).toEqual(output);
});
test('custom joiner - single line', () => {
const tokenize = descriptionTokenizer((lines) => {
return lines
.reduce((str, { tokens: { description } }) => {
const trimmed = description.trim();
if (!trimmed) {
return str;
}
return str + ' ' + trimmed;
}, '')
.slice(1);
});
const input = seedSpec({ source: sourceSingle });
const output = seedSpec({ source: sourceSingle, description: 'one two' });
expect(tokenize(input)).toEqual(output);
});
test('custom joiner - multiple lines', () => {
const tokenize = descriptionTokenizer((lines) => {
return lines
.reduce((str, { tokens: { description } }) => {
const trimmed = description.trim();
if (!trimmed) {
return str;
}
return str + ' ' + trimmed;
}, '')
.slice(1);
});
const input = seedSpec({ source: sourceMultiple });
const output = seedSpec({
source: sourceMultiple,
description: 'one two three four',
});
expect(tokenize(input)).toEqual(output);
});
@@ -0,0 +1,718 @@
flf2a$ 7 4 8 0 3 0 64 0
Font Author: RubixTW
FIGFont created with: http://patorjk.com/figfont-editor
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
▗▄▖ @
▐▌ ▐▌@
▐▛▀▜▌@
▐▌ ▐▌@
@
@
@@
▗▄▄▖ @
▐▌ ▐▌@
▐▛▀▚▖@
▐▙▄▞▘@
@
@
@@
▗▄▄▖@
▐▌ @
▐▌ @
▝▚▄▄▖@
@
@
@@
▗▄▄▄ @
▐▌ █@
▐▌ █@
▐▙▄▄▀@
@
@
@@
▗▄▄▄▖@
▐▌ @
▐▛▀▀▘@
▐▙▄▄▖@
@
@
@@
▗▄▄▄▖@
▐▌ @
▐▛▀▀▘@
▐▌ @
@
@
@@
▗▄▄▖@
▐▌ @
▐▌▝▜▌@
▝▚▄▞▘@
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▛▀▜▌@
▐▌ ▐▌@
@
@
@@
▗▄▄▄▖@
█ @
█ @
▗▄█▄▖@
@
@
@@
▗▖@
▐▌@
▐▌@
▗▄▄▞▘@
@
@
@@
▗▖ ▗▖@
▐▌▗▞▘@
▐▛▚▖ @
▐▌ ▐▌@
@
@
@@
▗▖ @
▐▌ @
▐▌ @
▐▙▄▄▖@
@
@
@@
▗▖ ▗▖@
▐▛▚▞▜▌@
▐▌ ▐▌@
▐▌ ▐▌@
@
@
@@
▗▖ ▗▖@
▐▛▚▖▐▌@
▐▌ ▝▜▌@
▐▌ ▐▌@
@
@
@@
▗▄▖ @
▐▌ ▐▌@
▐▌ ▐▌@
▝▚▄▞▘@
@
@
@@
▗▄▄▖ @
▐▌ ▐▌@
▐▛▀▘ @
▐▌ @
@
@
@@
▗▄▄▄▖ @
▐▌ ▐▌ @
▐▌ ▐▌ @
▐▙▄▟▙▖@
@
@
@@
▗▄▄▖ @
▐▌ ▐▌@
▐▛▀▚▖@
▐▌ ▐▌@
@
@
@@
▗▄▄▖@
▐▌ @
▝▀▚▖@
▗▄▄▞▘@
@
@
@@
▗▄▄▄▖@
█ @
█ @
█ @
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▌ ▐▌@
▝▚▄▞▘@
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▌ ▐▌@
▝▚▞▘ @
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▌ ▐▌@
▐▙█▟▌@
@
@
@@
▗▖ ▗▖@
▝▚▞▘ @
▐▌ @
▗▞▘▝▚▖@
@
@
@@
▗▖ ▗▖@
▝▚▞▘ @
▐▌ @
▐▌ @
@
@
@@
▗▄▄▄▄▖@
▗▞▘@
▗▞▘ @
▐▙▄▄▄▖@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
▗▄▖ @
▐▌ ▐▌@
▐▛▀▜▌@
▐▌ ▐▌@
@
@
@@
▗▄▄▖ @
▐▌ ▐▌@
▐▛▀▚▖@
▐▙▄▞▘@
@
@
@@
▗▄▄▖@
▐▌ @
▐▌ @
▝▚▄▄▖@
@
@
@@
▗▄▄▄ @
▐▌ █@
▐▌ █@
▐▙▄▄▀@
@
@
@@
▗▄▄▄▖@
▐▌ @
▐▛▀▀▘@
▐▙▄▄▖@
@
@
@@
▗▄▄▄▖@
▐▌ @
▐▛▀▀▘@
▐▌ @
@
@
@@
▗▄▄▖@
▐▌ @
▐▌▝▜▌@
▝▚▄▞▘@
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▛▀▜▌@
▐▌ ▐▌@
@
@
@@
▗▄▄▄▖@
█ @
█ @
▗▄█▄▖@
@
@
@@
▗▖@
▐▌@
▐▌@
▗▄▄▞▘@
@
@
@@
▗▖ ▗▖@
▐▌▗▞▘@
▐▛▚▖ @
▐▌ ▐▌@
@
@
@@
▗▖ @
▐▌ @
▐▌ @
▐▙▄▄▖@
@
@
@@
▗▖ ▗▖@
▐▛▚▞▜▌@
▐▌ ▐▌@
▐▌ ▐▌@
@
@
@@
▗▖ ▗▖@
▐▛▚▖▐▌@
▐▌ ▝▜▌@
▐▌ ▐▌@
@
@
@@
▗▄▖ @
▐▌ ▐▌@
▐▌ ▐▌@
▝▚▄▞▘@
@
@
@@
▗▄▄▖ @
▐▌ ▐▌@
▐▛▀▘ @
▐▌ @
@
@
@@
▗▄▄▄▖ @
▐▌ ▐▌ @
▐▌ ▐▌ @
▐▙▄▟▙▖@
@
@
@@
▗▄▄▖ @
▐▌ ▐▌@
▐▛▀▚▖@
▐▌ ▐▌@
@
@
@@
▗▄▄▖@
▐▌ @
▝▀▚▖@
▗▄▄▞▘@
@
@
@@
▗▄▄▄▖@
█ @
█ @
█ @
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▌ ▐▌@
▝▚▄▞▘@
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▌ ▐▌@
▝▚▞▘ @
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▌ ▐▌@
▐▙█▟▌@
@
@
@@
▗▖ ▗▖@
▝▚▞▘ @
▐▌ @
▗▞▘▝▚▖@
@
@
@@
▗▖ ▗▖@
▝▚▞▘ @
▐▌ @
▐▌ @
@
@
@@
▗▄▄▄▄▖@
▗▞▘@
▗▞▘ @
▐▙▄▄▄▖@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@@ -0,0 +1,48 @@
import '@heroui/system-rsc';
import './types.js';
import { ModalProviderProps } from '@react-aria/overlays';
import { ProviderContextProps } from './provider-context.js';
import { Href, RouterOptions } from '@react-types/shared';
import { I18nProviderProps } from '@react-aria/i18n';
import 'react';
import '@internationalized/date';
import '@react-types/datepicker';
interface HeroUIProviderProps extends Omit<ModalProviderProps, "children">, ProviderContextProps {
children: React.ReactNode;
/**
* Controls whether `framer-motion` animations are skipped within the application.
* This property is automatically enabled (`true`) when the `disableAnimation` prop is set to `true`,
* effectively skipping all `framer-motion` animations. To retain `framer-motion` animations while
* using the `disableAnimation` prop for other purposes, set this to `false`. However, note that
* animations in HeroUI Components are still omitted if the `disableAnimation` prop is `true`.
*/
skipFramerMotionAnimations?: boolean;
/**
* Defines a new default transition for the entire tree.
* @default "never"
* See: https://www.framer.com/motion/motion-config/#props
*/
reducedMotion?: "user" | "always" | "never";
/**
* The locale to apply to the children.
* @default "en-US"
*/
locale?: I18nProviderProps["locale"];
/**
* Provides a client side router to all nested components such as
* Link, Menu, Tabs, Table, etc.
*/
navigate?: (path: Href, routerOptions: RouterOptions | undefined) => void;
/**
* Convert an `href` provided to a link component to a native `href`
* For example, a router might accept hrefs relative to a base path,
* or offer additional custom ways of specifying link destinations.
* The original href specified on the link is passed to the navigate function of the RouterProvider,
* and useHref is used to generate the full native href to put on the actual DOM element.
*/
useHref?: (href: Href) => string;
}
declare const HeroUIProvider: React.FC<HeroUIProviderProps>;
export { HeroUIProvider, HeroUIProviderProps };
@@ -0,0 +1,28 @@
import baseToString from './_baseToString.js';
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
export default toString;
@@ -0,0 +1,29 @@
import { Registry } from 'parchment';
const MAX_REGISTER_ITERATIONS = 100;
const CORE_FORMATS = ['block', 'break', 'cursor', 'inline', 'scroll', 'text'];
const createRegistryWithFormats = (formats, sourceRegistry, debug) => {
const registry = new Registry();
CORE_FORMATS.forEach(name => {
const coreBlot = sourceRegistry.query(name);
if (coreBlot) registry.register(coreBlot);
});
formats.forEach(name => {
let format = sourceRegistry.query(name);
if (!format) {
debug.error(`Cannot register "${name}" specified in "formats" config. Are you sure it was registered?`);
}
let iterations = 0;
while (format) {
registry.register(format);
format = 'blotName' in format ? format.requiredContainer ?? null : null;
iterations += 1;
if (iterations > MAX_REGISTER_ITERATIONS) {
debug.error(`Cycle detected in registering blot requiredContainer: "${name}"`);
break;
}
}
});
return registry;
};
export default createRegistryWithFormats;
//# sourceMappingURL=createRegistryWithFormats.js.map
@@ -0,0 +1,3 @@
"use strict";var Ee=Object.defineProperty;var wt=Object.getOwnPropertyDescriptor;var Pt=Object.getOwnPropertyNames;var Mt=Object.prototype.hasOwnProperty;var bt=(e,t)=>{for(var n in t)Ee(e,n,{get:t[n],enumerable:!0})},Ce=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Pt(t))!Mt.call(e,a)&&a!==n&&Ee(e,a,{get:()=>t[a],enumerable:!(r=wt(t,a))||r.enumerable});return e},M=(e,t,n)=>(Ce(e,t,"default"),n&&Ce(n,t,"default"));var It=e=>Ce(Ee({},"__esModule",{value:!0}),e);var E={};bt(E,{ReducerType:()=>je,SHOULD_AUTOBATCH:()=>ae,TaskAbortError:()=>D,Tuple:()=>V,addListener:()=>Se,asyncThunkCreator:()=>at,autoBatchEnhancer:()=>oe,buildCreateSlice:()=>Fe,clearAllListeners:()=>We,combineSlices:()=>Rt,configureStore:()=>et,createAction:()=>v,createActionCreatorInvariantMiddleware:()=>Ke,createAsyncThunk:()=>ue,createDraftSafeSelector:()=>Z,createDraftSafeSelectorCreator:()=>Re,createDynamicMiddleware:()=>Ct,createEntityAdapter:()=>ut,createImmutableStateInvariantMiddleware:()=>qe,createListenerMiddleware:()=>xt,createNextState:()=>x.produce,createReducer:()=>se,createSelector:()=>xe.createSelector,createSelectorCreator:()=>O.createSelectorCreator,createSerializableStateInvariantMiddleware:()=>Xe,createSlice:()=>ot,current:()=>x.current,findNonSerializableValue:()=>Me,formatProdErrorMessage:()=>R,freeze:()=>ke.freeze,isActionCreator:()=>te,isAllOf:()=>G,isAnyOf:()=>L,isAsyncThunkAction:()=>De,isDraft:()=>x.isDraft,isFluxStandardAction:()=>ne,isFulfilled:()=>ve,isImmutableDefault:()=>He,isPending:()=>be,isPlain:()=>Pe,isRejected:()=>q,isRejectedWithValue:()=>Ie,lruMemoize:()=>xe.lruMemoize,miniSerializeError:()=>Oe,nanoid:()=>j,original:()=>ke.original,prepareAutoBatched:()=>Ye,removeListener:()=>ge,unwrapResult:()=>Ne,weakMapMemoize:()=>O.weakMapMemoize});module.exports=It(E);M(E,require("redux"),module.exports);var ke=require("immer");var x=require("immer");var xe=require("reselect");var O=require("reselect");var Re=(...e)=>{let t=(0,O.createSelectorCreator)(...e),n=Object.assign((...r)=>{let a=t(...r),o=(i,...h)=>a((0,x.isDraft)(i)?(0,x.current)(i):i,...h);return Object.assign(o,a),o},{withTypes:()=>n});return n},Z=Re(O.weakMapMemoize);var P=require("redux");var Be=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?P.compose:P.compose.apply(null,arguments)},Sn=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};var re=require("redux-thunk");var ee=e=>e&&typeof e.match=="function";function v(e,t){function n(...r){if(t){let a=t(...r);if(!a)throw new Error(R(0));return{type:e,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>(0,P.isAction)(r)&&r.type===e,n}function te(e){return typeof e=="function"&&"type"in e&&ee(e)}function ne(e){return(0,P.isAction)(e)&&Object.keys(e).every(vt)}function vt(e){return["type","payload","error","meta"].indexOf(e)>-1}function Dt(e){let t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched.
Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}function Ke(e={}){return()=>n=>r=>n(r)}var V=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function we(e){return(0,x.isDraftable)(e)?(0,x.produce)(e,()=>{}):e}function N(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function He(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function qe(e={}){if(1)return()=>r=>a=>r(a);var t,n}function Pe(e){let t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||(0,P.isPlainObject)(e)}function Me(e,t="",n=Pe,r,a=[],o){let i;if(!n(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||o?.has(e))return!1;let h=r!=null?r(e):Object.entries(e),s=a.length>0;for(let[c,y]of h){let A=t?t+"."+c:c;if(!(s&&a.some(f=>f instanceof RegExp?f.test(A):A===f))){if(!n(y))return{keyPath:A,value:y};if(typeof y=="object"&&(i=Me(y,A,n,r,a,o),i))return i}}return o&&$e(e)&&o.add(e),!1}function $e(e){if(!Object.isFrozen(e))return!1;for(let t of Object.values(e))if(!(typeof t!="object"||t===null)&&!$e(t))return!1;return!0}function Xe(e={}){return()=>t=>n=>t(n)}function Ot(e){return typeof e=="boolean"}var Je=()=>function(t){let{thunk:n=!0,immutableCheck:r=!0,serializableCheck:a=!0,actionCreatorCheck:o=!0}=t??{},i=new V;return n&&(Ot(n)?i.push(re.thunk):i.push((0,re.withExtraArgument)(n.extraArgument))),i};var ae="RTK_autoBatch",Ye=()=>e=>({payload:e,meta:{[ae]:!0}}),Qe=e=>t=>{setTimeout(t,e)},oe=(e={type:"raf"})=>t=>(...n)=>{let r=t(...n),a=!0,o=!1,i=!1,h=new Set,s=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Qe(10):e.type==="callback"?e.queueNotification:Qe(e.timeout),c=()=>{i=!1,o&&(o=!1,h.forEach(y=>y()))};return Object.assign({},r,{subscribe(y){let A=()=>a&&y(),S=r.subscribe(A);return h.add(y),()=>{S(),h.delete(y)}},dispatch(y){try{return a=!y?.meta?.[ae],o=!a,o&&(i||(i=!0,s(c))),r.dispatch(y)}finally{a=!0}}})};var Ze=e=>function(n){let{autoBatch:r=!0}=n??{},a=new V(e);return r&&a.push(oe(typeof r=="object"?r:void 0)),a};function et(e){let t=Je(),{reducer:n=void 0,middleware:r,devTools:a=!0,duplicateMiddlewareCheck:o=!0,preloadedState:i=void 0,enhancers:h=void 0}=e||{},s;if(typeof n=="function")s=n;else if((0,P.isPlainObject)(n))s=(0,P.combineReducers)(n);else throw new Error(R(1));let c;typeof r=="function"?c=r(t):c=t();let y=P.compose;a&&(y=Be({trace:!1,...typeof a=="object"&&a}));let A=(0,P.applyMiddleware)(...c),S=Ze(A),f=typeof h=="function"?h(S):S(),d=y(...f);return(0,P.createStore)(s,i,d)}function ie(e){let t={},n=[],r,a={addCase(o,i){let h=typeof o=="string"?o:o.type;if(!h)throw new Error(R(28));if(h in t)throw new Error(R(29));return t[h]=i,a},addAsyncThunk(o,i){return i.pending&&(t[o.pending.type]=i.pending),i.rejected&&(t[o.rejected.type]=i.rejected),i.fulfilled&&(t[o.fulfilled.type]=i.fulfilled),i.settled&&n.push({matcher:o.settled,reducer:i.settled}),a},addMatcher(o,i){return n.push({matcher:o,reducer:i}),a},addDefaultCase(o){return r=o,a}};return e(a),[t,n,r]}(0,x.setUseStrictIteration)(!1);function Nt(e){return typeof e=="function"}function se(e,t){let[n,r,a]=ie(t),o;if(Nt(e))o=()=>we(e());else{let h=we(e);o=()=>h}function i(h=o(),s){let c=[n[s.type],...r.filter(({matcher:y})=>y(s)).map(({reducer:y})=>y)];return c.filter(y=>!!y).length===0&&(c=[a]),c.reduce((y,A)=>{if(A)if((0,x.isDraft)(y)){let f=A(y,s);return f===void 0?y:f}else{if((0,x.isDraftable)(y))return(0,x.produce)(y,S=>A(S,s));{let S=A(y,s);if(S===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return y},h)}return i.getInitialState=o,i}var tt=(e,t)=>ee(e)?e.match(t):e(t);function L(...e){return t=>e.some(n=>tt(n,t))}function G(...e){return t=>e.every(n=>tt(n,t))}function ce(e,t){if(!e||!e.meta)return!1;let n=typeof e.meta.requestId=="string",r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function $(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function be(...e){return e.length===0?t=>ce(t,["pending"]):$(e)?L(...e.map(t=>t.pending)):be()(e[0])}function q(...e){return e.length===0?t=>ce(t,["rejected"]):$(e)?L(...e.map(t=>t.rejected)):q()(e[0])}function Ie(...e){let t=n=>n&&n.meta&&n.meta.rejectedWithValue;return e.length===0?G(q(...e),t):$(e)?G(q(...e),t):Ie()(e[0])}function ve(...e){return e.length===0?t=>ce(t,["fulfilled"]):$(e)?L(...e.map(t=>t.fulfilled)):ve()(e[0])}function De(...e){return e.length===0?t=>ce(t,["pending","fulfilled","rejected"]):$(e)?L(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):De()(e[0])}var jt="ModuleSymbhasOwnPr-012345678Line truncated
//# sourceMappingURL=redux-toolkit.production.min.cjs.map
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more