@xsolla/xui-context-menu 0.112.0 → 0.114.0
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/native/index.js +31 -3
- package/native/index.js.map +1 -1
- package/native/index.mjs +35 -4
- package/native/index.mjs.map +1 -1
- package/package.json +8 -8
- package/web/index.js +1 -0
- package/web/index.js.map +1 -1
- package/web/index.mjs +1 -0
- package/web/index.mjs.map +1 -1
package/native/index.js
CHANGED
|
@@ -225,29 +225,57 @@ var roleMap = {
|
|
|
225
225
|
link: "link",
|
|
226
226
|
text: "text"
|
|
227
227
|
};
|
|
228
|
+
var parseNumericValue = (value) => {
|
|
229
|
+
if (value === void 0) return void 0;
|
|
230
|
+
if (typeof value === "number") return value;
|
|
231
|
+
const parsed = parseFloat(value);
|
|
232
|
+
return isNaN(parsed) ? void 0 : parsed;
|
|
233
|
+
};
|
|
228
234
|
var Text = ({
|
|
229
235
|
children,
|
|
230
236
|
color,
|
|
231
237
|
fontSize,
|
|
232
238
|
fontWeight,
|
|
233
239
|
fontFamily,
|
|
240
|
+
textAlign,
|
|
241
|
+
lineHeight,
|
|
242
|
+
numberOfLines,
|
|
234
243
|
id,
|
|
235
244
|
role,
|
|
245
|
+
style: styleProp,
|
|
236
246
|
...props
|
|
237
247
|
}) => {
|
|
238
248
|
let resolvedFontFamily = fontFamily ? fontFamily.split(",")[0].replace(/['"]/g, "").trim() : void 0;
|
|
239
249
|
if (resolvedFontFamily === "Pilat Wide" || resolvedFontFamily === "Pilat Wide Bold" || resolvedFontFamily === "Aktiv Grotesk") {
|
|
240
250
|
resolvedFontFamily = void 0;
|
|
241
251
|
}
|
|
242
|
-
const
|
|
252
|
+
const incomingStyle = import_react_native2.StyleSheet.flatten(styleProp);
|
|
253
|
+
const baseStyle = {
|
|
243
254
|
color,
|
|
244
255
|
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
245
256
|
fontWeight,
|
|
246
257
|
fontFamily: resolvedFontFamily,
|
|
247
|
-
textDecorationLine: props.textDecoration
|
|
258
|
+
textDecorationLine: props.textDecoration,
|
|
259
|
+
textAlign: textAlign ?? incomingStyle?.textAlign,
|
|
260
|
+
lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),
|
|
261
|
+
marginTop: parseNumericValue(
|
|
262
|
+
incomingStyle?.marginTop
|
|
263
|
+
),
|
|
264
|
+
marginBottom: parseNumericValue(
|
|
265
|
+
incomingStyle?.marginBottom
|
|
266
|
+
)
|
|
248
267
|
};
|
|
249
268
|
const accessibilityRole = role ? roleMap[role] : void 0;
|
|
250
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
270
|
+
import_react_native2.Text,
|
|
271
|
+
{
|
|
272
|
+
style: baseStyle,
|
|
273
|
+
numberOfLines,
|
|
274
|
+
testID: id,
|
|
275
|
+
accessibilityRole,
|
|
276
|
+
children
|
|
277
|
+
}
|
|
278
|
+
);
|
|
251
279
|
};
|
|
252
280
|
|
|
253
281
|
// ../primitives-native/src/Icon.tsx
|