@tamagui/core 1.111.0 → 1.111.2
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.js +8 -7
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +8 -7
- package/dist/test.native.js.map +2 -2
- package/package.json +6 -6
package/dist/native.js
CHANGED
|
@@ -4259,7 +4259,12 @@ var require_createStyledContext_native = __commonJS({
|
|
|
4259
4259
|
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
4260
4260
|
var import_jsx_runtime = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")), import_objectIdentityKey = require_objectIdentityKey_native();
|
|
4261
4261
|
function createStyledContext(defaultValues) {
|
|
4262
|
-
var OGContext = /* @__PURE__ */ import_react3.default.createContext(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map()
|
|
4262
|
+
var OGContext = /* @__PURE__ */ import_react3.default.createContext(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map();
|
|
4263
|
+
function getOrCreateScopedContext(scope) {
|
|
4264
|
+
var ScopedContext = scopedContexts.get(scope);
|
|
4265
|
+
return ScopedContext || (ScopedContext = /* @__PURE__ */ import_react3.default.createContext(defaultValues), scopedContexts.set(scope, ScopedContext)), ScopedContext;
|
|
4266
|
+
}
|
|
4267
|
+
var Provider = function(param) {
|
|
4263
4268
|
var { children, scope, ...values } = param, next = import_react3.default.useMemo(function() {
|
|
4264
4269
|
return {
|
|
4265
4270
|
// this ! is a workaround for ts error
|
|
@@ -4269,16 +4274,12 @@ var require_createStyledContext_native = __commonJS({
|
|
|
4269
4274
|
}, [
|
|
4270
4275
|
(0, import_objectIdentityKey.objectIdentityKey)(values)
|
|
4271
4276
|
]), Provider22 = OGProvider;
|
|
4272
|
-
|
|
4273
|
-
var ScopedContext = scopedContexts.get(scope);
|
|
4274
|
-
ScopedContext || (ScopedContext = /* @__PURE__ */ import_react3.default.createContext(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider22 = ScopedContext.Provider;
|
|
4275
|
-
}
|
|
4276
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider22, {
|
|
4277
|
+
return scope && (Provider22 = getOrCreateScopedContext(scope).Provider), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider22, {
|
|
4277
4278
|
value: next,
|
|
4278
4279
|
children
|
|
4279
4280
|
});
|
|
4280
4281
|
}, useStyledContext = function(scope) {
|
|
4281
|
-
var context = scope ?
|
|
4282
|
+
var context = scope ? getOrCreateScopedContext(scope) : OGContext;
|
|
4282
4283
|
return import_react3.default.useContext(context);
|
|
4283
4284
|
};
|
|
4284
4285
|
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|