tamagui 1.85.9-1705340264375 → 1.85.11

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
@@ -1366,9 +1366,7 @@ var require_insertStyleRule_native = __commonJS({
1366
1366
  theme: values
1367
1367
  };
1368
1368
  for (let selector of selectors) {
1369
- let scheme = selector.includes("t_dark") ? "dark" : selector.includes("t_light") ? "light" : "", name = selector.slice(selector.lastIndexOf(".t_") + 3);
1370
- name.startsWith(scheme) && (name = name.slice(scheme.length + 1)), scheme === name && (scheme = "");
1371
- let themeName = `${scheme}${scheme && name ? "_" : ""}${name}`;
1369
+ let matches = selector.match(/(.t_(light|dark))?[\s]?(.t_([a-z0-9_]+))[\s]*$/i) || [], [_0, _1, scheme, _2, name] = matches, themeName = name && scheme && scheme !== name ? `${scheme}_${name}` : name || scheme;
1372
1370
  dedupedEntry.names.includes(themeName) || dedupedEntry.names.push(themeName);
1373
1371
  }
1374
1372
  return dedupedEntry;
@@ -1815,7 +1813,7 @@ var require_ThemeManager_native = __commonJS({
1815
1813
  return this.updateState(nextState, shouldNotify), nextState;
1816
1814
  }
1817
1815
  updateState(nextState, shouldNotify = !0) {
1818
- this.state = nextState, this._allKeys = null, process.env.NODE_ENV !== "production" && (this._numChangeEventsSent ??= 0, this._numChangeEventsSent++), shouldNotify && this.notify();
1816
+ this.state = nextState, this._allKeys = null, shouldNotify && this.notify();
1819
1817
  }
1820
1818
  getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
1821
1819
  let _ = this.getState(props, parentManager);
@@ -1838,7 +1836,7 @@ var require_ThemeManager_native = __commonJS({
1838
1836
  ]), this._allKeys;
1839
1837
  }
1840
1838
  notify(forced = !1) {
1841
- this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
1839
+ this.themeListeners.forEach((cb) => cb(this.state.name, this, forced)), process.env.NODE_ENV !== "production" && (this._numChangeEventsSent ??= 0, this._numChangeEventsSent++);
1842
1840
  }
1843
1841
  onChangeTheme(cb, debugId) {
1844
1842
  return process.env.NODE_ENV !== "production" && debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
@@ -2074,11 +2072,11 @@ If this is intended and you are using Tamagui without any themes, you can disabl
2074
2072
  }
2075
2073
  return !1;
2076
2074
  }
2077
- var activeThemeManagers = /* @__PURE__ */ new Set(), _idToManager = /* @__PURE__ */ new Map(), getThemeManager = (id) => {
2078
- var _a;
2079
- return (_a = _idToManager.get(id)) == null ? void 0 : _a.deref();
2080
- }, registerThemeManager = (t) => {
2081
- _idToManager.set(t.id, new WeakRef(t));
2075
+ var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = (id) => _idToUID[id], getThemeManager = (id) => _uidToManager.get(getId(id)), registerThemeManager = (t) => {
2076
+ if (!_idToUID[t.id]) {
2077
+ let id = _idToUID[t.id] = {};
2078
+ _uidToManager.set(id, t);
2079
+ }
2082
2080
  }, useChangeThemeEffect = (props, isRoot = !1, keys, shouldUpdate) => {
2083
2081
  let { disable } = props, parentManagerId = (0, import_react2.useContext)(import_ThemeManagerContext.ThemeManagerIDContext), parentManager = getThemeManager(parentManagerId);
2084
2082
  if (!isRoot && !parentManager || disable)