@tamagui/create-context 1.128.1 → 1.129.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/create-context",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.129.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@tamagui/build": "1.
|
|
36
|
+
"@tamagui/build": "1.129.0",
|
|
37
37
|
"react": "*"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
@@ -1,11 +1,22 @@
|
|
|
1
|
+
// from radix
|
|
2
|
+
// https://github.com/radix-ui/primitives/blob/main/packages/react/context/src/createContext.tsx
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
export type ScopedProps<
|
|
3
5
|
P,
|
|
4
6
|
K extends string
|
|
5
7
|
> = P & { [Key in `__scope${K}`]? : Scope };
|
|
6
|
-
export declare function createContext<ContextValueType extends object | null>(rootComponentName: string, defaultContext?: ContextValueType): readonly [(props: ContextValueType & {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
export declare function createContext<ContextValueType extends object | null>(rootComponentName: string, defaultContext?: ContextValueType): readonly [(props: ContextValueType & {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}) => JSX.Element, (consumerName: string) => Exclude<ContextValueType | undefined, undefined>];
|
|
11
|
+
/* -------------------------------------------------------------------------------------------------
|
|
12
|
+
* createContextScope
|
|
13
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
14
|
+
type ScopeHook = (scope: Scope) => {
|
|
15
|
+
[__scopeProp: string]: Scope;
|
|
16
|
+
};
|
|
17
|
+
export type Scope<C = any> = {
|
|
18
|
+
[scopeName: string]: React.Context<C>[];
|
|
19
|
+
} | undefined;
|
|
9
20
|
export interface CreateScope {
|
|
10
21
|
scopeName: string;
|
|
11
22
|
(): ScopeHook;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "AAGA,YAAY,WAAW,OAAO;AAE9B,YAAY;CAAY;CAAG;IAAoB,OAAO,iBAAiB,QAAO;AAE9E,OAAO,iBAAS,cAAc,
|
|
2
|
+
"mappings": ";;AAGA,YAAY,WAAW,OAAO;AAE9B,YAAY;CAAY;CAAG;IAAoB,OAAO,iBAAiB,QAAO;AAE9E,OAAO,iBAAS,cAAc,wCAC5BA,2BACAC,iBAAiB,8BAEhBC,OAAO,mBAAmB;CAAE,UAAU,MAAM;AAAW,MAAK,IAAI,UAChEC,yBAAyB,QAAQ;;;;KA2B/B,aAAaC,OAAO,UAAU;wBAAyB;AAAO;AAEnE,YAAY,MAAM,WAAW;sBAAuB,MAAM,QAAQ;AAAM;AAExE,iBAAiB,YAAY;CAC3B;KACI;AACL;AAED,OAAO,iBAAS,mBACdC,mBACAC,yBAAwB,2BAEvB,wCACCN,2BACAC,iBAAiB,gCAGfM,OAAO,mBAAmB;CACxB,OAAO,MAAM;CACb,UAAU,MAAM;AACjB,aACS,qBAAqB,IAAI,UAEnCJ,sBACAK,OAAO,MAAM,+BACbC,UAAU;CACR;CACA,WAAW,QAAQ;AACpB,MACE,mBAEP",
|
|
3
3
|
"names": [
|
|
4
4
|
"rootComponentName: string",
|
|
5
5
|
"defaultContext?: ContextValueType",
|