@tamagui/core 1.112.1 → 1.112.2
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 +282 -153
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +277 -146
- package/dist/test.native.js.map +3 -3
- package/package.json +7 -7
package/dist/test.native.js
CHANGED
|
@@ -6356,6 +6356,55 @@ var require_isActivePlatform_native = __commonJS({
|
|
|
6356
6356
|
}
|
|
6357
6357
|
});
|
|
6358
6358
|
|
|
6359
|
+
// ../web/dist/cjs/helpers/sortString.native.js
|
|
6360
|
+
var require_sortString_native = __commonJS({
|
|
6361
|
+
"../web/dist/cjs/helpers/sortString.native.js"(exports2, module2) {
|
|
6362
|
+
"use strict";
|
|
6363
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
6364
|
+
for (var name in all) __defProp2(target, name, {
|
|
6365
|
+
get: all[name],
|
|
6366
|
+
enumerable: !0
|
|
6367
|
+
});
|
|
6368
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
6369
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
6370
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
6371
|
+
for (var _loop = function() {
|
|
6372
|
+
var key = _step.value;
|
|
6373
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
6374
|
+
get: function() {
|
|
6375
|
+
return from[key];
|
|
6376
|
+
},
|
|
6377
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
6378
|
+
});
|
|
6379
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
6380
|
+
} catch (err) {
|
|
6381
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
6382
|
+
} finally {
|
|
6383
|
+
try {
|
|
6384
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
6385
|
+
} finally {
|
|
6386
|
+
if (_didIteratorError)
|
|
6387
|
+
throw _iteratorError;
|
|
6388
|
+
}
|
|
6389
|
+
}
|
|
6390
|
+
return to;
|
|
6391
|
+
}, __toCommonJS2 = function(mod) {
|
|
6392
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
6393
|
+
value: !0
|
|
6394
|
+
}), mod);
|
|
6395
|
+
}, sortString_exports = {};
|
|
6396
|
+
__export2(sortString_exports, {
|
|
6397
|
+
sortString: function() {
|
|
6398
|
+
return sortString;
|
|
6399
|
+
}
|
|
6400
|
+
});
|
|
6401
|
+
module2.exports = __toCommonJS2(sortString_exports);
|
|
6402
|
+
var sortString = function(a, b) {
|
|
6403
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
6404
|
+
};
|
|
6405
|
+
}
|
|
6406
|
+
});
|
|
6407
|
+
|
|
6359
6408
|
// ../web/dist/cjs/helpers/getSplitStyles.native.js
|
|
6360
6409
|
var require_getSplitStyles_native = __commonJS({
|
|
6361
6410
|
"../web/dist/cjs/helpers/getSplitStyles.native.js"(exports2, module2) {
|
|
@@ -6420,7 +6469,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6420
6469
|
}
|
|
6421
6470
|
});
|
|
6422
6471
|
module2.exports = __toCommonJS2(getSplitStyles_exports);
|
|
6423
|
-
var import_react3 = __toESM2(require("react")), import_constants = require_index_native3(), import_helpers = require_index_native4(), 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_skipProps = require_skipProps_native(), import_transformsToString = require_transformsToString_native(), import_isActivePlatform = require_isActivePlatform_native(), consoleGroupCollapsed = import_constants.isWeb ? console.groupCollapsed : console.info, conf, PROP_SPLIT = "-";
|
|
6472
|
+
var import_react3 = __toESM2(require("react")), import_constants = require_index_native3(), import_helpers = require_index_native4(), 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_skipProps = require_skipProps_native(), import_transformsToString = require_transformsToString_native(), import_isActivePlatform = require_isActivePlatform_native(), import_sortString = require_sortString_native(), consoleGroupCollapsed = import_constants.isWeb ? console.groupCollapsed : console.info, conf, PROP_SPLIT = "-";
|
|
6424
6473
|
function isValidStyleKey(key, staticConfig) {
|
|
6425
6474
|
var _staticConfig_accept, validStyleProps = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles);
|
|
6426
6475
|
return validStyleProps[key] || ((_staticConfig_accept = staticConfig.accept) === null || _staticConfig_accept === void 0 ? void 0 : _staticConfig_accept[key]);
|
|
@@ -6661,7 +6710,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6661
6710
|
var _styleState1;
|
|
6662
6711
|
(_styleState1 = styleState).style || (_styleState1.style = {}), Object.entries(styleState.flatTransforms).sort(function(param, param1) {
|
|
6663
6712
|
var [a] = param, [b] = param1;
|
|
6664
|
-
return
|
|
6713
|
+
return (0, import_sortString.sortString)(a, b);
|
|
6665
6714
|
}).forEach(function(param) {
|
|
6666
6715
|
var [key5, val3] = param;
|
|
6667
6716
|
mergeTransform(styleState.style, key5, val3, !0);
|
|
@@ -6991,6 +7040,78 @@ var require_setElementProps_native = __commonJS({
|
|
|
6991
7040
|
}
|
|
6992
7041
|
});
|
|
6993
7042
|
|
|
7043
|
+
// ../web/dist/cjs/helpers/subscribeToContextGroup.native.js
|
|
7044
|
+
var require_subscribeToContextGroup_native = __commonJS({
|
|
7045
|
+
"../web/dist/cjs/helpers/subscribeToContextGroup.native.js"(exports2, module2) {
|
|
7046
|
+
"use strict";
|
|
7047
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
7048
|
+
for (var name in all) __defProp2(target, name, {
|
|
7049
|
+
get: all[name],
|
|
7050
|
+
enumerable: !0
|
|
7051
|
+
});
|
|
7052
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
7053
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
7054
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
7055
|
+
for (var _loop = function() {
|
|
7056
|
+
var key = _step.value;
|
|
7057
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
7058
|
+
get: function() {
|
|
7059
|
+
return from[key];
|
|
7060
|
+
},
|
|
7061
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
7062
|
+
});
|
|
7063
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
7064
|
+
} catch (err) {
|
|
7065
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
7066
|
+
} finally {
|
|
7067
|
+
try {
|
|
7068
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
7069
|
+
} finally {
|
|
7070
|
+
if (_didIteratorError)
|
|
7071
|
+
throw _iteratorError;
|
|
7072
|
+
}
|
|
7073
|
+
}
|
|
7074
|
+
return to;
|
|
7075
|
+
}, __toCommonJS2 = function(mod) {
|
|
7076
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
7077
|
+
value: !0
|
|
7078
|
+
}), mod);
|
|
7079
|
+
}, subscribeToContextGroup_exports = {};
|
|
7080
|
+
__export2(subscribeToContextGroup_exports, {
|
|
7081
|
+
subscribeToContextGroup: function() {
|
|
7082
|
+
return subscribeToContextGroup;
|
|
7083
|
+
}
|
|
7084
|
+
});
|
|
7085
|
+
module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
|
|
7086
|
+
var import_createShallowSetState = require_createShallowSetState_native(), import_useMedia = require_useMedia_native(), subscribeToContextGroup = function(param) {
|
|
7087
|
+
var { disabled = !1, setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
|
|
7088
|
+
if (pseudoGroups || mediaGroups) {
|
|
7089
|
+
var _componentContext_groups_subscribe, _componentContext_groups, current = {
|
|
7090
|
+
pseudo: {},
|
|
7091
|
+
media: {}
|
|
7092
|
+
};
|
|
7093
|
+
return (_componentContext_groups = componentContext.groups) === null || _componentContext_groups === void 0 || (_componentContext_groups_subscribe = _componentContext_groups.subscribe) === null || _componentContext_groups_subscribe === void 0 ? void 0 : _componentContext_groups_subscribe.call(_componentContext_groups, function(name, param2) {
|
|
7094
|
+
var { layout, pseudo } = param2;
|
|
7095
|
+
if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
|
|
7096
|
+
else if (layout && mediaGroups) {
|
|
7097
|
+
var mediaState2 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState2);
|
|
7098
|
+
next !== current.media && (Object.assign(current.media, next), persist());
|
|
7099
|
+
}
|
|
7100
|
+
function persist() {
|
|
7101
|
+
var group = {
|
|
7102
|
+
...state.group,
|
|
7103
|
+
[name]: current
|
|
7104
|
+
};
|
|
7105
|
+
setStateShallow({
|
|
7106
|
+
group
|
|
7107
|
+
});
|
|
7108
|
+
}
|
|
7109
|
+
});
|
|
7110
|
+
}
|
|
7111
|
+
};
|
|
7112
|
+
}
|
|
7113
|
+
});
|
|
7114
|
+
|
|
6994
7115
|
// ../web/dist/cjs/views/ThemeDebug.native.js
|
|
6995
7116
|
var require_ThemeDebug_native = __commonJS({
|
|
6996
7117
|
"../web/dist/cjs/views/ThemeDebug.native.js"(exports2, module2) {
|
|
@@ -7329,6 +7450,149 @@ var require_useDidHydrateOnce_native = __commonJS({
|
|
|
7329
7450
|
}
|
|
7330
7451
|
});
|
|
7331
7452
|
|
|
7453
|
+
// ../web/dist/cjs/hooks/useComponentState.native.js
|
|
7454
|
+
var require_useComponentState_native = __commonJS({
|
|
7455
|
+
"../web/dist/cjs/hooks/useComponentState.native.js"(exports2, module2) {
|
|
7456
|
+
"use strict";
|
|
7457
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
7458
|
+
for (var name in all) __defProp2(target, name, {
|
|
7459
|
+
get: all[name],
|
|
7460
|
+
enumerable: !0
|
|
7461
|
+
});
|
|
7462
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
7463
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
7464
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
7465
|
+
for (var _loop = function() {
|
|
7466
|
+
var key = _step.value;
|
|
7467
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
7468
|
+
get: function() {
|
|
7469
|
+
return from[key];
|
|
7470
|
+
},
|
|
7471
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
7472
|
+
});
|
|
7473
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
7474
|
+
} catch (err) {
|
|
7475
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
7476
|
+
} finally {
|
|
7477
|
+
try {
|
|
7478
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
7479
|
+
} finally {
|
|
7480
|
+
if (_didIteratorError)
|
|
7481
|
+
throw _iteratorError;
|
|
7482
|
+
}
|
|
7483
|
+
}
|
|
7484
|
+
return to;
|
|
7485
|
+
}, __toCommonJS2 = function(mod) {
|
|
7486
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
7487
|
+
value: !0
|
|
7488
|
+
}), mod);
|
|
7489
|
+
}, useComponentState_exports = {};
|
|
7490
|
+
__export2(useComponentState_exports, {
|
|
7491
|
+
useComponentState: function() {
|
|
7492
|
+
return useComponentState;
|
|
7493
|
+
}
|
|
7494
|
+
});
|
|
7495
|
+
module2.exports = __toCommonJS2(useComponentState_exports);
|
|
7496
|
+
var import_defaultComponentState = require_defaultComponentState_native(), import_useDidHydrateOnce = require_useDidHydrateOnce_native(), import_react3 = require("react"), import_constants = require_index_native3(), import_createShallowSetState = require_createShallowSetState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), useComponentState = function(props, param, staticConfig, config) {
|
|
7497
|
+
var { animationDriver, groups } = param, _animationDriver_usePresence, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
|
|
7498
|
+
stateRef.current || (stateRef.current = {});
|
|
7499
|
+
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
|
|
7500
|
+
var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
|
|
7501
|
+
return !!(next || curStateRef.hasAnimated);
|
|
7502
|
+
}(), willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
|
|
7503
|
+
willBeAnimated && !curStateRef.hasAnimated && (curStateRef.hasAnimated = !0);
|
|
7504
|
+
var presence = willBeAnimated && props.animatePresence !== !1 && (animationDriver == null || (_animationDriver_usePresence = animationDriver.usePresence) === null || _animationDriver_usePresence === void 0 ? void 0 : _animationDriver_usePresence.call(animationDriver)) || null, presenceState = presence == null ? void 0 : presence[2], isExiting = (presenceState == null ? void 0 : presenceState.isPresent) === !1, isEntering = (presenceState == null ? void 0 : presenceState.isPresent) === !0 && presenceState.initial !== !1, hasEnterStyle = !!props.enterStyle, hasRNAnimation = hasAnimationProp && (animationDriver == null ? void 0 : animationDriver.isReactNative), hasEnterState = hasEnterStyle || isEntering, didHydrateOnce = willBeAnimated ? (0, import_useDidHydrateOnce.useDidHydrateOnce)() : !0, shouldEnter = hasEnterState || !didHydrateOnce && hasRNAnimation, shouldEnterFromUnhydrated = import_constants.isWeb && !didHydrateOnce, initialState = shouldEnter ? (
|
|
7505
|
+
// on the very first render we switch all spring animation drivers to css rendering
|
|
7506
|
+
// this is because we need to use css variables, which they don't support to do proper SSR
|
|
7507
|
+
// without flickers of the wrong colors.
|
|
7508
|
+
// but once we do that initial hydration and we are in client side rendering mode,
|
|
7509
|
+
// we can avoid the extra re-render on mount
|
|
7510
|
+
shouldEnterFromUnhydrated ? import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateShouldEnter
|
|
7511
|
+
) : import_defaultComponentState.defaultComponentStateMounted, disabled = isDisabled(props);
|
|
7512
|
+
disabled != null && (initialState.disabled = disabled);
|
|
7513
|
+
var states = (0, import_react3.useState)(initialState), state = props.forceStyle ? {
|
|
7514
|
+
...states[0],
|
|
7515
|
+
[props.forceStyle]: !0
|
|
7516
|
+
} : states[0], setState = states[1], isHydrated = state.unmounted === !1 || state.unmounted === "should-enter", isAnimated = willBeAnimated;
|
|
7517
|
+
import_constants.isWeb && hasRNAnimation && !staticConfig.isHOC && state.unmounted === !0 && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
|
|
7518
|
+
...state
|
|
7519
|
+
}));
|
|
7520
|
+
var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug);
|
|
7521
|
+
if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
7522
|
+
var { enterVariant, exitVariant, enterExitVariant, custom } = presenceState;
|
|
7523
|
+
(0, import_isObj.isObj)(custom) && Object.assign(props, custom);
|
|
7524
|
+
var exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
|
|
7525
|
+
state.unmounted && env && staticConfig.variants[env] ? props[env] = !0 : isExiting && exv && (props[exv] = exitVariant !== enterExitVariant);
|
|
7526
|
+
}
|
|
7527
|
+
var shouldAvoidClasses = !import_constants.isWeb;
|
|
7528
|
+
if (import_constants.isWeb) {
|
|
7529
|
+
var { disableClassName } = props, isAnimatedAndHydrated = isAnimated && !supportsCSSVars && didHydrateOnce && !import_constants.isServer, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || didHydrateOnce), isDisabledManually = disableClassName && !import_constants.isServer && didHydrateOnce && state.unmounted === !0;
|
|
7530
|
+
(isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (shouldAvoidClasses = !0);
|
|
7531
|
+
}
|
|
7532
|
+
var groupName = props.group;
|
|
7533
|
+
if (groupName && !curStateRef.group) {
|
|
7534
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
7535
|
+
curStateRef.group = {
|
|
7536
|
+
listeners,
|
|
7537
|
+
emit(name, state2) {
|
|
7538
|
+
listeners.forEach(function(l) {
|
|
7539
|
+
return l(name, state2);
|
|
7540
|
+
});
|
|
7541
|
+
},
|
|
7542
|
+
subscribe(cb) {
|
|
7543
|
+
return listeners.add(cb), function() {
|
|
7544
|
+
listeners.delete(cb);
|
|
7545
|
+
};
|
|
7546
|
+
}
|
|
7547
|
+
};
|
|
7548
|
+
}
|
|
7549
|
+
if (groupName) {
|
|
7550
|
+
var groupContextState = groups.state, og = setStateShallow;
|
|
7551
|
+
setStateShallow = function(state2) {
|
|
7552
|
+
og(state2), curStateRef.group.emit(groupName, {
|
|
7553
|
+
pseudo: state2
|
|
7554
|
+
});
|
|
7555
|
+
var next = {
|
|
7556
|
+
...groupContextState[groupName],
|
|
7557
|
+
...state2
|
|
7558
|
+
};
|
|
7559
|
+
groupContextState[groupName] = next;
|
|
7560
|
+
};
|
|
7561
|
+
}
|
|
7562
|
+
return {
|
|
7563
|
+
curStateRef,
|
|
7564
|
+
disabled,
|
|
7565
|
+
groupName,
|
|
7566
|
+
hasAnimationProp,
|
|
7567
|
+
hasEnterStyle,
|
|
7568
|
+
isAnimated,
|
|
7569
|
+
isExiting,
|
|
7570
|
+
isHydrated,
|
|
7571
|
+
presence,
|
|
7572
|
+
presenceState,
|
|
7573
|
+
setState,
|
|
7574
|
+
setStateShallow,
|
|
7575
|
+
shouldAvoidClasses,
|
|
7576
|
+
state,
|
|
7577
|
+
stateRef,
|
|
7578
|
+
supportsCSSVars,
|
|
7579
|
+
willBeAnimated,
|
|
7580
|
+
willBeAnimatedClient
|
|
7581
|
+
};
|
|
7582
|
+
};
|
|
7583
|
+
function hasAnimatedStyleValue(style) {
|
|
7584
|
+
return Object.keys(style).some(function(k) {
|
|
7585
|
+
var val = style[k];
|
|
7586
|
+
return val && typeof val == "object" && "_animation" in val;
|
|
7587
|
+
});
|
|
7588
|
+
}
|
|
7589
|
+
var isDisabled = function(props) {
|
|
7590
|
+
var _props_accessibilityState;
|
|
7591
|
+
return props.disabled || ((_props_accessibilityState = props.accessibilityState) === null || _props_accessibilityState === void 0 ? void 0 : _props_accessibilityState.disabled) || props["aria-disabled"] || props.accessibilityDisabled || !1;
|
|
7592
|
+
};
|
|
7593
|
+
}
|
|
7594
|
+
});
|
|
7595
|
+
|
|
7332
7596
|
// ../web/dist/cjs/setupHooks.native.js
|
|
7333
7597
|
var require_setupHooks_native = __commonJS({
|
|
7334
7598
|
"../web/dist/cjs/setupHooks.native.js"(exports2, module2) {
|
|
@@ -7538,21 +7802,12 @@ var require_createComponent_native = __commonJS({
|
|
|
7538
7802
|
createComponent: function() {
|
|
7539
7803
|
return createComponent;
|
|
7540
7804
|
},
|
|
7541
|
-
isDisabled: function() {
|
|
7542
|
-
return isDisabled;
|
|
7543
|
-
},
|
|
7544
7805
|
spacedChildren: function() {
|
|
7545
7806
|
return spacedChildren;
|
|
7546
|
-
},
|
|
7547
|
-
subscribeToContextGroup: function() {
|
|
7548
|
-
return subscribeToContextGroup;
|
|
7549
|
-
},
|
|
7550
|
-
useComponentState: function() {
|
|
7551
|
-
return useComponentState;
|
|
7552
7807
|
}
|
|
7553
7808
|
});
|
|
7554
7809
|
module2.exports = __toCommonJS2(createComponent_exports);
|
|
7555
|
-
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
7810
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_compose_refs = require_index_native5(), import_constants = require_index_native3(), import_helpers = require_index_native4(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_useComponentState = require_useComponentState_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(), componentSetStates = /* @__PURE__ */ new Set();
|
|
7556
7811
|
typeof document < "u" && (cancelTouches = function() {
|
|
7557
7812
|
componentSetStates.forEach(function(setState) {
|
|
7558
7813
|
return setState(function(prev) {
|
|
@@ -7564,93 +7819,7 @@ var require_createComponent_native = __commonJS({
|
|
|
7564
7819
|
});
|
|
7565
7820
|
}), componentSetStates.clear();
|
|
7566
7821
|
}, addEventListener("mouseup", cancelTouches), addEventListener("touchend", cancelTouches), addEventListener("touchcancel", cancelTouches));
|
|
7567
|
-
var cancelTouches,
|
|
7568
|
-
var { animationDriver, groups } = param, _animationDriver_usePresence, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = import_react3.default.useRef(void 0);
|
|
7569
|
-
stateRef.current || (stateRef.current = {});
|
|
7570
|
-
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
|
|
7571
|
-
var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
|
|
7572
|
-
return !!(next || curStateRef.hasAnimated);
|
|
7573
|
-
}(), willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
|
|
7574
|
-
willBeAnimated && !curStateRef.hasAnimated && (curStateRef.hasAnimated = !0);
|
|
7575
|
-
var presence = willBeAnimated && props.animatePresence !== !1 && (animationDriver == null || (_animationDriver_usePresence = animationDriver.usePresence) === null || _animationDriver_usePresence === void 0 ? void 0 : _animationDriver_usePresence.call(animationDriver)) || null, presenceState = presence == null ? void 0 : presence[2], isExiting = (presenceState == null ? void 0 : presenceState.isPresent) === !1, isEntering = (presenceState == null ? void 0 : presenceState.isPresent) === !0 && presenceState.initial !== !1, hasEnterStyle = !!props.enterStyle, hasRNAnimation = hasAnimationProp && (animationDriver == null ? void 0 : animationDriver.isReactNative), hasEnterState = hasEnterStyle || isEntering, didHydrateOnce = willBeAnimated ? (0, import_useDidHydrateOnce.useDidHydrateOnce)() : !0, shouldEnter = hasEnterState || !didHydrateOnce && hasRNAnimation, shouldEnterFromUnhydrated = import_constants.isWeb && !didHydrateOnce, initialState = shouldEnter ? (
|
|
7576
|
-
// on the very first render we switch all spring animation drivers to css rendering
|
|
7577
|
-
// this is because we need to use css variables, which they don't support to do proper SSR
|
|
7578
|
-
// without flickers of the wrong colors.
|
|
7579
|
-
// but once we do that initial hydration and we are in client side rendering mode,
|
|
7580
|
-
// we can avoid the extra re-render on mount
|
|
7581
|
-
shouldEnterFromUnhydrated ? import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateShouldEnter
|
|
7582
|
-
) : import_defaultComponentState.defaultComponentStateMounted, disabled = isDisabled(props);
|
|
7583
|
-
disabled != null && (initialState.disabled = disabled);
|
|
7584
|
-
var states = import_react3.default.useState(initialState), state = props.forceStyle ? {
|
|
7585
|
-
...states[0],
|
|
7586
|
-
[props.forceStyle]: !0
|
|
7587
|
-
} : states[0], setState = states[1], isHydrated = state.unmounted === !1 || state.unmounted === "should-enter", isAnimated = willBeAnimated;
|
|
7588
|
-
import_constants.isWeb && hasRNAnimation && !staticConfig.isHOC && state.unmounted === !0 && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
|
|
7589
|
-
...state
|
|
7590
|
-
}));
|
|
7591
|
-
var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug);
|
|
7592
|
-
if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
7593
|
-
var { enterVariant, exitVariant, enterExitVariant, custom } = presenceState;
|
|
7594
|
-
(0, import_isObj.isObj)(custom) && Object.assign(props, custom);
|
|
7595
|
-
var exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
|
|
7596
|
-
state.unmounted && env && staticConfig.variants[env] ? props[env] = !0 : isExiting && exv && (props[exv] = exitVariant !== enterExitVariant);
|
|
7597
|
-
}
|
|
7598
|
-
var shouldAvoidClasses = !import_constants.isWeb;
|
|
7599
|
-
if (import_constants.isWeb) {
|
|
7600
|
-
var { disableClassName } = props, isAnimatedAndHydrated = isAnimated && !supportsCSSVars && didHydrateOnce && !import_constants.isServer, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || didHydrateOnce), isDisabledManually = disableClassName && !import_constants.isServer && didHydrateOnce && state.unmounted === !0;
|
|
7601
|
-
(isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (shouldAvoidClasses = !0);
|
|
7602
|
-
}
|
|
7603
|
-
var groupName = props.group;
|
|
7604
|
-
if (groupName && !curStateRef.group) {
|
|
7605
|
-
var listeners = /* @__PURE__ */ new Set();
|
|
7606
|
-
curStateRef.group = {
|
|
7607
|
-
listeners,
|
|
7608
|
-
emit(name, state2) {
|
|
7609
|
-
listeners.forEach(function(l) {
|
|
7610
|
-
return l(name, state2);
|
|
7611
|
-
});
|
|
7612
|
-
},
|
|
7613
|
-
subscribe(cb) {
|
|
7614
|
-
return listeners.add(cb), function() {
|
|
7615
|
-
listeners.delete(cb);
|
|
7616
|
-
};
|
|
7617
|
-
}
|
|
7618
|
-
};
|
|
7619
|
-
}
|
|
7620
|
-
if (groupName) {
|
|
7621
|
-
var groupContextState = groups.state, og = setStateShallow;
|
|
7622
|
-
setStateShallow = function(state2) {
|
|
7623
|
-
og(state2), curStateRef.group.emit(groupName, {
|
|
7624
|
-
pseudo: state2
|
|
7625
|
-
});
|
|
7626
|
-
var next = {
|
|
7627
|
-
...groupContextState[groupName],
|
|
7628
|
-
...state2
|
|
7629
|
-
};
|
|
7630
|
-
groupContextState[groupName] = next;
|
|
7631
|
-
};
|
|
7632
|
-
}
|
|
7633
|
-
return {
|
|
7634
|
-
curStateRef,
|
|
7635
|
-
disabled,
|
|
7636
|
-
groupName,
|
|
7637
|
-
hasAnimationProp,
|
|
7638
|
-
hasEnterStyle,
|
|
7639
|
-
isAnimated,
|
|
7640
|
-
isExiting,
|
|
7641
|
-
isHydrated,
|
|
7642
|
-
presence,
|
|
7643
|
-
presenceState,
|
|
7644
|
-
setState,
|
|
7645
|
-
setStateShallow,
|
|
7646
|
-
shouldAvoidClasses,
|
|
7647
|
-
state,
|
|
7648
|
-
stateRef,
|
|
7649
|
-
supportsCSSVars,
|
|
7650
|
-
willBeAnimated,
|
|
7651
|
-
willBeAnimatedClient
|
|
7652
|
-
};
|
|
7653
|
-
}, BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
|
|
7822
|
+
var cancelTouches, BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
|
|
7654
7823
|
value: !1
|
|
7655
7824
|
};
|
|
7656
7825
|
import_constants.isWeb && globalThis.document && (document.addEventListener("keydown", function() {
|
|
@@ -7671,7 +7840,7 @@ var require_createComponent_native = __commonJS({
|
|
|
7671
7840
|
});
|
|
7672
7841
|
}
|
|
7673
7842
|
});
|
|
7674
|
-
var { Component, isText, isZStack, isHOC
|
|
7843
|
+
var { Component, isText, isZStack, isHOC } = staticConfig, component = /* @__PURE__ */ import_react3.default.forwardRef(function(propsIn, forwardedRef) {
|
|
7675
7844
|
var _themeState_state, _hooks_usePropsTransform, _hooks_useEvents, _config_animations, internalID = "";
|
|
7676
7845
|
if (!hasSetupBaseViews) {
|
|
7677
7846
|
var _hooks_getBaseViews;
|
|
@@ -7703,7 +7872,7 @@ var require_createComponent_native = __commonJS({
|
|
|
7703
7872
|
var debugProp = props.debug, componentName2 = props.componentName || staticConfig.componentName;
|
|
7704
7873
|
if (0)
|
|
7705
7874
|
var timer;
|
|
7706
|
-
var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, setStateShallow, shouldAvoidClasses, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient } = useComponentState(props, componentContext, staticConfig, config), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText), isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
|
|
7875
|
+
var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, setStateShallow, shouldAvoidClasses, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText), isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
|
|
7707
7876
|
animationDriver && isAnimated && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
|
|
7708
7877
|
var disableThemeProp = !1, disableTheme = disableThemeProp || isHOC;
|
|
7709
7878
|
props.themeShallow && (curStateRef.themeShallow = !0);
|
|
@@ -7826,7 +7995,7 @@ var require_createComponent_native = __commonJS({
|
|
|
7826
7995
|
});
|
|
7827
7996
|
return;
|
|
7828
7997
|
}
|
|
7829
|
-
var dispose = subscribeToContextGroup({
|
|
7998
|
+
var dispose = (0, import_subscribeToContextGroup.subscribeToContextGroup)({
|
|
7830
7999
|
disabled,
|
|
7831
8000
|
componentContext,
|
|
7832
8001
|
setStateShallow,
|
|
@@ -8131,43 +8300,8 @@ var require_createComponent_native = __commonJS({
|
|
|
8131
8300
|
left: 0,
|
|
8132
8301
|
pointerEvents: "box-none"
|
|
8133
8302
|
}
|
|
8134
|
-
})
|
|
8135
|
-
function hasAnimatedStyleValue(style) {
|
|
8136
|
-
return Object.keys(style).some(function(k) {
|
|
8137
|
-
var val = style[k];
|
|
8138
|
-
return val && typeof val == "object" && "_animation" in val;
|
|
8139
|
-
});
|
|
8140
|
-
}
|
|
8141
|
-
var fromPx = function(val) {
|
|
8303
|
+
}), fromPx = function(val) {
|
|
8142
8304
|
return typeof val != "string" ? val : +val.replace("px", "");
|
|
8143
|
-
}, isDisabled = function(props) {
|
|
8144
|
-
var _props_accessibilityState;
|
|
8145
|
-
return props.disabled || ((_props_accessibilityState = props.accessibilityState) === null || _props_accessibilityState === void 0 ? void 0 : _props_accessibilityState.disabled) || props["aria-disabled"] || props.accessibilityDisabled || !1;
|
|
8146
|
-
}, subscribeToContextGroup = function(param) {
|
|
8147
|
-
var { disabled = !1, setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
|
|
8148
|
-
if (pseudoGroups || mediaGroups) {
|
|
8149
|
-
var _componentContext_groups_subscribe, _componentContext_groups, current = {
|
|
8150
|
-
pseudo: {},
|
|
8151
|
-
media: {}
|
|
8152
|
-
};
|
|
8153
|
-
return (_componentContext_groups = componentContext.groups) === null || _componentContext_groups === void 0 || (_componentContext_groups_subscribe = _componentContext_groups.subscribe) === null || _componentContext_groups_subscribe === void 0 ? void 0 : _componentContext_groups_subscribe.call(_componentContext_groups, function(name, param2) {
|
|
8154
|
-
var { layout, pseudo } = param2;
|
|
8155
|
-
if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
|
|
8156
|
-
else if (layout && mediaGroups) {
|
|
8157
|
-
var mediaState2 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState2);
|
|
8158
|
-
next !== current.media && (Object.assign(current.media, next), persist());
|
|
8159
|
-
}
|
|
8160
|
-
function persist() {
|
|
8161
|
-
var group = {
|
|
8162
|
-
...state.group,
|
|
8163
|
-
[name]: current
|
|
8164
|
-
};
|
|
8165
|
-
setStateShallow({
|
|
8166
|
-
group
|
|
8167
|
-
});
|
|
8168
|
-
}
|
|
8169
|
-
});
|
|
8170
|
-
}
|
|
8171
8305
|
};
|
|
8172
8306
|
}
|
|
8173
8307
|
});
|
|
@@ -8870,9 +9004,8 @@ var require_createTamagui_native = __commonJS({
|
|
|
8870
9004
|
var foundThemes;
|
|
8871
9005
|
if (configIn.themes) {
|
|
8872
9006
|
var noThemes = Object.keys(configIn.themes).length === 0;
|
|
8873
|
-
foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed);
|
|
9007
|
+
noThemes && (foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed)), process.env.TAMAGUI_REACT_19 && process.env.TAMAGUI_SKIP_THEME_OPTIMIZATION || noThemes && (0, import_insertStyleRule.listenForSheetChanges)();
|
|
8874
9008
|
}
|
|
8875
|
-
(0, import_insertStyleRule.listenForSheetChanges)();
|
|
8876
9009
|
var fontSizeTokens = null, fontsParsed;
|
|
8877
9010
|
if (configIn.fonts) {
|
|
8878
9011
|
var fontTokens = Object.fromEntries(Object.entries(configIn.fonts).map(function(param) {
|
|
@@ -8920,9 +9053,7 @@ var require_createTamagui_native = __commonJS({
|
|
|
8920
9053
|
cssRuleSets.push(specificRuleSet);
|
|
8921
9054
|
}
|
|
8922
9055
|
}
|
|
8923
|
-
var themesIn =
|
|
8924
|
-
...configIn.themes
|
|
8925
|
-
}, dedupedThemes = foundThemes ?? getThemesDeduped(themesIn), themes = (0, import_proxyThemeToParents.proxyThemesToParents)(dedupedThemes);
|
|
9056
|
+
var themesIn = configIn.themes, dedupedThemes = foundThemes ?? getThemesDeduped(themesIn), themes = (0, import_proxyThemeToParents.proxyThemesToParents)(dedupedThemes);
|
|
8926
9057
|
return {
|
|
8927
9058
|
themes,
|
|
8928
9059
|
cssRuleSets,
|
|
@@ -10049,7 +10180,7 @@ var require_useProps_native = __commonJS({
|
|
|
10049
10180
|
}
|
|
10050
10181
|
});
|
|
10051
10182
|
module2.exports = __toCommonJS2(useProps_exports);
|
|
10052
|
-
var import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(),
|
|
10183
|
+
var import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_getSplitStyles = require_getSplitStyles_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_Stack = require_Stack_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native();
|
|
10053
10184
|
function useProps(props, opts) {
|
|
10054
10185
|
var [propsOut, styleOut] = usePropsAndStyle(props, {
|
|
10055
10186
|
...opts,
|
|
@@ -10070,7 +10201,7 @@ var require_useProps_native = __commonJS({
|
|
|
10070
10201
|
componentName: staticConfig.componentName,
|
|
10071
10202
|
name: "theme" in props ? props.theme : void 0,
|
|
10072
10203
|
inverse: "themeInverse" in props ? props.themeInverse : void 0
|
|
10073
|
-
}), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), { state, disabled, setStateShallow } = (0,
|
|
10204
|
+
}), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), { state, disabled, setStateShallow } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, (0, import_config.getConfig)()), media = (0, import_useMedia.useMedia)(), splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, ((_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "", state, {
|
|
10074
10205
|
isAnimated: !1,
|
|
10075
10206
|
mediaState: media,
|
|
10076
10207
|
noSkip: !0,
|
|
@@ -10087,7 +10218,7 @@ var require_useProps_native = __commonJS({
|
|
|
10087
10218
|
});
|
|
10088
10219
|
return;
|
|
10089
10220
|
}
|
|
10090
|
-
return (0,
|
|
10221
|
+
return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
|
|
10091
10222
|
disabled,
|
|
10092
10223
|
componentContext,
|
|
10093
10224
|
setStateShallow,
|