@tamagui/core 1.0.0-alpha.13 → 1.0.0-alpha.17
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/dist/cjs/createTheme.js.map +2 -2
- package/dist/cjs/views/TextAncestorContext.js +6 -7
- package/dist/cjs/views/TextAncestorContext.js.map +2 -2
- package/dist/esm/createTheme.js.map +2 -2
- package/dist/esm/views/TextAncestorContext.js +7 -8
- package/dist/esm/views/TextAncestorContext.js.map +2 -2
- package/dist/jsx/views/TextAncestorContext.js +5 -5
- package/package.json +8 -7
- package/src/createTheme.ts +2 -1
- package/src/views/TextAncestorContext.tsx +5 -6
- package/types/createTheme.d.ts +1 -1
- package/types/createTheme.d.ts.map +1 -1
- package/types/views/TextAncestorContext.d.ts +3 -1
- package/types/views/TextAncestorContext.d.ts.map +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createTheme.ts"],
|
|
4
|
-
"sourcesContent": ["import { Variable, createVariable } from './createVariable'\n\nexport const createTheme = <Theme extends { [key: string]: string | Variable }>(\n theme: Theme\n): {\n [key in keyof Theme]: Variable\n} => {\n const res = {} as any\n for (const key in theme) {\n const val = theme[key]\n if (!(val instanceof Variable)) {\n res[key] = createVariable({\n name: key,\n val,\n })\n }\n }\n return res\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,4BAAyC;AAElC,MAAM,cAAc,wBACzB,
|
|
4
|
+
"sourcesContent": ["import { Variable, createVariable } from './createVariable'\n\nexport const createTheme = <Theme extends { [key: string]: string | Variable }>(\n theme: Theme\n): {\n // allow string | Variable\n [key in keyof Theme]: Variable | string\n} => {\n const res = {} as any\n for (const key in theme) {\n const val = theme[key]\n if (!(val instanceof Variable)) {\n res[key] = createVariable({\n name: key,\n val,\n })\n }\n }\n return res\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,4BAAyC;AAElC,MAAM,cAAc,wBACzB,UAIG;AACH,QAAM,MAAM;AACZ,aAAW,OAAO,OAAO;AACvB,UAAM,MAAM,MAAM;AAClB,QAAI,CAAE,gBAAe,iCAAW;AAC9B,UAAI,OAAO,0CAAe;AAAA,QACxB,MAAM;AAAA,QACN;AAAA;AAAA;AAAA;AAIN,SAAO;AAAA,GAhBkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -23,19 +23,18 @@ var __toModule = (module2) => {
|
|
|
23
23
|
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
24
24
|
};
|
|
25
25
|
__export(exports, {
|
|
26
|
+
FallbackNativeContext: () => FallbackNativeContext,
|
|
26
27
|
TextAncestorContext: () => TextAncestorContext,
|
|
27
28
|
TextAncestorProvider: () => TextAncestorProvider
|
|
28
29
|
});
|
|
29
30
|
var import_react = __toModule(require("react"));
|
|
30
31
|
var import_rnw = __toModule(require("../constants/rnw"));
|
|
31
32
|
var _a;
|
|
32
|
-
const
|
|
33
|
+
const FallbackNativeContext = (0, import_react.createContext)(false);
|
|
34
|
+
const TextAncestorContext = ((_a = import_rnw.rnw) == null ? void 0 : _a.TextAncestorContext) ?? FallbackNativeContext;
|
|
33
35
|
const TextAncestorProvider = /* @__PURE__ */ __name((props) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}, props.children);
|
|
38
|
-
}
|
|
39
|
-
return props.children;
|
|
36
|
+
return /* @__PURE__ */ import_react.default.createElement(TextAncestorContext.Provider, {
|
|
37
|
+
value: false
|
|
38
|
+
}, props.children);
|
|
40
39
|
}, "TextAncestorProvider");
|
|
41
40
|
//# sourceMappingURL=TextAncestorContext.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/TextAncestorContext.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react'\n\nimport { rnw } from '../constants/rnw'\n\nexport const TextAncestorContext = rnw?.TextAncestorContext\n\nexport const TextAncestorProvider = (props) => {\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["import React, { createContext } from 'react'\n\nimport { rnw } from '../constants/rnw'\n\nexport const FallbackNativeContext = createContext(false)\n\nexport const TextAncestorContext = rnw?.TextAncestorContext ?? FallbackNativeContext\n\nexport const TextAncestorProvider = (props) => {\n return <TextAncestorContext.Provider value={false}>{props.children}</TextAncestorContext.Provider>\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqC;AAErC,iBAAoB;AAFpB;AAIO,MAAM,wBAAwB,gCAAc;AAE5C,MAAM,sBAAsB,6CAAK,wBAAuB;AAExD,MAAM,uBAAuB,wBAAC,UAAU;AAC7C,SAAO,mDAAC,oBAAoB,UAArB;AAAA,IAA8B,OAAO;AAAA,KAAQ,MAAM;AAAA,GADxB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createTheme.ts"],
|
|
4
|
-
"sourcesContent": ["import { Variable, createVariable } from './createVariable'\n\nexport const createTheme = <Theme extends { [key: string]: string | Variable }>(\n theme: Theme\n): {\n [key in keyof Theme]: Variable\n} => {\n const res = {} as any\n for (const key in theme) {\n const val = theme[key]\n if (!(val instanceof Variable)) {\n res[key] = createVariable({\n name: key,\n val,\n })\n }\n }\n return res\n}\n"],
|
|
5
|
-
"mappings": ";;AAAA;AAEO,MAAM,cAAc,wBACzB,
|
|
4
|
+
"sourcesContent": ["import { Variable, createVariable } from './createVariable'\n\nexport const createTheme = <Theme extends { [key: string]: string | Variable }>(\n theme: Theme\n): {\n // allow string | Variable\n [key in keyof Theme]: Variable | string\n} => {\n const res = {} as any\n for (const key in theme) {\n const val = theme[key]\n if (!(val instanceof Variable)) {\n res[key] = createVariable({\n name: key,\n val,\n })\n }\n }\n return res\n}\n"],
|
|
5
|
+
"mappings": ";;AAAA;AAEO,MAAM,cAAc,wBACzB,UAIG;AACH,QAAM,MAAM;AACZ,aAAW,OAAO,OAAO;AACvB,UAAM,MAAM,MAAM;AAClB,QAAI,CAAE,gBAAe,WAAW;AAC9B,UAAI,OAAO,eAAe;AAAA,QACxB,MAAM;AAAA,QACN;AAAA;AAAA;AAAA;AAIN,SAAO;AAAA,GAhBkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import React from "react";
|
|
3
|
+
import React, { createContext } from "react";
|
|
4
4
|
import { rnw } from "../constants/rnw";
|
|
5
|
-
const
|
|
5
|
+
const FallbackNativeContext = createContext(false);
|
|
6
|
+
const TextAncestorContext = rnw?.TextAncestorContext ?? FallbackNativeContext;
|
|
6
7
|
const TextAncestorProvider = /* @__PURE__ */ __name((props) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}, props.children);
|
|
11
|
-
}
|
|
12
|
-
return props.children;
|
|
8
|
+
return /* @__PURE__ */ React.createElement(TextAncestorContext.Provider, {
|
|
9
|
+
value: false
|
|
10
|
+
}, props.children);
|
|
13
11
|
}, "TextAncestorProvider");
|
|
14
12
|
export {
|
|
13
|
+
FallbackNativeContext,
|
|
15
14
|
TextAncestorContext,
|
|
16
15
|
TextAncestorProvider
|
|
17
16
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/TextAncestorContext.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react'\n\nimport { rnw } from '../constants/rnw'\n\nexport const TextAncestorContext = rnw?.TextAncestorContext\n\nexport const TextAncestorProvider = (props) => {\n
|
|
5
|
-
"mappings": ";;AAAA;AAEA;AAEO,MAAM,sBAAsB,KAAK;
|
|
4
|
+
"sourcesContent": ["import React, { createContext } from 'react'\n\nimport { rnw } from '../constants/rnw'\n\nexport const FallbackNativeContext = createContext(false)\n\nexport const TextAncestorContext = rnw?.TextAncestorContext ?? FallbackNativeContext\n\nexport const TextAncestorProvider = (props) => {\n return <TextAncestorContext.Provider value={false}>{props.children}</TextAncestorContext.Provider>\n}\n"],
|
|
5
|
+
"mappings": ";;AAAA;AAEA;AAEO,MAAM,wBAAwB,cAAc;AAE5C,MAAM,sBAAsB,KAAK,uBAAuB;AAExD,MAAM,uBAAuB,wBAAC,UAAU;AAC7C,SAAO,oCAAC,oBAAoB,UAArB;AAAA,IAA8B,OAAO;AAAA,KAAQ,MAAM;AAAA,GADxB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { createContext } from "react";
|
|
3
4
|
import { rnw } from "../constants/rnw";
|
|
4
|
-
const
|
|
5
|
+
const FallbackNativeContext = createContext(false);
|
|
6
|
+
const TextAncestorContext = rnw?.TextAncestorContext ?? FallbackNativeContext;
|
|
5
7
|
const TextAncestorProvider = /* @__PURE__ */ __name((props) => {
|
|
6
|
-
|
|
7
|
-
return <TextAncestorContext.Provider value={false}>{props.children}</TextAncestorContext.Provider>;
|
|
8
|
-
}
|
|
9
|
-
return props.children;
|
|
8
|
+
return <TextAncestorContext.Provider value={false}>{props.children}</TextAncestorContext.Provider>;
|
|
10
9
|
}, "TextAncestorProvider");
|
|
11
10
|
export {
|
|
11
|
+
FallbackNativeContext,
|
|
12
12
|
TextAncestorContext,
|
|
13
13
|
TextAncestorProvider
|
|
14
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.17",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"src"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@tamagui/helpers": "^1.0.0-alpha.
|
|
18
|
+
"@tamagui/helpers": "^1.0.0-alpha.17",
|
|
19
19
|
"@tamagui/ow": "^0.28.1",
|
|
20
|
-
"@tamagui/use-debounce": "^1.0.0-alpha.
|
|
21
|
-
"@tamagui/use-force-update": "^1.0.0-alpha.
|
|
20
|
+
"@tamagui/use-debounce": "^1.0.0-alpha.17",
|
|
21
|
+
"@tamagui/use-force-update": "^1.0.0-alpha.17",
|
|
22
22
|
"react": "*",
|
|
23
23
|
"react-dom": "*"
|
|
24
24
|
},
|
|
@@ -26,9 +26,10 @@
|
|
|
26
26
|
"react-native-web": "*"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@tamagui/build": "^1.0.0-alpha.
|
|
29
|
+
"@tamagui/build": "^1.0.0-alpha.17",
|
|
30
30
|
"@types/react": "^17.0.35",
|
|
31
|
-
"esbuild": "^0.
|
|
31
|
+
"esbuild": "^0.13.12",
|
|
32
|
+
"react-native-web": "^0.17.5",
|
|
32
33
|
"typescript": "^4.4.4"
|
|
33
34
|
},
|
|
34
35
|
"publishConfig": {
|
|
@@ -37,5 +38,5 @@
|
|
|
37
38
|
"engines": {
|
|
38
39
|
"node": ">=16"
|
|
39
40
|
},
|
|
40
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "af7a3c3e6d1da0e4a6f8636915fed3117448dffb"
|
|
41
42
|
}
|
package/src/createTheme.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { Variable, createVariable } from './createVariable'
|
|
|
3
3
|
export const createTheme = <Theme extends { [key: string]: string | Variable }>(
|
|
4
4
|
theme: Theme
|
|
5
5
|
): {
|
|
6
|
-
|
|
6
|
+
// allow string | Variable
|
|
7
|
+
[key in keyof Theme]: Variable | string
|
|
7
8
|
} => {
|
|
8
9
|
const res = {} as any
|
|
9
10
|
for (const key in theme) {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { createContext } from 'react'
|
|
2
2
|
|
|
3
3
|
import { rnw } from '../constants/rnw'
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const FallbackNativeContext = createContext(false)
|
|
6
|
+
|
|
7
|
+
export const TextAncestorContext = rnw?.TextAncestorContext ?? FallbackNativeContext
|
|
6
8
|
|
|
7
9
|
export const TextAncestorProvider = (props) => {
|
|
8
|
-
|
|
9
|
-
return <TextAncestorContext.Provider value={false}>{props.children}</TextAncestorContext.Provider>
|
|
10
|
-
}
|
|
11
|
-
return props.children
|
|
10
|
+
return <TextAncestorContext.Provider value={false}>{props.children}</TextAncestorContext.Provider>
|
|
12
11
|
}
|
package/types/createTheme.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Variable } from './createVariable';
|
|
2
2
|
export declare const createTheme: <Theme extends {
|
|
3
3
|
[key: string]: string | Variable;
|
|
4
|
-
}>(theme: Theme) => { [key in keyof Theme]: Variable; };
|
|
4
|
+
}>(theme: Theme) => { [key in keyof Theme]: string | Variable; };
|
|
5
5
|
//# sourceMappingURL=createTheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTheme.d.ts","sourceRoot":"","sources":["../src/createTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,kBAAkB,CAAA;AAE3D,eAAO,MAAM,WAAW;;
|
|
1
|
+
{"version":3,"file":"createTheme.d.ts","sourceRoot":"","sources":["../src/createTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,kBAAkB,CAAA;AAE3D,eAAO,MAAM,WAAW;;gEAiBvB,CAAA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const FallbackNativeContext: React.Context<boolean>;
|
|
1
3
|
export declare const TextAncestorContext: any;
|
|
2
|
-
export declare const TextAncestorProvider: (props: any) =>
|
|
4
|
+
export declare const TextAncestorProvider: (props: any) => JSX.Element;
|
|
3
5
|
//# sourceMappingURL=TextAncestorContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextAncestorContext.d.ts","sourceRoot":"","sources":["../../src/views/TextAncestorContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextAncestorContext.d.ts","sourceRoot":"","sources":["../../src/views/TextAncestorContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAI5C,eAAO,MAAM,qBAAqB,wBAAuB,CAAA;AAEzD,eAAO,MAAM,mBAAmB,KAAoD,CAAA;AAEpF,eAAO,MAAM,oBAAoB,6BAEhC,CAAA"}
|