tamagui 1.125.34 → 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.
package/dist/native.js CHANGED
@@ -7361,12 +7361,12 @@ var require_useThemeState_native = __commonJS({
7361
7361
  function getNewThemeName() {
7362
7362
  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;
7363
7363
  if (name && reset) throw new Error(process.env.NODE_ENV === "production" ? "\u274C004" : "Cannot reset and set a new name at the same time.");
7364
+ var { themes: themes2 } = (0, import_config.getConfig)();
7364
7365
  if (reset) {
7365
- if (!parentName) throw new Error("\u203C\uFE0F");
7366
- var lastPartIndex = parentName.lastIndexOf("_");
7367
- return lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex);
7366
+ var lastPartIndex = parentName.lastIndexOf("_"), name1 = lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex), scheme = parentName.slice(0, lastPartIndex), result = themes2[name1] ? name1 : scheme;
7367
+ return result;
7368
7368
  }
7369
- var { themes: themes2 } = (0, import_config.getConfig)(), parentParts = parentName.split("_"), lastName = parentParts[parentParts.length - 1];
7369
+ var parentParts = parentName.split("_"), lastName = parentParts[parentParts.length - 1];
7370
7370
  lastName && lastName[0].toLowerCase() !== lastName[0] && parentParts.pop();
7371
7371
  for (var subNames = [
7372
7372
  name && componentName ? `${name}_${componentName}` : void 0,
@@ -7395,8 +7395,8 @@ var require_useThemeState_native = __commonJS({
7395
7395
  }
7396
7396
  if (inverse) {
7397
7397
  found || (found = parentName);
7398
- var scheme = found.split("_")[0];
7399
- found = found.replace(new RegExp(`^${scheme}`), scheme === "light" ? "dark" : "light");
7398
+ var scheme1 = found.split("_")[0];
7399
+ found = found.replace(new RegExp(`^${scheme1}`), scheme1 === "light" ? "dark" : "light");
7400
7400
  }
7401
7401
  return !forceUpdate && found === parentName && // if its a scheme only sub-theme, we always consider it "new" because it likely inverses
7402
7402
  // and we want to avoid reparenting