@tamagui/core 1.88.13 → 1.88.15
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/LICENSE +21 -0
- package/dist/esm/createOptimizedView.mjs +2 -0
- package/dist/esm/getBaseViews.mjs +4 -0
- package/dist/esm/helpers/getBoundingClientRect.mjs +4 -0
- package/dist/esm/helpers/getRect.mjs +20 -0
- package/dist/esm/hooks/useElementLayout.mjs +87 -0
- package/dist/esm/hooks/usePlatformMethods.mjs +20 -0
- package/dist/esm/index.mjs +90 -0
- package/dist/esm/inject-styles.mjs +13 -0
- package/dist/esm/reactNativeTypes.mjs +0 -0
- package/dist/esm/vendor/Pressability.mjs +3 -0
- package/dist/native.js +21 -27
- package/dist/native.js.map +1 -1
- package/dist/test.native.js +20 -26
- package/dist/test.native.js.map +1 -1
- package/package.json +6 -6
- package/src/hooks/useElementLayout.tsx +1 -1
- package/src/hooks/usePlatformMethods.ts +1 -1
- package/types/hooks/useElementLayout.d.ts +1 -1
- package/types/hooks/useElementLayout.d.ts.map +1 -1
- package/types/hooks/usePlatformMethods.d.ts +1 -1
- package/types/hooks/usePlatformMethods.d.ts.map +1 -1
package/dist/test.native.js
CHANGED
|
@@ -1426,7 +1426,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1426
1426
|
continue;
|
|
1427
1427
|
}
|
|
1428
1428
|
let total = track(identifier, remove);
|
|
1429
|
-
remove ? total === 0 && delete allSelectors[identifier] : identifier in allSelectors || (!identifier.startsWith("_transform") || addTransform(identifier, cssRule.cssText, cssRule)) && (allSelectors[identifier] = cssRule.cssText);
|
|
1429
|
+
remove ? total === 0 && delete allSelectors[identifier] : identifier in allSelectors || (!identifier.startsWith("_transform-") || addTransform(identifier, cssRule.cssText, cssRule)) && (allSelectors[identifier] = cssRule.cssText);
|
|
1430
1430
|
}
|
|
1431
1431
|
return scannedCache.set(sheet2, cacheKey), dedupedThemes;
|
|
1432
1432
|
}
|
|
@@ -1468,7 +1468,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1468
1468
|
};
|
|
1469
1469
|
for (let selector of selectors) {
|
|
1470
1470
|
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;
|
|
1471
|
-
dedupedEntry.names.includes(themeName) || themeName === "light_dark" || dedupedEntry.names.push(themeName);
|
|
1471
|
+
!themeName || dedupedEntry.names.includes(themeName) || themeName === "light_dark" || themeName === "dark_light" || dedupedEntry.names.push(themeName);
|
|
1472
1472
|
}
|
|
1473
1473
|
return dedupedEntry;
|
|
1474
1474
|
}
|
|
@@ -1494,7 +1494,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1494
1494
|
return selector.includes(":") ? res.replace(/:[a-z]+$/, "") : res;
|
|
1495
1495
|
}, sheet = import_constants.isClient ? document.head.appendChild(document.createElement("style")).sheet : null;
|
|
1496
1496
|
function updateRules(identifier, rules) {
|
|
1497
|
-
return identifier in allRules ? !1 : (allRules[identifier] = rules.join(" "), identifier.startsWith("_transform") ? addTransform(identifier, rules[0]) : !0);
|
|
1497
|
+
return identifier in allRules ? !1 : (allRules[identifier] = rules.join(" "), identifier.startsWith("_transform-") ? addTransform(identifier, rules[0]) : !0);
|
|
1498
1498
|
}
|
|
1499
1499
|
function insertStyleRules(rulesToInsert) {
|
|
1500
1500
|
if (!(!rulesToInsert.length || !sheet)) {
|
|
@@ -3811,7 +3811,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3811
3811
|
useSplitStyles: () => useSplitStyles
|
|
3812
3812
|
});
|
|
3813
3813
|
module2.exports = __toCommonJS2(getSplitStyles_exports);
|
|
3814
|
-
var import_constants = require_index_native3(), import_helpers = require_index_native4(), import_react3 = require("react"), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-";
|
|
3814
|
+
var import_constants = require_index_native3(), import_helpers = require_index_native4(), import_react3 = require("react"), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_isObj = require_isObj_native(), IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-";
|
|
3815
3815
|
function isValidStyleKey(key, staticConfig) {
|
|
3816
3816
|
return (staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles))[key] || staticConfig.acceptTokens && staticConfig.acceptTokens[key];
|
|
3817
3817
|
}
|
|
@@ -3880,8 +3880,8 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3880
3880
|
viewProps[`data-${hyphenate(keyInit2)}`] = valInit[keyInit2];
|
|
3881
3881
|
continue;
|
|
3882
3882
|
}
|
|
3883
|
-
if (keyInit
|
|
3884
|
-
|
|
3883
|
+
if (keyInit.startsWith("_style") && (0, import_isObj.isObj)(valInit)) {
|
|
3884
|
+
Object.assign(styleState.style, valInit);
|
|
3885
3885
|
continue;
|
|
3886
3886
|
}
|
|
3887
3887
|
if (0)
|
|
@@ -4074,7 +4074,13 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
4074
4074
|
}
|
|
4075
4075
|
}
|
|
4076
4076
|
}
|
|
4077
|
-
if (props.style
|
|
4077
|
+
if (props.style)
|
|
4078
|
+
if (isHOC)
|
|
4079
|
+
viewProps.style = props.style;
|
|
4080
|
+
else
|
|
4081
|
+
for (let style2 of [].concat(props.style))
|
|
4082
|
+
style2 && (style2.$$css ? Object.assign(styleState.classNames, style2) : Object.assign(styleState.style, style2));
|
|
4083
|
+
if (styleProps.noNormalize !== !1 && ((0, import_expandStyles.fixStyles)(style), import_constants.isWeb && !staticConfig.isReactNative && (0, import_getStylesAtomic.styleToCSS)(style), styleState.transforms && Object.entries(styleState.transforms).sort(([a], [b]) => a.localeCompare(b)).forEach(([key, val]) => {
|
|
4078
4084
|
mergeTransform(style, key, val, !0);
|
|
4079
4085
|
}), parentSplitStyles && !shouldDoClasses))
|
|
4080
4086
|
for (let key in parentSplitStyles.style)
|
|
@@ -4128,19 +4134,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
4128
4134
|
!avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key);
|
|
4129
4135
|
}
|
|
4130
4136
|
return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
|
|
4131
|
-
}
|
|
4132
|
-
function mergeStylePropIntoStyle(styleState, cur) {
|
|
4133
|
-
if (!cur)
|
|
4134
|
-
return;
|
|
4135
|
-
let styles = Array.isArray(cur) ? cur : [cur];
|
|
4136
|
-
for (let style of styles) {
|
|
4137
|
-
if (!style)
|
|
4138
|
-
continue;
|
|
4139
|
-
let isRNW = style.$$css;
|
|
4140
|
-
Object.assign(isRNW ? styleState.classNames : styleState.style, style);
|
|
4141
|
-
}
|
|
4142
|
-
}
|
|
4143
|
-
var useInsertEffectCompat = import_constants.isWeb ? import_react3.useInsertionEffect || import_constants.useIsomorphicLayoutEffect : () => {
|
|
4137
|
+
}, useInsertEffectCompat = import_constants.isWeb ? import_react3.useInsertionEffect || import_constants.useIsomorphicLayoutEffect : () => {
|
|
4144
4138
|
}, useSplitStyles = (...args) => {
|
|
4145
4139
|
let res = getSplitStyles(...args);
|
|
4146
4140
|
return useInsertEffectCompat(() => {
|
|
@@ -4767,7 +4761,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4767
4761
|
fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
|
|
4768
4762
|
let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", style = animationStyles || splitStyles.style, className;
|
|
4769
4763
|
asChild === "except-style" || asChild === "except-style-web" || (viewProps.style = style);
|
|
4770
|
-
let runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = runtimeHoverStyle || onHoverIn || onHoverOut, isHoverable = import_constants.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), events = !!(attachFocus || attachPress || isHoverable || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle) && !isDisabled && !props.asChild ? {
|
|
4764
|
+
let runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = runtimeHoverStyle || onHoverIn || onHoverOut, isHoverable = import_constants.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), events = !!(attachFocus || attachPress || isHoverable || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle) && !isDisabled && !props.asChild ? {
|
|
4771
4765
|
onPressOut: attachPress ? (e) => {
|
|
4772
4766
|
unPress(), onPressOut == null || onPressOut(e), onMouseUp == null || onMouseUp(e);
|
|
4773
4767
|
} : void 0,
|
|
@@ -6206,19 +6200,19 @@ var require_TamaguiProvider_native = __commonJS({
|
|
|
6206
6200
|
...themePropsProvider
|
|
6207
6201
|
}) {
|
|
6208
6202
|
return (0, import_useMedia.setupMediaListeners)(), import_constants.isClient && React.useLayoutEffect(() => {
|
|
6209
|
-
if (config.disableSSR || document.documentElement.classList.contains("t_unmounted") && document.documentElement.classList.remove("t_unmounted"), !disableInjectCSS) {
|
|
6203
|
+
if (config && (config.disableSSR || document.documentElement.classList.contains("t_unmounted") && document.documentElement.classList.remove("t_unmounted"), !disableInjectCSS)) {
|
|
6210
6204
|
let style = document.createElement("style");
|
|
6211
6205
|
return style.appendChild(document.createTextNode(config.getCSS())), document.head.appendChild(style), () => {
|
|
6212
6206
|
document.head.removeChild(style);
|
|
6213
6207
|
};
|
|
6214
6208
|
}
|
|
6215
|
-
}, [config, disableInjectCSS]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, { animationDriver: config.animations, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
6209
|
+
}, [config, disableInjectCSS]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, { animationDriver: config == null ? void 0 : config.animations, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
6216
6210
|
import_ThemeProvider.ThemeProvider,
|
|
6217
6211
|
{
|
|
6218
|
-
themeClassNameOnRoot: config.themeClassNameOnRoot,
|
|
6219
|
-
disableRootThemeClass: config.disableRootThemeClass,
|
|
6212
|
+
themeClassNameOnRoot: config == null ? void 0 : config.themeClassNameOnRoot,
|
|
6213
|
+
disableRootThemeClass: config == null ? void 0 : config.disableRootThemeClass,
|
|
6220
6214
|
...themePropsProvider,
|
|
6221
|
-
defaultTheme: themePropsProvider.defaultTheme ?? Object.keys(config.themes)[0],
|
|
6215
|
+
defaultTheme: themePropsProvider.defaultTheme ?? (config ? Object.keys(config.themes)[0] : ""),
|
|
6222
6216
|
children
|
|
6223
6217
|
}
|
|
6224
6218
|
) });
|