@tamagui/core 1.65.4 → 1.67.0
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 +50 -11
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +13 -7
- package/dist/test.native.js.map +2 -2
- package/package.json +7 -7
package/dist/native.js
CHANGED
|
@@ -1154,6 +1154,7 @@ var require_config_native = __commonJS({
|
|
|
1154
1154
|
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), config_exports = {};
|
|
1155
1155
|
__export2(config_exports, {
|
|
1156
1156
|
configListeners: () => configListeners,
|
|
1157
|
+
devConfig: () => devConfig,
|
|
1157
1158
|
getConfig: () => getConfig2,
|
|
1158
1159
|
getFont: () => getFont,
|
|
1159
1160
|
getThemes: () => getThemes2,
|
|
@@ -1165,6 +1166,7 @@ var require_config_native = __commonJS({
|
|
|
1165
1166
|
setConfig: () => setConfig,
|
|
1166
1167
|
setConfigFont: () => setConfigFont,
|
|
1167
1168
|
setTokens: () => setTokens,
|
|
1169
|
+
setupDev: () => setupDev2,
|
|
1168
1170
|
updateConfig: () => updateConfig2,
|
|
1169
1171
|
useTokens: () => useTokens
|
|
1170
1172
|
});
|
|
@@ -1211,7 +1213,10 @@ var require_config_native = __commonJS({
|
|
|
1211
1213
|
return ((_b = (_a2 = conf2.fontsParsed[k]) == null ? void 0 : _a2.family) == null ? void 0 : _b.val) === name;
|
|
1212
1214
|
}
|
|
1213
1215
|
)) == null ? void 0 : _a[1]);
|
|
1214
|
-
};
|
|
1216
|
+
}, devConfig;
|
|
1217
|
+
function setupDev2(conf2) {
|
|
1218
|
+
process.env.NODE_ENV === "development" && (devConfig = conf2);
|
|
1219
|
+
}
|
|
1215
1220
|
}
|
|
1216
1221
|
});
|
|
1217
1222
|
|
|
@@ -2400,7 +2405,7 @@ var require_getVariantExtras_native = __commonJS({
|
|
|
2400
2405
|
tokens: conf.tokensParsed,
|
|
2401
2406
|
theme,
|
|
2402
2407
|
fontFamily,
|
|
2403
|
-
font: fonts[fontFamily],
|
|
2408
|
+
font: fonts[fontFamily] || fonts[styleState.conf.defaultFont],
|
|
2404
2409
|
// TODO do this in splitstlye
|
|
2405
2410
|
// we avoid passing in default props for media queries because that would confuse things like SizableText.size:
|
|
2406
2411
|
props: (0, import_createProxy.createProxy)(curProps, {
|
|
@@ -2626,9 +2631,9 @@ var require_propMapper_native = __commonJS({
|
|
|
2626
2631
|
case "lineHeight":
|
|
2627
2632
|
case "letterSpacing":
|
|
2628
2633
|
case "fontWeight": {
|
|
2629
|
-
let fam = fontFamily ||
|
|
2634
|
+
let defaultFont = conf.defaultFont || "$body", fam = fontFamily || defaultFont;
|
|
2630
2635
|
if (fam) {
|
|
2631
|
-
let
|
|
2636
|
+
let fontsParsed = context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed, font = fontsParsed[fam] || fontsParsed[defaultFont];
|
|
2632
2637
|
valOrVar = ((_b = font == null ? void 0 : font[fontShorthand[key] || key]) == null ? void 0 : _b[value]) || value, hasSet = !0;
|
|
2633
2638
|
}
|
|
2634
2639
|
break;
|
|
@@ -3882,7 +3887,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3882
3887
|
if (isStyleProp && props.asChild === "except-style")
|
|
3883
3888
|
continue;
|
|
3884
3889
|
let shouldPassProp = !isStyleProp || // is in parent variants
|
|
3885
|
-
isHOC && (parentStaticConfig == null ? void 0 : parentStaticConfig.variants) && keyInit in parentStaticConfig.variants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)),
|
|
3890
|
+
isHOC && (parentStaticConfig == null ? void 0 : parentStaticConfig.variants) && keyInit in parentStaticConfig.variants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), parentVariant = (_a = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) == null ? void 0 : _a[keyInit], isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo || parentVariant || keyInit in skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
3886
3891
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(
|
|
3887
3892
|
`\u{1F539}\u{1F539}\u{1F539}\u{1F539} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""} \u{1F539}\u{1F539}\u{1F539}\u{1F539}`
|
|
3888
3893
|
), console.log({ isVariant, valInit, shouldPassProp }), import_constants2.isClient && console.log({
|
|
@@ -4597,12 +4602,30 @@ var require_createComponent_native = __commonJS({
|
|
|
4597
4602
|
spacedChildren: () => spacedChildren
|
|
4598
4603
|
});
|
|
4599
4604
|
module2.exports = __toCommonJS2(createComponent_exports);
|
|
4600
|
-
var import_compose_refs = require_index_native6(), import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_use_did_finish_ssr = require_index_native7(), import_react = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_mergeProps = require_mergeProps_native(), import_proxyThemeVariables = require_proxyThemeVariables_native(), import_themeable = require_themeable_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), tamaguiConfig, AnimatedText, AnimatedView, initialTheme, time, mouseUps = /* @__PURE__ */ new Set();
|
|
4605
|
+
var import_compose_refs = require_index_native6(), import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_use_did_finish_ssr = require_index_native7(), import_react = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_mergeProps = require_mergeProps_native(), import_proxyThemeVariables = require_proxyThemeVariables_native(), import_themeable = require_themeable_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), tamaguiConfig, AnimatedText, AnimatedView, initialTheme, time, debugKeyListeners, startVisualizer, mouseUps = /* @__PURE__ */ new Set();
|
|
4601
4606
|
if (typeof document < "u") {
|
|
4602
4607
|
let cancelTouches = () => {
|
|
4603
4608
|
mouseUps.forEach((x) => x()), mouseUps.clear();
|
|
4604
4609
|
};
|
|
4605
|
-
addEventListener("mouseup", cancelTouches), addEventListener("touchend", cancelTouches), addEventListener("touchcancel", cancelTouches)
|
|
4610
|
+
addEventListener("mouseup", cancelTouches), addEventListener("touchend", cancelTouches), addEventListener("touchcancel", cancelTouches), process.env.NODE_ENV === "development" && (startVisualizer = () => {
|
|
4611
|
+
var _a;
|
|
4612
|
+
let devVisualizerConfig = (_a = import_config.devConfig) == null ? void 0 : _a.visualizer;
|
|
4613
|
+
if (devVisualizerConfig) {
|
|
4614
|
+
debugKeyListeners = /* @__PURE__ */ new Set();
|
|
4615
|
+
let tm, isShowing = !1, options = {
|
|
4616
|
+
key: "Alt",
|
|
4617
|
+
delay: 800,
|
|
4618
|
+
...typeof devVisualizerConfig == "object" ? devVisualizerConfig : {}
|
|
4619
|
+
};
|
|
4620
|
+
document.addEventListener("keydown", ({ key, defaultPrevented }) => {
|
|
4621
|
+
defaultPrevented || key === options.key && (clearTimeout(tm), tm = setTimeout(() => {
|
|
4622
|
+
isShowing = !0, debugKeyListeners == null || debugKeyListeners.forEach((l) => l(!0));
|
|
4623
|
+
}, options.delay));
|
|
4624
|
+
}), document.addEventListener("keyup", ({ key, defaultPrevented }) => {
|
|
4625
|
+
defaultPrevented || key === options.key && (clearTimeout(tm), isShowing && (debugKeyListeners == null || debugKeyListeners.forEach((l) => l(!1))));
|
|
4626
|
+
});
|
|
4627
|
+
}
|
|
4628
|
+
});
|
|
4606
4629
|
}
|
|
4607
4630
|
var BaseText, BaseView, hasSetupBaseViews = !1;
|
|
4608
4631
|
function createComponent(staticConfig) {
|
|
@@ -4629,7 +4652,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4629
4652
|
});
|
|
4630
4653
|
let component = (0, import_react.forwardRef)((propsIn, forwardedRef) => {
|
|
4631
4654
|
var _a2, _b, _c, _d, _g, _h, _i, _j, _k;
|
|
4632
|
-
if (!hasSetupBaseViews) {
|
|
4655
|
+
if (process.env.NODE_ENV === "development" && startVisualizer && (startVisualizer(), startVisualizer = void 0), !hasSetupBaseViews) {
|
|
4633
4656
|
hasSetupBaseViews = !0;
|
|
4634
4657
|
let baseViews = (_b = (_a2 = import_setupHooks.hooks).getBaseViews) == null ? void 0 : _b.call(_a2);
|
|
4635
4658
|
baseViews && (BaseText = baseViews.Text, BaseView = baseViews.View);
|
|
@@ -4650,7 +4673,21 @@ var require_createComponent_native = __commonJS({
|
|
|
4650
4673
|
let curDefaultProps = styledContextProps ? { ...defaultProps, ...styledContextProps } : defaultProps, props;
|
|
4651
4674
|
curDefaultProps ? props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn) : props = propsIn;
|
|
4652
4675
|
let debugProp = props.debug, componentName = props.componentName || staticConfig.componentName;
|
|
4653
|
-
process.env.NODE_ENV === "development" &&
|
|
4676
|
+
process.env.NODE_ENV === "development" && import_constants2.isClient && (0, import_react.useEffect)(() => {
|
|
4677
|
+
let overlay = null, debugVisualizerHandler = (show = !1) => {
|
|
4678
|
+
let node = hostRef.current;
|
|
4679
|
+
if (node)
|
|
4680
|
+
if (show) {
|
|
4681
|
+
overlay = document.createElement("span"), overlay.style.inset = "0px", overlay.style.zIndex = "1000000", overlay.style.position = "absolute", overlay.style.borderColor = "red", overlay.style.borderWidth = "1px", overlay.style.borderStyle = "dotted";
|
|
4682
|
+
let dataAt = node.getAttribute("data-at") || "", dataIn = node.getAttribute("data-in") || "", tooltip = document.createElement("span");
|
|
4683
|
+
tooltip.style.position = "absolute", tooltip.style.top = "0px", tooltip.style.left = "0px", tooltip.style.padding = "3px", tooltip.style.background = "rgba(0,0,0,0.75)", tooltip.style.color = "rgba(255,255,255,1)", tooltip.style.fontSize = "12px", tooltip.style.lineHeight = "12px", tooltip.style.fontFamily = "monospace", tooltip.style.webkitFontSmoothing = "none", tooltip.innerText = `${componentName || ""} ${dataAt} ${dataIn}`.trim(), overlay.appendChild(tooltip), node.appendChild(overlay);
|
|
4684
|
+
} else
|
|
4685
|
+
overlay && node.removeChild(overlay);
|
|
4686
|
+
};
|
|
4687
|
+
return debugKeyListeners ||= /* @__PURE__ */ new Set(), debugKeyListeners.add(debugVisualizerHandler), () => {
|
|
4688
|
+
debugKeyListeners == null || debugKeyListeners.delete(debugVisualizerHandler);
|
|
4689
|
+
};
|
|
4690
|
+
}, [componentName]), process.env.NODE_ENV === "development" && time && time`start (ignore)`;
|
|
4654
4691
|
let isHydrated = config != null && config.disableSSR ? !0 : (0, import_use_did_finish_ssr.useDidFinishSSR)();
|
|
4655
4692
|
process.env.NODE_ENV === "development" && time && time`did-finish-ssr`;
|
|
4656
4693
|
let stateRef = (0, import_react.useRef)(
|
|
@@ -5025,7 +5062,8 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5025
5062
|
...staticConfig,
|
|
5026
5063
|
...extended,
|
|
5027
5064
|
neverFlatten: !0,
|
|
5028
|
-
isHOC: !0
|
|
5065
|
+
isHOC: !0,
|
|
5066
|
+
isStyledHOC: !1
|
|
5029
5067
|
};
|
|
5030
5068
|
}
|
|
5031
5069
|
function extractable(Component2, extended) {
|
|
@@ -5846,7 +5884,7 @@ var require_styled_native = __commonJS({
|
|
|
5846
5884
|
}), parentStaticConfig && (parentStaticConfig.isHOC && !parentStaticConfig.isStyledHOC || (defaultProps = {
|
|
5847
5885
|
...parentStaticConfig.defaultProps,
|
|
5848
5886
|
...defaultProps
|
|
5849
|
-
}
|
|
5887
|
+
}, parentStaticConfig.variants && (variants = (0, import_mergeVariants.mergeVariants)(parentStaticConfig.variants, variants)))), parentStaticConfig != null && parentStaticConfig.isHOC && name && (defaultProps.componentName = name);
|
|
5850
5888
|
let isText = !!(staticExtractionOptions != null && staticExtractionOptions.isText || parentStaticConfig != null && parentStaticConfig.isText), acceptsClassName = acceptsClassNameProp ?? (isPlainStyledComponent || isReactNative || (parentStaticConfig == null ? void 0 : parentStaticConfig.isHOC) && (parentStaticConfig == null ? void 0 : parentStaticConfig.acceptsClassName)), conf = {
|
|
5851
5889
|
...parentStaticConfig,
|
|
5852
5890
|
...staticExtractionOptions,
|
|
@@ -6515,6 +6553,7 @@ var require_index_native9 = __commonJS({
|
|
|
6515
6553
|
mediaObjectToString: () => import_useMedia.mediaObjectToString,
|
|
6516
6554
|
mediaQueryConfig: () => import_useMedia.mediaQueryConfig,
|
|
6517
6555
|
mediaState: () => import_useMedia.mediaState,
|
|
6556
|
+
setupDev: () => import_config.setupDev,
|
|
6518
6557
|
updateConfig: () => import_config.updateConfig,
|
|
6519
6558
|
useMedia: () => import_useMedia.useMedia,
|
|
6520
6559
|
useMediaPropsActive: () => import_useMedia.useMediaPropsActive
|