@tamagui/web 1.129.12 → 1.129.13
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/contexts/ComponentContext.cjs +1 -6
- package/dist/cjs/contexts/ComponentContext.js +1 -6
- package/dist/cjs/contexts/ComponentContext.js.map +1 -1
- package/dist/cjs/contexts/ComponentContext.native.js +1 -6
- package/dist/cjs/contexts/ComponentContext.native.js.map +2 -2
- package/dist/cjs/contexts/GroupContext.cjs +27 -0
- package/dist/cjs/contexts/GroupContext.js +22 -0
- package/dist/cjs/contexts/GroupContext.js.map +6 -0
- package/dist/cjs/contexts/GroupContext.native.js +26 -0
- package/dist/cjs/contexts/GroupContext.native.js.map +6 -0
- package/dist/cjs/createComponent.cjs +131 -90
- package/dist/cjs/createComponent.js +139 -94
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createComponent.native.js +156 -106
- package/dist/cjs/createComponent.native.js.map +2 -2
- package/dist/cjs/helpers/createStyledContext.js.map +1 -1
- package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +68 -49
- package/dist/cjs/helpers/getSplitStyles.js +64 -55
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.native.js +82 -63
- package/dist/cjs/helpers/getSplitStyles.native.js.map +2 -2
- package/dist/cjs/helpers/pseudoDescriptors.cjs +12 -12
- package/dist/cjs/helpers/pseudoDescriptors.js +12 -12
- package/dist/cjs/helpers/pseudoDescriptors.js.map +1 -1
- package/dist/cjs/helpers/pseudoDescriptors.native.js +12 -12
- package/dist/cjs/helpers/pseudoDescriptors.native.js.map +1 -1
- package/dist/cjs/helpers/subscribeToContextGroup.cjs +48 -31
- package/dist/cjs/helpers/subscribeToContextGroup.js +36 -20
- package/dist/cjs/helpers/subscribeToContextGroup.js.map +1 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.js +48 -20
- package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +2 -2
- package/dist/cjs/hooks/useComponentState.cjs +2 -40
- package/dist/cjs/hooks/useComponentState.js +2 -30
- package/dist/cjs/hooks/useComponentState.js.map +2 -2
- package/dist/cjs/hooks/useComponentState.native.js +3 -43
- package/dist/cjs/hooks/useComponentState.native.js.map +2 -2
- package/dist/cjs/hooks/useConfiguration.cjs +1 -17
- package/dist/cjs/hooks/useConfiguration.js +2 -9
- package/dist/cjs/hooks/useConfiguration.js.map +1 -1
- package/dist/cjs/hooks/useConfiguration.native.js +2 -7
- package/dist/cjs/hooks/useConfiguration.native.js.map +2 -2
- package/dist/cjs/hooks/useMedia.cjs +4 -3
- package/dist/cjs/hooks/useMedia.js +3 -3
- package/dist/cjs/hooks/useMedia.js.map +1 -1
- package/dist/cjs/hooks/useMedia.native.js +3 -3
- package/dist/cjs/hooks/useMedia.native.js.map +2 -2
- package/dist/cjs/hooks/useProps.cjs +7 -6
- package/dist/cjs/hooks/useProps.js +13 -11
- package/dist/cjs/hooks/useProps.js.map +1 -1
- package/dist/cjs/hooks/useProps.native.js +11 -10
- package/dist/cjs/hooks/useProps.native.js.map +2 -2
- package/dist/cjs/hooks/useThemeState.cjs +2 -2
- package/dist/cjs/hooks/useThemeState.js +2 -2
- package/dist/cjs/hooks/useThemeState.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.native.js +2 -2
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +2 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/contexts/ComponentContext.js +1 -6
- package/dist/esm/contexts/ComponentContext.js.map +1 -1
- package/dist/esm/contexts/ComponentContext.mjs +1 -6
- package/dist/esm/contexts/ComponentContext.mjs.map +1 -1
- package/dist/esm/contexts/ComponentContext.native.js +1 -6
- package/dist/esm/contexts/ComponentContext.native.js.map +1 -1
- package/dist/esm/contexts/GroupContext.js +6 -0
- package/dist/esm/contexts/GroupContext.js.map +6 -0
- package/dist/esm/contexts/GroupContext.mjs +4 -0
- package/dist/esm/contexts/GroupContext.mjs.map +1 -0
- package/dist/esm/contexts/GroupContext.native.js +4 -0
- package/dist/esm/contexts/GroupContext.native.js.map +1 -0
- package/dist/esm/createComponent.js +141 -94
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createComponent.mjs +132 -91
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +152 -102
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/helpers/createStyledContext.js.map +1 -1
- package/dist/esm/helpers/createStyledContext.mjs.map +1 -1
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +68 -56
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.mjs +68 -49
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +72 -53
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/pseudoDescriptors.js +12 -12
- package/dist/esm/helpers/pseudoDescriptors.js.map +1 -1
- package/dist/esm/helpers/pseudoDescriptors.mjs +12 -12
- package/dist/esm/helpers/pseudoDescriptors.mjs.map +1 -1
- package/dist/esm/helpers/pseudoDescriptors.native.js +12 -12
- package/dist/esm/helpers/pseudoDescriptors.native.js.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.js +36 -20
- package/dist/esm/helpers/subscribeToContextGroup.js.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.mjs +47 -30
- package/dist/esm/helpers/subscribeToContextGroup.mjs.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js +64 -36
- package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.js +2 -30
- package/dist/esm/hooks/useComponentState.js.map +2 -2
- package/dist/esm/hooks/useComponentState.mjs +2 -40
- package/dist/esm/hooks/useComponentState.mjs.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +3 -46
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useConfiguration.js +1 -9
- package/dist/esm/hooks/useConfiguration.js.map +1 -1
- package/dist/esm/hooks/useConfiguration.mjs +1 -17
- package/dist/esm/hooks/useConfiguration.mjs.map +1 -1
- package/dist/esm/hooks/useConfiguration.native.js +1 -15
- package/dist/esm/hooks/useConfiguration.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.js +3 -3
- package/dist/esm/hooks/useMedia.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +4 -3
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +4 -3
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useProps.js +13 -10
- package/dist/esm/hooks/useProps.js.map +1 -1
- package/dist/esm/hooks/useProps.mjs +7 -6
- package/dist/esm/hooks/useProps.mjs.map +1 -1
- package/dist/esm/hooks/useProps.native.js +7 -6
- package/dist/esm/hooks/useProps.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.js +2 -2
- package/dist/esm/hooks/useThemeState.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +2 -2
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +2 -2
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +1 -0
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/package.json +12 -12
- package/src/contexts/ComponentContext.tsx +0 -5
- package/src/contexts/GroupContext.tsx +4 -0
- package/src/createComponent.tsx +251 -107
- package/src/helpers/createStyledContext.tsx +1 -1
- package/src/helpers/getSplitStyles.tsx +77 -56
- package/src/helpers/pseudoDescriptors.ts +15 -19
- package/src/helpers/subscribeToContextGroup.tsx +70 -34
- package/src/hooks/useComponentState.ts +2 -46
- package/src/hooks/useConfiguration.tsx +1 -9
- package/src/hooks/useMedia.tsx +4 -2
- package/src/hooks/useProps.tsx +15 -10
- package/src/hooks/useThemeState.ts +2 -2
- package/src/index.ts +1 -0
- package/src/interfaces/TamaguiComponentState.tsx +4 -3
- package/src/types.tsx +33 -36
- package/src/views/TamaguiProvider.tsx +1 -0
- package/types/contexts/ComponentContext.d.ts.map +1 -1
- package/types/contexts/GroupContext.d.ts +3 -0
- package/types/contexts/GroupContext.d.ts.map +1 -0
- package/types/createComponent.d.ts +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +2 -2
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/pseudoDescriptors.d.ts +14 -13
- package/types/helpers/pseudoDescriptors.d.ts.map +1 -1
- package/types/helpers/subscribeToContextGroup.d.ts +7 -6
- package/types/helpers/subscribeToContextGroup.d.ts.map +1 -1
- package/types/hooks/useComponentState.d.ts +3 -3
- package/types/hooks/useComponentState.d.ts.map +1 -1
- package/types/hooks/useConfiguration.d.ts +1 -121
- package/types/hooks/useConfiguration.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts +2 -2
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useProps.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/interfaces/TamaguiComponentState.d.ts +2 -2
- package/types/interfaces/TamaguiComponentState.d.ts.map +1 -1
- package/types/types.d.ts +22 -33
- package/types/types.d.ts.map +1 -1
- package/types/views/TamaguiProvider.d.ts.map +1 -1
|
@@ -29,10 +29,5 @@ const ComponentContext = (0, import_createStyledContext.createStyledContext)({
|
|
|
29
29
|
inText: !1,
|
|
30
30
|
language: null,
|
|
31
31
|
animationDriver: null,
|
|
32
|
-
setParentFocusState: null
|
|
33
|
-
groups: {
|
|
34
|
-
emit: null,
|
|
35
|
-
subscribe: null,
|
|
36
|
-
state: {}
|
|
37
|
-
}
|
|
32
|
+
setParentFocusState: null
|
|
38
33
|
});
|
|
@@ -23,11 +23,6 @@ const ComponentContext = (0, import_createStyledContext.createStyledContext)({
|
|
|
23
23
|
inText: !1,
|
|
24
24
|
language: null,
|
|
25
25
|
animationDriver: null,
|
|
26
|
-
setParentFocusState: null
|
|
27
|
-
groups: {
|
|
28
|
-
emit: null,
|
|
29
|
-
subscribe: null,
|
|
30
|
-
state: {}
|
|
31
|
-
}
|
|
26
|
+
setParentFocusState: null
|
|
32
27
|
});
|
|
33
28
|
//# sourceMappingURL=ComponentContext.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/contexts/ComponentContext.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAAoC;AAG7B,MAAM,uBAAmB,gDAAuC;AAAA,EACrE,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,qBAAqB;
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAAoC;AAG7B,MAAM,uBAAmB,gDAAuC;AAAA,EACrE,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,qBAAqB;AACvB,CAAC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -23,12 +23,7 @@ var import_createStyledContext = require("../helpers/createStyledContext"), Comp
|
|
|
23
23
|
inText: !1,
|
|
24
24
|
language: null,
|
|
25
25
|
animationDriver: null,
|
|
26
|
-
setParentFocusState: null
|
|
27
|
-
groups: {
|
|
28
|
-
emit: null,
|
|
29
|
-
subscribe: null,
|
|
30
|
-
state: {}
|
|
31
|
-
}
|
|
26
|
+
setParentFocusState: null
|
|
32
27
|
});
|
|
33
28
|
// Annotate the CommonJS export names for ESM import in node:
|
|
34
29
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/contexts/ComponentContext.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;;;;;iCAAoC,2CAGvBA,uBAAmBC,gDAAuC;EACrEC,YAAYC;EACZC,QAAQ;EACRC,UAAU;EACVC,iBAAiB;EACjBC,qBAAqB;
|
|
5
|
-
"names": ["ComponentContext", "createStyledContext", "disableSSR", "undefined", "inText", "language", "animationDriver", "setParentFocusState"
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;;;;;iCAAoC,2CAGvBA,uBAAmBC,gDAAuC;EACrEC,YAAYC;EACZC,QAAQ;EACRC,UAAU;EACVC,iBAAiB;EACjBC,qBAAqB;AACvB,CAAA;",
|
|
5
|
+
"names": ["ComponentContext", "createStyledContext", "disableSSR", "undefined", "inText", "language", "animationDriver", "setParentFocusState"]
|
|
6
6
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var GroupContext_exports = {};
|
|
22
|
+
__export(GroupContext_exports, {
|
|
23
|
+
GroupContext: () => GroupContext
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(GroupContext_exports);
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
const GroupContext = (0, import_react.createContext)(null);
|
|
@@ -0,0 +1,22 @@
|
|
|
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: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
+
var GroupContext_exports = {};
|
|
16
|
+
__export(GroupContext_exports, {
|
|
17
|
+
GroupContext: () => GroupContext
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(GroupContext_exports);
|
|
20
|
+
var import_react = require("react");
|
|
21
|
+
const GroupContext = (0, import_react.createContext)(null);
|
|
22
|
+
//# sourceMappingURL=GroupContext.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
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: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
var GroupContext_exports = {};
|
|
17
|
+
__export(GroupContext_exports, {
|
|
18
|
+
GroupContext: () => GroupContext
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(GroupContext_exports);
|
|
21
|
+
var import_react = require("react"), GroupContext = /* @__PURE__ */ (0, import_react.createContext)(null);
|
|
22
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
+
0 && (module.exports = {
|
|
24
|
+
GroupContext
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=GroupContext.js.map
|
|
@@ -41,11 +41,13 @@ module.exports = __toCommonJS(createComponent_exports);
|
|
|
41
41
|
var import_compose_refs = require("@tamagui/compose-refs"),
|
|
42
42
|
import_constants = require("@tamagui/constants"),
|
|
43
43
|
import_helpers = require("@tamagui/helpers"),
|
|
44
|
+
import_is_equal_shallow = require("@tamagui/is-equal-shallow"),
|
|
44
45
|
import_react = __toESM(require("react")),
|
|
45
46
|
import_config = require("./config.cjs"),
|
|
46
47
|
import_constants2 = require("./constants/constants.cjs"),
|
|
47
48
|
import_isDevTools = require("./constants/isDevTools.cjs"),
|
|
48
49
|
import_ComponentContext = require("./contexts/ComponentContext.cjs"),
|
|
50
|
+
import_GroupContext = require("./contexts/GroupContext.cjs"),
|
|
49
51
|
import_createVariable = require("./createVariable.cjs"),
|
|
50
52
|
import_defaultComponentState = require("./defaultComponentState.cjs"),
|
|
51
53
|
import_getShorthandValue = require("./helpers/getShorthandValue.cjs"),
|
|
@@ -64,7 +66,8 @@ var import_compose_refs = require("@tamagui/compose-refs"),
|
|
|
64
66
|
import_Theme = require("./views/Theme.cjs"),
|
|
65
67
|
import_jsx_runtime = require("react/jsx-runtime");
|
|
66
68
|
let time, debugKeyListeners, startVisualizer;
|
|
67
|
-
const componentSetStates = /* @__PURE__ */new Set()
|
|
69
|
+
const componentSetStates = /* @__PURE__ */new Set(),
|
|
70
|
+
avoidReRenderKeys = /* @__PURE__ */new Set(["hover", "press", "pressIn", "group", "focus", "focusWithin", "media", "group"]);
|
|
68
71
|
if (typeof window < "u") {
|
|
69
72
|
const cancelTouches = () => {
|
|
70
73
|
componentSetStates.forEach(setState => setState(prev => prev.press || prev.pressIn ? {
|
|
@@ -75,11 +78,11 @@ if (typeof window < "u") {
|
|
|
75
78
|
};
|
|
76
79
|
addEventListener("mouseup", cancelTouches), addEventListener("touchend", cancelTouches), addEventListener("touchcancel", cancelTouches), process.env.NODE_ENV === "development" && (startVisualizer = () => {
|
|
77
80
|
const devVisualizerConfig = import_config.devConfig?.visualizer;
|
|
78
|
-
if (devVisualizerConfig) {
|
|
81
|
+
if (devVisualizerConfig && !globalThis.__tamaguiDevVisualizer) {
|
|
79
82
|
let show = function (val) {
|
|
80
83
|
clearTimeout(tm), isShowing = val, debugKeyListeners?.forEach(l => l(val));
|
|
81
84
|
};
|
|
82
|
-
debugKeyListeners = /* @__PURE__ */new Set();
|
|
85
|
+
globalThis.__tamaguiDevVisualizer = !0, debugKeyListeners = /* @__PURE__ */new Set();
|
|
83
86
|
let tm,
|
|
84
87
|
isShowing = !1;
|
|
85
88
|
const options = {
|
|
@@ -109,12 +112,12 @@ let BaseText, BaseView;
|
|
|
109
112
|
const lastInteractionWasKeyboard = {
|
|
110
113
|
value: !1
|
|
111
114
|
};
|
|
112
|
-
import_constants.isWeb &&
|
|
113
|
-
lastInteractionWasKeyboard.value = !0;
|
|
115
|
+
import_constants.isWeb && typeof document < "u" && (document.addEventListener("keydown", () => {
|
|
116
|
+
lastInteractionWasKeyboard.value || (lastInteractionWasKeyboard.value = !0);
|
|
114
117
|
}), document.addEventListener("mousedown", () => {
|
|
115
|
-
lastInteractionWasKeyboard.value = !1;
|
|
118
|
+
lastInteractionWasKeyboard.value && (lastInteractionWasKeyboard.value = !1);
|
|
116
119
|
}), document.addEventListener("mousemove", () => {
|
|
117
|
-
lastInteractionWasKeyboard.value = !1;
|
|
120
|
+
lastInteractionWasKeyboard.value && (lastInteractionWasKeyboard.value = !1);
|
|
118
121
|
}));
|
|
119
122
|
function createComponent(staticConfig) {
|
|
120
123
|
const {
|
|
@@ -145,7 +148,6 @@ function createComponent(staticConfig) {
|
|
|
145
148
|
const component = import_react.default.forwardRef((propsIn, forwardedRef) => {
|
|
146
149
|
const internalID = process.env.NODE_ENV === "development" ? import_react.default.useId() : "";
|
|
147
150
|
process.env.NODE_ENV === "development" && startVisualizer && (startVisualizer(), startVisualizer = void 0), process.env.NODE_ENV === "test" && propsIn["data-test-renders"] && (propsIn["data-test-renders"].current ??= 0, propsIn["data-test-renders"].current += 1);
|
|
148
|
-
const componentContext = import_react.default.useContext(import_ComponentContext.ComponentContext);
|
|
149
151
|
let styledContextProps, overriddenContextProps, contextValue;
|
|
150
152
|
const {
|
|
151
153
|
context,
|
|
@@ -175,7 +177,7 @@ function createComponent(staticConfig) {
|
|
|
175
177
|
process.env.NODE_ENV === "development" && import_constants.isClient && import_react.default.useEffect(() => {
|
|
176
178
|
let overlay = null;
|
|
177
179
|
const debugVisualizerHandler = (show = !1) => {
|
|
178
|
-
const node =
|
|
180
|
+
const node = stateRef.current.host;
|
|
179
181
|
if (node) if (show) {
|
|
180
182
|
overlay = document.createElement("span"), overlay.style.inset = "0px", overlay.style.zIndex = "1000000", overlay.style.position = "absolute", overlay.style.borderColor = "red", overlay.style.borderWidth = "1px", overlay.style.borderStyle = "dotted";
|
|
181
183
|
const dataAt = node.getAttribute("data-at") || "",
|
|
@@ -188,11 +190,12 @@ function createComponent(staticConfig) {
|
|
|
188
190
|
debugKeyListeners?.delete(debugVisualizerHandler);
|
|
189
191
|
};
|
|
190
192
|
}, [componentName2]);
|
|
191
|
-
const
|
|
193
|
+
const componentContext = import_react.default.useContext(import_ComponentContext.ComponentContext),
|
|
194
|
+
groupContextParent = import_react.default.useContext(import_GroupContext.GroupContext),
|
|
195
|
+
animationDriver = componentContext.animationDriver,
|
|
192
196
|
useAnimations = animationDriver?.useAnimations,
|
|
193
|
-
componentState = (0, import_useComponentState.useComponentState)(props,
|
|
197
|
+
componentState = (0, import_useComponentState.useComponentState)(props, animationDriver, staticConfig, config),
|
|
194
198
|
{
|
|
195
|
-
curStateRef,
|
|
196
199
|
disabled,
|
|
197
200
|
groupName,
|
|
198
201
|
hasAnimationProp,
|
|
@@ -210,9 +213,46 @@ function createComponent(staticConfig) {
|
|
|
210
213
|
willBeAnimated,
|
|
211
214
|
willBeAnimatedClient,
|
|
212
215
|
startedUnhydrated
|
|
213
|
-
} = componentState
|
|
216
|
+
} = componentState,
|
|
217
|
+
allGroupContexts = (0, import_react.useMemo)(() => {
|
|
218
|
+
if (!groupName) return groupContextParent;
|
|
219
|
+
stateRef.current.group?.listeners.clear();
|
|
220
|
+
const listeners = /* @__PURE__ */new Set();
|
|
221
|
+
return stateRef.current.group = {
|
|
222
|
+
listeners,
|
|
223
|
+
emit(state2) {
|
|
224
|
+
listeners.forEach(l => l(state2));
|
|
225
|
+
},
|
|
226
|
+
subscribe(cb) {
|
|
227
|
+
return listeners.add(cb), listeners.size === 1 && setStateShallow({
|
|
228
|
+
hasDynGroupChildren: !0
|
|
229
|
+
}), () => {
|
|
230
|
+
listeners.delete(cb), listeners.size === 0 && setStateShallow({
|
|
231
|
+
hasDynGroupChildren: !1
|
|
232
|
+
});
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
}, {
|
|
236
|
+
...groupContextParent,
|
|
237
|
+
[groupName]: {
|
|
238
|
+
state: {
|
|
239
|
+
pseudo: import_defaultComponentState.defaultComponentStateMounted
|
|
240
|
+
},
|
|
241
|
+
subscribe: listener => {
|
|
242
|
+
const dispose = stateRef.current.group?.subscribe(listener);
|
|
243
|
+
return () => {
|
|
244
|
+
dispose?.();
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
}, [stateRef, groupName, groupContextParent]);
|
|
214
250
|
let setStateShallow = componentState.setStateShallow;
|
|
215
|
-
|
|
251
|
+
const pendingState = stateRef.current.nextComponentState;
|
|
252
|
+
pendingState && (stateRef.current.nextComponentState = void 0, componentState.setState(prev => ({
|
|
253
|
+
...prev,
|
|
254
|
+
...pendingState
|
|
255
|
+
}))), process.env.NODE_ENV === "development" && time && time`use-state`;
|
|
216
256
|
const hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText),
|
|
217
257
|
isTaggable = !Component || typeof Component == "string",
|
|
218
258
|
tagProp = props.tag,
|
|
@@ -225,14 +265,14 @@ function createComponent(staticConfig) {
|
|
|
225
265
|
// things declaratively
|
|
226
266
|
!animationDriver.needsWebStyles && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
|
|
227
267
|
const disableTheme = props["data-disable-theme"] || isHOC;
|
|
228
|
-
process.env.NODE_ENV === "development" && time && time`theme-props`, props.themeShallow && (
|
|
268
|
+
process.env.NODE_ENV === "development" && time && time`theme-props`, props.themeShallow && (stateRef.current.themeShallow = !0);
|
|
229
269
|
const themeStateProps = {
|
|
230
270
|
componentName: componentName2,
|
|
231
271
|
disable: disableTheme,
|
|
232
|
-
shallow:
|
|
272
|
+
shallow: stateRef.current.themeShallow,
|
|
233
273
|
debug: debugProp
|
|
234
274
|
};
|
|
235
|
-
if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof
|
|
275
|
+
if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof stateRef.current.isListeningToTheme == "boolean" && (themeStateProps.needsUpdate = () => !!stateRef.current.isListeningToTheme), process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
236
276
|
const name = `${componentName2 || Component?.displayName || Component?.name || "[Unnamed Component]"}`,
|
|
237
277
|
type = (hasEnterStyle ? "(hasEnter)" : " ") + (isAnimated ? "(animated)" : " ") + (isReactNative ? "(rnw)" : " ") + (noClass ? "(noClass)" : " ") + (state.press || state.pressIn ? "(PRESSED)" : " ") + (state.hover ? "(HOVERED)" : " ") + (state.focus ? "(FOCUSED)" : " ") + (state.focusWithin ? "(WITHIN FOCUSED)" : " ") + (presenceState?.isPresent === !1 ? "(EXIT)" : ""),
|
|
238
278
|
dataIs = propsIn["data-is"] || "",
|
|
@@ -253,7 +293,8 @@ function createComponent(staticConfig) {
|
|
|
253
293
|
themeStateProps
|
|
254
294
|
}), (0, import_log.log)({
|
|
255
295
|
contextProps: styledContextProps,
|
|
256
|
-
overriddenContextProps
|
|
296
|
+
overriddenContextProps,
|
|
297
|
+
componentContext
|
|
257
298
|
}), (0, import_log.log)({
|
|
258
299
|
presence,
|
|
259
300
|
isAnimated,
|
|
@@ -284,24 +325,51 @@ function createComponent(staticConfig) {
|
|
|
284
325
|
},
|
|
285
326
|
themeName = themeState?.name || "";
|
|
286
327
|
process.env.NODE_ENV === "development" && time && time`split-styles-prepare`;
|
|
287
|
-
const splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp)
|
|
288
|
-
|
|
328
|
+
const splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp),
|
|
329
|
+
groupContext = groupName && allGroupContexts?.[groupName] || null;
|
|
330
|
+
if (groupContext) {
|
|
331
|
+
const groupState = groupContext?.state;
|
|
332
|
+
groupState && groupState.layout === void 0 && (splitStyles.style?.width || splitStyles.style?.height) && (groupState.layout = {
|
|
333
|
+
width: fromPx(splitStyles.style.width),
|
|
334
|
+
height: fromPx(splitStyles.style.height)
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
if ((hasAnimationProp || groupName) && animationDriver?.avoidReRenders) {
|
|
289
338
|
const styleListener = stateRef.current.useStyleListener,
|
|
290
339
|
ogSetStateShallow = setStateShallow;
|
|
291
|
-
setStateShallow =
|
|
292
|
-
const
|
|
293
|
-
|
|
340
|
+
stateRef.current.setStateShallow = nextOrGetNext => {
|
|
341
|
+
const prev = stateRef.current.nextComponentState || state,
|
|
342
|
+
next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
|
|
343
|
+
if (next === prev || (0, import_is_equal_shallow.isEqualShallow)(prev, next)) return;
|
|
344
|
+
const canAvoidReRender = Object.keys(next).every(key => avoidReRenderKeys.has(key));
|
|
345
|
+
if (canAvoidReRender) {
|
|
294
346
|
const updatedState = {
|
|
295
|
-
...
|
|
347
|
+
...prev,
|
|
296
348
|
...next
|
|
297
349
|
};
|
|
298
|
-
stateRef.current.nextComponentState = updatedState
|
|
299
|
-
|
|
350
|
+
stateRef.current.nextComponentState = updatedState, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && (console.groupCollapsed("[\u26A1\uFE0F] avoid setState", next, {
|
|
351
|
+
updatedState,
|
|
352
|
+
props
|
|
353
|
+
}), console.info(stateRef.current.host), console.groupEnd());
|
|
354
|
+
const {
|
|
355
|
+
group,
|
|
356
|
+
hasDynGroupChildren,
|
|
357
|
+
unmounted,
|
|
358
|
+
animation,
|
|
359
|
+
...childrenGroupState
|
|
360
|
+
} = updatedState;
|
|
361
|
+
if (groupContext && notifyGroupSubscribers(groupContext, stateRef.current.group || null, childrenGroupState), !hasAnimationProp || !styleListener) return;
|
|
362
|
+
const nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp);
|
|
300
363
|
styleListener(nextStyles.style);
|
|
301
|
-
} else
|
|
364
|
+
} else process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && console.info("[\u{1F40C}] re-render", {
|
|
365
|
+
canAvoidReRender,
|
|
366
|
+
next
|
|
367
|
+
}), ogSetStateShallow(next);
|
|
368
|
+
}, setStateShallow = state2 => {
|
|
369
|
+
stateRef.current.setStateShallow?.(state2);
|
|
302
370
|
};
|
|
303
371
|
}
|
|
304
|
-
process.env.NODE_ENV === "development" && time && time`split-styles`, props.group && props.untilMeasured === "hide" && !
|
|
372
|
+
process.env.NODE_ENV === "development" && time && time`split-styles`, props.group && props.untilMeasured === "hide" && !stateRef.current.hasMeasured && (splitStyles.style ||= {}, splitStyles.style.opacity = 0), splitStyles.dynamicThemeAccess != null && (stateRef.current.isListeningToTheme = splitStyles.dynamicThemeAccess);
|
|
305
373
|
const hasRuntimeMediaKeys = splitStyles.hasMedia && splitStyles.hasMedia !== !0,
|
|
306
374
|
shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || hasRuntimeMediaKeys || noClass && splitStyles.hasMedia === !0,
|
|
307
375
|
mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
|
|
@@ -369,14 +437,14 @@ function createComponent(staticConfig) {
|
|
|
369
437
|
}
|
|
370
438
|
process.env.NODE_ENV === "development" && props.untilMeasured && !props.group && console.warn(`You set the untilMeasured prop without setting group. This doesn't work, be sure to set untilMeasured on the parent that sets group, not the children that use the $group- prop.
|
|
371
439
|
|
|
372
|
-
If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`), process.env.NODE_ENV === "development" && time && time`destructure`,
|
|
440
|
+
If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`), process.env.NODE_ENV === "development" && time && time`destructure`, groupContext && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(nonTamaguiProps.onLayout, e => {
|
|
373
441
|
const layout = e.nativeEvent.layout;
|
|
374
|
-
|
|
442
|
+
groupContext.state.layout = layout, stateRef.current.group?.emit({
|
|
375
443
|
layout
|
|
376
444
|
}), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(prev => ({
|
|
377
445
|
...prev
|
|
378
446
|
})), stateRef.current.hasMeasured = !0;
|
|
379
|
-
})), viewProps = import_setupHooks.hooks.usePropsTransform?.(elementType, nonTamaguiProps, stateRef,
|
|
447
|
+
})), viewProps = import_setupHooks.hooks.usePropsTransform?.(elementType, nonTamaguiProps, stateRef, stateRef.current.willHydrate) || nonTamaguiProps, stateRef.current.composedRef || (stateRef.current.composedRef = (0, import_compose_refs.composeRefs)(x => stateRef.current.host = x, forwardedRef, import_setElementProps.setElementProps, animatedRef)), viewProps.ref = stateRef.current.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants.isWeb && !isHOC && import_react.default.Children.toArray(props.children).forEach(item => {
|
|
380
448
|
typeof item == "string" && item !== `
|
|
381
449
|
` && console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <${staticConfig.componentName || propsIn.tag || "View"}>.`, props);
|
|
382
450
|
}), process.env.NODE_ENV === "development" && time && time`events-hooks`;
|
|
@@ -421,31 +489,23 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
421
489
|
});
|
|
422
490
|
return;
|
|
423
491
|
}
|
|
424
|
-
|
|
425
|
-
|
|
492
|
+
return () => {
|
|
493
|
+
componentSetStates.delete(setState);
|
|
494
|
+
};
|
|
495
|
+
}, [state.unmounted, disabled]), (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
496
|
+
if (!disabled && !(!pseudoGroups && !mediaGroups) && allGroupContexts) return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
|
|
497
|
+
groupContext: allGroupContexts,
|
|
426
498
|
setStateShallow,
|
|
427
|
-
state,
|
|
428
499
|
mediaGroups,
|
|
429
500
|
pseudoGroups
|
|
430
|
-
}) : null;
|
|
431
|
-
return () => {
|
|
432
|
-
dispose?.(), componentSetStates.delete(setState);
|
|
433
|
-
};
|
|
434
|
-
}, [state.unmounted, disabled, pseudoGroups ? Object.keys([...pseudoGroups]).join("") : 0, mediaGroups ? Object.keys([...mediaGroups]).join("") : 0]), (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
435
|
-
if (!groupName) return;
|
|
436
|
-
curStateRef.group.emit(groupName, {
|
|
437
|
-
pseudo: state,
|
|
438
|
-
layout: curStateRef.group?.layout
|
|
439
501
|
});
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}
|
|
448
|
-
}, [groupName, state]);
|
|
502
|
+
}, [allGroupContexts, disabled, pseudoGroups ? Object.keys([...pseudoGroups]).join("") : 0, mediaGroups ? Object.keys([...mediaGroups]).join("") : 0]), hasAnimationProp && animationDriver?.avoidReRenders && (0, import_react.useEffect)(() => {
|
|
503
|
+
stateRef.current.nextComponentState = void 0;
|
|
504
|
+
});
|
|
505
|
+
const groupEmitter = stateRef.current.group;
|
|
506
|
+
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
507
|
+
!groupContext || !groupEmitter || notifyGroupSubscribers(groupContext, groupEmitter, state);
|
|
508
|
+
}, [groupContext, groupEmitter, state]);
|
|
449
509
|
const runtimePressStyle = !disabled && noClass && pseudos?.pressStyle,
|
|
450
510
|
runtimeFocusStyle = !disabled && noClass && pseudos?.focusStyle,
|
|
451
511
|
runtimeFocusVisibleStyle = !disabled && noClass && pseudos?.focusVisibleStyle,
|
|
@@ -480,7 +540,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
480
540
|
},
|
|
481
541
|
onMouseLeave: e => {
|
|
482
542
|
const next = {};
|
|
483
|
-
needsHoverState && (next.hover = !1), needsPressState &&
|
|
543
|
+
needsHoverState && (next.hover = !1), needsPressState && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut?.(e), onMouseLeave?.(e);
|
|
484
544
|
}
|
|
485
545
|
}),
|
|
486
546
|
onPressIn: attachPress ? e => {
|
|
@@ -494,24 +554,16 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
494
554
|
} : void 0,
|
|
495
555
|
...(attachFocus && {
|
|
496
556
|
onFocus: e => {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
}), pseudos?.focusVisibleStyle ? setTimeout(() => {
|
|
500
|
-
setStateShallow({
|
|
501
|
-
focus: !0,
|
|
502
|
-
focusVisible: !!lastInteractionWasKeyboard.value
|
|
503
|
-
});
|
|
504
|
-
}, 0) : setStateShallow({
|
|
505
|
-
focus: !0,
|
|
506
|
-
focusVisible: !1
|
|
507
|
-
}), onFocus?.(e);
|
|
557
|
+
const next = {};
|
|
558
|
+
componentContext.setParentFocusState && (next.focusWithin = !0), pseudos?.focusVisibleStyle && lastInteractionWasKeyboard.value ? next.focusVisible = !0 : next.focus = !0, setStateShallow(next), onFocus?.(e);
|
|
508
559
|
},
|
|
509
560
|
onBlur: e => {
|
|
510
561
|
componentContext.setParentFocusState && componentContext.setParentFocusState({
|
|
511
562
|
focusWithin: !1
|
|
512
563
|
}), setStateShallow({
|
|
513
564
|
focus: !1,
|
|
514
|
-
focusVisible: !1
|
|
565
|
+
focusVisible: !1,
|
|
566
|
+
focusWithin: !1
|
|
515
567
|
}), onBlur?.(e);
|
|
516
568
|
}
|
|
517
569
|
})
|
|
@@ -551,35 +603,15 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
551
603
|
let useChildrenResult;
|
|
552
604
|
import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(elementType, content, viewProps)), process.env.NODE_ENV === "development" && time && time`use-children`, useChildrenResult ? content = useChildrenResult : content = import_react.default.createElement(elementType, viewProps, content);
|
|
553
605
|
const ResetPresence = config?.animations?.ResetPresence;
|
|
554
|
-
ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(ResetPresence, {
|
|
606
|
+
if (ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(ResetPresence, {
|
|
555
607
|
children: content
|
|
556
|
-
})), process.env.NODE_ENV === "development" && time && time`create-element
|
|
557
|
-
const groupState = curStateRef.group,
|
|
558
|
-
subGroupContext = import_react.default.useMemo(() => {
|
|
559
|
-
if (!(!groupState || !groupName)) return groupState.listeners.clear(), {
|
|
560
|
-
...componentContext.groups,
|
|
561
|
-
// change reference so as we mutate it doesn't affect siblings etc
|
|
562
|
-
state: {
|
|
563
|
-
...componentContext.groups.state,
|
|
564
|
-
[groupName]: {
|
|
565
|
-
pseudo: import_defaultComponentState.defaultComponentStateMounted,
|
|
566
|
-
// capture just initial width and height if they exist
|
|
567
|
-
// will have top, left, width, height (not x, y)
|
|
568
|
-
layout: {
|
|
569
|
-
width: fromPx(splitStyles.style?.width),
|
|
570
|
-
height: fromPx(splitStyles.style?.height)
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
},
|
|
574
|
-
emit: groupState.emit,
|
|
575
|
-
subscribe: groupState.subscribe
|
|
576
|
-
};
|
|
577
|
-
}, [groupName]);
|
|
578
|
-
if (("group" in props || propsIn.focusWithinStyle) && (content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, {
|
|
608
|
+
})), process.env.NODE_ENV === "development" && time && time`create-element`, "focusWithinStyle" in propsIn && (content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, {
|
|
579
609
|
...componentContext,
|
|
580
|
-
groups: subGroupContext,
|
|
581
610
|
setParentFocusState: setStateShallow,
|
|
582
611
|
children: content
|
|
612
|
+
})), "group" in props && (content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_GroupContext.GroupContext.Provider, {
|
|
613
|
+
value: allGroupContexts,
|
|
614
|
+
children: content
|
|
583
615
|
})), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1, stateRef), process.env.NODE_ENV === "development" && time && time`themed-children`, isReactNative && !asChild && (content = /* @__PURE__ */(0, import_jsx_runtime.jsx)("span", {
|
|
584
616
|
className: "_dsp_contents",
|
|
585
617
|
...(isHydrated && events && getWebEvents(events)),
|
|
@@ -610,6 +642,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
610
642
|
(0, import_log.log)("viewProps", viewProps), (0, import_log.log)("children", content), typeof window < "u" && (0, import_log.log)({
|
|
611
643
|
propsIn,
|
|
612
644
|
props,
|
|
645
|
+
attachPress,
|
|
613
646
|
animationStyles,
|
|
614
647
|
classNames,
|
|
615
648
|
content,
|
|
@@ -647,6 +680,14 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
647
680
|
delete globalThis.willPrint, time.print(), time = null;
|
|
648
681
|
}, 50))), content;
|
|
649
682
|
});
|
|
683
|
+
function notifyGroupSubscribers(groupContext, groupEmitter, pseudo) {
|
|
684
|
+
if (!groupContext || !groupEmitter) return;
|
|
685
|
+
const nextState = {
|
|
686
|
+
...groupContext.state,
|
|
687
|
+
pseudo
|
|
688
|
+
};
|
|
689
|
+
groupEmitter.emit(nextState), groupContext.state = nextState;
|
|
690
|
+
}
|
|
650
691
|
staticConfig.componentName && (component.displayName = staticConfig.componentName);
|
|
651
692
|
let res = component;
|
|
652
693
|
(process.env.TAMAGUI_FORCE_MEMO || staticConfig.memo) && (res = import_react.default.memo(res)), res.staticConfig = staticConfig;
|