tamagui 1.105.6 → 1.105.8

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
@@ -2583,6 +2583,9 @@ var require_insertStyleRule_native = __commonJS({
2583
2583
  scanAllSheets: function() {
2584
2584
  return scanAllSheets;
2585
2585
  },
2586
+ setNonce: function() {
2587
+ return setNonce2;
2588
+ },
2586
2589
  shouldInsertStyleRules: function() {
2587
2590
  return shouldInsertStyleRules;
2588
2591
  },
@@ -2859,12 +2862,20 @@ var require_insertStyleRule_native = __commonJS({
2859
2862
  var getIdentifierFromTamaguiSelector = function(selector) {
2860
2863
  var dotIndex = selector.indexOf(":");
2861
2864
  return dotIndex > -1 ? selector.slice(7, dotIndex) : selector.slice(7);
2862
- }, sheet = import_constants4.isClient && document.head ? document.head.appendChild(document.createElement("style")).sheet : null;
2865
+ }, sheet = null;
2863
2866
  function updateRules(identifier, rules) {
2864
2867
  if (!process.env.TAMAGUI_REACT_19) return identifier in allRules ? !1 : (allRules[identifier] = rules.join(" "), identifier.startsWith("_transform-") ? addTransform(identifier, rules[0]) : !0);
2865
2868
  }
2869
+ var nonce = "";
2870
+ function setNonce2(_) {
2871
+ nonce = _;
2872
+ }
2866
2873
  function insertStyleRules(rulesToInsert) {
2867
2874
  if (!process.env.TAMAGUI_REACT_19) {
2875
+ if (!sheet && import_constants4.isClient && document.head) {
2876
+ var styleTag = document.createElement("style");
2877
+ nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
2878
+ }
2868
2879
  if (!sheet) return;
2869
2880
  for (var key in rulesToInsert) {
2870
2881
  var styleObject = rulesToInsert[key], identifier = styleObject[import_helpers.StyleObjectIdentifier];
@@ -8711,7 +8722,7 @@ var require_Theme_native = __commonJS({
8711
8722
  }
8712
8723
  });
8713
8724
  module2.exports = __toCommonJS2(Theme_exports);
8714
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_constants4 = require_index_native6(), import_react4 = __toESM2(require("react")), import_createVariable = require_createVariable_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native(), import_ThemeDebug = require_ThemeDebug_native();
8725
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_constants4 = require_index_native6(), import_react4 = __toESM2(require("react")), import_createVariable = require_createVariable_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_log = require_log_native();
8715
8726
  function _define_property9(obj, key, value) {
8716
8727
  return key in obj ? Object.defineProperty(obj, key, {
8717
8728
  value,
@@ -8764,8 +8775,9 @@ var require_Theme_native = __commonJS({
8764
8775
  function getThemedChildren(themeState, children, props) {
8765
8776
  var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, stateRef = arguments.length > 4 ? arguments[4] : void 0, themeManager = themeState.themeManager, isNewTheme = themeState.isNewTheme;
8766
8777
  if (!themeManager) throw new Error(process.env.NODE_ENV === "development" ? "\u274C No theme found, either incorrect name, potential duplicate tamagui deps, or TamaguiProvider not providing themes." : "\u274C 005");
8767
- var shallow = props.shallow, forceClassName = props.forceClassName, shouldRenderChildrenWithTheme = isNewTheme || "inverse" in props || "name" in props || stateRef.current.hasEverThemed || isRoot;
8778
+ var shallow = props.shallow, forceClassName = props.forceClassName, shouldRenderChildrenWithTheme = isNewTheme || isRoot || stateRef.current.hasEverThemed || typeof props.inverse == "boolean";
8768
8779
  if (shouldRenderChildrenWithTheme && (stateRef.current.hasEverThemed = !0), !shouldRenderChildrenWithTheme) return children;
8780
+ process.env.NODE_ENV === "development" && shouldRenderChildrenWithTheme && props.debug && (0, import_log.log)("adding theme: isRoot ".concat(isRoot, ", inverse ").concat("inverse" in props, ", isNewTheme ").concat(isNewTheme, ", hasEver ").concat(stateRef.current.hasEverThemed), props);
8769
8781
  var next = children;
8770
8782
  shallow && (next = import_react4.Children.toArray(children).map(function(child) {
8771
8783
  return /* @__PURE__ */ (0, import_react4.isValidElement)(child) ? /* @__PURE__ */ (0, import_react4.cloneElement)(child, void 0, /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Theme2, {
@@ -13259,6 +13271,9 @@ var require_index_native13 = __commonJS({
13259
13271
  mediaState: function() {
13260
13272
  return import_useMedia.mediaState;
13261
13273
  },
13274
+ setNonce: function() {
13275
+ return import_insertStyleRule.setNonce;
13276
+ },
13262
13277
  setupDev: function() {
13263
13278
  return import_config.setupDev;
13264
13279
  },
@@ -13283,7 +13298,7 @@ var require_index_native13 = __commonJS({
13283
13298
  __reExport2(src_exports2, require_styled_native(), module2.exports);
13284
13299
  __reExport2(src_exports2, require_setupReactNative_native(), module2.exports);
13285
13300
  __reExport2(src_exports2, require_GetRef_native(), module2.exports);
13286
- var import_config = require_config_native();
13301
+ var import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native();
13287
13302
  __reExport2(src_exports2, require_constants_native2(), module2.exports);
13288
13303
  __reExport2(src_exports2, require_ComponentContext_native(), module2.exports);
13289
13304
  __reExport2(src_exports2, require_withStableStyle_native(), module2.exports);