node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

13
server/node_modules/@radix-ui/react-context/README.md generated vendored Normal file
View File

@@ -0,0 +1,13 @@
# `react-context`
## Installation
```sh
$ yarn add @radix-ui/react-context
# or
$ npm install @radix-ui/react-context
```
## Usage
This is an internal utility, not intended for public usage.

View File

@@ -0,0 +1,26 @@
import * as React from "react";
export function createContext<ContextValueType extends object | null>(rootComponentName: string, defaultContext?: ContextValueType): readonly [{
(props: ContextValueType & {
children: React.ReactNode;
}): JSX.Element;
displayName: string;
}, (consumerName: string) => ContextValueType];
export type Scope<C = any> = {
[scopeName: string]: React.Context<C>[];
} | undefined;
type ScopeHook = (scope: Scope) => {
[__scopeProp: string]: Scope;
};
export interface CreateScope {
scopeName: string;
(): ScopeHook;
}
export function createContextScope(scopeName: string, createContextScopeDeps?: CreateScope[]): readonly [<ContextValueType extends object | null>(rootComponentName: string, defaultContext?: ContextValueType | undefined) => readonly [{
(props: ContextValueType & {
scope: Scope<ContextValueType>;
children: React.ReactNode;
}): JSX.Element;
displayName: string;
}, (consumerName: string, scope: Scope<ContextValueType | undefined>) => ContextValueType], CreateScope];
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,26 @@
import * as React from "react";
export function createContext<ContextValueType extends object | null>(rootComponentName: string, defaultContext?: ContextValueType): readonly [{
(props: ContextValueType & {
children: React.ReactNode;
}): JSX.Element;
displayName: string;
}, (consumerName: string) => ContextValueType];
export type Scope<C = any> = {
[scopeName: string]: React.Context<C>[];
} | undefined;
type ScopeHook = (scope: Scope) => {
[__scopeProp: string]: Scope;
};
export interface CreateScope {
scopeName: string;
(): ScopeHook;
}
export function createContextScope(scopeName: string, createContextScopeDeps?: CreateScope[]): readonly [<ContextValueType extends object | null>(rootComponentName: string, defaultContext?: ContextValueType | undefined) => readonly [{
(props: ContextValueType & {
scope: Scope<ContextValueType>;
children: React.ReactNode;
}): JSX.Element;
displayName: string;
}, (consumerName: string, scope: Scope<ContextValueType | undefined>) => ContextValueType], CreateScope];
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"mappings":";AAEA,8BAAuB,gBAAgB,SAAS,MAAM,GAAG,IAAI,EAC3D,iBAAiB,EAAE,MAAM,EACzB,cAAc,CAAC,EAAE,gBAAgB;YAIR,gBAAgB,GAAG;QAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;KAAE;;kBAQvC,MAAM,uBAUzC;AAMD,kBAAW,CAAC,GAAG,GAAG,IAAI;IAAE,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,CAAA;CAAE,GAAG,SAAS,CAAC;AAC9E,iBAAiB,CAAC,KAAK,EAAE,KAAK,KAAK;IAAE,CAAC,WAAW,EAAE,MAAM,GAAG,KAAK,CAAA;CAAE,CAAC;AACpE;IACE,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,SAAS,CAAC;CACf;AAED,mCAA4B,SAAS,EAAE,MAAM,EAAE,sBAAsB,GAAE,WAAW,EAAO,yEAQlE,MAAM;;;kBAQ+C,MAAM,SAAS;;;kBAUrD,MAAM,iFAgC3C","sources":["packages/react/context/src/packages/react/context/src/createContext.tsx","packages/react/context/src/packages/react/context/src/index.ts","packages/react/context/src/index.ts"],"sourcesContent":[null,null,"export { createContext, createContextScope } from './createContext';\nexport type { CreateScope, Scope } from './createContext';\n"],"names":[],"version":3,"file":"index.d.ts.map"}

View File

@@ -0,0 +1,133 @@
var $4O1Ne$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "createContext", () => $dec3cc0142d4f286$export$fd42f52fd3ae1109);
$parcel$export(module.exports, "createContextScope", () => $dec3cc0142d4f286$export$50c7b4e9d9f19c1);
function $dec3cc0142d4f286$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
const Context = /*#__PURE__*/ $4O1Ne$react.createContext(defaultContext);
function Provider(props) {
const { children: children , ...context } = props; // Only re-memoize when prop values change
// eslint-disable-next-line react-hooks/exhaustive-deps
const value = $4O1Ne$react.useMemo(()=>context
, Object.values(context));
return /*#__PURE__*/ $4O1Ne$react.createElement(Context.Provider, {
value: value
}, children);
}
function useContext(consumerName) {
const context = $4O1Ne$react.useContext(Context);
if (context) return context;
if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
}
Provider.displayName = rootComponentName + 'Provider';
return [
Provider,
useContext
];
}
/* -------------------------------------------------------------------------------------------------
* createContextScope
* -----------------------------------------------------------------------------------------------*/ function $dec3cc0142d4f286$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
let defaultContexts = [];
/* -----------------------------------------------------------------------------------------------
* createContext
* ---------------------------------------------------------------------------------------------*/ function $dec3cc0142d4f286$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
const BaseContext = /*#__PURE__*/ $4O1Ne$react.createContext(defaultContext);
const index = defaultContexts.length;
defaultContexts = [
...defaultContexts,
defaultContext
];
function Provider(props) {
const { scope: scope , children: children , ...context } = props;
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
// eslint-disable-next-line react-hooks/exhaustive-deps
const value = $4O1Ne$react.useMemo(()=>context
, Object.values(context));
return /*#__PURE__*/ $4O1Ne$react.createElement(Context.Provider, {
value: value
}, children);
}
function useContext(consumerName, scope) {
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
const context = $4O1Ne$react.useContext(Context);
if (context) return context;
if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
}
Provider.displayName = rootComponentName + 'Provider';
return [
Provider,
useContext
];
}
/* -----------------------------------------------------------------------------------------------
* createScope
* ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
const scopeContexts = defaultContexts.map((defaultContext)=>{
return /*#__PURE__*/ $4O1Ne$react.createContext(defaultContext);
});
return function useScope(scope) {
const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
return $4O1Ne$react.useMemo(()=>({
[`__scope${scopeName}`]: {
...scope,
[scopeName]: contexts
}
})
, [
scope,
contexts
]);
};
};
createScope.scopeName = scopeName;
return [
$dec3cc0142d4f286$export$fd42f52fd3ae1109,
$dec3cc0142d4f286$var$composeContextScopes(createScope, ...createContextScopeDeps)
];
}
/* -------------------------------------------------------------------------------------------------
* composeContextScopes
* -----------------------------------------------------------------------------------------------*/ function $dec3cc0142d4f286$var$composeContextScopes(...scopes) {
const baseScope = scopes[0];
if (scopes.length === 1) return baseScope;
const createScope1 = ()=>{
const scopeHooks = scopes.map((createScope)=>({
useScope: createScope(),
scopeName: createScope.scopeName
})
);
return function useComposedScopes(overrideScopes) {
const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{
// We are calling a hook inside a callback which React warns against to avoid inconsistent
// renders, however, scoping doesn't have render side effects so we ignore the rule.
// eslint-disable-next-line react-hooks/rules-of-hooks
const scopeProps = useScope(overrideScopes);
const currentScope = scopeProps[`__scope${scopeName}`];
return {
...nextScopes,
...currentScope
};
}, {});
return $4O1Ne$react.useMemo(()=>({
[`__scope${baseScope.scopeName}`]: nextScopes1
})
, [
nextScopes1
]);
};
};
createScope1.scopeName = baseScope.scopeName;
return createScope1;
}
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,128 @@
import {createContext as $3bkAK$createContext, useMemo as $3bkAK$useMemo, createElement as $3bkAK$createElement, useContext as $3bkAK$useContext} from "react";
function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
const Context = /*#__PURE__*/ $3bkAK$createContext(defaultContext);
function Provider(props) {
const { children: children , ...context } = props; // Only re-memoize when prop values change
// eslint-disable-next-line react-hooks/exhaustive-deps
const value = $3bkAK$useMemo(()=>context
, Object.values(context));
return /*#__PURE__*/ $3bkAK$createElement(Context.Provider, {
value: value
}, children);
}
function useContext(consumerName) {
const context = $3bkAK$useContext(Context);
if (context) return context;
if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
}
Provider.displayName = rootComponentName + 'Provider';
return [
Provider,
useContext
];
}
/* -------------------------------------------------------------------------------------------------
* createContextScope
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
let defaultContexts = [];
/* -----------------------------------------------------------------------------------------------
* createContext
* ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
const BaseContext = /*#__PURE__*/ $3bkAK$createContext(defaultContext);
const index = defaultContexts.length;
defaultContexts = [
...defaultContexts,
defaultContext
];
function Provider(props) {
const { scope: scope , children: children , ...context } = props;
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
// eslint-disable-next-line react-hooks/exhaustive-deps
const value = $3bkAK$useMemo(()=>context
, Object.values(context));
return /*#__PURE__*/ $3bkAK$createElement(Context.Provider, {
value: value
}, children);
}
function useContext(consumerName, scope) {
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
const context = $3bkAK$useContext(Context);
if (context) return context;
if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
}
Provider.displayName = rootComponentName + 'Provider';
return [
Provider,
useContext
];
}
/* -----------------------------------------------------------------------------------------------
* createScope
* ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
const scopeContexts = defaultContexts.map((defaultContext)=>{
return /*#__PURE__*/ $3bkAK$createContext(defaultContext);
});
return function useScope(scope) {
const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
return $3bkAK$useMemo(()=>({
[`__scope${scopeName}`]: {
...scope,
[scopeName]: contexts
}
})
, [
scope,
contexts
]);
};
};
createScope.scopeName = scopeName;
return [
$c512c27ab02ef895$export$fd42f52fd3ae1109,
$c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
];
}
/* -------------------------------------------------------------------------------------------------
* composeContextScopes
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
const baseScope = scopes[0];
if (scopes.length === 1) return baseScope;
const createScope1 = ()=>{
const scopeHooks = scopes.map((createScope)=>({
useScope: createScope(),
scopeName: createScope.scopeName
})
);
return function useComposedScopes(overrideScopes) {
const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{
// We are calling a hook inside a callback which React warns against to avoid inconsistent
// renders, however, scoping doesn't have render side effects so we ignore the rule.
// eslint-disable-next-line react-hooks/rules-of-hooks
const scopeProps = useScope(overrideScopes);
const currentScope = scopeProps[`__scope${scopeName}`];
return {
...nextScopes,
...currentScope
};
}, {});
return $3bkAK$useMemo(()=>({
[`__scope${baseScope.scopeName}`]: nextScopes1
})
, [
nextScopes1
]);
};
};
createScope1.scopeName = baseScope.scopeName;
return createScope1;
}
export {$c512c27ab02ef895$export$fd42f52fd3ae1109 as createContext, $c512c27ab02ef895$export$50c7b4e9d9f19c1 as createContextScope};
//# sourceMappingURL=index.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,50 @@
{
"name": "@radix-ui/react-context",
"version": "1.0.1",
"license": "MIT",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"scripts": {
"clean": "rm -rf dist",
"version": "yarn version"
},
"peerDependencies": {
"@types/react": "*",
"react": "^16.8 || ^17.0 || ^18.0"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"dependencies": {
"@babel/runtime": "^7.13.10"
}
}