Socket
Socket
Sign inDemoInstall

@tamagui/web

Package Overview
Dependencies
Maintainers
1
Versions
751
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tamagui/web - npm Package Compare versions

Comparing version 1.105.6 to 1.105.7

12

dist/cjs/helpers/insertStyleRule.js

@@ -24,2 +24,3 @@ var __defProp = Object.defineProperty;

scanAllSheets: () => scanAllSheets,
setNonce: () => setNonce,
shouldInsertStyleRules: () => shouldInsertStyleRules,

@@ -180,3 +181,4 @@ updateRules: () => updateRules

return dotIndex > -1 ? selector.slice(7, dotIndex) : selector.slice(7);
}, sheet = import_constants.isClient && document.head ? document.head.appendChild(document.createElement("style")).sheet : null;
};
let sheet = null;
function updateRules(identifier, rules) {

@@ -186,4 +188,12 @@ if (!process.env.TAMAGUI_REACT_19)

}
let nonce = "";
function setNonce(_) {
nonce = _;
}
function insertStyleRules(rulesToInsert) {
if (!process.env.TAMAGUI_REACT_19) {
if (!sheet && import_constants.isClient && document.head) {
const styleTag = document.createElement("style");
nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
}
if (!sheet) return;

@@ -190,0 +200,0 @@ for (const key in rulesToInsert) {

@@ -25,2 +25,3 @@ "use strict";

scanAllSheets: () => scanAllSheets,
setNonce: () => setNonce,
shouldInsertStyleRules: () => shouldInsertStyleRules,

@@ -313,3 +314,3 @@ updateRules: () => updateRules

return dotIndex > -1 ? selector.slice(7, dotIndex) : selector.slice(7);
}, sheet = import_constants.isClient && document.head ? document.head.appendChild(document.createElement("style")).sheet : null;
}, sheet = null;
function updateRules(identifier, rules) {

@@ -319,4 +320,12 @@ if (!process.env.TAMAGUI_REACT_19)

}
var nonce = "";
function setNonce(_) {
nonce = _;
}
function insertStyleRules(rulesToInsert) {
if (!process.env.TAMAGUI_REACT_19) {
if (!sheet && import_constants.isClient && document.head) {
var styleTag = document.createElement("style");
nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
}
if (!sheet) return;

@@ -374,2 +383,3 @@ for (var key in rulesToInsert) {

scanAllSheets,
setNonce,
shouldInsertStyleRules,

@@ -376,0 +386,0 @@ updateRules

3

dist/cjs/index.js

@@ -28,2 +28,3 @@ var __defProp = Object.defineProperty;

mediaState: () => import_useMedia.mediaState,
setNonce: () => import_insertStyleRule.setNonce,
setupDev: () => import_config.setupDev,

@@ -47,3 +48,3 @@ updateConfig: () => import_config.updateConfig,

__reExport(src_exports, require("./interfaces/GetRef"), module.exports);
var import_config = require("./config");
var import_config = require("./config"), import_insertStyleRule = require("./helpers/insertStyleRule");
__reExport(src_exports, require("./constants/constants"), module.exports);

@@ -50,0 +51,0 @@ __reExport(src_exports, require("./contexts/ComponentContext"), module.exports);

@@ -29,2 +29,3 @@ "use strict";

mediaState: () => import_useMedia.mediaState,
setNonce: () => import_insertStyleRule.setNonce,
setupDev: () => import_config.setupDev,

@@ -48,3 +49,3 @@ updateConfig: () => import_config.updateConfig,

__reExport(src_exports, require("./interfaces/GetRef"), module.exports);
var import_config = require("./config");
var import_config = require("./config"), import_insertStyleRule = require("./helpers/insertStyleRule");
__reExport(src_exports, require("./constants/constants"), module.exports);

@@ -112,2 +113,3 @@ __reExport(src_exports, require("./contexts/ComponentContext"), module.exports);

mediaState,
setNonce,
setupDev,

@@ -114,0 +116,0 @@ updateConfig,

@@ -29,3 +29,3 @@ var __create = Object.create;

module.exports = __toCommonJS(Theme_exports);
var import_constants = require("@tamagui/constants"), import_react = __toESM(require("react")), import_createVariable = require("../createVariable"), import_ThemeManagerContext = require("../helpers/ThemeManagerContext"), import_useTheme = require("../hooks/useTheme"), import_ThemeDebug = require("./ThemeDebug"), import_jsx_runtime = require("react/jsx-runtime");
var import_constants = require("@tamagui/constants"), import_react = __toESM(require("react")), import_createVariable = require("../createVariable"), import_ThemeManagerContext = require("../helpers/ThemeManagerContext"), import_useTheme = require("../hooks/useTheme"), import_ThemeDebug = require("./ThemeDebug"), import_log = require("../helpers/log"), import_jsx_runtime = require("react/jsx-runtime");
const Theme = (0, import_react.forwardRef)(function({ children, ...props }, ref) {

@@ -59,5 +59,9 @@ if (props.disable)

const { shallow, forceClassName } = props;
let shouldRenderChildrenWithTheme = isNewTheme || "inverse" in props || "name" in props || stateRef.current.hasEverThemed || isRoot;
let shouldRenderChildrenWithTheme = isNewTheme || isRoot || stateRef.current.hasEverThemed || typeof props.inverse == "boolean";
if (shouldRenderChildrenWithTheme && (stateRef.current.hasEverThemed = !0), !shouldRenderChildrenWithTheme)
return children;
process.env.NODE_ENV === "development" && shouldRenderChildrenWithTheme && props.debug && (0, import_log.log)(
`adding theme: isRoot ${isRoot}, inverse ${"inverse" in props}, isNewTheme ${isNewTheme}, hasEver ${stateRef.current.hasEverThemed}`,
props
);
let next = children;

@@ -64,0 +68,0 @@ shallow && (next = import_react.Children.toArray(children).map((child) => (0, import_react.isValidElement)(child) ? (0, import_react.cloneElement)(

@@ -30,3 +30,3 @@ "use strict";

module.exports = __toCommonJS(Theme_exports);
var import_jsx_runtime = require("react/jsx-runtime"), import_constants = require("@tamagui/constants"), import_react = __toESM(require("react")), import_createVariable = require("../createVariable"), import_ThemeManagerContext = require("../helpers/ThemeManagerContext"), import_useTheme = require("../hooks/useTheme"), import_ThemeDebug = require("./ThemeDebug");
var import_jsx_runtime = require("react/jsx-runtime"), import_constants = require("@tamagui/constants"), import_react = __toESM(require("react")), import_createVariable = require("../createVariable"), import_ThemeManagerContext = require("../helpers/ThemeManagerContext"), import_useTheme = require("../hooks/useTheme"), import_ThemeDebug = require("./ThemeDebug"), import_log = require("../helpers/log");
function _define_property(obj, key, value) {

@@ -89,5 +89,6 @@ return key in obj ? Object.defineProperty(obj, key, {

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");
var shallow = props.shallow, forceClassName = props.forceClassName, shouldRenderChildrenWithTheme = isNewTheme || "inverse" in props || "name" in props || stateRef.current.hasEverThemed || isRoot;
var shallow = props.shallow, forceClassName = props.forceClassName, shouldRenderChildrenWithTheme = isNewTheme || isRoot || stateRef.current.hasEverThemed || typeof props.inverse == "boolean";
if (shouldRenderChildrenWithTheme && (stateRef.current.hasEverThemed = !0), !shouldRenderChildrenWithTheme)
return children;
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);
var next = children;

@@ -94,0 +95,0 @@ shallow && (next = import_react.Children.toArray(children).map(function(child) {

@@ -43,7 +43,3 @@ import { composeRefs } from "@tamagui/compose-refs";

import { useDidHydrateOnce } from "./hooks/useDidHydrateOnce";
import {
getMediaState,
setMediaShouldUpdate,
useMedia
} from "./hooks/useMedia";
import { getMediaState, setMediaShouldUpdate, useMedia } from "./hooks/useMedia";
import { useThemeWithState } from "./hooks/useTheme";

@@ -50,0 +46,0 @@ import { hooks } from "./setupHooks";

@@ -154,3 +154,4 @@ import { isClient } from "@tamagui/constants";

return dotIndex > -1 ? selector.slice(7, dotIndex) : selector.slice(7);
}, sheet = isClient && document.head ? document.head.appendChild(document.createElement("style")).sheet : null;
};
let sheet = null;
function updateRules(identifier, rules) {

@@ -160,4 +161,12 @@ if (!process.env.TAMAGUI_REACT_19)

}
let nonce = "";
function setNonce(_) {
nonce = _;
}
function insertStyleRules(rulesToInsert) {
if (!process.env.TAMAGUI_REACT_19) {
if (!sheet && isClient && document.head) {
const styleTag = document.createElement("style");
nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
}
if (!sheet) return;

@@ -204,2 +213,3 @@ for (const key in rulesToInsert) {

scanAllSheets,
setNonce,
shouldInsertStyleRules,

@@ -206,0 +216,0 @@ updateRules

@@ -286,3 +286,3 @@ import { isClient } from "@tamagui/constants";

return dotIndex > -1 ? selector.slice(7, dotIndex) : selector.slice(7);
}, sheet = isClient && document.head ? document.head.appendChild(document.createElement("style")).sheet : null;
}, sheet = null;
function updateRules(identifier, rules) {

@@ -292,4 +292,12 @@ if (!process.env.TAMAGUI_REACT_19)

}
var nonce = "";
function setNonce(_) {
nonce = _;
}
function insertStyleRules(rulesToInsert) {
if (!process.env.TAMAGUI_REACT_19) {
if (!sheet && isClient && document.head) {
var styleTag = document.createElement("style");
nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
}
if (!sheet) return;

@@ -346,2 +354,3 @@ for (var key in rulesToInsert) {

scanAllSheets,
setNonce,
shouldInsertStyleRules,

@@ -348,0 +357,0 @@ updateRules

@@ -23,2 +23,3 @@ export * from "./Tamagui";

} from "./config";
import { setNonce } from "./helpers/insertStyleRule";
export * from "./constants/constants";

@@ -93,2 +94,3 @@ export * from "./contexts/ComponentContext";

mediaState,
setNonce,
setupDev,

@@ -95,0 +97,0 @@ updateConfig,

@@ -15,2 +15,3 @@ export * from "./Tamagui";

import { setupDev, getConfig, getThemes, getTokens, updateConfig, getToken, getTokenValue } from "./config";
import { setNonce } from "./helpers/insertStyleRule";
export * from "./constants/constants";

@@ -77,2 +78,3 @@ export * from "./contexts/ComponentContext";

mediaState,
setNonce,
setupDev,

@@ -79,0 +81,0 @@ updateConfig,

@@ -7,2 +7,3 @@ import { isWeb } from "@tamagui/constants";

import { ThemeDebug } from "./ThemeDebug";
import { log } from "../helpers/log";
import { jsx } from "react/jsx-runtime";

@@ -37,5 +38,9 @@ const Theme = forwardRef(function({ children, ...props }, ref) {

const { shallow, forceClassName } = props;
let shouldRenderChildrenWithTheme = isNewTheme || "inverse" in props || "name" in props || stateRef.current.hasEverThemed || isRoot;
let shouldRenderChildrenWithTheme = isNewTheme || isRoot || stateRef.current.hasEverThemed || typeof props.inverse == "boolean";
if (shouldRenderChildrenWithTheme && (stateRef.current.hasEverThemed = !0), !shouldRenderChildrenWithTheme)
return children;
process.env.NODE_ENV === "development" && shouldRenderChildrenWithTheme && props.debug && log(
`adding theme: isRoot ${isRoot}, inverse ${"inverse" in props}, isNewTheme ${isNewTheme}, hasEver ${stateRef.current.hasEverThemed}`,
props
);
let next = children;

@@ -42,0 +47,0 @@ shallow && (next = Children.toArray(children).map((child) => isValidElement(child) ? cloneElement(

@@ -8,2 +8,3 @@ import { jsx as _jsx } from "react/jsx-runtime";

import { ThemeDebug } from "./ThemeDebug";
import { log } from "../helpers/log";
function _define_property(obj, key, value) {

@@ -66,5 +67,6 @@ return key in obj ? Object.defineProperty(obj, key, {

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");
var shallow = props.shallow, forceClassName = props.forceClassName, shouldRenderChildrenWithTheme = isNewTheme || "inverse" in props || "name" in props || stateRef.current.hasEverThemed || isRoot;
var shallow = props.shallow, forceClassName = props.forceClassName, shouldRenderChildrenWithTheme = isNewTheme || isRoot || stateRef.current.hasEverThemed || typeof props.inverse == "boolean";
if (shouldRenderChildrenWithTheme && (stateRef.current.hasEverThemed = !0), !shouldRenderChildrenWithTheme)
return children;
process.env.NODE_ENV === "development" && shouldRenderChildrenWithTheme && props.debug && log("adding theme: isRoot ".concat(isRoot, ", inverse ").concat("inverse" in props, ", isNewTheme ").concat(isNewTheme, ", hasEver ").concat(stateRef.current.hasEverThemed), props);
var next = children;

@@ -71,0 +73,0 @@ shallow && (next = Children.toArray(children).map(function(child) {

{
"name": "@tamagui/web",
"version": "1.105.6",
"version": "1.105.7",
"source": "src/index.ts",

@@ -30,14 +30,14 @@ "main": "dist/cjs",

"dependencies": {
"@tamagui/compose-refs": "1.105.6",
"@tamagui/constants": "1.105.6",
"@tamagui/helpers": "1.105.6",
"@tamagui/normalize-css-color": "1.105.6",
"@tamagui/timer": "1.105.6",
"@tamagui/types": "1.105.6",
"@tamagui/use-did-finish-ssr": "1.105.6",
"@tamagui/use-event": "1.105.6",
"@tamagui/use-force-update": "1.105.6"
"@tamagui/compose-refs": "1.105.7",
"@tamagui/constants": "1.105.7",
"@tamagui/helpers": "1.105.7",
"@tamagui/normalize-css-color": "1.105.7",
"@tamagui/timer": "1.105.7",
"@tamagui/types": "1.105.7",
"@tamagui/use-did-finish-ssr": "1.105.7",
"@tamagui/use-event": "1.105.7",
"@tamagui/use-force-update": "1.105.7"
},
"devDependencies": {
"@tamagui/build": "1.105.6",
"@tamagui/build": "1.105.7",
"@testing-library/react": "^14.0.0",

@@ -44,0 +44,0 @@ "csstype": "^3.0.10",

@@ -33,2 +33,4 @@ export * from './Tamagui'

export { setNonce } from './helpers/insertStyleRule'
export * from './constants/constants'

@@ -35,0 +37,0 @@

@@ -9,4 +9,5 @@ import type { DedupedThemes, RulesToInsert, TokensParsed } from '../types';

export declare function updateRules(identifier: string, rules: string[]): boolean | undefined;
export declare function setNonce(_: string): void;
export declare function insertStyleRules(rulesToInsert: RulesToInsert): void;
export declare function shouldInsertStyleRules(identifier: string): boolean;
//# sourceMappingURL=insertStyleRule.d.ts.map

@@ -21,2 +21,3 @@ export * from './Tamagui';

export { setupDev, getConfig, getThemes, getTokens, updateConfig, getToken, getTokenValue, } from './config';
export { setNonce } from './helpers/insertStyleRule';
export * from './constants/constants';

@@ -23,0 +24,0 @@ export * from './contexts/ComponentContext';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc