@tamagui/core 1.129.12 → 1.129.14
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 +419 -333
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +380 -317
- package/dist/test.native.js.map +3 -3
- package/package.json +9 -9
package/dist/test.native.js
CHANGED
|
@@ -1696,39 +1696,39 @@ var require_pseudoDescriptors_native = __commonJS({
|
|
|
1696
1696
|
// order of keys here important! in priority order
|
|
1697
1697
|
hoverStyle: {
|
|
1698
1698
|
name: "hover",
|
|
1699
|
-
priority:
|
|
1699
|
+
priority: 2
|
|
1700
1700
|
},
|
|
1701
1701
|
pressStyle: {
|
|
1702
1702
|
name: "active",
|
|
1703
1703
|
stateKey: "press",
|
|
1704
|
-
priority:
|
|
1704
|
+
priority: 3
|
|
1705
1705
|
},
|
|
1706
1706
|
focusVisibleStyle: {
|
|
1707
1707
|
name: "focus-visible",
|
|
1708
|
-
priority:
|
|
1708
|
+
priority: 4,
|
|
1709
1709
|
stateKey: "focusVisible"
|
|
1710
1710
|
},
|
|
1711
1711
|
focusStyle: {
|
|
1712
1712
|
name: "focus",
|
|
1713
|
-
priority:
|
|
1713
|
+
priority: 4
|
|
1714
1714
|
},
|
|
1715
1715
|
focusWithinStyle: {
|
|
1716
1716
|
name: "focus-within",
|
|
1717
|
-
priority:
|
|
1717
|
+
priority: 4,
|
|
1718
1718
|
stateKey: "focusWithin"
|
|
1719
1719
|
},
|
|
1720
1720
|
disabledStyle: {
|
|
1721
1721
|
name: "disabled",
|
|
1722
|
-
priority:
|
|
1722
|
+
priority: 5,
|
|
1723
1723
|
stateKey: "disabled"
|
|
1724
1724
|
}
|
|
1725
1725
|
}, pseudoPriorities = {
|
|
1726
|
-
hover:
|
|
1727
|
-
press:
|
|
1728
|
-
focus:
|
|
1729
|
-
focusVisible:
|
|
1730
|
-
focusWithin:
|
|
1731
|
-
disabled:
|
|
1726
|
+
hover: pseudoDescriptorsBase.hoverStyle.priority,
|
|
1727
|
+
press: pseudoDescriptorsBase.pressStyle.priority,
|
|
1728
|
+
focus: pseudoDescriptorsBase.focusStyle.priority,
|
|
1729
|
+
focusVisible: pseudoDescriptorsBase.focusVisibleStyle.priority,
|
|
1730
|
+
focusWithin: pseudoDescriptorsBase.focusWithinStyle.priority,
|
|
1731
|
+
disabled: pseudoDescriptorsBase.disabledStyle.priority
|
|
1732
1732
|
}, pseudoDescriptors = {
|
|
1733
1733
|
...pseudoDescriptorsBase,
|
|
1734
1734
|
enterStyle: {
|
|
@@ -1963,9 +1963,9 @@ var require_useMedia_native = __commonJS({
|
|
|
1963
1963
|
}
|
|
1964
1964
|
return res;
|
|
1965
1965
|
}
|
|
1966
|
-
var getMediaImportanceIfMoreImportant = function(mediaKey, key,
|
|
1967
|
-
var importance = isSizeMedia && !(0, import_config.getSetting)("mediaPropOrder") ? getMediaKeyImportance(mediaKey) : defaultMediaImportance;
|
|
1968
|
-
return !
|
|
1966
|
+
var getMediaImportanceIfMoreImportant = function(mediaKey, key, styleState, isSizeMedia) {
|
|
1967
|
+
var importance = isSizeMedia && !(0, import_config.getSetting)("mediaPropOrder") ? getMediaKeyImportance(mediaKey) : defaultMediaImportance, usedKeys = styleState.usedKeys;
|
|
1968
|
+
return !usedKeys[key] || importance > usedKeys[key] ? importance : null;
|
|
1969
1969
|
};
|
|
1970
1970
|
function camelToHyphen(str) {
|
|
1971
1971
|
return str.replace(/[A-Z]/g, function(m) {
|
|
@@ -2186,6 +2186,80 @@ var require_index_native4 = __commonJS({
|
|
|
2186
2186
|
}
|
|
2187
2187
|
});
|
|
2188
2188
|
|
|
2189
|
+
// ../../packages/is-equal-shallow/dist/cjs/index.native.js
|
|
2190
|
+
var require_index_native5 = __commonJS({
|
|
2191
|
+
"../../packages/is-equal-shallow/dist/cjs/index.native.js"(exports2, module2) {
|
|
2192
|
+
"use strict";
|
|
2193
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
2194
|
+
for (var name in all) __defProp2(target, name, {
|
|
2195
|
+
get: all[name],
|
|
2196
|
+
enumerable: !0
|
|
2197
|
+
});
|
|
2198
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
2199
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
2200
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
2201
|
+
for (var _loop = function() {
|
|
2202
|
+
var key = _step.value;
|
|
2203
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
2204
|
+
get: function() {
|
|
2205
|
+
return from[key];
|
|
2206
|
+
},
|
|
2207
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
2208
|
+
});
|
|
2209
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
2210
|
+
} catch (err) {
|
|
2211
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
2212
|
+
} finally {
|
|
2213
|
+
try {
|
|
2214
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
2215
|
+
} finally {
|
|
2216
|
+
if (_didIteratorError)
|
|
2217
|
+
throw _iteratorError;
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
return to;
|
|
2221
|
+
}, __toCommonJS2 = function(mod) {
|
|
2222
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
2223
|
+
value: !0
|
|
2224
|
+
}), mod);
|
|
2225
|
+
}, index_exports2 = {};
|
|
2226
|
+
__export2(index_exports2, {
|
|
2227
|
+
isEqualShallow: function() {
|
|
2228
|
+
return isEqualShallow;
|
|
2229
|
+
},
|
|
2230
|
+
mergeIfNotShallowEqual: function() {
|
|
2231
|
+
return mergeIfNotShallowEqual;
|
|
2232
|
+
},
|
|
2233
|
+
useCreateShallowSetState: function() {
|
|
2234
|
+
return useCreateShallowSetState;
|
|
2235
|
+
}
|
|
2236
|
+
});
|
|
2237
|
+
module2.exports = __toCommonJS2(index_exports2);
|
|
2238
|
+
var import_react3 = require("react");
|
|
2239
|
+
function useCreateShallowSetState(setter, debug) {
|
|
2240
|
+
return (0, import_react3.useCallback)(function(stateOrGetState) {
|
|
2241
|
+
setter(function(prev) {
|
|
2242
|
+
var next = typeof stateOrGetState == "function" ? stateOrGetState(prev) : stateOrGetState, update = mergeIfNotShallowEqual(prev, next);
|
|
2243
|
+
return update;
|
|
2244
|
+
});
|
|
2245
|
+
}, [
|
|
2246
|
+
setter,
|
|
2247
|
+
debug
|
|
2248
|
+
]);
|
|
2249
|
+
}
|
|
2250
|
+
function mergeIfNotShallowEqual(prev, next) {
|
|
2251
|
+
return !prev || !next || isEqualShallow(prev, next) ? prev || next : {
|
|
2252
|
+
...prev,
|
|
2253
|
+
...next
|
|
2254
|
+
};
|
|
2255
|
+
}
|
|
2256
|
+
function isEqualShallow(prev, next) {
|
|
2257
|
+
for (var key in next) if (prev[key] !== next[key]) return !1;
|
|
2258
|
+
return !0;
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
});
|
|
2262
|
+
|
|
2189
2263
|
// ../web/dist/cjs/constants/isDevTools.native.js
|
|
2190
2264
|
var require_isDevTools_native = __commonJS({
|
|
2191
2265
|
"../web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
|
|
@@ -2429,13 +2503,55 @@ var require_ComponentContext_native = __commonJS({
|
|
|
2429
2503
|
inText: !1,
|
|
2430
2504
|
language: null,
|
|
2431
2505
|
animationDriver: null,
|
|
2432
|
-
setParentFocusState: null
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2506
|
+
setParentFocusState: null
|
|
2507
|
+
});
|
|
2508
|
+
}
|
|
2509
|
+
});
|
|
2510
|
+
|
|
2511
|
+
// ../web/dist/cjs/contexts/GroupContext.native.js
|
|
2512
|
+
var require_GroupContext_native = __commonJS({
|
|
2513
|
+
"../web/dist/cjs/contexts/GroupContext.native.js"(exports2, module2) {
|
|
2514
|
+
"use strict";
|
|
2515
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
2516
|
+
for (var name in all) __defProp2(target, name, {
|
|
2517
|
+
get: all[name],
|
|
2518
|
+
enumerable: !0
|
|
2519
|
+
});
|
|
2520
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
2521
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
2522
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
2523
|
+
for (var _loop = function() {
|
|
2524
|
+
var key = _step.value;
|
|
2525
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
2526
|
+
get: function() {
|
|
2527
|
+
return from[key];
|
|
2528
|
+
},
|
|
2529
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
2530
|
+
});
|
|
2531
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
2532
|
+
} catch (err) {
|
|
2533
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
2534
|
+
} finally {
|
|
2535
|
+
try {
|
|
2536
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
2537
|
+
} finally {
|
|
2538
|
+
if (_didIteratorError)
|
|
2539
|
+
throw _iteratorError;
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
return to;
|
|
2543
|
+
}, __toCommonJS2 = function(mod) {
|
|
2544
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
2545
|
+
value: !0
|
|
2546
|
+
}), mod);
|
|
2547
|
+
}, GroupContext_exports = {};
|
|
2548
|
+
__export2(GroupContext_exports, {
|
|
2549
|
+
GroupContext: function() {
|
|
2550
|
+
return GroupContext;
|
|
2437
2551
|
}
|
|
2438
2552
|
});
|
|
2553
|
+
module2.exports = __toCommonJS2(GroupContext_exports);
|
|
2554
|
+
var import_react3 = require("react"), GroupContext = /* @__PURE__ */ (0, import_react3.createContext)(null);
|
|
2439
2555
|
}
|
|
2440
2556
|
});
|
|
2441
2557
|
|
|
@@ -3344,7 +3460,7 @@ var require_normalize_color = __commonJS({
|
|
|
3344
3460
|
});
|
|
3345
3461
|
|
|
3346
3462
|
// ../normalize-css-color/dist/cjs/index.native.js
|
|
3347
|
-
var
|
|
3463
|
+
var require_index_native6 = __commonJS({
|
|
3348
3464
|
"../normalize-css-color/dist/cjs/index.native.js"(exports2, module2) {
|
|
3349
3465
|
"use strict";
|
|
3350
3466
|
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
@@ -3467,7 +3583,7 @@ var require_normalizeColor_native = __commonJS({
|
|
|
3467
3583
|
}
|
|
3468
3584
|
});
|
|
3469
3585
|
module2.exports = __toCommonJS2(normalizeColor_exports);
|
|
3470
|
-
var import_normalize_css_color =
|
|
3586
|
+
var import_normalize_css_color = require_index_native6(), import_normalize_css_color2 = require_index_native6(), normalizeColor = function(color, opacity) {
|
|
3471
3587
|
if (color) {
|
|
3472
3588
|
if (color[0] === "$") return color;
|
|
3473
3589
|
if (color.startsWith("var(")) {
|
|
@@ -5028,7 +5144,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5028
5144
|
function isValidStyleKey(key, validStyles2, accept) {
|
|
5029
5145
|
return key in validStyles2 ? !0 : accept && key in accept;
|
|
5030
5146
|
}
|
|
5031
|
-
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, elementType, startedUnhydrated, debug) {
|
|
5147
|
+
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug) {
|
|
5032
5148
|
var _loop = function(keyOg2) {
|
|
5033
5149
|
var keyInit = keyOg2, valInit = props[keyInit];
|
|
5034
5150
|
if (keyInit === "children") return viewProps[keyInit] = valInit, "continue";
|
|
@@ -5037,12 +5153,12 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5037
5153
|
var accepted = accept[keyInit];
|
|
5038
5154
|
if ((accepted === "style" || accepted === "textStyle") && valInit && typeof valInit == "object") return viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClass), "continue";
|
|
5039
5155
|
}
|
|
5040
|
-
if (disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className"
|
|
5156
|
+
if (disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className") return "continue";
|
|
5041
5157
|
if (keyInit in import_skipProps.skipProps && !noSkip && !isHOC) {
|
|
5042
5158
|
if (keyInit === "group" && !1) var identifier2, containerType, containerCSS;
|
|
5043
5159
|
return "continue";
|
|
5044
5160
|
}
|
|
5045
|
-
var
|
|
5161
|
+
var isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles2, accept);
|
|
5046
5162
|
if (0) var _viewProps2, _dataSet;
|
|
5047
5163
|
if (!isValidStyleKeyInit) {
|
|
5048
5164
|
if (!import_constants.isAndroid && keyInit === "elevationAndroid") return "continue";
|
|
@@ -5056,13 +5172,13 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5056
5172
|
if (0) var didUseKeyInit;
|
|
5057
5173
|
var isVariant = !isValidStyleKeyInit && variants && keyInit in variants, isStyleLikeKey = isValidStyleKeyInit || isVariant, isPseudo = keyInit in import_helpers2.validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit), isMediaOrPseudo = !!(isMedia || isPseudo);
|
|
5058
5174
|
if (isMediaOrPseudo && keyInit.startsWith("$group-")) {
|
|
5059
|
-
var parts = keyInit.split("-");
|
|
5175
|
+
var parts = keyInit.split("-"), plen = parts.length;
|
|
5060
5176
|
if (
|
|
5061
5177
|
// check if its actually a simple group selector to avoid breaking selectors
|
|
5062
|
-
|
|
5178
|
+
plen === 2 || plen === 3 && import_pseudoDescriptors.pseudoPriorities[parts[parts.length - 1]]
|
|
5063
5179
|
) {
|
|
5064
5180
|
var name2 = parts[1];
|
|
5065
|
-
|
|
5181
|
+
groupContext && !(groupContext != null && groupContext[name2]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
|
|
5066
5182
|
}
|
|
5067
5183
|
}
|
|
5068
5184
|
var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo || isVariant && !noExpand;
|
|
@@ -5078,13 +5194,13 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5078
5194
|
viewProps[key4] = val2;
|
|
5079
5195
|
return;
|
|
5080
5196
|
}
|
|
5081
|
-
if (val2 != null
|
|
5197
|
+
if (val2 != null) {
|
|
5082
5198
|
if (key4 === "pointerEvents") {
|
|
5083
5199
|
viewProps[key4] = val2;
|
|
5084
5200
|
return;
|
|
5085
5201
|
}
|
|
5086
5202
|
if (!isHOC && isValidStyleKey(key4, validStyles2, accept) || import_constants.isAndroid && key4 === "elevation") {
|
|
5087
|
-
mergeStyle(styleState, key4, val2);
|
|
5203
|
+
mergeStyle(styleState, key4, val2, 1);
|
|
5088
5204
|
return;
|
|
5089
5205
|
}
|
|
5090
5206
|
if (isPseudo = key4 in import_helpers2.validPseudoKeys, isMedia = !isPseudo && (0, import_useMedia.isMediaKey)(key4), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants && key4 in variants, inlineProps != null && inlineProps.has(key4) || process.env.IS_STATIC === "is_static" && inlineWhenUnflattened != null && inlineWhenUnflattened.has(key4)) {
|
|
@@ -5113,7 +5229,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5113
5229
|
try {
|
|
5114
5230
|
for (var _iterator2 = pseudoStyles[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
|
|
5115
5231
|
var psuedoStyle = _step2.value, fullKey = `${psuedoStyle[import_helpers2.StyleObjectProperty]}${PROP_SPLIT}${descriptor.name}`;
|
|
5116
|
-
|
|
5232
|
+
addStyleToInsertRules(rulesToInsert, psuedoStyle), classNames[fullKey] = psuedoStyle[import_helpers2.StyleObjectIdentifier];
|
|
5117
5233
|
}
|
|
5118
5234
|
} catch (err) {
|
|
5119
5235
|
_didIteratorError2 = !0, _iteratorError2 = err;
|
|
@@ -5133,19 +5249,19 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5133
5249
|
var _$val = pseudoStyleObject[pkey];
|
|
5134
5250
|
if (isDisabled) applyDefaultStyle(pkey, styleState);
|
|
5135
5251
|
else {
|
|
5136
|
-
var curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
|
|
5252
|
+
var curImportance = styleState.usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
|
|
5137
5253
|
if (shouldMerge) {
|
|
5138
5254
|
if (process.env.IS_STATIC === "is_static") {
|
|
5139
5255
|
var _pseudos1, _key1;
|
|
5140
5256
|
pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key4] || (_pseudos1[_key1] = {}), pseudos[key4][pkey] = _$val;
|
|
5141
5257
|
}
|
|
5142
|
-
mergeStyle(styleState, pkey, _$val);
|
|
5258
|
+
mergeStyle(styleState, pkey, _$val, importance);
|
|
5143
5259
|
}
|
|
5144
5260
|
}
|
|
5145
5261
|
}
|
|
5146
5262
|
if (!isDisabled) for (var _$key in val2) {
|
|
5147
5263
|
var k = shorthands[_$key] || _$key;
|
|
5148
|
-
usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
|
|
5264
|
+
styleState.usedKeys[k] = Math.max(importance, styleState.usedKeys[k] || 0);
|
|
5149
5265
|
}
|
|
5150
5266
|
}
|
|
5151
5267
|
return;
|
|
@@ -5154,21 +5270,20 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5154
5270
|
if (!val2) return;
|
|
5155
5271
|
var hasSpace = val2.space, mediaKeyShort = key4.slice(isMedia == "theme" ? 7 : 1);
|
|
5156
5272
|
if (hasMedia || (hasMedia = !0), (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && ((!hasMedia || typeof hasMedia == "boolean") && (hasMedia = /* @__PURE__ */ new Set()), hasMedia.add(mediaKeyShort)), isMedia === "platform" && !(0, import_isActivePlatform.isActivePlatform)(key4)) return;
|
|
5157
|
-
|
|
5273
|
+
var priority = mediaStylesSeen;
|
|
5274
|
+
if (mediaStylesSeen += 1, shouldDoClasses) {
|
|
5158
5275
|
var mediaStyle = getSubStyle(styleState, key4, val2, !1);
|
|
5159
5276
|
if (hasSpace && (delete mediaStyle.space, mediaState2[mediaKeyShort])) {
|
|
5160
|
-
var importance1 = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKeyShort, "space",
|
|
5161
|
-
importance1 && (space = val2.space, usedKeys.space = importance1);
|
|
5277
|
+
var importance1 = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKeyShort, "space", styleState, !0);
|
|
5278
|
+
importance1 && (space = val2.space, styleState.usedKeys.space = importance1);
|
|
5162
5279
|
}
|
|
5163
|
-
var mediaStyles = (0, import_getCSSStylesAtomic.getCSSStylesAtomic)(mediaStyle),
|
|
5164
|
-
mediaStylesSeen += 1;
|
|
5165
|
-
var _iteratorNormalCompletion12 = !0, _didIteratorError12 = !1, _iteratorError12 = void 0;
|
|
5280
|
+
var mediaStyles = (0, import_getCSSStylesAtomic.getCSSStylesAtomic)(mediaStyle), _iteratorNormalCompletion12 = !0, _didIteratorError12 = !1, _iteratorError12 = void 0;
|
|
5166
5281
|
try {
|
|
5167
5282
|
for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = !0) {
|
|
5168
5283
|
var style3 = _step12.value, property = style3[import_helpers2.StyleObjectProperty], isSubStyle = property[0] === "$";
|
|
5169
5284
|
if (!(isSubStyle && !(0, import_isActivePlatform.isActivePlatform)(property))) {
|
|
5170
5285
|
var out = (0, import_createMediaStyle.createMediaStyle)(style3, mediaKeyShort, import_useMedia.mediaQueryConfig, isMedia, !1, priority), subKey = isSubStyle ? style3[2] : "", fullKey1 = `${style3[import_helpers2.StyleObjectProperty]}${subKey}${PROP_SPLIT}${mediaKeyShort}${style3[import_helpers2.StyleObjectPseudo] || ""}`;
|
|
5171
|
-
|
|
5286
|
+
addStyleToInsertRules(rulesToInsert, out), classNames[fullKey1] = out[import_helpers2.StyleObjectIdentifier];
|
|
5172
5287
|
}
|
|
5173
5288
|
}
|
|
5174
5289
|
} catch (err) {
|
|
@@ -5184,7 +5299,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5184
5299
|
var mergeMediaStyle2 = function(key5, val3) {
|
|
5185
5300
|
var _styleState4;
|
|
5186
5301
|
(_styleState4 = styleState).style || (_styleState4.style = {});
|
|
5187
|
-
var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3,
|
|
5302
|
+
var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3, mediaState2[mediaKeyShort], importanceBump, debug);
|
|
5188
5303
|
didMerge && key5 === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
|
|
5189
5304
|
}, mergeMediaStyle = mergeMediaStyle2, isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
|
|
5190
5305
|
if (!isThemeMedia && !isPlatformMedia && !isGroupMedia && !mediaState2[mediaKeyShort])
|
|
@@ -5201,27 +5316,28 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5201
5316
|
scheme,
|
|
5202
5317
|
val: _$val1,
|
|
5203
5318
|
oppositeVal
|
|
5204
|
-
}), mergeStyle(styleState, subKey1, mediaStyle1[subKey1]);
|
|
5319
|
+
}), mergeStyle(styleState, subKey1, mediaStyle1[subKey1], priority);
|
|
5205
5320
|
}
|
|
5206
5321
|
} else if (!(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort))) return;
|
|
5207
5322
|
} else if (isGroupMedia) {
|
|
5208
|
-
var _componentState_group, groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name,
|
|
5209
|
-
if (!
|
|
5323
|
+
var _groupContext_groupName, _componentState_group, groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupState = groupContext == null || (_groupContext_groupName = groupContext[groupName]) === null || _groupContext_groupName === void 0 ? void 0 : _groupContext_groupName.state;
|
|
5324
|
+
if (!groupState)
|
|
5210
5325
|
return;
|
|
5211
5326
|
var groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_componentState_group = componentState.group) === null || _componentState_group === void 0 ? void 0 : _componentState_group[groupName];
|
|
5212
5327
|
if (groupMediaKey) {
|
|
5213
5328
|
mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
|
|
5214
5329
|
var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
|
|
5215
|
-
if (!mediaState1 &&
|
|
5330
|
+
if (!mediaState1 && groupState.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupState.layout)), !isActive) {
|
|
5216
5331
|
for (var pkey1 in mediaStyle1) applyDefaultStyle(pkey1, styleState);
|
|
5217
5332
|
return;
|
|
5218
5333
|
}
|
|
5219
5334
|
importanceBump = 2;
|
|
5220
5335
|
}
|
|
5221
5336
|
if (groupPseudoKey) {
|
|
5337
|
+
var _this;
|
|
5222
5338
|
pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
|
|
5223
|
-
var componentGroupPseudoState = (componentGroupState || // fallback to context initially
|
|
5224
|
-
|
|
5339
|
+
var componentGroupPseudoState = (_this = componentGroupState || // fallback to context initially
|
|
5340
|
+
(groupContext == null ? void 0 : groupContext[groupName].state)) === null || _this === void 0 ? void 0 : _this.pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
|
|
5225
5341
|
if (!isActive1) {
|
|
5226
5342
|
for (var pkey2 in mediaStyle1) applyDefaultStyle(pkey2, styleState);
|
|
5227
5343
|
return;
|
|
@@ -5252,7 +5368,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5252
5368
|
conf = conf || (0, import_config.getConfig)();
|
|
5253
5369
|
var animationDriver = (componentContext == null ? void 0 : componentContext.animationDriver) || conf.animations;
|
|
5254
5370
|
import_constants.isWeb && styleProps.isAnimated && animationDriver.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
5255
|
-
var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState,
|
|
5371
|
+
var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClass && !styleProps.isAnimated, rulesToInsert = void 0, classNames = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, validStyles2 = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers2.stylePropsText : import_helpers2.validStyles), styleState = {
|
|
5256
5372
|
classNames,
|
|
5257
5373
|
conf,
|
|
5258
5374
|
props,
|
|
@@ -5261,7 +5377,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5261
5377
|
staticConfig,
|
|
5262
5378
|
style: null,
|
|
5263
5379
|
theme,
|
|
5264
|
-
usedKeys,
|
|
5380
|
+
usedKeys: {},
|
|
5265
5381
|
viewProps,
|
|
5266
5382
|
context: componentContext,
|
|
5267
5383
|
debug
|
|
@@ -5369,11 +5485,11 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5369
5485
|
mergeTransform(target, key, val, !0);
|
|
5370
5486
|
});
|
|
5371
5487
|
}
|
|
5372
|
-
function mergeStyle(styleState, key, val) {
|
|
5373
|
-
var disableNormalize = arguments.length >
|
|
5374
|
-
if (key in import_helpers2.stylePropsTransform) {
|
|
5488
|
+
function mergeStyle(styleState, key, val, importance) {
|
|
5489
|
+
var disableNormalize = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, { viewProps, styleProps, staticConfig, usedKeys } = styleState, existingImportance = usedKeys[key] || 0;
|
|
5490
|
+
if (!(existingImportance > importance)) if (key in import_helpers2.stylePropsTransform) {
|
|
5375
5491
|
var _styleState;
|
|
5376
|
-
(_styleState = styleState).flatTransforms || (_styleState.flatTransforms = {}), styleState.flatTransforms[key] = val;
|
|
5492
|
+
(_styleState = styleState).flatTransforms || (_styleState.flatTransforms = {}), usedKeys[key] = importance, styleState.flatTransforms[key] = val;
|
|
5377
5493
|
} else {
|
|
5378
5494
|
var shouldNormalize = import_constants.isWeb && !disableNormalize && !styleProps.noNormalize, out = shouldNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
|
|
5379
5495
|
if (
|
|
@@ -5382,7 +5498,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5382
5498
|
) viewProps[key] = out;
|
|
5383
5499
|
else {
|
|
5384
5500
|
var _styleState1;
|
|
5385
|
-
(_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key] = // if you dont do this you'll be passing props.transform arrays directly here and then mutating them
|
|
5501
|
+
(_styleState1 = styleState).style || (_styleState1.style = {}), usedKeys[key] = importance, styleState.style[key] = // if you dont do this you'll be passing props.transform arrays directly here and then mutating them
|
|
5386
5502
|
// if theres any flatTransforms later, causing issues (mutating props is bad, in strict mode styles get borked)
|
|
5387
5503
|
key === "transform" && Array.isArray(out) ? [
|
|
5388
5504
|
...out
|
|
@@ -5413,8 +5529,8 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5413
5529
|
}
|
|
5414
5530
|
return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
|
|
5415
5531
|
}, useInsertEffectCompat = import_constants.isWeb ? import_react3.default.useInsertionEffect || import_constants.useIsomorphicLayoutEffect : function() {
|
|
5416
|
-
}, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k) {
|
|
5417
|
-
var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k);
|
|
5532
|
+
}, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k, l) {
|
|
5533
|
+
var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k, l);
|
|
5418
5534
|
return res;
|
|
5419
5535
|
};
|
|
5420
5536
|
function addStyleToInsertRules(rulesToInsert, styleObject) {
|
|
@@ -5459,14 +5575,14 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5459
5575
|
delete viewProps[key], viewProps[key] = next;
|
|
5460
5576
|
} else viewProps[key] = val;
|
|
5461
5577
|
}
|
|
5462
|
-
function mergeMediaByImportance(styleState, mediaKey, key, value,
|
|
5463
|
-
var importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKey, key,
|
|
5578
|
+
function mergeMediaByImportance(styleState, mediaKey, key, value, isSizeMedia, importanceBump, debugProp) {
|
|
5579
|
+
var usedKeys = styleState.usedKeys, importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKey, key, styleState, isSizeMedia);
|
|
5464
5580
|
if (importanceBump && (importance = (importance || 0) + importanceBump), importance === null) return !1;
|
|
5465
|
-
if (
|
|
5581
|
+
if (key in import_pseudoDescriptors.pseudoDescriptors) {
|
|
5466
5582
|
var descriptor = import_pseudoDescriptors.pseudoDescriptors[key], descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = styleState.componentState[descriptorKey] === !1;
|
|
5467
5583
|
if (isDisabled) return !1;
|
|
5468
|
-
for (var subKey in value) mergeStyle(styleState, subKey, value[subKey]);
|
|
5469
|
-
} else mergeStyle(styleState, key, value);
|
|
5584
|
+
for (var subKey in value) mergeStyle(styleState, subKey, value[subKey], importance);
|
|
5585
|
+
} else mergeStyle(styleState, key, value, importance);
|
|
5470
5586
|
return !0;
|
|
5471
5587
|
}
|
|
5472
5588
|
function normalizeStyle(style) {
|
|
@@ -5479,7 +5595,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5479
5595
|
}
|
|
5480
5596
|
function applyDefaultStyle(pkey, styleState) {
|
|
5481
5597
|
var defaultValues = animatableDefaults[pkey];
|
|
5482
|
-
defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues);
|
|
5598
|
+
defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues, 1);
|
|
5483
5599
|
}
|
|
5484
5600
|
}
|
|
5485
5601
|
});
|
|
@@ -5600,79 +5716,6 @@ var require_setElementProps_native = __commonJS({
|
|
|
5600
5716
|
}
|
|
5601
5717
|
});
|
|
5602
5718
|
|
|
5603
|
-
// ../../packages/is-equal-shallow/dist/cjs/index.native.js
|
|
5604
|
-
var require_index_native6 = __commonJS({
|
|
5605
|
-
"../../packages/is-equal-shallow/dist/cjs/index.native.js"(exports2, module2) {
|
|
5606
|
-
"use strict";
|
|
5607
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
5608
|
-
for (var name in all) __defProp2(target, name, {
|
|
5609
|
-
get: all[name],
|
|
5610
|
-
enumerable: !0
|
|
5611
|
-
});
|
|
5612
|
-
}, __copyProps2 = function(to, from, except, desc) {
|
|
5613
|
-
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
5614
|
-
if (from && typeof from == "object" || typeof from == "function") try {
|
|
5615
|
-
for (var _loop = function() {
|
|
5616
|
-
var key = _step.value;
|
|
5617
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
5618
|
-
get: function() {
|
|
5619
|
-
return from[key];
|
|
5620
|
-
},
|
|
5621
|
-
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
5622
|
-
});
|
|
5623
|
-
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
5624
|
-
} catch (err) {
|
|
5625
|
-
_didIteratorError = !0, _iteratorError = err;
|
|
5626
|
-
} finally {
|
|
5627
|
-
try {
|
|
5628
|
-
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
5629
|
-
} finally {
|
|
5630
|
-
if (_didIteratorError)
|
|
5631
|
-
throw _iteratorError;
|
|
5632
|
-
}
|
|
5633
|
-
}
|
|
5634
|
-
return to;
|
|
5635
|
-
}, __toCommonJS2 = function(mod) {
|
|
5636
|
-
return __copyProps2(__defProp2({}, "__esModule", {
|
|
5637
|
-
value: !0
|
|
5638
|
-
}), mod);
|
|
5639
|
-
}, index_exports2 = {};
|
|
5640
|
-
__export2(index_exports2, {
|
|
5641
|
-
isEqualShallow: function() {
|
|
5642
|
-
return isEqualShallow;
|
|
5643
|
-
},
|
|
5644
|
-
mergeIfNotShallowEqual: function() {
|
|
5645
|
-
return mergeIfNotShallowEqual;
|
|
5646
|
-
},
|
|
5647
|
-
useCreateShallowSetState: function() {
|
|
5648
|
-
return useCreateShallowSetState;
|
|
5649
|
-
}
|
|
5650
|
-
});
|
|
5651
|
-
module2.exports = __toCommonJS2(index_exports2);
|
|
5652
|
-
var import_react3 = require("react");
|
|
5653
|
-
function useCreateShallowSetState(setter, debugIn) {
|
|
5654
|
-
return (0, import_react3.useCallback)(function(next) {
|
|
5655
|
-
setter(function(prev) {
|
|
5656
|
-
return mergeIfNotShallowEqual(prev, next, debugIn);
|
|
5657
|
-
});
|
|
5658
|
-
}, [
|
|
5659
|
-
setter,
|
|
5660
|
-
debugIn
|
|
5661
|
-
]);
|
|
5662
|
-
}
|
|
5663
|
-
function mergeIfNotShallowEqual(prev, next, debug) {
|
|
5664
|
-
return !prev || !next || isEqualShallow(prev, next) ? prev || next : {
|
|
5665
|
-
...prev,
|
|
5666
|
-
...next
|
|
5667
|
-
};
|
|
5668
|
-
}
|
|
5669
|
-
function isEqualShallow(prev, next) {
|
|
5670
|
-
for (var key in next) if (prev[key] !== next[key]) return !1;
|
|
5671
|
-
return !0;
|
|
5672
|
-
}
|
|
5673
|
-
}
|
|
5674
|
-
});
|
|
5675
|
-
|
|
5676
5719
|
// ../web/dist/cjs/helpers/subscribeToContextGroup.native.js
|
|
5677
5720
|
var require_subscribeToContextGroup_native = __commonJS({
|
|
5678
5721
|
"../web/dist/cjs/helpers/subscribeToContextGroup.native.js"(exports2, module2) {
|
|
@@ -5716,31 +5759,57 @@ var require_subscribeToContextGroup_native = __commonJS({
|
|
|
5716
5759
|
}
|
|
5717
5760
|
});
|
|
5718
5761
|
module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
|
|
5719
|
-
var
|
|
5720
|
-
var {
|
|
5762
|
+
var import_is_equal_shallow = require_index_native5(), import_useMedia = require_useMedia_native(), subscribeToContextGroup = function(props) {
|
|
5763
|
+
var { pseudoGroups, mediaGroups, groupContext } = props;
|
|
5721
5764
|
if (pseudoGroups || mediaGroups) {
|
|
5722
|
-
var
|
|
5723
|
-
|
|
5724
|
-
|
|
5765
|
+
var disposables = /* @__PURE__ */ new Set();
|
|
5766
|
+
if (pseudoGroups) for (var _i = 0, _iter = [
|
|
5767
|
+
...pseudoGroups
|
|
5768
|
+
]; _i < _iter.length; _i++) {
|
|
5769
|
+
var name = _iter[_i];
|
|
5770
|
+
disposables.add(createGroupListener(name, props));
|
|
5771
|
+
}
|
|
5772
|
+
if (mediaGroups) for (var _i1 = 0, _iter1 = [
|
|
5773
|
+
...mediaGroups
|
|
5774
|
+
]; _i1 < _iter1.length; _i1++) {
|
|
5775
|
+
var name1 = _iter1[_i1];
|
|
5776
|
+
disposables.add(createGroupListener(name1, props));
|
|
5777
|
+
}
|
|
5778
|
+
return function() {
|
|
5779
|
+
disposables.forEach(function(d) {
|
|
5780
|
+
return d();
|
|
5781
|
+
});
|
|
5782
|
+
};
|
|
5783
|
+
}
|
|
5784
|
+
}, createGroupListener = function(name, param) {
|
|
5785
|
+
var { setStateShallow, pseudoGroups, mediaGroups, groupContext } = param, parent = groupContext == null ? void 0 : groupContext[name];
|
|
5786
|
+
return parent ? parent.subscribe(function(param2) {
|
|
5787
|
+
var { layout, pseudo } = param2;
|
|
5788
|
+
setStateShallow(function(prev) {
|
|
5789
|
+
var _prev_group, didChange = !1, group = ((_prev_group = prev.group) === null || _prev_group === void 0 ? void 0 : _prev_group[name]) || {
|
|
5725
5790
|
pseudo: {},
|
|
5726
5791
|
media: {}
|
|
5727
5792
|
};
|
|
5728
|
-
if (pseudo && pseudoGroups != null && pseudoGroups.has(
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
next
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
var
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
setStateShallow({
|
|
5739
|
-
group
|
|
5740
|
-
});
|
|
5793
|
+
if (pseudo && pseudoGroups != null && pseudoGroups.has(name)) {
|
|
5794
|
+
var _group;
|
|
5795
|
+
(_group = group).pseudo || (_group.pseudo = {});
|
|
5796
|
+
var next = (0, import_is_equal_shallow.mergeIfNotShallowEqual)(group.pseudo, pseudo);
|
|
5797
|
+
next !== group.pseudo && (Object.assign(group.pseudo, pseudo), didChange = !0);
|
|
5798
|
+
} else if (layout && mediaGroups) {
|
|
5799
|
+
var _group1;
|
|
5800
|
+
(_group1 = group).media || (_group1.media = {});
|
|
5801
|
+
var mediaState2 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next1 = (0, import_is_equal_shallow.mergeIfNotShallowEqual)(group.media, mediaState2);
|
|
5802
|
+
next1 !== group.media && (Object.assign(group.media, next1), didChange = !0);
|
|
5741
5803
|
}
|
|
5804
|
+
return didChange ? {
|
|
5805
|
+
group: {
|
|
5806
|
+
...prev.group,
|
|
5807
|
+
[name]: group
|
|
5808
|
+
}
|
|
5809
|
+
} : prev;
|
|
5742
5810
|
});
|
|
5743
|
-
}
|
|
5811
|
+
}) : function() {
|
|
5812
|
+
};
|
|
5744
5813
|
};
|
|
5745
5814
|
}
|
|
5746
5815
|
});
|
|
@@ -6701,8 +6770,8 @@ var require_useComponentState_native = __commonJS({
|
|
|
6701
6770
|
}
|
|
6702
6771
|
});
|
|
6703
6772
|
module2.exports = __toCommonJS2(useComponentState_exports);
|
|
6704
|
-
var import_constants = require_index_native2(), import_is_equal_shallow =
|
|
6705
|
-
var
|
|
6773
|
+
var import_constants = require_index_native2(), import_is_equal_shallow = require_index_native5(), import_use_did_finish_ssr = require_index_native7(), import_react3 = require("react"), import_defaultComponentState = require_defaultComponentState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
6774
|
+
var _animationDriver_usePresence, isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)(), needsHydration = !(0, import_use_did_finish_ssr.useIsClientOnly)(), [startedUnhydrated] = (0, import_react3.useState)(needsHydration && !isHydrated), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
|
|
6706
6775
|
stateRef.current || (stateRef.current = {});
|
|
6707
6776
|
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSS = animationDriver == null ? void 0 : animationDriver.supportsCSS, curStateRef = stateRef.current;
|
|
6708
6777
|
!needsHydration && hasAnimationProp && (curStateRef.hasAnimated = !0);
|
|
@@ -6725,9 +6794,7 @@ var require_useComponentState_native = __commonJS({
|
|
|
6725
6794
|
var states = (0, import_react3.useState)(initialState), state = props.forceStyle ? {
|
|
6726
6795
|
...states[0],
|
|
6727
6796
|
[props.forceStyle]: !0
|
|
6728
|
-
} : states[0], setState = states[1];
|
|
6729
|
-
stateRef.current.nextComponentState && (Object.assign(state, stateRef.current.nextComponentState), stateRef.current.nextComponentState = void 0);
|
|
6730
|
-
var isAnimated = willBeAnimated;
|
|
6797
|
+
} : states[0], setState = states[1], isAnimated = willBeAnimated;
|
|
6731
6798
|
import_constants.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), state.disabled = disabled, setState(function(_) {
|
|
6732
6799
|
return {
|
|
6733
6800
|
...state
|
|
@@ -6745,46 +6812,6 @@ var require_useComponentState_native = __commonJS({
|
|
|
6745
6812
|
var isAnimatedAndHydrated = isAnimated && !supportsCSS, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || !state.unmounted), isDisabledManually = disableClassName && !state.unmounted;
|
|
6746
6813
|
(isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (noClass = !0);
|
|
6747
6814
|
}
|
|
6748
|
-
if (groupName && !curStateRef.group) {
|
|
6749
|
-
var listeners = /* @__PURE__ */ new Set();
|
|
6750
|
-
curStateRef.group = {
|
|
6751
|
-
listeners,
|
|
6752
|
-
emit(name, state2) {
|
|
6753
|
-
listeners.forEach(function(l) {
|
|
6754
|
-
return l(name, state2);
|
|
6755
|
-
});
|
|
6756
|
-
},
|
|
6757
|
-
subscribe(cb) {
|
|
6758
|
-
return listeners.add(cb), setStateShallow({
|
|
6759
|
-
hasDynGroupChildren: !0
|
|
6760
|
-
}), function() {
|
|
6761
|
-
listeners.delete(cb), listeners.size === 0 && setStateShallow({
|
|
6762
|
-
hasDynGroupChildren: !1
|
|
6763
|
-
});
|
|
6764
|
-
};
|
|
6765
|
-
}
|
|
6766
|
-
};
|
|
6767
|
-
}
|
|
6768
|
-
if (!curStateRef.stateEmitter && hasAnimationProp) {
|
|
6769
|
-
var listeners1 = /* @__PURE__ */ new Set();
|
|
6770
|
-
curStateRef.stateEmitter = {
|
|
6771
|
-
listeners: listeners1,
|
|
6772
|
-
emit(state2) {
|
|
6773
|
-
listeners1.forEach(function(l) {
|
|
6774
|
-
return l(state2);
|
|
6775
|
-
});
|
|
6776
|
-
},
|
|
6777
|
-
subscribe(cb) {
|
|
6778
|
-
return listeners1.add(cb), setStateShallow({
|
|
6779
|
-
hasDynGroupChildren: !0
|
|
6780
|
-
}), function() {
|
|
6781
|
-
listeners1.delete(cb), listeners1.size === 0 && setStateShallow({
|
|
6782
|
-
hasDynGroupChildren: !1
|
|
6783
|
-
});
|
|
6784
|
-
};
|
|
6785
|
-
}
|
|
6786
|
-
};
|
|
6787
|
-
}
|
|
6788
6815
|
return {
|
|
6789
6816
|
startedUnhydrated,
|
|
6790
6817
|
curStateRef,
|
|
@@ -7034,17 +7061,26 @@ var require_createComponent_native = __commonJS({
|
|
|
7034
7061
|
}
|
|
7035
7062
|
});
|
|
7036
7063
|
module2.exports = __toCommonJS2(createComponent_exports);
|
|
7037
|
-
var import_jsx_runtime2 = require("react/jsx-runtime"), import_compose_refs = require_index_native4(), import_constants = require_index_native2(), import_helpers2 = require_index_native3(), 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_getShorthandValue = require_getShorthandValue_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_wrapStyleTags = require_wrapStyleTags_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(), componentSetStates = /* @__PURE__ */ new Set()
|
|
7064
|
+
var import_jsx_runtime2 = require("react/jsx-runtime"), import_compose_refs = require_index_native4(), import_constants = require_index_native2(), import_helpers2 = require_index_native3(), import_is_equal_shallow = require_index_native5(), 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_GroupContext = require_GroupContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getShorthandValue = require_getShorthandValue_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_wrapStyleTags = require_wrapStyleTags_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(), NextState = /* @__PURE__ */ new WeakMap(), componentSetStates = /* @__PURE__ */ new Set(), avoidReRenderKeys = /* @__PURE__ */ new Set([
|
|
7065
|
+
"hover",
|
|
7066
|
+
"press",
|
|
7067
|
+
"pressIn",
|
|
7068
|
+
"group",
|
|
7069
|
+
"focus",
|
|
7070
|
+
"focusWithin",
|
|
7071
|
+
"media",
|
|
7072
|
+
"group"
|
|
7073
|
+
]);
|
|
7038
7074
|
if (0) var cancelTouches;
|
|
7039
7075
|
var BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
|
|
7040
7076
|
value: !1
|
|
7041
7077
|
};
|
|
7042
|
-
import_constants.isWeb &&
|
|
7043
|
-
lastInteractionWasKeyboard.value = !0;
|
|
7078
|
+
import_constants.isWeb && typeof document < "u" && (document.addEventListener("keydown", function() {
|
|
7079
|
+
lastInteractionWasKeyboard.value || (lastInteractionWasKeyboard.value = !0);
|
|
7044
7080
|
}), document.addEventListener("mousedown", function() {
|
|
7045
|
-
lastInteractionWasKeyboard.value = !1;
|
|
7081
|
+
lastInteractionWasKeyboard.value && (lastInteractionWasKeyboard.value = !1);
|
|
7046
7082
|
}), document.addEventListener("mousemove", function() {
|
|
7047
|
-
lastInteractionWasKeyboard.value = !1;
|
|
7083
|
+
lastInteractionWasKeyboard.value && (lastInteractionWasKeyboard.value = !1);
|
|
7048
7084
|
}));
|
|
7049
7085
|
function createComponent(staticConfig) {
|
|
7050
7086
|
var _staticConfig_defaultProps, { componentName } = staticConfig, config = null, defaultProps = staticConfig.defaultProps;
|
|
@@ -7069,7 +7105,7 @@ var require_createComponent_native = __commonJS({
|
|
|
7069
7105
|
var _propsIn_datatestrenders, _current, _;
|
|
7070
7106
|
(_ = (_propsIn_datatestrenders = propsIn["data-test-renders"])[_current = "current"]) !== null && _ !== void 0 || (_propsIn_datatestrenders[_current] = 0), propsIn["data-test-renders"].current += 1;
|
|
7071
7107
|
}
|
|
7072
|
-
var
|
|
7108
|
+
var styledContextProps, overriddenContextProps, contextValue, { context, isReactNative } = staticConfig;
|
|
7073
7109
|
if (context && (contextValue = import_react3.default.useContext(context), contextValue))
|
|
7074
7110
|
for (var key in context.props) {
|
|
7075
7111
|
var propVal = (0, import_getShorthandValue.getShorthandValue)(propsIn, key);
|
|
@@ -7088,21 +7124,65 @@ var require_createComponent_native = __commonJS({
|
|
|
7088
7124
|
...styledContextProps
|
|
7089
7125
|
} : defaultProps, props = propsIn;
|
|
7090
7126
|
curDefaultProps && (props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn));
|
|
7091
|
-
var componentName2 = props.componentName || staticConfig.componentName, animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = (0, import_useComponentState.useComponentState)(props,
|
|
7127
|
+
var componentName2 = props.componentName || staticConfig.componentName, componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), groupContextParent = import_react3.default.useContext(import_GroupContext.GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = (0, import_useComponentState.useComponentState)(props, animationDriver, staticConfig, config), { disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, noClass, state, stateRef, supportsCSS, willBeAnimated, willBeAnimatedClient, startedUnhydrated } = componentState;
|
|
7128
|
+
hasAnimationProp && animationDriver != null && animationDriver.avoidReRenders && (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
7129
|
+
var pendingState = NextState.get(stateRef);
|
|
7130
|
+
pendingState && (setStateShallow(pendingState), NextState.set(stateRef, void 0));
|
|
7131
|
+
});
|
|
7132
|
+
var allGroupContexts = (0, import_react3.useMemo)(function() {
|
|
7133
|
+
var _stateRef_current_group;
|
|
7134
|
+
if (!groupName) return groupContextParent;
|
|
7135
|
+
(_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0 || _stateRef_current_group.listeners.clear();
|
|
7136
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
7137
|
+
return stateRef.current.group = {
|
|
7138
|
+
listeners,
|
|
7139
|
+
emit(state2) {
|
|
7140
|
+
listeners.forEach(function(l) {
|
|
7141
|
+
return l(state2);
|
|
7142
|
+
});
|
|
7143
|
+
},
|
|
7144
|
+
subscribe(cb) {
|
|
7145
|
+
return listeners.add(cb), listeners.size === 1 && setStateShallow({
|
|
7146
|
+
hasDynGroupChildren: !0
|
|
7147
|
+
}), function() {
|
|
7148
|
+
listeners.delete(cb), listeners.size === 0 && setStateShallow({
|
|
7149
|
+
hasDynGroupChildren: !1
|
|
7150
|
+
});
|
|
7151
|
+
};
|
|
7152
|
+
}
|
|
7153
|
+
}, {
|
|
7154
|
+
...groupContextParent,
|
|
7155
|
+
[groupName]: {
|
|
7156
|
+
state: {
|
|
7157
|
+
pseudo: import_defaultComponentState.defaultComponentStateMounted
|
|
7158
|
+
},
|
|
7159
|
+
subscribe: function(listener) {
|
|
7160
|
+
var _stateRef_current_group2, dispose = (_stateRef_current_group2 = stateRef.current.group) === null || _stateRef_current_group2 === void 0 ? void 0 : _stateRef_current_group2.subscribe(listener);
|
|
7161
|
+
return function() {
|
|
7162
|
+
dispose == null || dispose();
|
|
7163
|
+
};
|
|
7164
|
+
}
|
|
7165
|
+
}
|
|
7166
|
+
};
|
|
7167
|
+
}, [
|
|
7168
|
+
stateRef,
|
|
7169
|
+
groupName,
|
|
7170
|
+
groupContextParent
|
|
7171
|
+
]), setStateShallow = componentState.setStateShallow, 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;
|
|
7092
7172
|
animationDriver && isAnimated && // this should really be behind another prop as it's not really related to
|
|
7093
7173
|
// "needsWebStyles" basically with motion we just animate a plain div, but
|
|
7094
7174
|
// we still have animated.View/Text for Sheet which wants to control
|
|
7095
7175
|
// things declaratively
|
|
7096
7176
|
!animationDriver.needsWebStyles && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
|
|
7097
7177
|
var disableThemeProp = !1, disableTheme = disableThemeProp || isHOC;
|
|
7098
|
-
props.themeShallow && (
|
|
7178
|
+
props.themeShallow && (stateRef.current.themeShallow = !0);
|
|
7099
7179
|
var themeStateProps = {
|
|
7100
7180
|
componentName: componentName2,
|
|
7101
7181
|
disable: disableTheme,
|
|
7102
|
-
shallow:
|
|
7182
|
+
shallow: stateRef.current.themeShallow,
|
|
7103
7183
|
debug: debugProp
|
|
7104
7184
|
};
|
|
7105
|
-
if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof
|
|
7185
|
+
if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof stateRef.current.isListeningToTheme == "boolean" && (themeStateProps.needsUpdate = function() {
|
|
7106
7186
|
return !!stateRef.current.isListeningToTheme;
|
|
7107
7187
|
}), themeStateProps.deopt = willBeAnimated, !1) {
|
|
7108
7188
|
var name, type, dataIs, banner;
|
|
@@ -7124,33 +7204,47 @@ var require_createComponent_native = __commonJS({
|
|
|
7124
7204
|
willBeAnimated,
|
|
7125
7205
|
styledContextProps,
|
|
7126
7206
|
noMergeStyle: isAnimated && (animationDriver == null ? void 0 : animationDriver.needsWebStyles)
|
|
7127
|
-
}, themeName = (themeState == null ? void 0 : themeState.name) || "", splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
|
|
7128
|
-
if (
|
|
7129
|
-
var
|
|
7130
|
-
|
|
7131
|
-
var
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
]), canAvoidReRender = Object.keys(next).every(function(key3) {
|
|
7136
|
-
return avoidReRenderKeys.has(key3);
|
|
7207
|
+
}, themeName = (themeState == null ? void 0 : themeState.name) || "", splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp), groupContext = groupName && (allGroupContexts == null ? void 0 : allGroupContexts[groupName]) || null;
|
|
7208
|
+
if (groupContext) {
|
|
7209
|
+
var groupState = groupContext == null ? void 0 : groupContext.state;
|
|
7210
|
+
if (groupState && groupState.layout === void 0) {
|
|
7211
|
+
var _splitStyles_style, _splitStyles_style1;
|
|
7212
|
+
(!((_splitStyles_style = splitStyles.style) === null || _splitStyles_style === void 0) && _splitStyles_style.width || !((_splitStyles_style1 = splitStyles.style) === null || _splitStyles_style1 === void 0) && _splitStyles_style1.height) && (groupState.layout = {
|
|
7213
|
+
width: fromPx(splitStyles.style.width),
|
|
7214
|
+
height: fromPx(splitStyles.style.height)
|
|
7137
7215
|
});
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7216
|
+
}
|
|
7217
|
+
}
|
|
7218
|
+
if ((hasAnimationProp || groupName) && animationDriver != null && animationDriver.avoidReRenders) {
|
|
7219
|
+
var styleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
|
|
7220
|
+
stateRef.current.setStateShallow = function(nextOrGetNext) {
|
|
7221
|
+
var prev = NextState.get(stateRef) || state, next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
|
|
7222
|
+
if (!(next === prev || (0, import_is_equal_shallow.isEqualShallow)(prev, next))) {
|
|
7223
|
+
var canAvoidReRender = Object.keys(next).every(function(key3) {
|
|
7224
|
+
return avoidReRenderKeys.has(key3);
|
|
7225
|
+
});
|
|
7226
|
+
if (canAvoidReRender) {
|
|
7227
|
+
var updatedState = {
|
|
7228
|
+
...prev,
|
|
7229
|
+
...next
|
|
7230
|
+
};
|
|
7231
|
+
NextState.set(stateRef, updatedState);
|
|
7232
|
+
var { group, hasDynGroupChildren, unmounted, animation, ...childrenGroupState } = updatedState;
|
|
7233
|
+
if (groupContext && notifyGroupSubscribers(groupContext, stateRef.current.group || null, childrenGroupState), !hasAnimationProp || !styleListener) return;
|
|
7234
|
+
var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp);
|
|
7235
|
+
styleListener(nextStyles.style);
|
|
7236
|
+
} else ogSetStateShallow(next);
|
|
7237
|
+
}
|
|
7238
|
+
}, setStateShallow = function(state2) {
|
|
7239
|
+
var _stateRef_current_setStateShallow, _stateRef_current;
|
|
7240
|
+
(_stateRef_current_setStateShallow = (_stateRef_current = stateRef.current).setStateShallow) === null || _stateRef_current_setStateShallow === void 0 || _stateRef_current_setStateShallow.call(_stateRef_current, state2);
|
|
7147
7241
|
};
|
|
7148
7242
|
}
|
|
7149
|
-
if (props.group && props.untilMeasured === "hide" && !
|
|
7243
|
+
if (props.group && props.untilMeasured === "hide" && !stateRef.current.hasMeasured) {
|
|
7150
7244
|
var _splitStyles;
|
|
7151
7245
|
(_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
|
|
7152
7246
|
}
|
|
7153
|
-
|
|
7247
|
+
splitStyles.dynamicThemeAccess != null && (stateRef.current.isListeningToTheme = splitStyles.dynamicThemeAccess);
|
|
7154
7248
|
var hasRuntimeMediaKeys = splitStyles.hasMedia && splitStyles.hasMedia !== !0, shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || hasRuntimeMediaKeys || noClass && splitStyles.hasMedia === !0, mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
|
|
7155
7249
|
(0, import_useMedia.setMediaShouldUpdate)(componentContext, shouldListenForMedia, mediaListeningKeys);
|
|
7156
7250
|
var { viewProps: viewPropsIn, pseudos, style: splitStylesStyle, classNames, space } = splitStyles, propsWithAnimation = props, {
|
|
@@ -7203,18 +7297,18 @@ var require_createComponent_native = __commonJS({
|
|
|
7203
7297
|
});
|
|
7204
7298
|
animations && (animationStyles = animations.style, viewProps.style = animationStyles, animations.className && (viewProps.className = `${state.unmounted === "should-enter" ? "t_unmounted " : ""}${viewProps.className || ""} ${animations.className}`), animations.ref && (animatedRef = animations.ref));
|
|
7205
7299
|
}
|
|
7206
|
-
|
|
7207
|
-
var layout = e.nativeEvent.layout;
|
|
7208
|
-
|
|
7300
|
+
groupContext && (nonTamaguiProps.onLayout = (0, import_helpers2.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
|
|
7301
|
+
var _stateRef_current_group, layout = e.nativeEvent.layout;
|
|
7302
|
+
groupContext.state.layout = layout, (_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0 || _stateRef_current_group.emit({
|
|
7209
7303
|
layout
|
|
7210
7304
|
}), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
|
|
7211
7305
|
return {
|
|
7212
7306
|
...prev
|
|
7213
7307
|
};
|
|
7214
7308
|
}), stateRef.current.hasMeasured = !0;
|
|
7215
|
-
})), viewProps = ((_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonTamaguiProps, stateRef,
|
|
7309
|
+
})), viewProps = ((_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonTamaguiProps, stateRef, stateRef.current.willHydrate)) || nonTamaguiProps, stateRef.current.composedRef || (stateRef.current.composedRef = (0, import_compose_refs.composeRefs)(function(x) {
|
|
7216
7310
|
return stateRef.current.host = x;
|
|
7217
|
-
}, forwardedRef, import_setElementProps.setElementProps, animatedRef)), viewProps.ref =
|
|
7311
|
+
}, forwardedRef, import_setElementProps.setElementProps, animatedRef)), viewProps.ref = stateRef.current.composedRef;
|
|
7218
7312
|
var { pseudoGroups, mediaGroups } = splitStyles, unPress = function() {
|
|
7219
7313
|
setStateShallow({
|
|
7220
7314
|
press: !1,
|
|
@@ -7242,18 +7336,21 @@ var require_createComponent_native = __commonJS({
|
|
|
7242
7336
|
});
|
|
7243
7337
|
return;
|
|
7244
7338
|
}
|
|
7245
|
-
var dispose = !disabled && (pseudoGroups || mediaGroups) ? (0, import_subscribeToContextGroup.subscribeToContextGroup)({
|
|
7246
|
-
componentContext,
|
|
7247
|
-
setStateShallow,
|
|
7248
|
-
state,
|
|
7249
|
-
mediaGroups,
|
|
7250
|
-
pseudoGroups
|
|
7251
|
-
}) : null;
|
|
7252
7339
|
return function() {
|
|
7253
|
-
|
|
7340
|
+
componentSetStates.delete(setState);
|
|
7254
7341
|
};
|
|
7255
7342
|
}, [
|
|
7256
7343
|
state.unmounted,
|
|
7344
|
+
disabled
|
|
7345
|
+
]), (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
7346
|
+
if (!disabled && !(!pseudoGroups && !mediaGroups) && allGroupContexts) return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
|
|
7347
|
+
groupContext: allGroupContexts,
|
|
7348
|
+
setStateShallow,
|
|
7349
|
+
mediaGroups,
|
|
7350
|
+
pseudoGroups
|
|
7351
|
+
});
|
|
7352
|
+
}, [
|
|
7353
|
+
allGroupContexts,
|
|
7257
7354
|
disabled,
|
|
7258
7355
|
pseudoGroups ? Object.keys([
|
|
7259
7356
|
...pseudoGroups
|
|
@@ -7261,24 +7358,13 @@ var require_createComponent_native = __commonJS({
|
|
|
7261
7358
|
mediaGroups ? Object.keys([
|
|
7262
7359
|
...mediaGroups
|
|
7263
7360
|
]).join("") : 0
|
|
7264
|
-
])
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
pseudo: state,
|
|
7269
|
-
layout: (_curStateRef_group = curStateRef.group) === null || _curStateRef_group === void 0 ? void 0 : _curStateRef_group.layout
|
|
7270
|
-
});
|
|
7271
|
-
var groupContextState = componentContext == null ? void 0 : componentContext.groups;
|
|
7272
|
-
if (groupContextState) {
|
|
7273
|
-
var next = {
|
|
7274
|
-
...groupContextState[groupName],
|
|
7275
|
-
...state
|
|
7276
|
-
};
|
|
7277
|
-
groupContextState[groupName] = next;
|
|
7278
|
-
}
|
|
7279
|
-
}
|
|
7361
|
+
]);
|
|
7362
|
+
var groupEmitter = stateRef.current.group;
|
|
7363
|
+
(0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
7364
|
+
!groupContext || !groupEmitter || notifyGroupSubscribers(groupContext, groupEmitter, state);
|
|
7280
7365
|
}, [
|
|
7281
|
-
|
|
7366
|
+
groupContext,
|
|
7367
|
+
groupEmitter,
|
|
7282
7368
|
state
|
|
7283
7369
|
]);
|
|
7284
7370
|
var runtimePressStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.focusStyle), runtimeFocusVisibleStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.focusVisibleStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || runtimeFocusVisibleStyle || onFocus || onBlur || componentContext.setParentFocusState), hasDynamicGroupChildren = !!(groupName && state.hasDynGroupChildren), attachPress = !!(hasDynamicGroupChildren || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || pseudos != null && pseudos.focusVisibleStyle), runtimeHoverStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(hasDynamicGroupChildren || runtimeHoverStyle), attachHover = import_constants.isWeb && !!(hasDynamicGroupChildren || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(hasDynamicGroupChildren || runtimePressStyle), events = shouldAttach ? {
|
|
@@ -7292,7 +7378,7 @@ var require_createComponent_native = __commonJS({
|
|
|
7292
7378
|
},
|
|
7293
7379
|
onMouseLeave: function(e) {
|
|
7294
7380
|
var next = {};
|
|
7295
|
-
needsHoverState && (next.hover = !1), needsPressState &&
|
|
7381
|
+
needsHoverState && (next.hover = !1), needsPressState && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut == null || onHoverOut(e), onMouseLeave == null || onMouseLeave(e);
|
|
7296
7382
|
}
|
|
7297
7383
|
},
|
|
7298
7384
|
onPressIn: attachPress ? function(e) {
|
|
@@ -7311,24 +7397,16 @@ var require_createComponent_native = __commonJS({
|
|
|
7311
7397
|
},
|
|
7312
7398
|
...attachFocus && {
|
|
7313
7399
|
onFocus: function(e) {
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
}), pseudos != null && pseudos.focusVisibleStyle ? setTimeout(function() {
|
|
7317
|
-
setStateShallow({
|
|
7318
|
-
focus: !0,
|
|
7319
|
-
focusVisible: !!lastInteractionWasKeyboard.value
|
|
7320
|
-
});
|
|
7321
|
-
}, 0) : setStateShallow({
|
|
7322
|
-
focus: !0,
|
|
7323
|
-
focusVisible: !1
|
|
7324
|
-
}), onFocus == null || onFocus(e);
|
|
7400
|
+
var next = {};
|
|
7401
|
+
componentContext.setParentFocusState && (next.focusWithin = !0), pseudos != null && pseudos.focusVisibleStyle && lastInteractionWasKeyboard.value ? next.focusVisible = !0 : next.focus = !0, setStateShallow(next), onFocus == null || onFocus(e);
|
|
7325
7402
|
},
|
|
7326
7403
|
onBlur: function(e) {
|
|
7327
7404
|
componentContext.setParentFocusState && componentContext.setParentFocusState({
|
|
7328
7405
|
focusWithin: !1
|
|
7329
7406
|
}), setStateShallow({
|
|
7330
7407
|
focus: !1,
|
|
7331
|
-
focusVisible: !1
|
|
7408
|
+
focusVisible: !1,
|
|
7409
|
+
focusWithin: !1
|
|
7332
7410
|
}), onBlur == null || onBlur(e);
|
|
7333
7411
|
}
|
|
7334
7412
|
}
|
|
@@ -7363,37 +7441,15 @@ var require_createComponent_native = __commonJS({
|
|
|
7363
7441
|
var useChildrenResult;
|
|
7364
7442
|
import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(elementType, content, viewProps)), useChildrenResult ? content = useChildrenResult : content = /* @__PURE__ */ import_react3.default.createElement(elementType, viewProps, content);
|
|
7365
7443
|
var ResetPresence = config == null || (_config_animations = config.animations) === null || _config_animations === void 0 ? void 0 : _config_animations.ResetPresence;
|
|
7366
|
-
ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ResetPresence, {
|
|
7444
|
+
if (ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ResetPresence, {
|
|
7367
7445
|
children: content
|
|
7368
|
-
}))
|
|
7369
|
-
var groupState = curStateRef.group, subGroupContext = import_react3.default.useMemo(function() {
|
|
7370
|
-
var _splitStyles_style, _splitStyles_style1;
|
|
7371
|
-
if (!(!groupState || !groupName)) return groupState.listeners.clear(), {
|
|
7372
|
-
...componentContext.groups,
|
|
7373
|
-
// change reference so as we mutate it doesn't affect siblings etc
|
|
7374
|
-
state: {
|
|
7375
|
-
...componentContext.groups.state,
|
|
7376
|
-
[groupName]: {
|
|
7377
|
-
pseudo: import_defaultComponentState.defaultComponentStateMounted,
|
|
7378
|
-
// capture just initial width and height if they exist
|
|
7379
|
-
// will have top, left, width, height (not x, y)
|
|
7380
|
-
layout: {
|
|
7381
|
-
width: fromPx((_splitStyles_style = splitStyles.style) === null || _splitStyles_style === void 0 ? void 0 : _splitStyles_style.width),
|
|
7382
|
-
height: fromPx((_splitStyles_style1 = splitStyles.style) === null || _splitStyles_style1 === void 0 ? void 0 : _splitStyles_style1.height)
|
|
7383
|
-
}
|
|
7384
|
-
}
|
|
7385
|
-
},
|
|
7386
|
-
emit: groupState.emit,
|
|
7387
|
-
subscribe: groupState.subscribe
|
|
7388
|
-
};
|
|
7389
|
-
}, [
|
|
7390
|
-
groupName
|
|
7391
|
-
]);
|
|
7392
|
-
if (("group" in props || propsIn.focusWithinStyle) && (content = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ComponentContext.ComponentContext.Provider, {
|
|
7446
|
+
})), "focusWithinStyle" in propsIn && (content = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ComponentContext.ComponentContext.Provider, {
|
|
7393
7447
|
...componentContext,
|
|
7394
|
-
groups: subGroupContext,
|
|
7395
7448
|
setParentFocusState: setStateShallow,
|
|
7396
7449
|
children: content
|
|
7450
|
+
})), "group" in props && (content = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_GroupContext.GroupContext.Provider, {
|
|
7451
|
+
value: allGroupContexts,
|
|
7452
|
+
children: content
|
|
7397
7453
|
})), content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1, stateRef), staticConfig.context) {
|
|
7398
7454
|
var contextProps = staticConfig.context.props;
|
|
7399
7455
|
for (var key1 in contextProps) if (viewProps.style && key1 in viewProps.style || key1 in viewProps) {
|
|
@@ -7419,6 +7475,15 @@ var require_createComponent_native = __commonJS({
|
|
|
7419
7475
|
}
|
|
7420
7476
|
return content;
|
|
7421
7477
|
});
|
|
7478
|
+
function notifyGroupSubscribers(groupContext, groupEmitter, pseudo) {
|
|
7479
|
+
if (!(!groupContext || !groupEmitter)) {
|
|
7480
|
+
var nextState = {
|
|
7481
|
+
...groupContext.state,
|
|
7482
|
+
pseudo
|
|
7483
|
+
};
|
|
7484
|
+
groupEmitter.emit(nextState), groupContext.state = nextState;
|
|
7485
|
+
}
|
|
7486
|
+
}
|
|
7422
7487
|
staticConfig.componentName && (component.displayName = staticConfig.componentName);
|
|
7423
7488
|
var res = component;
|
|
7424
7489
|
(process.env.TAMAGUI_FORCE_MEMO || staticConfig.memo) && (res = /* @__PURE__ */ import_react3.default.memo(res)), res.staticConfig = staticConfig;
|
|
@@ -9188,13 +9253,8 @@ var require_useConfiguration_native = __commonJS({
|
|
|
9188
9253
|
}
|
|
9189
9254
|
});
|
|
9190
9255
|
module2.exports = __toCommonJS2(useConfiguration_exports);
|
|
9191
|
-
var import_react3 = __toESM2(require("react")),
|
|
9192
|
-
|
|
9193
|
-
return {
|
|
9194
|
-
...restConfig,
|
|
9195
|
-
...restComponentConfig,
|
|
9196
|
-
animationDriver: animationDriver ?? (0, import_config.getConfig)().animations
|
|
9197
|
-
};
|
|
9256
|
+
var import_react3 = __toESM2(require("react")), import_ComponentContext = require_ComponentContext_native(), useConfiguration = function() {
|
|
9257
|
+
return import_react3.default.useContext(import_ComponentContext.ComponentContext);
|
|
9198
9258
|
};
|
|
9199
9259
|
}
|
|
9200
9260
|
});
|
|
@@ -9361,7 +9421,7 @@ var require_useProps_native = __commonJS({
|
|
|
9361
9421
|
}
|
|
9362
9422
|
});
|
|
9363
9423
|
module2.exports = __toCommonJS2(useProps_exports);
|
|
9364
|
-
var import_constants = require_index_native2(), 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();
|
|
9424
|
+
var import_constants = require_index_native2(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_GroupContext = require_GroupContext_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();
|
|
9365
9425
|
function useProps(props, opts) {
|
|
9366
9426
|
var [propsOut, styleOut] = usePropsAndStyle(props, {
|
|
9367
9427
|
...opts,
|
|
@@ -9385,7 +9445,7 @@ var require_useProps_native = __commonJS({
|
|
|
9385
9445
|
needsUpdate() {
|
|
9386
9446
|
return !0;
|
|
9387
9447
|
}
|
|
9388
|
-
}), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), { state, disabled, setStateShallow } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, (0, import_config.getConfig)()), mediaStateNow = opts != null && opts.noMedia ? (
|
|
9448
|
+
}), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), groupContext = import_react3.default.useContext(import_GroupContext.GroupContext), { state, disabled, setStateShallow } = (0, import_useComponentState.useComponentState)(props, componentContext.animationDriver, staticConfig, (0, import_config.getConfig)()), mediaStateNow = opts != null && opts.noMedia ? (
|
|
9389
9449
|
// not safe to use mediaState but really marginal to hit this
|
|
9390
9450
|
import_useMedia.mediaState
|
|
9391
9451
|
) : (0, import_useMedia.useMedia)(), splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, (themeState == null ? void 0 : themeState.name) || "", state, {
|
|
@@ -9396,7 +9456,7 @@ var require_useProps_native = __commonJS({
|
|
|
9396
9456
|
noClass: !0,
|
|
9397
9457
|
resolveValues: "auto",
|
|
9398
9458
|
...opts
|
|
9399
|
-
}, null, componentContext), { mediaGroups, pseudoGroups } = splitStyles;
|
|
9459
|
+
}, null, componentContext, groupContext), { mediaGroups, pseudoGroups } = splitStyles;
|
|
9400
9460
|
return (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
9401
9461
|
if (!disabled) {
|
|
9402
9462
|
if (state.unmounted) {
|
|
@@ -9405,16 +9465,16 @@ var require_useProps_native = __commonJS({
|
|
|
9405
9465
|
});
|
|
9406
9466
|
return;
|
|
9407
9467
|
}
|
|
9408
|
-
return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
|
|
9409
|
-
|
|
9468
|
+
if (groupContext) return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
|
|
9469
|
+
groupContext,
|
|
9410
9470
|
setStateShallow,
|
|
9411
|
-
state,
|
|
9412
9471
|
mediaGroups,
|
|
9413
9472
|
pseudoGroups
|
|
9414
9473
|
});
|
|
9415
9474
|
}
|
|
9416
9475
|
}, [
|
|
9417
9476
|
disabled,
|
|
9477
|
+
groupContext,
|
|
9418
9478
|
pseudoGroups ? Object.keys([
|
|
9419
9479
|
...pseudoGroups
|
|
9420
9480
|
]).join("") : 0,
|
|
@@ -10156,10 +10216,11 @@ var require_index_native9 = __commonJS({
|
|
|
10156
10216
|
var import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native();
|
|
10157
10217
|
__reExport2(index_exports2, require_constants_native2(), module2.exports);
|
|
10158
10218
|
__reExport2(index_exports2, require_ComponentContext_native(), module2.exports);
|
|
10219
|
+
__reExport2(index_exports2, require_GroupContext_native(), module2.exports);
|
|
10159
10220
|
__reExport2(index_exports2, require_withStableStyle_native(), module2.exports);
|
|
10160
10221
|
__reExport2(index_exports2, require_createMediaStyle_native(), module2.exports);
|
|
10161
10222
|
__reExport2(index_exports2, require_getShorthandValue_native(), module2.exports);
|
|
10162
|
-
__reExport2(index_exports2,
|
|
10223
|
+
__reExport2(index_exports2, require_index_native5(), module2.exports);
|
|
10163
10224
|
var import_insertStyleRule2 = require_insertStyleRule_native();
|
|
10164
10225
|
__reExport2(index_exports2, require_createStyledContext_native(), module2.exports);
|
|
10165
10226
|
__reExport2(index_exports2, require_expandStyles_native(), module2.exports);
|
|
@@ -11651,7 +11712,7 @@ var require_index_native12 = __commonJS({
|
|
|
11651
11712
|
}
|
|
11652
11713
|
});
|
|
11653
11714
|
module2.exports = __toCommonJS2(index_exports2);
|
|
11654
|
-
var import_constants = require_index_native2(), import_is_equal_shallow =
|
|
11715
|
+
var import_constants = require_index_native2(), import_is_equal_shallow = require_index_native5(), LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), strategy = "async";
|
|
11655
11716
|
function setOnLayoutStrategy2(state) {
|
|
11656
11717
|
strategy = state;
|
|
11657
11718
|
}
|
|
@@ -11693,7 +11754,9 @@ var require_index_native12 = __commonJS({
|
|
|
11693
11754
|
} else nodeRect = node.getBoundingClientRect(), parentRect = parentNode.getBoundingClientRect();
|
|
11694
11755
|
var cachedRect = NodeRectCache.get(node), cachedParentRect = NodeRectCache.get(parentNode);
|
|
11695
11756
|
if (!cachedRect || // has changed one rect
|
|
11696
|
-
|
|
11757
|
+
// @ts-expect-error DOMRectReadOnly can go into object
|
|
11758
|
+
!(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && // @ts-expect-error DOMRectReadOnly can go into object
|
|
11759
|
+
(!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect))) {
|
|
11697
11760
|
NodeRectCache.set(node, nodeRect), ParentRectCache.set(parentNode, parentRect);
|
|
11698
11761
|
var event = getElementLayoutEvent(nodeRect, parentRect);
|
|
11699
11762
|
avoidUpdates ? queuedUpdates.set(node, function() {
|