tamagui 1.85.7 → 1.85.9-1705340264375
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 +28 -29
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +24 -27
- package/dist/test.native.js.map +2 -2
- package/package.json +52 -52
package/dist/native.js
CHANGED
|
@@ -1329,7 +1329,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1329
1329
|
}
|
|
1330
1330
|
return scannedCache.set(sheet2, cacheKey), dedupedThemes;
|
|
1331
1331
|
}
|
|
1332
|
-
var colorVarToVal, rootComputedStyle = null
|
|
1332
|
+
var colorVarToVal, rootComputedStyle = null;
|
|
1333
1333
|
function addThemesFromCSS(cssStyleRule, tokens) {
|
|
1334
1334
|
let selectors = cssStyleRule.selectorText.split(",");
|
|
1335
1335
|
if (!selectors.length)
|
|
@@ -1347,7 +1347,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1347
1347
|
if (sepI === -1)
|
|
1348
1348
|
continue;
|
|
1349
1349
|
let key = rule.slice(rule.indexOf("--") + 2, sepI), val = rule.slice(sepI + 2), value;
|
|
1350
|
-
if (val
|
|
1350
|
+
if (val.startsWith("var(")) {
|
|
1351
1351
|
let varName = val.slice(6, -1), tokenVal = colorVarToVal[varName];
|
|
1352
1352
|
tokenVal ? value = tokenVal : (rootComputedStyle ||= getComputedStyle(document.body), value = rootComputedStyle.getPropertyValue("--" + varName));
|
|
1353
1353
|
} else
|
|
@@ -1361,20 +1361,17 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1361
1361
|
!0
|
|
1362
1362
|
);
|
|
1363
1363
|
}
|
|
1364
|
-
|
|
1365
|
-
names: [
|
|
1366
|
-
...new Set(
|
|
1367
|
-
selectors.map((selector) => {
|
|
1368
|
-
let parts = selector.replace(/(.t_|:root)/g, "").trim().split(" "), secondToLast = parts[parts.length - 2] || "", scheme = secondToLast.includes("dark") ? "dark" : secondToLast.includes("light") ? "light" : "", name = (() => {
|
|
1369
|
-
let _ = parts[parts.length - 1];
|
|
1370
|
-
return scheme && _.startsWith(scheme) && (_ = _.slice(scheme.length + 1)), _;
|
|
1371
|
-
})();
|
|
1372
|
-
return scheme === name || schemes[name] ? scheme : `${scheme}${scheme && name ? "_" : ""}${name}`;
|
|
1373
|
-
})
|
|
1374
|
-
)
|
|
1375
|
-
],
|
|
1364
|
+
let dedupedEntry = {
|
|
1365
|
+
names: [],
|
|
1376
1366
|
theme: values
|
|
1377
1367
|
};
|
|
1368
|
+
for (let selector of selectors) {
|
|
1369
|
+
let scheme = selector.includes("t_dark") ? "dark" : selector.includes("t_light") ? "light" : "", name = selector.slice(selector.lastIndexOf(".t_") + 3);
|
|
1370
|
+
name.startsWith(scheme) && (name = name.slice(scheme.length + 1)), scheme === name && (scheme = "");
|
|
1371
|
+
let themeName = `${scheme}${scheme && name ? "_" : ""}${name}`;
|
|
1372
|
+
dedupedEntry.names.includes(themeName) || dedupedEntry.names.push(themeName);
|
|
1373
|
+
}
|
|
1374
|
+
return dedupedEntry;
|
|
1378
1375
|
}
|
|
1379
1376
|
function getTamaguiSelector(rule, collectThemes = !1) {
|
|
1380
1377
|
if (rule instanceof CSSStyleRule) {
|
|
@@ -2077,11 +2074,11 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
2077
2074
|
}
|
|
2078
2075
|
return !1;
|
|
2079
2076
|
}
|
|
2080
|
-
var activeThemeManagers = /* @__PURE__ */ new Set(),
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2077
|
+
var activeThemeManagers = /* @__PURE__ */ new Set(), _idToManager = /* @__PURE__ */ new Map(), getThemeManager = (id) => {
|
|
2078
|
+
var _a;
|
|
2079
|
+
return (_a = _idToManager.get(id)) == null ? void 0 : _a.deref();
|
|
2080
|
+
}, registerThemeManager = (t) => {
|
|
2081
|
+
_idToManager.set(t.id, new WeakRef(t));
|
|
2085
2082
|
}, useChangeThemeEffect = (props, isRoot = !1, keys, shouldUpdate) => {
|
|
2086
2083
|
let { disable } = props, parentManagerId = (0, import_react2.useContext)(import_ThemeManagerContext.ThemeManagerIDContext), parentManager = getThemeManager(parentManagerId);
|
|
2087
2084
|
if (!isRoot && !parentManager || disable)
|
|
@@ -3642,7 +3639,9 @@ var require_propMapper_native = __commonJS({
|
|
|
3642
3639
|
let expanded = (0, import_expandStylesAndRemoveNullishValues.expandStylesAndRemoveNullishValues)(
|
|
3643
3640
|
variantValue,
|
|
3644
3641
|
!!styleProps.noNormalize
|
|
3645
|
-
)
|
|
3642
|
+
);
|
|
3643
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && console.info(" expanding styles from ", variantValue, "to", expanded);
|
|
3644
|
+
let next = Object.entries(expanded);
|
|
3646
3645
|
return fontFamilyResult && fontFamilyResult[0] === "$" && fontFamilyCache.set(next, (0, import_createVariable.getVariableValue)(fontFamilyResult)), next;
|
|
3647
3646
|
}
|
|
3648
3647
|
};
|
|
@@ -3680,7 +3679,7 @@ var require_propMapper_native = __commonJS({
|
|
|
3680
3679
|
continue;
|
|
3681
3680
|
}
|
|
3682
3681
|
if ((0, import_createVariable.isVariable)(val)) {
|
|
3683
|
-
res[subKey] = resolveVariableValue(subKey, val, styleProps.resolveValues);
|
|
3682
|
+
res[subKey] = resolveVariableValue(subKey, val, styleProps.resolveValues), process.env.NODE_ENV === "development" && debug === "verbose" && console.info("variable", subKey, res[subKey]);
|
|
3684
3683
|
continue;
|
|
3685
3684
|
}
|
|
3686
3685
|
if (typeof val == "string") {
|
|
@@ -15122,7 +15121,7 @@ var require_Popper_native = __commonJS({
|
|
|
15122
15121
|
usePopperContext: () => usePopperContext
|
|
15123
15122
|
});
|
|
15124
15123
|
module2.exports = __toCommonJS2(Popper_exports);
|
|
15125
|
-
var import_compose_refs = require_index_native10(), import_constants4 = require_index_native(),
|
|
15124
|
+
var import_compose_refs = require_index_native10(), import_constants4 = require_index_native(), import_core13 = require_index_native15(), import_floating = require_index_native53(), import_get_token2 = require_index_native17(), import_stacks3 = require_index_native19(), React2 = __toESM2(require("react")), import_react_native4 = require("react-native"), import_jsx_runtime6 = require("react/jsx-runtime"), PopperContext = (0, import_core13.createStyledContext)({}), { useStyledContext: usePopperContext, Provider: PopperProvider } = PopperContext;
|
|
15126
15125
|
function Popper(props) {
|
|
15127
15126
|
let {
|
|
15128
15127
|
children,
|
|
@@ -15134,7 +15133,7 @@ var require_Popper_native = __commonJS({
|
|
|
15134
15133
|
offset: offset2,
|
|
15135
15134
|
__scopePopper
|
|
15136
15135
|
} = props, [isMounted, setIsMounted] = React2.useState(!1);
|
|
15137
|
-
(0,
|
|
15136
|
+
(0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
15138
15137
|
setIsMounted(!0);
|
|
15139
15138
|
}, []);
|
|
15140
15139
|
let [anchorRef, setAnchorRef] = React2.useState(), [arrowEl, setArrow] = React2.useState(null), [arrowSize, setArrowSize] = React2.useState(0), offsetOptions = offset2 ?? arrowSize, floating = (0, import_floating.useFloating)({
|
|
@@ -15154,10 +15153,10 @@ var require_Popper_native = __commonJS({
|
|
|
15154
15153
|
// @ts-expect-error this comes from Tooltip for example
|
|
15155
15154
|
open
|
|
15156
15155
|
} = floating;
|
|
15157
|
-
if ((0,
|
|
15156
|
+
if ((0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
15158
15157
|
floating.refs.setReference(anchorRef);
|
|
15159
15158
|
}, [anchorRef]), import_constants4.isWeb)
|
|
15160
|
-
(0,
|
|
15159
|
+
(0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
15161
15160
|
if (open && refs.reference.current && refs.floating.current)
|
|
15162
15161
|
return (0, import_floating.autoUpdate)(refs.reference.current, refs.floating.current, floating.update);
|
|
15163
15162
|
}, [open, floating.update, refs.floating, refs.reference]);
|
|
@@ -15172,7 +15171,7 @@ var require_Popper_native = __commonJS({
|
|
|
15172
15171
|
return () => {
|
|
15173
15172
|
showSubscription.remove(), hideSubscription.remove();
|
|
15174
15173
|
};
|
|
15175
|
-
}, []), (0,
|
|
15174
|
+
}, []), (0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
15176
15175
|
floating.update();
|
|
15177
15176
|
}, [dimensions, keyboardOpen]);
|
|
15178
15177
|
}
|
|
@@ -15243,7 +15242,7 @@ var require_Popper_native = __commonJS({
|
|
|
15243
15242
|
), [placement, strategy, props]), [hasInitialPosition, setHasInitialPosition] = React2.useState(!0);
|
|
15244
15243
|
if (React2.useEffect(() => {
|
|
15245
15244
|
(x || y) && setHasInitialPosition(!1);
|
|
15246
|
-
}, [x, y]), (0,
|
|
15245
|
+
}, [x, y]), (0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
15247
15246
|
isMounted && update();
|
|
15248
15247
|
}, [isMounted]), !isMounted)
|
|
15249
15248
|
return null;
|
|
@@ -15262,7 +15261,7 @@ var require_Popper_native = __commonJS({
|
|
|
15262
15261
|
animateOnly: rest.animateOnly
|
|
15263
15262
|
}
|
|
15264
15263
|
};
|
|
15265
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
15264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core13.Stack, { ...getFloatingProps ? getFloatingProps(frameProps) : frameProps, children: contents });
|
|
15266
15265
|
}), PopperArrowFrame = (0, import_core13.styled)(import_stacks3.YStack, {
|
|
15267
15266
|
name: "PopperArrow",
|
|
15268
15267
|
variants: {
|
|
@@ -15310,7 +15309,7 @@ var require_Popper_native = __commonJS({
|
|
|
15310
15309
|
if (primaryPlacement) {
|
|
15311
15310
|
arrowStyle[isVertical ? "width" : "height"] = size2 * 2;
|
|
15312
15311
|
let oppSide = opposites[primaryPlacement];
|
|
15313
|
-
oppSide && (arrowStyle[oppSide] = -size2, innerArrowStyle[oppSide] = size2 / 2), oppSide === "bottom" && (arrowStyle[oppSide] += 1), (oppSide === "top" || oppSide === "bottom") && (arrowStyle.left = 0), (oppSide === "left" || oppSide === "right") && (arrowStyle.top = 0), (0,
|
|
15312
|
+
oppSide && (arrowStyle[oppSide] = -size2, innerArrowStyle[oppSide] = size2 / 2), oppSide === "bottom" && (arrowStyle[oppSide] += 1), (oppSide === "top" || oppSide === "bottom") && (arrowStyle.left = 0), (oppSide === "left" || oppSide === "right") && (arrowStyle.top = 0), (0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
15314
15313
|
var _a2;
|
|
15315
15314
|
(_a2 = context.onArrowSize) == null || _a2.call(context, size2);
|
|
15316
15315
|
}, [size2, context.onArrowSize]);
|