@tamagui/core 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 +6 -6
- package/dist/native.js.map +1 -1
- package/dist/test.native.js +6 -6
- package/dist/test.native.js.map +1 -1
- package/package.json +7 -7
package/dist/test.native.js
CHANGED
|
@@ -5869,12 +5869,12 @@ var require_useThemeState_native = __commonJS({
|
|
|
5869
5869
|
function getNewThemeName() {
|
|
5870
5870
|
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;
|
|
5871
5871
|
if (name && reset) throw new Error("Cannot reset and set a new name at the same time.");
|
|
5872
|
+
var { themes: themes2 } = (0, import_config.getConfig)();
|
|
5872
5873
|
if (reset) {
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
return lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex);
|
|
5874
|
+
var lastPartIndex = parentName.lastIndexOf("_"), name1 = lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex), scheme = parentName.slice(0, lastPartIndex), result = themes2[name1] ? name1 : scheme;
|
|
5875
|
+
return result;
|
|
5876
5876
|
}
|
|
5877
|
-
var
|
|
5877
|
+
var parentParts = parentName.split("_"), lastName = parentParts[parentParts.length - 1];
|
|
5878
5878
|
lastName && lastName[0].toLowerCase() !== lastName[0] && parentParts.pop();
|
|
5879
5879
|
for (var subNames = [
|
|
5880
5880
|
name && componentName ? `${name}_${componentName}` : void 0,
|
|
@@ -5903,8 +5903,8 @@ var require_useThemeState_native = __commonJS({
|
|
|
5903
5903
|
}
|
|
5904
5904
|
if (inverse) {
|
|
5905
5905
|
found || (found = parentName);
|
|
5906
|
-
var
|
|
5907
|
-
found = found.replace(new RegExp(`^${
|
|
5906
|
+
var scheme1 = found.split("_")[0];
|
|
5907
|
+
found = found.replace(new RegExp(`^${scheme1}`), scheme1 === "light" ? "dark" : "light");
|
|
5908
5908
|
}
|
|
5909
5909
|
return !forceUpdate && found === parentName && // if its a scheme only sub-theme, we always consider it "new" because it likely inverses
|
|
5910
5910
|
// and we want to avoid reparenting
|