@tamagui/core 1.79.12 → 1.79.13
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/cjs/hooks/useElementLayout.js +9 -5
- package/dist/cjs/hooks/useElementLayout.js.map +1 -1
- package/dist/cjs/hooks/useElementLayout.native.js +9 -5
- package/dist/cjs/hooks/useElementLayout.native.js.map +1 -1
- package/dist/cjs/hooks/usePlatformMethods.js +2 -2
- package/dist/cjs/hooks/usePlatformMethods.js.map +1 -1
- package/dist/cjs/hooks/usePlatformMethods.native.js +2 -2
- package/dist/cjs/hooks/usePlatformMethods.native.js.map +1 -1
- package/dist/esm/hooks/useElementLayout.js +9 -5
- package/dist/esm/hooks/useElementLayout.js.map +1 -1
- package/dist/esm/hooks/useElementLayout.native.js +9 -5
- package/dist/esm/hooks/useElementLayout.native.js.map +1 -1
- package/dist/esm/hooks/usePlatformMethods.js +1 -1
- package/dist/esm/hooks/usePlatformMethods.native.js +1 -1
- package/dist/native.js +215 -197
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +204 -188
- package/dist/test.native.js.map +3 -3
- package/package.json +6 -6
- package/src/hooks/useElementLayout.tsx +7 -1
- package/src/hooks/usePlatformMethods.ts +1 -1
- package/types/hooks/useElementLayout.d.ts.map +1 -1
package/dist/test.native.js
CHANGED
|
@@ -692,6 +692,51 @@ var require_index_native = __commonJS({
|
|
|
692
692
|
}
|
|
693
693
|
});
|
|
694
694
|
|
|
695
|
+
// ../simple-hash/dist/cjs/index.native.js
|
|
696
|
+
var require_index_native2 = __commonJS({
|
|
697
|
+
"../simple-hash/dist/cjs/index.native.js"(exports, module2) {
|
|
698
|
+
"use strict";
|
|
699
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
700
|
+
for (var name in all)
|
|
701
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
702
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
703
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
704
|
+
for (let key of __getOwnPropNames2(from))
|
|
705
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
706
|
+
return to;
|
|
707
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
|
|
708
|
+
__export2(src_exports2, {
|
|
709
|
+
simpleHash: () => simpleHash
|
|
710
|
+
});
|
|
711
|
+
module2.exports = __toCommonJS2(src_exports2);
|
|
712
|
+
var cache = /* @__PURE__ */ new Map(), simpleHash = (str, hashMin = 10) => {
|
|
713
|
+
if (cache.has(str))
|
|
714
|
+
return cache.get(str);
|
|
715
|
+
let hash = 0, valids = "", len = str.length;
|
|
716
|
+
for (let i = 0; i < len; i++) {
|
|
717
|
+
let char = str.charCodeAt(i);
|
|
718
|
+
if (hashMin !== "strict" && (char === 46 && (valids += "d0t"), isValidCSSCharCode(char) && len <= hashMin)) {
|
|
719
|
+
valids += str[i];
|
|
720
|
+
continue;
|
|
721
|
+
}
|
|
722
|
+
hash = hashChar(hash, str[i]);
|
|
723
|
+
}
|
|
724
|
+
let res = valids + (hash ? Math.abs(hash) : "");
|
|
725
|
+
return cache.size > 1e4 && cache.clear(), cache.set(str, res), res;
|
|
726
|
+
}, hashChar = (hash, c) => Math.imul(31, hash) + c.charCodeAt(0) | 0;
|
|
727
|
+
function isValidCSSCharCode(code) {
|
|
728
|
+
return (
|
|
729
|
+
// A-Z
|
|
730
|
+
code >= 65 && code <= 90 || // a-z
|
|
731
|
+
code >= 97 && code <= 122 || // _
|
|
732
|
+
code === 95 || // -
|
|
733
|
+
code === 45 || // 0-9
|
|
734
|
+
code >= 48 && code <= 57
|
|
735
|
+
);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
});
|
|
739
|
+
|
|
695
740
|
// ../helpers/dist/cjs/clamp.native.js
|
|
696
741
|
var require_clamp_native = __commonJS({
|
|
697
742
|
"../helpers/dist/cjs/clamp.native.js"(exports, module2) {
|
|
@@ -807,6 +852,20 @@ var require_concatClassName_native = __commonJS({
|
|
|
807
852
|
}
|
|
808
853
|
});
|
|
809
854
|
|
|
855
|
+
// ../helpers/dist/cjs/types.native.js
|
|
856
|
+
var require_types_native2 = __commonJS({
|
|
857
|
+
"../helpers/dist/cjs/types.native.js"(exports, module2) {
|
|
858
|
+
"use strict";
|
|
859
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
860
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
861
|
+
for (let key of __getOwnPropNames2(from))
|
|
862
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
863
|
+
return to;
|
|
864
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), types_exports = {};
|
|
865
|
+
module2.exports = __toCommonJS2(types_exports);
|
|
866
|
+
}
|
|
867
|
+
});
|
|
868
|
+
|
|
810
869
|
// ../constants/dist/cjs/constants.native.js
|
|
811
870
|
var require_constants_native = __commonJS({
|
|
812
871
|
"../constants/dist/cjs/constants.native.js"(exports, module2) {
|
|
@@ -839,7 +898,7 @@ var require_constants_native = __commonJS({
|
|
|
839
898
|
});
|
|
840
899
|
|
|
841
900
|
// ../constants/dist/cjs/index.native.js
|
|
842
|
-
var
|
|
901
|
+
var require_index_native3 = __commonJS({
|
|
843
902
|
"../constants/dist/cjs/index.native.js"(exports, module2) {
|
|
844
903
|
"use strict";
|
|
845
904
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
@@ -880,7 +939,7 @@ var require_validStyleProps_native = __commonJS({
|
|
|
880
939
|
validStylesOnBaseProps: () => validStylesOnBaseProps
|
|
881
940
|
});
|
|
882
941
|
module2.exports = __toCommonJS2(validStyleProps_exports);
|
|
883
|
-
var
|
|
942
|
+
var import_constants3 = require_index_native3(), placeHolderTextColors = {
|
|
884
943
|
placeholderTextColor: !0
|
|
885
944
|
}, validStylesOnBaseProps = {
|
|
886
945
|
...placeHolderTextColors
|
|
@@ -1050,7 +1109,7 @@ var require_validStyleProps_native = __commonJS({
|
|
|
1050
1109
|
...validStylesOnBaseProps,
|
|
1051
1110
|
...stylePropsTransform,
|
|
1052
1111
|
...stylePropsUnitless,
|
|
1053
|
-
...
|
|
1112
|
+
...import_constants3.isAndroid ? { elevationAndroid: !0 } : {}
|
|
1054
1113
|
}, stylePropsFont = {
|
|
1055
1114
|
fontFamily: !0,
|
|
1056
1115
|
fontSize: !0,
|
|
@@ -1083,23 +1142,9 @@ var require_validStyleProps_native = __commonJS({
|
|
|
1083
1142
|
}
|
|
1084
1143
|
});
|
|
1085
1144
|
|
|
1086
|
-
// ../helpers/dist/cjs/
|
|
1087
|
-
var
|
|
1088
|
-
"../helpers/dist/cjs/
|
|
1089
|
-
"use strict";
|
|
1090
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
1091
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1092
|
-
for (let key of __getOwnPropNames2(from))
|
|
1093
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1094
|
-
return to;
|
|
1095
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), types_exports = {};
|
|
1096
|
-
module2.exports = __toCommonJS2(types_exports);
|
|
1097
|
-
}
|
|
1098
|
-
});
|
|
1099
|
-
|
|
1100
|
-
// ../simple-hash/dist/cjs/index.native.js
|
|
1101
|
-
var require_index_native3 = __commonJS({
|
|
1102
|
-
"../simple-hash/dist/cjs/index.native.js"(exports, module2) {
|
|
1145
|
+
// ../helpers/dist/cjs/withStaticProperties.native.js
|
|
1146
|
+
var require_withStaticProperties_native = __commonJS({
|
|
1147
|
+
"../helpers/dist/cjs/withStaticProperties.native.js"(exports, module2) {
|
|
1103
1148
|
"use strict";
|
|
1104
1149
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1105
1150
|
for (var name in all)
|
|
@@ -1109,36 +1154,26 @@ var require_index_native3 = __commonJS({
|
|
|
1109
1154
|
for (let key of __getOwnPropNames2(from))
|
|
1110
1155
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1111
1156
|
return to;
|
|
1112
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
1113
|
-
__export2(
|
|
1114
|
-
|
|
1157
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), withStaticProperties_exports = {};
|
|
1158
|
+
__export2(withStaticProperties_exports, {
|
|
1159
|
+
withStaticProperties: () => withStaticProperties
|
|
1115
1160
|
});
|
|
1116
|
-
module2.exports = __toCommonJS2(
|
|
1117
|
-
var
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1161
|
+
module2.exports = __toCommonJS2(withStaticProperties_exports);
|
|
1162
|
+
var import_react3 = require("react"), Decorated = Symbol(), withStaticProperties = function(component, staticProps) {
|
|
1163
|
+
let next = (() => {
|
|
1164
|
+
if (component[Decorated]) {
|
|
1165
|
+
let _ = (0, import_react3.forwardRef)(
|
|
1166
|
+
(props, ref) => (0, import_react3.createElement)(component, { ...props, ref })
|
|
1167
|
+
);
|
|
1168
|
+
for (let key in component) {
|
|
1169
|
+
let v = component[key];
|
|
1170
|
+
_[key] = v && typeof v == "object" ? { ...v } : v;
|
|
1171
|
+
}
|
|
1126
1172
|
}
|
|
1127
|
-
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
}, hashChar = (hash, c) => Math.imul(31, hash) + c.charCodeAt(0) | 0;
|
|
1132
|
-
function isValidCSSCharCode(code) {
|
|
1133
|
-
return (
|
|
1134
|
-
// A-Z
|
|
1135
|
-
code >= 65 && code <= 90 || // a-z
|
|
1136
|
-
code >= 97 && code <= 122 || // _
|
|
1137
|
-
code === 95 || // -
|
|
1138
|
-
code === 45 || // 0-9
|
|
1139
|
-
code >= 48 && code <= 57
|
|
1140
|
-
);
|
|
1141
|
-
}
|
|
1173
|
+
return component;
|
|
1174
|
+
})();
|
|
1175
|
+
return Object.assign(next, staticProps), next[Decorated] = !0, next;
|
|
1176
|
+
};
|
|
1142
1177
|
}
|
|
1143
1178
|
});
|
|
1144
1179
|
|
|
@@ -1153,12 +1188,13 @@ var require_index_native4 = __commonJS({
|
|
|
1153
1188
|
return to;
|
|
1154
1189
|
}, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
|
|
1155
1190
|
module2.exports = __toCommonJS2(src_exports2);
|
|
1191
|
+
__reExport2(src_exports2, require_index_native2(), module2.exports);
|
|
1156
1192
|
__reExport2(src_exports2, require_clamp_native(), module2.exports);
|
|
1157
1193
|
__reExport2(src_exports2, require_composeEventHandlers_native(), module2.exports);
|
|
1158
1194
|
__reExport2(src_exports2, require_concatClassName_native(), module2.exports);
|
|
1159
|
-
__reExport2(src_exports2, require_validStyleProps_native(), module2.exports);
|
|
1160
1195
|
__reExport2(src_exports2, require_types_native2(), module2.exports);
|
|
1161
|
-
__reExport2(src_exports2,
|
|
1196
|
+
__reExport2(src_exports2, require_validStyleProps_native(), module2.exports);
|
|
1197
|
+
__reExport2(src_exports2, require_withStaticProperties_native(), module2.exports);
|
|
1162
1198
|
}
|
|
1163
1199
|
});
|
|
1164
1200
|
|
|
@@ -1194,7 +1230,7 @@ var require_config_native = __commonJS({
|
|
|
1194
1230
|
useTokens: () => useTokens
|
|
1195
1231
|
});
|
|
1196
1232
|
module2.exports = __toCommonJS2(config_exports);
|
|
1197
|
-
var
|
|
1233
|
+
var import_constants3 = require_index_native3(), conf, setConfig = (next) => {
|
|
1198
1234
|
conf = next, configListeners.forEach((cb) => cb(next));
|
|
1199
1235
|
}, setConfigFont = (name, font, fontParsed) => {
|
|
1200
1236
|
conf.fonts[name] = font, conf.fontsParsed[`$${name}`] = fontParsed;
|
|
@@ -1216,7 +1252,7 @@ var require_config_native = __commonJS({
|
|
|
1216
1252
|
}, getTokenObject = (value, group) => {
|
|
1217
1253
|
var _a, _b;
|
|
1218
1254
|
return conf.specificTokens[value] ?? (group ? (_a = tokensMerged[group]) == null ? void 0 : _a[value] : (_b = tokensMerged[Object.keys(tokensMerged).find((cat) => tokensMerged[cat][value]) || ""]) == null ? void 0 : _b[value]);
|
|
1219
|
-
}, getToken2 = (value, group, useVariable =
|
|
1255
|
+
}, getToken2 = (value, group, useVariable = import_constants3.isWeb) => {
|
|
1220
1256
|
let token = getTokenObject(value, group);
|
|
1221
1257
|
return useVariable ? token == null ? void 0 : token.variable : token == null ? void 0 : token.val;
|
|
1222
1258
|
}, getTokenValue2 = (value, group) => getToken2(value, group, !1), useTokens = getTokens2, getThemes2 = () => conf.themes, configListeners = /* @__PURE__ */ new Set(), onConfiguredOnce = (cb) => {
|
|
@@ -1264,7 +1300,7 @@ var require_createVariable_native = __commonJS({
|
|
|
1264
1300
|
variableToString: () => variableToString
|
|
1265
1301
|
});
|
|
1266
1302
|
module2.exports = __toCommonJS2(createVariable_exports);
|
|
1267
|
-
var
|
|
1303
|
+
var import_constants3 = require_index_native3(), import_helpers = require_index_native4(), import_config = require_config_native(), IS_VAR = "isVar", createVariable = (props, skipHash = !1) => {
|
|
1268
1304
|
if (!skipHash && isVariable(props))
|
|
1269
1305
|
return props;
|
|
1270
1306
|
let { key, name, val } = props;
|
|
@@ -1273,11 +1309,11 @@ var require_createVariable_native = __commonJS({
|
|
|
1273
1309
|
key,
|
|
1274
1310
|
name: skipHash ? "" : (0, import_helpers.simpleHash)(name, 40),
|
|
1275
1311
|
val,
|
|
1276
|
-
variable:
|
|
1312
|
+
variable: import_constants3.isWeb ? skipHash ? `var(--${name})` : createCSSVariable(name) : ""
|
|
1277
1313
|
};
|
|
1278
1314
|
};
|
|
1279
1315
|
function variableToString(vrble, getValue = !1) {
|
|
1280
|
-
return isVariable(vrble) ? !getValue &&
|
|
1316
|
+
return isVariable(vrble) ? !getValue && import_constants3.isWeb && vrble.variable ? vrble.variable : `${vrble.val}` : `${vrble || ""}`;
|
|
1281
1317
|
}
|
|
1282
1318
|
function isVariable(v) {
|
|
1283
1319
|
return v && typeof v == "object" && IS_VAR in v;
|
|
@@ -1330,7 +1366,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1330
1366
|
updateRules: () => updateRules
|
|
1331
1367
|
});
|
|
1332
1368
|
module2.exports = __toCommonJS2(insertStyleRule_exports);
|
|
1333
|
-
var
|
|
1369
|
+
var import_constants3 = require_index_native3(), import_createVariable = require_createVariable_native(), scannedCache = /* @__PURE__ */ new WeakMap(), totalSelectorsInserted = /* @__PURE__ */ new Map(), allSelectors = {}, allRules = {}, insertedTransforms = {}, getAllSelectors = () => allSelectors, getAllRules = () => Object.values(allRules), getAllTransforms = () => insertedTransforms;
|
|
1334
1370
|
function addTransform(identifier, css, rule) {
|
|
1335
1371
|
let s = css.indexOf("transform:");
|
|
1336
1372
|
if (s === -1)
|
|
@@ -1340,7 +1376,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1340
1376
|
return insertedTransforms[identifier] = value, !0;
|
|
1341
1377
|
}
|
|
1342
1378
|
function listenForSheetChanges() {
|
|
1343
|
-
|
|
1379
|
+
import_constants3.isClient && new MutationObserver((entries) => {
|
|
1344
1380
|
for (let entry of entries)
|
|
1345
1381
|
if (entry instanceof HTMLStyleElement && entry.sheet || entry instanceof HTMLLinkElement && entry.href.endsWith(".css")) {
|
|
1346
1382
|
break;
|
|
@@ -1457,7 +1493,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1457
1493
|
var getIdentifierFromTamaguiSelector = (selector) => {
|
|
1458
1494
|
let res = selector.slice(7);
|
|
1459
1495
|
return selector.includes(":") ? res.replace(/:[a-z]+$/, "") : res;
|
|
1460
|
-
}, sheet =
|
|
1496
|
+
}, sheet = import_constants3.isClient ? document.head.appendChild(document.createElement("style")).sheet : null;
|
|
1461
1497
|
function updateRules(identifier, rules) {
|
|
1462
1498
|
return identifier in allRules ? !1 : (allRules[identifier] = rules.join(" "), identifier.startsWith("_transform") ? addTransform(identifier, rules[0]) : !0);
|
|
1463
1499
|
}
|
|
@@ -1478,11 +1514,12 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1478
1514
|
}
|
|
1479
1515
|
}
|
|
1480
1516
|
}
|
|
1517
|
+
var minInsertAmt = process.env.TAMAGUI_INSERT_SELECTOR_TRIES ? +process.env.TAMAGUI_INSERT_SELECTOR_TRIES : 2;
|
|
1481
1518
|
function shouldInsertStyleRules(identifier) {
|
|
1482
1519
|
if (process.env.IS_STATIC === "is_static")
|
|
1483
1520
|
return !0;
|
|
1484
1521
|
let total = totalSelectorsInserted.get(identifier);
|
|
1485
|
-
return total === void 0 || total <
|
|
1522
|
+
return total === void 0 || total < minInsertAmt;
|
|
1486
1523
|
}
|
|
1487
1524
|
}
|
|
1488
1525
|
});
|
|
@@ -1695,20 +1732,14 @@ var require_ComponentContext_native = __commonJS({
|
|
|
1695
1732
|
ComponentContext: () => ComponentContext
|
|
1696
1733
|
});
|
|
1697
1734
|
module2.exports = __toCommonJS2(ComponentContext_exports);
|
|
1698
|
-
var import_createStyledContext = require_createStyledContext_native(),
|
|
1735
|
+
var import_createStyledContext = require_createStyledContext_native(), ComponentContext = (0, import_createStyledContext.createStyledContext)({
|
|
1699
1736
|
disableSSR: void 0,
|
|
1700
1737
|
inText: !1,
|
|
1701
1738
|
language: null,
|
|
1702
1739
|
animationDriver: null,
|
|
1703
1740
|
groups: {
|
|
1704
|
-
emit:
|
|
1705
|
-
|
|
1706
|
-
},
|
|
1707
|
-
subscribe(cb) {
|
|
1708
|
-
return listeners.add(cb), () => {
|
|
1709
|
-
listeners.delete(cb);
|
|
1710
|
-
};
|
|
1711
|
-
},
|
|
1741
|
+
emit: null,
|
|
1742
|
+
subscribe: null,
|
|
1712
1743
|
state: {}
|
|
1713
1744
|
}
|
|
1714
1745
|
});
|
|
@@ -1776,7 +1807,7 @@ var require_useMedia_native = __commonJS({
|
|
|
1776
1807
|
useMediaListeners: () => useMediaListeners
|
|
1777
1808
|
});
|
|
1778
1809
|
module2.exports = __toCommonJS2(useMedia_exports);
|
|
1779
|
-
var
|
|
1810
|
+
var import_constants3 = require_index_native3(), import_react3 = require("react"), import_config = require_config_native(), import_createProxy = require_createProxy_native(), import_matchMedia = require_matchMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_useDisableSSR = require_useDisableSSR_native(), mediaState2 = {}, mediaQueryConfig2 = {}, getMedia2 = () => mediaState2, mediaKeys = /* @__PURE__ */ new Set(), isMediaKey = (key) => {
|
|
1780
1811
|
if (mediaKeys.has(key))
|
|
1781
1812
|
return !0;
|
|
1782
1813
|
if (key[0] === "$") {
|
|
@@ -1820,7 +1851,7 @@ var require_useMedia_native = __commonJS({
|
|
|
1820
1851
|
}
|
|
1821
1852
|
}
|
|
1822
1853
|
function useMediaListeners(config) {
|
|
1823
|
-
config.disableSSR || (0,
|
|
1854
|
+
config.disableSSR || (0, import_constants3.useIsomorphicLayoutEffect)(() => {
|
|
1824
1855
|
setupMediaListeners();
|
|
1825
1856
|
}, []);
|
|
1826
1857
|
}
|
|
@@ -1838,7 +1869,7 @@ var require_useMedia_native = __commonJS({
|
|
|
1838
1869
|
return listeners.add(subscriber), () => listeners.delete(subscriber);
|
|
1839
1870
|
}
|
|
1840
1871
|
function useMedia2(uid, componentContext) {
|
|
1841
|
-
let internal = (0, import_react3.useRef)(), initialState = ((componentContext ? (0, import_useDisableSSR.getDisableSSR)(componentContext) : (0, import_useDisableSSR.useDisableSSR)()) || !
|
|
1872
|
+
let internal = (0, import_react3.useRef)(), initialState = ((componentContext ? (0, import_useDisableSSR.getDisableSSR)(componentContext) : (0, import_useDisableSSR.useDisableSSR)()) || !import_constants3.isWeb ? mediaState2 : initState) || {}, state = (0, import_react3.useSyncExternalStore)(
|
|
1842
1873
|
subscribe,
|
|
1843
1874
|
() => {
|
|
1844
1875
|
if (!internal.current)
|
|
@@ -2832,10 +2863,10 @@ var require_normalizeColor_native = __commonJS({
|
|
|
2832
2863
|
rgba: () => import_normalize_css_color2.rgba
|
|
2833
2864
|
});
|
|
2834
2865
|
module2.exports = __toCommonJS2(normalizeColor_exports);
|
|
2835
|
-
var
|
|
2866
|
+
var import_constants3 = require_index_native3(), import_normalize_css_color = require_index_native7(), import_normalize_css_color2 = require_index_native7(), normalizeColor = (color, opacity) => {
|
|
2836
2867
|
if (!color)
|
|
2837
2868
|
return;
|
|
2838
|
-
if (color[0] === "$" || color[0] === "v" && color.startsWith("var(") ||
|
|
2869
|
+
if (color[0] === "$" || color[0] === "v" && color.startsWith("var(") || import_constants3.isWeb && opacity === 1)
|
|
2839
2870
|
return color;
|
|
2840
2871
|
let colorProcessed = (0, import_normalize_css_color.normalizeCSSColor)(color);
|
|
2841
2872
|
if (colorProcessed != null) {
|
|
@@ -2864,13 +2895,13 @@ var require_normalizeValueWithProperty_native = __commonJS({
|
|
|
2864
2895
|
reverseMapClassNameToValue: () => reverseMapClassNameToValue
|
|
2865
2896
|
});
|
|
2866
2897
|
module2.exports = __toCommonJS2(normalizeValueWithProperty_exports);
|
|
2867
|
-
var
|
|
2898
|
+
var import_constants3 = require_index_native3(), import_helpers = require_index_native4(), import_insertStyleRule = require_insertStyleRule_native(), stylePropsAllPlusTransforms = {
|
|
2868
2899
|
...import_helpers.stylePropsAll,
|
|
2869
2900
|
translateX: !0,
|
|
2870
2901
|
translateY: !0
|
|
2871
2902
|
};
|
|
2872
2903
|
function normalizeValueWithProperty(value, property) {
|
|
2873
|
-
if (!
|
|
2904
|
+
if (!import_constants3.isWeb || typeof value == "boolean" || property && property in import_helpers.stylePropsUnitless || property && !(property in stylePropsAllPlusTransforms))
|
|
2874
2905
|
return value;
|
|
2875
2906
|
let res = value;
|
|
2876
2907
|
return value && typeof value == "object" ? value : (typeof value == "number" ? res = `${value}px` : property && (res = `${res}`), res);
|
|
@@ -2946,13 +2977,13 @@ var require_expandStyles_native = __commonJS({
|
|
|
2946
2977
|
fixStyles: () => fixStyles
|
|
2947
2978
|
});
|
|
2948
2979
|
module2.exports = __toCommonJS2(expandStyles_exports);
|
|
2949
|
-
var
|
|
2980
|
+
var import_constants3 = require_index_native3(), import_normalizeShadow = require_normalizeShadow_native();
|
|
2950
2981
|
function fixStyles(style) {
|
|
2951
2982
|
"elevationAndroid" in style && (style.elevation = style.elevationAndroid, delete style.elevationAndroid), (style.shadowRadius || style.shadowColor || style.shadowOpacity || style.shadowOffset) && Object.assign(style, (0, import_normalizeShadow.normalizeShadow)(style));
|
|
2952
2983
|
for (let key in borderDefaults)
|
|
2953
2984
|
key in style && !style[borderDefaults[key]] && (style[borderDefaults[key]] = "solid");
|
|
2954
2985
|
}
|
|
2955
|
-
var nativeStyle =
|
|
2986
|
+
var nativeStyle = import_constants3.isWeb ? null : "borderStyle", borderDefaults = {
|
|
2956
2987
|
borderWidth: "borderStyle",
|
|
2957
2988
|
borderBottomWidth: nativeStyle || "borderBottomStyle",
|
|
2958
2989
|
borderTopWidth: nativeStyle || "borderTopStyle",
|
|
@@ -3028,14 +3059,14 @@ var require_expandStyle_native = __commonJS({
|
|
|
3028
3059
|
expandStyle: () => expandStyle
|
|
3029
3060
|
});
|
|
3030
3061
|
module2.exports = __toCommonJS2(expandStyle_exports);
|
|
3031
|
-
var
|
|
3062
|
+
var import_constants3 = require_index_native3();
|
|
3032
3063
|
function expandStyle(key, value) {
|
|
3033
3064
|
if (!1)
|
|
3034
3065
|
switch (key) {
|
|
3035
3066
|
case "textAlignVertical":
|
|
3036
3067
|
case "writingDirection":
|
|
3037
3068
|
}
|
|
3038
|
-
if (
|
|
3069
|
+
if (import_constants3.isAndroid && key === "elevationAndroid")
|
|
3039
3070
|
return [["elevation", value]];
|
|
3040
3071
|
if (key in EXPANSIONS)
|
|
3041
3072
|
return EXPANSIONS[key].map((key2) => [key2, value]);
|
|
@@ -3056,7 +3087,7 @@ var require_expandStyle_native = __commonJS({
|
|
|
3056
3087
|
padding: all,
|
|
3057
3088
|
paddingHorizontal: horiz,
|
|
3058
3089
|
paddingVertical: vert,
|
|
3059
|
-
...
|
|
3090
|
+
...import_constants3.isWeb && {
|
|
3060
3091
|
// react-native only supports borderStyle
|
|
3061
3092
|
borderStyle: ["TopStyle", "RightStyle", "BottomStyle", "LeftStyle"],
|
|
3062
3093
|
// react-native doesn't support X / Y
|
|
@@ -3212,9 +3243,9 @@ var require_propMapper_native = __commonJS({
|
|
|
3212
3243
|
propMapper: () => propMapper
|
|
3213
3244
|
});
|
|
3214
3245
|
module2.exports = __toCommonJS2(propMapper_exports);
|
|
3215
|
-
var
|
|
3246
|
+
var import_constants3 = require_index_native3(), import_helpers = require_index_native4(), import_config = require_config_native(), import_isDevTools = require_isDevTools_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_expandStylesAndRemoveNullishValues = require_expandStylesAndRemoveNullishValues_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), propMapper = (key, value, styleStateIn, subPropsIn) => {
|
|
3216
3247
|
var _a;
|
|
3217
|
-
if (!
|
|
3248
|
+
if (!import_constants3.isAndroid && key === "elevationAndroid")
|
|
3218
3249
|
return;
|
|
3219
3250
|
if (value === "unset") {
|
|
3220
3251
|
let unsetVal = (_a = styleStateIn.conf.unset) == null ? void 0 : _a[key];
|
|
@@ -3426,9 +3457,9 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3426
3457
|
useSplitStyles: () => useSplitStyles
|
|
3427
3458
|
});
|
|
3428
3459
|
module2.exports = __toCommonJS2(getSplitStyles_exports);
|
|
3429
|
-
var
|
|
3460
|
+
var import_constants3 = require_index_native3(), import_helpers = require_index_native4(), import_react3 = require("react"), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-", getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
|
|
3430
3461
|
var _a, _b, _c, _e, _f, _g;
|
|
3431
|
-
conf = conf || (0, import_config.getConfig)(),
|
|
3462
|
+
conf = conf || (0, import_config.getConfig)(), import_constants3.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
3432
3463
|
let { shorthands } = conf, {
|
|
3433
3464
|
isHOC,
|
|
3434
3465
|
isText,
|
|
@@ -3438,7 +3469,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3438
3469
|
inlineWhenUnflattened,
|
|
3439
3470
|
parentStaticConfig,
|
|
3440
3471
|
acceptsClassName
|
|
3441
|
-
} = staticConfig, validStyleProps = isText ? import_helpers.stylePropsText : import_helpers.validStyles, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName &&
|
|
3472
|
+
} = staticConfig, validStyleProps = isText ? import_helpers.stylePropsText : import_helpers.validStyles, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants3.isWeb && !styleProps.noClassNames, rulesToInsert = [], classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, style = {}, className = "", mediaStylesSeen = 0, styleState = {
|
|
3442
3473
|
curProps: { ...props },
|
|
3443
3474
|
classNames,
|
|
3444
3475
|
conf,
|
|
@@ -3458,7 +3489,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3458
3489
|
if (styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || keyInit in skipProps && !isHOC)
|
|
3459
3490
|
continue;
|
|
3460
3491
|
let valInitType = typeof valInit;
|
|
3461
|
-
if (styleState.curProps[keyInit] = valInit, !
|
|
3492
|
+
if (styleState.curProps[keyInit] = valInit, !import_constants3.isAndroid && keyInit === "elevationAndroid")
|
|
3462
3493
|
continue;
|
|
3463
3494
|
if (keyInit === "userSelect")
|
|
3464
3495
|
keyInit = "selectable", valInit = valInit !== "none";
|
|
@@ -3550,7 +3581,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3550
3581
|
`${psuedoStyle.property}${PROP_SPLIT}${descriptor.name}` in usedKeys || psuedoStyle.identifier;
|
|
3551
3582
|
} else {
|
|
3552
3583
|
let descriptorKey = descriptor.stateKey || descriptor.name, pseudoState = componentState[descriptorKey], isDisabled = isExit ? !styleProps.isExiting : !pseudoState;
|
|
3553
|
-
|
|
3584
|
+
import_constants3.isWeb && !import_constants3.isClient && isEnter && (isDisabled = !1);
|
|
3554
3585
|
let importance = descriptor.priority;
|
|
3555
3586
|
for (let pkey in pseudoStyleObject) {
|
|
3556
3587
|
let val2 = pseudoStyleObject[pkey];
|
|
@@ -3578,7 +3609,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3578
3609
|
let platform = key.slice(10);
|
|
3579
3610
|
if (
|
|
3580
3611
|
// supports web, ios, android
|
|
3581
|
-
platform !==
|
|
3612
|
+
platform !== import_constants3.currentPlatform && // supports web, native
|
|
3582
3613
|
platform !== "native"
|
|
3583
3614
|
)
|
|
3584
3615
|
continue;
|
|
@@ -3670,7 +3701,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3670
3701
|
if (
|
|
3671
3702
|
// is HOC we can just pass through the styles as props
|
|
3672
3703
|
// this fixes issues where style prop got merged with wrong priority
|
|
3673
|
-
!isHOC && (key in validStyleProps ||
|
|
3704
|
+
!isHOC && (key in validStyleProps || import_constants3.isAndroid && key === "elevation")
|
|
3674
3705
|
) {
|
|
3675
3706
|
mergeStyle(styleState, key, val);
|
|
3676
3707
|
continue;
|
|
@@ -3683,7 +3714,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3683
3714
|
}
|
|
3684
3715
|
}
|
|
3685
3716
|
}
|
|
3686
|
-
if (props.style && mergeStylePropIntoStyle(styleState, props.style), styleProps.noNormalize !== !1 && ((0, import_expandStyles.fixStyles)(style),
|
|
3717
|
+
if (props.style && mergeStylePropIntoStyle(styleState, props.style), styleProps.noNormalize !== !1 && ((0, import_expandStyles.fixStyles)(style), import_constants3.isWeb && !staticConfig.isReactNative && (0, import_getStylesAtomic.styleToCSS)(style), styleState.transforms && Object.entries(styleState.transforms).sort(([a], [b]) => a.localeCompare(b)).forEach(([key, val]) => {
|
|
3687
3718
|
mergeTransform(style, key, val, !0);
|
|
3688
3719
|
}), parentSplitStyles && !shouldDoClasses))
|
|
3689
3720
|
for (let key in parentSplitStyles.style)
|
|
@@ -3717,12 +3748,12 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3717
3748
|
};
|
|
3718
3749
|
function mergeStyle(styleState, key, val, disableNormalize = !1) {
|
|
3719
3750
|
let { classNames, viewProps, style, usedKeys, styleProps } = styleState;
|
|
3720
|
-
if (
|
|
3751
|
+
if (import_constants3.isWeb && (val == null ? void 0 : val[0]) === "_")
|
|
3721
3752
|
classNames[key] = val, usedKeys[key] ||= 1;
|
|
3722
3753
|
else if (key in import_helpers.stylePropsTransform)
|
|
3723
3754
|
styleState.transforms ||= {}, styleState.transforms[key] = val;
|
|
3724
3755
|
else {
|
|
3725
|
-
let out =
|
|
3756
|
+
let out = import_constants3.isWeb && !disableNormalize && !styleProps.noNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
|
|
3726
3757
|
key in import_helpers.validStylesOnBaseProps ? viewProps[key] = out : style[key] = out;
|
|
3727
3758
|
}
|
|
3728
3759
|
}
|
|
@@ -3749,7 +3780,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3749
3780
|
Object.assign(isRNW ? styleState.classNames : styleState.style, style);
|
|
3750
3781
|
}
|
|
3751
3782
|
}
|
|
3752
|
-
var useInsertEffectCompat =
|
|
3783
|
+
var useInsertEffectCompat = import_constants3.isWeb ? import_react3.useInsertionEffect || import_constants3.useIsomorphicLayoutEffect : () => {
|
|
3753
3784
|
}, useSplitStyles = (...args) => {
|
|
3754
3785
|
let res = getSplitStyles(...args);
|
|
3755
3786
|
return useInsertEffectCompat(() => {
|
|
@@ -3927,7 +3958,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3927
3958
|
getManagers: () => getManagers
|
|
3928
3959
|
});
|
|
3929
3960
|
module2.exports = __toCommonJS2(ThemeManager_exports);
|
|
3930
|
-
var
|
|
3961
|
+
var import_constants3 = require_index_native3(), import_config = require_config_native(), import_constants22 = require_constants_native2(), emptyState = { name: "" };
|
|
3931
3962
|
function getHasThemeUpdatingProps(props) {
|
|
3932
3963
|
return props.name || props.componentName || props.inverse || props.reset;
|
|
3933
3964
|
}
|
|
@@ -4026,8 +4057,15 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4026
4057
|
potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
|
|
4027
4058
|
}
|
|
4028
4059
|
let found = potentials.find((t) => t in themes);
|
|
4029
|
-
if (typeof props.debug == "string" && console.info("
|
|
4030
|
-
|
|
4060
|
+
if (typeof props.debug == "string" && console.info(" getState ", {
|
|
4061
|
+
found,
|
|
4062
|
+
potentials,
|
|
4063
|
+
baseManager,
|
|
4064
|
+
nextName,
|
|
4065
|
+
baseName,
|
|
4066
|
+
prefix
|
|
4067
|
+
}), found) {
|
|
4068
|
+
let names = found.split("_"), [firstName, ...restNames] = names, lastName = names[names.length - 1], isComponent = lastName[0] === lastName[0].toUpperCase(), scheme = firstName === "light" ? "light" : firstName === "dark" ? "dark" : void 0, pre = import_constants22.THEME_CLASSNAME_PREFIX, className = import_constants3.isWeb ? `${pre}sub_theme ${pre}${!scheme || !restNames.length ? firstName : restNames.join("_")}` : "", parentState = (_a = baseManager || parentManager) == null ? void 0 : _a.state, parentName = parentState == null ? void 0 : parentState.name;
|
|
4031
4069
|
result = {
|
|
4032
4070
|
name: found,
|
|
4033
4071
|
parentName,
|
|
@@ -4094,7 +4132,7 @@ var require_useTheme_native = __commonJS({
|
|
|
4094
4132
|
useThemeWithState: () => useThemeWithState
|
|
4095
4133
|
});
|
|
4096
4134
|
module2.exports = __toCommonJS2(useTheme_exports);
|
|
4097
|
-
var
|
|
4135
|
+
var import_constants3 = require_index_native3(), import_react3 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createProxy = require_createProxy_native(), import_createShallowSetState = require_createShallowSetState_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_getThemeUnwrapped = require_getThemeUnwrapped_native(), emptyProps = { name: null }, cached;
|
|
4098
4136
|
function getDefaultThemeProxied() {
|
|
4099
4137
|
if (cached)
|
|
4100
4138
|
return cached;
|
|
@@ -4109,7 +4147,7 @@ var require_useTheme_native = __commonJS({
|
|
|
4109
4147
|
props,
|
|
4110
4148
|
!1,
|
|
4111
4149
|
keys.current,
|
|
4112
|
-
|
|
4150
|
+
import_constants3.isServer ? void 0 : () => {
|
|
4113
4151
|
var _a, _b;
|
|
4114
4152
|
return ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
|
|
4115
4153
|
}
|
|
@@ -4151,7 +4189,7 @@ var require_useTheme_native = __commonJS({
|
|
|
4151
4189
|
else if (subkey === "get")
|
|
4152
4190
|
return (platform) => {
|
|
4153
4191
|
let outVal = (0, import_createVariable.getVariable)(val);
|
|
4154
|
-
if (platform !== "web" &&
|
|
4192
|
+
if (platform !== "web" && import_constants3.isIos && !deopt && config.settings.fastSchemeChange && !someParentIsInversed(themeManager) && scheme) {
|
|
4155
4193
|
let oppositeThemeName = name.replace(
|
|
4156
4194
|
scheme === "dark" ? "dark" : "light",
|
|
4157
4195
|
scheme === "dark" ? "light" : "dark"
|
|
@@ -4204,7 +4242,7 @@ var require_useTheme_native = __commonJS({
|
|
|
4204
4242
|
if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
|
|
4205
4243
|
return next;
|
|
4206
4244
|
}
|
|
4207
|
-
if (
|
|
4245
|
+
if (import_constants3.isServer || (0, import_react3.useEffect)(() => {
|
|
4208
4246
|
if (!themeManager)
|
|
4209
4247
|
return;
|
|
4210
4248
|
if (props.inverse && !mounted) {
|
|
@@ -4339,7 +4377,7 @@ var require_Theme_native = __commonJS({
|
|
|
4339
4377
|
useThemedChildren: () => useThemedChildren
|
|
4340
4378
|
});
|
|
4341
4379
|
module2.exports = __toCommonJS2(Theme_exports);
|
|
4342
|
-
var
|
|
4380
|
+
var import_constants3 = require_index_native3(), import_react3 = __toESM2(require("react")), import_createVariable = require_createVariable_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), Theme = (0, import_react3.forwardRef)(function(props, ref) {
|
|
4343
4381
|
if (props.disable)
|
|
4344
4382
|
return props.children;
|
|
4345
4383
|
let isRoot = !!props._isRoot, disableDirectChildTheme = props["disable-child-theme"], themeState = (0, import_useTheme.useChangeThemeEffect)(props, isRoot), children = (0, import_react3.useMemo)(() => {
|
|
@@ -4368,7 +4406,7 @@ var require_Theme_native = __commonJS({
|
|
|
4368
4406
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Theme, { name: themeManager.state.parentName, children: child.props.children })
|
|
4369
4407
|
) : child));
|
|
4370
4408
|
let elementsWithContext = themeManager ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeManagerContext.ThemeManagerContext.Provider, { value: themeManager, children: next }) : next;
|
|
4371
|
-
return forceClassName === !1 ? elementsWithContext :
|
|
4409
|
+
return forceClassName === !1 ? elementsWithContext : import_constants3.isWeb && !avoidWrap ? wrapThemeElements({
|
|
4372
4410
|
children: elementsWithContext,
|
|
4373
4411
|
themeState,
|
|
4374
4412
|
forceClassName,
|
|
@@ -4486,7 +4524,7 @@ var require_Slot_native = __commonJS({
|
|
|
4486
4524
|
Slottable: () => Slottable
|
|
4487
4525
|
});
|
|
4488
4526
|
module2.exports = __toCommonJS2(Slot_exports);
|
|
4489
|
-
var import_compose_refs = require_index_native5(),
|
|
4527
|
+
var import_compose_refs = require_index_native5(), import_constants3 = require_index_native3(), import_helpers = require_index_native4(), import_react3 = require("react"), import_jsx_runtime = require("react/jsx-runtime"), Slot = (0, import_react3.forwardRef)(function(props, forwardedRef) {
|
|
4490
4528
|
let { children, ...slotProps } = props;
|
|
4491
4529
|
if ((0, import_react3.isValidElement)(children)) {
|
|
4492
4530
|
let mergedProps = mergeSlotProps(children, slotProps);
|
|
@@ -4499,7 +4537,7 @@ var require_Slot_native = __commonJS({
|
|
|
4499
4537
|
);
|
|
4500
4538
|
}
|
|
4501
4539
|
return import_react3.Children.count(children) > 1 ? import_react3.Children.only(null) : null;
|
|
4502
|
-
}), Slottable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children }), pressMap =
|
|
4540
|
+
}), Slottable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children }), pressMap = import_constants3.isWeb ? {
|
|
4503
4541
|
onPress: "onClick",
|
|
4504
4542
|
onPressOut: "onMouseUp",
|
|
4505
4543
|
onPressIn: "onMouseDown"
|
|
@@ -4547,7 +4585,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4547
4585
|
spacedChildren: () => spacedChildren
|
|
4548
4586
|
});
|
|
4549
4587
|
module2.exports = __toCommonJS2(createComponent_exports);
|
|
4550
|
-
var import_compose_refs = require_index_native5(),
|
|
4588
|
+
var import_compose_refs = require_index_native5(), import_constants3 = require_index_native3(), import_helpers = require_index_native4(), import_use_did_finish_ssr = require_index_native6(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_proxyThemeVariables = require_proxyThemeVariables_native(), import_themeable = require_themeable_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), tamaguiConfig, AnimatedText, AnimatedView, initialTheme, mouseUps = /* @__PURE__ */ new Set();
|
|
4551
4589
|
if (typeof document < "u") {
|
|
4552
4590
|
let cancelTouches = () => {
|
|
4553
4591
|
mouseUps.forEach((x) => x()), mouseUps.clear();
|
|
@@ -4595,19 +4633,27 @@ var require_createComponent_native = __commonJS({
|
|
|
4595
4633
|
let curDefaultProps = styledContextProps ? { ...defaultProps, ...styledContextProps } : defaultProps, props = propsIn;
|
|
4596
4634
|
curDefaultProps && (props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn));
|
|
4597
4635
|
let debugProp = props.debug, componentName = props.componentName || staticConfig.componentName, isHydrated = config != null && config.disableSSR ? !0 : (0, import_use_did_finish_ssr.useDidFinishSSR)(), stateRef = (0, import_react3.useRef)(
|
|
4598
|
-
|
|
4599
|
-
)
|
|
4600
|
-
|
|
4601
|
-
let hostRef = (0, import_react3.useRef)(null), animationsConfig = componentContext.animationDriver, useAnimations = animationsConfig == null ? void 0 : animationsConfig.useAnimations, hasAnimationProp = !!(props.animation || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationsConfig == null ? void 0 : animationsConfig.supportsCSSVars, willBeAnimated = (() => {
|
|
4602
|
-
if (import_constants2.isServer && !supportsCSSVars)
|
|
4636
|
+
{}
|
|
4637
|
+
), hostRef = (0, import_react3.useRef)(null), animationsConfig = componentContext.animationDriver, useAnimations = animationsConfig == null ? void 0 : animationsConfig.useAnimations, hasAnimationProp = !!(props.animation || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationsConfig == null ? void 0 : animationsConfig.supportsCSSVars, willBeAnimated = (() => {
|
|
4638
|
+
if (import_constants3.isServer && !supportsCSSVars)
|
|
4603
4639
|
return !1;
|
|
4604
4640
|
let curState = stateRef.current;
|
|
4605
4641
|
return !!(hasAnimationProp && !isHOC && useAnimations || curState.hasAnimated);
|
|
4606
|
-
})(), usePresence = animationsConfig == null ? void 0 : animationsConfig.usePresence, presence = willBeAnimated && (usePresence == null ? void 0 : usePresence()) || null, hasEnterStyle = !!props.enterStyle, needsMount = !!((!
|
|
4607
|
-
if (groupName
|
|
4642
|
+
})(), usePresence = animationsConfig == null ? void 0 : animationsConfig.usePresence, presence = willBeAnimated && (usePresence == null ? void 0 : usePresence()) || null, hasEnterStyle = !!props.enterStyle, needsMount = !!((!import_constants3.isWeb || import_constants3.isClient) && willBeAnimated), initialState = willBeAnimated ? supportsCSSVars ? import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateMounted, states = (0, import_react3.useState)(initialState), state = propsIn.forceStyle ? { ...states[0], [propsIn.forceStyle]: !0 } : states[0], setState = states[1], setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState), groupName = props.group, groupClassName = groupName ? `t_group_${props.group}` : "";
|
|
4643
|
+
if (groupName && !stateRef.current.group && (stateRef.current.group = {
|
|
4644
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
4645
|
+
emit(name, state2) {
|
|
4646
|
+
this.listeners.forEach((l) => l(name, state2));
|
|
4647
|
+
},
|
|
4648
|
+
subscribe(cb) {
|
|
4649
|
+
return this.listeners.add(cb), () => {
|
|
4650
|
+
this.listeners.delete(cb);
|
|
4651
|
+
};
|
|
4652
|
+
}
|
|
4653
|
+
}), groupName) {
|
|
4608
4654
|
let groupContextState = componentContext.groups.state, og = setStateShallow;
|
|
4609
4655
|
setStateShallow = (state2) => {
|
|
4610
|
-
og(state2),
|
|
4656
|
+
og(state2), stateRef.current.group.emit(groupName, {
|
|
4611
4657
|
pseudo: state2
|
|
4612
4658
|
});
|
|
4613
4659
|
let next = {
|
|
@@ -4618,8 +4664,8 @@ var require_createComponent_native = __commonJS({
|
|
|
4618
4664
|
};
|
|
4619
4665
|
}
|
|
4620
4666
|
let isAnimated = willBeAnimated;
|
|
4621
|
-
willBeAnimated && !supportsCSSVars && !presence && isHydrated && (
|
|
4622
|
-
let componentClassName = props.asChild ? "" : props.componentName ? `is_${props.componentName}` : defaultComponentClassName, hasTextAncestor = !!(
|
|
4667
|
+
willBeAnimated && !supportsCSSVars && !presence && isHydrated && (import_constants3.isServer || state.unmounted === !0) && (isAnimated = !1), willBeAnimated && !stateRef.current.hasAnimated && (stateRef.current.hasAnimated = !0);
|
|
4668
|
+
let componentClassName = props.asChild ? "" : props.componentName ? `is_${props.componentName}` : defaultComponentClassName, hasTextAncestor = !!(import_constants3.isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? ((_c = props.accessibilityState) == null ? void 0 : _c.disabled), element = import_constants3.isWeb && (!Component || typeof Component == "string") && props.tag || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div");
|
|
4623
4669
|
AnimatedText = animationsConfig ? animationsConfig.Text : BaseTextComponent, AnimatedView = animationsConfig ? animationsConfig.View : BaseViewComponent;
|
|
4624
4670
|
let elementType = isText ? (isAnimated ? AnimatedText : null) || BaseTextComponent : (isAnimated ? AnimatedView : null) || BaseViewComponent;
|
|
4625
4671
|
if (isAnimated && presence) {
|
|
@@ -4629,7 +4675,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4629
4675
|
isEntering && enterVariant ? props[enterVariant] = !0 : isExiting2 && exitVariant && (props[exitVariant] = !enterExitVariant);
|
|
4630
4676
|
}
|
|
4631
4677
|
}
|
|
4632
|
-
let isAnimatedReactNative = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = !!(staticConfig.isReactNative || isAnimatedReactNative), shouldAvoidClasses = !!(!
|
|
4678
|
+
let isAnimatedReactNative = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = !!(staticConfig.isReactNative || isAnimatedReactNative), shouldAvoidClasses = !!(!import_constants3.isWeb || isAnimated || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, disableThemeProp = !1, disableTheme = disableThemeProp && !willBeAnimated || isHOC;
|
|
4633
4679
|
props.themeShallow && (stateRef.current.themeShallow = !0);
|
|
4634
4680
|
let themeStateProps = {
|
|
4635
4681
|
name: props.theme,
|
|
@@ -4727,7 +4773,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4727
4773
|
isHOC && _themeProp && (viewProps.theme = _themeProp), groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(
|
|
4728
4774
|
nonTamaguiProps.onLayout,
|
|
4729
4775
|
(e) => {
|
|
4730
|
-
|
|
4776
|
+
stateRef.current.group.emit(groupName, {
|
|
4731
4777
|
layout: e.nativeEvent.layout
|
|
4732
4778
|
}), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState((prev) => ({ ...prev })), stateRef.current.hasMeasured = !0;
|
|
4733
4779
|
}
|
|
@@ -4785,7 +4831,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4785
4831
|
fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
|
|
4786
4832
|
let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", style = avoidAnimationStyle ? splitStyles.style : animationStyles || splitStyles.style, className;
|
|
4787
4833
|
viewProps.style = style;
|
|
4788
|
-
let runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), attachFocus = !!(runtimePressStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = runtimeHoverStyle || onHoverIn || onHoverOut, isHoverable =
|
|
4834
|
+
let runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), attachFocus = !!(runtimePressStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = runtimeHoverStyle || onHoverIn || onHoverOut, isHoverable = import_constants3.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), handlesPressEvents = !(import_constants3.isWeb || asChild), events = !!(attachFocus || attachPress || isHoverable || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle) && !isDisabled && !props.asChild ? {
|
|
4789
4835
|
onPressOut: attachPress ? (e) => {
|
|
4790
4836
|
unPress(), onPressOut == null || onPressOut(e), onMouseUp == null || onMouseUp(e);
|
|
4791
4837
|
} : void 0,
|
|
@@ -4803,10 +4849,10 @@ var require_createComponent_native = __commonJS({
|
|
|
4803
4849
|
runtimePressStyle && setStateShallow({
|
|
4804
4850
|
press: !0,
|
|
4805
4851
|
pressIn: !0
|
|
4806
|
-
}), onPressIn == null || onPressIn(e), onMouseDown == null || onMouseDown(e),
|
|
4852
|
+
}), onPressIn == null || onPressIn(e), onMouseDown == null || onMouseDown(e), import_constants3.isWeb && mouseUps.add(unPress);
|
|
4807
4853
|
} : void 0,
|
|
4808
4854
|
onPress: attachPress ? (e) => {
|
|
4809
|
-
unPress(),
|
|
4855
|
+
unPress(), import_constants3.isWeb && (onClick == null || onClick(e)), onPress == null || onPress(e);
|
|
4810
4856
|
} : void 0,
|
|
4811
4857
|
...attachPress && onLongPress && {
|
|
4812
4858
|
onLongPress: (e) => {
|
|
@@ -4853,9 +4899,9 @@ var require_createComponent_native = __commonJS({
|
|
|
4853
4899
|
events,
|
|
4854
4900
|
staticConfig
|
|
4855
4901
|
)), useChildrenResult ? content = useChildrenResult : content = (0, import_react3.createElement)(elementType, viewProps, content);
|
|
4856
|
-
let subGroupContext = (0, import_react3.useMemo)(() => {
|
|
4857
|
-
if (groupName)
|
|
4858
|
-
return {
|
|
4902
|
+
let groupState = stateRef.current.group, subGroupContext = (0, import_react3.useMemo)(() => {
|
|
4903
|
+
if (!(!groupState || !groupName))
|
|
4904
|
+
return groupState.listeners.clear(), {
|
|
4859
4905
|
...componentContext.groups,
|
|
4860
4906
|
// change reference so as we mutate it doesn't affect siblings etc
|
|
4861
4907
|
state: {
|
|
@@ -4869,7 +4915,9 @@ var require_createComponent_native = __commonJS({
|
|
|
4869
4915
|
height: fromPx(splitStyles.style.height)
|
|
4870
4916
|
}
|
|
4871
4917
|
}
|
|
4872
|
-
}
|
|
4918
|
+
},
|
|
4919
|
+
emit: groupState.emit,
|
|
4920
|
+
subscribe: groupState.subscribe
|
|
4873
4921
|
};
|
|
4874
4922
|
}, [groupName]);
|
|
4875
4923
|
if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, { groups: subGroupContext, children: content })), content = disableThemeProp ? content : (0, import_Theme.useThemedChildren)(themeState, content, themeStateProps, !1), staticConfig.context) {
|
|
@@ -5405,7 +5453,7 @@ var require_createTamagui_native = __commonJS({
|
|
|
5405
5453
|
createTamagui: () => createTamagui
|
|
5406
5454
|
});
|
|
5407
5455
|
module2.exports = __toCommonJS2(createTamagui_exports);
|
|
5408
|
-
var
|
|
5456
|
+
var import_constants3 = require_index_native3(), import_config = require_config_native(), import_createVariables = require_createVariables_native(), import_getThemeCSSRules = require_getThemeCSSRules_native(), import_insertStyleRule = require_insertStyleRule_native(), import_proxyThemeToParents = require_proxyThemeToParents_native(), import_registerCSSVariable = require_registerCSSVariable_native(), import_themes = require_themes_native(), import_useMedia = require_useMedia_native(), import_insertFont = require_insertFont_native(), import_Tamagui = require_Tamagui_native(), createdConfigs = /* @__PURE__ */ new WeakMap();
|
|
5409
5457
|
function createTamagui(configIn) {
|
|
5410
5458
|
var _a;
|
|
5411
5459
|
if (createdConfigs.has(configIn))
|
|
@@ -5451,9 +5499,9 @@ var require_createTamagui_native = __commonJS({
|
|
|
5451
5499
|
for (let key in tokens)
|
|
5452
5500
|
for (let skey in tokens[key]) {
|
|
5453
5501
|
let variable = tokens[key][skey];
|
|
5454
|
-
specificTokens[`$${key}.${skey}`] = variable,
|
|
5502
|
+
specificTokens[`$${key}.${skey}`] = variable, import_constants3.isWeb && ((0, import_registerCSSVariable.registerCSSVariable)(variable), declarations.push((0, import_registerCSSVariable.variableToCSS)(variable, key === "zIndex")));
|
|
5455
5503
|
}
|
|
5456
|
-
if (
|
|
5504
|
+
if (import_constants3.isWeb) {
|
|
5457
5505
|
let declarationsToRuleSet2 = function(decs, selector = "") {
|
|
5458
5506
|
return `:root${selector} {${sep}${[...decs].join(`;${sep}`)}${sep}}`;
|
|
5459
5507
|
};
|
|
@@ -5480,7 +5528,7 @@ var require_createTamagui_native = __commonJS({
|
|
|
5480
5528
|
cssRuleSets,
|
|
5481
5529
|
getThemeRulesSets() {
|
|
5482
5530
|
let themeRuleSets = [];
|
|
5483
|
-
if (
|
|
5531
|
+
if (import_constants3.isWeb)
|
|
5484
5532
|
for (let { names, theme } of dedupedThemes) {
|
|
5485
5533
|
let nextRules = (0, import_getThemeCSSRules.getThemeCSSRules)({
|
|
5486
5534
|
config: configIn,
|
|
@@ -5858,41 +5906,6 @@ var require_isTamaguiElement_native = __commonJS({
|
|
|
5858
5906
|
}
|
|
5859
5907
|
});
|
|
5860
5908
|
|
|
5861
|
-
// ../web/dist/cjs/helpers/withStaticProperties.native.js
|
|
5862
|
-
var require_withStaticProperties_native = __commonJS({
|
|
5863
|
-
"../web/dist/cjs/helpers/withStaticProperties.native.js"(exports, module2) {
|
|
5864
|
-
"use strict";
|
|
5865
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
5866
|
-
for (var name in all)
|
|
5867
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
5868
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
5869
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
5870
|
-
for (let key of __getOwnPropNames2(from))
|
|
5871
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
5872
|
-
return to;
|
|
5873
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), withStaticProperties_exports = {};
|
|
5874
|
-
__export2(withStaticProperties_exports, {
|
|
5875
|
-
withStaticProperties: () => withStaticProperties
|
|
5876
|
-
});
|
|
5877
|
-
module2.exports = __toCommonJS2(withStaticProperties_exports);
|
|
5878
|
-
var import_react3 = require("react"), Decorated = Symbol(), withStaticProperties = function(component, staticProps) {
|
|
5879
|
-
let next = (() => {
|
|
5880
|
-
if (component[Decorated]) {
|
|
5881
|
-
let _ = (0, import_react3.forwardRef)(
|
|
5882
|
-
(props, ref) => (0, import_react3.createElement)(component, { ...props, ref })
|
|
5883
|
-
);
|
|
5884
|
-
for (let key in component) {
|
|
5885
|
-
let v = component[key];
|
|
5886
|
-
_[key] = v && typeof v == "object" ? { ...v } : v;
|
|
5887
|
-
}
|
|
5888
|
-
}
|
|
5889
|
-
return component;
|
|
5890
|
-
})();
|
|
5891
|
-
return Object.assign(next, staticProps), next[Decorated] = !0, next;
|
|
5892
|
-
};
|
|
5893
|
-
}
|
|
5894
|
-
});
|
|
5895
|
-
|
|
5896
5909
|
// ../web/dist/cjs/internalWithTheme.native.js
|
|
5897
5910
|
var require_internalWithTheme_native = __commonJS({
|
|
5898
5911
|
"../web/dist/cjs/internalWithTheme.native.js"(exports, module2) {
|
|
@@ -5934,10 +5947,10 @@ var require_useThemeName_native = __commonJS({
|
|
|
5934
5947
|
useThemeName: () => useThemeName
|
|
5935
5948
|
});
|
|
5936
5949
|
module2.exports = __toCommonJS2(useThemeName_exports);
|
|
5937
|
-
var
|
|
5950
|
+
var import_constants3 = require_index_native3(), import_react3 = require("react"), import_ThemeManagerContext = require_ThemeManagerContext_native();
|
|
5938
5951
|
function useThemeName(opts) {
|
|
5939
5952
|
let manager = (0, import_react3.useContext)(import_ThemeManagerContext.ThemeManagerContext), [name, setName] = (0, import_react3.useState)((manager == null ? void 0 : manager.state.name) || "");
|
|
5940
|
-
return (0,
|
|
5953
|
+
return (0, import_constants3.useIsomorphicLayoutEffect)(() => {
|
|
5941
5954
|
if (manager)
|
|
5942
5955
|
return setName(manager.state.name), manager.onChangeTheme((next, manager2) => {
|
|
5943
5956
|
let name2 = opts != null && opts.parent && manager2.state.parentName || next;
|
|
@@ -5993,7 +6006,7 @@ var require_useIsTouchDevice_native = __commonJS({
|
|
|
5993
6006
|
useIsTouchDevice: () => useIsTouchDevice
|
|
5994
6007
|
});
|
|
5995
6008
|
module2.exports = __toCommonJS2(useIsTouchDevice_exports);
|
|
5996
|
-
var
|
|
6009
|
+
var import_constants3 = require_index_native3(), import_use_did_finish_ssr = require_index_native6(), useIsTouchDevice = () => import_constants3.isWeb ? (0, import_use_did_finish_ssr.useDidFinishSSR)() ? import_constants3.isTouchable : !1 : !0;
|
|
5997
6010
|
}
|
|
5998
6011
|
});
|
|
5999
6012
|
|
|
@@ -6014,9 +6027,9 @@ var require_Stack_native = __commonJS({
|
|
|
6014
6027
|
Stack: () => Stack2
|
|
6015
6028
|
});
|
|
6016
6029
|
module2.exports = __toCommonJS2(Stack_exports);
|
|
6017
|
-
var import_helpers = require_index_native4(),
|
|
6030
|
+
var import_helpers = require_index_native4(), import_constants3 = require_constants_native2(), import_createComponent = require_createComponent_native(), Stack2 = (0, import_createComponent.createComponent)({
|
|
6018
6031
|
acceptsClassName: !0,
|
|
6019
|
-
defaultProps:
|
|
6032
|
+
defaultProps: import_constants3.stackDefaultStyles,
|
|
6020
6033
|
validStyles: import_helpers.validStyles
|
|
6021
6034
|
});
|
|
6022
6035
|
}
|
|
@@ -6173,7 +6186,7 @@ var require_ThemeProvider_native = __commonJS({
|
|
|
6173
6186
|
ThemeProvider: () => ThemeProvider
|
|
6174
6187
|
});
|
|
6175
6188
|
module2.exports = __toCommonJS2(ThemeProvider_exports);
|
|
6176
|
-
var
|
|
6189
|
+
var import_constants3 = require_index_native3(), import_react3 = require("react"), import_constants22 = require_constants_native2(), import_Theme = require_Theme_native(), import_jsx_runtime = require("react/jsx-runtime"), ThemeProvider = (props) => (import_constants3.isClient && (0, import_react3.useLayoutEffect)(() => {
|
|
6177
6190
|
if (props.disableRootThemeClass)
|
|
6178
6191
|
return;
|
|
6179
6192
|
let cn = `${import_constants22.THEME_CLASSNAME_PREFIX}${props.defaultTheme}`, target = props.themeClassNameOnRoot ? document.documentElement : document.body;
|
|
@@ -6241,14 +6254,14 @@ var require_TamaguiProvider_native = __commonJS({
|
|
|
6241
6254
|
TamaguiProvider: () => TamaguiProvider
|
|
6242
6255
|
});
|
|
6243
6256
|
module2.exports = __toCommonJS2(TamaguiProvider_exports);
|
|
6244
|
-
var
|
|
6257
|
+
var import_constants3 = require_index_native3(), React = __toESM2(require("react")), import_ComponentContext = require_ComponentContext_native(), import_useMedia = require_useMedia_native(), import_ThemeProvider = require_ThemeProvider_native(), import_jsx_runtime = require("react/jsx-runtime");
|
|
6245
6258
|
function TamaguiProvider({
|
|
6246
6259
|
children,
|
|
6247
6260
|
disableInjectCSS,
|
|
6248
6261
|
config,
|
|
6249
6262
|
...themePropsProvider
|
|
6250
6263
|
}) {
|
|
6251
|
-
return
|
|
6264
|
+
return import_constants3.isWeb && import_constants3.isServer || (0, import_useMedia.useMediaListeners)(config), import_constants3.isClient && React.useLayoutEffect(() => {
|
|
6252
6265
|
if (document.documentElement.classList.contains("t_unmounted") && document.documentElement.classList.remove("t_unmounted"), disableInjectCSS)
|
|
6253
6266
|
return;
|
|
6254
6267
|
let style = document.createElement("style");
|
|
@@ -6307,10 +6320,10 @@ var require_useGet_native = __commonJS({
|
|
|
6307
6320
|
useGet: () => useGet
|
|
6308
6321
|
});
|
|
6309
6322
|
module2.exports = __toCommonJS2(useGet_exports);
|
|
6310
|
-
var
|
|
6323
|
+
var import_constants3 = require_index_native3(), import_react3 = require("react");
|
|
6311
6324
|
function useGet(currentValue, initialValue, forwardToFunction) {
|
|
6312
6325
|
let curRef = (0, import_react3.useRef)(initialValue ?? currentValue);
|
|
6313
|
-
return
|
|
6326
|
+
return (0, import_constants3.useIsomorphicLayoutEffect)(() => {
|
|
6314
6327
|
curRef.current = currentValue;
|
|
6315
6328
|
}), (0, import_react3.useCallback)(
|
|
6316
6329
|
forwardToFunction ? (...args) => {
|
|
@@ -6432,7 +6445,6 @@ var require_index_native9 = __commonJS({
|
|
|
6432
6445
|
__reExport2(src_exports2, require_themeable_native(), module2.exports);
|
|
6433
6446
|
__reExport2(src_exports2, require_themes_native(), module2.exports);
|
|
6434
6447
|
__reExport2(src_exports2, require_createShallowSetState_native(), module2.exports);
|
|
6435
|
-
__reExport2(src_exports2, require_withStaticProperties_native(), module2.exports);
|
|
6436
6448
|
__reExport2(src_exports2, require_internalWithTheme_native(), module2.exports);
|
|
6437
6449
|
var import_useMedia = require_useMedia_native();
|
|
6438
6450
|
__reExport2(src_exports2, require_useTheme_native(), module2.exports);
|
|
@@ -6454,7 +6466,7 @@ var require_index_native9 = __commonJS({
|
|
|
6454
6466
|
__reExport2(src_exports2, require_index_native8(), module2.exports);
|
|
6455
6467
|
__reExport2(src_exports2, require_index_native5(), module2.exports);
|
|
6456
6468
|
__reExport2(src_exports2, require_index_native4(), module2.exports);
|
|
6457
|
-
__reExport2(src_exports2,
|
|
6469
|
+
__reExport2(src_exports2, require_index_native3(), module2.exports);
|
|
6458
6470
|
__reExport2(src_exports2, require_setupHooks_native(), module2.exports);
|
|
6459
6471
|
}
|
|
6460
6472
|
});
|
|
@@ -6517,7 +6529,7 @@ __export(src_exports, {
|
|
|
6517
6529
|
View: () => View
|
|
6518
6530
|
});
|
|
6519
6531
|
module.exports = __toCommonJS(src_exports);
|
|
6520
|
-
var import_react_native_use_responder_events = __toESM(require_index_native()),
|
|
6532
|
+
var import_react_native_use_responder_events = __toESM(require_index_native()), import_web = __toESM(require_index_native9()), import_react2 = require("react");
|
|
6521
6533
|
|
|
6522
6534
|
// src/createOptimizedView.native.tsx
|
|
6523
6535
|
var import_react = require("react");
|
|
@@ -6733,7 +6745,7 @@ function getBaseViews() {
|
|
|
6733
6745
|
}
|
|
6734
6746
|
|
|
6735
6747
|
// src/hooks/useElementLayout.tsx
|
|
6736
|
-
var import_constants = __toESM(
|
|
6748
|
+
var import_constants = __toESM(require_index_native3());
|
|
6737
6749
|
|
|
6738
6750
|
// src/helpers/getBoundingClientRect.tsx
|
|
6739
6751
|
var getBoundingClientRect = (node) => {
|
|
@@ -6752,7 +6764,7 @@ var getRect = (node) => {
|
|
|
6752
6764
|
};
|
|
6753
6765
|
|
|
6754
6766
|
// src/hooks/useElementLayout.tsx
|
|
6755
|
-
var LayoutHandlers = /* @__PURE__ */ new WeakMap(), resizeObserver = null;
|
|
6767
|
+
var LayoutHandlers = /* @__PURE__ */ new WeakMap(), LayoutTimeouts = /* @__PURE__ */ new WeakMap(), resizeObserver = null;
|
|
6756
6768
|
typeof window < "u" && "ResizeObserver" in window && (resizeObserver = new ResizeObserver((entries) => {
|
|
6757
6769
|
for (let { target } of entries) {
|
|
6758
6770
|
let onLayout = LayoutHandlers.get(target);
|
|
@@ -6771,10 +6783,14 @@ typeof window < "u" && "ResizeObserver" in window && (resizeObserver = new Resiz
|
|
|
6771
6783
|
}));
|
|
6772
6784
|
var measureLayout = (node, relativeTo, callback) => {
|
|
6773
6785
|
let relativeNode = relativeTo || (node == null ? void 0 : node.parentNode);
|
|
6774
|
-
relativeNode instanceof HTMLElement
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6786
|
+
if (relativeNode instanceof HTMLElement) {
|
|
6787
|
+
clearTimeout(LayoutTimeouts.get(relativeNode));
|
|
6788
|
+
let tm = setTimeout(() => {
|
|
6789
|
+
let relativeRect = getBoundingClientRect(relativeNode), { height, left, top, width } = getRect(node), x = left - relativeRect.left, y = top - relativeRect.top;
|
|
6790
|
+
callback(x, y, width, height, left, top), LayoutTimeouts.delete(relativeNode);
|
|
6791
|
+
}, 0);
|
|
6792
|
+
LayoutTimeouts.set(relativeNode, tm);
|
|
6793
|
+
}
|
|
6778
6794
|
};
|
|
6779
6795
|
function useElementLayout(ref, onLayout) {
|
|
6780
6796
|
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
@@ -6789,9 +6805,9 @@ function useElementLayout(ref, onLayout) {
|
|
|
6789
6805
|
}
|
|
6790
6806
|
|
|
6791
6807
|
// src/hooks/usePlatformMethods.ts
|
|
6792
|
-
var
|
|
6808
|
+
var import_constants2 = __toESM(require_index_native3());
|
|
6793
6809
|
function usePlatformMethods(hostRef) {
|
|
6794
|
-
(0,
|
|
6810
|
+
(0, import_constants2.useIsomorphicLayoutEffect)(() => {
|
|
6795
6811
|
let node = hostRef.current;
|
|
6796
6812
|
node && (node.measure = (callback) => measureLayout(node, null, callback), node.measureLayout = (relativeToNode, success) => measureLayout(node, relativeToNode, success), node.measureInWindow = (callback) => {
|
|
6797
6813
|
node && setTimeout(() => {
|
|
@@ -6807,8 +6823,8 @@ var Pressability = require_fake_react_native().default, usePressability = (init_
|
|
|
6807
6823
|
|
|
6808
6824
|
// src/index.tsx
|
|
6809
6825
|
__reExport(src_exports, __toESM(require_index_native9()), module.exports);
|
|
6810
|
-
var View =
|
|
6811
|
-
(0,
|
|
6826
|
+
var View = import_web.View, Stack = import_web.Stack, Text = import_web.Text, baseViews = getBaseViews();
|
|
6827
|
+
(0, import_web.setupHooks)({
|
|
6812
6828
|
getBaseViews,
|
|
6813
6829
|
usePropsTransform(elementType, propsIn, hostRef) {
|
|
6814
6830
|
let {
|
|
@@ -6869,7 +6885,7 @@ var View = import_web2.View, Stack = import_web2.Stack, Text = import_web2.Text,
|
|
|
6869
6885
|
onPressIn,
|
|
6870
6886
|
onPressOut: onPressOut || onPress
|
|
6871
6887
|
};
|
|
6872
|
-
onPressOut && onPress && (inputEvents.onPressOut = (0,
|
|
6888
|
+
onPressOut && onPress && (inputEvents.onPressOut = (0, import_web.composeEventHandlers)(onPress, onPressOut)), Object.assign(viewProps, inputEvents);
|
|
6873
6889
|
}
|
|
6874
6890
|
} else {
|
|
6875
6891
|
events && viewProps.hitSlop && (events.hitSlop = viewProps.hitSlop);
|
|
@@ -6877,7 +6893,7 @@ var View = import_web2.View, Stack = import_web2.Stack, Text = import_web2.Text,
|
|
|
6877
6893
|
if (events && events.onPress)
|
|
6878
6894
|
for (let key in pressability) {
|
|
6879
6895
|
let og = viewProps[key], val = pressability[key];
|
|
6880
|
-
viewProps[key] = og && !dontComposePressabilityKeys[key] ? (0,
|
|
6896
|
+
viewProps[key] = og && !dontComposePressabilityKeys[key] ? (0, import_web.composeEventHandlers)(og, val) : val;
|
|
6881
6897
|
}
|
|
6882
6898
|
}
|
|
6883
6899
|
},
|