@tamagui/core 1.85.8 → 1.85.10

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
@@ -1502,9 +1502,7 @@ var require_insertStyleRule_native = __commonJS({
1502
1502
  theme: values
1503
1503
  };
1504
1504
  for (let selector of selectors) {
1505
- let scheme = selector.includes("t_dark") ? "dark" : selector.includes("t_light") ? "light" : "", name = selector.slice(selector.lastIndexOf(".t_") + 3);
1506
- name.startsWith(scheme) && (name = name.slice(scheme.length + 1)), scheme === name && (scheme = "");
1507
- let themeName = `${scheme}${scheme && name ? "_" : ""}${name}`;
1505
+ 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;
1508
1506
  dedupedEntry.names.includes(themeName) || dedupedEntry.names.push(themeName);
1509
1507
  }
1510
1508
  return dedupedEntry;
@@ -1951,7 +1949,7 @@ var require_ThemeManager_native = __commonJS({
1951
1949
  return this.updateState(nextState, shouldNotify), nextState;
1952
1950
  }
1953
1951
  updateState(nextState, shouldNotify = !0) {
1954
- this.state = nextState, this._allKeys = null, process.env.NODE_ENV !== "production" && (this._numChangeEventsSent ??= 0, this._numChangeEventsSent++), shouldNotify && this.notify();
1952
+ this.state = nextState, this._allKeys = null, shouldNotify && this.notify();
1955
1953
  }
1956
1954
  getStateIfChanged(props = this.props, state = this.state, parentManager = this.parentManager) {
1957
1955
  let _ = this.getState(props, parentManager);
@@ -1974,7 +1972,7 @@ var require_ThemeManager_native = __commonJS({
1974
1972
  ]), this._allKeys;
1975
1973
  }
1976
1974
  notify(forced = !1) {
1977
- this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
1975
+ this.themeListeners.forEach((cb) => cb(this.state.name, this, forced)), process.env.NODE_ENV !== "production" && (this._numChangeEventsSent ??= 0, this._numChangeEventsSent++);
1978
1976
  }
1979
1977
  onChangeTheme(cb, debugId) {
1980
1978
  return process.env.NODE_ENV !== "production" && debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
@@ -2210,11 +2208,11 @@ If this is intended and you are using Tamagui without any themes, you can disabl
2210
2208
  }
2211
2209
  return !1;
2212
2210
  }
2213
- var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = (id) => _idToUID[id], getThemeManager = (id) => _uidToManager.get(getId(id)), registerThemeManager = (t) => {
2214
- if (!_idToUID[t.id]) {
2215
- let id = _idToUID[t.id] = {};
2216
- _uidToManager.set(id, t);
2217
- }
2211
+ var activeThemeManagers = /* @__PURE__ */ new Set(), _idToManager = /* @__PURE__ */ new Map(), getThemeManager = (id) => {
2212
+ var _a;
2213
+ return (_a = _idToManager.get(id)) == null ? void 0 : _a.deref();
2214
+ }, registerThemeManager = (t) => {
2215
+ _idToManager.set(t.id, new WeakRef(t));
2218
2216
  }, useChangeThemeEffect = (props, isRoot = !1, keys, shouldUpdate) => {
2219
2217
  let { disable } = props, parentManagerId = (0, import_react3.useContext)(import_ThemeManagerContext.ThemeManagerIDContext), parentManager = getThemeManager(parentManagerId);
2220
2218
  if (!isRoot && !parentManager || disable)