@tamagui/core 1.130.8 → 1.131.0

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.
@@ -1938,7 +1938,7 @@ var require_useMedia_native = __commonJS({
1938
1938
  internalRef.current || (internalRef.current = {
1939
1939
  keys: /* @__PURE__ */ new Set()
1940
1940
  });
1941
- var { keys, lastState = (0, import_config.getSetting)("disableSSR") ? mediaState2 : initState } = internalRef.current;
1941
+ var { keys, lastState = mediaState2 } = internalRef.current;
1942
1942
  keys.size && keys.clear();
1943
1943
  var state = (0, import_react3.useSyncExternalStore)(subscribe, function() {
1944
1944
  if (componentState != null && componentState.enabled) return internalRef.current.lastState = mediaState2, mediaState2;
@@ -2454,13 +2454,15 @@ var require_createStyledContext_native = __commonJS({
2454
2454
  module2.exports = __toCommonJS2(createStyledContext_exports);
2455
2455
  var import_jsx_runtime2 = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")), import_objectIdentityKey = require_objectIdentityKey_native(), createReactContext = import_react3.default[Math.random(), "createContext"];
2456
2456
  function createStyledContext(defaultValues) {
2457
- var OGContext = createReactContext(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map();
2457
+ 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);
2458
2458
  function getOrCreateScopedContext(scope) {
2459
2459
  var ScopedContext = scopedContexts.get(scope);
2460
2460
  return ScopedContext || (ScopedContext = createReactContext(defaultValues), scopedContexts.set(scope, ScopedContext)), ScopedContext;
2461
2461
  }
2462
- var Provider = function(param) {
2463
- var { children, scope, ...values } = param, next = import_react3.default.useMemo(function() {
2462
+ var getNamespacedScope = function(scope) {
2463
+ return namespace ? `${namespace}--${scope}` : scope;
2464
+ }, Provider = function(param) {
2465
+ var { children, scope: scopeIn, ...values } = param, scope = getNamespacedScope(scopeIn), next = import_react3.default.useMemo(function() {
2464
2466
  return {
2465
2467
  // this ! is a workaround for ts error
2466
2468
  ...defaultValues,
@@ -2469,13 +2471,16 @@ var require_createStyledContext_native = __commonJS({
2469
2471
  }, [
2470
2472
  (0, import_objectIdentityKey.objectIdentityKey)(values)
2471
2473
  ]), Provider22 = OGProvider;
2472
- return scope && (Provider22 = getOrCreateScopedContext(scope).Provider), /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Provider22, {
2473
- value: next,
2474
- children
2474
+ return scope && (Provider22 = getOrCreateScopedContext(scope).Provider), /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LastScopeInNamespace.Provider, {
2475
+ value: scope,
2476
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Provider22, {
2477
+ value: next,
2478
+ children
2479
+ })
2475
2480
  });
2476
- }, useStyledContext = function(scope) {
2477
- var context = scope ? getOrCreateScopedContext(scope) : OGContext;
2478
- return import_react3.default.useContext(context);
2481
+ }, useStyledContext = function() {
2482
+ var scopeIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", lastScopeInNamespace = (0, import_react3.useContext)(LastScopeInNamespace), scope = namespace ? scopeIn ? getNamespacedScope(scopeIn) : lastScopeInNamespace : scopeIn, context = scope ? getOrCreateScopedContext(scope) : OGContext, value = import_react3.default.useContext(context);
2483
+ return value;
2479
2484
  };
2480
2485
  return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
2481
2486
  }