@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.
@@ -34,13 +34,13 @@ var import_react_native_media_driver = require("@tamagui/react-native-media-driv
34
34
  import_web = require("@tamagui/web"),
35
35
  import_react = require("react"),
36
36
  import_use_element_layout = require("@tamagui/use-element-layout"),
37
- import_addNativeValidStyles = require("./addNativeValidStyles"),
38
- import_createOptimizedView = require("./createOptimizedView"),
39
- import_getBaseViews = require("./getBaseViews"),
40
- import_Pressability = require("./vendor/Pressability"),
37
+ import_addNativeValidStyles = require("./addNativeValidStyles.cjs"),
38
+ import_createOptimizedView = require("./createOptimizedView.cjs"),
39
+ import_getBaseViews = require("./getBaseViews.cjs"),
40
+ import_Pressability = require("./vendor/Pressability.cjs"),
41
41
  import_use_element_layout2 = require("@tamagui/use-element-layout");
42
42
  __reExport(index_exports, require("@tamagui/web"), module.exports);
43
- __reExport(index_exports, require("./reactNativeTypes"), module.exports);
43
+ __reExport(index_exports, require("./reactNativeTypes.cjs"), module.exports);
44
44
  var import_jsx_runtime = require("react/jsx-runtime");
45
45
  (0, import_addNativeValidStyles.addNativeValidStyles)();
46
46
  const TamaguiProvider = props => ((0, import_web.useIsomorphicLayoutEffect)(() => {
package/dist/native.js CHANGED
@@ -2124,7 +2124,7 @@ var require_useMedia_native = __commonJS({
2124
2124
  internalRef.current || (internalRef.current = {
2125
2125
  keys: /* @__PURE__ */ new Set()
2126
2126
  });
2127
- var { keys, lastState = (0, import_config.getSetting)("disableSSR") ? mediaState2 : initState } = internalRef.current;
2127
+ var { keys, lastState = mediaState2 } = internalRef.current;
2128
2128
  keys.size && keys.clear();
2129
2129
  var state = (0, import_react3.useSyncExternalStore)(subscribe, function() {
2130
2130
  if (componentState != null && componentState.enabled) return internalRef.current.lastState = mediaState2, mediaState2;
@@ -2713,13 +2713,15 @@ var require_createStyledContext_native = __commonJS({
2713
2713
  module2.exports = __toCommonJS2(createStyledContext_exports);
2714
2714
  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"];
2715
2715
  function createStyledContext(defaultValues) {
2716
- var OGContext = createReactContext(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map();
2716
+ 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);
2717
2717
  function getOrCreateScopedContext(scope) {
2718
2718
  var ScopedContext = scopedContexts.get(scope);
2719
2719
  return ScopedContext || (ScopedContext = createReactContext(defaultValues), scopedContexts.set(scope, ScopedContext)), ScopedContext;
2720
2720
  }
2721
- var Provider = function(param) {
2722
- var { children, scope, ...values } = param, next = import_react3.default.useMemo(function() {
2721
+ var getNamespacedScope = function(scope) {
2722
+ return namespace ? `${namespace}--${scope}` : scope;
2723
+ }, Provider = function(param) {
2724
+ var { children, scope: scopeIn, ...values } = param, scope = getNamespacedScope(scopeIn), next = import_react3.default.useMemo(function() {
2723
2725
  return {
2724
2726
  // this ! is a workaround for ts error
2725
2727
  ...defaultValues,
@@ -2728,13 +2730,16 @@ var require_createStyledContext_native = __commonJS({
2728
2730
  }, [
2729
2731
  (0, import_objectIdentityKey.objectIdentityKey)(values)
2730
2732
  ]), Provider22 = OGProvider;
2731
- return scope && (Provider22 = getOrCreateScopedContext(scope).Provider), /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Provider22, {
2732
- value: next,
2733
- children
2733
+ return scope && (Provider22 = getOrCreateScopedContext(scope).Provider), /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LastScopeInNamespace.Provider, {
2734
+ value: scope,
2735
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Provider22, {
2736
+ value: next,
2737
+ children
2738
+ })
2734
2739
  });
2735
- }, useStyledContext = function(scope) {
2736
- var context = scope ? getOrCreateScopedContext(scope) : OGContext;
2737
- return import_react3.default.useContext(context);
2740
+ }, useStyledContext = function() {
2741
+ 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);
2742
+ return value;
2738
2743
  };
2739
2744
  return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
2740
2745
  }