@tamagui/core 2.0.0-rc.13 → 2.0.0-rc.13-1771262617050
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/native.cjs +5 -4
- package/dist/test.native.cjs +5 -4
- package/package.json +10 -10
package/dist/native.cjs
CHANGED
|
@@ -168,12 +168,13 @@ function objectIdentityKey(obj) {
|
|
|
168
168
|
return k;
|
|
169
169
|
}
|
|
170
170
|
var cache$6 = /* @__PURE__ */ new WeakMap();
|
|
171
|
+
var createReactContext = React["createContext"], useReactMemo = React["useMemo"], useReactContext = React["useContext"];
|
|
171
172
|
function createStyledContext(defaultValues) {
|
|
172
173
|
"use no memo";
|
|
173
|
-
var namespace = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", OGContext =
|
|
174
|
+
var namespace = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", OGContext = createReactContext(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), LastScopeInNamespace = createReactContext(namespace);
|
|
174
175
|
function getOrCreateScopedContext(scope) {
|
|
175
176
|
var ScopedContext = scopedContexts.get(scope);
|
|
176
|
-
return ScopedContext || (ScopedContext =
|
|
177
|
+
return ScopedContext || (ScopedContext = createReactContext(defaultValues), scopedContexts.set(scope, ScopedContext)), ScopedContext;
|
|
177
178
|
}
|
|
178
179
|
var getNamespacedScope = function(scope) {
|
|
179
180
|
return namespace ? `${namespace}--${scope}` : scope;
|
|
@@ -187,7 +188,7 @@ function createStyledContext(defaultValues) {
|
|
|
187
188
|
"scope",
|
|
188
189
|
// performance: avoid creating objects
|
|
189
190
|
"__disableMergeDefaultValues"
|
|
190
|
-
]), scope = getNamespacedScope(scopeIn), next =
|
|
191
|
+
]), scope = getNamespacedScope(scopeIn), next = useReactMemo(function() {
|
|
191
192
|
return __disableMergeDefaultValues ? values : mergeProps(defaultValues, values);
|
|
192
193
|
}, [objectIdentityKey(values)]), ScopedProvider = OGProvider;
|
|
193
194
|
return scope && (ScopedProvider = getOrCreateScopedContext(scope).Provider), /* @__PURE__ */ jsxRuntime.jsx(LastScopeInNamespace.Provider, {
|
|
@@ -198,7 +199,7 @@ function createStyledContext(defaultValues) {
|
|
|
198
199
|
})
|
|
199
200
|
});
|
|
200
201
|
}, useStyledContext = function() {
|
|
201
|
-
var scopeIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", lastScopeInNamespace =
|
|
202
|
+
var scopeIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", lastScopeInNamespace = useReactContext(LastScopeInNamespace), scope = namespace ? scopeIn ? getNamespacedScope(scopeIn) : lastScopeInNamespace : scopeIn, context = scope ? getOrCreateScopedContext(scope) : OGContext, value = useReactContext(context);
|
|
202
203
|
return value;
|
|
203
204
|
};
|
|
204
205
|
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|
package/dist/test.native.cjs
CHANGED
|
@@ -148,12 +148,13 @@ function objectIdentityKey(obj) {
|
|
|
148
148
|
return k;
|
|
149
149
|
}
|
|
150
150
|
var cache$5 = /* @__PURE__ */ new WeakMap();
|
|
151
|
+
var createReactContext = React["createContext"], useReactMemo = React["useMemo"], useReactContext = React["useContext"];
|
|
151
152
|
function createStyledContext(defaultValues) {
|
|
152
153
|
"use no memo";
|
|
153
|
-
var namespace = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", OGContext =
|
|
154
|
+
var namespace = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", OGContext = createReactContext(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), LastScopeInNamespace = createReactContext(namespace);
|
|
154
155
|
function getOrCreateScopedContext(scope) {
|
|
155
156
|
var ScopedContext = scopedContexts.get(scope);
|
|
156
|
-
return ScopedContext || (ScopedContext =
|
|
157
|
+
return ScopedContext || (ScopedContext = createReactContext(defaultValues), scopedContexts.set(scope, ScopedContext)), ScopedContext;
|
|
157
158
|
}
|
|
158
159
|
var getNamespacedScope = function(scope) {
|
|
159
160
|
return namespace ? `${namespace}--${scope}` : scope;
|
|
@@ -167,7 +168,7 @@ function createStyledContext(defaultValues) {
|
|
|
167
168
|
"scope",
|
|
168
169
|
// performance: avoid creating objects
|
|
169
170
|
"__disableMergeDefaultValues"
|
|
170
|
-
]), scope = getNamespacedScope(scopeIn), next =
|
|
171
|
+
]), scope = getNamespacedScope(scopeIn), next = useReactMemo(function() {
|
|
171
172
|
return __disableMergeDefaultValues ? values : mergeProps(defaultValues, values);
|
|
172
173
|
}, [objectIdentityKey(values)]), ScopedProvider = OGProvider;
|
|
173
174
|
return scope && (ScopedProvider = getOrCreateScopedContext(scope).Provider), /* @__PURE__ */ jsxRuntime.jsx(LastScopeInNamespace.Provider, {
|
|
@@ -178,7 +179,7 @@ function createStyledContext(defaultValues) {
|
|
|
178
179
|
})
|
|
179
180
|
});
|
|
180
181
|
}, useStyledContext = function() {
|
|
181
|
-
var scopeIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", lastScopeInNamespace =
|
|
182
|
+
var scopeIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", lastScopeInNamespace = useReactContext(LastScopeInNamespace), scope = namespace ? scopeIn ? getNamespacedScope(scopeIn) : lastScopeInNamespace : scopeIn, context = scope ? getOrCreateScopedContext(scope) : OGContext, value = useReactContext(context);
|
|
182
183
|
return value;
|
|
183
184
|
};
|
|
184
185
|
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "2.0.0-rc.13",
|
|
3
|
+
"version": "2.0.0-rc.13-1771262617050",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -80,17 +80,17 @@
|
|
|
80
80
|
"clean:build": "tamagui-build clean:build"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@tamagui/helpers": "2.0.0-rc.13",
|
|
84
|
-
"@tamagui/react-native-media-driver": "2.0.0-rc.13",
|
|
85
|
-
"@tamagui/react-native-use-pressable": "2.0.0-rc.13",
|
|
86
|
-
"@tamagui/use-element-layout": "2.0.0-rc.13",
|
|
87
|
-
"@tamagui/use-event": "2.0.0-rc.13",
|
|
88
|
-
"@tamagui/web": "2.0.0-rc.13"
|
|
83
|
+
"@tamagui/helpers": "2.0.0-rc.13-1771262617050",
|
|
84
|
+
"@tamagui/react-native-media-driver": "2.0.0-rc.13-1771262617050",
|
|
85
|
+
"@tamagui/react-native-use-pressable": "2.0.0-rc.13-1771262617050",
|
|
86
|
+
"@tamagui/use-element-layout": "2.0.0-rc.13-1771262617050",
|
|
87
|
+
"@tamagui/use-event": "2.0.0-rc.13-1771262617050",
|
|
88
|
+
"@tamagui/web": "2.0.0-rc.13-1771262617050"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
|
-
"@tamagui/build": "2.0.0-rc.13",
|
|
92
|
-
"@tamagui/native-bundle": "2.0.0-rc.13",
|
|
93
|
-
"@tamagui/react-native-web-lite": "2.0.0-rc.13",
|
|
91
|
+
"@tamagui/build": "2.0.0-rc.13-1771262617050",
|
|
92
|
+
"@tamagui/native-bundle": "2.0.0-rc.13-1771262617050",
|
|
93
|
+
"@tamagui/react-native-web-lite": "2.0.0-rc.13-1771262617050",
|
|
94
94
|
"@testing-library/react": "^16.1.0",
|
|
95
95
|
"csstype": "^3.0.10",
|
|
96
96
|
"react": ">=19",
|