tamagui 1.125.33 → 1.125.35

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.
@@ -6968,12 +6968,12 @@ var require_useThemeState_native = __commonJS({
6968
6968
  function getNewThemeName() {
6969
6969
  var parentName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", { name, reset, componentName, inverse, debug } = arguments.length > 1 ? arguments[1] : void 0, forceUpdate = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
6970
6970
  if (name && reset) throw new Error("Cannot reset and set a new name at the same time.");
6971
+ var { themes: themes2 } = (0, import_config.getConfig)();
6971
6972
  if (reset) {
6972
- if (!parentName) throw new Error("\u203C\uFE0F");
6973
- var lastPartIndex = parentName.lastIndexOf("_");
6974
- return lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex);
6973
+ var lastPartIndex = parentName.lastIndexOf("_"), name1 = lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex), scheme = parentName.slice(0, lastPartIndex), result = themes2[name1] ? name1 : scheme;
6974
+ return result;
6975
6975
  }
6976
- var { themes: themes2 } = (0, import_config.getConfig)(), parentParts = parentName.split("_"), lastName = parentParts[parentParts.length - 1];
6976
+ var parentParts = parentName.split("_"), lastName = parentParts[parentParts.length - 1];
6977
6977
  lastName && lastName[0].toLowerCase() !== lastName[0] && parentParts.pop();
6978
6978
  for (var subNames = [
6979
6979
  name && componentName ? `${name}_${componentName}` : void 0,
@@ -7002,8 +7002,8 @@ var require_useThemeState_native = __commonJS({
7002
7002
  }
7003
7003
  if (inverse) {
7004
7004
  found || (found = parentName);
7005
- var scheme = found.split("_")[0];
7006
- found = found.replace(new RegExp(`^${scheme}`), scheme === "light" ? "dark" : "light");
7005
+ var scheme1 = found.split("_")[0];
7006
+ found = found.replace(new RegExp(`^${scheme1}`), scheme1 === "light" ? "dark" : "light");
7007
7007
  }
7008
7008
  return !forceUpdate && found === parentName && // if its a scheme only sub-theme, we always consider it "new" because it likely inverses
7009
7009
  // and we want to avoid reparenting
@@ -16003,7 +16003,7 @@ var require_Portal_native = __commonJS({
16003
16003
  return console.info("Note: error importing portal, defaulting to non-native portals", err), null;
16004
16004
  }
16005
16005
  try {
16006
- var _ReactNativeShimModule_default, ReactNativeShimModule = require("react-native/Libraries/Renderer/shims/ReactNative").createPortal, _ReactNativeShimModule_default_createPortal;
16006
+ var _ReactNativeShimModule_default, ReactNativeShimModule = require("react-native/Libraries/Renderer/shims/ReactNative"), _ReactNativeShimModule_default_createPortal;
16007
16007
  return (_ReactNativeShimModule_default_createPortal = ReactNativeShimModule == null || (_ReactNativeShimModule_default = ReactNativeShimModule.default) === null || _ReactNativeShimModule_default === void 0 ? void 0 : _ReactNativeShimModule_default.createPortal) !== null && _ReactNativeShimModule_default_createPortal !== void 0 ? _ReactNativeShimModule_default_createPortal : ReactNativeShimModule.createPortal;
16008
16008
  } catch (err) {
16009
16009
  return console.info("Note: error importing portal, defaulting to non-native portals", err), null;