@tamagui/core 2.0.0-1768636514428 → 2.0.0-1768699687560
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.cjs +93 -43
- package/dist/test.native.cjs +93 -43
- package/package.json +11 -11
package/dist/native.cjs
CHANGED
|
@@ -138,7 +138,7 @@ var pseudoDescriptorsBase = {
|
|
|
138
138
|
priority: 5
|
|
139
139
|
}
|
|
140
140
|
}), defaultMediaImportance = Object.keys(pseudoDescriptors).length;
|
|
141
|
-
function _type_of$
|
|
141
|
+
function _type_of$a(obj) {
|
|
142
142
|
"@swc/helpers - typeof";
|
|
143
143
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
144
144
|
}
|
|
@@ -162,13 +162,13 @@ var mergeProps = function(defaultProps2, props) {
|
|
|
162
162
|
};
|
|
163
163
|
function mergeProp(out, defaultProps2, props, key) {
|
|
164
164
|
var val = props[key];
|
|
165
|
-
if (defaultProps2 && key in defaultProps2 && (key in pseudoDescriptors || key[0] === "$") && val && (typeof val > "u" ? "undefined" : _type_of$
|
|
165
|
+
if (defaultProps2 && key in defaultProps2 && (key in pseudoDescriptors || key[0] === "$") && val && (typeof val > "u" ? "undefined" : _type_of$a(val)) === "object") {
|
|
166
166
|
var defaultVal = defaultProps2[key];
|
|
167
|
-
defaultVal && (typeof defaultVal > "u" ? "undefined" : _type_of$
|
|
167
|
+
defaultVal && (typeof defaultVal > "u" ? "undefined" : _type_of$a(defaultVal)) === "object" && (val = mergeProps(defaultVal, val));
|
|
168
168
|
}
|
|
169
169
|
out[key] = val;
|
|
170
170
|
}
|
|
171
|
-
function _type_of$
|
|
171
|
+
function _type_of$9(obj) {
|
|
172
172
|
"@swc/helpers - typeof";
|
|
173
173
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
174
174
|
}
|
|
@@ -176,7 +176,7 @@ function objectIdentityKey(obj) {
|
|
|
176
176
|
var k = "";
|
|
177
177
|
for (var key in obj) {
|
|
178
178
|
k += key;
|
|
179
|
-
var arg = obj[key], type = typeof arg > "u" ? "undefined" : _type_of$
|
|
179
|
+
var arg = obj[key], type = typeof arg > "u" ? "undefined" : _type_of$9(arg);
|
|
180
180
|
if (!arg || type !== "object" && type !== "function") k += type + arg;
|
|
181
181
|
else if (cache$6.has(arg)) k += cache$6.get(arg);
|
|
182
182
|
else {
|
|
@@ -8390,6 +8390,18 @@ var getTokens = function() {
|
|
|
8390
8390
|
};
|
|
8391
8391
|
function setupDev(conf2) {
|
|
8392
8392
|
}
|
|
8393
|
+
function loadAnimationDriver(name, driver) {
|
|
8394
|
+
var config = getConfigFromGlobalOrLocal();
|
|
8395
|
+
if (!config) {
|
|
8396
|
+
return;
|
|
8397
|
+
}
|
|
8398
|
+
config.animations && !("default" in config.animations) && (config.animations = {
|
|
8399
|
+
default: config.animations
|
|
8400
|
+
}), config.animations ? config.animations[name] = driver : config.animations = {
|
|
8401
|
+
default: driver,
|
|
8402
|
+
[name]: driver
|
|
8403
|
+
};
|
|
8404
|
+
}
|
|
8393
8405
|
var matchMediaImpl = matchMediaFallback, matchMedia$1 = function() {
|
|
8394
8406
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
8395
8407
|
return matchMediaImpl(...args);
|
|
@@ -8598,7 +8610,7 @@ function clamp(value, param) {
|
|
|
8598
8610
|
var [min, max] = param;
|
|
8599
8611
|
return Math.min(max, Math.max(min, value));
|
|
8600
8612
|
}
|
|
8601
|
-
function _type_of$
|
|
8613
|
+
function _type_of$8(obj) {
|
|
8602
8614
|
"@swc/helpers - typeof";
|
|
8603
8615
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
8604
8616
|
}
|
|
@@ -8607,7 +8619,7 @@ function composeEventHandlers(og, next) {
|
|
|
8607
8619
|
checkDefaultPrevented = true
|
|
8608
8620
|
} = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
8609
8621
|
return !og || !next ? next || og || void 0 : function(event) {
|
|
8610
|
-
if (og == null ? void 0 : og(event), !event || !(checkDefaultPrevented && (typeof event > "u" ? "undefined" : _type_of$
|
|
8622
|
+
if (og == null ? void 0 : og(event), !event || !(checkDefaultPrevented && (typeof event > "u" ? "undefined" : _type_of$8(event)) === "object" && "defaultPrevented" in event) || // @ts-ignore
|
|
8611
8623
|
"defaultPrevented" in event && !event.defaultPrevented) return next == null ? void 0 : next(event);
|
|
8612
8624
|
};
|
|
8613
8625
|
}
|
|
@@ -8915,6 +8927,7 @@ var textColors = {
|
|
|
8915
8927
|
elevationAndroid: true
|
|
8916
8928
|
} : {}), {
|
|
8917
8929
|
boxShadow: true,
|
|
8930
|
+
border: true,
|
|
8918
8931
|
filter: true,
|
|
8919
8932
|
// RN 0.76/0.77+ style props (New Architecture)
|
|
8920
8933
|
boxSizing: true,
|
|
@@ -8951,7 +8964,7 @@ var textColors = {
|
|
|
8951
8964
|
disabledStyle: true,
|
|
8952
8965
|
focusWithinStyle: true
|
|
8953
8966
|
}, validStyles = stylePropsView;
|
|
8954
|
-
function _type_of$
|
|
8967
|
+
function _type_of$7(obj) {
|
|
8955
8968
|
"@swc/helpers - typeof";
|
|
8956
8969
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
8957
8970
|
}
|
|
@@ -8965,14 +8978,14 @@ var Decorated = Symbol(), withStaticProperties = function(component, staticProps
|
|
|
8965
8978
|
});
|
|
8966
8979
|
for (var key in component) {
|
|
8967
8980
|
var v = component[key];
|
|
8968
|
-
_2[key] = v && (typeof v > "u" ? "undefined" : _type_of$
|
|
8981
|
+
_2[key] = v && (typeof v > "u" ? "undefined" : _type_of$7(v)) === "object" ? __spreadValues({}, v) : v;
|
|
8969
8982
|
}
|
|
8970
8983
|
}
|
|
8971
8984
|
return component;
|
|
8972
8985
|
})();
|
|
8973
8986
|
return Object.assign(next, staticProps), next[Decorated] = true, next;
|
|
8974
8987
|
};
|
|
8975
|
-
function _type_of$
|
|
8988
|
+
function _type_of$6(obj) {
|
|
8976
8989
|
"@swc/helpers - typeof";
|
|
8977
8990
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
8978
8991
|
}
|
|
@@ -8999,7 +9012,7 @@ function variableToString(vrble) {
|
|
|
8999
9012
|
return isVariable(vrble) ? `${vrble.val}` : `${vrble || ""}`;
|
|
9000
9013
|
}
|
|
9001
9014
|
function isVariable(v) {
|
|
9002
|
-
return v && (typeof v > "u" ? "undefined" : _type_of$
|
|
9015
|
+
return v && (typeof v > "u" ? "undefined" : _type_of$6(v)) === "object" && "isVar" in v;
|
|
9003
9016
|
}
|
|
9004
9017
|
function getVariable(nameOrVariable) {
|
|
9005
9018
|
var group = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "size", _tokens_group;
|
|
@@ -9331,7 +9344,7 @@ function getThemeProxied(_props, _state, _keys) {
|
|
|
9331
9344
|
var outVal = getVariable(value), {
|
|
9332
9345
|
name,
|
|
9333
9346
|
scheme
|
|
9334
|
-
} = curState, shouldOptimize = scheme && platform !== "web" && isIos && !curProps.deopt && getSetting("fastSchemeChange") && doesRootSchemeMatchSystem();
|
|
9347
|
+
} = curState, shouldOptimize = scheme && platform !== "web" && isIos && !curProps.deopt && !curState.isInverse && getSetting("fastSchemeChange") && doesRootSchemeMatchSystem();
|
|
9335
9348
|
if (shouldOptimize) {
|
|
9336
9349
|
var _config_themes_name, _config_themes_oppositeName, oppositeScheme = scheme === "dark" ? "light" : "dark", oppositeName = name.replace(scheme, oppositeScheme), color = getVariable((_config_themes_name = config.themes[name]) === null || _config_themes_name === void 0 ? void 0 : _config_themes_name[key]), oppositeColor = getVariable((_config_themes_oppositeName = config.themes[oppositeName]) === null || _config_themes_oppositeName === void 0 ? void 0 : _config_themes_oppositeName[key]), dynamicVal = getDynamicVal({
|
|
9337
9350
|
scheme,
|
|
@@ -9720,12 +9733,12 @@ function getFontsForLanguage(fonts, language) {
|
|
|
9720
9733
|
})));
|
|
9721
9734
|
return fontLanguageCache.set(language, next), next;
|
|
9722
9735
|
}
|
|
9723
|
-
function _type_of$
|
|
9736
|
+
function _type_of$5(obj) {
|
|
9724
9737
|
"@swc/helpers - typeof";
|
|
9725
9738
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
9726
9739
|
}
|
|
9727
9740
|
var isObj = function(x) {
|
|
9728
|
-
return x && !Array.isArray(x) && (typeof x > "u" ? "undefined" : _type_of$
|
|
9741
|
+
return x && !Array.isArray(x) && (typeof x > "u" ? "undefined" : _type_of$5(x)) === "object";
|
|
9729
9742
|
};
|
|
9730
9743
|
function normalizeStyle$1(style) {
|
|
9731
9744
|
var disableNormalize = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, res = {};
|
|
@@ -9812,14 +9825,14 @@ var skipProps = {
|
|
|
9812
9825
|
debug: 1,
|
|
9813
9826
|
componentName: 1,
|
|
9814
9827
|
disableOptimization: 1,
|
|
9815
|
-
|
|
9828
|
+
render: 1,
|
|
9816
9829
|
style: 1,
|
|
9817
9830
|
// handled after loop so pseudos set usedKeys and override it if necessary
|
|
9818
9831
|
group: 1,
|
|
9819
9832
|
animatePresence: 1
|
|
9820
9833
|
};
|
|
9821
9834
|
Object.assign(skipProps, webPropsToSkip);
|
|
9822
|
-
function _type_of$
|
|
9835
|
+
function _type_of$4(obj) {
|
|
9823
9836
|
"@swc/helpers - typeof";
|
|
9824
9837
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
9825
9838
|
}
|
|
@@ -9892,7 +9905,7 @@ var resolveTok = function(v, cat, sp, ss) {
|
|
|
9892
9905
|
}
|
|
9893
9906
|
styleProps2.disableExpandShorthands || key in conf2.shorthands && (key = conf2.shorthands[key]);
|
|
9894
9907
|
var originalValue = value;
|
|
9895
|
-
if (value != null && (key === "boxShadow" && (typeof value > "u" ? "undefined" : _type_of$
|
|
9908
|
+
if (value != null && (key === "boxShadow" && (typeof value > "u" ? "undefined" : _type_of$4(value)) === "object" ? value = boxShadowObjResolve(value, styleProps2, styleState) : key === "filter" && (typeof value > "u" ? "undefined" : _type_of$4(value)) === "object" ? value = filterObjResolve(value, styleProps2, styleState) : typeof value == "string" && value[0] === "$" ? value = getTokenForKey(key, value, styleProps2, styleState) : key === "boxShadow" && typeof value == "string" && value.includes("$") ? value = value.replace(/(\$[\w.-]+)/g, function(t2) {
|
|
9896
9909
|
var cat = /^\$-?\d/.test(t2) ? "size" : "color", r = getTokenForKey(cat, t2, styleProps2, styleState);
|
|
9897
9910
|
return r != null ? String(r) : t2;
|
|
9898
9911
|
}) : key === "filter" && typeof value == "string" && value.includes("$") ? value = value.replace(/(\$[\w.-]+)/g, function(t2) {
|
|
@@ -10051,7 +10064,7 @@ function getVariantDefinition(variant, value, conf2) {
|
|
|
10051
10064
|
var fontSizeVariant = variant["...fontSize"];
|
|
10052
10065
|
if (fontSizeVariant && conf2.fontSizeTokens.has(value)) return fontSizeVariant;
|
|
10053
10066
|
}
|
|
10054
|
-
return variant[`:${typeof value > "u" ? "undefined" : _type_of$
|
|
10067
|
+
return variant[`:${typeof value > "u" ? "undefined" : _type_of$4(value)}`] || variant["..."];
|
|
10055
10068
|
}
|
|
10056
10069
|
}
|
|
10057
10070
|
var fontShorthand = {
|
|
@@ -10138,7 +10151,7 @@ function transformsToString(transforms) {
|
|
|
10138
10151
|
}
|
|
10139
10152
|
).join(" ");
|
|
10140
10153
|
}
|
|
10141
|
-
function _type_of$
|
|
10154
|
+
function _type_of$3(obj) {
|
|
10142
10155
|
"@swc/helpers - typeof";
|
|
10143
10156
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
10144
10157
|
}
|
|
@@ -10163,7 +10176,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
10163
10176
|
if (keyInit === "children") return viewProps[keyInit] = valInit, "continue";
|
|
10164
10177
|
if (accept) {
|
|
10165
10178
|
var accepted = accept[keyInit];
|
|
10166
|
-
if ((accepted === "style" || accepted === "textStyle") && valInit && (typeof valInit > "u" ? "undefined" : _type_of$
|
|
10179
|
+
if ((accepted === "style" || accepted === "textStyle") && valInit && (typeof valInit > "u" ? "undefined" : _type_of$3(valInit)) === "object") return viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps2.noClass), "continue";
|
|
10167
10180
|
}
|
|
10168
10181
|
if (disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className") return "continue";
|
|
10169
10182
|
if (keyInit in skipProps && !noSkip && !isHOC) {
|
|
@@ -10348,7 +10361,9 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
10348
10361
|
inlineWhenUnflattened,
|
|
10349
10362
|
parentStaticConfig,
|
|
10350
10363
|
acceptsClassName
|
|
10351
|
-
} = staticConfig, viewProps = {}, mediaState = styleProps2.mediaState || exports.mediaState, shouldDoClasses = acceptsClassName && isWeb, rulesToInsert = void 0, classNames = {}
|
|
10364
|
+
} = staticConfig, viewProps = {}, mediaState = styleProps2.mediaState || exports.mediaState, shouldDoClasses = acceptsClassName && isWeb, rulesToInsert = void 0, classNames = {};
|
|
10365
|
+
props.space;
|
|
10366
|
+
var pseudos = null, hasMedia = false, dynamicThemeAccess, pseudoGroups, mediaGroups;
|
|
10352
10367
|
props.className || "";
|
|
10353
10368
|
var mediaStylesSeen = 0, validStyles$1 = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? stylePropsText : validStyles);
|
|
10354
10369
|
var styleState = {
|
|
@@ -10591,6 +10606,18 @@ function applyDefaultStyle(pkey, styleState) {
|
|
|
10591
10606
|
var defaultValues = animatableDefaults[pkey];
|
|
10592
10607
|
defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues, 1);
|
|
10593
10608
|
}
|
|
10609
|
+
var isEventHandler = /^on[A-Z]/;
|
|
10610
|
+
function mergeSlotStyleProps(base, overlay) {
|
|
10611
|
+
for (var key in overlay) {
|
|
10612
|
+
var baseVal = base[key], overlayVal = overlay[key];
|
|
10613
|
+
overlayVal !== void 0 && (key === "style" ? base.style = baseVal && overlayVal ? __spreadValues(__spreadValues({}, baseVal), overlayVal) : overlayVal || baseVal : key === "className" ? base.className = baseVal && overlayVal ? `${baseVal} ${overlayVal}` : overlayVal || baseVal : key === "ref" ? base.ref = baseVal && overlayVal ? composeRefs(baseVal, overlayVal) : overlayVal || baseVal : isEventHandler.test(key) && typeof baseVal == "function" && typeof overlayVal == "function" ? base[key] = composeEventHandlers(baseVal, overlayVal) : base[key] = overlayVal);
|
|
10614
|
+
}
|
|
10615
|
+
return base;
|
|
10616
|
+
}
|
|
10617
|
+
function mergeRenderElementProps(elementProps, viewProps, children) {
|
|
10618
|
+
var merged = mergeSlotStyleProps(__spreadValues({}, elementProps), viewProps);
|
|
10619
|
+
return merged.children = children, merged;
|
|
10620
|
+
}
|
|
10594
10621
|
function setElementProps(element) {
|
|
10595
10622
|
element && !element.getBoundingClientRect && (element.getBoundingClientRect = function() {
|
|
10596
10623
|
if (element.unstable_getBoundingClientRect != null) return element.unstable_getBoundingClientRect();
|
|
@@ -10773,7 +10800,7 @@ function useClientValue(value) {
|
|
|
10773
10800
|
useDidFinishSSR();
|
|
10774
10801
|
return typeof value == "function" ? value() : value;
|
|
10775
10802
|
}
|
|
10776
|
-
function _type_of$
|
|
10803
|
+
function _type_of$2(obj) {
|
|
10777
10804
|
"@swc/helpers - typeof";
|
|
10778
10805
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
10779
10806
|
}
|
|
@@ -10851,7 +10878,7 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
|
10851
10878
|
function hasAnimatedStyleValue(style) {
|
|
10852
10879
|
return Object.keys(style).some(function(k) {
|
|
10853
10880
|
var val = style[k];
|
|
10854
|
-
return val && (typeof val > "u" ? "undefined" : _type_of$
|
|
10881
|
+
return val && (typeof val > "u" ? "undefined" : _type_of$2(val)) === "object" && "_animation" in val;
|
|
10855
10882
|
});
|
|
10856
10883
|
}
|
|
10857
10884
|
var isDisabled = function(props) {
|
|
@@ -10862,7 +10889,7 @@ var hooks = {};
|
|
|
10862
10889
|
function setupHooks(next) {
|
|
10863
10890
|
Object.assign(hooks, next);
|
|
10864
10891
|
}
|
|
10865
|
-
var
|
|
10892
|
+
var Slot = /* @__PURE__ */ React.memo(/* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
10866
10893
|
var _a = props, {
|
|
10867
10894
|
children
|
|
10868
10895
|
} = _a, slotProps = __objRest(_a, [
|
|
@@ -10871,7 +10898,7 @@ var is19 = React.version.startsWith("19."), Slot = /* @__PURE__ */ React.memo(/*
|
|
|
10871
10898
|
if (/* @__PURE__ */ React.isValidElement(children)) {
|
|
10872
10899
|
var mergedProps = mergeSlotProps(children, slotProps);
|
|
10873
10900
|
return /* @__PURE__ */ React.cloneElement(children, children.type.avoidForwardRef ? mergedProps : __spreadProps(__spreadValues({}, mergedProps), {
|
|
10874
|
-
ref: composeRefs(forwardedRef,
|
|
10901
|
+
ref: composeRefs(forwardedRef, children.props.ref)
|
|
10875
10902
|
}));
|
|
10876
10903
|
}
|
|
10877
10904
|
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
@@ -10886,17 +10913,16 @@ var is19 = React.version.startsWith("19."), Slot = /* @__PURE__ */ React.memo(/*
|
|
|
10886
10913
|
Slottable.displayName = "Slottable";
|
|
10887
10914
|
var pressMap = {};
|
|
10888
10915
|
function mergeSlotProps(child, slotProps) {
|
|
10889
|
-
var childProps = child.props,
|
|
10916
|
+
var childProps = child.props, isHTMLChild = typeof child.type == "string";
|
|
10890
10917
|
if (isHTMLChild) for (var key in pressMap) key in slotProps && (slotProps[pressMap[key]] = slotProps[key], delete slotProps[key]);
|
|
10891
|
-
|
|
10892
|
-
|
|
10893
|
-
|
|
10894
|
-
|
|
10895
|
-
|
|
10896
|
-
|
|
10897
|
-
return
|
|
10918
|
+
var merged = mergeSlotStyleProps(slotProps, childProps);
|
|
10919
|
+
if (isHTMLChild) for (var key1 in pressMap) key1 in merged && (merged[pressMap[key1]] = merged[key1], delete merged[key1]);
|
|
10920
|
+
return merged;
|
|
10921
|
+
}
|
|
10922
|
+
function _type_of$1(obj) {
|
|
10923
|
+
"@swc/helpers - typeof";
|
|
10924
|
+
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
10898
10925
|
}
|
|
10899
|
-
var handleRegex = /^on[A-Z]/;
|
|
10900
10926
|
var componentSetStates = /* @__PURE__ */ new Set(), avoidReRenderKeys = /* @__PURE__ */ new Set(["hover", "press", "pressIn", "group", "focus", "focusWithin", "media", "group"]);
|
|
10901
10927
|
var BaseText, BaseView, hasSetupBaseViews = false, lastInteractionWasKeyboard = {
|
|
10902
10928
|
value: false
|
|
@@ -10918,7 +10944,7 @@ function createComponent(staticConfig) {
|
|
|
10918
10944
|
isHOC
|
|
10919
10945
|
} = staticConfig;
|
|
10920
10946
|
var component = /* @__PURE__ */ React.forwardRef(function(propsIn, forwardedRef) {
|
|
10921
|
-
var _hooks_usePropsTransform, _hooks_useEvents
|
|
10947
|
+
var _hooks_usePropsTransform, _hooks_useEvents;
|
|
10922
10948
|
if (!hasSetupBaseViews) {
|
|
10923
10949
|
var _hooks_getBaseViews;
|
|
10924
10950
|
hasSetupBaseViews = true;
|
|
@@ -10935,7 +10961,17 @@ function createComponent(staticConfig) {
|
|
|
10935
10961
|
nextProps && (props = nextProps), overriddenContextProps = overrides;
|
|
10936
10962
|
}
|
|
10937
10963
|
var componentName2 = props.componentName || staticConfig.componentName;
|
|
10938
|
-
var groupContextParent = React.useContext(GroupContext), animationDriver =
|
|
10964
|
+
var groupContextParent = React.useContext(GroupContext), animationDriver = (function() {
|
|
10965
|
+
if (props.animatedBy && (config == null ? void 0 : config.animations)) {
|
|
10966
|
+
var animations2 = config.animations;
|
|
10967
|
+
if ("default" in animations2) {
|
|
10968
|
+
var _animations_props_animatedBy;
|
|
10969
|
+
return (_animations_props_animatedBy = animations2[props.animatedBy]) !== null && _animations_props_animatedBy !== void 0 ? _animations_props_animatedBy : animations2.default;
|
|
10970
|
+
}
|
|
10971
|
+
return props.animatedBy === "default" ? animations2 : null;
|
|
10972
|
+
}
|
|
10973
|
+
return componentContext.animationDriver;
|
|
10974
|
+
})(), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = useComponentState(props, (animationDriver == null ? void 0 : animationDriver.isStub) ? null : animationDriver, staticConfig), {
|
|
10939
10975
|
disabled,
|
|
10940
10976
|
groupName,
|
|
10941
10977
|
hasAnimationProp,
|
|
@@ -10992,7 +11028,7 @@ function createComponent(staticConfig) {
|
|
|
10992
11028
|
}
|
|
10993
11029
|
});
|
|
10994
11030
|
}, [stateRef, groupName, groupContextParent]), setStateShallow = componentState.setStateShallow;
|
|
10995
|
-
var isTaggable = !Component || typeof Component == "string",
|
|
11031
|
+
var isTaggable = !Component || typeof Component == "string", renderProp = props.render, element = Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || "div", elementType = isText ? BaseTextComponent : BaseViewComponent;
|
|
10996
11032
|
animationDriver && isAnimated && // this should really be behind another prop as it's not really related to
|
|
10997
11033
|
// "needsWebStyles" basically with motion we just animate a plain div, but
|
|
10998
11034
|
// we still have animated.View/Text for Sheet which wants to control
|
|
@@ -11010,7 +11046,7 @@ function createComponent(staticConfig) {
|
|
|
11010
11046
|
return !!stateRef.current.isListeningToTheme;
|
|
11011
11047
|
}, themeStateProps.deopt = willBeAnimated, false) ;
|
|
11012
11048
|
var [theme, themeState] = useThemeWithState(themeStateProps);
|
|
11013
|
-
elementType =
|
|
11049
|
+
elementType = element || elementType;
|
|
11014
11050
|
var mediaState = useMedia(componentContext);
|
|
11015
11051
|
setDidGetVariableValue(false);
|
|
11016
11052
|
var resolveValues = (
|
|
@@ -11152,7 +11188,7 @@ function createComponent(staticConfig) {
|
|
|
11152
11188
|
"onClick",
|
|
11153
11189
|
"theme"
|
|
11154
11190
|
]), viewProps = nonTamaguiProps;
|
|
11155
|
-
!isTaggable && props.forceStyle && (viewProps.forceStyle = props.forceStyle), isHOC && (typeof _themeProp < "u" && (viewProps.theme = _themeProp), typeof passThrough < "u" && (viewProps.passThrough = passThrough)),
|
|
11191
|
+
!isTaggable && props.forceStyle && (viewProps.forceStyle = props.forceStyle), isHOC && (typeof _themeProp < "u" && (viewProps.theme = _themeProp), typeof passThrough < "u" && (viewProps.passThrough = passThrough)), renderProp && elementType.acceptTagProp && (viewProps.render = renderProp);
|
|
11156
11192
|
var animationStyles, shouldUseAnimation = (
|
|
11157
11193
|
// if it supports css vars we run it on server too to get matching initial style
|
|
11158
11194
|
(supportsCSS ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
|
|
@@ -11171,6 +11207,7 @@ function createComponent(staticConfig) {
|
|
|
11171
11207
|
componentState: state,
|
|
11172
11208
|
styleProps: styleProps2,
|
|
11173
11209
|
theme,
|
|
11210
|
+
themeName,
|
|
11174
11211
|
pseudos: pseudos || null,
|
|
11175
11212
|
staticConfig,
|
|
11176
11213
|
stateRef
|
|
@@ -11302,8 +11339,17 @@ function createComponent(staticConfig) {
|
|
|
11302
11339
|
}
|
|
11303
11340
|
});
|
|
11304
11341
|
var useChildrenResult;
|
|
11305
|
-
hooks.useChildren && (useChildrenResult = hooks.useChildren(elementType, content, viewProps)), useChildrenResult
|
|
11306
|
-
|
|
11342
|
+
if (hooks.useChildren && (useChildrenResult = hooks.useChildren(elementType, content, viewProps)), useChildrenResult) content = useChildrenResult;
|
|
11343
|
+
else if (typeof renderProp == "function") {
|
|
11344
|
+
var renderProps = __spreadProps(__spreadValues({}, viewProps), {
|
|
11345
|
+
children: content
|
|
11346
|
+
});
|
|
11347
|
+
content = renderProp(renderProps, state);
|
|
11348
|
+
} else if (renderProp && (typeof renderProp > "u" ? "undefined" : _type_of$1(renderProp)) === "object" && /* @__PURE__ */ React.isValidElement(renderProp)) {
|
|
11349
|
+
var elementProps = renderProp.props || {}, mergedProps = mergeRenderElementProps(elementProps, viewProps, content);
|
|
11350
|
+
content = /* @__PURE__ */ React.cloneElement(renderProp, mergedProps);
|
|
11351
|
+
} else content = /* @__PURE__ */ React.createElement(elementType, viewProps, content);
|
|
11352
|
+
var ResetPresence = animationDriver == null ? void 0 : animationDriver.ResetPresence, needsReset = !!// not when passing down to child
|
|
11307
11353
|
(!asChild && // not when passThrough
|
|
11308
11354
|
splitStyles && // not when HOC
|
|
11309
11355
|
!isHOC && ResetPresence && willBeAnimated && (hasEnterStyle || presenceState)), hasEverReset = stateRef.current.hasEverResetPresence;
|
|
@@ -12024,9 +12070,12 @@ function TamaguiProvider$1(param) {
|
|
|
12024
12070
|
}, []);
|
|
12025
12071
|
var memoizedInsets = React.useMemo(function() {
|
|
12026
12072
|
return insets;
|
|
12027
|
-
}, [insets == null ? void 0 : insets.top, insets == null ? void 0 : insets.right, insets == null ? void 0 : insets.bottom, insets == null ? void 0 : insets.left]),
|
|
12073
|
+
}, [insets == null ? void 0 : insets.top, insets == null ? void 0 : insets.right, insets == null ? void 0 : insets.bottom, insets == null ? void 0 : insets.left]), defaultAnimationDriver2 = React.useMemo(function() {
|
|
12074
|
+
var animations = config == null ? void 0 : config.animations;
|
|
12075
|
+
return animations ? "default" in animations ? animations.default : animations : null;
|
|
12076
|
+
}, [config == null ? void 0 : config.animations]), contents = /* @__PURE__ */ jsxRuntime.jsx(UnmountedClassName, {
|
|
12028
12077
|
children: /* @__PURE__ */ jsxRuntime.jsx(ComponentContext.Provider, {
|
|
12029
|
-
animationDriver:
|
|
12078
|
+
animationDriver: defaultAnimationDriver2,
|
|
12030
12079
|
insets: memoizedInsets,
|
|
12031
12080
|
children: /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, {
|
|
12032
12081
|
defaultTheme,
|
|
@@ -12696,6 +12745,7 @@ exports.isVariable = isVariable;
|
|
|
12696
12745
|
exports.isWeb = isWeb;
|
|
12697
12746
|
exports.isWebTouchable = isWebTouchable;
|
|
12698
12747
|
exports.isWindowDefined = isWindowDefined;
|
|
12748
|
+
exports.loadAnimationDriver = loadAnimationDriver;
|
|
12699
12749
|
exports.matchMedia = matchMedia$1;
|
|
12700
12750
|
exports.mediaKeyMatch = mediaKeyMatch;
|
|
12701
12751
|
exports.mediaObjectToString = mediaObjectToString;
|
package/dist/test.native.cjs
CHANGED
|
@@ -118,7 +118,7 @@ var pseudoDescriptorsBase = {
|
|
|
118
118
|
priority: 5
|
|
119
119
|
}
|
|
120
120
|
}), defaultMediaImportance = Object.keys(pseudoDescriptors).length;
|
|
121
|
-
function _type_of$
|
|
121
|
+
function _type_of$a(obj) {
|
|
122
122
|
"@swc/helpers - typeof";
|
|
123
123
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
124
124
|
}
|
|
@@ -142,13 +142,13 @@ var mergeProps = function(defaultProps, props) {
|
|
|
142
142
|
};
|
|
143
143
|
function mergeProp(out, defaultProps, props, key) {
|
|
144
144
|
var val = props[key];
|
|
145
|
-
if (defaultProps && key in defaultProps && (key in pseudoDescriptors || key[0] === "$") && val && (typeof val > "u" ? "undefined" : _type_of$
|
|
145
|
+
if (defaultProps && key in defaultProps && (key in pseudoDescriptors || key[0] === "$") && val && (typeof val > "u" ? "undefined" : _type_of$a(val)) === "object") {
|
|
146
146
|
var defaultVal = defaultProps[key];
|
|
147
|
-
defaultVal && (typeof defaultVal > "u" ? "undefined" : _type_of$
|
|
147
|
+
defaultVal && (typeof defaultVal > "u" ? "undefined" : _type_of$a(defaultVal)) === "object" && (val = mergeProps(defaultVal, val));
|
|
148
148
|
}
|
|
149
149
|
out[key] = val;
|
|
150
150
|
}
|
|
151
|
-
function _type_of$
|
|
151
|
+
function _type_of$9(obj) {
|
|
152
152
|
"@swc/helpers - typeof";
|
|
153
153
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
154
154
|
}
|
|
@@ -156,7 +156,7 @@ function objectIdentityKey(obj) {
|
|
|
156
156
|
var k = "";
|
|
157
157
|
for (var key in obj) {
|
|
158
158
|
k += key;
|
|
159
|
-
var arg = obj[key], type = typeof arg > "u" ? "undefined" : _type_of$
|
|
159
|
+
var arg = obj[key], type = typeof arg > "u" ? "undefined" : _type_of$9(arg);
|
|
160
160
|
if (!arg || type !== "object" && type !== "function") k += type + arg;
|
|
161
161
|
else if (cache$5.has(arg)) k += cache$5.get(arg);
|
|
162
162
|
else {
|
|
@@ -307,6 +307,18 @@ var getTokens = function() {
|
|
|
307
307
|
};
|
|
308
308
|
function setupDev(conf2) {
|
|
309
309
|
}
|
|
310
|
+
function loadAnimationDriver(name, driver) {
|
|
311
|
+
var config = getConfigFromGlobalOrLocal();
|
|
312
|
+
if (!config) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
config.animations && !("default" in config.animations) && (config.animations = {
|
|
316
|
+
default: config.animations
|
|
317
|
+
}), config.animations ? config.animations[name] = driver : config.animations = {
|
|
318
|
+
default: driver,
|
|
319
|
+
[name]: driver
|
|
320
|
+
};
|
|
321
|
+
}
|
|
310
322
|
var matchMediaImpl = matchMediaFallback, matchMedia$1 = function() {
|
|
311
323
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
312
324
|
return matchMediaImpl(...args);
|
|
@@ -515,7 +527,7 @@ function clamp(value, param) {
|
|
|
515
527
|
var [min, max] = param;
|
|
516
528
|
return Math.min(max, Math.max(min, value));
|
|
517
529
|
}
|
|
518
|
-
function _type_of$
|
|
530
|
+
function _type_of$8(obj) {
|
|
519
531
|
"@swc/helpers - typeof";
|
|
520
532
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
521
533
|
}
|
|
@@ -524,7 +536,7 @@ function composeEventHandlers(og, next) {
|
|
|
524
536
|
checkDefaultPrevented = true
|
|
525
537
|
} = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
526
538
|
return !og || !next ? next || og || void 0 : function(event) {
|
|
527
|
-
if (og == null ? void 0 : og(event), !event || !(checkDefaultPrevented && (typeof event > "u" ? "undefined" : _type_of$
|
|
539
|
+
if (og == null ? void 0 : og(event), !event || !(checkDefaultPrevented && (typeof event > "u" ? "undefined" : _type_of$8(event)) === "object" && "defaultPrevented" in event) || // @ts-ignore
|
|
528
540
|
"defaultPrevented" in event && !event.defaultPrevented) return next == null ? void 0 : next(event);
|
|
529
541
|
};
|
|
530
542
|
}
|
|
@@ -832,6 +844,7 @@ var textColors = {
|
|
|
832
844
|
elevationAndroid: true
|
|
833
845
|
} : {}), {
|
|
834
846
|
boxShadow: true,
|
|
847
|
+
border: true,
|
|
835
848
|
filter: true,
|
|
836
849
|
// RN 0.76/0.77+ style props (New Architecture)
|
|
837
850
|
boxSizing: true,
|
|
@@ -868,7 +881,7 @@ var textColors = {
|
|
|
868
881
|
disabledStyle: true,
|
|
869
882
|
focusWithinStyle: true
|
|
870
883
|
}, validStyles = stylePropsView;
|
|
871
|
-
function _type_of$
|
|
884
|
+
function _type_of$7(obj) {
|
|
872
885
|
"@swc/helpers - typeof";
|
|
873
886
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
874
887
|
}
|
|
@@ -882,14 +895,14 @@ var Decorated = Symbol(), withStaticProperties = function(component, staticProps
|
|
|
882
895
|
});
|
|
883
896
|
for (var key in component) {
|
|
884
897
|
var v = component[key];
|
|
885
|
-
_2[key] = v && (typeof v > "u" ? "undefined" : _type_of$
|
|
898
|
+
_2[key] = v && (typeof v > "u" ? "undefined" : _type_of$7(v)) === "object" ? __spreadValues({}, v) : v;
|
|
886
899
|
}
|
|
887
900
|
}
|
|
888
901
|
return component;
|
|
889
902
|
})();
|
|
890
903
|
return Object.assign(next, staticProps), next[Decorated] = true, next;
|
|
891
904
|
};
|
|
892
|
-
function _type_of$
|
|
905
|
+
function _type_of$6(obj) {
|
|
893
906
|
"@swc/helpers - typeof";
|
|
894
907
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
895
908
|
}
|
|
@@ -916,7 +929,7 @@ function variableToString(vrble) {
|
|
|
916
929
|
return isVariable(vrble) ? `${vrble.val}` : `${vrble || ""}`;
|
|
917
930
|
}
|
|
918
931
|
function isVariable(v) {
|
|
919
|
-
return v && (typeof v > "u" ? "undefined" : _type_of$
|
|
932
|
+
return v && (typeof v > "u" ? "undefined" : _type_of$6(v)) === "object" && "isVar" in v;
|
|
920
933
|
}
|
|
921
934
|
function getVariable(nameOrVariable) {
|
|
922
935
|
var group = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "size", _tokens_group;
|
|
@@ -1248,7 +1261,7 @@ function getThemeProxied(_props, _state, _keys) {
|
|
|
1248
1261
|
var outVal = getVariable(value), {
|
|
1249
1262
|
name,
|
|
1250
1263
|
scheme
|
|
1251
|
-
} = curState, shouldOptimize = scheme && platform !== "web" && isIos && !curProps.deopt && getSetting("fastSchemeChange") && doesRootSchemeMatchSystem();
|
|
1264
|
+
} = curState, shouldOptimize = scheme && platform !== "web" && isIos && !curProps.deopt && !curState.isInverse && getSetting("fastSchemeChange") && doesRootSchemeMatchSystem();
|
|
1252
1265
|
if (shouldOptimize) {
|
|
1253
1266
|
var _config_themes_name, _config_themes_oppositeName, oppositeScheme = scheme === "dark" ? "light" : "dark", oppositeName = name.replace(scheme, oppositeScheme), color = getVariable((_config_themes_name = config.themes[name]) === null || _config_themes_name === void 0 ? void 0 : _config_themes_name[key]), oppositeColor = getVariable((_config_themes_oppositeName = config.themes[oppositeName]) === null || _config_themes_oppositeName === void 0 ? void 0 : _config_themes_oppositeName[key]), dynamicVal = getDynamicVal({
|
|
1254
1267
|
scheme,
|
|
@@ -2181,12 +2194,12 @@ function getFontsForLanguage(fonts, language) {
|
|
|
2181
2194
|
})));
|
|
2182
2195
|
return fontLanguageCache.set(language, next), next;
|
|
2183
2196
|
}
|
|
2184
|
-
function _type_of$
|
|
2197
|
+
function _type_of$5(obj) {
|
|
2185
2198
|
"@swc/helpers - typeof";
|
|
2186
2199
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
2187
2200
|
}
|
|
2188
2201
|
var isObj = function(x) {
|
|
2189
|
-
return x && !Array.isArray(x) && (typeof x > "u" ? "undefined" : _type_of$
|
|
2202
|
+
return x && !Array.isArray(x) && (typeof x > "u" ? "undefined" : _type_of$5(x)) === "object";
|
|
2190
2203
|
};
|
|
2191
2204
|
function normalizeStyle$1(style) {
|
|
2192
2205
|
var disableNormalize = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, res = {};
|
|
@@ -2273,7 +2286,7 @@ var skipProps = {
|
|
|
2273
2286
|
debug: 1,
|
|
2274
2287
|
componentName: 1,
|
|
2275
2288
|
disableOptimization: 1,
|
|
2276
|
-
|
|
2289
|
+
render: 1,
|
|
2277
2290
|
style: 1,
|
|
2278
2291
|
// handled after loop so pseudos set usedKeys and override it if necessary
|
|
2279
2292
|
group: 1,
|
|
@@ -2281,7 +2294,7 @@ var skipProps = {
|
|
|
2281
2294
|
};
|
|
2282
2295
|
skipProps["data-test-renders"] = 1;
|
|
2283
2296
|
Object.assign(skipProps, webPropsToSkip);
|
|
2284
|
-
function _type_of$
|
|
2297
|
+
function _type_of$4(obj) {
|
|
2285
2298
|
"@swc/helpers - typeof";
|
|
2286
2299
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
2287
2300
|
}
|
|
@@ -2354,7 +2367,7 @@ var resolveTok = function(v, cat, sp, ss) {
|
|
|
2354
2367
|
}
|
|
2355
2368
|
styleProps.disableExpandShorthands || key in conf2.shorthands && (key = conf2.shorthands[key]);
|
|
2356
2369
|
var originalValue = value;
|
|
2357
|
-
if (value != null && (key === "boxShadow" && (typeof value > "u" ? "undefined" : _type_of$
|
|
2370
|
+
if (value != null && (key === "boxShadow" && (typeof value > "u" ? "undefined" : _type_of$4(value)) === "object" ? value = boxShadowObjResolve(value, styleProps, styleState) : key === "filter" && (typeof value > "u" ? "undefined" : _type_of$4(value)) === "object" ? value = filterObjResolve(value, styleProps, styleState) : typeof value == "string" && value[0] === "$" ? value = getTokenForKey(key, value, styleProps, styleState) : key === "boxShadow" && typeof value == "string" && value.includes("$") ? value = value.replace(/(\$[\w.-]+)/g, function(t2) {
|
|
2358
2371
|
var cat = /^\$-?\d/.test(t2) ? "size" : "color", r = getTokenForKey(cat, t2, styleProps, styleState);
|
|
2359
2372
|
return r != null ? String(r) : t2;
|
|
2360
2373
|
}) : key === "filter" && typeof value == "string" && value.includes("$") ? value = value.replace(/(\$[\w.-]+)/g, function(t2) {
|
|
@@ -2513,7 +2526,7 @@ function getVariantDefinition(variant, value, conf2) {
|
|
|
2513
2526
|
var fontSizeVariant = variant["...fontSize"];
|
|
2514
2527
|
if (fontSizeVariant && conf2.fontSizeTokens.has(value)) return fontSizeVariant;
|
|
2515
2528
|
}
|
|
2516
|
-
return variant[`:${typeof value > "u" ? "undefined" : _type_of$
|
|
2529
|
+
return variant[`:${typeof value > "u" ? "undefined" : _type_of$4(value)}`] || variant["..."];
|
|
2517
2530
|
}
|
|
2518
2531
|
}
|
|
2519
2532
|
var fontShorthand = {
|
|
@@ -2600,7 +2613,7 @@ function transformsToString(transforms) {
|
|
|
2600
2613
|
}
|
|
2601
2614
|
).join(" ");
|
|
2602
2615
|
}
|
|
2603
|
-
function _type_of$
|
|
2616
|
+
function _type_of$3(obj) {
|
|
2604
2617
|
"@swc/helpers - typeof";
|
|
2605
2618
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
2606
2619
|
}
|
|
@@ -2626,7 +2639,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
2626
2639
|
if (keyInit === "jestAnimatedStyle") return "continue";
|
|
2627
2640
|
if (accept) {
|
|
2628
2641
|
var accepted = accept[keyInit];
|
|
2629
|
-
if ((accepted === "style" || accepted === "textStyle") && valInit && (typeof valInit > "u" ? "undefined" : _type_of$
|
|
2642
|
+
if ((accepted === "style" || accepted === "textStyle") && valInit && (typeof valInit > "u" ? "undefined" : _type_of$3(valInit)) === "object") return viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClass), "continue";
|
|
2630
2643
|
}
|
|
2631
2644
|
if (disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className") return "continue";
|
|
2632
2645
|
if (keyInit in skipProps && !noSkip && !isHOC) {
|
|
@@ -2811,7 +2824,9 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
2811
2824
|
inlineWhenUnflattened,
|
|
2812
2825
|
parentStaticConfig,
|
|
2813
2826
|
acceptsClassName
|
|
2814
|
-
} = staticConfig, viewProps = {}, mediaState = styleProps.mediaState || exports.mediaState, shouldDoClasses = acceptsClassName && isWeb, rulesToInsert = void 0, classNames = {}
|
|
2827
|
+
} = staticConfig, viewProps = {}, mediaState = styleProps.mediaState || exports.mediaState, shouldDoClasses = acceptsClassName && isWeb, rulesToInsert = void 0, classNames = {};
|
|
2828
|
+
props.space;
|
|
2829
|
+
var pseudos = null, hasMedia = false, dynamicThemeAccess, pseudoGroups, mediaGroups;
|
|
2815
2830
|
props.className || "";
|
|
2816
2831
|
var mediaStylesSeen = 0, validStyles$1 = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? stylePropsText : validStyles);
|
|
2817
2832
|
var styleState = {
|
|
@@ -3054,6 +3069,18 @@ function applyDefaultStyle(pkey, styleState) {
|
|
|
3054
3069
|
var defaultValues = animatableDefaults[pkey];
|
|
3055
3070
|
defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues, 1);
|
|
3056
3071
|
}
|
|
3072
|
+
var isEventHandler = /^on[A-Z]/;
|
|
3073
|
+
function mergeSlotStyleProps(base, overlay) {
|
|
3074
|
+
for (var key in overlay) {
|
|
3075
|
+
var baseVal = base[key], overlayVal = overlay[key];
|
|
3076
|
+
overlayVal !== void 0 && (key === "style" ? base.style = baseVal && overlayVal ? __spreadValues(__spreadValues({}, baseVal), overlayVal) : overlayVal || baseVal : key === "className" ? base.className = baseVal && overlayVal ? `${baseVal} ${overlayVal}` : overlayVal || baseVal : key === "ref" ? base.ref = baseVal && overlayVal ? composeRefs(baseVal, overlayVal) : overlayVal || baseVal : isEventHandler.test(key) && typeof baseVal == "function" && typeof overlayVal == "function" ? base[key] = composeEventHandlers(baseVal, overlayVal) : base[key] = overlayVal);
|
|
3077
|
+
}
|
|
3078
|
+
return base;
|
|
3079
|
+
}
|
|
3080
|
+
function mergeRenderElementProps(elementProps, viewProps, children) {
|
|
3081
|
+
var merged = mergeSlotStyleProps(__spreadValues({}, elementProps), viewProps);
|
|
3082
|
+
return merged.children = children, merged;
|
|
3083
|
+
}
|
|
3057
3084
|
function setElementProps(element) {
|
|
3058
3085
|
element && !element.getBoundingClientRect && (element.getBoundingClientRect = function() {
|
|
3059
3086
|
if (element.unstable_getBoundingClientRect != null) return element.unstable_getBoundingClientRect();
|
|
@@ -3236,7 +3263,7 @@ function useClientValue(value) {
|
|
|
3236
3263
|
useDidFinishSSR();
|
|
3237
3264
|
return typeof value == "function" ? value() : value;
|
|
3238
3265
|
}
|
|
3239
|
-
function _type_of$
|
|
3266
|
+
function _type_of$2(obj) {
|
|
3240
3267
|
"@swc/helpers - typeof";
|
|
3241
3268
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
3242
3269
|
}
|
|
@@ -3314,7 +3341,7 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
|
3314
3341
|
function hasAnimatedStyleValue(style) {
|
|
3315
3342
|
return Object.keys(style).some(function(k) {
|
|
3316
3343
|
var val = style[k];
|
|
3317
|
-
return val && (typeof val > "u" ? "undefined" : _type_of$
|
|
3344
|
+
return val && (typeof val > "u" ? "undefined" : _type_of$2(val)) === "object" && "_animation" in val;
|
|
3318
3345
|
});
|
|
3319
3346
|
}
|
|
3320
3347
|
var isDisabled = function(props) {
|
|
@@ -3325,7 +3352,7 @@ var hooks = {};
|
|
|
3325
3352
|
function setupHooks(next) {
|
|
3326
3353
|
Object.assign(hooks, next);
|
|
3327
3354
|
}
|
|
3328
|
-
var
|
|
3355
|
+
var Slot = /* @__PURE__ */ React.memo(/* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
3329
3356
|
var _a = props, {
|
|
3330
3357
|
children
|
|
3331
3358
|
} = _a, slotProps = __objRest(_a, [
|
|
@@ -3334,7 +3361,7 @@ var is19 = React.version.startsWith("19."), Slot = /* @__PURE__ */ React.memo(/*
|
|
|
3334
3361
|
if (/* @__PURE__ */ React.isValidElement(children)) {
|
|
3335
3362
|
var mergedProps = mergeSlotProps(children, slotProps);
|
|
3336
3363
|
return /* @__PURE__ */ React.cloneElement(children, children.type.avoidForwardRef ? mergedProps : __spreadProps(__spreadValues({}, mergedProps), {
|
|
3337
|
-
ref: composeRefs(forwardedRef,
|
|
3364
|
+
ref: composeRefs(forwardedRef, children.props.ref)
|
|
3338
3365
|
}));
|
|
3339
3366
|
}
|
|
3340
3367
|
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
@@ -3349,17 +3376,16 @@ var is19 = React.version.startsWith("19."), Slot = /* @__PURE__ */ React.memo(/*
|
|
|
3349
3376
|
Slottable.displayName = "Slottable";
|
|
3350
3377
|
var pressMap = {};
|
|
3351
3378
|
function mergeSlotProps(child, slotProps) {
|
|
3352
|
-
var childProps = child.props,
|
|
3379
|
+
var childProps = child.props, isHTMLChild = typeof child.type == "string";
|
|
3353
3380
|
if (isHTMLChild) for (var key in pressMap) key in slotProps && (slotProps[pressMap[key]] = slotProps[key], delete slotProps[key]);
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
return
|
|
3381
|
+
var merged = mergeSlotStyleProps(slotProps, childProps);
|
|
3382
|
+
if (isHTMLChild) for (var key1 in pressMap) key1 in merged && (merged[pressMap[key1]] = merged[key1], delete merged[key1]);
|
|
3383
|
+
return merged;
|
|
3384
|
+
}
|
|
3385
|
+
function _type_of$1(obj) {
|
|
3386
|
+
"@swc/helpers - typeof";
|
|
3387
|
+
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
3361
3388
|
}
|
|
3362
|
-
var handleRegex = /^on[A-Z]/;
|
|
3363
3389
|
var componentSetStates = /* @__PURE__ */ new Set(), avoidReRenderKeys = /* @__PURE__ */ new Set(["hover", "press", "pressIn", "group", "focus", "focusWithin", "media", "group"]);
|
|
3364
3390
|
var BaseText, BaseView, hasSetupBaseViews = false, lastInteractionWasKeyboard = {
|
|
3365
3391
|
value: false
|
|
@@ -3381,7 +3407,7 @@ function createComponent(staticConfig) {
|
|
|
3381
3407
|
isHOC
|
|
3382
3408
|
} = staticConfig;
|
|
3383
3409
|
var component = /* @__PURE__ */ React.forwardRef(function(propsIn, forwardedRef) {
|
|
3384
|
-
var _hooks_usePropsTransform, _hooks_useEvents
|
|
3410
|
+
var _hooks_usePropsTransform, _hooks_useEvents;
|
|
3385
3411
|
if (!hasSetupBaseViews) {
|
|
3386
3412
|
var _hooks_getBaseViews;
|
|
3387
3413
|
hasSetupBaseViews = true;
|
|
@@ -3402,7 +3428,17 @@ function createComponent(staticConfig) {
|
|
|
3402
3428
|
nextProps && (props = nextProps), overriddenContextProps = overrides;
|
|
3403
3429
|
}
|
|
3404
3430
|
var componentName2 = props.componentName || staticConfig.componentName;
|
|
3405
|
-
var groupContextParent = React.useContext(GroupContext), animationDriver =
|
|
3431
|
+
var groupContextParent = React.useContext(GroupContext), animationDriver = (function() {
|
|
3432
|
+
if (props.animatedBy && (config == null ? void 0 : config.animations)) {
|
|
3433
|
+
var animations2 = config.animations;
|
|
3434
|
+
if ("default" in animations2) {
|
|
3435
|
+
var _animations_props_animatedBy;
|
|
3436
|
+
return (_animations_props_animatedBy = animations2[props.animatedBy]) !== null && _animations_props_animatedBy !== void 0 ? _animations_props_animatedBy : animations2.default;
|
|
3437
|
+
}
|
|
3438
|
+
return props.animatedBy === "default" ? animations2 : null;
|
|
3439
|
+
}
|
|
3440
|
+
return componentContext.animationDriver;
|
|
3441
|
+
})(), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = useComponentState(props, (animationDriver == null ? void 0 : animationDriver.isStub) ? null : animationDriver, staticConfig), {
|
|
3406
3442
|
disabled,
|
|
3407
3443
|
groupName,
|
|
3408
3444
|
hasAnimationProp,
|
|
@@ -3459,7 +3495,7 @@ function createComponent(staticConfig) {
|
|
|
3459
3495
|
}
|
|
3460
3496
|
});
|
|
3461
3497
|
}, [stateRef, groupName, groupContextParent]), setStateShallow = componentState.setStateShallow;
|
|
3462
|
-
var isTaggable = !Component || typeof Component == "string",
|
|
3498
|
+
var isTaggable = !Component || typeof Component == "string", renderProp = props.render, element = Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || "div", elementType = isText ? BaseTextComponent : BaseViewComponent;
|
|
3463
3499
|
animationDriver && isAnimated && // this should really be behind another prop as it's not really related to
|
|
3464
3500
|
// "needsWebStyles" basically with motion we just animate a plain div, but
|
|
3465
3501
|
// we still have animated.View/Text for Sheet which wants to control
|
|
@@ -3477,7 +3513,7 @@ function createComponent(staticConfig) {
|
|
|
3477
3513
|
return !!stateRef.current.isListeningToTheme;
|
|
3478
3514
|
}, themeStateProps.deopt = willBeAnimated, false) ;
|
|
3479
3515
|
var [theme, themeState] = useThemeWithState(themeStateProps);
|
|
3480
|
-
elementType =
|
|
3516
|
+
elementType = element || elementType;
|
|
3481
3517
|
var mediaState = useMedia(componentContext);
|
|
3482
3518
|
setDidGetVariableValue(false);
|
|
3483
3519
|
var resolveValues = (
|
|
@@ -3619,7 +3655,7 @@ function createComponent(staticConfig) {
|
|
|
3619
3655
|
"onClick",
|
|
3620
3656
|
"theme"
|
|
3621
3657
|
]), viewProps = nonTamaguiProps;
|
|
3622
|
-
!isTaggable && props.forceStyle && (viewProps.forceStyle = props.forceStyle), isHOC && (typeof _themeProp < "u" && (viewProps.theme = _themeProp), typeof passThrough < "u" && (viewProps.passThrough = passThrough)),
|
|
3658
|
+
!isTaggable && props.forceStyle && (viewProps.forceStyle = props.forceStyle), isHOC && (typeof _themeProp < "u" && (viewProps.theme = _themeProp), typeof passThrough < "u" && (viewProps.passThrough = passThrough)), renderProp && elementType.acceptTagProp && (viewProps.render = renderProp);
|
|
3623
3659
|
var animationStyles, shouldUseAnimation = (
|
|
3624
3660
|
// if it supports css vars we run it on server too to get matching initial style
|
|
3625
3661
|
(supportsCSS ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
|
|
@@ -3638,6 +3674,7 @@ function createComponent(staticConfig) {
|
|
|
3638
3674
|
componentState: state,
|
|
3639
3675
|
styleProps,
|
|
3640
3676
|
theme,
|
|
3677
|
+
themeName,
|
|
3641
3678
|
pseudos: pseudos || null,
|
|
3642
3679
|
staticConfig,
|
|
3643
3680
|
stateRef
|
|
@@ -3769,8 +3806,17 @@ function createComponent(staticConfig) {
|
|
|
3769
3806
|
}
|
|
3770
3807
|
});
|
|
3771
3808
|
var useChildrenResult;
|
|
3772
|
-
hooks.useChildren && (useChildrenResult = hooks.useChildren(elementType, content, viewProps)), useChildrenResult
|
|
3773
|
-
|
|
3809
|
+
if (hooks.useChildren && (useChildrenResult = hooks.useChildren(elementType, content, viewProps)), useChildrenResult) content = useChildrenResult;
|
|
3810
|
+
else if (typeof renderProp == "function") {
|
|
3811
|
+
var renderProps = __spreadProps(__spreadValues({}, viewProps), {
|
|
3812
|
+
children: content
|
|
3813
|
+
});
|
|
3814
|
+
content = renderProp(renderProps, state);
|
|
3815
|
+
} else if (renderProp && (typeof renderProp > "u" ? "undefined" : _type_of$1(renderProp)) === "object" && /* @__PURE__ */ React.isValidElement(renderProp)) {
|
|
3816
|
+
var elementProps = renderProp.props || {}, mergedProps = mergeRenderElementProps(elementProps, viewProps, content);
|
|
3817
|
+
content = /* @__PURE__ */ React.cloneElement(renderProp, mergedProps);
|
|
3818
|
+
} else content = /* @__PURE__ */ React.createElement(elementType, viewProps, content);
|
|
3819
|
+
var ResetPresence = animationDriver == null ? void 0 : animationDriver.ResetPresence, needsReset = !!// not when passing down to child
|
|
3774
3820
|
(!asChild && // not when passThrough
|
|
3775
3821
|
splitStyles && // not when HOC
|
|
3776
3822
|
!isHOC && ResetPresence && willBeAnimated && (hasEnterStyle || presenceState)), hasEverReset = stateRef.current.hasEverResetPresence;
|
|
@@ -4492,9 +4538,12 @@ function TamaguiProvider$1(param) {
|
|
|
4492
4538
|
}, []);
|
|
4493
4539
|
var memoizedInsets = React.useMemo(function() {
|
|
4494
4540
|
return insets;
|
|
4495
|
-
}, [insets == null ? void 0 : insets.top, insets == null ? void 0 : insets.right, insets == null ? void 0 : insets.bottom, insets == null ? void 0 : insets.left]),
|
|
4541
|
+
}, [insets == null ? void 0 : insets.top, insets == null ? void 0 : insets.right, insets == null ? void 0 : insets.bottom, insets == null ? void 0 : insets.left]), defaultAnimationDriver2 = React.useMemo(function() {
|
|
4542
|
+
var animations = config == null ? void 0 : config.animations;
|
|
4543
|
+
return animations ? "default" in animations ? animations.default : animations : null;
|
|
4544
|
+
}, [config == null ? void 0 : config.animations]), contents = /* @__PURE__ */ jsxRuntime.jsx(UnmountedClassName, {
|
|
4496
4545
|
children: /* @__PURE__ */ jsxRuntime.jsx(ComponentContext.Provider, {
|
|
4497
|
-
animationDriver:
|
|
4546
|
+
animationDriver: defaultAnimationDriver2,
|
|
4498
4547
|
insets: memoizedInsets,
|
|
4499
4548
|
children: /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, {
|
|
4500
4549
|
defaultTheme,
|
|
@@ -4951,6 +5000,7 @@ exports.isVariable = isVariable;
|
|
|
4951
5000
|
exports.isWeb = isWeb;
|
|
4952
5001
|
exports.isWebTouchable = isWebTouchable;
|
|
4953
5002
|
exports.isWindowDefined = isWindowDefined;
|
|
5003
|
+
exports.loadAnimationDriver = loadAnimationDriver;
|
|
4954
5004
|
exports.matchMedia = matchMedia$1;
|
|
4955
5005
|
exports.mediaKeyMatch = mediaKeyMatch;
|
|
4956
5006
|
exports.mediaObjectToString = mediaObjectToString;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-1768699687560",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"source": "src/index.tsx",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -33,18 +33,18 @@
|
|
|
33
33
|
"native-test.d.ts"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tamagui/helpers": "2.0.0-
|
|
37
|
-
"@tamagui/react-native-media-driver": "2.0.0-
|
|
38
|
-
"@tamagui/react-native-use-pressable": "2.0.0-
|
|
39
|
-
"@tamagui/react-native-use-responder-events": "2.0.0-
|
|
40
|
-
"@tamagui/use-element-layout": "2.0.0-
|
|
41
|
-
"@tamagui/use-event": "2.0.0-
|
|
42
|
-
"@tamagui/web": "2.0.0-
|
|
36
|
+
"@tamagui/helpers": "2.0.0-1768699687560",
|
|
37
|
+
"@tamagui/react-native-media-driver": "2.0.0-1768699687560",
|
|
38
|
+
"@tamagui/react-native-use-pressable": "2.0.0-1768699687560",
|
|
39
|
+
"@tamagui/react-native-use-responder-events": "2.0.0-1768699687560",
|
|
40
|
+
"@tamagui/use-element-layout": "2.0.0-1768699687560",
|
|
41
|
+
"@tamagui/use-event": "2.0.0-1768699687560",
|
|
42
|
+
"@tamagui/web": "2.0.0-1768699687560"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@tamagui/build": "2.0.0-
|
|
46
|
-
"@tamagui/native-bundle": "2.0.0-
|
|
47
|
-
"@tamagui/react-native-web-lite": "2.0.0-
|
|
45
|
+
"@tamagui/build": "2.0.0-1768699687560",
|
|
46
|
+
"@tamagui/native-bundle": "2.0.0-1768699687560",
|
|
47
|
+
"@tamagui/react-native-web-lite": "2.0.0-1768699687560",
|
|
48
48
|
"@testing-library/react": "^16.1.0",
|
|
49
49
|
"csstype": "^3.0.10",
|
|
50
50
|
"react": "*",
|