@tamagui/core 1.0.1-rc.8 → 1.0.1-rc.9
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/Pressability.js +32 -0
- package/dist/cjs/Pressability.js.map +7 -0
- package/dist/cjs/Pressability.native.js +32 -0
- package/dist/cjs/Pressability.native.js.map +7 -0
- package/dist/cjs/ThemeContext.js +30 -0
- package/dist/cjs/ThemeContext.js.map +7 -0
- package/dist/cjs/ThemeManager.js +211 -0
- package/dist/cjs/ThemeManager.js.map +7 -0
- package/dist/cjs/conf.js +70 -0
- package/dist/cjs/conf.js.map +7 -0
- package/dist/cjs/constants/platform.js +4 -10
- package/dist/cjs/constants/platform.js.map +2 -2
- package/dist/cjs/constants/rnw.native.js +28 -0
- package/dist/cjs/constants/rnw.native.js.map +7 -0
- package/dist/cjs/contexts/ButtonInsideButtonContext.js.map +1 -1
- package/dist/cjs/createTamagui.js +2 -0
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/defaultComponentState.js +2 -0
- package/dist/cjs/defaultComponentState.js.map +7 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +1 -1
- package/dist/cjs/helpers/calc.js.map +2 -2
- package/dist/cjs/helpers/createShallowUpdate.js +9 -12
- package/dist/cjs/helpers/createShallowUpdate.js.map +1 -1
- package/dist/cjs/helpers/createTamaguiProvider.js +65 -0
- package/dist/cjs/helpers/createTamaguiProvider.js.map +7 -0
- package/dist/cjs/helpers/cssHash.js +51 -0
- package/dist/cjs/helpers/cssHash.js.map +7 -0
- package/dist/cjs/helpers/expandStyle.test.js +10 -0
- package/dist/cjs/helpers/expandStyle.test.js.map +7 -0
- package/dist/cjs/helpers/getFont.js +2 -6
- package/dist/cjs/helpers/getFont.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +14 -9
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStackSize.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.js +60 -27
- package/dist/cjs/helpers/insertStyleRule.js.map +3 -3
- package/dist/cjs/helpers/nativeGestureHandler.native.js +19 -0
- package/dist/cjs/helpers/nativeGestureHandler.native.js.map +7 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.js +3 -3
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +2 -2
- package/dist/cjs/helpers/startTransition.js +1 -4
- package/dist/cjs/helpers/startTransition.js.map +2 -2
- package/dist/cjs/helpers/themeable.js +2 -2
- package/dist/cjs/helpers/themeable.js.map +2 -2
- package/dist/cjs/helpers/wrapThemeManagerContext.js +37 -0
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +7 -0
- package/dist/cjs/hooks/useConstant.js +0 -3
- package/dist/cjs/hooks/useConstant.js.map +2 -2
- package/dist/cjs/hooks/useElementLayout.js +1 -1
- package/dist/cjs/hooks/useElementLayout.js.map +2 -2
- package/dist/cjs/hooks/useFeatures.js +201 -0
- package/dist/cjs/hooks/useFeatures.js.map +7 -0
- package/dist/cjs/hooks/useIsMounted.js.map +1 -1
- package/dist/cjs/hooks/useIsSSR.js +6 -10
- package/dist/cjs/hooks/useIsSSR.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +5 -0
- package/dist/cjs/hooks/useMedia.js.map +2 -2
- package/dist/cjs/hooks/usePressable.js.map +1 -1
- package/dist/cjs/hooks/usePrevious.js +1 -0
- package/dist/cjs/hooks/usePrevious.js.map +7 -0
- package/dist/cjs/hooks/useUnmountEffect.js.map +1 -1
- package/dist/cjs/styled.js +12 -0
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/views/TextAncestorContext.js +44 -0
- package/dist/cjs/views/TextAncestorContext.js.map +7 -0
- package/dist/cjs/views/ThemeInverse.js +20 -21
- package/dist/cjs/views/ThemeInverse.js.map +2 -2
- package/dist/cjs/views/ThemeReset.js +5 -10
- package/dist/cjs/views/ThemeReset.js.map +3 -3
- package/dist/esm/Pressability.js +7 -0
- package/dist/esm/Pressability.js.map +7 -0
- package/dist/esm/Pressability.native.js +7 -0
- package/dist/esm/Pressability.native.js.map +7 -0
- package/dist/esm/ThemeContext.js +6 -0
- package/dist/esm/ThemeContext.js.map +7 -0
- package/dist/esm/ThemeManager.js +185 -0
- package/dist/esm/ThemeManager.js.map +7 -0
- package/dist/esm/conf.js +39 -0
- package/dist/esm/conf.js.map +7 -0
- package/dist/esm/constants/platform.js +3 -7
- package/dist/esm/constants/platform.js.map +2 -2
- package/dist/esm/constants/rnw.native.js +5 -0
- package/dist/esm/constants/rnw.native.js.map +7 -0
- package/dist/esm/contexts/ButtonInsideButtonContext.js.map +1 -1
- package/dist/esm/createTamagui.js +7 -1
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/defaultComponentState.js +1 -0
- package/dist/esm/defaultComponentState.js.map +7 -0
- package/dist/esm/helpers/assignNativePropsToWeb.js.map +1 -1
- package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +1 -1
- package/dist/esm/helpers/calc.js.map +2 -2
- package/dist/esm/helpers/createShallowUpdate.js +9 -12
- package/dist/esm/helpers/createShallowUpdate.js.map +1 -1
- package/dist/esm/helpers/createTamaguiProvider.js +38 -0
- package/dist/esm/helpers/createTamaguiProvider.js.map +7 -0
- package/dist/esm/helpers/cssHash.js +27 -0
- package/dist/esm/helpers/cssHash.js.map +7 -0
- package/dist/esm/helpers/expandStyle.test.js +9 -0
- package/dist/esm/helpers/expandStyle.test.js.map +7 -0
- package/dist/esm/helpers/getFont.js +2 -6
- package/dist/esm/helpers/getFont.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +16 -10
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getStackSize.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.js +58 -26
- package/dist/esm/helpers/insertStyleRule.js.map +3 -3
- package/dist/esm/helpers/nativeGestureHandler.native.js +2 -0
- package/dist/esm/helpers/nativeGestureHandler.native.js.map +7 -0
- package/dist/esm/helpers/normalizeValueWithProperty.js +3 -3
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +2 -2
- package/dist/esm/helpers/startTransition.js.map +1 -1
- package/dist/esm/helpers/themeable.js +2 -2
- package/dist/esm/helpers/themeable.js.map +2 -2
- package/dist/esm/helpers/wrapThemeManagerContext.js +11 -0
- package/dist/esm/helpers/wrapThemeManagerContext.js.map +7 -0
- package/dist/esm/hooks/useConstant.js +1 -4
- package/dist/esm/hooks/useConstant.js.map +2 -2
- package/dist/esm/hooks/useElementLayout.js +1 -1
- package/dist/esm/hooks/useElementLayout.js.map +2 -2
- package/dist/esm/hooks/useFeatures.js +174 -0
- package/dist/esm/hooks/useFeatures.js.map +7 -0
- package/dist/esm/hooks/useIsMounted.js.map +1 -1
- package/dist/esm/hooks/useIsSSR.js +8 -12
- package/dist/esm/hooks/useIsSSR.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +4 -0
- package/dist/esm/hooks/useMedia.js.map +2 -2
- package/dist/esm/hooks/usePressable.js.map +1 -1
- package/dist/esm/hooks/usePrevious.js +1 -0
- package/dist/esm/hooks/usePrevious.js.map +7 -0
- package/dist/esm/hooks/useUnmountEffect.js.map +1 -1
- package/dist/esm/styled.js +12 -0
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/views/TextAncestorContext.js +15 -0
- package/dist/esm/views/TextAncestorContext.js.map +7 -0
- package/dist/esm/views/ThemeInverse.js +15 -20
- package/dist/esm/views/ThemeInverse.js.map +2 -2
- package/dist/esm/views/ThemeReset.js +4 -6
- package/dist/esm/views/ThemeReset.js.map +2 -2
- package/package.json +10 -11
- package/src/createTamagui.ts +8 -1
- package/src/helpers/getSplitStyles.tsx +17 -9
- package/src/helpers/insertStyleRule.tsx +70 -38
- package/src/helpers/normalizeValueWithProperty.ts +3 -3
- package/src/helpers/themeable.tsx +3 -3
- package/src/hooks/useElementLayout.tsx +1 -1
- package/src/hooks/useMedia.tsx +3 -0
- package/src/styled.tsx +15 -0
- package/types/helpers/insertStyleRule.d.ts +2 -1
- package/types/helpers/themeable.d.ts +1 -1
- package/types/hooks/useMedia.d.ts +1 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Pressability_exports = {};
|
|
20
|
+
__export(Pressability_exports, {
|
|
21
|
+
Pressability: () => Pressability,
|
|
22
|
+
usePressability: () => usePressability
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Pressability_exports);
|
|
25
|
+
const Pressability = {};
|
|
26
|
+
const usePressability = {};
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
Pressability,
|
|
30
|
+
usePressability
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=Pressability.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Pressability.tsx"],
|
|
4
|
+
"sourcesContent": ["export const Pressability = {} as any\nexport const usePressability = {} as Function\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,eAAe,CAAC;AACtB,MAAM,kBAAkB,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Pressability_native_exports = {};
|
|
20
|
+
__export(Pressability_native_exports, {
|
|
21
|
+
Pressability: () => Pressability,
|
|
22
|
+
usePressability: () => usePressability
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Pressability_native_exports);
|
|
25
|
+
const Pressability = require("react-native/Libraries/Pressability/Pressability").default;
|
|
26
|
+
const usePressability = require("react-native/Libraries/Pressability/usePressability").default;
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
Pressability,
|
|
30
|
+
usePressability
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=Pressability.native.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Pressability.native.tsx"],
|
|
4
|
+
"sourcesContent": ["export const Pressability = require('react-native/Libraries/Pressability/Pressability').default\nexport const usePressability =\n require('react-native/Libraries/Pressability/usePressability').default\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,eAAe,QAAQ,kDAAkD,EAAE;AACjF,MAAM,kBACX,QAAQ,qDAAqD,EAAE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var ThemeContext_exports = {};
|
|
20
|
+
__export(ThemeContext_exports, {
|
|
21
|
+
ThemeContext: () => ThemeContext
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(ThemeContext_exports);
|
|
24
|
+
var import_react = require("react");
|
|
25
|
+
const ThemeContext = (0, import_react.createContext)(null);
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
28
|
+
ThemeContext
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=ThemeContext.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/ThemeContext.tsx"],
|
|
4
|
+
"sourcesContent": ["import { createContext } from 'react'\n\nimport { ThemeName, Themes } from './types'\n\nexport const ThemeContext = createContext<{ themes: Themes; defaultTheme: ThemeName } | null>(null)\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8B;AAIvB,MAAM,eAAe,gCAAkE,IAAI;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var ThemeManager_exports = {};
|
|
20
|
+
__export(ThemeManager_exports, {
|
|
21
|
+
ThemeManager: () => ThemeManager,
|
|
22
|
+
ThemeManagerContext: () => ThemeManagerContext,
|
|
23
|
+
emptyManager: () => emptyManager
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(ThemeManager_exports);
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_conf = require("./conf");
|
|
28
|
+
var import_constants = require("./constants/constants");
|
|
29
|
+
var import_getThemeUnwrapped = require("./hooks/getThemeUnwrapped");
|
|
30
|
+
class ThemeManager {
|
|
31
|
+
constructor(name = "", theme = null, parentManager = null, reset = false) {
|
|
32
|
+
this.name = name;
|
|
33
|
+
this.theme = theme;
|
|
34
|
+
this.parentManager = parentManager;
|
|
35
|
+
this.reset = reset;
|
|
36
|
+
this.keys = /* @__PURE__ */ new Map();
|
|
37
|
+
this.listeners = /* @__PURE__ */ new Map();
|
|
38
|
+
this.themeListeners = /* @__PURE__ */ new Set();
|
|
39
|
+
this.className = null;
|
|
40
|
+
let parent = parentManager;
|
|
41
|
+
let tries = 0;
|
|
42
|
+
while (true) {
|
|
43
|
+
tries++;
|
|
44
|
+
if (tries > 10) {
|
|
45
|
+
throw new Error(`Nested 10 of the same theme in a row, likely error`);
|
|
46
|
+
}
|
|
47
|
+
if (!parent)
|
|
48
|
+
break;
|
|
49
|
+
if (parent.name === name) {
|
|
50
|
+
parent = parent.parentManager;
|
|
51
|
+
} else {
|
|
52
|
+
this.parentManager = parent;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
get didChangeTheme() {
|
|
58
|
+
return this.parentManager && this.name !== this.parentManager.fullName;
|
|
59
|
+
}
|
|
60
|
+
get parentName() {
|
|
61
|
+
var _a;
|
|
62
|
+
return ((_a = this.parentManager) == null ? void 0 : _a.name) || null;
|
|
63
|
+
}
|
|
64
|
+
get fullName() {
|
|
65
|
+
return this.getNextTheme().name || this.name || "";
|
|
66
|
+
}
|
|
67
|
+
getValue(key) {
|
|
68
|
+
let theme = this.theme;
|
|
69
|
+
let manager = this;
|
|
70
|
+
while (true) {
|
|
71
|
+
if (!theme)
|
|
72
|
+
return;
|
|
73
|
+
if (key in theme) {
|
|
74
|
+
return theme[key];
|
|
75
|
+
}
|
|
76
|
+
manager = this.parentManager;
|
|
77
|
+
if (!manager) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (manager.theme === theme) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
theme = manager.theme;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
update({ name, theme, className } = {}) {
|
|
87
|
+
const nameChanged = name !== this.name;
|
|
88
|
+
if (!nameChanged) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
this.className = className || null;
|
|
92
|
+
this.name = name || "";
|
|
93
|
+
this.theme = theme;
|
|
94
|
+
this.notifyListeners();
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
getNextTheme(props = {}, debug) {
|
|
98
|
+
var _a;
|
|
99
|
+
const { themes = (0, import_conf.getThemes)(), name, componentName } = props;
|
|
100
|
+
if (props.reset && name) {
|
|
101
|
+
return {
|
|
102
|
+
name,
|
|
103
|
+
theme: themes[name],
|
|
104
|
+
className: this.getClassName(name)
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const parentIsReset = (_a = this.parentManager) == null ? void 0 : _a.reset;
|
|
108
|
+
if (!name) {
|
|
109
|
+
if (componentName) {
|
|
110
|
+
const names = [
|
|
111
|
+
`${this.name}_${componentName}`,
|
|
112
|
+
`${withoutComponentName(this.name)}_${componentName}`
|
|
113
|
+
];
|
|
114
|
+
for (const name2 of names) {
|
|
115
|
+
if (name2 in themes) {
|
|
116
|
+
const className = this.getClassName(name2);
|
|
117
|
+
return { name: name2, theme: themes[name2], className };
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
name: this.name,
|
|
123
|
+
theme: this.theme
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
let nextName = name || this.name || "";
|
|
127
|
+
let parentName = parentIsReset ? this.parentName || this.fullName : this.fullName;
|
|
128
|
+
while (true) {
|
|
129
|
+
if (nextName in themes) {
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
nextName = `${parentName}_${name}`;
|
|
133
|
+
if (nextName in themes) {
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
if (!parentName.includes(import_constants.THEME_NAME_SEPARATOR)) {
|
|
137
|
+
console.warn("theme not found", name);
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
parentName = parentName.slice(0, parentName.lastIndexOf(import_constants.THEME_NAME_SEPARATOR));
|
|
141
|
+
}
|
|
142
|
+
if (componentName) {
|
|
143
|
+
const names = [
|
|
144
|
+
`${nextName}_${componentName}`,
|
|
145
|
+
`${withoutComponentName(nextName)}_${componentName}`
|
|
146
|
+
];
|
|
147
|
+
for (const name2 of names) {
|
|
148
|
+
if (name2 in themes) {
|
|
149
|
+
nextName = name2;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
let theme = themes[nextName];
|
|
154
|
+
if (!theme) {
|
|
155
|
+
theme = themes[`light_${nextName}`];
|
|
156
|
+
}
|
|
157
|
+
if (process.env.NODE_ENV === "development") {
|
|
158
|
+
if (debug) {
|
|
159
|
+
console.log("getNextTheme", this.getClassName(nextName), { props, nextName, parentName });
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
name: nextName,
|
|
164
|
+
theme: (0, import_getThemeUnwrapped.getThemeUnwrapped)(theme),
|
|
165
|
+
className: this.getClassName(nextName)
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
getClassName(name) {
|
|
169
|
+
return `${import_constants.THEME_CLASSNAME_PREFIX}${name} t_Theme`.replace("light_", "").replace("dark_", "");
|
|
170
|
+
}
|
|
171
|
+
track(uuid, keys) {
|
|
172
|
+
if (!this.name)
|
|
173
|
+
return;
|
|
174
|
+
this.keys.set(uuid, keys);
|
|
175
|
+
}
|
|
176
|
+
notifyListeners() {
|
|
177
|
+
var _a;
|
|
178
|
+
if (!this.name) {
|
|
179
|
+
this.keys.clear();
|
|
180
|
+
}
|
|
181
|
+
for (const [uuid, keys] of this.keys.entries()) {
|
|
182
|
+
if (keys.size) {
|
|
183
|
+
(_a = this.listeners.get(uuid)) == null ? void 0 : _a();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
this.themeListeners.forEach((cb) => cb(this.name, this));
|
|
187
|
+
}
|
|
188
|
+
onChangeTheme(cb) {
|
|
189
|
+
this.themeListeners.add(cb);
|
|
190
|
+
return () => {
|
|
191
|
+
this.themeListeners.delete(cb);
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
onUpdate(uuid, cb) {
|
|
195
|
+
this.listeners.set(uuid, cb);
|
|
196
|
+
return () => {
|
|
197
|
+
this.listeners.delete(uuid);
|
|
198
|
+
this.keys.delete(uuid);
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
const ThemeManagerContext = (0, import_react.createContext)(null);
|
|
203
|
+
const emptyManager = new ThemeManager();
|
|
204
|
+
const withoutComponentName = (name) => name.replace(/(\_[A-Z][a-zA-Z]+)+$/g, "");
|
|
205
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
206
|
+
0 && (module.exports = {
|
|
207
|
+
ThemeManager,
|
|
208
|
+
ThemeManagerContext,
|
|
209
|
+
emptyManager
|
|
210
|
+
});
|
|
211
|
+
//# sourceMappingURL=ThemeManager.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/ThemeManager.tsx"],
|
|
4
|
+
"sourcesContent": ["import { createContext } from 'react'\n\nimport { getThemes } from './conf'\nimport { THEME_CLASSNAME_PREFIX, THEME_NAME_SEPARATOR } from './constants/constants'\nimport { getThemeUnwrapped } from './hooks/getThemeUnwrapped'\nimport { ThemeObject, Themes } from './types'\n\ntype ThemeListener = (name: string | null, themeManager: ThemeManager) => void\n\nexport type SetActiveThemeProps = {\n className?: string\n parentManager?: ThemeManager | null\n name?: string | null\n theme?: any\n}\n\nexport type GetNextThemeProps = {\n themes?: Themes\n name?: string | null\n componentName?: string | null\n reset?: boolean\n}\n\nexport class ThemeManager {\n keys = new Map<any, Set<string>>()\n listeners = new Map<any, Function>()\n themeListeners = new Set<ThemeListener>()\n className: string | null = null\n\n constructor(\n public name: string = '',\n public theme: ThemeObject | null = null,\n public parentManager: ThemeManager | null = null,\n public reset: boolean = false\n ) {\n // find the nearest different parentManager\n let parent = parentManager\n let tries = 0\n while (true) {\n tries++\n if (tries > 10) {\n throw new Error(`Nested 10 of the same theme in a row, likely error`)\n }\n if (!parent) break\n if (parent.name === name) {\n // go up if same\n parent = parent.parentManager\n } else {\n this.parentManager = parent\n break\n }\n }\n }\n\n get didChangeTheme() {\n return this.parentManager && this.name !== this.parentManager.fullName\n }\n\n get parentName() {\n return this.parentManager?.name || null\n }\n\n get fullName(): string {\n return this.getNextTheme().name || this.name || ''\n // const parentName = this.parentManager?.fullName || ''\n // const name = this.name || ''\n // const parts = [...new Set([...`${parentName}_${name}`.split('_')])].filter(Boolean)\n // return parts.join('_')\n }\n\n // gets value going up to parents\n getValue(key: string) {\n let theme = this.theme\n let manager = this as ThemeManager | null\n while (true) {\n if (!theme) return\n if (key in theme) {\n return theme[key]\n }\n manager = this.parentManager\n if (!manager) {\n return\n }\n if (manager.theme === theme) {\n return\n }\n theme = manager.theme\n }\n }\n\n update({ name, theme, className }: SetActiveThemeProps = {}) {\n // className compare on web, avoids light/dark re-renders\n const nameChanged = name !== this.name\n if (!nameChanged) {\n return false\n }\n this.className = className || null\n this.name = name || ''\n this.theme = theme\n this.notifyListeners()\n return true\n }\n\n getNextTheme(props: GetNextThemeProps = {}, debug?: any) {\n const { themes = getThemes(), name, componentName } = props\n\n if (props.reset && name) {\n return {\n name: name,\n theme: themes[name],\n className: this.getClassName(name),\n }\n }\n\n const parentIsReset = this.parentManager?.reset\n\n if (!name) {\n if (componentName) {\n // allow for _Card_Button or just _Button\n const names = [\n `${this.name}_${componentName}`,\n `${withoutComponentName(this.name)}_${componentName}`,\n ]\n for (const name of names) {\n if (name in themes) {\n const className = this.getClassName(name)\n return { name, theme: themes[name], className }\n }\n }\n }\n return {\n name: this.name,\n theme: this.theme,\n }\n }\n\n let nextName = name || this.name || ''\n let parentName = parentIsReset ? this.parentName || this.fullName : this.fullName\n\n while (true) {\n if (nextName in themes) {\n break\n }\n nextName = `${parentName}_${name}`\n if (nextName in themes) {\n break\n }\n if (!parentName.includes(THEME_NAME_SEPARATOR)) {\n // not found!\n console.warn('theme not found', name)\n // this happens in next during _document.getInitialProps and has a terrible/non-existent stack trace\n // throw new Error(`Theme not found: ${name}`)\n break\n }\n // go up one\n parentName = parentName.slice(0, parentName.lastIndexOf(THEME_NAME_SEPARATOR))\n }\n\n if (componentName) {\n // allow for _Card_Button or just _Button\n const names = [\n `${nextName}_${componentName}`,\n `${withoutComponentName(nextName)}_${componentName}`,\n ]\n for (const name of names) {\n if (name in themes) {\n nextName = name\n }\n }\n }\n\n let theme = themes[nextName]\n if (!theme) {\n theme = themes[`light_${nextName}`]\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (debug) {\n console.log('getNextTheme', this.getClassName(nextName), { props, nextName, parentName })\n }\n }\n\n return {\n name: nextName,\n theme: getThemeUnwrapped(theme),\n className: this.getClassName(nextName),\n }\n }\n\n getClassName(name: string) {\n return `${THEME_CLASSNAME_PREFIX}${name} t_Theme`.replace('light_', '').replace('dark_', '')\n }\n\n track(uuid: any, keys: Set<string>) {\n if (!this.name) return\n this.keys.set(uuid, keys)\n }\n\n notifyListeners() {\n if (!this.name) {\n this.keys.clear()\n }\n for (const [uuid, keys] of this.keys.entries()) {\n if (keys.size) {\n this.listeners.get(uuid)?.()\n }\n }\n this.themeListeners.forEach((cb) => cb(this.name, this))\n }\n\n onChangeTheme(cb: ThemeListener) {\n this.themeListeners.add(cb)\n return () => {\n this.themeListeners.delete(cb)\n }\n }\n\n onUpdate(uuid: any, cb: Function) {\n this.listeners.set(uuid, cb)\n return () => {\n this.listeners.delete(uuid)\n this.keys.delete(uuid)\n }\n }\n}\n\nexport const ThemeManagerContext = createContext<ThemeManager | null>(null)\nexport const emptyManager = new ThemeManager()\n\nconst withoutComponentName = (name: string) => name.replace(/(\\_[A-Z][a-zA-Z]+)+$/g, '')\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8B;AAE9B,kBAA0B;AAC1B,uBAA6D;AAC7D,+BAAkC;AAmB3B,MAAM,aAAa;AAAA,EAMxB,YACS,OAAe,IACf,QAA4B,MAC5B,gBAAqC,MACrC,QAAiB,OACxB;AAJO;AACA;AACA;AACA;AATT,gBAAO,oBAAI,IAAsB;AACjC,qBAAY,oBAAI,IAAmB;AACnC,0BAAiB,oBAAI,IAAmB;AACxC,qBAA2B;AASzB,QAAI,SAAS;AACb,QAAI,QAAQ;AACZ,WAAO,MAAM;AACX;AACA,UAAI,QAAQ,IAAI;AACd,cAAM,IAAI,MAAM,oDAAoD;AAAA,MACtE;AACA,UAAI,CAAC;AAAQ;AACb,UAAI,OAAO,SAAS,MAAM;AAExB,iBAAS,OAAO;AAAA,MAClB,OAAO;AACL,aAAK,gBAAgB;AACrB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA,IAAI,iBAAiB;AACnB,WAAO,KAAK,iBAAiB,KAAK,SAAS,KAAK,cAAc;AAAA,EAChE;AAAA,EAEA,IAAI,aAAa;AA1DnB;AA2DI,WAAO,YAAK,kBAAL,mBAAoB,SAAQ;AAAA,EACrC;AAA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AAM;AAChB,SAAK,KAAK,IAAI,MAAM,IAAI;AAAA,EAC1B;AAAA,EAEA,kBAAkB;AAtMpB;AAuMI,QAAI,CAAC,KAAK,MAAM;AACd,WAAK,KAAK,MAAM;AAAA,IAClB;AACA,eAAW,CAAC,MAAM,SAAS,KAAK,KAAK,QAAQ,GAAG;AAC9C,UAAI,KAAK,MAAM;AACb,mBAAK,UAAU,IAAI,IAAI,MAAvB;AAAA,MACF;AAAA,IACF;AACA,SAAK,eAAe,QAAQ,CAAC,OAAO,GAAG,KAAK,MAAM,IAAI,CAAC;AAAA,EACzD;AAAA,EAEA,cAAc,IAAmB;AAC/B,SAAK,eAAe,IAAI,EAAE;AAC1B,WAAO,MAAM;AACX,WAAK,eAAe,OAAO,EAAE;AAAA,IAC/B;AAAA,EACF;AAAA,EAEA,SAAS,MAAW,IAAc;AAChC,SAAK,UAAU,IAAI,MAAM,EAAE;AAC3B,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,IAAI;AAC1B,WAAK,KAAK,OAAO,IAAI;AAAA,IACvB;AAAA,EACF;AACF;AAEO,MAAM,sBAAsB,gCAAmC,IAAI;AACnE,MAAM,eAAe,IAAI,aAAa;AAE7C,MAAM,uBAAuB,CAAC,SAAiB,KAAK,QAAQ,yBAAyB,EAAE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/cjs/conf.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var conf_exports = {};
|
|
20
|
+
__export(conf_exports, {
|
|
21
|
+
configListeners: () => configListeners,
|
|
22
|
+
getConfig: () => getConfig,
|
|
23
|
+
getHasConfigured: () => getHasConfigured,
|
|
24
|
+
getThemes: () => getThemes,
|
|
25
|
+
getTokens: () => getTokens,
|
|
26
|
+
onConfiguredOnce: () => onConfiguredOnce,
|
|
27
|
+
setConfig: () => setConfig,
|
|
28
|
+
setConfigFont: () => setConfigFont
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(conf_exports);
|
|
31
|
+
let conf;
|
|
32
|
+
const setConfig = (next) => {
|
|
33
|
+
conf = next;
|
|
34
|
+
if (configListeners.size) {
|
|
35
|
+
configListeners.forEach((cb) => cb(conf));
|
|
36
|
+
configListeners.clear();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const setConfigFont = (name, font, fontParsed) => {
|
|
40
|
+
if (process.env.NODE_ENV === "development") {
|
|
41
|
+
if (!conf)
|
|
42
|
+
throw new Error(`Haven't called createTamagui yet`);
|
|
43
|
+
}
|
|
44
|
+
Object.assign(conf.fonts, { [name]: font });
|
|
45
|
+
Object.assign(conf.fontsParsed, { [`$${name}`]: fontParsed });
|
|
46
|
+
};
|
|
47
|
+
const getHasConfigured = () => !!conf;
|
|
48
|
+
const getConfig = () => conf;
|
|
49
|
+
const getTokens = () => conf.tokensParsed;
|
|
50
|
+
const getThemes = () => conf.themes;
|
|
51
|
+
const configListeners = /* @__PURE__ */ new Set();
|
|
52
|
+
const onConfiguredOnce = (cb) => {
|
|
53
|
+
if (conf) {
|
|
54
|
+
cb(conf);
|
|
55
|
+
} else {
|
|
56
|
+
configListeners.add(cb);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
configListeners,
|
|
62
|
+
getConfig,
|
|
63
|
+
getHasConfigured,
|
|
64
|
+
getThemes,
|
|
65
|
+
getTokens,
|
|
66
|
+
onConfiguredOnce,
|
|
67
|
+
setConfig,
|
|
68
|
+
setConfigFont
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=conf.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/conf.ts"],
|
|
4
|
+
"sourcesContent": ["import { ConfigListener, TamaguiInternalConfig } from './types'\n\nlet conf: TamaguiInternalConfig | null\n\nexport const setConfig = (next: TamaguiInternalConfig) => {\n conf = next\n if (configListeners.size) {\n configListeners.forEach((cb) => cb(conf!))\n configListeners.clear()\n }\n}\n\nexport const setConfigFont = (name: string, font: any, fontParsed: any) => {\n if (process.env.NODE_ENV === 'development') {\n if (!conf) throw new Error(`Haven't called createTamagui yet`)\n }\n Object.assign(conf!.fonts, { [name]: font })\n Object.assign(conf!.fontsParsed, { [`$${name}`]: fontParsed })\n}\n\nexport const getHasConfigured = () => !!conf\nexport const getConfig = () => conf!\nexport const getTokens = () => conf!.tokensParsed\nexport const getThemes = () => conf!.themes\n\nexport const configListeners = new Set<ConfigListener>()\n\nexport const onConfiguredOnce = (cb: ConfigListener) => {\n if (conf) {\n cb(conf!)\n } else {\n configListeners.add(cb)\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAI;AAEG,MAAM,YAAY,CAAC,SAAgC;AACxD,SAAO;AACP,MAAI,gBAAgB,MAAM;AACxB,oBAAgB,QAAQ,CAAC,OAAO,GAAG,IAAK,CAAC;AACzC,oBAAgB,MAAM;AAAA,EACxB;AACF;AAEO,MAAM,gBAAgB,CAAC,MAAc,MAAW,eAAoB;AACzE,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC;AAAM,YAAM,IAAI,MAAM,kCAAkC;AAAA,EAC/D;AACA,SAAO,OAAO,KAAM,OAAO,EAAE,CAAC,OAAO,KAAK,CAAC;AAC3C,SAAO,OAAO,KAAM,aAAa,EAAE,CAAC,IAAI,SAAS,WAAW,CAAC;AAC/D;AAEO,MAAM,mBAAmB,MAAM,CAAC,CAAC;AACjC,MAAM,YAAY,MAAM;AACxB,MAAM,YAAY,MAAM,KAAM;AAC9B,MAAM,YAAY,MAAM,KAAM;AAE9B,MAAM,kBAAkB,oBAAI,IAAoB;AAEhD,MAAM,mBAAmB,CAAC,OAAuB;AACtD,MAAI,MAAM;AACR,OAAG,IAAK;AAAA,EACV,OAAO;AACL,oBAAgB,IAAI,EAAE;AAAA,EACxB;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -22,8 +22,7 @@ __export(platform_exports, {
|
|
|
22
22
|
isChrome: () => isChrome,
|
|
23
23
|
isClient: () => isClient,
|
|
24
24
|
isIOS: () => isIOS,
|
|
25
|
-
|
|
26
|
-
isServer: () => isServer,
|
|
25
|
+
isSSR: () => isSSR,
|
|
27
26
|
isTouchable: () => isTouchable,
|
|
28
27
|
isWeb: () => isWeb,
|
|
29
28
|
isWebTouchable: () => isWebTouchable,
|
|
@@ -33,18 +32,14 @@ __export(platform_exports, {
|
|
|
33
32
|
module.exports = __toCommonJS(platform_exports);
|
|
34
33
|
var import_react = require("react");
|
|
35
34
|
var import_react_native = require("react-native");
|
|
36
|
-
const import_meta = {};
|
|
37
35
|
var _a, _b;
|
|
38
36
|
const isAndroid = ((_a = import_react_native.Platform) == null ? void 0 : _a.OS) === "android";
|
|
39
37
|
const isIOS = ((_b = import_react_native.Platform) == null ? void 0 : _b.OS) === "ios";
|
|
40
38
|
const isWeb = process.env.TAMAGUI_TARGET === "web";
|
|
41
39
|
const isWindowDefined = typeof window !== "undefined";
|
|
42
|
-
const
|
|
40
|
+
const isSSR = isWeb && !isWindowDefined;
|
|
43
41
|
const isClient = isWeb && isWindowDefined;
|
|
44
|
-
const
|
|
45
|
-
const idFn = () => {
|
|
46
|
-
};
|
|
47
|
-
const useIsomorphicLayoutEffect = isRSC ? idFn : isServer ? import_react.useEffect : import_react.useLayoutEffect;
|
|
42
|
+
const useIsomorphicLayoutEffect = isSSR ? import_react.useEffect : import_react.useLayoutEffect;
|
|
48
43
|
const isChrome = typeof navigator !== "undefined" && /Chrome/.test(navigator.userAgent || "");
|
|
49
44
|
const isWebTouchable = isClient && "ontouchstart" in window;
|
|
50
45
|
const isTouchable = !isWeb || isWebTouchable;
|
|
@@ -54,8 +49,7 @@ const isTouchable = !isWeb || isWebTouchable;
|
|
|
54
49
|
isChrome,
|
|
55
50
|
isClient,
|
|
56
51
|
isIOS,
|
|
57
|
-
|
|
58
|
-
isServer,
|
|
52
|
+
isSSR,
|
|
59
53
|
isTouchable,
|
|
60
54
|
isWeb,
|
|
61
55
|
isWebTouchable,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/constants/platform.ts"],
|
|
4
|
-
"sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isAndroid = Platform?.OS === 'android'\nexport const isIOS = Platform?.OS === 'ios'\nexport const isWeb = process.env.TAMAGUI_TARGET === 'web'\nexport const isWindowDefined = typeof window !== 'undefined'\nexport const
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA
|
|
4
|
+
"sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isAndroid = Platform?.OS === 'android'\nexport const isIOS = Platform?.OS === 'ios'\nexport const isWeb = process.env.TAMAGUI_TARGET === 'web'\nexport const isWindowDefined = typeof window !== 'undefined'\nexport const isSSR = isWeb && !isWindowDefined\nexport const isClient = isWeb && isWindowDefined\nexport const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect\nexport const isChrome = typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')\nexport const isWebTouchable = isClient && 'ontouchstart' in window\nexport const isTouchable = !isWeb || isWebTouchable\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2C;AAC3C,0BAAyB;AADzB;AAGO,MAAM,YAAY,2DAAU,QAAO;AACnC,MAAM,QAAQ,2DAAU,QAAO;AAC/B,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,kBAAkB,OAAO,WAAW;AAC1C,MAAM,QAAQ,SAAS,CAAC;AACxB,MAAM,WAAW,SAAS;AAC1B,MAAM,4BAA4B,QAAQ,yBAAY;AACtD,MAAM,WAAW,OAAO,cAAc,eAAe,SAAS,KAAK,UAAU,aAAa,EAAE;AAC5F,MAAM,iBAAiB,YAAY,kBAAkB;AACrD,MAAM,cAAc,CAAC,SAAS;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var rnw_native_exports = {};
|
|
19
|
+
__export(rnw_native_exports, {
|
|
20
|
+
rnw: () => rnw
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(rnw_native_exports);
|
|
23
|
+
const rnw = {};
|
|
24
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
25
|
+
0 && (module.exports = {
|
|
26
|
+
rnw
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=rnw.native.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/contexts/ButtonInsideButtonContext.tsx"],
|
|
4
4
|
"sourcesContent": ["import { createContext } from 'react'\n\nexport const ButtonInsideButtonContext = createContext(false)\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8B;AAEvB,MAAM,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8B;AAEvB,MAAM,4BAA4B,gCAAc,KAAK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -48,6 +48,8 @@ function createTamagui(configIn) {
|
|
|
48
48
|
throw new Error("Must define fonts");
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
+
(0, import_insertStyleRule.scanAllSheets)();
|
|
52
|
+
(0, import_insertStyleRule.listenForSheetChanges)();
|
|
51
53
|
const fontTokens = Object.fromEntries(
|
|
52
54
|
Object.entries(configIn.fonts).map(([k, v]) => {
|
|
53
55
|
return [k, (0, import_createVariables.createVariables)(v, "f", true)];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createTamagui.ts"],
|
|
4
|
-
"sourcesContent": ["import { isRSC, isWeb } from '@tamagui/constants'\n\nimport { configListeners, setConfig } from './config'\nimport { createVariables } from './createVariables'\nimport { getThemeCSSRules } from './helpers/getThemeCSSRules'\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA6B;AAE7B,oBAA2C;AAC3C,6BAAgC;AAChC,8BAAiC;AACjC,
|
|
4
|
+
"sourcesContent": ["import { isRSC, isWeb } from '@tamagui/constants'\n\nimport { configListeners, setConfig } from './config'\nimport { createVariables } from './createVariables'\nimport { getThemeCSSRules } from './helpers/getThemeCSSRules'\nimport {\n getAllRules,\n listenForSheetChanges,\n scanAllSheets,\n} from './helpers/insertStyleRule'\nimport {\n registerCSSVariable,\n tokensValueToVariable,\n variableToCSS,\n} from './helpers/registerCSSVariable'\nimport { ensureThemeVariable, proxyThemeToParents } from './helpers/themes'\nimport { configureMedia } from './hooks/useMedia'\nimport { parseFont, registerFontVariables } from './insertFont'\nimport { Tamagui } from './Tamagui'\nimport {\n CreateTamaguiProps,\n InferTamaguiConfig,\n TamaguiInternalConfig,\n ThemeParsed,\n} from './types'\n\n// config is re-run by the @tamagui/static, dont double validate\nconst createdConfigs = new WeakMap<any, boolean>()\n\nexport function createTamagui<Conf extends CreateTamaguiProps>(\n configIn: Conf\n): InferTamaguiConfig<Conf> {\n if (createdConfigs.has(configIn)) {\n return configIn as any\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (!configIn.tokens) {\n throw new Error('Must define tokens')\n }\n if (!configIn.themes) {\n throw new Error('Must define themes')\n }\n if (!configIn.fonts) {\n throw new Error('Must define fonts')\n }\n }\n\n scanAllSheets()\n listenForSheetChanges()\n\n const fontTokens = Object.fromEntries(\n Object.entries(configIn.fonts!).map(([k, v]) => {\n return [k, createVariables(v, 'f', true)]\n })\n )\n\n const fontsParsed = (() => {\n const res = {} as typeof fontTokens\n for (const familyName in fontTokens) {\n res[`$${familyName}`] = parseFont(fontTokens[familyName])\n }\n return res!\n })()\n\n const themeConfig = (() => {\n const themes = { ...configIn.themes }\n const cssRuleSets: string[] = []\n\n if (isWeb) {\n const declarations: string[] = []\n const fontDeclarations: Record<\n string,\n { name: string; declarations: string[]; language?: string }\n > = {}\n\n for (const key in configIn.tokens) {\n for (const skey in configIn.tokens[key]) {\n const val = configIn.tokens[key][skey]\n registerCSSVariable(val)\n declarations.push(variableToCSS(val))\n }\n }\n\n for (const key in fontsParsed) {\n const fontParsed = fontsParsed[key]\n const [name, language] = key.includes('_') ? key.split('_') : [key]\n const fontVars = registerFontVariables(fontParsed)\n fontDeclarations[key] = {\n name: name.slice(1),\n declarations: fontVars,\n language,\n }\n }\n\n const sep =\n process.env.NODE_ENV === 'development' ? configIn.cssStyleSeparator || ' ' : ''\n\n function declarationsToRuleSet(decs: string[], selector = '') {\n return `:root${selector} {${sep}${[...decs].join(`;${sep}`)}${sep}}`\n }\n\n // non-font\n cssRuleSets.push(declarationsToRuleSet(declarations))\n\n // fonts\n if (fontDeclarations) {\n for (const key in fontDeclarations) {\n const { name, declarations, language = 'default' } = fontDeclarations[key]\n const fontSelector = `.font_${name}`\n const langSelector = `:root .t_lang-${name}-${language} ${fontSelector}`\n const selectors =\n language === 'default' ? ` ${fontSelector}, ${langSelector}` : langSelector\n const specificRuleSet = declarationsToRuleSet(declarations, selectors)\n cssRuleSets.push(specificRuleSet)\n }\n }\n }\n\n // dedupe themes to avoid duplicate CSS generation\n type DedupedTheme = {\n names: string[]\n theme: ThemeParsed\n }\n const dedupedThemes: {\n [key: string]: DedupedTheme\n } = {}\n const existing = new WeakMap<ThemeParsed, DedupedTheme>()\n\n // first, de-dupe and parse them\n for (const themeName in themes) {\n const rawTheme = themes[themeName] as ThemeParsed\n\n // if existing, avoid\n if (existing.has(rawTheme)) {\n const e = existing.get(rawTheme)!\n themes[themeName] = e.theme\n e.names.push(themeName)\n continue\n }\n\n // ensure each theme object unique for dedupe\n const theme = { ...rawTheme }\n // parse into variables\n for (const key in theme) {\n // make sure properly names theme variables\n ensureThemeVariable(theme, key)\n }\n themes[themeName] = theme\n\n // set deduped\n dedupedThemes[themeName] = {\n names: [themeName],\n theme,\n }\n existing.set(rawTheme, dedupedThemes[themeName])\n }\n\n // then, generate CSS from de-duped\n let themeRuleSets: string[] = []\n\n if (isWeb || isRSC) {\n for (const themeName in dedupedThemes) {\n themeRuleSets = [\n ...themeRuleSets,\n ...getThemeCSSRules({\n config: configIn,\n themeName,\n ...dedupedThemes[themeName],\n }),\n ]\n }\n }\n\n // proxy upwards to get parent variables (themes are subset going down)\n for (const themeName in themes) {\n themes[themeName] = proxyThemeToParents(themeName, themes[themeName], themes)\n }\n\n tokensValueToVariable.clear()\n\n return {\n themes,\n cssRuleSets,\n themeRuleSets,\n }\n })()\n\n // faster $lookups\n const tokensParsed: any = Object.fromEntries(\n Object.entries(configIn.tokens).map(([k, v]) => [\n k,\n Object.fromEntries(Object.entries(v).map(([k, v]) => [`$${k}`, v])),\n ])\n )\n\n const shorthands = configIn.shorthands || {}\n\n const config: TamaguiInternalConfig = {\n fontLanguages: [],\n animations: {} as any,\n media: {},\n ...configIn,\n // vite made this into a function if it wasn't set\n shorthands: { ...shorthands },\n inverseShorthands: shorthands\n ? Object.fromEntries(Object.entries(shorthands).map(([k, v]) => [v, k]))\n : {},\n themes: themeConfig.themes as any,\n fontsParsed,\n themeConfig,\n tokensParsed,\n parsed: true,\n getCSS: (separator = '\\n') => {\n return `.is_Text .is_Text {display:inline-flex;}\n._dsp_contents {display:contents;}\n${themeConfig.cssRuleSets.join(separator)}\n${themeConfig.themeRuleSets.join(separator)}\n${getAllRules().join(separator)}`\n },\n // const tokens = [...getToken(tokens.size[0])]\n // .spacer-sm + ._dsp_contents._dsp-sm-hidden { margin-left: -var(--${}) }\n }\n\n configureMedia(config)\n setConfig(config)\n\n if (configListeners.size) {\n configListeners.forEach((cb) => cb(config))\n configListeners.clear()\n }\n\n createdConfigs.set(config, true)\n\n if (process.env.NODE_ENV === 'development') {\n if (process.env.DEBUG?.startsWith('tamagui')) {\n // eslint-disable-next-line no-console\n console.log('Tamagui config:', config)\n }\n if (!globalThis['Tamagui']) {\n globalThis['Tamagui'] = Tamagui\n }\n }\n\n return config as any\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA6B;AAE7B,oBAA2C;AAC3C,6BAAgC;AAChC,8BAAiC;AACjC,6BAIO;AACP,iCAIO;AACP,oBAAyD;AACzD,sBAA+B;AAC/B,wBAAiD;AACjD,qBAAwB;AASxB,MAAM,iBAAiB,oBAAI,QAAsB;AAE1C,SAAS,cACd,UAC0B;AA/B5B;AAgCE,MAAI,eAAe,IAAI,QAAQ,GAAG;AAChC,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC,SAAS,QAAQ;AACpB,YAAM,IAAI,MAAM,oBAAoB;AAAA,IACtC;AACA,QAAI,CAAC,SAAS,QAAQ;AACpB,YAAM,IAAI,MAAM,oBAAoB;AAAA,IACtC;AACA,QAAI,CAAC,SAAS,OAAO;AACnB,YAAM,IAAI,MAAM,mBAAmB;AAAA,IACrC;AAAA,EACF;AAEA,4CAAc;AACd,oDAAsB;AAEtB,QAAM,aAAa,OAAO;AAAA,IACxB,OAAO,QAAQ,SAAS,KAAM,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM;AAC9C,aAAO,CAAC,OAAG,wCAAgB,GAAG,KAAK,IAAI,CAA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