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

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

No files matched your search

@@ -0,0 +1,339 @@
"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/index.ts
var src_exports = {};
__export(src_exports, {
Button: () => button_default,
ButtonGroup: () => button_group_default,
ButtonGroupProvider: () => ButtonGroupProvider,
useButton: () => useButton,
useButtonGroup: () => useButtonGroup,
useButtonGroupContext: () => useButtonGroupContext
});
module.exports = __toCommonJS(src_exports);
// src/button.tsx
var import_spinner = require("@heroui/spinner");
var import_ripple2 = require("@heroui/ripple");
var import_system2 = require("@heroui/system");
// src/use-button.ts
var import_system = require("@heroui/system");
var import_shared_utils = require("@heroui/shared-utils");
var import_react = require("react");
var import_focus = require("@react-aria/focus");
var import_utils = require("@react-aria/utils");
var import_react_utils2 = require("@heroui/react-utils");
var import_theme = require("@heroui/theme");
var import_react2 = require("react");
var import_use_aria_button = require("@heroui/use-aria-button");
var import_interactions = require("@react-aria/interactions");
var import_ripple = require("@heroui/ripple");
// src/button-group-context.ts
var import_react_utils = require("@heroui/react-utils");
var [ButtonGroupProvider, useButtonGroupContext] = (0, import_react_utils.createContext)({
name: "ButtonGroupContext",
strict: false
});
// src/use-button.ts
function useButton(props) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
const groupContext = useButtonGroupContext();
const globalContext = (0, import_system.useProviderContext)();
const isInGroup = !!groupContext;
const {
ref,
as,
children,
startContent: startContentProp,
endContent: endContentProp,
autoFocus,
className,
spinner,
isLoading = false,
disableRipple: disableRippleProp = false,
fullWidth = (_a = groupContext == null ? void 0 : groupContext.fullWidth) != null ? _a : false,
radius = groupContext == null ? void 0 : groupContext.radius,
size = (_b = groupContext == null ? void 0 : groupContext.size) != null ? _b : "md",
color = (_c = groupContext == null ? void 0 : groupContext.color) != null ? _c : "default",
variant = (_d = groupContext == null ? void 0 : groupContext.variant) != null ? _d : "solid",
disableAnimation = (_f = (_e = groupContext == null ? void 0 : groupContext.disableAnimation) != null ? _e : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _f : false,
isDisabled: isDisabledProp = (_g = groupContext == null ? void 0 : groupContext.isDisabled) != null ? _g : false,
isIconOnly = (_h = groupContext == null ? void 0 : groupContext.isIconOnly) != null ? _h : false,
spinnerPlacement = "start",
onPress,
onClick,
...otherProps
} = props;
const Component = as || "button";
const shouldFilterDOMProps = typeof Component === "string";
const domRef = (0, import_react_utils2.useDOMRef)(ref);
const disableRipple = (_i = disableRippleProp || (globalContext == null ? void 0 : globalContext.disableRipple)) != null ? _i : disableAnimation;
const { isFocusVisible, isFocused, focusProps } = (0, import_focus.useFocusRing)({
autoFocus
});
const isDisabled = isDisabledProp || isLoading;
const styles = (0, import_react2.useMemo)(
() => (0, import_theme.button)({
size,
color,
variant,
radius,
fullWidth,
isDisabled,
isInGroup,
disableAnimation,
isIconOnly,
className
}),
[
size,
color,
variant,
radius,
fullWidth,
isDisabled,
isInGroup,
isIconOnly,
disableAnimation,
className
]
);
const { onPress: onRipplePressHandler, onClear: onClearRipple, ripples } = (0, import_ripple.useRipple)();
const handlePress = (0, import_react.useCallback)(
(e) => {
if (disableRipple || isDisabled || disableAnimation)
return;
domRef.current && onRipplePressHandler(e);
},
[disableRipple, isDisabled, disableAnimation, domRef, onRipplePressHandler]
);
const { buttonProps: ariaButtonProps, isPressed } = (0, import_use_aria_button.useAriaButton)(
{
elementType: as,
isDisabled,
onPress: (0, import_utils.chain)(onPress, handlePress),
onClick,
...otherProps
},
domRef
);
const { isHovered, hoverProps } = (0, import_interactions.useHover)({ isDisabled });
const getButtonProps = (0, import_react.useCallback)(
(props2 = {}) => ({
"data-disabled": (0, import_shared_utils.dataAttr)(isDisabled),
"data-focus": (0, import_shared_utils.dataAttr)(isFocused),
"data-pressed": (0, import_shared_utils.dataAttr)(isPressed),
"data-focus-visible": (0, import_shared_utils.dataAttr)(isFocusVisible),
"data-hover": (0, import_shared_utils.dataAttr)(isHovered),
"data-loading": (0, import_shared_utils.dataAttr)(isLoading),
...(0, import_utils.mergeProps)(
ariaButtonProps,
focusProps,
hoverProps,
(0, import_react_utils2.filterDOMProps)(otherProps, {
enabled: shouldFilterDOMProps
}),
(0, import_react_utils2.filterDOMProps)(props2)
)
}),
[
isLoading,
isDisabled,
isFocused,
isPressed,
shouldFilterDOMProps,
isFocusVisible,
isHovered,
ariaButtonProps,
focusProps,
hoverProps,
otherProps
]
);
const getIconClone = (icon) => (0, import_react2.isValidElement)(icon) ? (0, import_react2.cloneElement)(icon, {
"aria-hidden": true,
focusable: false,
tabIndex: -1
}) : null;
const startContent = getIconClone(startContentProp);
const endContent = getIconClone(endContentProp);
const spinnerSize = (0, import_react2.useMemo)(() => {
const buttonSpinnerSizeMap = {
sm: "sm",
md: "sm",
lg: "md"
};
return buttonSpinnerSizeMap[size];
}, [size]);
const getRippleProps = (0, import_react.useCallback)(
() => ({ ripples, onClear: onClearRipple }),
[ripples, onClearRipple]
);
return {
Component,
children,
domRef,
spinner,
styles,
startContent,
endContent,
isLoading,
spinnerPlacement,
spinnerSize,
disableRipple,
getButtonProps,
getRippleProps,
isIconOnly
};
}
// src/button.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var Button = (0, import_system2.forwardRef)((props, ref) => {
const {
Component,
domRef,
children,
styles,
spinnerSize,
spinner = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_spinner.Spinner, { color: "current", size: spinnerSize }),
spinnerPlacement,
startContent,
endContent,
isLoading,
disableRipple,
getButtonProps,
getRippleProps,
isIconOnly
} = useButton({ ...props, ref });
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Component, { ref: domRef, className: styles, ...getButtonProps(), children: [
startContent,
isLoading && spinnerPlacement === "start" && spinner,
isLoading && isIconOnly ? null : children,
isLoading && spinnerPlacement === "end" && spinner,
endContent,
!disableRipple && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ripple2.Ripple, { ...getRippleProps() })
] });
});
Button.displayName = "HeroUI.Button";
var button_default = Button;
// src/button-group.tsx
var import_system4 = require("@heroui/system");
// src/use-button-group.ts
var import_theme2 = require("@heroui/theme");
var import_system3 = require("@heroui/system");
var import_react_utils3 = require("@heroui/react-utils");
var import_react3 = require("react");
var import_shared_utils2 = require("@heroui/shared-utils");
function useButtonGroup(originalProps) {
var _a, _b;
const globalContext = (0, import_system3.useProviderContext)();
const [props, variantProps] = (0, import_system3.mapPropsVariants)(originalProps, import_theme2.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 = (0, import_react_utils3.useDOMRef)(ref);
const classNames = (0, import_react3.useMemo)(
() => (0, import_theme2.buttonGroup)({
...variantProps,
className
}),
[(0, import_shared_utils2.objectToDeps)(variantProps), className]
);
const context = (0, import_react3.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 = (0, import_react3.useCallback)(
() => ({
role: "group",
...otherProps
}),
[otherProps]
);
return {
Component,
children,
domRef,
context,
classNames,
getButtonGroupProps
};
}
// src/button-group.tsx
var import_jsx_runtime2 = require("react/jsx-runtime");
var ButtonGroup = (0, import_system4.forwardRef)((props, ref) => {
const { Component, domRef, context, children, classNames, getButtonGroupProps } = useButtonGroup({
...props,
ref
});
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ButtonGroupProvider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Component, { ref: domRef, className: classNames, ...getButtonGroupProps(), children }) });
});
ButtonGroup.displayName = "HeroUI.ButtonGroup";
var button_group_default = ButtonGroup;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Button,
ButtonGroup,
ButtonGroupProvider,
useButton,
useButtonGroup,
useButtonGroupContext
});
@@ -0,0 +1 @@
{"mappings":";;;AAAA;;;;;;;;;;CAUC,GAEA,uCAAuC;;AAoBxC,oFAAoF;AACpF,sFAAsF;AACtF,oFAAoF;AACpF,MAAM,yCAAkC,EAAE;AAOnC,SAAS,0CAAU,KAAqB;IAC7C,QAAQ,IAAI,CAAC;IACb,IAAI,gBAAC,YAAY,WAAE,OAAO,eAAE,WAAW,WAAE,OAAO,UAAE,MAAM,oBAAE,gBAAgB,eAAE,WAAW,eAAE,WAAW,oBAAE,gBAAgB,oBAAE,gBAAgB,oBAAE,gBAAgB,EAAC,GAAG;IAC9J,IAAI,cAAc,CAAC,IAAM,gBAAgB,eAAe,EAAE,OAAO,GAAG,EAAE,OAAO;IAC7E,IAAI,gBAAgB,CAAC;QACnB,IAAI,kBAAkB,CAAA,GAAA,yCAAQ,EAAE,aAAa,OAAO,EAAE,SAAS;QAC/D,IAAI,cAAc,YAAY;QAC9B,IAAI,aAAa,UAAU,kBAAkB,cAAc,cAAc;QACzE,OAAO;IACT;IACA,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;IACtB,IAAI,eAAe,CAAA,GAAA,aAAK,EAAE;IAE1B,kFAAkF;IAClF,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;0BAAC;gBAAkB;IAAM;IAC/C,SAAS,OAAO,CAAC,MAAM,GAAG;IAC1B,SAAS,OAAO,CAAC,gBAAgB,GAAG;IAEpC,IAAI,iBAAiB,CAAC;QACpB,EAAE,cAAc;QAChB,IAAI,aAAa,cAAc;QAC/B,IAAI,CAAC,SAAS,OAAO,EAAE;YACrB,SAAS,OAAO,GAAG;YACnB,IAAI,SAAS,OAAO,CAAC,MAAM,EACzB,SAAS,OAAO,CAAC,MAAM,CAAC;YAE1B,IAAI,SAAS,OAAO,CAAC,gBAAgB,EACnC,SAAS,OAAO,CAAC,gBAAgB,CAAC;QAEtC;QACA,IAAI,aAAa,OAAO,KAAK,YAC3B;QAEF,aAAa,OAAO,GAAG;QACvB,IAAI,kBACF,iBAAiB;IAErB;IAEA,IAAI,YAAY,CAAC;QACf,MAAM,SAAS,EAAE,MAAM;QACvB,SAAS,OAAO,GAAG;QACnB,IAAI,aAAa,cAAc;QAC/B,IAAI,SAAS,OAAO,CAAC,MAAM,EACzB,SAAS,OAAO,CAAC,MAAM,CAAC;QAE1B,IAAI,SAAS,OAAO,CAAC,gBAAgB,EACnC,SAAS,OAAO,CAAC,gBAAgB,CAAC;QAGpC,uCAAiB,MAAM,CAAC,uCAAiB,OAAO,CAAC,SAAS;QAC1D,OAAO,mBAAmB,CAAC,WAAW,WAAW;QACjD,OAAO,mBAAmB,CAAC,aAAa,gBAAgB;IAC1D;IAEA,IAAI,cAAc,CAAC;QACjB,MAAM,SAAS,EAAE,aAAa;QAC9B,0EAA0E;QAC1E,kEAAkE;QAClE,IAAI,uCAAiB,IAAI,CAAC,CAAA,MAAO,OAAO,QAAQ,CAAC,OAC/C;QAEF,uCAAiB,IAAI,CAAC;QACtB,OAAO,gBAAgB,CAAC,aAAa,gBAAgB;QACrD,OAAO,gBAAgB,CAAC,WAAW,WAAW;IAChD;IAEA,IAAI,eAAe;QACjB,IAAI,SACF,QAAQ;IAEZ;IAEA,IAAI,aAAa;QACf,IAAI,SACF,QAAQ;IAEZ;IAEA,IAAI,YAAY,CAAC;QACf,OAAQ,EAAE,GAAG;YACX,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,cAAc;oBAChC,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,YAAY;oBAC9B,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,cAAc;oBAChC,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,YAAY;oBAC9B,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;gBACH,EAAE,cAAc;gBAChB,IAAI,kBACF;gBAEF;YACF,KAAK;gBACH,EAAE,cAAc;gBAChB,IAAI,kBACF;gBAEF;YACF,KAAK;gBACH,EAAE,cAAc;gBAChB,IAAI,kBACF;gBAEF;QACJ;IACF;IAEA,OAAO;qBAAC;sBAAa;oBAAc;mBAAY;IAAS;AAC1D","sources":["packages/@react-aria/utils/src/useDrag1D.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 /* eslint-disable rulesdir/pure-render */\n\nimport {getOffset} from './getOffset';\nimport {Orientation} from '@react-types/shared';\nimport React, {HTMLAttributes, MutableRefObject, useRef} from 'react';\n\ninterface UseDrag1DProps {\n containerRef: MutableRefObject<HTMLElement>,\n reverse?: boolean,\n orientation?: Orientation,\n onHover?: (hovered: boolean) => void,\n onDrag?: (dragging: boolean) => void,\n onPositionChange?: (position: number) => void,\n onIncrement?: () => void,\n onDecrement?: () => void,\n onIncrementToMax?: () => void,\n onDecrementToMin?: () => void,\n onCollapseToggle?: () => void\n}\n\n// Keep track of elements that we are currently handling dragging for via useDrag1D.\n// If there's an ancestor and a descendant both using useDrag1D(), and the user starts\n// dragging the descendant, we don't want useDrag1D events to fire for the ancestor.\nconst draggingElements: HTMLElement[] = [];\n\n// created for splitview, this should be reusable for things like sliders/dials\n// It also handles keyboard events on the target allowing for increment/decrement by a given stepsize as well as minifying/maximizing and toggling between minified and previous size\n// It can also take a 'reverse' param to say if we should measure from the right/bottom instead of the top/left\n// It can also handle either a vertical or horizontal movement, but not both at the same time\n\nexport function useDrag1D(props: UseDrag1DProps): HTMLAttributes<HTMLElement> {\n console.warn('useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html');\n let {containerRef, reverse, orientation, onHover, onDrag, onPositionChange, onIncrement, onDecrement, onIncrementToMax, onDecrementToMin, onCollapseToggle} = props;\n let getPosition = (e) => orientation === 'horizontal' ? e.clientXLine truncated
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.V2Form = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const asn1_x509_1 = require("@peculiar/asn1-x509");
const issuer_serial_1 = require("./issuer_serial");
const object_digest_info_1 = require("./object_digest_info");
class V2Form {
constructor(params = {}) {
Object.assign(this, params);
}
}
exports.V2Form = V2Form;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.GeneralNames, optional: true })
], V2Form.prototype, "issuerName", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: issuer_serial_1.IssuerSerial, context: 0, implicit: true, optional: true })
], V2Form.prototype, "baseCertificateID", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: object_digest_info_1.ObjectDigestInfo, context: 1, implicit: true, optional: true })
], V2Form.prototype, "objectDigestInfo", void 0);
@@ -0,0 +1,33 @@
import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment.cts';
export type MemoState = {
lastKey: number;
lastNeedle: number;
lastIndex: number;
};
export declare let found: boolean;
/**
* A binary search implementation that returns the index if a match is found.
* If no match is found, then the left-index (the index associated with the item that comes just
* before the desired index) is returned. To maintain proper sort order, a splice would happen at
* the next index:
*
* ```js
* const array = [1, 3];
* const needle = 2;
* const index = binarySearch(array, needle, (item, needle) => item - needle);
*
* assert.equal(index, 0);
* array.splice(index + 1, 0, needle);
* assert.deepEqual(array, [1, 2, 3]);
* ```
*/
export declare function binarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, low: number, high: number): number;
export declare function upperBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number;
export declare function lowerBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number;
export declare function memoizedState(): MemoState;
/**
* This overly complicated beast is just to record the last tested line/column and the resulting
* index, allowing us to skip a few tests if mappings are monotonically increasing.
*/
export declare function memoizedBinarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, state: MemoState, key: number): number;
//# sourceMappingURL=binary-search.d.ts.map
@@ -0,0 +1,274 @@
import type {
Api,
BaseQueryFn,
EndpointDefinitions,
InfiniteQueryDefinition,
Module,
MutationDefinition,
PrefetchOptions,
QueryArgFrom,
QueryDefinition,
QueryKeys,
} from '@reduxjs/toolkit/query'
import {
batch as rrBatch,
useDispatch as rrUseDispatch,
useSelector as rrUseSelector,
useStore as rrUseStore,
} from 'react-redux'
import { createSelector as _createSelector } from 'reselect'
import {
isInfiniteQueryDefinition,
isMutationDefinition,
isQueryDefinition,
} from '../endpointDefinitions'
import { safeAssign } from '../tsHelpers'
import { capitalize, countObjectKeys } from '../utils'
import type {
InfiniteQueryHooks,
MutationHooks,
QueryHooks,
} from './buildHooks'
import { buildHooks } from './buildHooks'
import type { HooksWithUniqueNames } from './namedHooks'
export const reactHooksModuleName = /* @__PURE__ */ Symbol()
export type ReactHooksModule = typeof reactHooksModuleName
declare module '@reduxjs/toolkit/query' {
export interface ApiModules<
// eslint-disable-next-line @typescript-eslint/no-unused-vars
BaseQuery extends BaseQueryFn,
Definitions extends EndpointDefinitions,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
ReducerPath extends string,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
TagTypes extends string,
> {
[reactHooksModuleName]: {
/**
* Endpoints based on the input endpoints provided to `createApi`, containing `select`, `hooks` and `action matchers`.
*/
endpoints: {
[K in keyof Definitions]: Definitions[K] extends QueryDefinition<
any,
any,
any,
any,
any
>
? QueryHooks<Definitions[K]>
: Definitions[K] extends MutationDefinition<any, any, any, any, any>
? MutationHooks<Definitions[K]>
: Definitions[K] extends InfiniteQueryDefinition<
any,
any,
any,
any,
any
>
? InfiniteQueryHooks<Definitions[K]>
: never
}
/**
* A hook that accepts a string endpoint name, and provides a callback that when called, pre-fetches the data for that endpoint.
*/
usePrefetch<EndpointName extends QueryKeys<Definitions>>(
endpointName: EndpointName,
options?: PrefetchOptions,
): (
arg: QueryArgFrom<Definitions[EndpointName]>,
options?: PrefetchOptions,
) => void
} & HooksWithUniqueNames<Definitions>
}
}
type RR = typeof import('react-redux')
export interface ReactHooksModuleOptions {
/**
* The hooks from React Redux to be used
*/
hooks?: {
/**
* The version of the `useDispatch` hook to be used
*/
useDispatch: RR['useDispatch']
/**
* The version of the `useSelector` hook to be used
*/
useSelector: RR['useSelector']
/**
* The version of the `useStore` hook to be used
*/
useStore: RR['useStore']
}
/**
* The version of the `batchedUpdates` function to be used
*/
batch?: RR['batch']
/**
* Enables performing asynchronous tasks immediately within a render.
*
* @example
*
* ```ts
* import {
* buildCreateApi,
* coreModule,
* reactHooksModule
* } from '@reduxjs/toolkit/query/react'
*
* const createApi = buildCreateApi(
* coreModule(),
* reactHooksModule({ unstable__sideEffectsInRender: true })
* )
* ```
*/
unstable__sideEffectsInRender?: boolean
/**
* A selector creator (usually from `reselect`, or matching the same signature)
*/
createSelector?: typeof _createSelector
}
/**
* Creates a module that generates react hooks from endpoints, for use with `buildCreateApi`.
*
* @example
* ```ts
* const MyContext = React.createContext<ReactReduxContextValue | null>(null);
* const customCreateApi = buildCreateApi(
* coreModule(),
* reactHooksModule({
* hooks: {
* useDispatch: createDispatchHook(MyContext),
* useSelector: createSelectorHook(MyContext),
* useStore: createStoreHook(MyContext)
* }
* })
* );
* ```
*
* @returns A module for use with `buildCreateApi`
*/
export const reactHooksModule = ({
batch = rrBatch,
hooks = {
useDispatch: rrUseDispatch,
useSelector: rrUseSelector,
useStore: rrUseStore,
},
createSelector = _createSelector,
unstable__sideEffectsInRender = false,
...rest
}: ReactHooksModuleOptions = {}): Module<ReactHooksModule> => {
if (process.env.NODE_ENV !== 'production') {
const hookNames = ['useDispatch', 'useSelector', 'useStore'] as const
let warned = false
for (const hookName of hookNames) {
// warn for old hook options
if (countObjectKeys(rest) > 0) {
if ((rest as Partial<typeof hooks>)[hookName]) {
if (!warned) {
console.warn(
'As of RTK 2.0, the hooks now need to be specified as one object, provided under a `hooks` key:' +
'\n`reactHooksModule({ hooks: { useDispatch, useSelector, useStore } })`',
)
warned = true
}
}
// migrate
// @ts-ignore
hooks[hookName] = rest[hookName]
}
// then make sure we have them all
if (typeof hooks[hookName] !== 'function') {
throw new Error(
`When using custom hooks for context, all ${
hookNames.length
} hooks need to be provided: ${hookNames.join(
', ',
)}.\nHook ${hookName} was either not provided or not a function.`,
)
}
}
}
return {
name: reactHooksModuleName,
init(api, { serializeQueryArgs }, context) {
const anyApi = api as any as Api<
any,
Record<string, any>,
any,
any,
ReactHooksModule
>
const {
buildQueryHooks,
buildInfiniteQueryHooks,
buildMutationHook,
usePrefetch,
} = buildHooks({
api,
moduleOptions: {
batch,
hooks,
unstable__sideEffectsInRender,
createSelector,
},
serializeQueryArgs,
context,
})
safeAssign(anyApi, { usePrefetch })
safeAssign(context, { batch })
return {
injectEndpoint(endpointName, definition) {
if (isQueryDefinition(definition)) {
const {
useQuery,
useLazyQuery,
useLazyQuerySubscription,
useQueryState,
useQuerySubscription,
} = buildQueryHooks(endpointName)
safeAssign(anyApi.endpoints[endpointName], {
useQuery,
useLazyQuery,
useLazyQuerySubscription,
useQueryState,
useQuerySubscription,
})
;(api as any)[`use${capitalize(endpointName)}Query`] = useQuery
;(api as any)[`useLazy${capitalize(endpointName)}Query`] =
useLazyQuery
}
if (isMutationDefinition(definition)) {
const useMutation = buildMutationHook(endpointName)
safeAssign(anyApi.endpoints[endpointName], {
useMutation,
})
;(api as any)[`use${capitalize(endpointName)}Mutation`] =
useMutation
} else if (isInfiniteQueryDefinition(definition)) {
const {
useInfiniteQuery,
useInfiniteQuerySubscription,
useInfiniteQueryState,
} = buildInfiniteQueryHooks(endpointName)
safeAssign(anyApi.endpoints[endpointName], {
useInfiniteQuery,
useInfiniteQuerySubscription,
useInfiniteQueryState,
})
;(api as any)[`use${capitalize(endpointName)}InfiniteQuery`] =
useInfiniteQuery
}
},
}
},
}
}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=cloneDynamicValueBinding.spec.d.ts.map
@@ -0,0 +1,8 @@
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
import { Kind } from '../symbols/index.mjs';
export interface TAny extends TSchema {
[Kind]: 'Any';
static: any;
}
/** `[Json]` Creates an Any type */
export declare function Any(options?: SchemaOptions): TAny;
@@ -0,0 +1,13 @@
import {TagPath} from './TagPath.js';
export default class TagPathMatcher{
constructor(stack,node){
this.stack = stack;
this.node= node;
}
match(path){
const tagPath = new TagPath(path);
return tagPath.match(this.stack, this.node);
}
}
@@ -0,0 +1,159 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = retry;
var _wrapAsync = require('./internal/wrapAsync.js');
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
var _promiseCallback = require('./internal/promiseCallback.js');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function constant(value) {
return function () {
return value;
};
}
/**
* Attempts to get a successful response from `task` no more than `times` times
* before returning an error. If the task is successful, the `callback` will be
* passed the result of the successful task. If all attempts fail, the callback
* will be passed the error and result (if any) of the final attempt.
*
* @name retry
* @static
* @memberOf module:ControlFlow
* @method
* @category Control Flow
* @see [async.retryable]{@link module:ControlFlow.retryable}
* @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an
* object with `times` and `interval` or a number.
* * `times` - The number of attempts to make before giving up. The default
* is `5`.
* * `interval` - The time to wait between retries, in milliseconds. The
* default is `0`. The interval may also be specified as a function of the
* retry count (see example).
* * `errorFilter` - An optional synchronous function that is invoked on
* erroneous result. If it returns `true` the retry attempts will continue;
* if the function returns `false` the retry flow is aborted with the current
* attempt's error and result being returned to the final callback.
* Invoked with (err).
* * If `opts` is a number, the number specifies the number of times to retry,
* with the default interval of `0`.
* @param {AsyncFunction} task - An async function to retry.
* Invoked with (callback).
* @param {Function} [callback] - An optional callback which is called when the
* task has succeeded, or after the final failed attempt. It receives the `err`
* and `result` arguments of the last attempt at completing the `task`. Invoked
* with (err, results).
* @returns {Promise} a promise if no callback provided
*
* @example
*
* // The `retry` function can be used as a stand-alone control flow by passing
* // a callback, as shown below:
*
* // try calling apiMethod 3 times
* async.retry(3, apiMethod, function(err, result) {
* // do something with the result
* });
*
* // try calling apiMethod 3 times, waiting 200 ms between each retry
* async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {
* // do something with the result
* });
*
* // try calling apiMethod 10 times with exponential backoff
* // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds)
* async.retry({
* times: 10,
* interval: function(retryCount) {
* return 50 * Math.pow(2, retryCount);
* }
* }, apiMethod, function(err, result) {
* // do something with the result
* });
*
* // try calling apiMethod the default 5 times no delay between each retry
* async.retry(apiMethod, function(err, result) {
* // do something with the result
* });
*
* // try calling apiMethod only when error condition satisfies, all other
* // errors will abort the retry control flow and return to final callback
* async.retry({
* errorFilter: function(err) {
* return err.message === 'Temporary error'; // only retry on a specific error
* }
* }, apiMethod, function(err, result) {
* // do something with the result
* });
*
* // to retry individual methods that are not as reliable within other
* // control flow functions, use the `retryable` wrapper:
* async.auto({
* users: api.getUsers.bind(api),
* payments: async.retryable(3, api.getPayments.bind(api))
* }, function(err, results) {
* // do something with the results
* });
*
*/
const DEFAULT_TIMES = 5;
const DEFAULT_INTERVAL = 0;
function retry(opts, task, callback) {
var options = {
times: DEFAULT_TIMES,
intervalFunc: constant(DEFAULT_INTERVAL)
};
if (arguments.length < 3 && typeof opts === 'function') {
callback = task || (0, _promiseCallback.promiseCallback)();
task = opts;
} else {
parseTimes(options, opts);
callback = callback || (0, _promiseCallback.promiseCallback)();
}
if (typeof task !== 'function') {
throw new Error("Invalid arguments for async.retry");
}
var _task = (0, _wrapAsync2.default)(task);
var attempt = 1;
function retryAttempt() {
_task((err, ...args) => {
if (err === false) return;
if (err && attempt++ < options.times && (typeof options.errorFilter != 'function' || options.errorFilter(err))) {
setTimeout(retryAttempt, options.intervalFunc(attempt - 1));
} else {
callback(err, ...args);
}
});
}
retryAttempt();
return callback[_promiseCallback.PROMISE_SYMBOL];
}
function parseTimes(acc, t) {
if (typeof t === 'object') {
acc.times = +t.times || DEFAULT_TIMES;
acc.intervalFunc = typeof t.interval === 'function' ? t.interval : constant(+t.interval || DEFAULT_INTERVAL);
acc.errorFilter = t.errorFilter;
} else if (typeof t === 'number' || typeof t === 'string') {
acc.times = +t || DEFAULT_TIMES;
} else {
throw new Error("Invalid arguments for async.retry");
}
}
module.exports = exports.default;
@@ -0,0 +1,13 @@
export type FormatRegistryValidationFunction = (value: string) => boolean;
/** Returns the entries in this registry */
export declare function Entries(): Map<string, FormatRegistryValidationFunction>;
/** Clears all user defined string formats */
export declare function Clear(): void;
/** Deletes a registered format */
export declare function Delete(format: string): boolean;
/** Returns true if the user defined string format exists */
export declare function Has(format: string): boolean;
/** Sets a validation function for a user defined string format */
export declare function Set(format: string, func: FormatRegistryValidationFunction): void;
/** Gets a validation function for a user defined string format */
export declare function Get(format: string): FormatRegistryValidationFunction | undefined;
@@ -0,0 +1,2 @@
import type * as ts from 'typescript';
export declare function specifierNameMatches(type: ts.Type, names: string | string[]): boolean;
@@ -0,0 +1,3 @@
# @react-stately/virtualizer
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.
@@ -0,0 +1,14 @@
'use strict';
var MAX_SAFE_INTEGER = require('math-intrinsics/constants/maxSafeInteger');
var ToInteger = require('./ToInteger');
// https://262.ecma-international.org/6.0/#sec-tolength
module.exports = function ToLength(argument) {
var len = ToInteger(argument);
if (len <= 0) { return 0; } // includes converting -0 to +0
if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }
return len;
};
@@ -0,0 +1,393 @@
/*
This file is copied from https://github.com/nodejs/node/blob/v14.19.3/lib/internal/per_context/primordials.js
under the following license:
Copyright Node.js contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
*/
'use strict';
/* eslint-disable node-core/prefer-primordials */
// This file subclasses and stores the JS builtins that come from the VM
// so that Node.js's builtin modules do not need to later look these up from
// the global proxy, which can be mutated by users.
// Use of primordials have sometimes a dramatic impact on performance, please
// benchmark all changes made in performance-sensitive areas of the codebase.
// See: https://github.com/nodejs/node/pull/38248
const primordials = {};
const {
defineProperty: ReflectDefineProperty,
getOwnPropertyDescriptor: ReflectGetOwnPropertyDescriptor,
ownKeys: ReflectOwnKeys,
} = Reflect;
// `uncurryThis` is equivalent to `func => Function.prototype.call.bind(func)`.
// It is using `bind.bind(call)` to avoid using `Function.prototype.bind`
// and `Function.prototype.call` after it may have been mutated by users.
const { apply, bind, call } = Function.prototype;
const uncurryThis = bind.bind(call);
primordials.uncurryThis = uncurryThis;
// `applyBind` is equivalent to `func => Function.prototype.apply.bind(func)`.
// It is using `bind.bind(apply)` to avoid using `Function.prototype.bind`
// and `Function.prototype.apply` after it may have been mutated by users.
const applyBind = bind.bind(apply);
primordials.applyBind = applyBind;
// Methods that accept a variable number of arguments, and thus it's useful to
// also create `${prefix}${key}Apply`, which uses `Function.prototype.apply`,
// instead of `Function.prototype.call`, and thus doesn't require iterator
// destructuring.
const varargsMethods = [
// 'ArrayPrototypeConcat' is omitted, because it performs the spread
// on its own for arrays and array-likes with a truthy
// @@isConcatSpreadable symbol property.
'ArrayOf',
'ArrayPrototypePush',
'ArrayPrototypeUnshift',
// 'FunctionPrototypeCall' is omitted, since there's 'ReflectApply'
// and 'FunctionPrototypeApply'.
'MathHypot',
'MathMax',
'MathMin',
'StringPrototypeConcat',
'TypedArrayOf',
];
function getNewKey(key) {
return typeof key === 'symbol' ?
`Symbol${key.description[7].toUpperCase()}${key.description.slice(8)}` :
`${key[0].toUpperCase()}${key.slice(1)}`;
}
function copyAccessor(dest, prefix, key, { enumerable, get, set }) {
ReflectDefineProperty(dest, `${prefix}Get${key}`, {
value: uncurryThis(get),
enumerable
});
if (set !== undefined) {
ReflectDefineProperty(dest, `${prefix}Set${key}`, {
value: uncurryThis(set),
enumerable
});
}
}
function copyPropsRenamed(src, dest, prefix) {
for (const key of ReflectOwnKeys(src)) {
const newKey = getNewKey(key);
const desc = ReflectGetOwnPropertyDescriptor(src, key);
if ('get' in desc) {
copyAccessor(dest, prefix, newKey, desc);
} else {
const name = `${prefix}${newKey}`;
ReflectDefineProperty(dest, name, desc);
if (varargsMethods.includes(name)) {
ReflectDefineProperty(dest, `${name}Apply`, {
// `src` is bound as the `this` so that the static `this` points
// to the object it was defined on,
// e.g.: `ArrayOfApply` gets a `this` of `Array`:
value: applyBind(desc.value, src),
});
}
}
}
}
function copyPropsRenamedBound(src, dest, prefix) {
for (const key of ReflectOwnKeys(src)) {
const newKey = getNewKey(key);
const desc = ReflectGetOwnPropertyDescriptor(src, key);
if ('get' in desc) {
copyAccessor(dest, prefix, newKey, desc);
} else {
const { value } = desc;
if (typeof value === 'function') {
desc.value = value.bind(src);
}
const name = `${prefix}${newKey}`;
ReflectDefineProperty(dest, name, desc);
if (varargsMethods.includes(name)) {
ReflectDefineProperty(dest, `${name}Apply`, {
value: applyBind(value, src),
});
}
}
}
}
function copyPrototype(src, dest, prefix) {
for (const key of ReflectOwnKeys(src)) {
const newKey = getNewKey(key);
const desc = ReflectGetOwnPropertyDescriptor(src, key);
if ('get' in desc) {
copyAccessor(dest, prefix, newKey, desc);
} else {
const { value } = desc;
if (typeof value === 'function') {
desc.value = uncurryThis(value);
}
const name = `${prefix}${newKey}`;
ReflectDefineProperty(dest, name, desc);
if (varargsMethods.includes(name)) {
ReflectDefineProperty(dest, `${name}Apply`, {
value: applyBind(value),
});
}
}
}
}
// Create copies of configurable value properties of the global object
[
'Proxy',
'globalThis',
].forEach((name) => {
// eslint-disable-next-line no-restricted-globals
primordials[name] = globalThis[name];
});
// Create copies of URI handling functions
[
decodeURI,
decodeURIComponent,
encodeURI,
encodeURIComponent,
].forEach((fn) => {
primordials[fn.name] = fn;
});
// Create copies of the namespace objects
[
'JSON',
'Math',
'Proxy',
'Reflect',
].forEach((name) => {
// eslint-disable-next-line no-restricted-globals
copyPropsRenamed(global[name], primordials, name);
});
// Create copies of intrinsic objects
[
'Array',
'ArrayBuffer',
'BigInt',
'BigInt64Array',
'BigUint64Array',
'Boolean',
'DataView',
'Date',
'Error',
'EvalError',
'Float32Array',
'Float64Array',
'Function',
'Int16Array',
'Int32Array',
'Int8Array',
'Map',
'Number',
'Object',
'RangeError',
'ReferenceError',
'RegExp',
'Set',
'String',
'Symbol',
'SyntaxError',
'TypeError',
'URIError',
'Uint16Array',
'Uint32Array',
'Uint8Array',
'Uint8ClampedArray',
'WeakMap',
'WeakSet',
].forEach((name) => {
// eslint-disable-next-line no-restricted-globals
const original = global[name];
primordials[name] = original;
copyPropsRenamed(original, primordials, name);
copyPrototype(original.prototype, primordials, `${name}Prototype`);
});
// Create copies of intrinsic objects that require a valid `this` to call
// static methods.
// Refs: https://www.ecma-international.org/ecma-262/#sec-promise.all
[
'Promise',
].forEach((name) => {
// eslint-disable-next-line no-restricted-globals
const original = global[name];
primordials[name] = original;
copyPropsRenamedBound(original, primordials, name);
copyPrototype(original.prototype, primordials, `${name}Prototype`);
});
// Create copies of abstract intrinsic objects that are not directly exposed
// on the global object.
// Refs: https://tc39.es/ecma262/#sec-%typedarray%-intrinsic-object
[
{ name: 'TypedArray', original: Reflect.getPrototypeOf(Uint8Array) },
{ name: 'ArrayIterator', original: {
prototype: Reflect.getPrototypeOf(Array.prototype[Symbol.iterator]()),
} },
{ name: 'StringIterator', original: {
prototype: Reflect.getPrototypeOf(String.prototype[Symbol.iterator]()),
} },
].forEach(({ name, original }) => {
primordials[name] = original;
// The static %TypedArray% methods require a valid `this`, but can't be bound,
// as they need a subclass constructor as the receiver:
copyPrototype(original, primordials, name);
copyPrototype(original.prototype, primordials, `${name}Prototype`);
});
/* eslint-enable node-core/prefer-primordials */
const {
ArrayPrototypeForEach,
FunctionPrototypeCall,
Map,
ObjectFreeze,
ObjectSetPrototypeOf,
Set,
SymbolIterator,
WeakMap,
WeakSet,
} = primordials;
// Because these functions are used by `makeSafe`, which is exposed
// on the `primordials` object, it's important to use const references
// to the primordials that they use:
const createSafeIterator = (factory, next) => {
class SafeIterator {
constructor(iterable) {
this._iterator = factory(iterable);
}
next() {
return next(this._iterator);
}
[SymbolIterator]() {
return this;
}
}
ObjectSetPrototypeOf(SafeIterator.prototype, null);
ObjectFreeze(SafeIterator.prototype);
ObjectFreeze(SafeIterator);
return SafeIterator;
};
primordials.SafeArrayIterator = createSafeIterator(
primordials.ArrayPrototypeSymbolIterator,
primordials.ArrayIteratorPrototypeNext
);
primordials.SafeStringIterator = createSafeIterator(
primordials.StringPrototypeSymbolIterator,
primordials.StringIteratorPrototypeNext
);
const copyProps = (src, dest) => {
ArrayPrototypeForEach(ReflectOwnKeys(src), (key) => {
if (!ReflectGetOwnPropertyDescriptor(dest, key)) {
ReflectDefineProperty(
dest,
key,
ReflectGetOwnPropertyDescriptor(src, key));
}
});
};
const makeSafe = (unsafe, safe) => {
if (SymbolIterator in unsafe.prototype) {
const dummy = new unsafe();
let next; // We can reuse the same `next` method.
ArrayPrototypeForEach(ReflectOwnKeys(unsafe.prototype), (key) => {
if (!ReflectGetOwnPropertyDescriptor(safe.prototype, key)) {
const desc = ReflectGetOwnPropertyDescriptor(unsafe.prototype, key);
if (
typeof desc.value === 'function' &&
desc.value.length === 0 &&
SymbolIterator in (FunctionPrototypeCall(desc.value, dummy) ?? {})
) {
const createIterator = uncurryThis(desc.value);
next = next ?? uncurryThis(createIterator(dummy).next);
const SafeIterator = createSafeIterator(createIterator, next);
desc.value = function() {
return new SafeIterator(this);
};
}
ReflectDefineProperty(safe.prototype, key, desc);
}
});
} else {
copyProps(unsafe.prototype, safe.prototype);
}
copyProps(unsafe, safe);
ObjectSetPrototypeOf(safe.prototype, null);
ObjectFreeze(safe.prototype);
ObjectFreeze(safe);
return safe;
};
primordials.makeSafe = makeSafe;
// Subclass the constructors because we need to use their prototype
// methods later.
// Defining the `constructor` is necessary here to avoid the default
// constructor which uses the user-mutable `%ArrayIteratorPrototype%.next`.
primordials.SafeMap = makeSafe(
Map,
class SafeMap extends Map {
constructor(i) { super(i); } // eslint-disable-line no-useless-constructor
}
);
primordials.SafeWeakMap = makeSafe(
WeakMap,
class SafeWeakMap extends WeakMap {
constructor(i) { super(i); } // eslint-disable-line no-useless-constructor
}
);
primordials.SafeSet = makeSafe(
Set,
class SafeSet extends Set {
constructor(i) { super(i); } // eslint-disable-line no-useless-constructor
}
);
primordials.SafeWeakSet = makeSafe(
WeakSet,
class SafeWeakSet extends WeakSet {
constructor(i) { super(i); } // eslint-disable-line no-useless-constructor
}
);
ObjectSetPrototypeOf(primordials, null);
ObjectFreeze(primordials);
module.exports = primordials;
@@ -0,0 +1,203 @@
'use strict';
var utils = require('../utils.js');
var utils$1 = require('@typescript-eslint/utils');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
const ClassMemberTypes = {
"*": { test: () => true },
"field": { test: (node) => node.type === "PropertyDefinition" },
"method": { test: (node) => node.type === "MethodDefinition" }
};
var _baseRule = utils.createRule(
{
name: "lines-between-class-members",
package: "js",
meta: {
type: "layout",
docs: {
description: "Require or disallow an empty line between class members"
},
fixable: "whitespace",
schema: [
{
anyOf: [
{
type: "object",
properties: {
enforce: {
type: "array",
items: {
type: "object",
properties: {
blankLine: { type: "string", enum: ["always", "never"] },
prev: { type: "string", enum: ["method", "field", "*"] },
next: { type: "string", enum: ["method", "field", "*"] }
},
additionalProperties: false,
required: ["blankLine", "prev", "next"]
},
minItems: 1
}
},
additionalProperties: false,
required: ["enforce"]
},
{
type: "string",
enum: ["always", "never"]
}
]
},
{
type: "object",
properties: {
exceptAfterSingleLine: {
type: "boolean",
default: false
}
},
additionalProperties: false
}
],
messages: {
never: "Unexpected blank line between class members.",
always: "Expected blank line between class members."
}
},
create(context) {
const options = [];
options[0] = context.options[0] || "always";
options[1] = context.options[1] || { exceptAfterSingleLine: false };
const configureList = typeof options[0] === "object" ? options[0].enforce : [{ blankLine: options[0], prev: "*", next: "*" }];
const sourceCode = context.sourceCode;
function getBoundaryTokens(curNode, nextNode) {
const lastToken = sourceCode.getLastToken(curNode);
const prevToken = sourceCode.getTokenBefore(lastToken);
const nextToken = sourceCode.getFirstToken(nextNode);
const isSemicolonLessStyle = utils.isSemicolonToken(lastToken) && !utils.isTokenOnSameLine(prevToken, lastToken) && utils.isTokenOnSameLine(lastToken, nextToken);
return isSemicolonLessStyle ? { curLast: prevToken, nextFirst: lastToken } : { curLast: lastToken, nextFirst: nextToken };
}
function findLastConsecutiveTokenAfter(prevLastToken, nextFirstToken, maxLine) {
const after = sourceCode.getTokenAfter(prevLastToken, { includeComments: true });
if (after !== nextFirstToken && after.loc.start.line - prevLastToken.loc.end.line <= maxLine)
return findLastConsecutiveTokenAfter(after, nextFirstToken, maxLine);
return prevLastToken;
}
function findFirstConsecutiveTokenBefore(nextFirstToken, prevLastToken, maxLine) {
const before = sourceCode.getTokenBefore(nextFirstToken, { includeComments: true });
if (before !== prevLastToken && nextFirstToken.loc.start.line - before.loc.end.line <= maxLine)
return findFirstConsecutiveTokenBefore(before, prevLastToken, maxLine);
return nextFirstToken;
}
function hasTokenOrCommentBetween(before, after) {
return sourceCode.getTokensBetween(before, after, { includeComments: true }).length !== 0;
}
function match(node, type) {
return ClassMemberTypes[type].test(node);
}
function getPaddingType(prevNode, nextNode) {
for (let i = configureList.length - 1; i >= 0; --i) {
const configure = configureList[i];
const matched = match(prevNode, configure.prev) && match(nextNode, configure.next);
if (matched)
return configure.blankLine;
}
return null;
}
return {
ClassBody(node) {
const body = node.body;
for (let i = 0; i < body.length - 1; i++) {
const curFirst = sourceCode.getFirstToken(body[i]);
const { curLast, nextFirst } = getBoundaryTokens(body[i], body[i + 1]);
const isMulti = !utils.isTokenOnSameLine(curFirst, curLast);
const skip = !isMulti && options[1].exceptAfterSingleLine;
const beforePadding = findLastConsecutiveTokenAfter(curLast, nextFirst, 1);
const afterPadding = findFirstConsecutiveTokenBefore(nextFirst, curLast, 1);
const isPadded = afterPadding.loc.start.line - beforePadding.loc.end.line > 1;
const hasTokenInPadding = hasTokenOrCommentBetween(beforePadding, afterPadding);
const curLineLastToken = findLastConsecutiveTokenAfter(curLast, nextFirst, 0);
const paddingType = getPaddingType(body[i], body[i + 1]);
if (paddingType === "never" && isPadded) {
context.report({
node: body[i + 1],
messageId: "never",
fix(fixer) {
if (hasTokenInPadding)
return null;
return fixer.replaceTextRange([beforePadding.range[1], afterPadding.range[0]], "\n");
}
});
} else if (paddingType === "always" && !skip && !isPadded) {
context.report({
node: body[i + 1],
messageId: "always",
fix(fixer) {
if (hasTokenInPadding)
return null;
return fixer.insertTextAfter(curLineLastToken, "\n");
}
});
}
}
}
};
}
}
);
const baseRule = /* @__PURE__ */ utils.castRuleModule(_baseRule);
const schema = Object.values(
utils.deepMerge(
{ ...baseRule.meta.schema },
{
1: {
properties: {
exceptAfterOverload: {
type: "boolean",
default: true
}
}
}
}
)
);
var linesBetweenClassMembers = utils.createRule({
name: "lines-between-class-members",
package: "ts",
meta: {
type: "layout",
docs: {
description: "Require or disallow an empty line between class members"
},
fixable: "whitespace",
hasSuggestions: baseRule.meta.hasSuggestions,
schema,
messages: baseRule.meta.messages
},
defaultOptions: [
"always",
{
exceptAfterOverload: true,
exceptAfterSingleLine: false
}
],
create(context, [firstOption, secondOption]) {
const rules = baseRule.create(context);
const exceptAfterOverload = secondOption?.exceptAfterOverload && (firstOption === "always" || typeof firstOption !== "string" && firstOption?.enforce.some(({ blankLine, prev, next }) => blankLine === "always" && prev !== "field" && next !== "field"));
function isOverload(node) {
return (node.type === utils$1.AST_NODE_TYPES.TSAbstractMethodDefinition || node.type === utils$1.AST_NODE_TYPES.MethodDefinition) && node.value.type === utils$1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression;
}
return {
ClassBody(node) {
const body = exceptAfterOverload ? node.body.filter((node2) => !isOverload(node2)) : node.body;
rules.ClassBody({ ...node, body });
}
};
}
});
module.exports = linesBetweenClassMembers;
@@ -0,0 +1,22 @@
# PostCSS JS
<img align="right" width="135" height="95"
title="Philosopher’s stone, logo of PostCSS"
src="https://postcss.org/logo-leftp.svg">
[PostCSS] for CSS-in-JS and styles in JS objects.
For example, to use [Stylelint] or [RTLCSS] plugins in your workflow.
<a href="https://evilmartians.com/?utm_source=postcss-js">
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
alt="Sponsored by Evil Martians" width="236" height="54">
</a>
[Stylelint]: https://github.com/stylelint/stylelint
[PostCSS]: https://github.com/postcss/postcss
[RTLCSS]: https://github.com/MohammadYounes/rtlcss
## Docs
Read full docs **[here](https://github.com/postcss/postcss-js#readme)**.
@@ -0,0 +1,57 @@
'use strict';
const { parseContentType } = require('./utils.js');
function getInstance(cfg) {
const headers = cfg.headers;
const conType = parseContentType(headers['content-type']);
if (!conType)
throw new Error('Malformed content type');
for (const type of TYPES) {
const matched = type.detect(conType);
if (!matched)
continue;
const instanceCfg = {
limits: cfg.limits,
headers,
conType,
highWaterMark: undefined,
fileHwm: undefined,
defCharset: undefined,
defParamCharset: undefined,
preservePath: false,
};
if (cfg.highWaterMark)
instanceCfg.highWaterMark = cfg.highWaterMark;
if (cfg.fileHwm)
instanceCfg.fileHwm = cfg.fileHwm;
instanceCfg.defCharset = cfg.defCharset;
instanceCfg.defParamCharset = cfg.defParamCharset;
instanceCfg.preservePath = cfg.preservePath;
return new type(instanceCfg);
}
throw new Error(`Unsupported content type: ${headers['content-type']}`);
}
// Note: types are explicitly listed here for easier bundling
// See: https://github.com/mscdex/busboy/issues/121
const TYPES = [
require('./types/multipart'),
require('./types/urlencoded'),
].filter(function(typemod) { return typeof typemod.detect === 'function'; });
module.exports = (cfg) => {
if (typeof cfg !== 'object' || cfg === null)
cfg = {};
if (typeof cfg.headers !== 'object'
|| cfg.headers === null
|| typeof cfg.headers['content-type'] !== 'string') {
throw new Error('Missing Content-Type');
}
return getInstance(cfg);
};
@@ -0,0 +1 @@
module.exports={C:{"43":0.0041,"45":0.0041,"47":0.0041,"51":0.0041,"52":0.00819,"54":0.0041,"57":0.0041,"60":0.0041,"67":0.0041,"68":0.0041,"72":0.00819,"73":0.0041,"75":0.00819,"76":0.0041,"78":0.01638,"85":0.00819,"88":0.0041,"93":0.0041,"102":0.0041,"113":0.0041,"115":0.55296,"121":0.0041,"124":0.0041,"125":0.00819,"126":0.0041,"127":0.02048,"128":0.02867,"129":0.0041,"131":0.01229,"132":0.0041,"133":0.00819,"135":0.0041,"136":0.04506,"137":0.0041,"138":0.02048,"139":0.00819,"140":0.12288,"141":0.03277,"142":0.09421,"143":1.75718,"144":1.4377,"145":0.06554,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 48 49 50 53 55 56 58 59 61 62 63 64 65 66 69 70 71 74 77 79 80 81 82 83 84 86 87 89 90 91 92 94 95 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 114 116 117 118 119 120 122 123 130 134 146 147 3.5 3.6"},D:{"11":0.0041,"39":0.00819,"40":0.0041,"41":0.00819,"42":0.01229,"43":0.00819,"44":0.00819,"45":0.0041,"46":0.0041,"47":0.0041,"48":0.0041,"49":0.01229,"50":0.00819,"51":0.0041,"52":0.00819,"53":0.00819,"54":0.01229,"55":0.0041,"56":0.0041,"57":0.02048,"58":0.0041,"59":0.00819,"60":0.01229,"61":0.01638,"63":0.00819,"64":0.0041,"65":0.01229,"66":0.0041,"67":0.00819,"68":0.00819,"70":0.00819,"71":0.00819,"73":0.02048,"74":0.0041,"75":0.0041,"76":0.0041,"77":0.0041,"78":0.0041,"79":0.03686,"80":0.02458,"81":0.02458,"83":0.00819,"84":0.00819,"85":0.02867,"86":0.01229,"87":0.03277,"88":0.0041,"89":0.00819,"90":0.00819,"91":0.02048,"92":0.0041,"93":0.0041,"94":0.00819,"95":0.03686,"97":0.00819,"98":0.0041,"99":0.00819,"100":0.0041,"101":0.02458,"102":0.0041,"103":0.02048,"104":0.01638,"105":0.00819,"106":0.01229,"107":0.0041,"108":0.01229,"109":1.5401,"110":0.0041,"111":0.01229,"112":0.00819,"113":0.00819,"114":0.01229,"115":0.02048,"116":0.11469,"117":0.0041,"118":0.02048,"119":0.01638,"120":0.03277,"121":0.02048,"122":0.06554,"123":0.01638,"124":0.03277,"125":0.85606,"126":0.03277,"127":0.05325,"128":0.03686,"129":0.07782,"130":0.05734,"131":0.08192,"132":0.04506,"133":0.04915,"134":0.07373,"135":0.07782,"136":0.16384,"137":0.15565,"138":0.56115,"139":0.63078,"140":5.47226,"141":12.93517,"142":0.25395,"143":0.00819,_:"4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 62 69 72 96 144 145"},F:{"65":0.0041,"74":0.0041,"79":0.02048,"82":0.0041,"90":0.00819,"91":0.01229,"92":0.01229,"95":0.04506,"102":0.0041,"113":0.00819,"114":0.00819,"119":0.0041,"120":0.13926,"121":0.02458,"122":1.024,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 66 67 68 69 70 71 72 73 75 76 77 78 80 81 83 84 85 86 87 88 89 93 94 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 115 116 117 118 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6","12.1":0.0041},B:{"12":0.0041,"14":0.00819,"15":0.0041,"16":0.0041,"17":0.00819,"18":0.02867,"84":0.00819,"85":0.0041,"86":0.0041,"89":0.00819,"90":0.00819,"92":0.14336,"100":0.04506,"109":0.09011,"114":0.05325,"120":0.0041,"122":0.02867,"127":0.0041,"128":0.01638,"129":0.0041,"130":0.0041,"131":0.0041,"132":0.0041,"133":0.0041,"134":0.01229,"135":0.0041,"136":0.00819,"137":0.02048,"138":0.04096,"139":0.04096,"140":0.63078,"141":2.5641,"142":0.0041,_:"13 79 80 81 83 87 88 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 119 121 123 124 125 126"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 15.1 15.2-15.3 15.4 15.5 16.0 16.2 16.4 17.0 18.2 26.1 26.2","12.1":0.0041,"13.1":0.0041,"14.1":0.0041,"15.6":0.04506,"16.1":0.0041,"16.3":0.0041,"16.5":0.0041,"16.6":0.17613,"17.1":0.0041,"17.2":0.0041,"17.3":0.00819,"17.4":0.00819,"17.5":0.0041,"17.6":0.02458,"18.0":0.02048,"18.1":0.0041,"18.3":0.03277,"18.4":0.0041,"18.5-18.6":0.02867,"26.0":0.17613},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00032,"5.0-5.1":0,"6.0-6.1":0.00127,"7.0-7.1":0.00095,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00285,"10.0-10.2":0.00032,"10.3":0.00538,"11.0-11.2":0.07975,"11.3-11.4":0.0019,"12.0-12.1":0.00063,"12.2-12.5":0.01551,"13.0-13.1":0,"13.2":0.00158,"13.3":0.00063,"13.4-13.7":0.00253,"14.0-14.4":0.00538,"14.5-14.8":0.0057,"15.0-15.1":0.00538,"15.2-15.3":0.00411,"15.4":0.00475,"15.5":0.00538,"15.6-15.8":0.07025,"16.0":0.00949,"16.1":0.01772,"16.2":0.00918,"16.3":0.01646,"16.4":0.00411,"16.5":0.00728,"16.6-16.7":0.09399,"17.0":0.00665,"17.1":0.01013,"17.2":0.00728,"17.3":0.01076,"17.4":0.01899,"17.5":0.03259,"17.6-17.7":0.08228,"18.0":0.01867,"18.1":0.03861,"18.2":0.02089,"18.3":0.06709,"18.4":0.03449,"18.5-18.6":1.75885,"26.0":0.2174,"26.1":0.00791},P:{"25":0.0112,"26":0.0112,"27":0.0112,"28":0.35848,"29":0.0224,_:"4 20 21 22 23 24 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 17.0 18.0 19.0","7.2-7.4":0.0112,"16.0":0.0112},I:{"0":0.24173,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00005,"4.4":0,"4.4.3-4.4.4":0Line truncated
@@ -0,0 +1,160 @@
# Release history
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
<details>
<summary><strong>Guiding Principles</strong></summary>
- Changelogs are for humans, not machines.
- There should be an entry for every single version.
- The same types of changes should be grouped.
- Versions and sections should be linkable.
- The latest version comes first.
- The release date of each versions is displayed.
- Mention whether you follow Semantic Versioning.
</details>
<details>
<summary><strong>Types of changes</strong></summary>
Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_):
- `Added` for new features.
- `Changed` for changes in existing functionality.
- `Deprecated` for soon-to-be removed features.
- `Removed` for now removed features.
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.
</details>
## [6.0.3] - 2020-01-16
- Merge pull request #31 for issue #30
## [6.0.0] - 2017-10-13
- refactor code to be more performant
- refactor benchmarks
## [5.1.0] - 2017-10-13
**Added**
- Merge pull request #15 from aretecode/patch-1
- adds support and tests for string & array iterators
**Changed**
- updates benchmarks
## [5.0.2] - 2017-08-02
- Merge pull request #14 from struct78/master
- Added `undefined` check
## [5.0.0] - 2017-06-21
- Merge pull request #12 from aretecode/iterator
- Set Iterator + Map Iterator
- streamline `isbuffer`, minor edits
## [4.0.0] - 2017-05-19
- Merge pull request #8 from tunnckoCore/master
- update deps
## [3.2.2] - 2017-05-16
- fix version
## [3.2.1] - 2017-05-16
- add browserify
## [3.2.0] - 2017-04-25
- Merge pull request #10 from ksheedlo/unrequire-buffer
- add `promise` support and tests
- Remove unnecessary `Buffer` check
## [3.1.0] - 2016-12-07
- Merge pull request #7 from laggingreflex/err
- add support for `error` and tests
- run update
## [3.0.4] - 2016-07-29
- move tests
- run update
## [3.0.3] - 2016-05-03
- fix prepublish script
- remove unused dep
## [3.0.0] - 2015-11-17
- add typed array support
- Merge pull request #5 from miguelmota/typed-arrays
- adds new tests
## [2.0.1] - 2015-08-21
- use `is-buffer` module
## [2.0.0] - 2015-05-31
- Create fallback for `Array.isArray` if used as a browser package
- Merge pull request #2 from dtothefp/patch-1
- Merge pull request #3 from pdehaan/patch-1
- Merge branch 'master' of https://github.com/chorks/kind-of into chorks-master
- optimizations, mostly date and regex
## [1.1.0] - 2015-02-09
- adds `buffer` support
- adds tests for `buffer`
## [1.0.0] - 2015-01-19
- update benchmarks
- optimizations based on benchmarks
## [0.1.2] - 2014-10-26
- return `typeof` value if it's not an object. very slight speed improvement
- use `.slice`
- adds benchmarks
## [0.1.0] - 2014-9-26
- first commit
[6.0.0]: https://github.com/jonschlinkert/kind-of/compare/5.1.0...6.0.0
[5.1.0]: https://github.com/jonschlinkert/kind-of/compare/5.0.2...5.1.0
[5.0.2]: https://github.com/jonschlinkert/kind-of/compare/5.0.1...5.0.2
[5.0.1]: https://github.com/jonschlinkert/kind-of/compare/5.0.0...5.0.1
[5.0.0]: https://github.com/jonschlinkert/kind-of/compare/4.0.0...5.0.0
[4.0.0]: https://github.com/jonschlinkert/kind-of/compare/3.2.2...4.0.0
[3.2.2]: https://github.com/jonschlinkert/kind-of/compare/3.2.1...3.2.2
[3.2.1]: https://github.com/jonschlinkert/kind-of/compare/3.2.0...3.2.1
[3.2.0]: https://github.com/jonschlinkert/kind-of/compare/3.1.0...3.2.0
[3.1.0]: https://github.com/jonschlinkert/kind-of/compare/3.0.4...3.1.0
[3.0.4]: https://github.com/jonschlinkert/kind-of/compare/3.0.3...3.0.4
[3.0.3]: https://github.com/jonschlinkert/kind-of/compare/3.0.0...3.0.3
[3.0.0]: https://github.com/jonschlinkert/kind-of/compare/2.0.1...3.0.0
[2.0.1]: https://github.com/jonschlinkert/kind-of/compare/2.0.0...2.0.1
[2.0.0]: https://github.com/jonschlinkert/kind-of/compare/1.1.0...2.0.0
[1.1.0]: https://github.com/jonschlinkert/kind-of/compare/1.0.0...1.1.0
[1.0.0]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...1.0.0
[0.1.2]: https://github.com/jonschlinkert/kind-of/compare/0.1.0...0.1.2
[0.1.0]: https://github.com/jonschlinkert/kind-of/commit/2fae09b0b19b1aadb558e9be39f0c3ef6034eb87
[Unreleased]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...HEAD
[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog
@@ -0,0 +1,53 @@
var pump = require('./index')
var rs = require('fs').createReadStream('/dev/random')
var ws = require('fs').createWriteStream('/dev/null')
var toHex = function () {
var reverse = new (require('stream').Transform)()
reverse._transform = function (chunk, enc, callback) {
reverse.push(chunk.toString('hex'))
callback()
}
return reverse
}
var wsClosed = false
var rsClosed = false
var callbackCalled = false
var check = function () {
if (wsClosed && rsClosed && callbackCalled) {
console.log('test-node.js passes')
clearTimeout(timeout)
}
}
ws.on('close', function () {
wsClosed = true
check()
})
rs.on('close', function () {
rsClosed = true
check()
})
var res = pump(rs, toHex(), toHex(), toHex(), ws, function () {
callbackCalled = true
check()
})
if (res !== ws) {
throw new Error('should return last stream')
}
setTimeout(function () {
rs.destroy()
}, 1000)
var timeout = setTimeout(function () {
throw new Error('timeout')
}, 5000)
@@ -0,0 +1 @@
{"name":"es-abstract","version":"1.24.0","requiresBuild":false,"files":{".editorconfig":{"checkedAt":1794532096488,"integrity":"sha512-4WD+dTh8h4tByUh1QLYMaeXqRb80nNvYQnV/VNtcxm31ENaRc8XjKlAzlGGwNrPqKMrtF2f3dspCo25pB2S1Bg==","mode":420,"size":312},".eslintrc":{"checkedAt":1794532096488,"integrity":"sha512-sZV5SJytp7shsBJEF1lTQapMHxIUhCUr85pMHruCUNj+8YFXw7h4Ht81m0Pq0CCdUIG+L+a2APZvMUET9wsKSg==","mode":420,"size":1895},".nycrc":{"checkedAt":1794532096488,"integrity":"sha512-pd1ooUypMeURrUlMj3pKOlAuV1u2YdXfn162vBRpNVK/zwV4CRwwmWNWaA55zxflLH/V9G7sw9H9jm2a3RAXZw==","mode":420,"size":312},"LICENSE":{"checkedAt":1794532096488,"integrity":"sha512-70vA0lB4xuMmkvyZGRtRJc3G2QixeJ9qOJ58WiYUJCHo2o4fgvZUWeelRg9AF6sc6iL+xX4OExaaX13bZSTX5w==","mode":420,"size":1081},"operations/2015.js":{"checkedAt":1794532096488,"integrity":"sha512-UWWcokKcJHTucb8LEtbSkbBCA9u+Rk0NbUw4F4noU6/WVwHgqC2J+LXovTy2Cf4QAXdnhIaB/y4GYIIHO7c1FA==","mode":420,"size":24056},"operations/2016.js":{"checkedAt":1794532096489,"integrity":"sha512-ZencLY4/WdP6HJcNETrfIHFiknuc8NUZrAJTV59ps1FPezUNFWb3i3n2S9Q1FEPEWL8B6sShrgQxvMsOJoIbvQ==","mode":420,"size":26544},"operations/2017.js":{"checkedAt":1794532096489,"integrity":"sha512-oBhe50jKD1cmdWMc8Blaj/2gzKGNn7V+XAaXHmOJXl6gyPp6DxYM5vwgKtBV+V6INGmFkJdjLWVzps7IeC+THA==","mode":420,"size":30900},"operations/2018.js":{"checkedAt":1794532096489,"integrity":"sha512-nKSjPmktVsnNhq7Y//rlUMm3yjCJP/CW18v6+RlAms4Zav/Yu9gOu23wyR1ISn2dyjiaN8dN9JJ9dMO6sG4SNA==","mode":420,"size":33492},"operations/2019.js":{"checkedAt":1794532096489,"integrity":"sha512-+KcjIJRPBEoddWROa+GbyGoiQiLgKeaV19bzw1N8G8SHOivZj8b/8RWTFE4ArZbv425fSJsiOjNV/suBJpH40g==","mode":420,"size":34388},"operations/2020.js":{"checkedAt":1794532096490,"integrity":"sha512-rXpOjYaK/7W9p8657M9+A2tedh0qzZgBvhzIKlQN9QgBpZKVCdv2DY6s/mVgPZJrj4O7L3iKYR4px8nYfxduYg==","mode":420,"size":40870},"operations/2021.js":{"checkedAt":1794532096490,"integrity":"sha512-qV3XkXLUvmdA7pLLFngfQbrbq4fOWunMpP5vAnnszkxDKhP+nv7VDDC37SVSPLrgcVMLDldaXGrtGUrPA5BtEw==","mode":420,"size":42892},"operations/2022.js":{"checkedAt":1794532096490,"integrity":"sha512-alY50S5pQDU7btwdtjsmxFNfNGEKk2QQ4hdwGWgET6gkx7vzdLXimZMchZ4S3x3kbXewAbCaadSF7Tao0JCQxg==","mode":420,"size":45945},"operations/2023.js":{"checkedAt":1794532096490,"integrity":"sha512-pBy1b7mCSxcSI06VZ+d/G4etFTD1I+MDs0d4C5GjV6VnuiK5gcwgwIkgFMzX4me0k81jBKeN6rW1Crp6bKWl1g==","mode":420,"size":48235},"operations/2024.js":{"checkedAt":1794532096491,"integrity":"sha512-tFf8TlL4WVs9igNMFY50wDjRNHtUnkuD1kGzc2HijL6uFmOZTtqHpnuZjA1O+j6i9PU2jxRDSe/Ap8wUTp+BtA==","mode":420,"size":51778},"operations/2025.js":{"checkedAt":1794532096491,"integrity":"sha512-2quCHJSXjuXKc+mc0zim67iX6K4rTAx2gkvAO50V5r+Aj11nQ2o9Is69jYJokfjHWiD9FyHGYOQMAhW1PhxgMg==","mode":420,"size":54146},"2015/abs.js":{"checkedAt":1794532096491,"integrity":"sha512-/7+iSdfi3JDuu9pXX8EgA6b8aw2UJMtattYCA3tdb4SSruItq1BuSYl2XjTg41zermkUyMEefWvxKohDqN+wWQ==","mode":420,"size":166},"2016/abs.js":{"checkedAt":1794532096491,"integrity":"sha512-/7+iSdfi3JDuu9pXX8EgA6b8aw2UJMtattYCA3tdb4SSruItq1BuSYl2XjTg41zermkUyMEefWvxKohDqN+wWQ==","mode":420,"size":166},"2017/abs.js":{"checkedAt":1794532096491,"integrity":"sha512-/7+iSdfi3JDuu9pXX8EgA6b8aw2UJMtattYCA3tdb4SSruItq1BuSYl2XjTg41zermkUyMEefWvxKohDqN+wWQ==","mode":420,"size":166},"2018/abs.js":{"checkedAt":1794532096491,"integrity":"sha512-/7+iSdfi3JDuu9pXX8EgA6b8aw2UJMtattYCA3tdb4SSruItq1BuSYl2XjTg41zermkUyMEefWvxKohDqN+wWQ==","mode":420,"size":166},"2019/abs.js":{"checkedAt":1794532096491,"integrity":"sha512-/7+iSdfi3JDuu9pXX8EgA6b8aw2UJMtattYCA3tdb4SSruItq1BuSYl2XjTg41zermkUyMEefWvxKohDqN+wWQ==","mode":420,"size":166},"2020/abs.js":{"checkedAt":1794532096491,"integrity":"sha512-Uj8KhNclrNMkg5WZLL/v3F6Q6lYJQuGGHlot+YaCVwNN2KruLp9rjxsH8rA6IW6JoEzz3AMiO5X4Q3ZePdaPxg==","mode":420,"size":217},"2021/abs.js":{"checkedAt":1794532096491,"integrity":"sha512-Uj8KhNclrNMkg5WZLL/v3F6Q6lYJQuGGHlot+YaCVwNN2KruLp9rjxsH8rA6IW6JoEzz3AMiO5X4Q3ZePdaPxg==","mode":420,"size":217},"2022/abs.js":{"checkedAt":1794532096491,"integrity":"sha512-Uj8KhNclrNMkg5WZLL/v3F6Q6lYJQuGGHlot+YaCVwNN2KruLp9rjxsH8rA6IW6JoEzz3AMiO5X4Q3ZePdaPxg==","mode":420,"size":217},"2023/abs.js":{"checkedAt":1794532096491,"integrity":"sha512-Uj8KhNclrNMkg5WZLL/v3F6Q6lYJQuGGHlot+YaCVwNN2KruLp9rjxsH8rA6IW6JoEzz3AMiO5X4Q3ZePdaPxg==","mode":420,"size":217},"2024/abs.js":{"checkedAt":1794532096491,"integrity":"sha512-Uj8KhNclrNMkg5WZLL/v3F6Q6lYJQuGGHlot+YaCVwNN2KruLp9rjxsH8rA6IW6JoEzz3AMiO5X4Q3ZePdaPxg==","mode":420,"size":217},"2025/abs.js":{"checkedAt":1794532096491,"integrity":"sha512-Uj8KhNclrNMkg5WZLL/v3F6Q6lYJQuGGHlot+YaCVwNN2KruLp9rjxsH8rA6IW6JoEzz3AMiO5X4Q3ZePdaPxg==","mode":420,"size":217},"5/abs.js":{"checkedAt":1794532096491,"integrity":"sha512-/7+iSdfi3JDuu9pXX8EgA6b8aw2UJMtattYCA3tdb4SSruItq1BuSYl2XjTg41zermkUyMEefWvxKohDqN+wWQ==","mode":420,"size":166},"2015/AbstractEqualityComparison.js":{"checkedAt":1794532096491,"integrity":"sha512-lJtz60zj3e+vhxhLjiWuguebRriC05RmM04NMXkm+S4qGlGgbGemsLXdLine truncated
@@ -0,0 +1,15 @@
# Installation
> `npm install --save @types/babel__template`
# Summary
This package contains type definitions for @babel/template (https://github.com/babel/babel/tree/master/packages/babel-template).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__template.
### Additional Details
* Last updated: Mon, 06 Nov 2023 22:41:04 GMT
* Dependencies: [@babel/parser](https://npmjs.com/package/@babel/parser), [@babel/types](https://npmjs.com/package/@babel/types)
# Credits
These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), [Melvin Groenhoff](https://github.com/mgroenhoff), and [ExE Boss](https://github.com/ExE-Boss).
@@ -0,0 +1,349 @@
import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';
import { time } from '../frameloop/sync-time.mjs';
import { activeAnimations } from '../stats/animation-count.mjs';
import { mix } from '../utils/mix/index.mjs';
import { frameloopDriver } from './drivers/frame.mjs';
import { inertia } from './generators/inertia.mjs';
import { keyframes } from './generators/keyframes.mjs';
import { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';
import { getFinalKeyframe } from './keyframes/get-final.mjs';
import { replaceTransitionType } from './utils/replace-transition-type.mjs';
import { WithPromise } from './utils/WithPromise.mjs';
const percentToProgress = (percent) => percent / 100;
class JSAnimation extends WithPromise {
constructor(options) {
super();
this.state = "idle";
this.startTime = null;
this.isStopped = false;
/**
* The current time of the animation.
*/
this.currentTime = 0;
/**
* The time at which the animation was paused.
*/
this.holdTime = null;
/**
* Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.
*/
this.playbackSpeed = 1;
/**
* This method is bound to the instance to fix a pattern where
* animation.stop is returned as a reference from a useEffect.
*/
this.stop = () => {
const { motionValue } = this.options;
if (motionValue && motionValue.updatedAt !== time.now()) {
this.tick(time.now());
}
this.isStopped = true;
if (this.state === "idle")
return;
this.teardown();
this.options.onStop?.();
};
activeAnimations.mainThread++;
this.options = options;
this.initAnimation();
this.play();
if (options.autoplay === false)
this.pause();
}
initAnimation() {
const { options } = this;
replaceTransitionType(options);
const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;
let { keyframes: keyframes$1 } = options;
const generatorFactory = type || keyframes;
if (process.env.NODE_ENV !== "production" &&
generatorFactory !== keyframes) {
invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames");
}
if (generatorFactory !== keyframes &&
typeof keyframes$1[0] !== "number") {
this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));
keyframes$1 = [0, 100];
}
const generator = generatorFactory({ ...options, keyframes: keyframes$1 });
/**
* If we have a mirror repeat type we need to create a second generator that outputs the
* mirrored (not reversed) animation and later ping pong between the two generators.
*/
if (repeatType === "mirror") {
this.mirroredGenerator = generatorFactory({
...options,
keyframes: [...keyframes$1].reverse(),
velocity: -velocity,
});
}
/**
* If duration is undefined and we have repeat options,
* we need to calculate a duration from the generator.
*
* We set it to the generator itself to cache the duration.
* Any timeline resolver will need to have already precalculated
* the duration by this step.
*/
if (generator.calculatedDuration === null) {
generator.calculatedDuration = calcGeneratorDuration(generator);
}
const { calculatedDuration } = generator;
this.calculatedDuration = calculatedDuration;
this.resolvedDuration = calculatedDuration + repeatDelay;
this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;
this.generator = generator;
}
updateTime(timestamp) {
const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;
// Update currentTime
if (this.holdTime !== null) {
this.currentTime = this.holdTime;
}
else {
// Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =
// 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for
// example.
this.currentTime = animationTime;
}
}
tick(timestamp, sample = false) {
const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;
if (this.startTime === null)
return generator.next(0);
const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;
/**
* requestAnimationFrame timestamps can come through as lower than
* the startTime as set by performance.now(). Here we prevent this,
* though in the future it could be possible to make setting startTime
* a pending operation that gets resolved here.
*/
if (this.speed > 0) {
this.startTime = Math.min(this.startTime, timestamp);
}
else if (this.speed < 0) {
this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);
}
if (sample) {
this.currentTime = timestamp;
}
else {
this.updateTime(timestamp);
}
// Rebase on delay
const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);
const isInDelayPhase = this.playbackSpeed >= 0
? timeWithoutDelay < 0
: timeWithoutDelay > totalDuration;
this.currentTime = Math.max(timeWithoutDelay, 0);
// If this animation has finished, set the current time to the total duration.
if (this.state === "finished" && this.holdTime === null) {
this.currentTime = totalDuration;
}
let elapsed = this.currentTime;
let frameGenerator = generator;
if (repeat) {
/**
* Get the current progress (0-1) of the animation. If t is >
* than duration we'll get values like 2.5 (midway through the
* third iteration)
*/
const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;
/**
* Get the current iteration (0 indexed). For instance the floor of
* 2.5 is 2.
*/
let currentIteration = Math.floor(progress);
/**
* Get the current progress of the iteration by taking the remainder
* so 2.5 is 0.5 through iteration 2
*/
let iterationProgress = progress % 1.0;
/**
* If iteration progress is 1 we count that as the end
* of the previous iteration.
*/
if (!iterationProgress && progress >= 1) {
iterationProgress = 1;
}
iterationProgress === 1 && currentIteration--;
currentIteration = Math.min(currentIteration, repeat + 1);
/**
* Reverse progress if we're not running in "normal" direction
*/
const isOddIteration = Boolean(currentIteration % 2);
if (isOddIteration) {
if (repeatType === "reverse") {
iterationProgress = 1 - iterationProgress;
if (repeatDelay) {
iterationProgress -= repeatDelay / resolvedDuration;
}
}
else if (repeatType === "mirror") {
frameGenerator = mirroredGenerator;
}
}
elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;
}
/**
* If we're in negative time, set state as the initial keyframe.
* This prevents delay: x, duration: 0 animations from finishing
* instantly.
*/
const state = isInDelayPhase
? { done: false, value: keyframes[0] }
: frameGenerator.next(elapsed);
if (mixKeyframes) {
state.value = mixKeyframes(state.value);
}
let { done } = state;
if (!isInDelayPhase && calculatedDuration !== null) {
done =
this.playbackSpeed >= 0
? this.currentTime >= totalDuration
: this.currentTime <= 0;
}
const isAnimationFinished = this.holdTime === null &&
(this.state === "finished" || (this.state === "running" && done));
// TODO: The exception for inertia could be cleaner here
if (isAnimationFinished && type !== inertia) {
state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);
}
if (onUpdate) {
onUpdate(state.value);
}
if (isAnimationFinished) {
this.finish();
}
return state;
}
/**
* Allows the returned animation to be awaited or promise-chained. Currently
* resolves when the animation finishes at all but in a future update could/should
* reject if its cancels.
*/
then(resolve, reject) {
return this.finished.then(resolve, reject);
}
get duration() {
return millisecondsToSeconds(this.calculatedDuration);
}
get iterationDuration() {
const { delay = 0 } = this.options || {};
return this.duration + millisecondsToSeconds(delay);
}
get time() {
return millisecondsToSeconds(this.currentTime);
}
set time(newTime) {
newTime = secondsToMilliseconds(newTime);
this.currentTime = newTime;
if (this.startTime === null ||
this.holdTime !== null ||
this.playbackSpeed === 0) {
this.holdTime = newTime;
}
else if (this.driver) {
this.startTime = this.driver.now() - newTime / this.playbackSpeed;
}
this.driver?.start(false);
}
get speed() {
return this.playbackSpeed;
}
set speed(newSpeed) {
this.updateTime(time.now());
const hasChanged = this.playbackSpeed !== newSpeed;
this.playbackSpeed = newSpeed;
if (hasChanged) {
this.time = millisecondsToSeconds(this.currentTime);
}
}
play() {
if (this.isStopped)
return;
const { driver = frameloopDriver, startTime } = this.options;
if (!this.driver) {
this.driver = driver((timestamp) => this.tick(timestamp));
}
this.options.onPlay?.();
const now = this.driver.now();
if (this.state === "finished") {
this.updateFinished();
this.startTime = now;
}
else if (this.holdTime !== null) {
this.startTime = now - this.holdTime;
}
else if (!this.startTime) {
this.startTime = startTime ?? now;
}
if (this.state === "finished" && this.speed < 0) {
this.startTime += this.calculatedDuration;
}
this.holdTime = null;
/**
* Set playState to running only after we've used it in
* the previous logic.
*/
this.state = "running";
this.driver.start();
}
pause() {
this.state = "paused";
this.updateTime(time.now());
this.holdTime = this.currentTime;
}
complete() {
if (this.state !== "running") {
this.play();
}
this.state = "finished";
this.holdTime = null;
}
finish() {
this.notifyFinished();
this.teardown();
this.state = "finished";
this.options.onComplete?.();
}
cancel() {
this.holdTime = null;
this.startTime = 0;
this.tick(0);
this.teardown();
this.options.onCancel?.();
}
teardown() {
this.state = "idle";
this.stopDriver();
this.startTime = this.holdTime = null;
activeAnimations.mainThread--;
}
stopDriver() {
if (!this.driver)
return;
this.driver.stop();
this.driver = undefined;
}
sample(sampleTime) {
this.startTime = 0;
return this.tick(sampleTime, true);
}
attachTimeline(timeline) {
if (this.options.allowFlatten) {
this.options.type = "keyframes";
this.options.ease = "linear";
this.initAnimation();
}
this.driver?.stop();
return timeline.observe(this);
}
}
// Legacy function support
function animateValue(options) {
return new JSAnimation(options);
}
export { JSAnimation, animateValue };
@@ -0,0 +1,8 @@
import Settings from '../../settings';
import { EntryTransformerFunction } from '../../types';
export default class EntryTransformer {
private readonly _settings;
constructor(_settings: Settings);
getTransformer(): EntryTransformerFunction;
private _transform;
}
@@ -0,0 +1 @@
{"version":3,"file":"isParentBindingConstraintsWithTag.d.ts","sourceRoot":"","sources":["../../../../src/binding/calculations/isParentBindingConstraintsWithTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKpE,wBAAgB,iCAAiC,CAC/C,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,OAAO,GACb,CAAC,WAAW,EAAE,kBAAkB,KAAK,OAAO,CAE9C"}
@@ -0,0 +1,633 @@
export default `flf2a$ 6 6 15 -1 19
The elder futhark -- by Bryan Alexander
(alexande@mathcs.rhodes.edu)
figlet release 2.1 -- 12 Aug 1994
This font consists of the runes in the elder futhark. It is accurate as
far as I know. Any corrections, or ideas on improving the font's appearance
are welcome. Modifying this font is fine with me; please e-mail me the
result.
Explanation of first line:
flf2 - "magic number" for file identification
a - should always be \`a', for now
$ - the "hardblank" -- prints as a blank, but can't be smushed
6 - height of a character
6 - height of a character, not including descenders
15 - max line length (excluding comment lines) + a fudge factor
-1 - default smushmode for this font
19 - number of comment lines
$ $@
$ $@
$ _ $@
$|_|$@
$ $@
$ $@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
__/\\__@
\\ /@
/_ _\\@
\\/ @
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
_ @
|_|@
_ @
|_|@
_ @
|_|@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
_ @
(_)@
@
(_)@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
|\\ @
| \\ @
|\\ @
| \\ @
| @
| @@
|~\\ @
| > @
|_/ @
|~\\ @
| > @
|_/ @@
| @
| @
| @
|\\ @
| \\ @
| \\ @@
|\\ /| @
| \\ / | @
| \\/ | @
| /\\ | @
| / \\ | @
|/ \\| @@
|\\ /| @
| \\ / | @
| \\/ | @
| | @
| | @
| | @@
| / / @
|/ / @
| / @
|/ @
| @
| @@
\\ / @
\\ / @
\\/ @
/\\ @
/ \\ @
/ \\ @@
| | @
|\\ | @
| \\ | @
| \\ | @
| \\| @
| | @@
| @
| @
| @
| @
| @
| @@
/ @
/ @
\\ \\ @
\\ \\ @
/ @
/ @@
/ @
/ @
/ @
\\ @
\\ @
\\ @@
|\\ @
| \\ @
| \\ @
| @
| @
| @@
|\\ /| @
| \\/ | @
| /\\ | @
|/ \\| @
| | @
| | @@
| @
\\ | @
\\| @
|\\ @
| \\ @
| @@
/~\\ @
/ \\ @
\\ / @
\\ / @
/ \\ @
/ \\ @@
|\\ / @
| \\/ @
| @
| @
| /\\ @
|/ \\ @@
@
@
@
@
@
@@
|~\\ @
| \\ @
| / @
|_/ @
| \\ @
| \\ @@
/ @
/ @
/____ @
/ @
/ @
/ @@
/|\\ @
/ | \\ @
/ | \\ @
| @
| @
| @@
|\\ @
| \\ @
| \\ @
| | @
| | @
| | @@
|\\ @
| \\ @
| \\ @
| | @
| | @
| | @@
|\\ @
| > @
|/ @
| @
| @
| @@
@
@
@
@
@
@@
|~~-__ @
| | @
|_____| @
| | | @
| | | @
| | | @@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
`
@@ -0,0 +1,82 @@
/**
* @author Jamund Ferguson
* See LICENSE file in root directory for full license.
*/
"use strict"
module.exports = {
meta: {
docs: {
description:
"ensure Node.js-style error-first callback pattern is followed",
category: "Possible Errors",
recommended: false,
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-callback-literal.md",
},
type: "problem",
fixable: null,
schema: [],
},
create(context) {
const callbackNames = ["callback", "cb"]
function isCallback(name) {
return callbackNames.indexOf(name) > -1
}
return {
CallExpression(node) {
const errorArg = node.arguments[0]
const calleeName = node.callee.name
if (
errorArg &&
!couldBeError(errorArg) &&
isCallback(calleeName)
) {
context.report({
node,
message:
"Unexpected literal in error position of callback.",
})
}
},
}
},
}
/**
* Determine if a node has a possiblity to be an Error object
* @param {ASTNode} node ASTNode to check
* @returns {boolean} True if there is a chance it contains an Error obj
*/
function couldBeError(node) {
switch (node.type) {
case "Identifier":
case "CallExpression":
case "NewExpression":
case "MemberExpression":
case "TaggedTemplateExpression":
case "YieldExpression":
return true // possibly an error object.
case "AssignmentExpression":
return couldBeError(node.right)
case "SequenceExpression": {
const exprs = node.expressions
return exprs.length !== 0 && couldBeError(exprs[exprs.length - 1])
}
case "LogicalExpression":
return couldBeError(node.left) || couldBeError(node.right)
case "ConditionalExpression":
return couldBeError(node.consequent) || couldBeError(node.alternate)
default:
return node.value === null
}
}
@@ -0,0 +1,197 @@
/**
* Negates a boolean type.
*/
export type Not<T extends boolean> = T extends true ? false : true;
/**
* Returns `true` if at least one of the types in the
* {@linkcode Types} array is `true`, otherwise returns `false`.
*/
export type Or<Types extends boolean[]> = Types[number] extends false ? false : true;
/**
* Checks if all the boolean types in the {@linkcode Types} array are `true`.
*/
export type And<Types extends boolean[]> = Types[number] extends true ? true : false;
/**
* Represents an equality type that returns {@linkcode Right} if
* {@linkcode Left} is `true`,
* otherwise returns the negation of {@linkcode Right}.
*/
export type Eq<Left extends boolean, Right extends boolean> = Left extends true ? Right : Not<Right>;
/**
* Represents the exclusive OR operation on a tuple of boolean types.
* Returns `true` if exactly one of the boolean types is `true`,
* otherwise returns `false`.
*/
export type Xor<Types extends [boolean, boolean]> = Not<Eq<Types[0], Types[1]>>;
/**
* @internal
*/
declare const secret: unique symbol;
/**
* @internal
*/
type Secret = typeof secret;
/**
* Checks if the given type is `never`.
*/
export type IsNever<T> = [T] extends [never] ? true : false;
/**
* Checks if the given type is `any`.
*/
export type IsAny<T> = [T] extends [Secret] ? Not<IsNever<T>> : false;
/**
* Determines if the given type is `unknown`.
*/
export type IsUnknown<T> = [unknown] extends [T] ? Not<IsAny<T>> : false;
/**
* Determines if a type is either `never` or `any`.
*/
export type IsNeverOrAny<T> = Or<[IsNever<T>, IsAny<T>]>;
/**
* Subjective "useful" keys from a type. For objects it's just `keyof` but for
* tuples/arrays it's the number keys.
*
* @example
* ```ts
* UsefulKeys<{ a: 1; b: 2 }> // 'a' | 'b'
*
* UsefulKeys<['a', 'b']> // '0' | '1'
*
* UsefulKeys<string[]> // number
* ```
*/
export type UsefulKeys<T> = T extends any[] ? {
[K in keyof T]: K;
}[number] : keyof T;
/**
* Extracts the keys from a type that are required (not optional).
*/
export type RequiredKeys<T> = Extract<{
[K in keyof T]-?: {} extends Pick<T, K> ? never : K;
}[keyof T], keyof T>;
/**
* Gets the keys of an object type that are optional.
*/
export type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
/**
* Extracts the keys from a type that are not `readonly`.
*/
export type ReadonlyKeys<T> = Extract<{
[K in keyof T]-?: ReadonlyEquivalent<{
[_K in K]: T[K];
}, {
-readonly [_K in K]: T[K];
}> extends true ? never : K;
}[keyof T], keyof T>;
/**
* Determines if two types, are equivalent in a `readonly` manner.
*
* @internal
*/
type ReadonlyEquivalent<X, Y> = Extends<(<T>() => T extends X ? true : false), (<T>() => T extends Y ? true : false)>;
/**
* Checks if one type extends another. Note: this is not quite the same as `Left extends Right` because:
* 1. If either type is `never`, the result is `true` iff the other type is also `never`.
* 2. Types are wrapped in a 1-tuple so that union types are not distributed - instead we consider `string | number` to _not_ extend `number`. If we used `Left extends Right` directly you would get `Extends<string | number, number>` => `false | true` => `boolean`.
*/
export type Extends<Left, Right> = IsNever<Left> extends true ? IsNever<Right> : [Left] extends [Right] ? true : false;
/**
* Checks if the {@linkcode Left} type extends the {@linkcode Right} type,
* excluding `any` or `never`.
*/
export type ExtendsExcludingAnyOrNever<Left, Right> = IsAny<Left> extends true ? IsAny<Right> : Extends<Left, Right>;
/**
* Checks if two types are strictly equal using
* the TypeScript internal identical-to operator.
*
* @see {@link https://github.com/microsoft/TypeScript/issues/55188#issuecomment-1656328122 | much history}
*/
export type StrictEqualUsingTSInternalIdenticalToOperator<L, R> = (<T>() => T extends (L & T) | T ? true : false) extends <T>() => T extends (R & T) | T ? true : false ? IsNever<L> extends IsNever<R> ? true : false : false;
/**
* Checks that {@linkcode Left} and {@linkcode Right} extend each other.
* Not quite the same as an equality check since `any` can make it resolve
* to `true`. So should only be used when {@linkcode Left} and
* {@linkcode Right} are known to avoid `any`.
*/
export type MutuallyExtends<Left, Right> = And<[Extends<Left, Right>, Extends<Right, Left>]>;
/**
* @internal
*/
declare const mismatch: unique symbol;
/**
* @internal
*/
type Mismatch = {
[mismatch]: 'mismatch';
};
/**
* A type which should match anything passed as a value but *doesn't*
* match {@linkcode Mismatch}. It helps TypeScript select the right overload
* for {@linkcode PositiveExpectTypeOf.toEqualTypeOf | .toEqualTypeOf()} and
* {@linkcode PositiveExpectTypeOf.toMatchTypeOf | .toMatchTypeOf()}.
*
* @internal
*/
declare const avalue: unique symbol;
/**
* Represents a value that can be of various types.
*/
export type AValue = {
[avalue]?: undefined;
} | string | number | boolean | symbol | bigint | null | undefined | void;
/**
* Represents the type of mismatched arguments between
* the actual result and the expected result.
*
* If {@linkcode ActualResult} and {@linkcode ExpectedResult} are equivalent,
* the type resolves to an empty tuple `[]`, indicating no mismatch.
* If they are not equivalent, it resolves to a tuple containing the element
* {@linkcode Mismatch}, signifying a discrepancy between
* the expected and actual results.
*/
export type MismatchArgs<ActualResult extends boolean, ExpectedResult extends boolean> = Eq<ActualResult, ExpectedResult> extends true ? [] : [Mismatch];
/**
* Represents the options for the {@linkcode ExpectTypeOf} function.
*/
export interface ExpectTypeOfOptions {
positive: boolean;
branded: boolean;
}
/**
* Convert a union to an intersection.
* `A | B | C` -\> `A & B & C`
*/
export type UnionToIntersection<Union> = (Union extends any ? (distributedUnion: Union) => void : never) extends (mergedIntersection: infer Intersection) => void ? Intersection : never;
/**
* Get the last element of a union.
* First, converts to a union of `() => T` functions,
* then uses {@linkcode UnionToIntersection} to get the last one.
*/
export type LastOf<Union> = UnionToIntersection<Union extends any ? () => Union : never> extends () => infer R ? R : never;
/**
* Intermediate type for {@linkcode UnionToTuple} which pushes the
* "last" union member to the end of a tuple, and recursively prepends
* the remainder of the union.
*/
export type TuplifyUnion<Union, LastElement = LastOf<Union>> = IsNever<Union> extends true ? [] : [...TuplifyUnion<Exclude<Union, LastElement>>, LastElement];
/**
* Convert a union like `1 | 2 | 3` to a tuple like `[1, 2, 3]`.
*/
export type UnionToTuple<Union> = TuplifyUnion<Union>;
export type IsTuple<T> = Or<[Extends<T, []>, Extends<T, [any, ...any[]]>]>;
export type IsUnion<T> = Not<Extends<UnionToTuple<T>['length'], 1>>;
/**
* A recursive version of `Pick` that selects properties from the left type that are present in the right type.
* The "leaf" types from `Left` are used - only the keys of `Right` are considered.
*
* @example
* ```ts
* const user = {email: 'a@b.com', name: 'John Doe', address: {street: '123 2nd St', city: 'New York', zip: '10001', state: 'NY', country: 'USA'}}
*
* type Result = DeepPickMatchingProps<typeof user, {name: unknown; address: {city: unknown}}> // {name: string, address: {city: string}}
* ```
*/
export type DeepPickMatchingProps<Left, Right> = Left extends Record<string, unknown> ? Pick<{
[K in keyof Left]: K extends keyof Right ? DeepPickMatchingProps<Left[K], Right[K]> : never;
}, Extract<keyof Left, keyof Right>> : Left;
export {};
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,eAAe,CAAC,gBAAgB,CAAC;AACrD","sources":["packages/@react-aria/breadcrumbs/intl/nb-NO.json"],"sourcesContent":["{\n \"breadcrumbs\": \"Navigasjonsstier\"\n}\n"],"names":[],"version":3,"file":"nb-NO.module.js.map"}
@@ -0,0 +1,14 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes } from "@peculiar/asn1-schema";
export class OtherKeyAttribute {
constructor(params = {}) {
this.keyAttrId = "";
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
], OtherKeyAttribute.prototype, "keyAttrId", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Any, optional: true })
], OtherKeyAttribute.prototype, "keyAttr", void 0);
@@ -0,0 +1,106 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "ALIAS_KEYS", {
enumerable: true,
get: function () {
return _utils.ALIAS_KEYS;
}
});
Object.defineProperty(exports, "BUILDER_KEYS", {
enumerable: true,
get: function () {
return _utils.BUILDER_KEYS;
}
});
Object.defineProperty(exports, "DEPRECATED_ALIASES", {
enumerable: true,
get: function () {
return _deprecatedAliases.DEPRECATED_ALIASES;
}
});
Object.defineProperty(exports, "DEPRECATED_KEYS", {
enumerable: true,
get: function () {
return _utils.DEPRECATED_KEYS;
}
});
Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", {
enumerable: true,
get: function () {
return _utils.FLIPPED_ALIAS_KEYS;
}
});
Object.defineProperty(exports, "NODE_FIELDS", {
enumerable: true,
get: function () {
return _utils.NODE_FIELDS;
}
});
Object.defineProperty(exports, "NODE_PARENT_VALIDATIONS", {
enumerable: true,
get: function () {
return _utils.NODE_PARENT_VALIDATIONS;
}
});
Object.defineProperty(exports, "NODE_UNION_SHAPES__PRIVATE", {
enumerable: true,
get: function () {
return _utils.NODE_UNION_SHAPES__PRIVATE;
}
});
Object.defineProperty(exports, "PLACEHOLDERS", {
enumerable: true,
get: function () {
return _placeholders.PLACEHOLDERS;
}
});
Object.defineProperty(exports, "PLACEHOLDERS_ALIAS", {
enumerable: true,
get: function () {
return _placeholders.PLACEHOLDERS_ALIAS;
}
});
Object.defineProperty(exports, "PLACEHOLDERS_FLIPPED_ALIAS", {
enumerable: true,
get: function () {
return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS;
}
});
exports.TYPES = void 0;
Object.defineProperty(exports, "VISITOR_KEYS", {
enumerable: true,
get: function () {
return _utils.VISITOR_KEYS;
}
});
require("./core.js");
require("./flow.js");
require("./jsx.js");
require("./misc.js");
require("./experimental.js");
require("./typescript.js");
var _utils = require("./utils.js");
var _placeholders = require("./placeholders.js");
var _deprecatedAliases = require("./deprecated-aliases.js");
Object.keys(_deprecatedAliases.DEPRECATED_ALIASES).forEach(deprecatedAlias => {
_utils.FLIPPED_ALIAS_KEYS[deprecatedAlias] = _utils.FLIPPED_ALIAS_KEYS[_deprecatedAliases.DEPRECATED_ALIASES[deprecatedAlias]];
});
for (const {
types,
set
} of _utils.allExpandedTypes) {
for (const type of types) {
const aliases = _utils.FLIPPED_ALIAS_KEYS[type];
if (aliases) {
aliases.forEach(set.add, set);
} else {
set.add(type);
}
}
}
const TYPES = exports.TYPES = [].concat(Object.keys(_utils.VISITOR_KEYS), Object.keys(_utils.FLIPPED_ALIAS_KEYS), Object.keys(_utils.DEPRECATED_KEYS));
//# sourceMappingURL=index.js.map
@@ -0,0 +1,16 @@
var $2a03621e773f1678$exports = {};
$2a03621e773f1678$exports = {
"ascending": `rosn\u{105}co`,
"ascendingSort": (args)=>`posortowano wed\u{142}ug kolumny ${args.columnName} w porz\u{105}dku rosn\u{105}cym`,
"columnSize": (args)=>`Liczba pikseli: ${args.value}`,
"descending": `malej\u{105}co`,
"descendingSort": (args)=>`posortowano wed\u{142}ug kolumny ${args.columnName} w porz\u{105}dku malej\u{105}cym`,
"resizerDescription": `Naci\u{15B}nij Enter, aby rozpocz\u{105}\u{107} zmienianie rozmiaru`,
"select": `Zaznacz`,
"selectAll": `Zaznacz wszystko`,
"sortable": `kolumna z mo\u{17C}liwo\u{15B}ci\u{105} sortowania`
};
export {$2a03621e773f1678$exports as default};
//# sourceMappingURL=pl-PL.module.js.map
@@ -0,0 +1,205 @@
"use client";
// src/use-tooltip.ts
import { useId, useImperativeHandle } from "react";
import { useTooltipTriggerState } from "@react-stately/tooltip";
import { mergeProps } from "@react-aria/utils";
import { useTooltip as useReactAriaTooltip, useTooltipTrigger } from "@react-aria/tooltip";
import { useOverlayPosition, useOverlay } from "@react-aria/overlays";
import { mapPropsVariants, useProviderContext } from "@heroui/system";
import { popover } from "@heroui/theme";
import { clsx, dataAttr, objectToDeps } from "@heroui/shared-utils";
import { mergeRefs } from "@heroui/react-utils";
import { createDOMRef } from "@heroui/react-utils";
import { useMemo, useRef, useCallback } from "react";
import { toReactAriaPlacement, getArrowPlacement } from "@heroui/aria-utils";
import { useSafeLayoutEffect } from "@heroui/use-safe-layout-effect";
function useTooltip(originalProps) {
var _a, _b;
const globalContext = useProviderContext();
const [props, variantProps] = mapPropsVariants(originalProps, popover.variantKeys);
const {
ref,
as,
isOpen: isOpenProp,
content,
children,
defaultOpen,
onOpenChange,
isDisabled,
trigger: triggerAction,
shouldFlip = true,
containerPadding = 12,
placement: placementProp = "top",
delay = 0,
closeDelay = 500,
showArrow = false,
offset = 7,
crossOffset = 0,
isDismissable,
shouldCloseOnBlur = true,
portalContainer,
isKeyboardDismissDisabled = false,
updatePositionDeps = [],
shouldCloseOnInteractOutside,
className,
onClose,
motionProps,
classNames,
...otherProps
} = props;
const Component = as || "div";
const disableAnimation = (_b = (_a = originalProps == null ? void 0 : originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;
const state = useTooltipTriggerState({
delay,
closeDelay,
isDisabled,
defaultOpen,
isOpen: isOpenProp,
onOpenChange: (isOpen2) => {
onOpenChange == null ? void 0 : onOpenChange(isOpen2);
if (!isOpen2) {
onClose == null ? void 0 : onClose();
}
}
});
const triggerRef = useRef(null);
const overlayRef = useRef(null);
const tooltipId = useId();
const isOpen = state.isOpen && !isDisabled;
useImperativeHandle(
ref,
() => createDOMRef(overlayRef)
);
const { triggerProps, tooltipProps: triggerTooltipProps } = useTooltipTrigger(
{
isDisabled,
trigger: triggerAction
},
state,
triggerRef
);
const { tooltipProps } = useReactAriaTooltip(
{
isOpen,
...mergeProps(props, triggerTooltipProps)
},
state
);
const {
overlayProps: positionProps,
placement,
updatePosition
} = useOverlayPosition({
isOpen,
targetRef: triggerRef,
placement: toReactAriaPlacement(placementProp),
overlayRef,
offset: showArrow ? offset + 3 : offset,
crossOffset,
shouldFlip,
containerPadding
});
useSafeLayoutEffect(() => {
if (!updatePositionDeps.length)
return;
updatePosition();
}, updatePositionDeps);
const { overlayProps } = useOverlay(
{
isOpen,
onClose: state.close,
isDismissable,
shouldCloseOnBlur,
isKeyboardDismissDisabled,
shouldCloseOnInteractOutside
},
overlayRef
);
const slots = useMemo(
() => {
var _a2, _b2, _c;
return popover({
...variantProps,
disableAnimation,
radius: (_a2 = originalProps == null ? void 0 : originalProps.radius) != null ? _a2 : "md",
size: (_b2 = originalProps == null ? void 0 : originalProps.size) != null ? _b2 : "md",
shadow: (_c = originalProps == null ? void 0 : originalProps.shadow) != null ? _c : "sm"
});
},
[
objectToDeps(variantProps),
disableAnimation,
originalProps == null ? void 0 : originalProps.radius,
originalProps == null ? void 0 : originalProps.size,
originalProps == null ? void 0 : originalProps.shadow
]
);
const getTriggerProps = useCallback(
(props2 = {}, _ref = null) => ({
...mergeProps(triggerProps, props2),
ref: mergeRefs(_ref, triggerRef),
"aria-describedby": isOpen ? tooltipId : void 0
}),
[triggerProps, isOpen, tooltipId, state]
);
const getTooltipProps = useCallback(
() => ({
ref: overlayRef,
"data-slot": "base",
"data-open": dataAttr(isOpen),
"data-arrow": dataAttr(showArrow),
"data-disabled": dataAttr(isDisabled),
"data-placement": getArrowPlacement(placement || "top", placementProp),
...mergeProps(tooltipProps, overlayProps, otherProps),
style: mergeProps(positionProps.style, otherProps.style, props.style),
className: slots.base({ class: classNames == null ? void 0 : classNames.base }),
id: tooltipId
}),
[
slots,
isOpen,
showArrow,
isDisabled,
placement,
placementProp,
tooltipProps,
overlayProps,
otherProps,
positionProps,
props,
tooltipId
]
);
const getTooltipContentProps = useCallback(
() => ({
"data-slot": "content",
"data-open": dataAttr(isOpen),
"data-arrow": dataAttr(showArrow),
"data-disabled": dataAttr(isDisabled),
"data-placement": getArrowPlacement(placement || "top", placementProp),
className: slots.content({ class: clsx(classNames == null ? void 0 : classNames.content, className) })
}),
[slots, isOpen, showArrow, isDisabled, placement, placementProp, classNames]
);
return {
Component,
content,
children,
isOpen,
triggerRef,
showArrow,
portalContainer,
placement: placementProp,
disableAnimation,
isDisabled,
motionProps,
getTooltipContentProps,
getTriggerProps,
getTooltipProps
};
}
export {
useTooltip
};
@@ -0,0 +1,3 @@
# @react-types/link
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.
@@ -0,0 +1,42 @@
import { transformProps, defaultTransformValue, readTransformValue, isCSSVariableName } from 'motion-dom';
import { measureViewportBox } from '../../projection/utils/measure.mjs';
import { DOMVisualElement } from '../dom/DOMVisualElement.mjs';
import { buildHTMLStyles } from './utils/build-styles.mjs';
import { renderHTML } from './utils/render.mjs';
import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';
function getComputedStyle(element) {
return window.getComputedStyle(element);
}
class HTMLVisualElement extends DOMVisualElement {
constructor() {
super(...arguments);
this.type = "html";
this.renderInstance = renderHTML;
}
readValueFromInstance(instance, key) {
if (transformProps.has(key)) {
return this.projection?.isProjecting
? defaultTransformValue(key)
: readTransformValue(instance, key);
}
else {
const computedStyle = getComputedStyle(instance);
const value = (isCSSVariableName(key)
? computedStyle.getPropertyValue(key)
: computedStyle[key]) || 0;
return typeof value === "string" ? value.trim() : value;
}
}
measureInstanceViewportBox(instance, { transformPagePoint }) {
return measureViewportBox(instance, transformPagePoint);
}
build(renderState, latestValues, props) {
buildHTMLStyles(renderState, latestValues, props.transformTemplate);
}
scrapeMotionValuesFromProps(props, prevProps, visualElement) {
return scrapeMotionValuesFromProps(props, prevProps, visualElement);
}
}
export { HTMLVisualElement, getComputedStyle };
@@ -0,0 +1,62 @@
'use strict';
var $SyntaxError = require('es-errors/syntax');
var $TypeError = require('es-errors/type');
var IsDetachedBuffer = require('./IsDetachedBuffer');
var IsInteger = require('./IsInteger');
var SetValueInBuffer = require('./SetValueInBuffer');
var ToNumber = require('./ToNumber');
var isNegativeZero = require('math-intrinsics/isNegativeZero');
var typedArrayBuffer = require('typed-array-buffer');
var typedArrayByteOffset = require('typed-array-byte-offset');
var typedArrayLength = require('typed-array-length');
var whichTypedArray = require('which-typed-array');
var tableTAO = require('./tables/typed-array-objects');
// https://262.ecma-international.org/6.0/#sec-integerindexedelementset
module.exports = function IntegerIndexedElementSet(O, index, value) {
if (typeof index !== 'number') {
throw new $TypeError('`index` must be a Number'); // step 1
}
var arrayTypeName = whichTypedArray(O); // step 12
if (!arrayTypeName) {
throw new $TypeError('`O` must be a TypedArray'); // step 2
}
if (arrayTypeName === 'BigInt64Array' || arrayTypeName === 'BigUint64Array') {
throw new $SyntaxError('BigInt64Array and BigUint64Array do not exist until ES2020'); // step 2
}
var numValue = ToNumber(value); // step 3
var buffer = typedArrayBuffer(O); // step 5
if (IsDetachedBuffer(buffer)) {
throw new $TypeError('`O` has a detached buffer'); // step 6
}
if (!IsInteger(index) || isNegativeZero(index)) {
return false; // steps 7 - 8
}
var length = typedArrayLength(O); // step 9
if (index < 0 || index >= length) {
return false; // step 10
}
var offset = typedArrayByteOffset(O); // step 11
var elementType = tableTAO.name['$' + arrayTypeName]; // step 15
var elementSize = tableTAO.size['$' + elementType]; // step 13
var indexedPosition = (index * elementSize) + offset; // step 14
SetValueInBuffer(buffer, indexedPosition, elementType, numValue); // step 16
return true; // step 17
};
@@ -0,0 +1,54 @@
/**
* Adapted from `eslint-plugin-unicorn`
* @license MIT
*/
'use strict'
const {
isParenthesized,
isOpeningParenToken,
isClosingParenToken,
} = require('@eslint-community/eslint-utils')
/*
Get how many times the node is parenthesized.
@param {Node} node - The node to be checked.
@param {SourceCode} sourceCode - The source code object.
@returns {number}
*/
function getParenthesizedTimes(node, sourceCode) {
let times = 0
while (isParenthesized(times + 1, node, sourceCode)) {
times++
}
return times
}
/*
Get all parentheses tokens around the node.
@param {Node} node - The node to be checked.
@param {SourceCode} sourceCode - The source code object.
@returns {Token[]}
*/
function getParentheses(node, sourceCode) {
const count = getParenthesizedTimes(node, sourceCode)
if (count === 0) {
return []
}
return [
...sourceCode.getTokensBefore(node, { count, filter: isOpeningParenToken }),
...sourceCode.getTokensAfter(node, { count, filter: isClosingParenToken }),
]
}
module.exports = {
isParenthesized,
getParenthesizedTimes,
getParentheses,
}
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.objectForEachKey = objectForEachKey;
exports.objectMapKey = objectMapKey;
exports.objectReduceKey = objectReduceKey;
function objectForEachKey(obj, callback) {
const keys = Object.keys(obj);
for (const key of keys) {
callback(key);
}
}
function objectMapKey(obj, callback) {
const values = [];
objectForEachKey(obj, key => {
values.push(callback(key));
});
return values;
}
function objectReduceKey(obj, callback, initial) {
let accumulator = initial;
objectForEachKey(obj, key => {
accumulator = callback(accumulator, key);
});
return accumulator;
}
@@ -0,0 +1,95 @@
/*
* Copyright 2022 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {ClearPressResponder} from '@react-aria/interactions';
import {FocusScope} from '@react-aria/focus';
import React, {ReactNode, useContext, useMemo, useState} from 'react';
import ReactDOM from 'react-dom';
import {useIsSSR} from '@react-aria/ssr';
import {useLayoutEffect} from '@react-aria/utils';
import {useUNSAFE_PortalContext} from './PortalProvider';
export interface OverlayProps {
/**
* The container element in which the overlay portal will be placed.
* @default document.body
*/
portalContainer?: Element,
/** The overlay to render in the portal. */
children: ReactNode,
/**
* Disables default focus management for the overlay, including containment and restoration.
* This option should be used very carefully. When focus management is disabled, you must
* implement focus containment and restoration to ensure the overlay is keyboard accessible.
*/
disableFocusManagement?: boolean,
/**
* Whether to contain focus within the overlay.
*/
shouldContainFocus?: boolean,
/**
* Whether the overlay is currently performing an exit animation. When true,
* focus is allowed to move outside.
*/
isExiting?: boolean
}
export const OverlayContext: React.Context<{contain: boolean, setContain: React.Dispatch<React.SetStateAction<boolean>>} | null> =
React.createContext<{contain: boolean, setContain: React.Dispatch<React.SetStateAction<boolean>>} | null>(null);
/**
* A container which renders an overlay such as a popover or modal in a portal,
* and provides a focus scope for the child elements.
*/
export function Overlay(props: OverlayProps): React.ReactPortal | null {
let isSSR = useIsSSR();
let {portalContainer = isSSR ? null : document.body, isExiting} = props;
let [contain, setContain] = useState(false);
let contextValue = useMemo(() => ({contain, setContain}), [contain, setContain]);
let {getContainer} = useUNSAFE_PortalContext();
if (!props.portalContainer && getContainer) {
portalContainer = getContainer();
}
if (!portalContainer) {
return null;
}
let contents = props.children;
if (!props.disableFocusManagement) {
contents = (
<FocusScope restoreFocus contain={(props.shouldContainFocus || contain) && !isExiting}>
{contents}
</FocusScope>
);
}
contents = (
<OverlayContext.Provider value={contextValue}>
<ClearPressResponder>
{contents}
</ClearPressResponder>
</OverlayContext.Provider>
);
return ReactDOM.createPortal(contents, portalContainer);
}
/** @private */
export function useOverlayFocusContain(): void {
let ctx = useContext(OverlayContext);
let setContain = ctx?.setContain;
useLayoutEffect(() => {
setContain?.(true);
}, [setContain]);
}
@@ -0,0 +1 @@
{"name":"pathe","version":"2.0.3","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532091451,"integrity":"sha512-w3WwYi2zRZlZIma5tiUr/HeLiw+bx+ZWijL7kfts0W2AvJ7ra0n7soe5mkogo3jV4KZMTEhqvMTWdMrLBvp0ug==","mode":420,"size":3355},"dist/index.cjs":{"checkedAt":1794532091451,"integrity":"sha512-O2+MlHlAJ91sNFAfMjAuyHUA9ISM1F2u1lW3335chErDYGlsEVH02T/MywI27a9ru2a+ACnnB3UYTkYibFKdVQ==","mode":420,"size":1249},"dist/shared/pathe.BSlhyZSM.cjs":{"checkedAt":1794532091452,"integrity":"sha512-Z/XEA2joAyZlBoMJZqFCEPxDpM1+ewVvZwKSdfklXFuLwiPQrmqB2LyCnOqskVnto4DfNQIiBVbPTckjdk5zdg==","mode":420,"size":13027},"dist/utils.cjs":{"checkedAt":1794532091452,"integrity":"sha512-dC3I+oGVsKMrPDD+LU0JDMWHsNGRODzRIj/OTiCwBl8NE2lOm/v9tv8dzbhHMN3zZorqFcsSkz7tbNNRFuHK6Q==","mode":420,"size":2521},"dist/index.d.cts":{"checkedAt":1794532091452,"integrity":"sha512-UW1n+AJc5Oo6hGWIOG7bkzbQwjsZAQOxkmixAa3ehwhSYeHMEAf3GnARpJm9i3UxwCWRpdV+XDvKz+T2908ggw==","mode":420,"size":1901},"dist/utils.d.cts":{"checkedAt":1794532091452,"integrity":"sha512-0wf8IxJwFrbKJSkURMsIz0fAQQ+llt53cBYEFEON4a0OveIUofhNfDZraNXLH7FXwyfOJnQw7ZAW67/G92gdYg==","mode":420,"size":1599},"package.json":{"checkedAt":1794532091452,"integrity":"sha512-fWrSQYb6jWsX25WUcL4jnflsPGPHsdjArxLmcxTakAMWRrHBYhjDBGgsYh/elW6SRb7wN9iiJQzHx/r2M7GJUQ==","mode":420,"size":1534},"README.md":{"checkedAt":1794532091453,"integrity":"sha512-94gLf+K6pDuTpWaqTPe4Ziurt6jkSjFTf01rnSX9jIgIx9H4JfzAZhD7RsPwYTV1a5WMmJ1an442XgMsx0nWbA==","mode":420,"size":3048},"dist/index.mjs":{"checkedAt":1794532091453,"integrity":"sha512-ucFdkkQ0kO0oFxnWFa4+K17pA3EFHKI3wUcCg6C7w56mUjG3j47Ag/N6+P55IoNgOi30kh8dsxbNofeRsNP6bA==","mode":420,"size":876},"dist/shared/pathe.M-eThtNZ.mjs":{"checkedAt":1794532091453,"integrity":"sha512-/vFbJ5W/l9vQ3wY/km99QPAdnsATNdSuwso2+mYSpjeiUp0BSRJKghCKj8gDmG3aLPREs+Ev/ErotaXexoeVMQ==","mode":420,"size":12786},"dist/utils.mjs":{"checkedAt":1794532091453,"integrity":"sha512-J+ci/s+MdcPeuYhGyzocbPJq1rlE2XNFlizP7IowFV3FM9LP+M6lnlktwwy9yhaR32uSVTD8TNnCR2FSG6YS7A==","mode":420,"size":2406},"dist/index.d.mts":{"checkedAt":1794532091452,"integrity":"sha512-UW1n+AJc5Oo6hGWIOG7bkzbQwjsZAQOxkmixAa3ehwhSYeHMEAf3GnARpJm9i3UxwCWRpdV+XDvKz+T2908ggw==","mode":420,"size":1901},"dist/utils.d.mts":{"checkedAt":1794532091452,"integrity":"sha512-0wf8IxJwFrbKJSkURMsIz0fAQQ+llt53cBYEFEON4a0OveIUofhNfDZraNXLH7FXwyfOJnQw7ZAW67/G92gdYg==","mode":420,"size":1599},"dist/index.d.ts":{"checkedAt":1794532091452,"integrity":"sha512-UW1n+AJc5Oo6hGWIOG7bkzbQwjsZAQOxkmixAa3ehwhSYeHMEAf3GnARpJm9i3UxwCWRpdV+XDvKz+T2908ggw==","mode":420,"size":1901},"dist/utils.d.ts":{"checkedAt":1794532091452,"integrity":"sha512-0wf8IxJwFrbKJSkURMsIz0fAQQ+llt53cBYEFEON4a0OveIUofhNfDZraNXLH7FXwyfOJnQw7ZAW67/G92gdYg==","mode":420,"size":1599},"utils.d.ts":{"checkedAt":1794532091453,"integrity":"sha512-toN6jPdQMqmUvVSJSwb3SbLcG1ePnJ/YiBssOZhb1qXcJSk77xUyo6QDEwOu85Y41+iiXDDfQLyn2k8+auIN0A==","mode":420,"size":30}}}
@@ -0,0 +1 @@
{"name":"escalade","version":"3.2.0","requiresBuild":false,"files":{"license":{"checkedAt":1794532104228,"integrity":"sha512-i6YIwLi6LAoHlfXiVTw43Q0ZiRcQCv1FNCkjUPIILCoCba1PT0oTfRnGgTrRQOWMjj2ip9gQjPNEajOmCbYNyQ==","mode":420,"size":1104},"dist/index.js":{"checkedAt":1794532117241,"integrity":"sha512-MjstZ4TMjZ4rUjNTFvpjQ8/2kw7Ecrao0nBjMhzxxKvj947VqfFLeDZpiW7MedJ0JzOkIFqbviZvYZwxfEksKQ==","mode":420,"size":534},"sync/index.js":{"checkedAt":1794532117241,"integrity":"sha512-7+/SekZXDWV2ltAuR6cUzpbVo/46ZvxVMBSNwGoXSlQ+6hSWAbq1ir/pIvq04+lchkOxZc1bRpnAK3uw3SwAbw==","mode":420,"size":416},"package.json":{"checkedAt":1794532117241,"integrity":"sha512-nX2h3JlmJO5B37+tC5t3K1V72ObWmjnb+JLf9bmTsEeNObybte/XKlRUfvmM6KYCIksFXEJolBQOAazhjd2cxw==","mode":420,"size":1461},"readme.md":{"checkedAt":1794532117242,"integrity":"sha512-9yQy9RxEcbJoUslsqW8BbsT/WdHBZjXPzvNkaDOAlg0uKhms7ZopwK7qNb/C30Qgc1Hn2sQ0ERVXsIovODk8lQ==","mode":420,"size":6993},"dist/index.mjs":{"checkedAt":1794532117242,"integrity":"sha512-vTqBeadcgN8mUUaaICxIaJuCD50YgXzF6tjUhSjE8b4CUznrxloGnSHOV5tL7mQtr005r3uUr132phPPR/OQSQ==","mode":420,"size":517},"sync/index.mjs":{"checkedAt":1794532117242,"integrity":"sha512-6tclL+N/9Jd5HkVvP7gCQ8pPDa5nYsRdnPGyO54oEh/nDjul7OiMjRqajFp6/mESrj/jEgGfUdFJwXtjHdPNpg==","mode":420,"size":404},"index.d.mts":{"checkedAt":1794532117242,"integrity":"sha512-1IAzmDBgu88WpIPaWQsllv0t8hVSzw6904sXnmpPOvF/FHnQ3lGzea3KX7q3dXxKC9Pk5Z/2Wa8CxTSKZBFdmA==","mode":420,"size":236},"sync/index.d.mts":{"checkedAt":1794532117242,"integrity":"sha512-y+hxE3Ex76ses97zD3sodcTIcUooFJEePkdux6EF8ZNT+Xbfjq4DNT9jSGbndseal9ayjOIKlyPb93UNLo/BpQ==","mode":420,"size":177},"index.d.ts":{"checkedAt":1794532117242,"integrity":"sha512-o5vHXnhVGV6QLvSlH740WXjpfgkJif2QuMTm/vDiNj62J8/ofvHAPsJ6xDoAv7albLH87CadjdSLSmhSGk+Ycw==","mode":420,"size":301},"sync/index.d.ts":{"checkedAt":1794532117243,"integrity":"sha512-LNXr5um7NMP3CHv6USSiId/RyG8z7n9RJReJMUj3RLMLJxQHwTLjffI+126UDg4b+et+mYfU8O6mmdyFTH7TMQ==","mode":420,"size":242}}}
@@ -0,0 +1,30 @@
"use strict";
/**
* Copyright (c) 2019, Microsoft Corporation (MIT License).
*/
Object.defineProperty(exports, "__esModule", { value: true });
var assert = require("assert");
var eventEmitter2_1 = require("./eventEmitter2");
describe('EventEmitter2', function () {
it('should fire listeners multiple times', function () {
var order = [];
var emitter = new eventEmitter2_1.EventEmitter2();
emitter.event(function (data) { return order.push(data + 'a'); });
emitter.event(function (data) { return order.push(data + 'b'); });
emitter.fire(1);
emitter.fire(2);
assert.deepEqual(order, ['1a', '1b', '2a', '2b']);
});
it('should not fire listeners once disposed', function () {
var order = [];
var emitter = new eventEmitter2_1.EventEmitter2();
emitter.event(function (data) { return order.push(data + 'a'); });
var disposeB = emitter.event(function (data) { return order.push(data + 'b'); });
emitter.event(function (data) { return order.push(data + 'c'); });
emitter.fire(1);
disposeB.dispose();
emitter.fire(2);
assert.deepEqual(order, ['1a', '1b', '1c', '2a', '2c']);
});
});
//# sourceMappingURL=eventEmitter2.test.js.map
@@ -0,0 +1,547 @@
import { server } from '@internal/query/tests/mocks/server'
import { setupApiStore } from '@internal/tests/utils/helpers'
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'
import { waitFor } from '@testing-library/react'
import { HttpResponse, http } from 'msw'
import { vi } from 'vitest'
const api = createApi({
baseQuery: fetchBaseQuery({ baseUrl: 'https://example.com' }),
endpoints: () => ({}),
})
const storeRef = setupApiStore(api)
const onStart = vi.fn()
const onSuccess = vi.fn()
const onError = vi.fn()
beforeEach(() => {
onStart.mockClear()
onSuccess.mockClear()
onError.mockClear()
})
describe.each([['query'], ['mutation']] as const)(
'generic cases: %s',
(type) => {
test(`${type}: onStart only`, async () => {
const extended = api.injectEndpoints({
overrideExisting: true,
endpoints: (build) => ({
injected: build[type as 'mutation']<unknown, string>({
query: () => '/success',
onQueryStarted(arg) {
onStart(arg)
},
}),
}),
})
storeRef.store.dispatch(extended.endpoints.injected.initiate('arg'))
expect(onStart).toHaveBeenCalledWith('arg')
})
test(`${type}: onStart and onSuccess`, async () => {
const extended = api.injectEndpoints({
overrideExisting: true,
endpoints: (build) => ({
injected: build[type as 'mutation']<number, string>({
query: () => '/success',
async onQueryStarted(arg, { queryFulfilled }) {
onStart(arg)
// awaiting without catching like this would result in an `unhandledRejection` exception if there was an error
// unfortunately we cannot test for that in jest.
const result = await queryFulfilled
onSuccess(result)
},
}),
}),
})
storeRef.store.dispatch(extended.endpoints.injected.initiate('arg'))
expect(onStart).toHaveBeenCalledWith('arg')
await waitFor(() => {
expect(onSuccess).toHaveBeenCalledWith({
data: { value: 'success' },
meta: {
request: expect.any(Request),
response: expect.any(Object), // Response is not available in jest env
},
})
})
})
test(`${type}: onStart and onError`, async () => {
const extended = api.injectEndpoints({
overrideExisting: true,
endpoints: (build) => ({
injected: build[type as 'mutation']<unknown, string>({
query: () => '/error',
async onQueryStarted(arg, { queryFulfilled }) {
onStart(arg)
try {
const result = await queryFulfilled
onSuccess(result)
} catch (e) {
onError(e)
}
},
}),
}),
})
storeRef.store.dispatch(extended.endpoints.injected.initiate('arg'))
expect(onStart).toHaveBeenCalledWith('arg')
await waitFor(() => {
expect(onError).toHaveBeenCalledWith({
error: {
status: 500,
data: { value: 'error' },
},
isUnhandledError: false,
meta: {
request: expect.any(Request),
response: expect.any(Object), // Response is not available in jest env
},
})
})
expect(onSuccess).not.toHaveBeenCalled()
})
},
)
test('query: getCacheEntry (success)', async () => {
const snapshot = vi.fn()
const extended = api.injectEndpoints({
overrideExisting: true,
endpoints: (build) => ({
injected: build.query<unknown, string>({
query: () => '/success',
async onQueryStarted(
arg,
{ dispatch, getState, getCacheEntry, queryFulfilled },
) {
try {
snapshot(getCacheEntry())
const result = await queryFulfilled
onSuccess(result)
snapshot(getCacheEntry())
} catch (e) {
onError(e)
snapshot(getCacheEntry())
}
},
}),
}),
})
const promise = storeRef.store.dispatch(
extended.endpoints.injected.initiate('arg'),
)
await waitFor(() => {
expect(onSuccess).toHaveBeenCalled()
})
expect(snapshot).toHaveBeenCalledTimes(2)
expect(snapshot.mock.calls[0][0]).toMatchObject({
endpointName: 'injected',
isError: false,
isLoading: true,
isSuccess: false,
isUninitialized: false,
originalArgs: 'arg',
requestId: promise.requestId,
startedTimeStamp: expect.any(Number),
status: 'pending',
})
expect(snapshot.mock.calls[1][0]).toMatchObject({
data: {
value: 'success',
},
endpointName: 'injected',
fulfilledTimeStamp: expect.any(Number),
isError: false,
isLoading: false,
isSuccess: true,
isUninitialized: false,
originalArgs: 'arg',
requestId: promise.requestId,
startedTimeStamp: expect.any(Number),
status: 'fulfilled',
})
})
test('query: getCacheEntry (error)', async () => {
const snapshot = vi.fn()
const extended = api.injectEndpoints({
overrideExisting: true,
endpoints: (build) => ({
injected: build.query<unknown, string>({
query: () => '/error',
async onQueryStarted(
arg,
{ dispatch, getState, getCacheEntry, queryFulfilled },
) {
try {
snapshot(getCacheEntry())
const result = await queryFulfilled
onSuccess(result)
snapshot(getCacheEntry())
} catch (e) {
onError(e)
snapshot(getCacheEntry())
}
},
}),
}),
})
const promise = storeRef.store.dispatch(
extended.endpoints.injected.initiate('arg'),
)
await waitFor(() => {
expect(onError).toHaveBeenCalled()
})
expect(snapshot.mock.calls[0][0]).toMatchObject({
endpointName: 'injected',
isError: false,
isLoading: true,
isSuccess: false,
isUninitialized: false,
originalArgs: 'arg',
requestId: promise.requestId,
startedTimeStamp: expect.any(Number),
status: 'pending',
})
expect(snapshot.mock.calls[1][0]).toMatchObject({
error: {
data: { value: 'error' },
status: 500,
},
endpointName: 'injected',
isError: true,
isLoading: false,
isSuccess: false,
isUninitialized: false,
originalArgs: 'arg',
requestId: promise.requestId,
startedTimeStamp: expect.any(Number),
status: 'rejected',
})
})
test('mutation: getCacheEntry (success)', async () => {
const snapshot = vi.fn()
const extended = api.injectEndpoints({
overrideExisting: true,
endpoints: (build) => ({
injected: build.mutation<unknown, string>({
query: () => '/success',
async onQueryStarted(
arg,
{ dispatch, getState, getCacheEntry, queryFulfilled },
) {
try {
snapshot(getCacheEntry())
const result = await queryFulfilled
onSuccess(result)
snapshot(getCacheEntry())
} catch (e) {
onError(e)
snapshot(getCacheEntry())
}
},
}),
}),
})
const promise = storeRef.store.dispatch(
extended.endpoints.injected.initiate('arg'),
)
await waitFor(() => {
expect(onSuccess).toHaveBeenCalled()
})
expect(snapshot).toHaveBeenCalledTimes(2)
expect(snapshot.mock.calls[0][0]).toMatchObject({
endpointName: 'injected',
isError: false,
isLoading: true,
isSuccess: false,
isUninitialized: false,
startedTimeStamp: expect.any(Number),
status: 'pending',
})
expect(snapshot.mock.calls[1][0]).toMatchObject({
data: {
value: 'success',
},
endpointName: 'injected',
fulfilledTimeStamp: expect.any(Number),
isError: false,
isLoading: false,
isSuccess: true,
isUninitialized: false,
startedTimeStamp: expect.any(Number),
status: 'fulfilled',
})
})
test('mutation: getCacheEntry (error)', async () => {
const snapshot = vi.fn()
const extended = api.injectEndpoints({
overrideExisting: true,
endpoints: (build) => ({
injected: build.mutation<unknown, string>({
query: () => '/error',
async onQueryStarted(
arg,
{ dispatch, getState, getCacheEntry, queryFulfilled },
) {
try {
snapshot(getCacheEntry())
const result = await queryFulfilled
onSuccess(result)
snapshot(getCacheEntry())
} catch (e) {
onError(e)
snapshot(getCacheEntry())
}
},
}),
}),
})
const promise = storeRef.store.dispatch(
extended.endpoints.injected.initiate('arg'),
)
await waitFor(() => {
expect(onError).toHaveBeenCalled()
})
expect(snapshot.mock.calls[0][0]).toMatchObject({
endpointName: 'injected',
isError: false,
isLoading: true,
isSuccess: false,
isUninitialized: false,
startedTimeStamp: expect.any(Number),
status: 'pending',
})
expect(snapshot.mock.calls[1][0]).toMatchObject({
error: {
data: { value: 'error' },
status: 500,
},
endpointName: 'injected',
isError: true,
isLoading: false,
isSuccess: false,
isUninitialized: false,
startedTimeStamp: expect.any(Number),
status: 'rejected',
})
})
test('query: updateCachedData', async () => {
const extended = api.injectEndpoints({
overrideExisting: true,
endpoints: (build) => ({
injected: build.query<{ value: string }, string>({
query: () => '/success',
async onQueryStarted(
arg,
{
dispatch,
getState,
getCacheEntry,
updateCachedData,
queryFulfilled,
},
) {
// calling `updateCachedData` when there is no data yet should not do anything
// but if there is a cache value it will be updated & overwritten by the next successful result
updateCachedData((draft) => {
draft.value += '.'
})
try {
await queryFulfilled
onSuccess(getCacheEntry().data)
} catch (error) {
updateCachedData((draft) => {
draft.value += 'x'
})
onError(getCacheEntry().data)
}
},
}),
}),
})
// request 1: success
expect(onSuccess).not.toHaveBeenCalled()
storeRef.store.dispatch(extended.endpoints.injected.initiate('arg'))
await waitFor(() => {
expect(onSuccess).toHaveBeenCalled()
})
expect(onSuccess).toHaveBeenCalledWith({ value: 'success' })
onSuccess.mockClear()
// request 2: error
expect(onError).not.toHaveBeenCalled()
server.use(
http.get(
'https://example.com/success',
() => {
return HttpResponse.json({ value: 'failed' }, { status: 500 })
},
{ once: true },
),
)
storeRef.store.dispatch(
extended.endpoints.injected.initiate('arg', { forceRefetch: true }),
)
await waitFor(() => {
expect(onError).toHaveBeenCalled()
})
expect(onError).toHaveBeenCalledWith({ value: 'success.x' })
// request 3: success
expect(onSuccess).not.toHaveBeenCalled()
storeRef.store.dispatch(
extended.endpoints.injected.initiate('arg', { forceRefetch: true }),
)
await waitFor(() => {
expect(onSuccess).toHaveBeenCalled()
})
expect(onSuccess).toHaveBeenCalledWith({ value: 'success' })
onSuccess.mockClear()
})
test('infinite query: updateCachedData', async () => {
const extended = api.injectEndpoints({
overrideExisting: true,
endpoints: (build) => ({
infiniteInjected: build.infiniteQuery<{ value: string }, string, number>({
query: () => '/success',
infiniteQueryOptions: {
initialPageParam: 1,
getNextPageParam: (
lastPage,
allPages,
lastPageParam,
allPageParams,
) => lastPageParam + 1,
},
async onQueryStarted(
arg,
{
dispatch,
getState,
getCacheEntry,
updateCachedData,
queryFulfilled,
},
) {
// calling `updateCachedData` when there is no data yet should not do anything
// but if there is a cache value it will be updated & overwritten by the next successful result
updateCachedData((draft) => {
draft.pages = [{ value: '.' }]
draft.pageParams = [1]
})
try {
await queryFulfilled
onSuccess(getCacheEntry().data)
} catch (error) {
updateCachedData((draft) => {
draft.pages = [{ value: 'success.x' }]
draft.pageParams = [1]
})
onError(getCacheEntry().data)
}
},
}),
}),
})
// request 1: success
expect(onSuccess).not.toHaveBeenCalled()
storeRef.store.dispatch(extended.endpoints.infiniteInjected.initiate('arg'))
await waitFor(() => {
expect(onSuccess).toHaveBeenCalled()
})
expect(onSuccess).toHaveBeenCalledWith({
pages: [{ value: 'success' }],
pageParams: [1],
})
onSuccess.mockClear()
// request 2: error
expect(onError).not.toHaveBeenCalled()
server.use(
http.get(
'https://example.com/success',
() => {
return HttpResponse.json({ value: 'failed' }, { status: 500 })
},
{ once: true },
),
)
storeRef.store.dispatch(
extended.endpoints.infiniteInjected.initiate('arg', { forceRefetch: true }),
)
await waitFor(() => {
expect(onError).toHaveBeenCalled()
})
expect(onError).toHaveBeenCalledWith({
pages: [{ value: 'success.x' }],
pageParams: [1],
})
// request 3: success
expect(onSuccess).not.toHaveBeenCalled()
storeRef.store.dispatch(
extended.endpoints.infiniteInjected.initiate('arg', { forceRefetch: true }),
)
await waitFor(() => {
expect(onSuccess).toHaveBeenCalled()
})
expect(onSuccess).toHaveBeenCalledWith({
pages: [{ value: 'success' }],
pageParams: [1],
})
onSuccess.mockClear()
})
test('query: will only start lifecycle if query is not skipped due to `condition`', async () => {
const extended = api.injectEndpoints({
overrideExisting: true,
endpoints: (build) => ({
injected: build.query<unknown, string>({
query: () => '/success',
onQueryStarted(arg) {
onStart(arg)
},
}),
}),
})
const promise = storeRef.store.dispatch(
extended.endpoints.injected.initiate('arg'),
)
expect(onStart).toHaveBeenCalledOnce()
storeRef.store.dispatch(extended.endpoints.injected.initiate('arg'))
expect(onStart).toHaveBeenCalledOnce()
await promise
storeRef.store.dispatch(
extended.endpoints.injected.initiate('arg', { forceRefetch: true }),
)
expect(onStart).toHaveBeenCalledTimes(2)
})
@@ -0,0 +1,17 @@
import {announce as $319e236875307eab$export$a9b970dcc4ae71a9, clearAnnouncer as $319e236875307eab$export$d10ae4f68404609a, destroyAnnouncer as $319e236875307eab$export$d8686216b8b81b2f} from "./LiveAnnouncer.mjs";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
export {$319e236875307eab$export$a9b970dcc4ae71a9 as announce, $319e236875307eab$export$d10ae4f68404609a as clearAnnouncer, $319e236875307eab$export$d8686216b8b81b2f as destroyAnnouncer};
//# sourceMappingURL=module.js.map
@@ -0,0 +1,46 @@
import type { ControllerProps, FieldPath, FieldValues } from './types';
/**
* Component based on `useController` hook to work with controlled component.
*
* @remarks
* [API](https://react-hook-form.com/docs/usecontroller/controller) • [Demo](https://codesandbox.io/s/react-hook-form-v6-controller-ts-jwyzw) • [Video](https://www.youtube.com/watch?v=N2UNk_UCVyA)
*
* @param props - the path name to the form field value, and validation rules.
*
* @returns provide field handler functions, field and form state.
*
* @example
* ```tsx
* function App() {
* const { control } = useForm<FormValues>({
* defaultValues: {
* test: ""
* }
* });
*
* return (
* <form>
* <Controller
* control={control}
* name="test"
* render={({ field: { onChange, onBlur, value, ref }, formState, fieldState }) => (
* <>
* <input
* onChange={onChange} // send value to hook form
* onBlur={onBlur} // notify when input is touched
* value={value} // return updated value
* ref={ref} // set ref for focus management
* />
* <p>{formState.isSubmitted ? "submitted" : ""}</p>
* <p>{fieldState.isTouched ? "touched" : ""}</p>
* </>
* )}
* />
* </form>
* );
* }
* ```
*/
declare const Controller: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TTransformedValues = TFieldValues>(props: ControllerProps<TFieldValues, TName, TTransformedValues>) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
export { Controller };
//# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1,117 @@
"use strict";
/* eslint consistent-return: 0 -- no default case */
const messages = {
env: `
A config object is using the "env" key, which is not supported in flat config system.
Flat config uses "languageOptions.globals" to define global variables for your files.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options
If you're not using "env" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
`,
extends: `
A config object is using the "extends" key, which is not supported in flat config system.
Instead of "extends", you can include config objects that you'd like to extend from directly in the flat config array.
If you're using "extends" in your config file, please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#predefined-and-shareable-configs
If you're not using "extends" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
`,
globals: `
A config object is using the "globals" key, which is not supported in flat config system.
Flat config uses "languageOptions.globals" to define global variables for your files.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options
If you're not using "globals" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
`,
ignorePatterns: `
A config object is using the "ignorePatterns" key, which is not supported in flat config system.
Flat config uses "ignores" to specify files to ignore.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
If you're not using "ignorePatterns" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
`,
noInlineConfig: `
A config object is using the "noInlineConfig" key, which is not supported in flat config system.
Flat config uses "linterOptions.noInlineConfig" to specify files to ignore.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#linter-options
`,
overrides: `
A config object is using the "overrides" key, which is not supported in flat config system.
Flat config is an array that acts like the eslintrc "overrides" array.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#glob-based-configs
If you're not using "overrides" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
`,
parser: `
A config object is using the "parser" key, which is not supported in flat config system.
Flat config uses "languageOptions.parser" to override the default parser.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#custom-parsers
If you're not using "parser" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
`,
parserOptions: `
A config object is using the "parserOptions" key, which is not supported in flat config system.
Flat config uses "languageOptions.parserOptions" to specify parser options.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options
If you're not using "parserOptions" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
`,
reportUnusedDisableDirectives: `
A config object is using the "reportUnusedDisableDirectives" key, which is not supported in flat config system.
Flat config uses "linterOptions.reportUnusedDisableDirectives" to specify files to ignore.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#linter-options
`,
root: `
A config object is using the "root" key, which is not supported in flat config system.
Flat configs always act as if they are the root config file, so this key can be safely removed.
`,
};
module.exports = function ({ key }) {
return messages[key].trim();
};
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=BindingFluentSyntaxImplementation.spec.d.ts.map
@@ -0,0 +1,97 @@
'use strict'
const { getAncestors } = require('./lib/eslint-compat')
const getDocsUrl = require('./lib/get-docs-url')
module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Prefer `async`/`await` to the callback pattern.',
url: getDocsUrl('prefer-await-to-callbacks'),
},
messages: {
error: 'Avoid callbacks. Prefer Async/Await.',
},
schema: [],
},
create(context) {
function checkLastParamsForCallback(node) {
const lastParam = node.params[node.params.length - 1] || {}
if (lastParam.name === 'callback' || lastParam.name === 'cb') {
context.report({ node: lastParam, messageId: 'error' })
}
}
function isInsideYieldOrAwait(node) {
return getAncestors(context, node).some((parent) => {
return (
parent.type === 'AwaitExpression' || parent.type === 'YieldExpression'
)
})
}
return {
CallExpression(node) {
// Callbacks aren't allowed.
if (node.callee.name === 'cb' || node.callee.name === 'callback') {
context.report({ node, messageId: 'error' })
return
}
// Then-ables aren't allowed either.
const args = node.arguments
const lastArgIndex = args.length - 1
const arg = lastArgIndex > -1 && node.arguments[lastArgIndex]
if (
(arg && arg.type === 'FunctionExpression') ||
arg.type === 'ArrowFunctionExpression'
) {
// Ignore event listener callbacks.
if (
node.callee.property &&
(node.callee.property.name === 'on' ||
node.callee.property.name === 'once')
) {
return
}
// carve out exemption for map/filter/etc
const arrayMethods = [
'map',
'every',
'forEach',
'some',
'find',
'filter',
]
const isLodash =
node.callee.object &&
['lodash', 'underscore', '_'].includes(node.callee.object.name)
const callsArrayMethod =
node.callee.property &&
arrayMethods.includes(node.callee.property.name) &&
(node.arguments.length === 1 ||
(node.arguments.length === 2 && isLodash))
const isArrayMethod =
node.callee.name &&
arrayMethods.includes(node.callee.name) &&
node.arguments.length === 2
if (callsArrayMethod || isArrayMethod) return
// actually check for callbacks (I know this is the worst)
if (
arg.params &&
arg.params[0] &&
(arg.params[0].name === 'err' || arg.params[0].name === 'error')
) {
if (!isInsideYieldOrAwait(node)) {
context.report({ node: arg, messageId: 'error' })
}
}
}
},
FunctionDeclaration: checkLastParamsForCallback,
FunctionExpression: checkLastParamsForCallback,
ArrowFunctionExpression: checkLastParamsForCallback,
}
},
}
@@ -0,0 +1,13 @@
import { AnimationFeature } from './animation/index.mjs';
import { ExitAnimationFeature } from './animation/exit.mjs';
const animations = {
animation: {
Feature: AnimationFeature,
},
exit: {
Feature: ExitAnimationFeature,
},
};
export { animations };
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=updateMaybeClassMetadataConstructorArgument.spec.d.ts.map
@@ -0,0 +1,2 @@
import type { ClientRect } from '../../types';
export declare function getWindowClientRect(element: typeof window): ClientRect;
@@ -0,0 +1,9 @@
/*! https://mths.be/includes v2.0.0 by @mathias */
'use strict';
var implementation = require('./implementation');
module.exports = function getPolyfill() {
return String.prototype.includes || implementation;
};
@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CanonicalizeTimeZoneName = CanonicalizeTimeZoneName;
/**
* https://tc39.es/ecma402/#sec-canonicalizetimezonename
* @param tz
*/
function CanonicalizeTimeZoneName(tz, _a) {
var zoneNames = _a.zoneNames, uppercaseLinks = _a.uppercaseLinks;
var uppercasedTz = tz.toUpperCase();
var uppercasedZones = zoneNames.reduce(function (all, z) {
all[z.toUpperCase()] = z;
return all;
}, {});
var ianaTimeZone = uppercaseLinks[uppercasedTz] || uppercasedZones[uppercasedTz];
if (ianaTimeZone === 'Etc/UTC' || ianaTimeZone === 'Etc/GMT') {
return 'UTC';
}
return ianaTimeZone;
}
@@ -0,0 +1 @@
{"version":3,"file":"curryLazyBuildPlanServiceNodeFromClassElementMetadata.js","sourceRoot":"","sources":["../../../../src/planning/actions/curryLazyBuildPlanServiceNodeFromClassElementMetadata.ts"],"names":[],"mappings":";;AAaA,sHA0CC;AApDD,8EAA2E;AAC3E,sFAAmF;AAOnF,2HAAwH;AAExH,SAAgB,qDAAqD,CACnE,wBAMsB;IAMtB,MAAM,4CAA4C,GAI3B,IAAA,qGAAiD,EACtE,wBAAwB,CACzB,CAAC;IAEF,OAAO,CACL,MAAqB,EACrB,sBAA6E,EAC7E,eAA4C,EACf,EAAE;QAC/B,IAAI,CAAC;YACH,OAAO,4CAA4C,CACjD,MAAM,EACN,sBAAsB,EACtB,eAAe,CAChB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,IACE,uCAAkB,CAAC,aAAa,CAAC,KAAK,EAAE,+CAAsB,CAAC,QAAQ,CAAC,EACxE,CAAC;gBACD,OAAO,SAAS,CAAC;YACnB,CAAC;YAED,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,114 @@
/*
* 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 {AriaLabelingProps, FocusableDOMProps, FocusableProps, Key, PressEvents, StyleProps} from '@react-types/shared';
import {ElementType, JSXElementConstructor, ReactNode} from 'react';
interface ButtonProps extends PressEvents, FocusableProps {
/** Whether the button is disabled. */
isDisabled?: boolean,
/** The content to display in the button. */
children?: ReactNode
}
interface ToggleButtonProps extends ButtonProps {
/** Whether the element should be selected (controlled). */
isSelected?: boolean,
/** Whether the element should be selected (uncontrolled). */
defaultSelected?: boolean,
/** Handler that is called when the element's selection state changes. */
onChange?: (isSelected: boolean) => void
}
export interface AriaButtonElementTypeProps<T extends ElementType = 'button'> {
/**
* The HTML element or React element used to render the button, e.g. 'div', 'a', or `RouterLink`.
* @default 'button'
*/
elementType?: T | JSXElementConstructor<any>
}
export interface LinkButtonProps<T extends ElementType = 'button'> extends AriaButtonElementTypeProps<T> {
/** A URL to link to if elementType="a". */
href?: string,
/** The target window for the link. */
target?: string,
/** The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel). */
rel?: string
}
interface AriaBaseButtonProps extends FocusableDOMProps, AriaLabelingProps {
/** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
'aria-expanded'?: boolean | 'true' | 'false',
/** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
'aria-haspopup'?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | 'true' | 'false',
/** Identifies the element (or elements) whose contents or presence are controlled by the current element. */
'aria-controls'?: string,
/** Indicates the current "pressed" state of toggle buttons. */
'aria-pressed'?: boolean | 'true' | 'false' | 'mixed',
/**
* The behavior of the button when used in an HTML form.
* @default 'button'
*/
type?: 'button' | 'submit' | 'reset',
/**
* Whether to prevent focus from moving to the button when pressing it.
*
* Caution, this can make the button inaccessible and should only be used when alternative keyboard interaction is provided,
* such as ComboBox's MenuTrigger or a NumberField's increment/decrement control.
*/
preventFocusOnPress?: boolean
}
export interface AriaButtonProps<T extends ElementType = 'button'> extends ButtonProps, LinkButtonProps<T>, AriaBaseButtonProps {}
export interface AriaToggleButtonProps<T extends ElementType = 'button'> extends ToggleButtonProps, AriaBaseButtonProps, AriaButtonElementTypeProps<T> {}
export interface AriaToggleButtonGroupItemProps<E extends ElementType = 'button'> extends Omit<AriaToggleButtonProps<E>, 'id' | 'isSelected' | 'defaultSelected' | 'onChange'> {
/** An identifier for the item in the `selectedKeys` of a ToggleButtonGroup. */
id: Key
}
/** @deprecated */
type LegacyButtonVariant = 'cta' | 'overBackground';
export interface SpectrumButtonProps<T extends ElementType = 'button'> extends AriaBaseButtonProps, ButtonProps, LinkButtonProps<T>, StyleProps {
/** The [visual style](https://spectrum.adobe.com/page/button/#Options) of the button. */
variant: 'accent' | 'primary' | 'secondary' | 'negative' | LegacyButtonVariant,
/** The background style of the button. */
style?: 'fill' | 'outline',
/** The static color style to apply. Useful when the button appears over a color background. */
staticColor?: 'white' | 'black',
/**
* Whether to disable events immediately and display a loading spinner after a 1 second delay.
*/
isPending?: boolean,
/**
* Whether the button should be displayed with a quiet style.
* @deprecated
*/
isQuiet?: boolean
}
export interface SpectrumActionButtonProps extends AriaBaseButtonProps, ButtonProps, StyleProps {
/** Whether the button should be displayed with a [quiet style](https://spectrum.adobe.com/page/action-button/#Quiet). */
isQuiet?: boolean,
/** The static color style to apply. Useful when the button appears over a color background. */
staticColor?: 'white' | 'black'
}
export interface SpectrumLogicButtonProps extends AriaBaseButtonProps, ButtonProps, StyleProps {
/** The type of boolean sequence to be represented by the LogicButton. */
variant: 'and' | 'or'
}
export interface SpectrumToggleButtonProps extends ToggleButtonProps, SpectrumActionButtonProps {
/** Whether the button should be displayed with an [emphasized style](https://spectrum.adobe.com/page/action-button/#Emphasis). */
isEmphasized?: boolean
}
@@ -0,0 +1,19 @@
import { Peer } from './types';
interface FileUUIDData {
peer: Peer;
modelId?: string;
fileId?: string;
msgId?: string;
elementId?: string;
fileUUID?: string;
}
export declare class FileNapCatOneBotUUIDWrap {
private manager;
constructor(ttl?: number);
encodeModelId(peer: Peer, modelId: string, fileId: string, fileUUID?: string, endString?: string, customUUID?: string): string;
decodeModelId(uuid: string): FileUUIDData | undefined;
encode(peer: Peer, msgId: string, elementId: string, fileUUID?: string, customUUID?: string): string;
decode(uuid: string): FileUUIDData | undefined;
}
export declare const FileNapCatOneBotUUID: FileNapCatOneBotUUIDWrap;
export {};
@@ -0,0 +1,294 @@
'use strict';
var defineProperties = require('define-properties');
var test = require('tape');
var callBind = require('call-bind');
var functionsHaveNames = require('functions-have-names')();
var hasStrictMode = require('has-strict-mode')();
var forEach = require('for-each');
var debug = require('object-inspect');
var v = require('es-value-fixtures');
var hasSymbols = require('has-symbols/shams')();
var hasPropertyDescriptors = require('has-property-descriptors')();
var iterate = require('iterate-iterator');
var index = require('../Iterator.prototype.drop');
var impl = require('../Iterator.prototype.drop/implementation');
var fnName = 'drop';
var isEnumerable = Object.prototype.propertyIsEnumerable;
var testIterator = require('./helpers/testIterator');
module.exports = {
tests: function (drop, name, t) {
t['throws'](
function () { return new drop(); }, // eslint-disable-line new-cap
TypeError,
'`' + name + '` itself is not a constructor'
);
forEach(v.primitives.concat(v.objects), function (nonIterator) {
t['throws'](
function () { iterate(drop(nonIterator, 0)); },
TypeError,
debug(nonIterator) + ' is not an Object with a callable `next` method'
);
var badNext = { next: nonIterator };
t['throws'](
function () { iterate(drop(badNext, 0)); },
TypeError,
debug(badNext) + ' is not an Object with a callable `next` method'
);
});
t.test('observable lookups', { skip: !hasPropertyDescriptors }, function (st) {
var effects = [];
var obj = {};
Object.defineProperty(obj, 'next', {
configurable: true,
enumerable: true,
get: function next() {
effects.push('get next');
return function () {
return { done: true, value: undefined };
};
}
});
drop(obj, {
valueOf: function valueOf() {
effects.push('ToNumber limit');
return 0;
}
});
st.deepEqual(effects, [
'ToNumber limit',
'get next'
]);
st.end();
});
var arr = [1, 2, 3];
t.test('actual iteration', { skip: !hasSymbols }, function (st) {
var iterator = callBind(arr[Symbol.iterator], arr);
st['throws'](
function () { drop(iterator(), -3); },
RangeError,
'-3 is not >= 0'
);
st['throws'](
function () { return new drop(iterator()); }, // eslint-disable-line new-cap
TypeError,
'`' + name + '` iterator is not a constructor'
);
st['throws'](
function () { return new drop(iterator(), 0); }, // eslint-disable-line new-cap
TypeError,
'`' + name + '` iterator is not a constructor'
);
testIterator(iterator(), [1, 2, 3], st, 'original');
testIterator(drop(iterator(), 0), [1, 2, 3], st, 'drop 0');
testIterator(drop(iterator(), 1), [2, 3], st, 'drop 1');
testIterator(drop(iterator(), 2), [3], st, 'drop 2');
testIterator(drop(iterator(), 3), [], st, 'drop 3');
testIterator(drop(iterator(), Infinity), [], st, 'drop ∞');
st.end();
});
t.test('262: test/built-ins/Iterator/prototype/drop/get-return-method-throws', { skip: !hasPropertyDescriptors }, function (st) {
var badIterator = {
next: function next() {
return {
done: false,
value: 1
};
}
};
Object.defineProperty(badIterator, 'return', {
configurable: true,
enumerable: true,
get: function () { throw new SyntaxError(); }
});
var iter = drop(badIterator, 1);
iter.next();
st['throws'](
function () { iter['return'](); },
SyntaxError,
'gets the `return` method, whose getter throws'
);
st.end();
});
t.test('262: test/built-ins/Iterator/prototype/drop/return-is-forwarded', function (st) {
var returnCount = 0;
var makeBadIterator = function makeBadIterator() {
return {
next: function next() {
return {
done: false,
value: 1
};
},
'return': function () {
returnCount += 1;
return {};
}
};
};
var iter1 = drop(makeBadIterator(), 0);
st.equal(returnCount, 0, 'iter1, before return()');
iter1['return']();
st.equal(returnCount, 1, 'iter1, after return()');
var iter2 = drop(makeBadIterator(), 1);
st.equal(returnCount, 1, 'iter2, before return()');
iter2['return']();
st.equal(returnCount, 2, 'iter2, after return()');
// 5 drops (i wish i had pipeline)
var iter3 = drop(
drop(
drop(
drop(
drop(
makeBadIterator(),
1
),
1
),
1
),
1
),
1
);
st.equal(returnCount, 2, 'iter3, before return()');
iter3['return']();
st.equal(returnCount, 3, 'iter3, after return()');
st.end();
});
t.test('262: test/built-ins/Iterator/prototype/drop/return-is-not-forwarded-after-exhaustion', { skip: !hasPropertyDescriptors }, function (st) {
var makeBadIterator = function makeBadIterator() {
return {
next: function next() {
return {
done: true,
value: undefined
};
},
'return': function () {
throw new SyntaxError();
}
};
};
var iter1 = drop(makeBadIterator(), 0);
st['throws'](
function () { iter1['return'](); },
SyntaxError,
'iter1, return() throws'
);
iter1.next();
iter1['return']();
var iter2 = drop(makeBadIterator(), 1);
st['throws'](
function () { iter2['return'](); },
SyntaxError,
'iter2, return() throws'
);
iter2.next();
iter2['return']();
// 5 drops (i wish i had pipeline)
var iter3 = drop(
drop(
drop(
drop(
drop(
makeBadIterator(),
1
),
1
),
1
),
1
),
1
);
st['throws'](
function () { iter3['return'](); },
SyntaxError,
'iter3, return() throws'
);
iter3.next();
iter3['return']();
var iter4 = drop(makeBadIterator(), 10);
st['throws'](
function () { iter4['return'](); },
SyntaxError,
'iter4, return() throws'
);
iter4.next();
iter4['return']();
st.end();
});
},
index: function () {
test('Iterator.prototype.' + fnName + ': index', function (t) {
module.exports.tests(index, 'Iterator.prototype.' + fnName, t);
t.end();
});
},
implementation: function () {
test('Iterator.prototype.' + fnName + ': implementation', function (t) {
module.exports.tests(callBind(impl), 'Iterator.prototype.' + fnName, t);
t.end();
});
},
shimmed: function () {
test('Iterator.prototype.' + fnName + ': shimmed', function (t) {
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(Iterator.prototype[fnName].name, fnName, 'Iterator#' + fnName + ' has name "' + fnName + '"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(Iterator.prototype, fnName), 'Iterator#' + fnName + ' is not enumerable');
et.end();
});
t.test('bad string/this value', { skip: !hasStrictMode }, function (st) {
st['throws'](function () { return Iterator.prototype[fnName].call(undefined, 'a'); }, TypeError, 'undefined is not an object');
st['throws'](function () { return Iterator.prototype[fnName].call(null, 'a'); }, TypeError, 'null is not an object');
st.end();
});
module.exports.tests(callBind(Iterator.prototype[fnName]), 'Iterator.prototype.' + fnName, t);
t.end();
});
}
};
@@ -0,0 +1,75 @@
{
"name": "async",
"description": "Higher-order functions and common patterns for asynchronous code",
"version": "3.2.6",
"main": "dist/async.js",
"author": "Caolan McMahon",
"homepage": "https://caolan.github.io/async/",
"repository": {
"type": "git",
"url": "https://github.com/caolan/async.git"
},
"bugs": {
"url": "https://github.com/caolan/async/issues"
},
"keywords": [
"async",
"callback",
"module",
"utility"
],
"devDependencies": {
"@babel/eslint-parser": "^7.16.5",
"@babel/core": "7.25.2",
"babel-minify": "^0.5.0",
"babel-plugin-add-module-exports": "^1.0.4",
"babel-plugin-istanbul": "^7.0.0",
"babel-plugin-syntax-async-generators": "^6.13.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"babel-preset-es2015": "^6.3.13",
"babel-preset-es2017": "^6.22.0",
"babel-register": "^6.26.0",
"babelify": "^10.0.0",
"benchmark": "^2.1.1",
"bluebird": "^3.4.6",
"browserify": "^17.0.0",
"chai": "^4.2.0",
"cheerio": "^0.22.0",
"es6-promise": "^4.2.8",
"eslint": "^8.6.0",
"eslint-plugin-prefer-arrow": "^1.2.3",
"fs-extra": "^11.1.1",
"jsdoc": "^4.0.3",
"karma": "^6.3.12",
"karma-browserify": "^8.1.0",
"karma-firefox-launcher": "^2.1.2",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.0",
"karma-safari-launcher": "^1.0.0",
"mocha": "^6.1.4",
"native-promise-only": "^0.8.0-a",
"nyc": "^17.0.0",
"rollup": "^4.2.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-npm": "^2.0.0",
"rsvp": "^4.8.5",
"semver": "^7.3.5",
"yargs": "^17.3.1"
},
"scripts": {
"coverage": "nyc npm run mocha-node-test -- --grep @nycinvalid --invert",
"jsdoc": "jsdoc -c ./support/jsdoc/jsdoc.json && node support/jsdoc/jsdoc-fix-html.js",
"lint": "eslint --fix .",
"mocha-browser-test": "karma start",
"mocha-node-test": "mocha",
"mocha-test": "npm run mocha-node-test && npm run mocha-browser-test",
"test": "npm run lint && npm run mocha-node-test"
},
"license": "MIT",
"nyc": {
"exclude": [
"test"
]
},
"module": "dist/async.mjs"
}
@@ -0,0 +1,45 @@
/**
* @author Vignesh Anand
* See LICENSE file in root directory for full license.
*/
"use strict"
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "disallow the use of `process.env`",
category: "Stylistic Issues",
recommended: false,
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-process-env.md",
},
fixable: null,
schema: [],
messages: {
unexpectedProcessEnv: "Unexpected use of process.env.",
},
},
create(context) {
return {
MemberExpression(node) {
const objectName = node.object.name
const propertyName = node.property.name
if (
objectName === "process" &&
!node.computed &&
propertyName &&
propertyName === "env"
) {
context.report({ node, messageId: "unexpectedProcessEnv" })
}
},
}
},
}
@@ -0,0 +1,24 @@
import baseSortedUniq from './_baseSortedUniq.js';
/**
* This method is like `_.uniq` except that it's designed and optimized
* for sorted arrays.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.sortedUniq([1, 1, 2]);
* // => [1, 2]
*/
function sortedUniq(array) {
return (array && array.length)
? baseSortedUniq(array)
: [];
}
export default sortedUniq;
@@ -0,0 +1,21 @@
import baseEach from './_baseEach.js';
/**
* Aggregates elements of `collection` on `accumulator` with keys transformed
* by `iteratee` and values set by `setter`.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform keys.
* @param {Object} accumulator The initial aggregated object.
* @returns {Function} Returns `accumulator`.
*/
function baseAggregator(collection, setter, iteratee, accumulator) {
baseEach(collection, function(value, key, collection) {
setter(accumulator, value, iteratee(value), collection);
});
return accumulator;
}
export default baseAggregator;
@@ -0,0 +1,19 @@
## Versions of `node-gyp` that are earlier than v9.x.x
Please look thru your error log for the string `gyp info using node-gyp@` and if that version number is less than the [current release of node-gyp](https://github.com/nodejs/node-gyp/releases) then __please upgrade__ using [these instructions](https://github.com/nodejs/node-gyp/blob/master/docs/Updating-npm-bundled-node-gyp.md) and then try your command again.
## `node-sass` is deprecated
Please be aware that the package [`node-sass` is deprecated](https://github.com/sass/node-sass#node-sass) so you should actively seek alternatives. You can try:
```
npm uninstall node-sass
npm install sass --save
# or ...
npm install --global node-sass@latest
```
`node-sass` projects _may_ work by downgrading to Node.js v14 but [that release is end-of-life](https://github.com/nodejs/release#release-schedule).
But in any case, please avoid opening new `node-sass` issues on this repo because we [cannot help much](https://github.com/nodejs/node-gyp/issues?q=is%3Aissue+label%3A%22Node+Sass+--%3E+Dart+Sass%22+).
## Issues finding the installed Visual Studio
In cmd, [`npm config set msvs_version 20xx`](https://github.com/nodejs/node-gyp#on-windows) with ___xx___ matching your locally installed version of Visual Studio.
@@ -0,0 +1,352 @@
import { expect, test } from "vitest";
import * as z from "zod/v4";
test("continuability", () => {
/**
* | $ZodGUID
| $ZodUUID
| $ZodEmail
| $ZodURL
| $ZodEmoji
| $ZodNanoID
| $ZodCUID
| $ZodCUID2
| $ZodULID
| $ZodXID
| $ZodKSUID
| $ZodISODateTime
| $ZodISODate
| $ZodISOTime
| $ZodISODuration
| $ZodIPv4
| $ZodIPv6
| $ZodCIDRv4
| $ZodCIDRv6
| $ZodBase64
| $ZodBase64URL
| $ZodE164
| $ZodJWT;
*/
expect(
z
.email()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "email",
"message": "Invalid email address",
"origin": "string",
"path": [],
"pattern": "/^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.uuid()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "uuid",
"message": "Invalid UUID",
"origin": "string",
"path": [],
"pattern": "/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.url()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "url",
"message": "Invalid URL",
"path": [],
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.jwt()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "jwt",
"message": "Invalid JWT",
"path": [],
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.cidrv4()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "cidrv4",
"message": "Invalid IPv4 range",
"origin": "string",
"path": [],
"pattern": "/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.cidrv6()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "cidrv6",
"message": "Invalid IPv6 range",
"path": [],
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.ipv4()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "ipv4",
"message": "Invalid IPv4 address",
"origin": "string",
"path": [],
"pattern": "/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.ipv6()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "ipv6",
"message": "Invalid IPv6 address",
"path": [],
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.emoji()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "emoji",
"message": "Invalid emoji",
"origin": "string",
"path": [],
"pattern": "/^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$/u",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.nanoid()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "nanoid",
"message": "Invalid nanoid",
"origin": "string",
"path": [],
"pattern": "/^[a-zA-Z0-9_-]{21}$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.cuid()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "cuid",
"message": "Invalid cuid",
"origin": "string",
"path": [],
"pattern": "/^[cC][^\\s-]{8,}$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.cuid2()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "cuid2",
"message": "Invalid cuid2",
"origin": "string",
"path": [],
"pattern": "/^[0-9a-z]+$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.ulid()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "ulid",
"message": "Invalid ULID",
"origin": "string",
"path": [],
"pattern": "/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.xid()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "xid",
"message": "Invalid XID",
"origin": "string",
"path": [],
"pattern": "/^[0-9a-vA-V]{20}$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.ksuid()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "ksuid",
"message": "Invalid KSUID",
"origin": "string",
"path": [],
"pattern": "/^[A-Za-z0-9]{27}$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
});
@@ -0,0 +1,420 @@
"use strict"
// builtin tooling
const path = require("path")
// internal tooling
const joinMedia = require("./lib/join-media")
const joinLayer = require("./lib/join-layer")
const resolveId = require("./lib/resolve-id")
const loadContent = require("./lib/load-content")
const processContent = require("./lib/process-content")
const parseStatements = require("./lib/parse-statements")
const assignLayerNames = require("./lib/assign-layer-names")
const dataURL = require("./lib/data-url")
function AtImport(options) {
options = {
root: process.cwd(),
path: [],
skipDuplicates: true,
resolve: resolveId,
load: loadContent,
plugins: [],
addModulesDirectories: [],
nameLayer: null,
...options,
}
options.root = path.resolve(options.root)
// convert string to an array of a single element
if (typeof options.path === "string") options.path = [options.path]
if (!Array.isArray(options.path)) options.path = []
options.path = options.path.map(p => path.resolve(options.root, p))
return {
postcssPlugin: "postcss-import",
Once(styles, { result, atRule, postcss }) {
const state = {
importedFiles: {},
hashFiles: {},
rootFilename: null,
anonymousLayerCounter: 0,
}
if (styles.source?.input?.file) {
state.rootFilename = styles.source.input.file
state.importedFiles[styles.source.input.file] = {}
}
if (options.plugins && !Array.isArray(options.plugins)) {
throw new Error("plugins option must be an array")
}
if (options.nameLayer && typeof options.nameLayer !== "function") {
throw new Error("nameLayer option must be a function")
}
return parseStyles(result, styles, options, state, [], []).then(
bundle => {
applyRaws(bundle)
applyMedia(bundle)
applyStyles(bundle, styles)
}
)
function applyRaws(bundle) {
bundle.forEach((stmt, index) => {
if (index === 0) return
if (stmt.parent) {
const { before } = stmt.parent.node.raws
if (stmt.type === "nodes") stmt.nodes[0].raws.before = before
else stmt.node.raws.before = before
} else if (stmt.type === "nodes") {
stmt.nodes[0].raws.before = stmt.nodes[0].raws.before || "\n"
}
})
}
function applyMedia(bundle) {
bundle.forEach(stmt => {
if (
(!stmt.media.length && !stmt.layer.length) ||
stmt.type === "charset"
) {
return
}
if (stmt.layer.length > 1) {
assignLayerNames(stmt.layer, stmt.node, state, options)
}
if (stmt.type === "import") {
const parts = [stmt.fullUri]
const media = stmt.media.join(", ")
if (stmt.layer.length) {
const layerName = stmt.layer.join(".")
let layerParams = "layer"
if (layerName) {
layerParams = `layer(${layerName})`
}
parts.push(layerParams)
}
if (media) {
parts.push(media)
}
stmt.node.params = parts.join(" ")
} else if (stmt.type === "media") {
if (stmt.layer.length) {
const layerNode = atRule({
name: "layer",
params: stmt.layer.join("."),
source: stmt.node.source,
})
if (stmt.parentMedia?.length) {
const mediaNode = atRule({
name: "media",
params: stmt.parentMedia.join(", "),
source: stmt.node.source,
})
mediaNode.append(layerNode)
layerNode.append(stmt.node)
stmt.node = mediaNode
} else {
layerNode.append(stmt.node)
stmt.node = layerNode
}
} else {
stmt.node.params = stmt.media.join(", ")
}
} else {
const { nodes } = stmt
const { parent } = nodes[0]
let outerAtRule
let innerAtRule
if (stmt.media.length && stmt.layer.length) {
const mediaNode = atRule({
name: "media",
params: stmt.media.join(", "),
source: parent.source,
})
const layerNode = atRule({
name: "layer",
params: stmt.layer.join("."),
source: parent.source,
})
mediaNode.append(layerNode)
innerAtRule = layerNode
outerAtRule = mediaNode
} else if (stmt.media.length) {
const mediaNode = atRule({
name: "media",
params: stmt.media.join(", "),
source: parent.source,
})
innerAtRule = mediaNode
outerAtRule = mediaNode
} else if (stmt.layer.length) {
const layerNode = atRule({
name: "layer",
params: stmt.layer.join("."),
source: parent.source,
})
innerAtRule = layerNode
outerAtRule = layerNode
}
parent.insertBefore(nodes[0], outerAtRule)
// remove nodes
nodes.forEach(node => {
node.parent = undefined
})
// better output
nodes[0].raws.before = nodes[0].raws.before || "\n"
// wrap new rules with media query and/or layer at rule
innerAtRule.append(nodes)
stmt.type = "media"
stmt.node = outerAtRule
delete stmt.nodes
}
})
}
function applyStyles(bundle, styles) {
styles.nodes = []
// Strip additional statements.
bundle.forEach(stmt => {
if (["charset", "import", "media"].includes(stmt.type)) {
stmt.node.parent = undefined
styles.append(stmt.node)
} else if (stmt.type === "nodes") {
stmt.nodes.forEach(node => {
node.parent = undefined
styles.append(node)
})
}
})
}
function parseStyles(result, styles, options, state, media, layer) {
const statements = parseStatements(result, styles)
return Promise.resolve(statements)
.then(stmts => {
// process each statement in series
return stmts.reduce((promise, stmt) => {
return promise.then(() => {
stmt.media = joinMedia(media, stmt.media || [])
stmt.parentMedia = media
stmt.layer = joinLayer(layer, stmt.layer || [])
// skip protocol base uri (protocol://url) or protocol-relative
if (
stmt.type !== "import" ||
/^(?:[a-z]+:)?\/\//i.test(stmt.uri)
) {
return
}
if (options.filter && !options.filter(stmt.uri)) {
// rejected by filter
return
}
return resolveImportId(result, stmt, options, state)
})
}, Promise.resolve())
})
.then(() => {
let charset
const imports = []
const bundle = []
function handleCharset(stmt) {
if (!charset) charset = stmt
// charsets aren't case-sensitive, so convert to lower case to compare
else if (
stmt.node.params.toLowerCase() !==
charset.node.params.toLowerCase()
) {
throw new Error(
`Incompatable @charset statements:
${stmt.node.params} specified in ${stmt.node.source.input.file}
${charset.node.params} specified in ${charset.node.source.input.file}`
)
}
}
// squash statements and their children
statements.forEach(stmt => {
if (stmt.type === "charset") handleCharset(stmt)
else if (stmt.type === "import") {
if (stmt.children) {
stmt.children.forEach((child, index) => {
if (child.type === "import") imports.push(child)
else if (child.type === "charset") handleCharset(child)
else bundle.push(child)
// For better output
if (index === 0) child.parent = stmt
})
} else imports.push(stmt)
} else if (stmt.type === "media" || stmt.type === "nodes") {
bundle.push(stmt)
}
})
return charset
? [charset, ...imports.concat(bundle)]
: imports.concat(bundle)
})
}
function resolveImportId(result, stmt, options, state) {
if (dataURL.isValid(stmt.uri)) {
return loadImportContent(result, stmt, stmt.uri, options, state).then(
result => {
stmt.children = result
}
)
}
const atRule = stmt.node
let sourceFile
if (atRule.source?.input?.file) {
sourceFile = atRule.source.input.file
}
const base = sourceFile
? path.dirname(atRule.source.input.file)
: options.root
return Promise.resolve(options.resolve(stmt.uri, base, options))
.then(paths => {
if (!Array.isArray(paths)) paths = [paths]
// Ensure that each path is absolute:
return Promise.all(
paths.map(file => {
return !path.isAbsolute(file)
? resolveId(file, base, options)
: file
})
)
})
.then(resolved => {
// Add dependency messages:
resolved.forEach(file => {
result.messages.push({
type: "dependency",
plugin: "postcss-import",
file,
parent: sourceFile,
})
})
return Promise.all(
resolved.map(file => {
return loadImportContent(result, stmt, file, options, state)
})
)
})
.then(result => {
// Merge loaded statements
stmt.children = result.reduce((result, statements) => {
return statements ? result.concat(statements) : result
}, [])
})
}
function loadImportContent(result, stmt, filename, options, state) {
const atRule = stmt.node
const { media, layer } = stmt
assignLayerNames(layer, atRule, state, options)
if (options.skipDuplicates) {
// skip files already imported at the same scope
if (state.importedFiles[filename]?.[media]?.[layer]) {
return
}
// save imported files to skip them next time
if (!state.importedFiles[filename]) {
state.importedFiles[filename] = {}
}
if (!state.importedFiles[filename][media]) {
state.importedFiles[filename][media] = {}
}
state.importedFiles[filename][media][layer] = true
}
return Promise.resolve(options.load(filename, options)).then(
content => {
if (content.trim() === "") {
result.warn(`${filename} is empty`, { node: atRule })
return
}
// skip previous imported files not containing @import rules
if (state.hashFiles[content]?.[media]?.[layer]) {
return
}
return processContent(
result,
content,
filename,
options,
postcss
).then(importedResult => {
const styles = importedResult.root
result.messages = result.messages.concat(importedResult.messages)
if (options.skipDuplicates) {
const hasImport = styles.some(child => {
return child.type === "atrule" && child.name === "import"
})
if (!hasImport) {
// save hash files to skip them next time
if (!state.hashFiles[content]) {
state.hashFiles[content] = {}
}
if (!state.hashFiles[content][media]) {
state.hashFiles[content][media] = {}
}
state.hashFiles[content][media][layer] = true
}
}
// recursion: import @import from imported file
return parseStyles(result, styles, options, state, media, layer)
})
}
)
}
},
}
}
AtImport.postcss = true
module.exports = AtImport
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('wrap', require('../wrap'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,11 @@
export { useSensor } from './useSensor';
export { useSensors } from './useSensors';
export { AbstractPointerSensor, PointerSensor } from './pointer';
export type { AbstractPointerSensorOptions, AbstractPointerSensorProps, PointerActivationConstraint, PointerEventHandlers, PointerSensorOptions, PointerSensorProps, } from './pointer';
export { MouseSensor } from './mouse';
export type { MouseSensorOptions, MouseSensorProps } from './mouse';
export { TouchSensor } from './touch';
export type { TouchSensorOptions, TouchSensorProps } from './touch';
export { KeyboardSensor, KeyboardCode, defaultKeyboardCoordinateGetter, } from './keyboard';
export type { KeyboardCoordinateGetter, KeyboardSensorOptions, KeyboardSensorProps, KeyboardCodes, } from './keyboard';
export type { Activator, Activators, Response as SensorResponse, Sensor, Sensors, SensorActivatorFunction, SensorDescriptor, SensorContext, SensorHandler, SensorInstance, SensorOptions, SensorProps, } from './types';
@@ -0,0 +1,24 @@
/**
* @license React
* react-dom-test-utils.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
"production" !== process.env.NODE_ENV &&
(function () {
var React = require("react"),
didWarnAboutUsingAct = !1;
exports.act = function (callback) {
!1 === didWarnAboutUsingAct &&
((didWarnAboutUsingAct = !0),
console.error(
"`ReactDOMTestUtils.act` is deprecated in favor of `React.act`. Import `act` from `react` instead of `react-dom/test-utils`. See https://react.dev/warnings/react-dom-test-utils for more info."
));
return React.act(callback);
};
})();
@@ -0,0 +1,6 @@
function _arrayLikeToArray(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
return n;
}
export { _arrayLikeToArray as default };
@@ -0,0 +1,7 @@
import addMilliseconds from "./addMilliseconds.mjs";
function subMilliseconds(date, ms) {
return addMilliseconds(date, -ms);
}
export {
subMilliseconds as default
};
@@ -0,0 +1,25 @@
"use client";
import {
button_group_default
} from "./chunk-57V4RE7B.mjs";
import {
button_default
} from "./chunk-XJ3PDX4B.mjs";
import {
useButtonGroup
} from "./chunk-6XRBX2TW.mjs";
import {
useButton
} from "./chunk-JLZ7IZPR.mjs";
import {
ButtonGroupProvider,
useButtonGroupContext
} from "./chunk-3SAWKTTV.mjs";
export {
button_default as Button,
button_group_default as ButtonGroup,
ButtonGroupProvider,
useButton,
useButtonGroup,
useButtonGroupContext
};
@@ -0,0 +1,129 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
// Portions of the code in this file are based on code from ICU.
// Original licensing can be found in the NOTICE file in the root directory of this source tree.
import {AnyCalendarDate} from '../types';
import {CalendarDate} from '../CalendarDate';
import {fromExtendedYear, GregorianCalendar, gregorianToJulianDay, isLeapYear} from './GregorianCalendar';
// Starts in 78 AD,
const INDIAN_ERA_START = 78;
// The Indian year starts 80 days later than the Gregorian year.
const INDIAN_YEAR_START = 80;
/**
* The Indian National Calendar is similar to the Gregorian calendar, but with
* years numbered since the Saka era in 78 AD (Gregorian). There are 12 months
* in each year, with either 30 or 31 days. Only one era identifier is supported: 'saka'.
*/
export class IndianCalendar extends GregorianCalendar {
identifier = 'indian';
fromJulianDay(jd: number): CalendarDate {
// Gregorian date for Julian day
let date = super.fromJulianDay(jd);
// Year in Saka era
let indianYear = date.year - INDIAN_ERA_START;
// Day number in Gregorian year (starting from 0)
let yDay = jd - gregorianToJulianDay(date.era, date.year, 1, 1);
let leapMonth: number;
if (yDay < INDIAN_YEAR_START) {
// Day is at the end of the preceding Saka year
indianYear--;
// Days in leapMonth this year, previous Gregorian year
leapMonth = isLeapYear(date.year - 1) ? 31 : 30;
yDay += leapMonth + (31 * 5) + (30 * 3) + 10;
} else {
// Days in leapMonth this year
leapMonth = isLeapYear(date.year) ? 31 : 30;
yDay -= INDIAN_YEAR_START;
}
let indianMonth: number;
let indianDay: number;
if (yDay < leapMonth) {
indianMonth = 1;
indianDay = yDay + 1;
} else {
let mDay = yDay - leapMonth;
if (mDay < (31 * 5)) {
indianMonth = Math.floor(mDay / 31) + 2;
indianDay = (mDay % 31) + 1;
} else {
mDay -= 31 * 5;
indianMonth = Math.floor(mDay / 30) + 7;
indianDay = (mDay % 30) + 1;
}
}
return new CalendarDate(this, indianYear, indianMonth, indianDay);
}
toJulianDay(date: AnyCalendarDate) {
let extendedYear = date.year + INDIAN_ERA_START;
let [era, year] = fromExtendedYear(extendedYear);
let leapMonth: number;
let jd: number;
if (isLeapYear(year)) {
leapMonth = 31;
jd = gregorianToJulianDay(era, year, 3, 21);
} else {
leapMonth = 30;
jd = gregorianToJulianDay(era, year, 3, 22);
}
if (date.month === 1) {
return jd + date.day - 1;
}
jd += leapMonth + Math.min(date.month - 2, 5) * 31;
if (date.month >= 8) {
jd += (date.month - 7) * 30;
}
jd += date.day - 1;
return jd;
}
getDaysInMonth(date: AnyCalendarDate): number {
if (date.month === 1 && isLeapYear(date.year + INDIAN_ERA_START)) {
return 31;
}
if (date.month >= 2 && date.month <= 6) {
return 31;
}
return 30;
}
getYearsInEra(): number {
// 9999-12-31 gregorian is 9920-10-10 indian.
// Round down to 9919 for the last full year.
return 9919;
}
getEras() {
return ['saka'];
}
balanceDate() {}
}
@@ -0,0 +1,81 @@
class GroupAnimation {
constructor(animations) {
// Bound to accomadate common `return animation.stop` pattern
this.stop = () => this.runAll("stop");
this.animations = animations.filter(Boolean);
}
get finished() {
return Promise.all(this.animations.map((animation) => animation.finished));
}
/**
* TODO: Filter out cancelled or stopped animations before returning
*/
getAll(propName) {
return this.animations[0][propName];
}
setAll(propName, newValue) {
for (let i = 0; i < this.animations.length; i++) {
this.animations[i][propName] = newValue;
}
}
attachTimeline(timeline) {
const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline));
return () => {
subscriptions.forEach((cancel, i) => {
cancel && cancel();
this.animations[i].stop();
});
};
}
get time() {
return this.getAll("time");
}
set time(time) {
this.setAll("time", time);
}
get speed() {
return this.getAll("speed");
}
set speed(speed) {
this.setAll("speed", speed);
}
get state() {
return this.getAll("state");
}
get startTime() {
return this.getAll("startTime");
}
get duration() {
return getMax(this.animations, "duration");
}
get iterationDuration() {
return getMax(this.animations, "iterationDuration");
}
runAll(methodName) {
this.animations.forEach((controls) => controls[methodName]());
}
play() {
this.runAll("play");
}
pause() {
this.runAll("pause");
}
cancel() {
this.runAll("cancel");
}
complete() {
this.runAll("complete");
}
}
function getMax(animations, propName) {
let max = 0;
for (let i = 0; i < animations.length; i++) {
const value = animations[i][propName];
if (value !== null && value > max) {
max = value;
}
}
return max;
}
export { GroupAnimation };
@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* GraphemerIterator
*
* Takes a string and a "BreakHandler" method during initialisation
* and creates an iterable object that returns individual graphemes.
*
* @param str {string}
* @return GraphemerIterator
*/
class GraphemerIterator {
constructor(str, nextBreak) {
this._index = 0;
this._str = str;
this._nextBreak = nextBreak;
}
[Symbol.iterator]() {
return this;
}
next() {
let brk;
if ((brk = this._nextBreak(this._str, this._index)) < this._str.length) {
const value = this._str.slice(this._index, brk);
this._index = brk;
return { value: value, done: false };
}
if (this._index < this._str.length) {
const value = this._str.slice(this._index);
this._index = this._str.length;
return { value: value, done: false };
}
return { value: undefined, done: true };
}
}
exports.default = GraphemerIterator;
@@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_sk=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);function r(e){return e>1&&e<5&&1!=~~(e/10)}function o(e,t,n,o){var a=e+" ";switch(n){case"s":return t||o?"pár sekúnd":"pár sekundami";case"m":return t?"minúta":o?"minútu":"minútou";case"mm":return t||o?a+(r(e)?"minúty":"minút"):a+"minútami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?a+(r(e)?"hodiny":"hodín"):a+"hodinami";case"d":return t||o?"deň":"dňom";case"dd":return t||o?a+(r(e)?"dni":"dní"):a+"dňami";case"M":return t||o?"mesiac":"mesiacom";case"MM":return t||o?a+(r(e)?"mesiace":"mesiacov"):a+"mesiacmi";case"y":return t||o?"rok":"rokom";case"yy":return t||o?a+(r(e)?"roky":"rokov"):a+"rokmi"}}var a={name:"sk",weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),months:"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),monthsShort:"jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(e){return e+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"za %s",past:"pred %s",s:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o}};return n.default.locale(a,null,!0),a}));
@@ -0,0 +1,18 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./date"), exports);
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('partial', require('../partial'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,37 @@
import { __read } from "tslib";
import { useState } from 'react';
import useMemoizedFn from '../useMemoizedFn';
function useMap(initialValue) {
var getInitValue = function () { return new Map(initialValue); };
var _a = __read(useState(getInitValue), 2), map = _a[0], setMap = _a[1];
var set = function (key, entry) {
setMap(function (prev) {
var temp = new Map(prev);
temp.set(key, entry);
return temp;
});
};
var setAll = function (newMap) {
setMap(new Map(newMap));
};
var remove = function (key) {
setMap(function (prev) {
var temp = new Map(prev);
temp.delete(key);
return temp;
});
};
var reset = function () { return setMap(getInitValue()); };
var get = function (key) { return map.get(key); };
return [
map,
{
set: useMemoizedFn(set),
setAll: useMemoizedFn(setAll),
remove: useMemoizedFn(remove),
reset: useMemoizedFn(reset),
get: useMemoizedFn(get),
},
];
}
export default useMap;
@@ -0,0 +1,9 @@
try {
var util = require('util');
/* istanbul ignore next */
if (typeof util.inherits !== 'function') throw '';
module.exports = util.inherits;
} catch (e) {
/* istanbul ignore next */
module.exports = require('./inherits_browser.js');
}
@@ -0,0 +1,77 @@
/**
* @fileoverview Enforce no duplicate props
* @author Markus Ånöstam
*/
'use strict';
const has = require('hasown');
const docsUrl = require('../util/docsUrl');
const report = require('../util/report');
// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------
const messages = {
noDuplicateProps: 'No duplicate props allowed',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Disallow duplicate properties in JSX',
category: 'Possible Errors',
recommended: true,
url: docsUrl('jsx-no-duplicate-props'),
},
messages,
schema: [{
type: 'object',
properties: {
ignoreCase: {
type: 'boolean',
},
},
additionalProperties: false,
}],
},
create(context) {
const configuration = context.options[0] || {};
const ignoreCase = configuration.ignoreCase || false;
return {
JSXOpeningElement(node) {
const props = {};
node.attributes.forEach((decl) => {
if (decl.type === 'JSXSpreadAttribute') {
return;
}
let name = decl.name.name;
if (typeof name !== 'string') {
return;
}
if (ignoreCase) {
name = name.toLowerCase();
}
if (has(props, name)) {
report(context, messages.noDuplicateProps, 'noDuplicateProps', {
node: decl,
});
} else {
props[name] = 1;
}
});
},
};
},
};
@@ -0,0 +1,5 @@
import type { Coordinates } from './types';
/**
* Returns the normalized x and y coordinates for mouse and touch events.
*/
export declare function getEventCoordinates(event: Event): Coordinates | null;
@@ -0,0 +1,92 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _iterationDecorator = _interopRequireDefault(require("./util/iterationDecorator"));
var _AXObjectsMap = _interopRequireDefault(require("./AXObjectsMap"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
var AXObjectRoleElements = [];
var _iterator = _createForOfIteratorHelper(_AXObjectsMap.default.entries()),
_step;
try {
var _loop = function _loop() {
var _step$value = _slicedToArray(_step.value, 2),
name = _step$value[0],
def = _step$value[1];
var relatedConcepts = def.relatedConcepts;
if (Array.isArray(relatedConcepts)) {
relatedConcepts.forEach(function (relation) {
if (relation.module === 'ARIA') {
var concept = relation.concept;
if (concept) {
var index = AXObjectRoleElements.findIndex(function (_ref5) {
var _ref6 = _slicedToArray(_ref5, 1),
key = _ref6[0];
return key === name;
});
if (index === -1) {
AXObjectRoleElements.push([name, []]);
index = AXObjectRoleElements.length - 1;
}
AXObjectRoleElements[index][1].push(concept);
}
}
});
}
};
for (_iterator.s(); !(_step = _iterator.n()).done;) {
_loop();
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
var AXObjectRoleMap = {
entries: function entries() {
return AXObjectRoleElements;
},
forEach: function forEach(fn) {
var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
for (var _i = 0, _AXObjectRoleElements = AXObjectRoleElements; _i < _AXObjectRoleElements.length; _i++) {
var _AXObjectRoleElements2 = _slicedToArray(_AXObjectRoleElements[_i], 2),
key = _AXObjectRoleElements2[0],
values = _AXObjectRoleElements2[1];
fn.call(thisArg, values, key, AXObjectRoleElements);
}
},
get: function get(key) {
var item = AXObjectRoleElements.find(function (tuple) {
return tuple[0] === key ? true : false;
});
return item && item[1];
},
has: function has(key) {
return !!AXObjectRoleMap.get(key);
},
keys: function keys() {
return AXObjectRoleElements.map(function (_ref) {
var _ref2 = _slicedToArray(_ref, 1),
key = _ref2[0];
return key;
});
},
values: function values() {
return AXObjectRoleElements.map(function (_ref3) {
var _ref4 = _slicedToArray(_ref3, 2),
values = _ref4[1];
return values;
});
}
};
var _default = (0, _iterationDecorator.default)(AXObjectRoleMap, AXObjectRoleMap.entries());
exports.default = _default;
@@ -0,0 +1,129 @@
/**
* Copyright (c) 2022 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { IBufferRange, ILink } from 'browser/Types';
import { ILinkProvider } from 'browser/services/Services';
import { CellData } from 'common/buffer/CellData';
import { IBufferService, IOptionsService, IOscLinkService } from 'common/services/Services';
export class OscLinkProvider implements ILinkProvider {
constructor(
@IBufferService private readonly _bufferService: IBufferService,
@IOptionsService private readonly _optionsService: IOptionsService,
@IOscLinkService private readonly _oscLinkService: IOscLinkService
) {
}
public provideLinks(y: number, callback: (links: ILink[] | undefined) => void): void {
const line = this._bufferService.buffer.lines.get(y - 1);
if (!line) {
callback(undefined);
return;
}
const result: ILink[] = [];
const linkHandler = this._optionsService.rawOptions.linkHandler;
const cell = new CellData();
const lineLength = line.getTrimmedLength();
let currentLinkId = -1;
let currentStart = -1;
let finishLink = false;
for (let x = 0; x < lineLength; x++) {
// Minor optimization, only check for content if there isn't a link in case the link ends with
// a null cell
if (currentStart === -1 && !line.hasContent(x)) {
continue;
}
line.loadCell(x, cell);
if (cell.hasExtendedAttrs() && cell.extended.urlId) {
if (currentStart === -1) {
currentStart = x;
currentLinkId = cell.extended.urlId;
continue;
} else {
finishLink = cell.extended.urlId !== currentLinkId;
}
} else {
if (currentStart !== -1) {
finishLink = true;
}
}
if (finishLink || (currentStart !== -1 && x === lineLength - 1)) {
const text = this._oscLinkService.getLinkData(currentLinkId)?.uri;
if (text) {
// These ranges are 1-based
const range: IBufferRange = {
start: {
x: currentStart + 1,
y
},
end: {
// Offset end x if it's a link that ends on the last cell in the line
x: x + (!finishLink && x === lineLength - 1 ? 1 : 0),
y
}
};
let ignoreLink = false;
if (!linkHandler?.allowNonHttpProtocols) {
try {
const parsed = new URL(text);
if (!['http:', 'https:'].includes(parsed.protocol)) {
ignoreLink = true;
}
} catch (e) {
// Ignore invalid URLs to prevent unexpected behaviors
ignoreLink = true;
}
}
if (!ignoreLink) {
// OSC links always use underline and pointer decorations
result.push({
text,
range,
activate: (e, text) => (linkHandler ? linkHandler.activate(e, text, range) : defaultActivate(e, text)),
hover: (e, text) => linkHandler?.hover?.(e, text, range),
leave: (e, text) => linkHandler?.leave?.(e, text, range)
});
}
}
finishLink = false;
// Clear link or start a new link if one starts immediately
if (cell.hasExtendedAttrs() && cell.extended.urlId) {
currentStart = x;
currentLinkId = cell.extended.urlId;
} else {
currentStart = -1;
currentLinkId = -1;
}
}
}
// TODO: Handle fetching and returning other link ranges to underline other links with the same
// id
callback(result);
}
}
function defaultActivate(e: MouseEvent, uri: string): void {
const answer = confirm(`Do you want to navigate to ${uri}?\n\nWARNING: This link could potentially be dangerous`);
if (answer) {
const newWindow = window.open();
if (newWindow) {
try {
newWindow.opener = null;
} catch {
// no-op, Electron can throw
}
newWindow.location.href = uri;
} else {
console.warn('Opening link blocked as opener could not be cleared');
}
}
}
@@ -0,0 +1 @@
{"version":3,"file":"feeds.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/domutils/0ab8bcf1ecfc70dfc93291a4cb2496578ac25e9c/src/","sources":["feeds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAW,MAAM,YAAY,CAAC;AAInD;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GACzB,OAAO,GACP,OAAO,GACP,OAAO,GACP,UAAU,GACV,YAAY,CAAC;AAEnB;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAEpE;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACxC,SAAS,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,KAAK,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,IAAI;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAQnD"}
@@ -0,0 +1,38 @@
{
"name": "signal-exit",
"version": "3.0.7",
"description": "when you want to fire an event no matter how a process exits.",
"main": "index.js",
"scripts": {
"test": "tap",
"snap": "tap",
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags"
},
"files": [
"index.js",
"signals.js"
],
"repository": {
"type": "git",
"url": "https://github.com/tapjs/signal-exit.git"
},
"keywords": [
"signal",
"exit"
],
"author": "Ben Coe <ben@npmjs.com>",
"license": "ISC",
"bugs": {
"url": "https://github.com/tapjs/signal-exit/issues"
},
"homepage": "https://github.com/tapjs/signal-exit",
"devDependencies": {
"chai": "^3.5.0",
"coveralls": "^3.1.1",
"nyc": "^15.1.0",
"standard-version": "^9.3.1",
"tap": "^15.1.1"
}
}
@@ -0,0 +1 @@
{"version":3,"names":["_index","require","_index2","hasOwn","Function","call","bind","Object","prototype","hasOwnProperty","cloneIfNode","obj","deep","withoutLoc","commentsCache","type","cloneNodeInternal","cloneIfNodeOrArray","Array","isArray","map","node","cloneNode","Map","newNode","isIdentifier","name","optional","typeAnnotation","decorators","NODE_FIELDS","Error","field","keys","isFile","maybeCloneComments","comments","loc","leadingComments","innerComments","trailingComments","extra","assign","comment","cache","get","value","ret","set"],"sources":["../../src/clone/cloneNode.ts"],"sourcesContent":["import { NODE_FIELDS } from \"../definitions/index.ts\";\nimport type * as t from \"../index.ts\";\nimport { isFile, isIdentifier } from \"../validators/generated/index.ts\";\n\nconst { hasOwn } = process.env.BABEL_8_BREAKING\n ? Object\n : { hasOwn: Function.call.bind(Object.prototype.hasOwnProperty) };\n\ntype CommentCache = Map<t.Comment, t.Comment>;\n\n// This function will never be called for comments, only for real nodes.\nfunction cloneIfNode(\n obj: t.Node | undefined | null,\n deep: boolean,\n withoutLoc: boolean,\n commentsCache: CommentCache,\n) {\n if (obj && typeof obj.type === \"string\") {\n return cloneNodeInternal(obj, deep, withoutLoc, commentsCache);\n }\n\n return obj;\n}\n\nfunction cloneIfNodeOrArray(\n obj: t.Node | undefined | null | (t.Node | undefined | null)[],\n deep: boolean,\n withoutLoc: boolean,\n commentsCache: CommentCache,\n) {\n if (Array.isArray(obj)) {\n return obj.map(node => cloneIfNode(node, deep, withoutLoc, commentsCache));\n }\n return cloneIfNode(obj, deep, withoutLoc, commentsCache);\n}\n\n/**\n * Create a clone of a `node` including only properties belonging to the node.\n * If the second parameter is `false`, cloneNode performs a shallow clone.\n * If the third parameter is true, the cloned nodes exclude location properties.\n */\nexport default function cloneNode<T extends t.Node>(\n node: T,\n deep: boolean = true,\n withoutLoc: boolean = false,\n): T {\n return cloneNodeInternal(node, deep, withoutLoc, new Map());\n}\n\nfunction cloneNodeInternal<T extends t.Node>(\n node: T,\n deep: boolean = true,\n withoutLoc: boolean = false,\n commentsCache: CommentCache,\n): T {\n if (!node) return node;\n\n const { type } = node;\n const newNode: any = { type: node.type };\n\n // Special-case identifiers since they are the most cloned nodes.\n if (isIdentifier(node)) {\n newNode.name = node.name;\n\n if (hasOwn(node, \"optional\") && typeof node.optional === \"boolean\") {\n newNode.optional = node.optional;\n }\n\n if (hasOwn(node, \"typeAnnotation\")) {\n newNode.typeAnnotation = deep\n ? cloneIfNodeOrArray(\n node.typeAnnotation,\n true,\n withoutLoc,\n commentsCache,\n )\n : node.typeAnnotation;\n }\n\n if (hasOwn(node, \"decorators\")) {\n newNode.decorators = deep\n ? cloneIfNodeOrArray(node.decorators, true, withoutLoc, commentsCache)\n : node.decorators;\n }\n } else if (!hasOwn(NODE_FIELDS, type)) {\n throw new Error(`Unknown node type: \"${type}\"`);\n } else {\n for (const field of Object.keys(NODE_FIELDS[type])) {\n if (hasOwn(node, field)) {\n if (deep) {\n newNode[field] =\n isFile(node) && field === \"comments\"\n ? maybeCloneComments(\n node.comments,\n deep,\n withoutLoc,\n commentsCache,\n )\n : cloneIfNodeOrArray(\n // @ts-expect-error node[field] has been guarded by has check\n node[field],\n true,\n withoutLoc,\n commentsCache,\n );\n } else {\n newNode[field] =\n // @ts-expect-error node[field] has been guarded by has check\n node[field];\n }\n }\n }\n }\n\n if (hasOwn(node, \"loc\")) {\n if (withoutLoc) {\n newNode.loc = null;\n } else {\n newNode.loc = node.loc;\n }\n }\n if (hasOwn(node, \"leadingComments\")) {\n newNode.leadingComments = maybeCloneComments(\n node.leadingComments,\n deep,\n withoutLoc,\n commentsCache,\n );\n }\n if (hasOwn(node, \"innerComments\")) {\n newNode.innerComments = maybeCloneComments(\n node.innerComments,\n deep,\n withoutLoc,\n commentsCache,\n );\n }\n if (hasOwn(node, \"trailingComments\")) {\n newNode.trailingComments = maybeCloneComments(\n node.trailingComments,\n deep,\n withoutLoc,\n commentsCache,\n );\n }\n if (hasOwn(node, \"extra\")) {\n newNode.extra = {\n ...node.extra,\n };\n }\n\n return newNode;\n}\n\nfunction maybeCloneComments<T extends t.Comment>(\n comments: ReadonlyArray<T> | null,\n deep: boolean,\n withoutLoc: boolean,\n cLine truncated
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=buildFilteredServiceBindings.spec.d.ts.map
@@ -0,0 +1,27 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"id-length": "off",
"new-cap": ["error", {
"capIsNewExceptions": [
"GetIntrinsic"
],
}],
"no-extra-parens": "off",
},
"overrides": [
{
"files": ["test/**/*.js"],
"rules": {
"id-length": "off",
"max-lines-per-function": "off",
"multiline-comment-style": "off",
"no-empty-function": "off",
},
},
],
}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=ContainerModule.spec.d.ts.map
@@ -0,0 +1,6 @@
export { arrayMove } from './arrayMove';
export { arraySwap } from './arraySwap';
export { getSortedRects } from './getSortedRects';
export { isValidIndex } from './isValidIndex';
export { itemsEqual } from './itemsEqual';
export { normalizeDisabled } from './normalizeDisabled';
@@ -0,0 +1,31 @@
import after from './after.js';
import ary from './ary.js';
import before from './before.js';
import bind from './bind.js';
import bindKey from './bindKey.js';
import curry from './curry.js';
import curryRight from './curryRight.js';
import debounce from './debounce.js';
import defer from './defer.js';
import delay from './delay.js';
import flip from './flip.js';
import memoize from './memoize.js';
import negate from './negate.js';
import once from './once.js';
import overArgs from './overArgs.js';
import partial from './partial.js';
import partialRight from './partialRight.js';
import rearg from './rearg.js';
import rest from './rest.js';
import spread from './spread.js';
import throttle from './throttle.js';
import unary from './unary.js';
import wrap from './wrap.js';
export default {
after, ary, before, bind, bindKey,
curry, curryRight, debounce, defer, delay,
flip, memoize, negate, once, overArgs,
partial, partialRight, rearg, rest, spread,
throttle, unary, wrap
};
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"K D E F A B","16":"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 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 BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB 0C 1C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC"},E:{"1":"J ZB K D E F A B C L M G 2C ZC 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z FD GD HD ID NC uC JD OC","16":"F"},G:{"1":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"1":"hD"},I:{"1":"TC J I kD lD vC mD nD","16":"iD jD"},J:{"1":"D A"},K:{"1":"A B C H NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:1,C:"Element.insertAdjacentElement() & Element.insertAdjacentText()",D:true};
@@ -0,0 +1 @@
module.exports={C:{_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 3.5 3.6"},D:{"138":20.835,"139":12.5,"140":4.165,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 141 142 143 144 145"},F:{_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"141":4.165,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 142"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.4 15.5 15.6 16.0 16.1 16.2 16.3 16.4 16.5 16.6 17.0 17.1 17.2 17.3 17.4 17.5 17.6 18.0 18.1 18.2 18.3 18.4 18.5-18.6 26.0 26.1 26.2"},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00083,"5.0-5.1":0,"6.0-6.1":0.00333,"7.0-7.1":0.0025,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.0075,"10.0-10.2":0.00083,"10.3":0.01417,"11.0-11.2":0.21004,"11.3-11.4":0.005,"12.0-12.1":0.00167,"12.2-12.5":0.04084,"13.0-13.1":0,"13.2":0.00417,"13.3":0.00167,"13.4-13.7":0.00667,"14.0-14.4":0.01417,"14.5-14.8":0.015,"15.0-15.1":0.01417,"15.2-15.3":0.01084,"15.4":0.0125,"15.5":0.01417,"15.6-15.8":0.18504,"16.0":0.02501,"16.1":0.04668,"16.2":0.02417,"16.3":0.04334,"16.4":0.01084,"16.5":0.01917,"16.6-16.7":0.24755,"17.0":0.0175,"17.1":0.02667,"17.2":0.01917,"17.3":0.02834,"17.4":0.05001,"17.5":0.08585,"17.6-17.7":0.21671,"18.0":0.04918,"18.1":0.10169,"18.2":0.05501,"18.3":0.1767,"18.4":0.09085,"18.5-18.6":4.63259,"26.0":0.57261,"26.1":0.02084},P:{_:"4 20 21 22 23 24 25 26 27 28 29 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{_:"0"},Q:{_:"14.9"},O:{_:"0"},H:{"0":0},L:{"0":50}};
@@ -0,0 +1,8 @@
<svg viewbox="0 0 18 18">
<line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"></line>
<line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"></line>
<line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"></line>
<line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"></line>
<line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"></line>
<line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"></line>
</svg>

After

Width:  |  Height:  |  Size: 411 B

@@ -0,0 +1,899 @@
/*
* @fileoverview Main Doctrine object
* @author Yusuke Suzuki <utatane.tea@gmail.com>
* @author Dan Tao <daniel.tao@gmail.com>
* @author Andrew Eisenberg <andrew@eisenberg.as>
*/
(function () {
'use strict';
var typed,
utility,
jsdoc,
esutils,
hasOwnProperty;
esutils = require('esutils');
typed = require('./typed');
utility = require('./utility');
function sliceSource(source, index, last) {
return source.slice(index, last);
}
hasOwnProperty = (function () {
var func = Object.prototype.hasOwnProperty;
return function hasOwnProperty(obj, name) {
return func.call(obj, name);
};
}());
function shallowCopy(obj) {
var ret = {}, key;
for (key in obj) {
if (obj.hasOwnProperty(key)) {
ret[key] = obj[key];
}
}
return ret;
}
function isASCIIAlphanumeric(ch) {
return (ch >= 0x61 /* 'a' */ && ch <= 0x7A /* 'z' */) ||
(ch >= 0x41 /* 'A' */ && ch <= 0x5A /* 'Z' */) ||
(ch >= 0x30 /* '0' */ && ch <= 0x39 /* '9' */);
}
function isParamTitle(title) {
return title === 'param' || title === 'argument' || title === 'arg';
}
function isReturnTitle(title) {
return title === 'return' || title === 'returns';
}
function isProperty(title) {
return title === 'property' || title === 'prop';
}
function isNameParameterRequired(title) {
return isParamTitle(title) || isProperty(title) ||
title === 'alias' || title === 'this' || title === 'mixes' || title === 'requires';
}
function isAllowedName(title) {
return isNameParameterRequired(title) || title === 'const' || title === 'constant';
}
function isAllowedNested(title) {
return isProperty(title) || isParamTitle(title);
}
function isAllowedOptional(title) {
return isProperty(title) || isParamTitle(title);
}
function isTypeParameterRequired(title) {
return isParamTitle(title) || isReturnTitle(title) ||
title === 'define' || title === 'enum' ||
title === 'implements' || title === 'this' ||
title === 'type' || title === 'typedef' || isProperty(title);
}
// Consider deprecation instead using 'isTypeParameterRequired' and 'Rules' declaration to pick when a type is optional/required
// This would require changes to 'parseType'
function isAllowedType(title) {
return isTypeParameterRequired(title) || title === 'throws' || title === 'const' || title === 'constant' ||
title === 'namespace' || title === 'member' || title === 'var' || title === 'module' ||
title === 'constructor' || title === 'class' || title === 'extends' || title === 'augments' ||
title === 'public' || title === 'private' || title === 'protected';
}
// A regex character class that contains all whitespace except linebreak characters (\r, \n, \u2028, \u2029)
var WHITESPACE = '[ \\f\\t\\v\\u00a0\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]';
var STAR_MATCHER = '(' + WHITESPACE + '*(?:\\*' + WHITESPACE + '?)?)(.+|[\r\n\u2028\u2029])';
function unwrapComment(doc) {
// JSDoc comment is following form
// /**
// * .......
// */
return doc.
// remove /**
replace(/^\/\*\*?/, '').
// remove */
replace(/\*\/$/, '').
// remove ' * ' at the beginning of a line
replace(new RegExp(STAR_MATCHER, 'g'), '$2').
// remove trailing whitespace
replace(/\s*$/, '');
}
/**
* Converts an index in an "unwrapped" JSDoc comment to the corresponding index in the original "wrapped" version
* @param {string} originalSource The original wrapped comment
* @param {number} unwrappedIndex The index of a character in the unwrapped string
* @returns {number} The index of the corresponding character in the original wrapped string
*/
function convertUnwrappedCommentIndex(originalSource, unwrappedIndex) {
var replacedSource = originalSource.replace(/^\/\*\*?/, '');
var numSkippedChars = 0;
var matcher = new RegExp(STAR_MATCHER, 'g');
var match;
while ((match = matcher.exec(replacedSource))) {
numSkippedChars += match[1].length;
if (match.index + match[0].length > unwrappedIndex + numSkippedChars) {
return unwrappedIndex + numSkippedChars + originalSource.length - replacedSource.length;
}
}
return originalSource.replace(/\*\/$/, '').replace(/\s*$/, '').length;
}
// JSDoc Tag Parser
(function (exports) {
var Rules,
index,
lineNumber,
length,
source,
originalSource,
recoverable,
sloppy,
strict;
function advance() {
var ch = source.charCodeAt(index);
index += 1;
if (esutils.code.isLineTerminator(ch) && !(ch === 0x0D /* '\r' */ && source.charCodeAt(index) === 0x0A /* '\n' */)) {
lineNumber += 1;
}
return String.fromCharCode(ch);
}
function scanTitle() {
var title = '';
// waste '@'
advance();
while (index < length && isASCIIAlphanumeric(source.charCodeAt(index))) {
title += advance();
}
return title;
}
function seekContent() {
var ch, waiting, last = index;
waiting = false;
while (last < length) {
ch = source.charCodeAt(last);
if (esutils.code.isLineTerminator(ch) && !(ch === 0x0D /* '\r' */ && source.charCodeAt(last + 1) === 0x0A /* '\n' */)) {
waiting = true;
} else if (waiting) {
if (ch === 0x40 /* '@' */) {
break;
}
if (!esutils.code.isWhiteSpace(ch)) {
waiting = false;
}
}
last += 1;
}
return last;
}
// type expression may have nest brace, such as,
// { { ok: string } }
//
// therefore, scanning type expression with balancing braces.
function parseType(title, last, addRange) {
var ch, brace, type, startIndex, direct = false;
// search '{'
while (index < last) {
ch = source.charCodeAt(index);
if (esutils.code.isWhiteSpace(ch)) {
advance();
} else if (ch === 0x7B /* '{' */) {
advance();
break;
} else {
// this is direct pattern
direct = true;
break;
}
}
if (direct) {
return null;
}
// type expression { is found
brace = 1;
type = '';
while (index < last) {
ch = source.charCodeAt(index);
if (esutils.code.isLineTerminator(ch)) {
advance();
} else {
if (ch === 0x7D /* '}' */) {
brace -= 1;
if (brace === 0) {
advance();
break;
}
} else if (ch === 0x7B /* '{' */) {
brace += 1;
}
if (type === '') {
startIndex = index;
}
type += advance();
}
}
if (brace !== 0) {
// braces is not balanced
return utility.throwError('Braces are not balanced');
}
if (isAllowedOptional(title)) {
return typed.parseParamType(type, {startIndex: convertIndex(startIndex), range: addRange});
}
return typed.parseType(type, {startIndex: convertIndex(startIndex), range: addRange});
}
function scanIdentifier(last) {
var identifier;
if (!esutils.code.isIdentifierStartES5(source.charCodeAt(index)) && !source[index].match(/[0-9]/)) {
return null;
}
identifier = advance();
while (index < last && esutils.code.isIdentifierPartES5(source.charCodeAt(index))) {
identifier += advance();
}
return identifier;
}
function skipWhiteSpace(last) {
while (index < last && (esutils.code.isWhiteSpace(source.charCodeAt(index)) || esutils.code.isLineTerminator(source.charCodeAt(index)))) {
advance();
}
}
function parseName(last, allowBrackets, allowNestedParams) {
var name = '',
useBrackets,
insideString;
skipWhiteSpace(last);
if (index >= last) {
return null;
}
if (source.charCodeAt(index) === 0x5B /* '[' */) {
if (allowBrackets) {
useBrackets = true;
name = advance();
} else {
return null;
}
}
name += scanIdentifier(last);
if (allowNestedParams) {
if (source.charCodeAt(index) === 0x3A /* ':' */ && (
name === 'module' ||
name === 'external' ||
name === 'event')) {
name += advance();
name += scanIdentifier(last);
}
if(source.charCodeAt(index) === 0x5B /* '[' */ && source.charCodeAt(index + 1) === 0x5D /* ']' */){
name += advance();
name += advance();
}
while (source.charCodeAt(index) === 0x2E /* '.' */ ||
source.charCodeAt(index) === 0x2F /* '/' */ ||
source.charCodeAt(index) === 0x23 /* '#' */ ||
source.charCodeAt(index) === 0x2D /* '-' */ ||
source.charCodeAt(index) === 0x7E /* '~' */) {
name += advance();
name += scanIdentifier(last);
}
}
if (useBrackets) {
skipWhiteSpace(last);
// do we have a default value for this?
if (source.charCodeAt(index) === 0x3D /* '=' */) {
// consume the '='' symbol
name += advance();
skipWhiteSpace(last);
var ch;
var bracketDepth = 1;
// scan in the default value
while (index < last) {
ch = source.charCodeAt(index);
if (esutils.code.isWhiteSpace(ch)) {
if (!insideString) {
skipWhiteSpace(last);
ch = source.charCodeAt(index);
}
}
if (ch === 0x27 /* ''' */) {
if (!insideString) {
insideString = '\'';
} else {
if (insideString === '\'') {
insideString = '';
}
}
}
if (ch === 0x22 /* '"' */) {
if (!insideString) {
insideString = '"';
} else {
if (insideString === '"') {
insideString = '';
}
}
}
if (ch === 0x5B /* '[' */) {
bracketDepth++;
} else if (ch === 0x5D /* ']' */ &&
--bracketDepth === 0) {
break;
}
name += advance();
}
}
skipWhiteSpace(last);
if (index >= last || source.charCodeAt(index) !== 0x5D /* ']' */) {
// we never found a closing ']'
return null;
}
// collect the last ']'
name += advance();
}
return name;
}
function skipToTag() {
while (index < length && source.charCodeAt(index) !== 0x40 /* '@' */) {
advance();
}
if (index >= length) {
return false;
}
utility.assert(source.charCodeAt(index) === 0x40 /* '@' */);
return true;
}
function convertIndex(rangeIndex) {
if (source === originalSource) {
return rangeIndex;
}
return convertUnwrappedCommentIndex(originalSource, rangeIndex);
}
function TagParser(options, title) {
this._options = options;
this._title = title.toLowerCase();
this._tag = {
title: title,
description: null
};
if (this._options.lineNumbers) {
this._tag.lineNumber = lineNumber;
}
this._first = index - title.length - 1;
this._last = 0;
// space to save special information for title parsers.
this._extra = { };
}
// addError(err, ...)
TagParser.prototype.addError = function addError(errorText) {
var args = Array.prototype.slice.call(arguments, 1),
msg = errorText.replace(
/%(\d)/g,
function (whole, index) {
utility.assert(index < args.length, 'Message reference must be in range');
return args[index];
}
);
if (!this._tag.errors) {
this._tag.errors = [];
}
if (strict) {
utility.throwError(msg);
}
this._tag.errors.push(msg);
return recoverable;
};
TagParser.prototype.parseType = function () {
// type required titles
if (isTypeParameterRequired(this._title)) {
try {
this._tag.type = parseType(this._title, this._last, this._options.range);
if (!this._tag.type) {
if (!isParamTitle(this._title) && !isReturnTitle(this._title)) {
if (!this.addError('Missing or invalid tag type')) {
return false;
}
}
}
} catch (error) {
this._tag.type = null;
if (!this.addError(error.message)) {
return false;
}
}
} else if (isAllowedType(this._title)) {
// optional types
try {
this._tag.type = parseType(this._title, this._last, this._options.range);
} catch (e) {
//For optional types, lets drop the thrown error when we hit the end of the file
}
}
return true;
};
TagParser.prototype._parseNamePath = function (optional) {
var name;
name = parseName(this._last, sloppy && isAllowedOptional(this._title), true);
if (!name) {
if (!optional) {
if (!this.addError('Missing or invalid tag name')) {
return false;
}
}
}
this._tag.name = name;
return true;
};
TagParser.prototype.parseNamePath = function () {
return this._parseNamePath(false);
};
TagParser.prototype.parseNamePathOptional = function () {
return this._parseNamePath(true);
};
TagParser.prototype.parseName = function () {
var assign, name;
// param, property requires name
if (isAllowedName(this._title)) {
this._tag.name = parseName(this._last, sloppy && isAllowedOptional(this._title), isAllowedNested(this._title));
if (!this._tag.name) {
if (!isNameParameterRequired(this._title)) {
return true;
}
// it's possible the name has already been parsed but interpreted as a type
// it's also possible this is a sloppy declaration, in which case it will be
// fixed at the end
if (isParamTitle(this._title) && this._tag.type && this._tag.type.name) {
this._extra.name = this._tag.type;
this._tag.name = this._tag.type.name;
this._tag.type = null;
} else {
if (!this.addError('Missing or invalid tag name')) {
return false;
}
}
} else {
name = this._tag.name;
if (name.charAt(0) === '[' && name.charAt(name.length - 1) === ']') {
// extract the default value if there is one
// example: @param {string} [somebody=John Doe] description
assign = name.substring(1, name.length - 1).split('=');
if (assign.length > 1) {
this._tag['default'] = assign.slice(1).join('=');
}
this._tag.name = assign[0];
// convert to an optional type
if (this._tag.type && this._tag.type.type !== 'OptionalType') {
this._tag.type = {
type: 'OptionalType',
expression: this._tag.type
};
}
}
}
}
return true;
};
TagParser.prototype.parseDescription = function parseDescription() {
var description = sliceSource(source, index, this._last).trim();
if (description) {
if ((/^-\s+/).test(description)) {
description = description.substring(2);
}
this._tag.description = description;
}
return true;
};
TagParser.prototype.parseCaption = function parseDescription() {
var description = sliceSource(source, index, this._last).trim();
var captionStartTag = '<caption>';
var captionEndTag = '</caption>';
var captionStart = description.indexOf(captionStartTag);
var captionEnd = description.indexOf(captionEndTag);
if (captionStart >= 0 && captionEnd >= 0) {
this._tag.caption = description.substring(
captionStart + captionStartTag.length, captionEnd).trim();
this._tag.description = description.substring(captionEnd + captionEndTag.length).trim();
} else {
this._tag.description = description;
}
return true;
};
TagParser.prototype.parseKind = function parseKind() {
var kind, kinds;
kinds = {
'class': true,
'constant': true,
'event': true,
'external': true,
'file': true,
'function': true,
'member': true,
'mixin': true,
'module': true,
'namespace': true,
'typedef': true
};
kind = sliceSource(source, index, this._last).trim();
this._tag.kind = kind;
if (!hasOwnProperty(kinds, kind)) {
if (!this.addError('Invalid kind name \'%0\'', kind)) {
return false;
}
}
return true;
};
TagParser.prototype.parseAccess = function parseAccess() {
var access;
access = sliceSource(source, index, this._last).trim();
this._tag.access = access;
if (access !== 'private' && access !== 'protected' && access !== 'public') {
if (!this.addError('Invalid access name \'%0\'', access)) {
return false;
}
}
return true;
};
TagParser.prototype.parseThis = function parseThis() {
// this name may be a name expression (e.g. {foo.bar}),
// an union (e.g. {foo.bar|foo.baz}) or a name path (e.g. foo.bar)
var value = sliceSource(source, index, this._last).trim();
if (value && value.charAt(0) === '{') {
var gotType = this.parseType();
if (gotType && this._tag.type.type === 'NameExpression' || this._tag.type.type === 'UnionType') {
this._tag.name = this._tag.type.name;
return true;
} else {
return this.addError('Invalid name for this');
}
} else {
return this.parseNamePath();
}
};
TagParser.prototype.parseVariation = function parseVariation() {
var variation, text;
text = sliceSource(source, index, this._last).trim();
variation = parseFloat(text, 10);
this._tag.variation = variation;
if (isNaN(variation)) {
if (!this.addError('Invalid variation \'%0\'', text)) {
return false;
}
}
return true;
};
TagParser.prototype.ensureEnd = function () {
var shouldBeEmpty = sliceSource(source, index, this._last).trim();
if (shouldBeEmpty) {
if (!this.addError('Unknown content \'%0\'', shouldBeEmpty)) {
return false;
}
}
return true;
};
TagParser.prototype.epilogue = function epilogue() {
var description;
description = this._tag.description;
// un-fix potentially sloppy declaration
if (isAllowedOptional(this._title) && !this._tag.type && description && description.charAt(0) === '[') {
this._tag.type = this._extra.name;
if (!this._tag.name) {
this._tag.name = undefined;
}
if (!sloppy) {
if (!this.addError('Missing or invalid tag name')) {
return false;
}
}
}
return true;
};
Rules = {
// http://usejsdoc.org/tags-access.html
'access': ['parseAccess'],
// http://usejsdoc.org/tags-alias.html
'alias': ['parseNamePath', 'ensureEnd'],
// http://usejsdoc.org/tags-augments.html
'augments': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
// http://usejsdoc.org/tags-constructor.html
'constructor': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
// Synonym: http://usejsdoc.org/tags-constructor.html
'class': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
// Synonym: http://usejsdoc.org/tags-extends.html
'extends': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
// http://usejsdoc.org/tags-example.html
'example': ['parseCaption'],
// http://usejsdoc.org/tags-deprecated.html
'deprecated': ['parseDescription'],
// http://usejsdoc.org/tags-global.html
'global': ['ensureEnd'],
// http://usejsdoc.org/tags-inner.html
'inner': ['ensureEnd'],
// http://usejsdoc.org/tags-instance.html
'instance': ['ensureEnd'],
// http://usejsdoc.org/tags-kind.html
'kind': ['parseKind'],
// http://usejsdoc.org/tags-mixes.html
'mixes': ['parseNamePath', 'ensureEnd'],
// http://usejsdoc.org/tags-mixin.html
'mixin': ['parseNamePathOptional', 'ensureEnd'],
// http://usejsdoc.org/tags-member.html
'member': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
// http://usejsdoc.org/tags-method.html
'method': ['parseNamePathOptional', 'ensureEnd'],
// http://usejsdoc.org/tags-module.html
'module': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
// Synonym: http://usejsdoc.org/tags-method.html
'func': ['parseNamePathOptional', 'ensureEnd'],
// Synonym: http://usejsdoc.org/tags-method.html
'function': ['parseNamePathOptional', 'ensureEnd'],
// Synonym: http://usejsdoc.org/tags-member.html
'var': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
// http://usejsdoc.org/tags-name.html
'name': ['parseNamePath', 'ensureEnd'],
// http://usejsdoc.org/tags-namespace.html
'namespace': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
// http://usejsdoc.org/tags-private.html
'private': ['parseType', 'parseDescription'],
// http://usejsdoc.org/tags-protected.html
'protected': ['parseType', 'parseDescription'],
// http://usejsdoc.org/tags-public.html
'public': ['parseType', 'parseDescription'],
// http://usejsdoc.org/tags-readonly.html
'readonly': ['ensureEnd'],
// http://usejsdoc.org/tags-requires.html
'requires': ['parseNamePath', 'ensureEnd'],
// http://usejsdoc.org/tags-since.html
'since': ['parseDescription'],
// http://usejsdoc.org/tags-static.html
'static': ['ensureEnd'],
// http://usejsdoc.org/tags-summary.html
'summary': ['parseDescription'],
// http://usejsdoc.org/tags-this.html
'this': ['parseThis', 'ensureEnd'],
// http://usejsdoc.org/tags-todo.html
'todo': ['parseDescription'],
// http://usejsdoc.org/tags-typedef.html
'typedef': ['parseType', 'parseNamePathOptional'],
// http://usejsdoc.org/tags-variation.html
'variation': ['parseVariation'],
// http://usejsdoc.org/tags-version.html
'version': ['parseDescription']
};
TagParser.prototype.parse = function parse() {
var i, iz, sequences, method;
// empty title
if (!this._title) {
if (!this.addError('Missing or invalid title')) {
return null;
}
}
// Seek to content last index.
this._last = seekContent(this._title);
if (this._options.range) {
this._tag.range = [this._first, source.slice(0, this._last).replace(/\s*$/, '').length].map(convertIndex);
}
if (hasOwnProperty(Rules, this._title)) {
sequences = Rules[this._title];
} else {
// default sequences
sequences = ['parseType', 'parseName', 'parseDescription', 'epilogue'];
}
for (i = 0, iz = sequences.length; i < iz; ++i) {
method = sequences[i];
if (!this[method]()) {
return null;
}
}
return this._tag;
};
function parseTag(options) {
var title, parser, tag;
// skip to tag
if (!skipToTag()) {
return null;
}
// scan title
title = scanTitle();
// construct tag parser
parser = new TagParser(options, title);
tag = parser.parse();
// Seek global index to end of this tag.
while (index < parser._last) {
advance();
}
return tag;
}
//
// Parse JSDoc
//
function scanJSDocDescription(preserveWhitespace) {
var description = '', ch, atAllowed;
atAllowed = true;
while (index < length) {
ch = source.charCodeAt(index);
if (atAllowed && ch === 0x40 /* '@' */) {
break;
}
if (esutils.code.isLineTerminator(ch)) {
atAllowed = true;
} else if (atAllowed && !esutils.code.isWhiteSpace(ch)) {
atAllowed = false;
}
description += advance();
}
return preserveWhitespace ? description : description.trim();
}
function parse(comment, options) {
var tags = [], tag, description, interestingTags, i, iz;
if (options === undefined) {
options = {};
}
if (typeof options.unwrap === 'boolean' && options.unwrap) {
source = unwrapComment(comment);
} else {
source = comment;
}
originalSource = comment;
// array of relevant tags
if (options.tags) {
if (Array.isArray(options.tags)) {
interestingTags = { };
for (i = 0, iz = options.tags.length; i < iz; i++) {
if (typeof options.tags[i] === 'string') {
interestingTags[options.tags[i]] = true;
} else {
utility.throwError('Invalid "tags" parameter: ' + options.tags);
}
}
} else {
utility.throwError('Invalid "tags" parameter: ' + options.tags);
}
}
length = source.length;
index = 0;
lineNumber = 0;
recoverable = options.recoverable;
sloppy = options.sloppy;
strict = options.strict;
description = scanJSDocDescription(options.preserveWhitespace);
while (true) {
tag = parseTag(options);
if (!tag) {
break;
}
if (!interestingTags || interestingTags.hasOwnProperty(tag.title)) {
tags.push(tag);
}
}
return {
description: description,
tags: tags
};
}
exports.parse = parse;
}(jsdoc = {}));
exports.version = utility.VERSION;
exports.parse = jsdoc.parse;
exports.parseType = typed.parseType;
exports.parseParamType = typed.parseParamType;
exports.unwrapComment = unwrapComment;
exports.Syntax = shallowCopy(typed.Syntax);
exports.Error = utility.DoctrineError;
exports.type = {
Syntax: exports.Syntax,
parseType: typed.parseType,
parseParamType: typed.parseParamType,
stringify: typed.stringify
};
}());
/* vim: set sw=4 ts=4 et tw=80 : */
@@ -0,0 +1 @@
{"version":3,"file":"icon-picker.js","names":["Picker","IconPicker","constructor","select","icons","container","classList","add","Array","from","querySelectorAll","forEach","item","innerHTML","getAttribute","defaultItem","querySelector","selectItem","target","trigger","label"],"sources":["../../src/ui/icon-picker.ts"],"sourcesContent":["import Picker from './picker.js';\n\nclass IconPicker extends Picker {\n defaultItem: HTMLElement | null;\n\n constructor(select: HTMLSelectElement, icons: Record<string, string>) {\n super(select);\n this.container.classList.add('ql-icon-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item')).forEach(\n (item) => {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n },\n );\n this.defaultItem = this.container.querySelector('.ql-selected');\n this.selectItem(this.defaultItem);\n }\n\n selectItem(target: HTMLElement | null, trigger?: boolean) {\n super.selectItem(target, trigger);\n const item = target || this.defaultItem;\n if (item != null) {\n if (this.label.innerHTML === item.innerHTML) return;\n this.label.innerHTML = item.innerHTML;\n }\n }\n}\n\nexport default IconPicker;\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,aAAa;AAEhC,MAAMC,UAAU,SAASD,MAAM,CAAC;EAG9BE,WAAWA,CAACC,MAAyB,EAAEC,KAA6B,EAAE;IACpE,KAAK,CAACD,MAAM,CAAC;IACb,IAAI,CAACE,SAAS,CAACC,SAAS,CAACC,GAAG,CAAC,gBAAgB,CAAC;IAC9CC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACJ,SAAS,CAACK,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,CAACC,OAAO,CACnEC,IAAI,IAAK;MACRA,IAAI,CAACC,SAAS,GAAGT,KAAK,CAACQ,IAAI,CAACE,YAAY,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IAC/D,CACF,CAAC;IACD,IAAI,CAACC,WAAW,GAAG,IAAI,CAACV,SAAS,CAACW,aAAa,CAAC,cAAc,CAAC;IAC/D,IAAI,CAACC,UAAU,CAAC,IAAI,CAACF,WAAW,CAAC;EACnC;EAEAE,UAAUA,CAACC,MAA0B,EAAEC,OAAiB,EAAE;IACxD,KAAK,CAACF,UAAU,CAACC,MAAM,EAAEC,OAAO,CAAC;IACjC,MAAMP,IAAI,GAAGM,MAAM,IAAI,IAAI,CAACH,WAAW;IACvC,IAAIH,IAAI,IAAI,IAAI,EAAE;MAChB,IAAI,IAAI,CAACQ,KAAK,CAACP,SAAS,KAAKD,IAAI,CAACC,SAAS,EAAE;MAC7C,IAAI,CAACO,KAAK,CAACP,SAAS,GAAGD,IAAI,CAACC,SAAS;IACvC;EACF;AACF;AAEA,eAAeZ,UAAU","ignoreList":[]}
@@ -0,0 +1,49 @@
"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/success.tsx
var success_exports = {};
__export(success_exports, {
SuccessIcon: () => SuccessIcon
});
module.exports = __toCommonJS(success_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var SuccessIcon = (props) => {
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"svg",
{
fill: "none",
height: "24",
viewBox: "0 0 24 24",
width: "24",
xmlns: "http://www.w3.org/2000/svg",
...props,
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"path",
{
d: "\n M12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2Z\n M16.78 9.7L11.11 15.37C10.97 15.51 10.78 15.59 10.58 15.59C10.38 15.59 10.19 15.51 10.05 15.37L7.22 12.54\n C6.93 12.25 6.93 11.77 7.22 11.48C7.51 11.19 7.99 11.19 8.28 11.48L10.58 13.78L15.72 8.64\n C16.01 8.35 16.49 8.35 16.78 8.64C17.07 8.93 17.07 9.4 16.78 9.7Z\n "
}
)
}
);
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
SuccessIcon
});
@@ -0,0 +1,209 @@
'use strict';
var identity = require('../nodes/identity.js');
var Pair = require('../nodes/Pair.js');
var YAMLMap = require('../nodes/YAMLMap.js');
var YAMLSeq = require('../nodes/YAMLSeq.js');
var resolveEnd = require('./resolve-end.js');
var resolveProps = require('./resolve-props.js');
var utilContainsNewline = require('./util-contains-newline.js');
var utilMapIncludes = require('./util-map-includes.js');
const blockMsg = 'Block collections are not allowed within flow collections';
const isBlock = (token) => token && (token.type === 'block-map' || token.type === 'block-seq');
function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) {
const isMap = fc.start.source === '{';
const fcName = isMap ? 'flow map' : 'flow sequence';
const NodeClass = (tag?.nodeClass ?? (isMap ? YAMLMap.YAMLMap : YAMLSeq.YAMLSeq));
const coll = new NodeClass(ctx.schema);
coll.flow = true;
const atRoot = ctx.atRoot;
if (atRoot)
ctx.atRoot = false;
if (ctx.atKey)
ctx.atKey = false;
let offset = fc.offset + fc.start.source.length;
for (let i = 0; i < fc.items.length; ++i) {
const collItem = fc.items[i];
const { start, key, sep, value } = collItem;
const props = resolveProps.resolveProps(start, {
flow: fcName,
indicator: 'explicit-key-ind',
next: key ?? sep?.[0],
offset,
onError,
parentIndent: fc.indent,
startOnNewline: false
});
if (!props.found) {
if (!props.anchor && !props.tag && !sep && !value) {
if (i === 0 && props.comma)
onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`);
else if (i < fc.items.length - 1)
onError(props.start, 'UNEXPECTED_TOKEN', `Unexpected empty item in ${fcName}`);
if (props.comment) {
if (coll.comment)
coll.comment += '\n' + props.comment;
else
coll.comment = props.comment;
}
offset = props.end;
continue;
}
if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(key))
onError(key, // checked by containsNewline()
'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line');
}
if (i === 0) {
if (props.comma)
onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`);
}
else {
if (!props.comma)
onError(props.start, 'MISSING_CHAR', `Missing , between ${fcName} items`);
if (props.comment) {
let prevItemComment = '';
loop: for (const st of start) {
switch (st.type) {
case 'comma':
case 'space':
break;
case 'comment':
prevItemComment = st.source.substring(1);
break loop;
default:
break loop;
}
}
if (prevItemComment) {
let prev = coll.items[coll.items.length - 1];
if (identity.isPair(prev))
prev = prev.value ?? prev.key;
if (prev.comment)
prev.comment += '\n' + prevItemComment;
else
prev.comment = prevItemComment;
props.comment = props.comment.substring(prevItemComment.length + 1);
}
}
}
if (!isMap && !sep && !props.found) {
// item is a value in a seq
// → key & sep are empty, start does not include ? or :
const valueNode = value
? composeNode(ctx, value, props, onError)
: composeEmptyNode(ctx, props.end, sep, null, props, onError);
coll.items.push(valueNode);
offset = valueNode.range[2];
if (isBlock(value))
onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);
}
else {
// item is a key+value pair
// key value
ctx.atKey = true;
const keyStart = props.end;
const keyNode = key
? composeNode(ctx, key, props, onError)
: composeEmptyNode(ctx, keyStart, start, null, props, onError);
if (isBlock(key))
onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
ctx.atKey = false;
// value properties
const valueProps = resolveProps.resolveProps(sep ?? [], {
flow: fcName,
indicator: 'map-value-ind',
next: value,
offset: keyNode.range[2],
onError,
parentIndent: fc.indent,
startOnNewline: false
});
if (valueProps.found) {
if (!isMap && !props.found && ctx.options.strict) {
if (sep)
for (const st of sep) {
if (st === valueProps.found)
break;
if (st.type === 'newline') {
onError(st, 'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line');
break;
}
}
if (props.start < valueProps.found.offset - 1024)
onError(valueProps.found, 'KEY_OVER_1024_CHARS', 'The : indicator must be at most 1024 chars after the start of an implicit flow sequence key');
}
}
else if (value) {
if ('source' in value && value.source?.[0] === ':')
onError(value, 'MISSING_CHAR', `Missing space after : in ${fcName}`);
else
onError(valueProps.start, 'MISSING_CHAR', `Missing , or : between ${fcName} items`);
}
// value value
const valueNode = value
? composeNode(ctx, value, valueProps, onError)
: valueProps.found
? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError)
: null;
if (valueNode) {
if (isBlock(value))
onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);
}
else if (valueProps.comment) {
if (keyNode.comment)
keyNode.comment += '\n' + valueProps.comment;
else
keyNode.comment = valueProps.comment;
}
const pair = new Pair.Pair(keyNode, valueNode);
if (ctx.options.keepSourceTokens)
pair.srcToken = collItem;
if (isMap) {
const map = coll;
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
map.items.push(pair);
}
else {
const map = new YAMLMap.YAMLMap(ctx.schema);
map.flow = true;
map.items.push(pair);
const endRange = (valueNode ?? keyNode).range;
map.range = [keyNode.range[0], endRange[1], endRange[2]];
coll.items.push(map);
}
offset = valueNode ? valueNode.range[2] : valueProps.end;
}
}
const expectedEnd = isMap ? '}' : ']';
const [ce, ...ee] = fc.end;
let cePos = offset;
if (ce?.source === expectedEnd)
cePos = ce.offset + ce.source.length;
else {
const name = fcName[0].toUpperCase() + fcName.substring(1);
const msg = atRoot
? `${name} must end with a ${expectedEnd}`
: `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`;
onError(offset, atRoot ? 'MISSING_CHAR' : 'BAD_INDENT', msg);
if (ce && ce.source.length !== 1)
ee.unshift(ce);
}
if (ee.length > 0) {
const end = resolveEnd.resolveEnd(ee, cePos, ctx.options.strict, onError);
if (end.comment) {
if (coll.comment)
coll.comment += '\n' + end.comment;
else
coll.comment = end.comment;
}
coll.range = [fc.offset, cePos, end.offset];
}
else {
coll.range = [fc.offset, cePos, cePos];
}
return coll;
}
exports.resolveFlowCollection = resolveFlowCollection;
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more