@tamagui/web 1.129.12 → 1.129.14
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 +130 -89
- package/dist/cjs/createComponent.js +139 -93
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createComponent.native.js +153 -105
- 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 +1 -40
- package/dist/cjs/hooks/useComponentState.js +1 -30
- package/dist/cjs/hooks/useComponentState.js.map +2 -2
- package/dist/cjs/hooks/useComponentState.native.js +3 -45
- 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 +140 -92
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createComponent.mjs +130 -89
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +148 -101
- 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 +1 -30
- package/dist/esm/hooks/useComponentState.js.map +2 -2
- package/dist/esm/hooks/useComponentState.mjs +1 -40
- package/dist/esm/hooks/useComponentState.mjs.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +4 -48
- 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 +247 -108
- 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 +5 -49
- 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 +32 -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 +21 -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"),
|
|
@@ -63,8 +65,11 @@ var import_compose_refs = require("@tamagui/compose-refs"),
|
|
|
63
65
|
import_Slot = require("./views/Slot.cjs"),
|
|
64
66
|
import_Theme = require("./views/Theme.cjs"),
|
|
65
67
|
import_jsx_runtime = require("react/jsx-runtime");
|
|
66
|
-
let time
|
|
67
|
-
const
|
|
68
|
+
let time;
|
|
69
|
+
const NextState = /* @__PURE__ */new WeakMap();
|
|
70
|
+
let debugKeyListeners, startVisualizer;
|
|
71
|
+
const componentSetStates = /* @__PURE__ */new Set(),
|
|
72
|
+
avoidReRenderKeys = /* @__PURE__ */new Set(["hover", "press", "pressIn", "group", "focus", "focusWithin", "media", "group"]);
|
|
68
73
|
if (typeof window < "u") {
|
|
69
74
|
const cancelTouches = () => {
|
|
70
75
|
componentSetStates.forEach(setState => setState(prev => prev.press || prev.pressIn ? {
|
|
@@ -75,11 +80,11 @@ if (typeof window < "u") {
|
|
|
75
80
|
};
|
|
76
81
|
addEventListener("mouseup", cancelTouches), addEventListener("touchend", cancelTouches), addEventListener("touchcancel", cancelTouches), process.env.NODE_ENV === "development" && (startVisualizer = () => {
|
|
77
82
|
const devVisualizerConfig = import_config.devConfig?.visualizer;
|
|
78
|
-
if (devVisualizerConfig) {
|
|
83
|
+
if (devVisualizerConfig && !globalThis.__tamaguiDevVisualizer) {
|
|
79
84
|
let show = function (val) {
|
|
80
85
|
clearTimeout(tm), isShowing = val, debugKeyListeners?.forEach(l => l(val));
|
|
81
86
|
};
|
|
82
|
-
debugKeyListeners = /* @__PURE__ */new Set();
|
|
87
|
+
globalThis.__tamaguiDevVisualizer = !0, debugKeyListeners = /* @__PURE__ */new Set();
|
|
83
88
|
let tm,
|
|
84
89
|
isShowing = !1;
|
|
85
90
|
const options = {
|
|
@@ -109,12 +114,12 @@ let BaseText, BaseView;
|
|
|
109
114
|
const lastInteractionWasKeyboard = {
|
|
110
115
|
value: !1
|
|
111
116
|
};
|
|
112
|
-
import_constants.isWeb &&
|
|
113
|
-
lastInteractionWasKeyboard.value = !0;
|
|
117
|
+
import_constants.isWeb && typeof document < "u" && (document.addEventListener("keydown", () => {
|
|
118
|
+
lastInteractionWasKeyboard.value || (lastInteractionWasKeyboard.value = !0);
|
|
114
119
|
}), document.addEventListener("mousedown", () => {
|
|
115
|
-
lastInteractionWasKeyboard.value = !1;
|
|
120
|
+
lastInteractionWasKeyboard.value && (lastInteractionWasKeyboard.value = !1);
|
|
116
121
|
}), document.addEventListener("mousemove", () => {
|
|
117
|
-
lastInteractionWasKeyboard.value = !1;
|
|
122
|
+
lastInteractionWasKeyboard.value && (lastInteractionWasKeyboard.value = !1);
|
|
118
123
|
}));
|
|
119
124
|
function createComponent(staticConfig) {
|
|
120
125
|
const {
|
|
@@ -145,7 +150,6 @@ function createComponent(staticConfig) {
|
|
|
145
150
|
const component = import_react.default.forwardRef((propsIn, forwardedRef) => {
|
|
146
151
|
const internalID = process.env.NODE_ENV === "development" ? import_react.default.useId() : "";
|
|
147
152
|
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
153
|
let styledContextProps, overriddenContextProps, contextValue;
|
|
150
154
|
const {
|
|
151
155
|
context,
|
|
@@ -175,7 +179,7 @@ function createComponent(staticConfig) {
|
|
|
175
179
|
process.env.NODE_ENV === "development" && import_constants.isClient && import_react.default.useEffect(() => {
|
|
176
180
|
let overlay = null;
|
|
177
181
|
const debugVisualizerHandler = (show = !1) => {
|
|
178
|
-
const node =
|
|
182
|
+
const node = stateRef.current.host;
|
|
179
183
|
if (node) if (show) {
|
|
180
184
|
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
185
|
const dataAt = node.getAttribute("data-at") || "",
|
|
@@ -188,11 +192,12 @@ function createComponent(staticConfig) {
|
|
|
188
192
|
debugKeyListeners?.delete(debugVisualizerHandler);
|
|
189
193
|
};
|
|
190
194
|
}, [componentName2]);
|
|
191
|
-
const
|
|
195
|
+
const componentContext = import_react.default.useContext(import_ComponentContext.ComponentContext),
|
|
196
|
+
groupContextParent = import_react.default.useContext(import_GroupContext.GroupContext),
|
|
197
|
+
animationDriver = componentContext.animationDriver,
|
|
192
198
|
useAnimations = animationDriver?.useAnimations,
|
|
193
|
-
componentState = (0, import_useComponentState.useComponentState)(props,
|
|
199
|
+
componentState = (0, import_useComponentState.useComponentState)(props, animationDriver, staticConfig, config),
|
|
194
200
|
{
|
|
195
|
-
curStateRef,
|
|
196
201
|
disabled,
|
|
197
202
|
groupName,
|
|
198
203
|
hasAnimationProp,
|
|
@@ -211,6 +216,43 @@ function createComponent(staticConfig) {
|
|
|
211
216
|
willBeAnimatedClient,
|
|
212
217
|
startedUnhydrated
|
|
213
218
|
} = componentState;
|
|
219
|
+
hasAnimationProp && animationDriver?.avoidReRenders && (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
220
|
+
const pendingState = NextState.get(stateRef);
|
|
221
|
+
pendingState && (setStateShallow(pendingState), NextState.set(stateRef, void 0));
|
|
222
|
+
});
|
|
223
|
+
const allGroupContexts = (0, import_react.useMemo)(() => {
|
|
224
|
+
if (!groupName) return groupContextParent;
|
|
225
|
+
stateRef.current.group?.listeners.clear();
|
|
226
|
+
const listeners = /* @__PURE__ */new Set();
|
|
227
|
+
return stateRef.current.group = {
|
|
228
|
+
listeners,
|
|
229
|
+
emit(state2) {
|
|
230
|
+
listeners.forEach(l => l(state2));
|
|
231
|
+
},
|
|
232
|
+
subscribe(cb) {
|
|
233
|
+
return listeners.add(cb), listeners.size === 1 && setStateShallow({
|
|
234
|
+
hasDynGroupChildren: !0
|
|
235
|
+
}), () => {
|
|
236
|
+
listeners.delete(cb), listeners.size === 0 && setStateShallow({
|
|
237
|
+
hasDynGroupChildren: !1
|
|
238
|
+
});
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
}, {
|
|
242
|
+
...groupContextParent,
|
|
243
|
+
[groupName]: {
|
|
244
|
+
state: {
|
|
245
|
+
pseudo: import_defaultComponentState.defaultComponentStateMounted
|
|
246
|
+
},
|
|
247
|
+
subscribe: listener => {
|
|
248
|
+
const dispose = stateRef.current.group?.subscribe(listener);
|
|
249
|
+
return () => {
|
|
250
|
+
dispose?.();
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
}, [stateRef, groupName, groupContextParent]);
|
|
214
256
|
let setStateShallow = componentState.setStateShallow;
|
|
215
257
|
process.env.NODE_ENV === "development" && time && time`use-state`;
|
|
216
258
|
const hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText),
|
|
@@ -225,14 +267,14 @@ function createComponent(staticConfig) {
|
|
|
225
267
|
// things declaratively
|
|
226
268
|
!animationDriver.needsWebStyles && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
|
|
227
269
|
const disableTheme = props["data-disable-theme"] || isHOC;
|
|
228
|
-
process.env.NODE_ENV === "development" && time && time`theme-props`, props.themeShallow && (
|
|
270
|
+
process.env.NODE_ENV === "development" && time && time`theme-props`, props.themeShallow && (stateRef.current.themeShallow = !0);
|
|
229
271
|
const themeStateProps = {
|
|
230
272
|
componentName: componentName2,
|
|
231
273
|
disable: disableTheme,
|
|
232
|
-
shallow:
|
|
274
|
+
shallow: stateRef.current.themeShallow,
|
|
233
275
|
debug: debugProp
|
|
234
276
|
};
|
|
235
|
-
if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof
|
|
277
|
+
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
278
|
const name = `${componentName2 || Component?.displayName || Component?.name || "[Unnamed Component]"}`,
|
|
237
279
|
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
280
|
dataIs = propsIn["data-is"] || "",
|
|
@@ -253,7 +295,8 @@ function createComponent(staticConfig) {
|
|
|
253
295
|
themeStateProps
|
|
254
296
|
}), (0, import_log.log)({
|
|
255
297
|
contextProps: styledContextProps,
|
|
256
|
-
overriddenContextProps
|
|
298
|
+
overriddenContextProps,
|
|
299
|
+
componentContext
|
|
257
300
|
}), (0, import_log.log)({
|
|
258
301
|
presence,
|
|
259
302
|
isAnimated,
|
|
@@ -284,24 +327,51 @@ function createComponent(staticConfig) {
|
|
|
284
327
|
},
|
|
285
328
|
themeName = themeState?.name || "";
|
|
286
329
|
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
|
-
|
|
330
|
+
const splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp),
|
|
331
|
+
groupContext = groupName && allGroupContexts?.[groupName] || null;
|
|
332
|
+
if (groupContext) {
|
|
333
|
+
const groupState = groupContext?.state;
|
|
334
|
+
groupState && groupState.layout === void 0 && (splitStyles.style?.width || splitStyles.style?.height) && (groupState.layout = {
|
|
335
|
+
width: fromPx(splitStyles.style.width),
|
|
336
|
+
height: fromPx(splitStyles.style.height)
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
if ((hasAnimationProp || groupName) && animationDriver?.avoidReRenders) {
|
|
289
340
|
const styleListener = stateRef.current.useStyleListener,
|
|
290
341
|
ogSetStateShallow = setStateShallow;
|
|
291
|
-
setStateShallow =
|
|
292
|
-
const
|
|
293
|
-
|
|
342
|
+
stateRef.current.setStateShallow = nextOrGetNext => {
|
|
343
|
+
const prev = NextState.get(stateRef) || state,
|
|
344
|
+
next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
|
|
345
|
+
if (next === prev || (0, import_is_equal_shallow.isEqualShallow)(prev, next)) return;
|
|
346
|
+
const canAvoidReRender = Object.keys(next).every(key => avoidReRenderKeys.has(key));
|
|
347
|
+
if (canAvoidReRender) {
|
|
294
348
|
const updatedState = {
|
|
295
|
-
...
|
|
349
|
+
...prev,
|
|
296
350
|
...next
|
|
297
351
|
};
|
|
298
|
-
stateRef.
|
|
299
|
-
|
|
352
|
+
NextState.set(stateRef, updatedState), process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && (console.groupCollapsed("[\u26A1\uFE0F] avoid setState", next, {
|
|
353
|
+
updatedState,
|
|
354
|
+
props
|
|
355
|
+
}), console.info(stateRef.current.host), console.groupEnd());
|
|
356
|
+
const {
|
|
357
|
+
group,
|
|
358
|
+
hasDynGroupChildren,
|
|
359
|
+
unmounted,
|
|
360
|
+
animation,
|
|
361
|
+
...childrenGroupState
|
|
362
|
+
} = updatedState;
|
|
363
|
+
if (groupContext && notifyGroupSubscribers(groupContext, stateRef.current.group || null, childrenGroupState), !hasAnimationProp || !styleListener) return;
|
|
364
|
+
const nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp);
|
|
300
365
|
styleListener(nextStyles.style);
|
|
301
|
-
} else
|
|
366
|
+
} else process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && console.info("[\u{1F40C}] re-render", {
|
|
367
|
+
canAvoidReRender,
|
|
368
|
+
next
|
|
369
|
+
}), ogSetStateShallow(next);
|
|
370
|
+
}, setStateShallow = state2 => {
|
|
371
|
+
stateRef.current.setStateShallow?.(state2);
|
|
302
372
|
};
|
|
303
373
|
}
|
|
304
|
-
process.env.NODE_ENV === "development" && time && time`split-styles`, props.group && props.untilMeasured === "hide" && !
|
|
374
|
+
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
375
|
const hasRuntimeMediaKeys = splitStyles.hasMedia && splitStyles.hasMedia !== !0,
|
|
306
376
|
shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || hasRuntimeMediaKeys || noClass && splitStyles.hasMedia === !0,
|
|
307
377
|
mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
|
|
@@ -369,14 +439,14 @@ function createComponent(staticConfig) {
|
|
|
369
439
|
}
|
|
370
440
|
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
441
|
|
|
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`,
|
|
442
|
+
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
443
|
const layout = e.nativeEvent.layout;
|
|
374
|
-
|
|
444
|
+
groupContext.state.layout = layout, stateRef.current.group?.emit({
|
|
375
445
|
layout
|
|
376
446
|
}), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(prev => ({
|
|
377
447
|
...prev
|
|
378
448
|
})), stateRef.current.hasMeasured = !0;
|
|
379
|
-
})), viewProps = import_setupHooks.hooks.usePropsTransform?.(elementType, nonTamaguiProps, stateRef,
|
|
449
|
+
})), 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
450
|
typeof item == "string" && item !== `
|
|
381
451
|
` && console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <${staticConfig.componentName || propsIn.tag || "View"}>.`, props);
|
|
382
452
|
}), process.env.NODE_ENV === "development" && time && time`events-hooks`;
|
|
@@ -421,31 +491,21 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
421
491
|
});
|
|
422
492
|
return;
|
|
423
493
|
}
|
|
424
|
-
|
|
425
|
-
|
|
494
|
+
return () => {
|
|
495
|
+
componentSetStates.delete(setState);
|
|
496
|
+
};
|
|
497
|
+
}, [state.unmounted, disabled]), (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
498
|
+
if (!disabled && !(!pseudoGroups && !mediaGroups) && allGroupContexts) return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
|
|
499
|
+
groupContext: allGroupContexts,
|
|
426
500
|
setStateShallow,
|
|
427
|
-
state,
|
|
428
501
|
mediaGroups,
|
|
429
502
|
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
503
|
});
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
};
|
|
446
|
-
groupContextState[groupName] = next;
|
|
447
|
-
}
|
|
448
|
-
}, [groupName, state]);
|
|
504
|
+
}, [allGroupContexts, disabled, pseudoGroups ? Object.keys([...pseudoGroups]).join("") : 0, mediaGroups ? Object.keys([...mediaGroups]).join("") : 0]);
|
|
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;
|