Socket
Socket
Sign inDemoInstall

@tamagui/core

Package Overview
Dependencies
Maintainers
1
Versions
1162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tamagui/core - npm Package Compare versions

Comparing version 1.0.0-alpha.5 to 1.0.0-alpha.6

dist/helpers/isComponent.js

70

dist/createComponent.js

@@ -50,3 +50,35 @@ var __defProp = Object.defineProperty;

const component = forwardRef((props, forwardedRef) => {
const forceUpdate = useForceUpdate();
const features = useFeatures(props, { forceUpdate });
const manager = useContext(ThemeManagerContext);
const [state, set_] = useState(() => ({
hover: false,
press: false,
pressIn: false,
theme: manager.name
}));
const set = /* @__PURE__ */ __name((next) => set_((prev) => {
for (const key in next) {
if (prev[key] !== next[key]) {
return { ...prev, ...next };
}
}
return prev;
}), "set");
if (process.env.NODE_ENV === "development" && !isText && isWeb) {
Children.toArray(props.children).forEach((item) => {
if (typeof item === "string") {
console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`);
}
});
}
const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false;
const hostRef = useRef(null);
const {
viewProps: viewPropsIn,
pseudos,
style,
classNames
} = getSplitStyles(props, staticConfig, manager.theme || initialTheme);
const {
tag,

@@ -84,30 +116,13 @@ hitSlop,

onClick,
onLayout
} = props;
const forceUpdate = useForceUpdate();
const features = useFeatures(props, { forceUpdate });
const manager = useContext(ThemeManagerContext);
const [state, set_] = useState(() => ({
hover: false,
press: false,
pressIn: false,
theme: manager.name
}));
const set = /* @__PURE__ */ __name((next) => set_((prev) => {
for (const key in next) {
if (prev[key] !== next[key]) {
return { ...prev, ...next };
}
}
return prev;
}), "set");
if (process.env.NODE_ENV === "development" && !isText && isWeb) {
Children.toArray(props.children).forEach((item) => {
if (typeof item === "string") {
console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`);
}
});
accessible,
accessibilityRole,
onLayout,
...viewProps
} = viewPropsIn;
if (!isWeb) {
if (accessible)
viewProps.accessible = accessible;
if (accessibilityRole)
viewProps.accessibilityRole = accessibilityRole;
}
const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false;
const hostRef = useRef(null);
if (isWeb) {

@@ -134,3 +149,2 @@ rnw.useResponderEvents(hostRef, {

const isTracking = useRef(false);
const { viewProps, pseudos, style, classNames } = getSplitStyles(props, staticConfig, manager.theme || initialTheme);
const internal = useRef();

@@ -137,0 +151,0 @@ if (!internal.current) {

3

dist/createVariable.js

@@ -10,2 +10,5 @@ var __defProp = Object.defineProperty;

}
toString() {
return isWeb ? this.variable : this.val;
}
}

@@ -12,0 +15,0 @@ __name(Variable, "Variable");

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

const style = [];
const blacklistProps = isSplittingDefaultProps ? blacklistDefaultProps : blacklistFinalProps;
let pseudos = null;

@@ -100,3 +99,3 @@ let cur = null;

}
if (!blacklistProps[key]) {
if (!staticConfig.variants || !(key in staticConfig.variants)) {
viewProps[key] = val;

@@ -139,13 +138,2 @@ }

}, "getSubStyle");
const blacklistDefaultProps = {
...validStyles,
...stylePropsText
};
const blacklistFinalProps = {
...blacklistDefaultProps,
tag: true,
debug: true,
space: true,
hitSlop: true
};
const mapTransformKeys = {

@@ -152,0 +140,0 @@ x: "translateX",

@@ -18,2 +18,3 @@ export * from "./createComponent";

export * from "./helpers/themeable";
export * from "./helpers/isTamaguiElement";
export * from "./hooks/useConstant";

@@ -29,3 +30,2 @@ export * from "./hooks/useMedia";

export * from "./views/TextAncestorContext";
export * from "./views/SafeAreaProvider";
export {

@@ -32,0 +32,0 @@ createTokens

@@ -18,4 +18,8 @@ var __defProp = Object.defineProperty;

const name = props.name;
const theme = themes[name] || themes[`${name}-${parentName}`];
const activeName = !name ? null : name in themes ? name : `${name}-${parentName}`;
const theme = activeName ? themes[activeName] : null;
const themeManager = useConstant(() => {
if (!theme) {
return null;
}
const manager = new ThemeManager();

@@ -28,3 +32,6 @@ if (name) {

useIsomorphicLayoutEffect(() => {
themeManager.setActiveTheme(name, theme);
if (!themeManager) {
return;
}
themeManager.setActiveTheme(activeName, theme);
return parent.onChangeTheme((next) => {

@@ -36,4 +43,4 @@ if (next) {

});
}, [themes, name]);
if (!name) {
}, [themes, activeName]);
if (!name || !theme) {
return props.children;

@@ -40,0 +47,0 @@ }

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

const name = inversions[themeName] || inversions[defaultTheme] || null;
console.log("todo fixme invert", { themeName, defaultTheme, next: name });
return /* @__PURE__ */ React.createElement(Theme, {

@@ -21,0 +20,0 @@ name

{
"name": "@tamagui/core",
"version": "1.0.0-alpha.5",
"version": "1.0.0-alpha.6",
"source": "src/index.ts",

@@ -19,7 +19,6 @@ "main": "dist/index.cjs",

"@tamagui/helpers": "^1.0.0-alpha.5",
"@tamagui/use-debounce": "^1.0.0-alpha.5",
"@tamagui/use-debounce": "^1.0.0-alpha.6",
"@tamagui/use-force-update": "^1.0.0-alpha.5",
"react": "*",
"react-dom": "*",
"react-native-safe-area-context": "^3.3.0"
"react-dom": "*"
},

@@ -41,3 +40,3 @@ "peerDependencies": {

},
"gitHead": "e12f14aa087c41ea5ba3933a05f33fada0be03c0"
"gitHead": "18a942d7a08109c8f5b8692a2adb20c69d56a7e1"
}

@@ -14,2 +14,6 @@ import { isWeb } from './constants/platform'

}
toString() {
return isWeb ? this.variable : this.val
}
}

@@ -16,0 +20,0 @@

@@ -20,2 +20,3 @@ export * from './createComponent'

export * from './helpers/themeable'
export * from './helpers/isTamaguiElement'

@@ -33,2 +34,1 @@ export * from './hooks/useConstant'

export * from './views/TextAncestorContext'
export * from './views/SafeAreaProvider'

@@ -14,2 +14,3 @@ // Generated by dts-bundle-generator v5.9.0

constructor({ val, name }: VariableIn);
toString(): string | number;
}

@@ -495,2 +496,3 @@ export declare type VariableIn = {

}
export declare const isTamaguiElement: (child: any) => child is React.ReactElement<any, string | React.JSXElementConstructor<any>>;
export declare function useConstant<T>(fn: () => T): T;

@@ -554,7 +556,3 @@ export declare const mediaState: {

export declare const TextAncestorProvider: (props: any) => any;
export declare const SafeAreaProvider: ({ initialWindowMetrics, children, }: {
children?: any;
initialWindowMetrics?: any;
}) => JSX.Element;
export {};

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