decord/alpha/source/i18n/native/updateRules.tsx

175 lines
5.6 KiB
TypeScript
Raw Permalink Normal View History

2026-10-13 12:43:34 +00:00
// Module ID: 18013
// Function ID: 18014
// Name: updateRules
2026-10-10 08:08:14 +00:00
// Dependencies: [19, 1085, 21, 558, 576, 4834, 4818, 587, 4806, 1949, 1200, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-10-13 12:43:34 +00:00
// Module 18013 (updateRules)
2026-10-03 08:58:59 +00:00
import Fragment from "Fragment" /* 21 */;
import nativeDefault from "native" /* 587 */;
import Constants from "Constants" /* 1085 */;
2026-10-08 09:57:35 +00:00
import native from "native" /* 1200 */;
2026-10-09 10:00:15 +00:00
import _modDef1949 from "module_1949" /* 1949 */;
2026-10-10 08:08:14 +00:00
import LinkingDefault from "Linking" /* 4806 */;
2026-10-03 08:58:59 +00:00
import react from "react" /* 19 */;
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
const Fonts = Constants.Fonts;
const jsx = Fragment.jsx;
let paragraph = { strong: { fontFamily: Fonts.PRIMARY_SEMIBOLD }, italic: { fontStyle: "italic" }, underline: { textDecorationLine: "underline" } };
2026-10-08 09:57:35 +00:00
let tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function I18nLink(node) {
2026-10-03 08:58:59 +00:00
let output;
let state;
2026-10-08 09:57:35 +00:00
const tmp = node;
2026-10-03 08:58:59 +00:00
let obj = node(576);
const cResult = obj.c(9);
node = node.node;
({ output, state } = node);
2026-10-10 08:08:14 +00:00
const alwaysShowLinkDecorations = react.useContext(node(4834).AccessibilityPreferencesContext).alwaysShowLinkDecorations;
const obj2 = node(4818);
2026-10-03 08:58:59 +00:00
const token = obj2.useToken(nativeDefault.colors.TEXT_LINK);
let str = "none";
if (alwaysShowLinkDecorations) {
str = "underline";
}
if (cResult[0] === token) {
2026-10-08 09:57:35 +00:00
let tmp5;
if (cResult[1] === str) {
tmp5 = cResult[2];
}
2026-10-03 08:58:59 +00:00
const obj3 = {};
2026-07-20 16:05:17 +00:00
if (null != node.context) {
2026-10-03 08:58:59 +00:00
if (node.context[node.target]) {
if (node.context[node.target].onClick) {
obj3.onClick = node.context[node.target].onClick;
}
}
obj3.onClick = node.context[node.target];
}
if (null == obj3.onClick) {
2026-10-08 09:57:35 +00:00
let tmp8;
2026-10-03 08:58:59 +00:00
if (cResult[3] !== node.target) {
2026-10-08 09:57:35 +00:00
const fn = function f() {
const openURL = LinkingDefault.openURL;
LinkingDefault;
2026-10-09 10:00:15 +00:00
const obj = _modDef1949;
2026-10-08 09:57:35 +00:00
return openURL(obj.sanitizeUrl(node.target));
};
2026-10-03 08:58:59 +00:00
cResult[3] = node.target;
2026-10-08 09:57:35 +00:00
cResult[4] = fn;
tmp8 = fn;
2026-10-03 08:58:59 +00:00
} else {
2026-10-08 09:57:35 +00:00
tmp8 = cResult[4];
2026-10-03 08:58:59 +00:00
}
2026-10-08 09:57:35 +00:00
obj3.onClick = tmp8;
2026-10-03 08:58:59 +00:00
}
if (cResult[5] === node.content) {
2026-10-08 09:57:35 +00:00
if (cResult[6] === output) {
let tmp10;
if (cResult[7] === state) {
tmp10 = cResult[8];
2026-07-20 16:05:17 +00:00
}
2026-10-08 09:57:35 +00:00
return jsx(tmp(1200).LegacyText, { accessible: true, accessibilityRole: "link", onPress: tmp9, style: tmp5, children: tmp10 });
2026-07-20 16:05:17 +00:00
}
}
2026-10-08 09:57:35 +00:00
const outputResult = output(node.content, state);
2026-10-03 08:58:59 +00:00
cResult[5] = node.content;
cResult[6] = output;
cResult[7] = state;
2026-10-08 09:57:35 +00:00
cResult[8] = outputResult;
tmp10 = outputResult;
2026-10-03 08:58:59 +00:00
}
2026-10-08 09:57:35 +00:00
const obj5 = { color: token, textDecorationLine: str };
2026-10-03 08:58:59 +00:00
cResult[0] = token;
cResult[1] = str;
2026-10-08 09:57:35 +00:00
cResult[2] = obj5;
tmp5 = obj5;
}) : (function I18nLink(node) {
2026-10-03 08:58:59 +00:00
let output;
let state;
node = node.node;
let token;
let obj = {};
({ output, state } = node);
const tmp = node;
const alwaysShowLinkDecorations = react.useContext(node(token[5]).AccessibilityPreferencesContext).alwaysShowLinkDecorations;
const obj2 = node(token[6]);
const tmp2 = token;
token = obj2.useToken(alwaysShowLinkDecorations(token[7]).colors.TEXT_LINK);
const items = [token, alwaysShowLinkDecorations];
const memo = react.useMemo(() => {
let str;
const obj = { color: token, textDecorationLine: str };
str = "none";
if (alwaysShowLinkDecorations) {
str = "underline";
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
return obj;
}, items);
if (null != node.context) {
if (node.context[node.target]) {
if (node.context[node.target].onClick) {
obj.onClick = node.context[node.target].onClick;
}
}
obj.onClick = node.context[node.target];
}
if (null == obj.onClick) {
obj.onClick = () => {
const openURL = LinkingDefault.openURL;
LinkingDefault;
2026-10-09 10:00:15 +00:00
const obj = _modDef1949;
2026-10-03 08:58:59 +00:00
return openURL(obj.sanitizeUrl(node.target));
};
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
const LegacyText = tmp(tmp2[10]).LegacyText;
return <LegacyText accessible accessibilityRole="link" onPress={obj.onClick} style={memo}>{output(node.content, state)}</LegacyText>;
});
let closure_6 = tmp2;
const result = size.fileFinishedImporting("i18n/native/updateRules.tsx");
2026-07-20 16:05:17 +00:00
export default function updateRules(paragraph) {
2026-10-03 08:58:59 +00:00
paragraph = {
2026-10-08 09:57:35 +00:00
react: function ParagraphReact(content, fn, key) {
2026-10-03 08:58:59 +00:00
const LegacyText = native.LegacyText;
return <LegacyText key={arg2.key}>{arg1(arg0.content, arg2)}</LegacyText>;
}
2026-07-20 16:05:17 +00:00
};
2026-10-03 08:58:59 +00:00
const merged = Object.assign(paragraph.paragraph);
paragraph.paragraph = paragraph;
2026-10-03 08:58:59 +00:00
const obj2 = {
2026-10-08 09:57:35 +00:00
react: function StrongReact(content, fn, key) {
2026-10-03 08:58:59 +00:00
const LegacyText = native.LegacyText;
return <LegacyText key={arg2.key} style={paragraph.strong}>{arg1(arg0.content, arg2)}</LegacyText>;
}
2026-07-20 16:05:17 +00:00
};
2026-10-03 08:58:59 +00:00
const merged1 = Object.assign(paragraph.strong);
paragraph.strong = obj2;
2026-10-03 08:58:59 +00:00
const obj3 = {
2026-10-08 09:57:35 +00:00
react: function EmReact(content, fn, key) {
2026-10-03 08:58:59 +00:00
const LegacyText = native.LegacyText;
return <LegacyText key={arg2.key} style={paragraph.italic}>{arg1(arg0.content, arg2)}</LegacyText>;
}
2026-07-20 16:05:17 +00:00
};
2026-10-03 08:58:59 +00:00
const merged2 = Object.assign(paragraph.em);
paragraph.em = obj3;
2026-10-03 08:58:59 +00:00
const obj4 = {
2026-10-08 09:57:35 +00:00
react: function UnderlineReact(content, fn, key) {
2026-10-03 08:58:59 +00:00
const LegacyText = native.LegacyText;
return <LegacyText key={arg2.key} style={paragraph.underline}>{arg1(arg0.content, arg2)}</LegacyText>;
}
2026-07-20 16:05:17 +00:00
};
2026-10-03 08:58:59 +00:00
const merged3 = Object.assign(paragraph.u);
paragraph.u = obj4;
2026-10-03 08:58:59 +00:00
const obj5 = {
react(node, output, state) {
return <closure_1_6 key={arg2.key} node={arg0} output={arg1} state={arg2} />;
}
2026-07-20 16:05:17 +00:00
};
2026-10-03 08:58:59 +00:00
const merged4 = Object.assign(paragraph.link);
paragraph.link = obj5;
2026-07-20 16:05:17 +00:00
return paragraph;
};
2026-10-03 08:58:59 +00:00
export const I18nLink = tmp2;