@xsolla/xui-context-menu 0.112.0 → 0.113.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.mjs
CHANGED
|
@@ -179,7 +179,10 @@ var Box = ({
|
|
|
179
179
|
};
|
|
180
180
|
|
|
181
181
|
// ../primitives-native/src/Text.tsx
|
|
182
|
-
import {
|
|
182
|
+
import {
|
|
183
|
+
Text as RNText,
|
|
184
|
+
StyleSheet
|
|
185
|
+
} from "react-native";
|
|
183
186
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
184
187
|
var roleMap = {
|
|
185
188
|
alert: "alert",
|
|
@@ -188,29 +191,57 @@ var roleMap = {
|
|
|
188
191
|
link: "link",
|
|
189
192
|
text: "text"
|
|
190
193
|
};
|
|
194
|
+
var parseNumericValue = (value) => {
|
|
195
|
+
if (value === void 0) return void 0;
|
|
196
|
+
if (typeof value === "number") return value;
|
|
197
|
+
const parsed = parseFloat(value);
|
|
198
|
+
return isNaN(parsed) ? void 0 : parsed;
|
|
199
|
+
};
|
|
191
200
|
var Text = ({
|
|
192
201
|
children,
|
|
193
202
|
color,
|
|
194
203
|
fontSize,
|
|
195
204
|
fontWeight,
|
|
196
205
|
fontFamily,
|
|
206
|
+
textAlign,
|
|
207
|
+
lineHeight,
|
|
208
|
+
numberOfLines,
|
|
197
209
|
id,
|
|
198
210
|
role,
|
|
211
|
+
style: styleProp,
|
|
199
212
|
...props
|
|
200
213
|
}) => {
|
|
201
214
|
let resolvedFontFamily = fontFamily ? fontFamily.split(",")[0].replace(/['"]/g, "").trim() : void 0;
|
|
202
215
|
if (resolvedFontFamily === "Pilat Wide" || resolvedFontFamily === "Pilat Wide Bold" || resolvedFontFamily === "Aktiv Grotesk") {
|
|
203
216
|
resolvedFontFamily = void 0;
|
|
204
217
|
}
|
|
205
|
-
const
|
|
218
|
+
const incomingStyle = StyleSheet.flatten(styleProp);
|
|
219
|
+
const baseStyle = {
|
|
206
220
|
color,
|
|
207
221
|
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
208
222
|
fontWeight,
|
|
209
223
|
fontFamily: resolvedFontFamily,
|
|
210
|
-
textDecorationLine: props.textDecoration
|
|
224
|
+
textDecorationLine: props.textDecoration,
|
|
225
|
+
textAlign: textAlign ?? incomingStyle?.textAlign,
|
|
226
|
+
lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),
|
|
227
|
+
marginTop: parseNumericValue(
|
|
228
|
+
incomingStyle?.marginTop
|
|
229
|
+
),
|
|
230
|
+
marginBottom: parseNumericValue(
|
|
231
|
+
incomingStyle?.marginBottom
|
|
232
|
+
)
|
|
211
233
|
};
|
|
212
234
|
const accessibilityRole = role ? roleMap[role] : void 0;
|
|
213
|
-
return /* @__PURE__ */ jsx2(
|
|
235
|
+
return /* @__PURE__ */ jsx2(
|
|
236
|
+
RNText,
|
|
237
|
+
{
|
|
238
|
+
style: baseStyle,
|
|
239
|
+
numberOfLines,
|
|
240
|
+
testID: id,
|
|
241
|
+
accessibilityRole,
|
|
242
|
+
children
|
|
243
|
+
}
|
|
244
|
+
);
|
|
214
245
|
};
|
|
215
246
|
|
|
216
247
|
// ../primitives-native/src/Icon.tsx
|