decord/source/i18n/native/updateRules.tsx

94 lines
3.3 KiB
TypeScript
Raw Normal View History

// Module ID: 17281
// Function ID: 17282
2026-07-20 16:05:17 +00:00
// Name: I18nLink
// Dependencies: [19, 1074, 21, 4279, 4262, 576, 4255, 4257, 1178, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 17281 (I18nLink)
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
import { jsx } from "jsxProd" /* 21 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
class I18nLink {
constructor(arg0) {
node = global.node;
2026-07-29 08:29:29 +00:00
alwaysShowLinkDecorations = undefined;
2026-08-24 06:08:38 +00:00
closure_2 = undefined;
2026-07-20 16:05:17 +00:00
obj = {};
({ output, state } = global);
2026-07-29 08:29:29 +00:00
tmp = node;
2026-08-24 06:08:38 +00:00
tmp2 = closure_2;
alwaysShowLinkDecorations = closure_3.useContext(require("context").AccessibilityPreferencesContext).alwaysShowLinkDecorations;
2026-07-23 10:11:24 +00:00
obj2 = require("map");
2026-07-29 08:29:29 +00:00
token = obj2.useToken(require("Themes").colors.TEXT_LINK);
2026-08-24 06:08:38 +00:00
closure_2 = token;
2026-07-20 16:05:17 +00:00
items = [, ];
items[0] = token;
items[1] = alwaysShowLinkDecorations;
2026-08-24 06:08:38 +00:00
memo = closure_3.useMemo(() => {
2026-07-29 08:29:29 +00:00
const obj = { color: token, textDecorationLine: null };
2026-07-20 16:05:17 +00:00
let str = "none";
if (alwaysShowLinkDecorations) {
str = "underline";
}
2026-07-29 08:29:29 +00:00
obj[1] = str;
2026-07-20 16:05:17 +00:00
return obj;
}, items);
if (null != node.context) {
2026-07-29 08:29:29 +00:00
tmp5 = node.context[node.target];
if (tmp5) {
if (tmp5.onClick) {
obj.onClick = tmp5.onClick;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj.onClick = tmp5;
2026-07-20 16:05:17 +00:00
}
if (null == obj.onClick) {
obj.onClick = () => {
const obj = alwaysShowLinkDecorations(token[6]);
return obj.openURL(alwaysShowLinkDecorations(token[7]).sanitizeUrl(node.target));
};
}
2026-08-24 06:08:38 +00:00
obj = { accessible: true, accessibilityRole: "link", onPress: obj.onClick, style: memo, children: output(node.content, state) };
2026-07-23 10:11:24 +00:00
return jsx(require("Button").LegacyText, obj);
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
let closure_5 = { strong: { fontFamily: require("ME").Fonts.PRIMARY_SEMIBOLD }, italic: { fontStyle: "italic" }, underline: { textDecorationLine: "underline" } };
let obj = { fontFamily: require("ME").Fonts.PRIMARY_SEMIBOLD };
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("i18n/native/updateRules.tsx");
2026-07-20 16:05:17 +00:00
export default function updateRules(paragraph) {
let obj = {};
const merged = Object.assign(paragraph.paragraph);
2026-07-29 08:29:29 +00:00
obj.react = function react(content, arg1, key) {
return callback2(callback(1178).LegacyText, { children: arg1(content.content, key) }, key.key);
2026-07-20 16:05:17 +00:00
};
paragraph.paragraph = obj;
obj = {};
const merged1 = Object.assign(paragraph.strong);
2026-07-29 08:29:29 +00:00
obj.react = function react(content, arg1, key) {
return callback2(callback(1178).LegacyText, { style: closure_5.strong, children: arg1(content.content, key) }, key.key);
2026-07-20 16:05:17 +00:00
};
paragraph.strong = obj;
obj = {};
const merged2 = Object.assign(paragraph.em);
2026-07-29 08:29:29 +00:00
obj.react = function react(content, arg1, key) {
return callback2(callback(1178).LegacyText, { style: closure_5.italic, children: arg1(content.content, key) }, key.key);
2026-07-20 16:05:17 +00:00
};
paragraph.em = obj;
2026-08-24 06:08:38 +00:00
obj1 = {};
2026-07-20 16:05:17 +00:00
const merged3 = Object.assign(paragraph.u);
2026-07-29 08:29:29 +00:00
obj1.react = function react(content, arg1, key) {
return callback2(callback(1178).LegacyText, { style: closure_5.underline, children: arg1(content.content, key) }, key.key);
2026-07-20 16:05:17 +00:00
};
paragraph.u = obj1;
const obj2 = {};
const merged4 = Object.assign(paragraph.link);
2026-07-29 08:29:29 +00:00
obj2.react = function react(node, output, key) {
return callback2(closure_6, { node, output, state: key }, key.key);
2026-07-20 16:05:17 +00:00
};
paragraph.link = obj2;
return paragraph;
};
export { I18nLink };