tamagui 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 +54 -54
package/dist/native.js
CHANGED
|
@@ -4404,7 +4404,12 @@ var require_createStyledContext_native = __commonJS({
|
|
|
4404
4404
|
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
4405
4405
|
var import_jsx_runtime6 = require("react/jsx-runtime"), import_react4 = __toESM2(require("react")), import_objectIdentityKey = require_objectIdentityKey_native();
|
|
4406
4406
|
function createStyledContext2(defaultValues) {
|
|
4407
|
-
var OGContext = /* @__PURE__ */ import_react4.default.createContext(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map()
|
|
4407
|
+
var OGContext = /* @__PURE__ */ import_react4.default.createContext(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map();
|
|
4408
|
+
function getOrCreateScopedContext(scope) {
|
|
4409
|
+
var ScopedContext = scopedContexts.get(scope);
|
|
4410
|
+
return ScopedContext || (ScopedContext = /* @__PURE__ */ import_react4.default.createContext(defaultValues), scopedContexts.set(scope, ScopedContext)), ScopedContext;
|
|
4411
|
+
}
|
|
4412
|
+
var Provider = function(param) {
|
|
4408
4413
|
var { children, scope, ...values } = param, next = import_react4.default.useMemo(function() {
|
|
4409
4414
|
return {
|
|
4410
4415
|
// this ! is a workaround for ts error
|
|
@@ -4414,16 +4419,12 @@ var require_createStyledContext_native = __commonJS({
|
|
|
4414
4419
|
}, [
|
|
4415
4420
|
(0, import_objectIdentityKey.objectIdentityKey)(values)
|
|
4416
4421
|
]), Provider22 = OGProvider2;
|
|
4417
|
-
|
|
4418
|
-
var ScopedContext = scopedContexts.get(scope);
|
|
4419
|
-
ScopedContext || (ScopedContext = /* @__PURE__ */ import_react4.default.createContext(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider22 = ScopedContext.Provider;
|
|
4420
|
-
}
|
|
4421
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider22, {
|
|
4422
|
+
return scope && (Provider22 = getOrCreateScopedContext(scope).Provider), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider22, {
|
|
4422
4423
|
value: next,
|
|
4423
4424
|
children
|
|
4424
4425
|
});
|
|
4425
4426
|
}, useStyledContext = function(scope) {
|
|
4426
|
-
var context = scope ?
|
|
4427
|
+
var context = scope ? getOrCreateScopedContext(scope) : OGContext;
|
|
4427
4428
|
return import_react4.default.useContext(context);
|
|
4428
4429
|
};
|
|
4429
4430
|
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|