update
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
// Ported from https://github.com/mafintosh/pump with
|
||||
// permission from the author, Mathias Buus (@mafintosh).
|
||||
|
||||
'use strict';
|
||||
|
||||
var eos;
|
||||
function once(callback) {
|
||||
var called = false;
|
||||
return function () {
|
||||
if (called) return;
|
||||
called = true;
|
||||
callback.apply(void 0, arguments);
|
||||
};
|
||||
}
|
||||
var _require$codes = require('../../../errors').codes,
|
||||
ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,
|
||||
ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
|
||||
function noop(err) {
|
||||
// Rethrow the error if it exists to avoid swallowing it
|
||||
if (err) throw err;
|
||||
}
|
||||
function isRequest(stream) {
|
||||
return stream.setHeader && typeof stream.abort === 'function';
|
||||
}
|
||||
function destroyer(stream, reading, writing, callback) {
|
||||
callback = once(callback);
|
||||
var closed = false;
|
||||
stream.on('close', function () {
|
||||
closed = true;
|
||||
});
|
||||
if (eos === undefined) eos = require('./end-of-stream');
|
||||
eos(stream, {
|
||||
readable: reading,
|
||||
writable: writing
|
||||
}, function (err) {
|
||||
if (err) return callback(err);
|
||||
closed = true;
|
||||
callback();
|
||||
});
|
||||
var destroyed = false;
|
||||
return function (err) {
|
||||
if (closed) return;
|
||||
if (destroyed) return;
|
||||
destroyed = true;
|
||||
|
||||
// request.destroy just do .end - .abort is what we want
|
||||
if (isRequest(stream)) return stream.abort();
|
||||
if (typeof stream.destroy === 'function') return stream.destroy();
|
||||
callback(err || new ERR_STREAM_DESTROYED('pipe'));
|
||||
};
|
||||
}
|
||||
function call(fn) {
|
||||
fn();
|
||||
}
|
||||
function pipe(from, to) {
|
||||
return from.pipe(to);
|
||||
}
|
||||
function popCallback(streams) {
|
||||
if (!streams.length) return noop;
|
||||
if (typeof streams[streams.length - 1] !== 'function') return noop;
|
||||
return streams.pop();
|
||||
}
|
||||
function pipeline() {
|
||||
for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
streams[_key] = arguments[_key];
|
||||
}
|
||||
var callback = popCallback(streams);
|
||||
if (Array.isArray(streams[0])) streams = streams[0];
|
||||
if (streams.length < 2) {
|
||||
throw new ERR_MISSING_ARGS('streams');
|
||||
}
|
||||
var error;
|
||||
var destroys = streams.map(function (stream, i) {
|
||||
var reading = i < streams.length - 1;
|
||||
var writing = i > 0;
|
||||
return destroyer(stream, reading, writing, function (err) {
|
||||
if (!error) error = err;
|
||||
if (err) destroys.forEach(call);
|
||||
if (reading) return;
|
||||
destroys.forEach(call);
|
||||
callback(error);
|
||||
});
|
||||
});
|
||||
return streams.reduce(pipe);
|
||||
}
|
||||
module.exports = pipeline;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 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 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N O P","260":"Q H R S"},C:{"1":"0 9 R OC 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 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"1 2 3 4 5 6 7 8 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB qC rC","260":"MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B","516":"kB lB mB nB oB pB qB rB sB tB uB vB","580":"WB XB YB ZB aB bB cB dB eB fB gB hB iB jB","2049":"AC BC CC DC Q H"},D:{"1":"0 9 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 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB","132":"ZB aB bB","260":"cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S"},E:{"1":"G zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"J PB K D E F A sC SC tC uC vC wC TC","1090":"B C L FC GC","2049":"M xC yC"},F:{"1":"0 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 F B C G N O P QB 4C 5C 6C 7C FC kC 8C GC","132":"4 5 6","260":"7 8 RB SB TB UB VB WB XB YB ZB aB 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"},G:{"2":"E SC 9C lC AD BD CD DD ED FD GD HD","1090":"ID JD KD LD MD ND OD","2049":"PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 lD mD IC JC KC nD","260":"J dD eD fD gD hD TC iD jD kD"},Q:{"260":"oD"},R:{"1":"pD"},S:{"1":"rD","516":"qD"}},B:5,C:"Web Animations API",D:true};
|
||||
@@ -0,0 +1,196 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||
const utils = require("./utils.cjs");
|
||||
const storageKey = "tsr-scroll-restoration-v1_3";
|
||||
let sessionsStorage = false;
|
||||
try {
|
||||
sessionsStorage = typeof window !== "undefined" && typeof window.sessionStorage === "object";
|
||||
} catch {
|
||||
}
|
||||
const throttle = (fn, wait) => {
|
||||
let timeout;
|
||||
return (...args) => {
|
||||
if (!timeout) {
|
||||
timeout = setTimeout(() => {
|
||||
fn(...args);
|
||||
timeout = null;
|
||||
}, wait);
|
||||
}
|
||||
};
|
||||
};
|
||||
const scrollRestorationCache = sessionsStorage ? (() => {
|
||||
const state = JSON.parse(window.sessionStorage.getItem(storageKey) || "null") || {};
|
||||
return {
|
||||
state,
|
||||
// This setter is simply to make sure that we set the sessionStorage right
|
||||
// after the state is updated. It doesn't necessarily need to be a functional
|
||||
// update.
|
||||
set: (updater) => (scrollRestorationCache.state = utils.functionalUpdate(updater, scrollRestorationCache.state) || scrollRestorationCache.state, window.sessionStorage.setItem(
|
||||
storageKey,
|
||||
JSON.stringify(scrollRestorationCache.state)
|
||||
))
|
||||
};
|
||||
})() : void 0;
|
||||
const defaultGetScrollRestorationKey = (location) => {
|
||||
return location.state.key || location.href;
|
||||
};
|
||||
function getCssSelector(el) {
|
||||
const path = [];
|
||||
let parent;
|
||||
while (parent = el.parentNode) {
|
||||
path.unshift(
|
||||
`${el.tagName}:nth-child(${[].indexOf.call(parent.children, el) + 1})`
|
||||
);
|
||||
el = parent;
|
||||
}
|
||||
return `${path.join(" > ")}`.toLowerCase();
|
||||
}
|
||||
let ignoreScroll = false;
|
||||
function restoreScroll(storageKey2, key, behavior, shouldScrollRestoration, scrollToTopSelectors) {
|
||||
var _a;
|
||||
let byKey;
|
||||
try {
|
||||
byKey = JSON.parse(sessionStorage.getItem(storageKey2) || "{}");
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return;
|
||||
}
|
||||
const resolvedKey = key || ((_a = window.history.state) == null ? void 0 : _a.key);
|
||||
const elementEntries = byKey[resolvedKey];
|
||||
ignoreScroll = true;
|
||||
(() => {
|
||||
if (shouldScrollRestoration && elementEntries) {
|
||||
for (const elementSelector in elementEntries) {
|
||||
const entry = elementEntries[elementSelector];
|
||||
if (elementSelector === "window") {
|
||||
window.scrollTo({
|
||||
top: entry.scrollY,
|
||||
left: entry.scrollX,
|
||||
behavior
|
||||
});
|
||||
} else if (elementSelector) {
|
||||
const element = document.querySelector(elementSelector);
|
||||
if (element) {
|
||||
element.scrollLeft = entry.scrollX;
|
||||
element.scrollTop = entry.scrollY;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
const hash = window.location.hash.split("#")[1];
|
||||
if (hash) {
|
||||
const hashScrollIntoViewOptions = (window.history.state || {}).__hashScrollIntoViewOptions ?? true;
|
||||
if (hashScrollIntoViewOptions) {
|
||||
const el = document.getElementById(hash);
|
||||
if (el) {
|
||||
el.scrollIntoView(hashScrollIntoViewOptions);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
[
|
||||
"window",
|
||||
...(scrollToTopSelectors == null ? void 0 : scrollToTopSelectors.filter((d) => d !== "window")) ?? []
|
||||
].forEach((selector) => {
|
||||
const element = selector === "window" ? window : document.querySelector(selector);
|
||||
if (element) {
|
||||
element.scrollTo({
|
||||
top: 0,
|
||||
left: 0,
|
||||
behavior
|
||||
});
|
||||
}
|
||||
});
|
||||
})();
|
||||
ignoreScroll = false;
|
||||
}
|
||||
function setupScrollRestoration(router, force) {
|
||||
const shouldScrollRestoration = force ?? router.options.scrollRestoration ?? false;
|
||||
if (shouldScrollRestoration) {
|
||||
router.isScrollRestoring = true;
|
||||
}
|
||||
if (typeof document === "undefined" || router.isScrollRestorationSetup) {
|
||||
return;
|
||||
}
|
||||
router.isScrollRestorationSetup = true;
|
||||
ignoreScroll = false;
|
||||
const getKey = router.options.getScrollRestorationKey || defaultGetScrollRestorationKey;
|
||||
window.history.scrollRestoration = "manual";
|
||||
const onScroll = (event) => {
|
||||
if (ignoreScroll || !router.isScrollRestoring) {
|
||||
return;
|
||||
}
|
||||
let elementSelector = "";
|
||||
if (event.target === document || event.target === window) {
|
||||
elementSelector = "window";
|
||||
} else {
|
||||
const attrId = event.target.getAttribute(
|
||||
"data-scroll-restoration-id"
|
||||
);
|
||||
if (attrId) {
|
||||
elementSelector = `[data-scroll-restoration-id="${attrId}"]`;
|
||||
} else {
|
||||
elementSelector = getCssSelector(event.target);
|
||||
}
|
||||
}
|
||||
const restoreKey = getKey(router.state.location);
|
||||
scrollRestorationCache.set((state) => {
|
||||
const keyEntry = state[restoreKey] = state[restoreKey] || {};
|
||||
const elementEntry = keyEntry[elementSelector] = keyEntry[elementSelector] || {};
|
||||
if (elementSelector === "window") {
|
||||
elementEntry.scrollX = window.scrollX || 0;
|
||||
elementEntry.scrollY = window.scrollY || 0;
|
||||
} else if (elementSelector) {
|
||||
const element = document.querySelector(elementSelector);
|
||||
if (element) {
|
||||
elementEntry.scrollX = element.scrollLeft || 0;
|
||||
elementEntry.scrollY = element.scrollTop || 0;
|
||||
}
|
||||
}
|
||||
return state;
|
||||
});
|
||||
};
|
||||
if (typeof document !== "undefined") {
|
||||
document.addEventListener("scroll", throttle(onScroll, 100), true);
|
||||
}
|
||||
router.subscribe("onRendered", (event) => {
|
||||
const cacheKey = getKey(event.toLocation);
|
||||
if (!router.resetNextScroll) {
|
||||
router.resetNextScroll = true;
|
||||
return;
|
||||
}
|
||||
restoreScroll(
|
||||
storageKey,
|
||||
cacheKey,
|
||||
router.options.scrollRestorationBehavior || void 0,
|
||||
router.isScrollRestoring || void 0,
|
||||
router.options.scrollToTopSelectors || void 0
|
||||
);
|
||||
if (router.isScrollRestoring) {
|
||||
scrollRestorationCache.set((state) => {
|
||||
state[cacheKey] = state[cacheKey] || {};
|
||||
return state;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleHashScroll(router) {
|
||||
if (typeof document !== "undefined" && document.querySelector) {
|
||||
const hashScrollIntoViewOptions = router.state.location.state.__hashScrollIntoViewOptions ?? true;
|
||||
if (hashScrollIntoViewOptions && router.state.location.hash !== "") {
|
||||
const el = document.getElementById(router.state.location.hash);
|
||||
if (el) {
|
||||
el.scrollIntoView(hashScrollIntoViewOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.defaultGetScrollRestorationKey = defaultGetScrollRestorationKey;
|
||||
exports.getCssSelector = getCssSelector;
|
||||
exports.handleHashScroll = handleHashScroll;
|
||||
exports.restoreScroll = restoreScroll;
|
||||
exports.scrollRestorationCache = scrollRestorationCache;
|
||||
exports.setupScrollRestoration = setupScrollRestoration;
|
||||
exports.storageKey = storageKey;
|
||||
//# sourceMappingURL=scroll-restoration.cjs.map
|
||||
@@ -0,0 +1,42 @@
|
||||
declare namespace pLimit {
|
||||
interface Limit {
|
||||
/**
|
||||
The number of promises that are currently running.
|
||||
*/
|
||||
readonly activeCount: number;
|
||||
|
||||
/**
|
||||
The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
|
||||
*/
|
||||
readonly pendingCount: number;
|
||||
|
||||
/**
|
||||
Discard pending promises that are waiting to run.
|
||||
|
||||
This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
|
||||
|
||||
Note: This does not cancel promises that are already running.
|
||||
*/
|
||||
clearQueue: () => void;
|
||||
|
||||
/**
|
||||
@param fn - Promise-returning/async function.
|
||||
@param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions.
|
||||
@returns The promise returned by calling `fn(...arguments)`.
|
||||
*/
|
||||
<Arguments extends unknown[], ReturnType>(
|
||||
fn: (...arguments: Arguments) => PromiseLike<ReturnType> | ReturnType,
|
||||
...arguments: Arguments
|
||||
): Promise<ReturnType>;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Run multiple promise-returning & async functions with limited concurrency.
|
||||
|
||||
@param concurrency - Concurrency limit. Minimum: `1`.
|
||||
@returns A `limit` function.
|
||||
*/
|
||||
declare function pLimit(concurrency: number): pLimit.Limit;
|
||||
|
||||
export = pLimit;
|
||||
@@ -0,0 +1,98 @@
|
||||
import { N as NamedUtilityValue, P as PluginUtils } from './resolve-config-QUZ9b-Gn.mjs';
|
||||
|
||||
type Config = UserConfig;
|
||||
type PluginFn = (api: PluginAPI) => void;
|
||||
type PluginWithConfig = {
|
||||
handler: PluginFn;
|
||||
config?: UserConfig;
|
||||
/** @internal */
|
||||
reference?: boolean;
|
||||
};
|
||||
type PluginWithOptions<T> = {
|
||||
(options?: T): PluginWithConfig;
|
||||
__isOptionsFunction: true;
|
||||
};
|
||||
type Plugin = PluginFn | PluginWithConfig | PluginWithOptions<any>;
|
||||
type PluginAPI = {
|
||||
addBase(base: CssInJs): void;
|
||||
addVariant(name: string, variant: string | string[] | CssInJs): void;
|
||||
matchVariant<T = string>(name: string, cb: (value: T | string, extra: {
|
||||
modifier: string | null;
|
||||
}) => string | string[], options?: {
|
||||
values?: Record<string, T>;
|
||||
sort?(a: {
|
||||
value: T | string;
|
||||
modifier: string | null;
|
||||
}, b: {
|
||||
value: T | string;
|
||||
modifier: string | null;
|
||||
}): number;
|
||||
}): void;
|
||||
addUtilities(utilities: Record<string, CssInJs | CssInJs[]> | Record<string, CssInJs | CssInJs[]>[], options?: {}): void;
|
||||
matchUtilities(utilities: Record<string, (value: string, extra: {
|
||||
modifier: string | null;
|
||||
}) => CssInJs | CssInJs[]>, options?: Partial<{
|
||||
type: string | string[];
|
||||
supportsNegativeValues: boolean;
|
||||
values: Record<string, string> & {
|
||||
__BARE_VALUE__?: (value: NamedUtilityValue) => string | undefined;
|
||||
};
|
||||
modifiers: 'any' | Record<string, string>;
|
||||
}>): void;
|
||||
addComponents(utilities: Record<string, CssInJs> | Record<string, CssInJs>[], options?: {}): void;
|
||||
matchComponents(utilities: Record<string, (value: string, extra: {
|
||||
modifier: string | null;
|
||||
}) => CssInJs>, options?: Partial<{
|
||||
type: string | string[];
|
||||
supportsNegativeValues: boolean;
|
||||
values: Record<string, string> & {
|
||||
__BARE_VALUE__?: (value: NamedUtilityValue) => string | undefined;
|
||||
};
|
||||
modifiers: 'any' | Record<string, string>;
|
||||
}>): void;
|
||||
theme(path: string, defaultValue?: any): any;
|
||||
config(path?: string, defaultValue?: any): any;
|
||||
prefix(className: string): string;
|
||||
};
|
||||
type CssInJs = {
|
||||
[key: string]: string | string[] | CssInJs | CssInJs[];
|
||||
};
|
||||
|
||||
type ResolvableTo<T> = T | ((utils: PluginUtils) => T);
|
||||
type ThemeValue = ResolvableTo<Record<string, unknown>> | null | undefined;
|
||||
type ThemeConfig = Record<string, ThemeValue> & {
|
||||
extend?: Record<string, ThemeValue>;
|
||||
};
|
||||
type ContentFile = string | {
|
||||
raw: string;
|
||||
extension?: string;
|
||||
};
|
||||
type DarkModeStrategy = false | 'media' | 'class' | ['class', string] | 'selector' | ['selector', string] | ['variant', string | string[]];
|
||||
interface UserConfig {
|
||||
presets?: UserConfig[];
|
||||
theme?: ThemeConfig;
|
||||
plugins?: Plugin[];
|
||||
}
|
||||
interface UserConfig {
|
||||
content?: ContentFile[] | {
|
||||
relative?: boolean;
|
||||
files: ContentFile[];
|
||||
};
|
||||
}
|
||||
interface UserConfig {
|
||||
darkMode?: DarkModeStrategy;
|
||||
}
|
||||
interface UserConfig {
|
||||
prefix?: string;
|
||||
}
|
||||
interface UserConfig {
|
||||
blocklist?: string[];
|
||||
}
|
||||
interface UserConfig {
|
||||
important?: boolean | string;
|
||||
}
|
||||
interface UserConfig {
|
||||
future?: 'all' | Record<string, boolean>;
|
||||
}
|
||||
|
||||
export type { Config as C, Plugin as P, ThemeConfig as T, UserConfig as U, PluginFn as a, PluginWithConfig as b, PluginWithOptions as c, PluginAPI as d };
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,37 @@
|
||||
// Copyright Joyent, Inc. and other Node contributors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
// persons to whom the Software is furnished to do so, subject to the
|
||||
// following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// a passthrough stream.
|
||||
// basically just the most minimal sort of Transform stream.
|
||||
// Every written chunk gets output as-is.
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = PassThrough;
|
||||
var Transform = require('./_stream_transform');
|
||||
require('inherits')(PassThrough, Transform);
|
||||
function PassThrough(options) {
|
||||
if (!(this instanceof PassThrough)) return new PassThrough(options);
|
||||
Transform.call(this, options);
|
||||
}
|
||||
PassThrough.prototype._transform = function (chunk, encoding, cb) {
|
||||
cb(null, chunk);
|
||||
};
|
||||
@@ -0,0 +1,162 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||
const React = require("react");
|
||||
const useRouter = require("./useRouter.cjs");
|
||||
function _interopNamespaceDefault(e) {
|
||||
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
||||
if (e) {
|
||||
for (const k in e) {
|
||||
if (k !== "default") {
|
||||
const d = Object.getOwnPropertyDescriptor(e, k);
|
||||
Object.defineProperty(n, k, d.get ? d : {
|
||||
enumerable: true,
|
||||
get: () => e[k]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
n.default = e;
|
||||
return Object.freeze(n);
|
||||
}
|
||||
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
||||
function _resolveBlockerOpts(opts, condition) {
|
||||
if (opts === void 0) {
|
||||
return {
|
||||
shouldBlockFn: () => true,
|
||||
withResolver: false
|
||||
};
|
||||
}
|
||||
if ("shouldBlockFn" in opts) {
|
||||
return opts;
|
||||
}
|
||||
if (typeof opts === "function") {
|
||||
const shouldBlock2 = Boolean(condition ?? true);
|
||||
const _customBlockerFn2 = async () => {
|
||||
if (shouldBlock2) return await opts();
|
||||
return false;
|
||||
};
|
||||
return {
|
||||
shouldBlockFn: _customBlockerFn2,
|
||||
enableBeforeUnload: shouldBlock2,
|
||||
withResolver: false
|
||||
};
|
||||
}
|
||||
const shouldBlock = Boolean(opts.condition ?? true);
|
||||
const fn = opts.blockerFn;
|
||||
const _customBlockerFn = async () => {
|
||||
if (shouldBlock && fn !== void 0) {
|
||||
return await fn();
|
||||
}
|
||||
return shouldBlock;
|
||||
};
|
||||
return {
|
||||
shouldBlockFn: _customBlockerFn,
|
||||
enableBeforeUnload: shouldBlock,
|
||||
withResolver: fn === void 0
|
||||
};
|
||||
}
|
||||
function useBlocker(opts, condition) {
|
||||
const {
|
||||
shouldBlockFn,
|
||||
enableBeforeUnload = true,
|
||||
disabled = false,
|
||||
withResolver = false
|
||||
} = _resolveBlockerOpts(opts, condition);
|
||||
const router = useRouter.useRouter();
|
||||
const { history } = router;
|
||||
const [resolver, setResolver] = React__namespace.useState({
|
||||
status: "idle",
|
||||
current: void 0,
|
||||
next: void 0,
|
||||
action: void 0,
|
||||
proceed: void 0,
|
||||
reset: void 0
|
||||
});
|
||||
React__namespace.useEffect(() => {
|
||||
const blockerFnComposed = async (blockerFnArgs) => {
|
||||
function getLocation(location) {
|
||||
const parsedLocation = router.parseLocation(void 0, location);
|
||||
const matchedRoutes = router.getMatchedRoutes(parsedLocation);
|
||||
if (matchedRoutes.foundRoute === void 0) {
|
||||
throw new Error(`No route found for location ${location.href}`);
|
||||
}
|
||||
return {
|
||||
routeId: matchedRoutes.foundRoute.id,
|
||||
fullPath: matchedRoutes.foundRoute.fullPath,
|
||||
pathname: parsedLocation.pathname,
|
||||
params: matchedRoutes.routeParams,
|
||||
search: parsedLocation.search
|
||||
};
|
||||
}
|
||||
const current = getLocation(blockerFnArgs.currentLocation);
|
||||
const next = getLocation(blockerFnArgs.nextLocation);
|
||||
const shouldBlock = await shouldBlockFn({
|
||||
action: blockerFnArgs.action,
|
||||
current,
|
||||
next
|
||||
});
|
||||
if (!withResolver) {
|
||||
return shouldBlock;
|
||||
}
|
||||
if (!shouldBlock) {
|
||||
return false;
|
||||
}
|
||||
const promise = new Promise((resolve) => {
|
||||
setResolver({
|
||||
status: "blocked",
|
||||
current,
|
||||
next,
|
||||
action: blockerFnArgs.action,
|
||||
proceed: () => resolve(false),
|
||||
reset: () => resolve(true)
|
||||
});
|
||||
});
|
||||
const canNavigateAsync = await promise;
|
||||
setResolver({
|
||||
status: "idle",
|
||||
current: void 0,
|
||||
next: void 0,
|
||||
action: void 0,
|
||||
proceed: void 0,
|
||||
reset: void 0
|
||||
});
|
||||
return canNavigateAsync;
|
||||
};
|
||||
return disabled ? void 0 : history.block({ blockerFn: blockerFnComposed, enableBeforeUnload });
|
||||
}, [
|
||||
shouldBlockFn,
|
||||
enableBeforeUnload,
|
||||
disabled,
|
||||
withResolver,
|
||||
history,
|
||||
router
|
||||
]);
|
||||
return resolver;
|
||||
}
|
||||
const _resolvePromptBlockerArgs = (props) => {
|
||||
if ("shouldBlockFn" in props) {
|
||||
return { ...props };
|
||||
}
|
||||
const shouldBlock = Boolean(props.condition ?? true);
|
||||
const fn = props.blockerFn;
|
||||
const _customBlockerFn = async () => {
|
||||
if (shouldBlock && fn !== void 0) {
|
||||
return await fn();
|
||||
}
|
||||
return shouldBlock;
|
||||
};
|
||||
return {
|
||||
shouldBlockFn: _customBlockerFn,
|
||||
enableBeforeUnload: shouldBlock,
|
||||
withResolver: fn === void 0
|
||||
};
|
||||
};
|
||||
function Block(opts) {
|
||||
const { children, ...rest } = opts;
|
||||
const args = _resolvePromptBlockerArgs(rest);
|
||||
const resolver = useBlocker(args);
|
||||
return children ? typeof children === "function" ? children(resolver) : children : null;
|
||||
}
|
||||
exports.Block = Block;
|
||||
exports.useBlocker = useBlocker;
|
||||
//# sourceMappingURL=useBlocker.cjs.map
|
||||
@@ -0,0 +1,202 @@
|
||||
# set-cookie-parser
|
||||
|
||||
[](https://github.com/nfriedly/set-cookie-parser/actions/workflows/node.js.yml)
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[][npm-url]
|
||||
|
||||
---
|
||||
|
||||
ℹ️ **Note for current users:** I'm considering some changes for the next major version and would appreciate your feedback: https://github.com/nfriedly/set-cookie-parser/discussions/68
|
||||
|
||||
---
|
||||
|
||||
Parses set-cookie headers into JavaScript objects
|
||||
|
||||
Accepts a single `set-cookie` header value, an array of `set-cookie` header values, a Node.js response object, or a `fetch()` `Response` object that may have 0 or more `set-cookie` headers.
|
||||
|
||||
Also accepts an optional options object. Defaults:
|
||||
|
||||
```js
|
||||
{
|
||||
decodeValues: true, // Calls decodeURIComponent on each value - default: true
|
||||
map: false, // Return an object instead of an array - default: false
|
||||
silent: false, // Suppress the warning that is logged when called on a request instead of a response - default: false
|
||||
}
|
||||
```
|
||||
|
||||
Returns either an array of cookie objects or a map of name => cookie object with `{map: true}`. Each cookie object will have, at a minimum `name` and `value` properties, and may have additional properties depending on the set-cookie header:
|
||||
|
||||
* `name` - cookie name (string)
|
||||
* `value` - cookie value (string)
|
||||
* `path` - URL path to limit the scope to (string or undefined)
|
||||
* `domain` - domain to expand the scope to (string or undefined, may begin with "." to indicate the named domain or any subdomain of it)
|
||||
* `expires` - absolute expiration date for the cookie (Date object or undefined)
|
||||
* `maxAge` - relative expiration time of the cookie in seconds from when the client receives it (integer or undefined)
|
||||
* Note: when using with [express's res.cookie() method](http://expressjs.com/en/4x/api.html#res.cookie), multiply `maxAge` by 1000 to convert to milliseconds.
|
||||
* `secure` - indicates cookie should only be sent over HTTPs (true or undefined)
|
||||
* `httpOnly` - indicates cookie should *not* be accessible to client-side JavaScript (true or undefined)
|
||||
* `sameSite` - indicates if cookie should be included in cross-site requests ([more info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value)) (string or undefined)
|
||||
* Note: valid values are `"Strict"`, `"Lax"`, and `"None"`, but set-cookie-parser coppies the value verbatim and does *not* perform any validation.
|
||||
* `partitioned` - indicates cookie should be scoped to the combination of 3rd party domain + top page domain ([more info](https://developer.mozilla.org/en-US/docs/Web/Privacy/Privacy_sandbox/Partitioned_cookies)) (true or undefined)
|
||||
|
||||
(The output format is loosely based on the input format of https://www.npmjs.com/package/cookie)
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save set-cookie-parser
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
### Get array of cookie objects
|
||||
|
||||
```js
|
||||
var http = require('http');
|
||||
var setCookie = require('set-cookie-parser');
|
||||
|
||||
http.get('http://example.com', function(res) {
|
||||
var cookies = setCookie.parse(res, {
|
||||
decodeValues: true // default: true
|
||||
});
|
||||
|
||||
cookies.forEach(console.log);
|
||||
}
|
||||
```
|
||||
|
||||
Example output:
|
||||
|
||||
```js
|
||||
[
|
||||
{
|
||||
name: 'bam',
|
||||
value: 'baz'
|
||||
},
|
||||
{
|
||||
name: 'foo',
|
||||
value: 'bar',
|
||||
path: '/',
|
||||
expires: new Date('Tue Jul 01 2025 06:01:11 GMT-0400 (EDT)'),
|
||||
maxAge: 1000,
|
||||
domain: '.example.com',
|
||||
secure: true,
|
||||
httpOnly: true,
|
||||
sameSite: 'lax'
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### Get map of cookie objects
|
||||
|
||||
```js
|
||||
var http = require('http');
|
||||
var setCookie = require('set-cookie-parser');
|
||||
|
||||
http.get('http://example.com', function(res) {
|
||||
var cookies = setCookie.parse(res, {
|
||||
decodeValues: true, // default: true
|
||||
map: true // default: false
|
||||
});
|
||||
|
||||
var desiredCookie = cookies['session'];
|
||||
console.log(desiredCookie);
|
||||
});
|
||||
```
|
||||
Example output:
|
||||
```js
|
||||
{
|
||||
bam: {
|
||||
name: 'bam',
|
||||
value: 'baz'
|
||||
},
|
||||
foo: {
|
||||
name: 'foo',
|
||||
value: 'bar',
|
||||
path: '/',
|
||||
expires: new Date('Tue Jul 01 2025 06:01:11 GMT-0400 (EDT)'),
|
||||
maxAge: 1000,
|
||||
domain: '.example.com',
|
||||
secure: true,
|
||||
httpOnly: true,
|
||||
sameSite: 'lax'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Creating a new, modified set-cookie header
|
||||
|
||||
This library can be used in conjunction with the [cookie](https://www.npmjs.com/package/cookie) library to modify and replace set-cookie headers:
|
||||
|
||||
```js
|
||||
const libCookie = require('cookie');
|
||||
const setCookie = require('set-cookie-parser');
|
||||
|
||||
function modifySetCookie(res){
|
||||
// parse the set-cookie headers with this library
|
||||
let cookies = setCookie.parse(res);
|
||||
|
||||
// modify the cookies here
|
||||
// ...
|
||||
|
||||
// create new set-cookie headers using the cookie library
|
||||
res.headers['set-cookie'] = cookies.map(function(cookie) {
|
||||
return libCookie.serialize(cookie.name, cookie.value, cookie);
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
See a real-world example of this in [unblocker](https://github.com/nfriedly/node-unblocker/blob/08a89ec27274b46dcd80d0a324a59406f2bdad3d/lib/cookies.js#L67-L85)
|
||||
|
||||
## Usage in React Native (and with some other fetch implementations)
|
||||
|
||||
React Native follows the Fetch spec more closely and combines all of the Set-Cookie header values into a single string.
|
||||
The `splitCookiesString` method reverses this.
|
||||
|
||||
```js
|
||||
var setCookie = require('set-cookie-parser');
|
||||
|
||||
var response = fetch(/*...*/);
|
||||
|
||||
// This is mainly for React Native; Node.js does not combine set-cookie headers.
|
||||
var combinedCookieHeader = response.headers.get('Set-Cookie');
|
||||
var splitCookieHeaders = setCookie.splitCookiesString(combinedCookieHeader)
|
||||
var cookies = setCookie.parse(splitCookieHeaders);
|
||||
|
||||
console.log(cookies); // should be an array of cookies
|
||||
```
|
||||
|
||||
This behavior may become a default part of parse in the next major release, but requires the extra step for now.
|
||||
|
||||
Note that the `fetch()` spec now includes a `getSetCookie()` method that provides un-combined `Set-Cookie` headers. This library will automatically use that method if it is present.
|
||||
|
||||
## API
|
||||
|
||||
### parse(input, [options])
|
||||
|
||||
Parses cookies from a string, array of strings, or a http response object.
|
||||
Always returns an array, regardless of input format. (Unless the `map` option is set, in which case it always returns an object.)
|
||||
|
||||
### parseString(individualSetCookieHeader, [options])
|
||||
|
||||
Parses a single set-cookie header value string. Options default is `{decodeValues: true}`. Used under-the-hood by `parse()`.
|
||||
Returns an object.
|
||||
|
||||
### splitCookiesString(combinedSetCookieHeader)
|
||||
|
||||
It's uncommon, but the HTTP spec does allow for multiple of the same header to have their values combined (comma-separated) into a single header.
|
||||
This method splits apart a combined header without choking on commas that appear within a cookie's value (or expiration date).
|
||||
Returns an array of strings that may be passed to `parse()`.
|
||||
|
||||
## References
|
||||
|
||||
* [RFC 6265: HTTP State Management Mechanism](https://tools.ietf.org/html/rfc6265)
|
||||
* [draft-ietf-httpbis-rfc6265bis-10](https://httpwg.org/http-extensions/draft-ietf-httpbis-rfc6265bis.html)
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Nathan Friedly](http://www.nfriedly.com/)
|
||||
|
||||
|
||||
[npm-image]: https://badge.fury.io/js/set-cookie-parser.svg
|
||||
[npm-url]: https://npmjs.org/package/set-cookie-parser
|
||||
@@ -0,0 +1 @@
|
||||
export default function resolve(input: string, base: string | undefined): string;
|
||||
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = cloneDeep;
|
||||
var _cloneNode = require("./cloneNode.js");
|
||||
function cloneDeep(node) {
|
||||
return (0, _cloneNode.default)(node);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=cloneDeep.js.map
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 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 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N O P"},C:{"1":"0 9 kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC 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 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"1 2 3 4 5 6 7 8 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB qC rC"},D:{"1":"0 9 mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC 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 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB"},E:{"1":"F A B C L M G wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"J PB K D E sC SC tC uC vC"},F:{"1":"0 ZB aB 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 Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","2":"E SC 9C lC AD BD CD DD"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD","2":"J"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"qD rD"}},B:5,C:"Case-insensitive CSS attribute selectors",D:true};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"C L M G N O P","2":"0 9 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 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I"},C:{"2":"0 1 2 3 4 5 6 7 8 9 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC 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 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC qC rC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC 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 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC"},E:{"1":"K D E F A B C L M G uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"J PB sC SC tC"},F:{"2":"0 1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB ZB aB 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 Q H R OC 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 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC"},H:{"2":"WD"},I:{"1":"LC J I aD lC bD cD","2":"XD YD ZD"},J:{"1":"A","2":"D"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"2":"qD rD"}},B:7,C:"HTTP Live Streaming (HLS)",D:true};
|
||||
@@ -0,0 +1,15 @@
|
||||
import * as React from 'react'
|
||||
import warning from 'tiny-warning'
|
||||
import { getRouterContext } from './routerContext'
|
||||
import type { AnyRouter, RegisteredRouter } from '@tanstack/router-core'
|
||||
|
||||
export function useRouter<TRouter extends AnyRouter = RegisteredRouter>(opts?: {
|
||||
warn?: boolean
|
||||
}): TRouter {
|
||||
const value = React.useContext(getRouterContext())
|
||||
warning(
|
||||
!((opts?.warn ?? true) && !value),
|
||||
'useRouter must be used inside a <RouterProvider> component!',
|
||||
)
|
||||
return value as any
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_classPrivateFieldBase","receiver","privateKey","Object","prototype","hasOwnProperty","call","TypeError"],"sources":["../../src/helpers/classPrivateFieldLooseBase.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _classPrivateFieldBase<T extends object>(\n receiver: T,\n privateKey: PropertyKey,\n) {\n if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {\n throw new TypeError(\"attempted to use private field on non-instance\");\n }\n return receiver;\n}\n"],"mappings":";;;;;;AAEe,SAASA,sBAAsBA,CAC5CC,QAAW,EACXC,UAAuB,EACvB;EACA,IAAI,CAACC,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACL,QAAQ,EAAEC,UAAU,CAAC,EAAE;IAC/D,MAAM,IAAIK,SAAS,CAAC,gDAAgD,CAAC;EACvE;EACA,OAAON,QAAQ;AACjB","ignoreList":[]}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"34":0.00251,"78":0.00502,"115":0.04269,"128":0.01507,"129":0.00502,"132":0.00251,"134":0.00753,"135":0.03515,"136":0.20088,"137":0.00251,_:"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 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 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 116 117 118 119 120 121 122 123 124 125 126 127 130 131 133 138 139 140 3.5 3.6"},D:{"11":0.01507,"42":0.00251,"43":0.00251,"46":0.00251,"49":0.00251,"61":0.00502,"62":0.00251,"63":0.00251,"65":0.00251,"66":0.00251,"69":0.00502,"70":0.00502,"72":0.00251,"73":0.00753,"75":0.00251,"76":0.00502,"79":0.00502,"81":0.01758,"83":0.00502,"84":0.00502,"86":0.01256,"87":0.04771,"88":0.00753,"89":0.00753,"90":0.00251,"93":0.00753,"94":0.00251,"95":0.01758,"97":0.00251,"98":0.00753,"99":0.00753,"100":0.00251,"101":0.00251,"102":0.00502,"103":0.02009,"104":0.00251,"105":0.00251,"106":0.0226,"107":0.00251,"108":0.00502,"109":0.83365,"110":0.00753,"111":0.00502,"114":0.01004,"115":0.00251,"116":0.05775,"117":0.00502,"118":0.01507,"119":0.03013,"120":0.01758,"121":0.00753,"122":0.01256,"123":0.02762,"124":0.01256,"125":0.03013,"126":0.01758,"127":0.02762,"128":0.02762,"129":0.03013,"130":0.0226,"131":0.09793,"132":0.08789,"133":1.71752,"134":3.31954,"135":0.01256,_:"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 39 40 41 44 45 47 48 50 51 52 53 54 55 56 57 58 59 60 64 67 68 71 74 77 78 80 85 91 92 96 112 113 136 137 138"},F:{"32":0.00251,"79":0.00502,"84":0.00251,"86":0.00251,"87":0.00753,"95":0.08035,"102":0.00251,"108":0.00251,"114":0.00502,"115":0.00251,"116":0.01758,"117":0.40929,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 80 81 82 83 85 88 89 90 91 92 93 94 96 97 98 99 100 101 103 104 105 106 107 109 110 111 112 113 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.00251,"13":0.00251,"14":0.01004,"18":0.01256,"84":0.00251,"89":0.00502,"90":0.01507,"92":0.03515,"100":0.00502,"103":0.00251,"105":0.00251,"109":0.03264,"114":0.00251,"120":0.00251,"121":0.01507,"122":0.00753,"123":0.00251,"124":0.00502,"125":0.00753,"126":0.00753,"127":0.00753,"128":0.01758,"129":0.01256,"130":0.02009,"131":0.09291,"132":0.08537,"133":0.80854,"134":1.69241,_:"15 16 17 79 80 81 83 85 86 87 88 91 93 94 95 96 97 98 99 101 102 104 106 107 108 110 111 112 113 115 116 117 118 119"},E:{"14":0.00753,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 15.1 15.2-15.3 15.4 15.5 16.0 16.2 16.4 16.5 17.0 17.2 17.3 17.4 18.4","11.1":0.00251,"12.1":0.00251,"13.1":0.01507,"14.1":0.00251,"15.6":0.06529,"16.1":0.00251,"16.3":0.00251,"16.6":0.0226,"17.1":0.00251,"17.5":0.00502,"17.6":0.01256,"18.0":0.00753,"18.1":0.00502,"18.2":0.00251,"18.3":0.02511},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00204,"5.0-5.1":0,"6.0-6.1":0.00612,"7.0-7.1":0.00408,"8.1-8.4":0,"9.0-9.2":0.00306,"9.3":0.01429,"10.0-10.2":0.00102,"10.3":0.02348,"11.0-11.2":0.1082,"11.3-11.4":0.00715,"12.0-12.1":0.00408,"12.2-12.5":0.10105,"13.0-13.1":0.00204,"13.2":0.00306,"13.3":0.00408,"13.4-13.7":0.01429,"14.0-14.4":0.03573,"14.5-14.8":0.04287,"15.0-15.1":0.02348,"15.2-15.3":0.02348,"15.4":0.02858,"15.5":0.03266,"15.6-15.8":0.40218,"16.0":0.05716,"16.1":0.11739,"16.2":0.06125,"16.3":0.10616,"16.4":0.02348,"16.5":0.04389,"16.6-16.7":0.47669,"17.0":0.02858,"17.1":0.05104,"17.2":0.03879,"17.3":0.0541,"17.4":0.1082,"17.5":0.2409,"17.6-17.7":0.69921,"18.0":0.19598,"18.1":0.64103,"18.2":0.28683,"18.3":5.99487,"18.4":0.08881},P:{"4":0.09042,"20":0.01005,"21":0.02009,"22":0.02009,"23":0.01005,"24":0.03014,"25":0.03014,"26":0.10046,"27":0.27125,"5.0-5.4":0.01005,_:"6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0","7.2-7.4":0.11051,"13.0":0.01005,"14.0":0.01005,"15.0":0.01005,"16.0":0.01005,"17.0":0.06028,"18.0":0.01005,"19.0":0.01005},I:{"0":0.00747,"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.00001},K:{"0":0.23709,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{"2.5":0.05242,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.11982},Q:{_:"14.9"},O:{"0":0.0674},H:{"0":0.04},L:{"0":77.48744}};
|
||||
@@ -0,0 +1,103 @@
|
||||
import { RouteIds } from './routeInfo.cjs';
|
||||
import { AnyRouter } from './router.cjs';
|
||||
export type NoInfer<T> = [T][T extends any ? 0 : never];
|
||||
export type IsAny<TValue, TYesResult, TNoResult = TValue> = 1 extends 0 & TValue ? TYesResult : TNoResult;
|
||||
export type PickAsRequired<TValue, TKey extends keyof TValue> = Omit<TValue, TKey> & Required<Pick<TValue, TKey>>;
|
||||
export type PickRequired<T> = {
|
||||
[K in keyof T as undefined extends T[K] ? never : K]: T[K];
|
||||
};
|
||||
export type PickOptional<T> = {
|
||||
[K in keyof T as undefined extends T[K] ? K : never]: T[K];
|
||||
};
|
||||
export type WithoutEmpty<T> = T extends any ? ({} extends T ? never : T) : never;
|
||||
export type Expand<T> = T extends object ? T extends infer O ? O extends Function ? O : {
|
||||
[K in keyof O]: O[K];
|
||||
} : never : T;
|
||||
export type DeepPartial<T> = T extends object ? {
|
||||
[P in keyof T]?: DeepPartial<T[P]>;
|
||||
} : T;
|
||||
export type MakeDifferenceOptional<TLeft, TRight> = Omit<TRight, keyof TLeft> & {
|
||||
[K in keyof TLeft & keyof TRight]?: TRight[K];
|
||||
};
|
||||
export type IsUnion<T, U extends T = T> = (T extends any ? (U extends T ? false : true) : never) extends false ? false : true;
|
||||
export type IsNonEmptyObject<T> = T extends object ? keyof T extends never ? false : true : false;
|
||||
export type Assign<TLeft, TRight> = TLeft extends any ? TRight extends any ? IsNonEmptyObject<TLeft> extends false ? TRight : IsNonEmptyObject<TRight> extends false ? TLeft : keyof TLeft & keyof TRight extends never ? TLeft & TRight : Omit<TLeft, keyof TRight> & TRight : never : never;
|
||||
export type IntersectAssign<TLeft, TRight> = TLeft extends any ? TRight extends any ? IsNonEmptyObject<TLeft> extends false ? TRight : IsNonEmptyObject<TRight> extends false ? TLeft : TRight & TLeft : never : never;
|
||||
export type Timeout = ReturnType<typeof setTimeout>;
|
||||
export type Updater<TPrevious, TResult = TPrevious> = TResult | ((prev?: TPrevious) => TResult);
|
||||
export type NonNullableUpdater<TPrevious, TResult = TPrevious> = TResult | ((prev: TPrevious) => TResult);
|
||||
export type ExtractObjects<TUnion> = TUnion extends MergeAllPrimitive ? never : TUnion;
|
||||
export type PartialMergeAllObject<TUnion> = ExtractObjects<TUnion> extends infer TObj ? [TObj] extends [never] ? never : {
|
||||
[TKey in TObj extends any ? keyof TObj : never]?: TObj extends any ? TKey extends keyof TObj ? TObj[TKey] : never : never;
|
||||
} : never;
|
||||
export type MergeAllPrimitive = ReadonlyArray<any> | number | string | bigint | boolean | symbol | undefined | null;
|
||||
export type ExtractPrimitives<TUnion> = TUnion extends MergeAllPrimitive ? TUnion : TUnion extends object ? never : TUnion;
|
||||
export type PartialMergeAll<TUnion> = ExtractPrimitives<TUnion> | PartialMergeAllObject<TUnion>;
|
||||
export type Constrain<T, TConstraint, TDefault = TConstraint> = (T extends TConstraint ? T : never) | TDefault;
|
||||
export type ConstrainLiteral<T, TConstraint, TDefault = TConstraint> = (T & TConstraint) | TDefault;
|
||||
/**
|
||||
* To be added to router types
|
||||
*/
|
||||
export type UnionToIntersection<T> = (T extends any ? (arg: T) => any : never) extends (arg: infer T) => any ? T : never;
|
||||
/**
|
||||
* Merges everything in a union into one object.
|
||||
* This mapped type is homomorphic which means it preserves stuff! :)
|
||||
*/
|
||||
export type MergeAllObjects<TUnion, TIntersected = UnionToIntersection<ExtractObjects<TUnion>>> = [keyof TIntersected] extends [never] ? never : {
|
||||
[TKey in keyof TIntersected]: TUnion extends any ? TUnion[TKey & keyof TUnion] : never;
|
||||
};
|
||||
export type MergeAll<TUnion> = MergeAllObjects<TUnion> | ExtractPrimitives<TUnion>;
|
||||
export type ValidateJSON<T> = ((...args: Array<any>) => any) extends T ? unknown extends T ? never : 'Function is not serializable' : {
|
||||
[K in keyof T]: ValidateJSON<T[K]>;
|
||||
};
|
||||
export declare function last<T>(arr: Array<T>): T | undefined;
|
||||
export declare function functionalUpdate<TPrevious, TResult = TPrevious>(updater: Updater<TPrevious, TResult> | NonNullableUpdater<TPrevious, TResult>, previous: TPrevious): TResult;
|
||||
export declare function pick<TValue, TKey extends keyof TValue>(parent: TValue, keys: Array<TKey>): Pick<TValue, TKey>;
|
||||
/**
|
||||
* This function returns `prev` if `_next` is deeply equal.
|
||||
* If not, it will replace any deeply equal children of `b` with those of `a`.
|
||||
* This can be used for structural sharing between immutable JSON values for example.
|
||||
* Do not use this with signals
|
||||
*/
|
||||
export declare function replaceEqualDeep<T>(prev: any, _next: T): T;
|
||||
export declare function isPlainObject(o: any): boolean;
|
||||
export declare function isPlainArray(value: unknown): value is Array<unknown>;
|
||||
export declare function deepEqual(a: any, b: any, opts?: {
|
||||
partial?: boolean;
|
||||
ignoreUndefined?: boolean;
|
||||
}): boolean;
|
||||
export type StringLiteral<T> = T extends string ? string extends T ? string : T : never;
|
||||
export type ThrowOrOptional<T, TThrow extends boolean> = TThrow extends true ? T : T | undefined;
|
||||
export type StrictOrFrom<TRouter extends AnyRouter, TFrom, TStrict extends boolean = true> = TStrict extends false ? {
|
||||
from?: never;
|
||||
strict: TStrict;
|
||||
} : {
|
||||
from: ConstrainLiteral<TFrom, RouteIds<TRouter['routeTree']>>;
|
||||
strict?: TStrict;
|
||||
};
|
||||
export type ThrowConstraint<TStrict extends boolean, TThrow extends boolean> = TStrict extends false ? (TThrow extends true ? never : TThrow) : TThrow;
|
||||
export type ControlledPromise<T> = Promise<T> & {
|
||||
resolve: (value: T) => void;
|
||||
reject: (value: any) => void;
|
||||
status: 'pending' | 'resolved' | 'rejected';
|
||||
value?: T;
|
||||
};
|
||||
export declare function createControlledPromise<T>(onResolve?: (value: T) => void): ControlledPromise<T>;
|
||||
/**
|
||||
*
|
||||
* @deprecated use `jsesc` instead
|
||||
*/
|
||||
export declare function escapeJSON(jsonString: string): string;
|
||||
export declare function shallow<T>(objA: T, objB: T): boolean;
|
||||
/**
|
||||
* Checks if a string contains URI-encoded special characters (e.g., %3F, %20).
|
||||
*
|
||||
* @param {string} inputString The string to check.
|
||||
* @returns {boolean} True if the string contains URI-encoded characters, false otherwise.
|
||||
* @example
|
||||
* ```typescript
|
||||
* const str1 = "foo%3Fbar";
|
||||
* const hasEncodedChars = hasUriEncodedChars(str1); // returns true
|
||||
* ```
|
||||
*/
|
||||
export declare function hasUriEncodedChars(inputString: string): boolean;
|
||||
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||
const React = require("react");
|
||||
function _interopNamespaceDefault(e) {
|
||||
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
||||
if (e) {
|
||||
for (const k in e) {
|
||||
if (k !== "default") {
|
||||
const d = Object.getOwnPropertyDescriptor(e, k);
|
||||
Object.defineProperty(n, k, d.get ? d : {
|
||||
enumerable: true,
|
||||
get: () => e[k]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
n.default = e;
|
||||
return Object.freeze(n);
|
||||
}
|
||||
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
||||
const matchContext = React__namespace.createContext(void 0);
|
||||
const dummyMatchContext = React__namespace.createContext(
|
||||
void 0
|
||||
);
|
||||
exports.dummyMatchContext = dummyMatchContext;
|
||||
exports.matchContext = matchContext;
|
||||
//# sourceMappingURL=matchContext.cjs.map
|
||||
Reference in New Issue
Block a user