decord/source/modules/markup/native/MarkupMessagePreviewReactRules.tsx

235 lines
8.8 KiB
TypeScript
Raw Normal View History

2026-08-13 07:00:46 +00:00
// Module ID: 9843
// Function ID: 9844
2026-07-20 16:05:17 +00:00
// Name: defaultReactFn
2026-08-13 07:00:46 +00:00
// Dependencies: [19, 9844, 21, 4337, 8241, 9845, 5817, 4775, 4777, 9850, 5308, 501, 9851, 9852, 1297, 9853, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-13 07:00:46 +00:00
// Module 9843 (defaultReactFn)
import "noop";
2026-07-23 10:11:24 +00:00
import { MUTED_OPACITY_CONTENT } from "hairlineWidth";
import jsxProd from "jsxProd";
2026-07-29 08:29:29 +00:00
let c4;
let c5;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function defaultReactFn(content, output, state) {
2026-08-04 21:03:28 +00:00
if (typeof content.content === "string") {
2026-07-20 16:05:17 +00:00
content = content.content;
} else {
2026-08-13 07:00:46 +00:00
content = require(8241) /* smartOutput */.smartOutput(content, output, state);
const obj = require(8241) /* smartOutput */;
2026-07-20 16:05:17 +00:00
}
return content;
}
2026-08-13 07:00:46 +00:00
function createMessagePreviewReactRules(customEmojiSize) {
let num = customEmojiSize.customEmojiSize;
if (num === undefined) {
num = 15;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj = { [closure_0(closure_2[7]).AST_KEY.TEXT]: obj };
2026-07-20 16:05:17 +00:00
obj = { react: defaultReactFn };
obj = {};
2026-08-13 07:00:46 +00:00
const merged = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.STRIKETHROUGH]);
2026-07-29 08:29:29 +00:00
obj.react = defaultReactFn;
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.STRIKETHROUGH] = obj;
2026-07-23 10:11:24 +00:00
let obj1 = {};
2026-08-13 07:00:46 +00:00
const merged1 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.UNDERLINE]);
2026-07-29 08:29:29 +00:00
obj1.react = defaultReactFn;
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.UNDERLINE] = obj1;
2026-07-23 10:11:24 +00:00
let obj2 = {};
2026-08-13 07:00:46 +00:00
const merged2 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.ITALICS]);
2026-07-29 08:29:29 +00:00
obj2.react = defaultReactFn;
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.ITALICS] = obj2;
2026-07-29 08:29:29 +00:00
const obj3 = {};
2026-08-13 07:00:46 +00:00
const merged3 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.STRONG]);
2026-07-29 08:29:29 +00:00
obj3.react = defaultReactFn;
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.STRONG] = obj3;
2026-07-29 08:29:29 +00:00
const obj4 = {};
2026-08-13 07:00:46 +00:00
const merged4 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.LINK]);
2026-07-29 08:29:29 +00:00
obj4.react = defaultReactFn;
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.LINK] = obj4;
2026-07-20 16:05:17 +00:00
const obj5 = {};
2026-08-13 07:00:46 +00:00
const merged5 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.URL]);
2026-07-29 08:29:29 +00:00
obj5.react = defaultReactFn;
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.URL] = obj5;
2026-07-20 16:05:17 +00:00
const obj6 = {};
2026-08-13 07:00:46 +00:00
const merged6 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.AUTOLINK]);
2026-07-29 08:29:29 +00:00
obj6.react = defaultReactFn;
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.AUTOLINK] = obj6;
2026-07-20 16:05:17 +00:00
const obj7 = {};
2026-08-13 07:00:46 +00:00
const merged7 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.LINE_BREAK]);
2026-07-29 08:29:29 +00:00
obj7.react = function react() {
2026-07-20 16:05:17 +00:00
return "\n";
};
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.LINE_BREAK] = obj7;
obj[num(4775).AST_KEY.HIGHLIGHT] = {
2026-07-20 16:05:17 +00:00
react(node, output, key) {
2026-07-29 08:29:29 +00:00
const obj = { children: null };
2026-08-13 07:00:46 +00:00
const tmp = callback(9850);
obj[0] = num(8241).smartOutput(node, output, key);
2026-07-29 08:29:29 +00:00
return callback2(tmp, obj, key.key);
2026-07-20 16:05:17 +00:00
}
};
const obj8 = {};
2026-08-13 07:00:46 +00:00
const merged8 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.BLOCK_QUOTE]);
2026-07-29 08:29:29 +00:00
obj8.react = defaultReactFn;
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.BLOCK_QUOTE] = obj8;
2026-07-20 16:05:17 +00:00
const obj9 = {};
2026-08-13 07:00:46 +00:00
const merged9 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.PARAGRAPH]);
2026-07-29 08:29:29 +00:00
obj9.order = 600;
obj9.react = defaultReactFn;
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.PARAGRAPH] = obj9;
obj[num(4775).AST_KEY.EMOJI] = {
2026-07-20 16:05:17 +00:00
react(surrogate) {
return surrogate.surrogate || surrogate.content;
}
};
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.CUSTOM_EMOJI] = {
2026-07-20 16:05:17 +00:00
react(src, arg1, muted) {
if (src.src) {
2026-08-13 07:00:46 +00:00
let obj = num(outer1_2[5]);
const sizeStyle = obj.makeSizeStyle(num);
2026-07-29 08:29:29 +00:00
const items = [sizeStyle, { resizeMode: "contain" }, , ];
2026-08-13 07:00:46 +00:00
let obj1 = num(outer1_2[11]);
2026-07-29 08:29:29 +00:00
let isAndroidResult = obj1.isAndroid();
2026-07-20 16:05:17 +00:00
if (isAndroidResult) {
2026-07-29 08:29:29 +00:00
obj = { transform: null };
const items1 = [{ translateY: 3 }];
obj[0] = items1;
isAndroidResult = obj;
2026-07-20 16:05:17 +00:00
}
items[2] = isAndroidResult;
muted = muted.muted;
if (muted) {
2026-07-29 08:29:29 +00:00
obj = { opacity: null };
obj[0] = outer1_3;
muted = obj;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj1 = { style: null, source: null };
2026-07-20 16:05:17 +00:00
items[3] = muted;
2026-07-29 08:29:29 +00:00
obj1[0] = items;
const obj2 = { uri: null };
obj2[0] = src.src;
obj1[1] = obj2;
2026-08-13 07:00:46 +00:00
return outer1_4(outer1_1(outer1_2[10]), obj1, muted.key);
2026-07-20 16:05:17 +00:00
} else {
return src.alt;
}
}
};
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.SPOILER] = {
2026-07-20 16:05:17 +00:00
react(node, output, muted) {
2026-07-29 08:29:29 +00:00
const obj = { disableReveal: true, muted: muted.muted, children: null };
2026-08-13 07:00:46 +00:00
const tmp = callback(9851);
obj[2] = num(8241).smartOutput(node, output, muted);
2026-07-29 08:29:29 +00:00
return callback2(tmp, obj, muted.key);
2026-07-20 16:05:17 +00:00
}
};
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.STATIC_ROUTE_LINK] = {
2026-07-20 16:05:17 +00:00
react(channelId, output, state) {
let smartOutputResult = null;
if (obj.isStaticRouteIconType(channelId.channelId)) {
2026-08-13 07:00:46 +00:00
smartOutputResult = num(8241).smartOutput(channelId, output, state);
const tmpResult = num(8241);
2026-07-20 16:05:17 +00:00
}
return smartOutputResult;
}
};
const obj10 = {};
2026-08-13 07:00:46 +00:00
const merged10 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.INLINE_CODE]);
2026-07-29 08:29:29 +00:00
obj10.react = defaultReactFn;
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.INLINE_CODE] = obj10;
2026-07-20 16:05:17 +00:00
const obj11 = {};
2026-08-13 07:00:46 +00:00
const merged11 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.CODE_BLOCK]);
2026-07-29 08:29:29 +00:00
obj11.parse = function parse(arg0, arg1, arg2) {
2026-08-13 07:00:46 +00:00
const parsed = callback(4777).RULES[num(undefined, 4775).AST_KEY.CODE_BLOCK].parse(arg0, arg1, arg2);
2026-07-20 16:05:17 +00:00
if ("ansi" === str.toLowerCase()) {
const content = parsed.content;
2026-07-29 08:29:29 +00:00
parsed.content = content.replaceAll(closure_6, "");
2026-07-20 16:05:17 +00:00
}
return parsed;
};
2026-07-29 08:29:29 +00:00
obj11.react = defaultReactFn;
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.CODE_BLOCK] = obj11;
2026-07-20 16:05:17 +00:00
const obj12 = {};
2026-08-13 07:00:46 +00:00
const merged12 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.MENTION]);
2026-07-29 08:29:29 +00:00
obj12.react = defaultReactFn;
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.MENTION] = obj12;
2026-07-20 16:05:17 +00:00
const obj13 = {};
2026-08-13 07:00:46 +00:00
const merged13 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.CHANNEL_MENTION]);
obj13.react = num(9852).inlineChannelMentionReact;
obj[num(4775).AST_KEY.CHANNEL_MENTION] = obj13;
2026-07-20 16:05:17 +00:00
const obj14 = {};
2026-08-13 07:00:46 +00:00
const merged14 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.ATTACHMENT_LINK]);
2026-07-29 08:29:29 +00:00
obj14.react = function react(node, output, key) {
2026-08-13 07:00:46 +00:00
const obj = { children: null };
const items = ["\u{1F4CE} ", num(8241).smartOutput(node, output, key)];
2026-07-29 08:29:29 +00:00
obj[0] = items;
2026-08-13 07:00:46 +00:00
return callback3(num(1297).LegacyText, obj, key.key);
2026-07-20 16:05:17 +00:00
};
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.ATTACHMENT_LINK] = obj14;
2026-07-20 16:05:17 +00:00
const obj15 = {};
2026-08-13 07:00:46 +00:00
const merged15 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.SOUNDBOARD]);
2026-07-29 08:29:29 +00:00
obj15.react = defaultReactFn;
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.SOUNDBOARD] = obj15;
obj[num(4775).AST_KEY.GUILD] = { react: defaultReactFn };
const obj16 = { react: null };
let obj19 = num(9852);
obj16[0] = obj19.createInlineChannelReact("\u{1F4AC}");
obj[num(4775).AST_KEY.CHANNEL] = obj16;
const obj17 = {};
const merged16 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.COMMAND_MENTION]);
obj17.react = function react(node, output, key) {
2026-07-29 08:29:29 +00:00
const obj = { children: null };
2026-08-13 07:00:46 +00:00
const items = ["/", num(8241).smartOutput(node, output, key)];
2026-07-29 08:29:29 +00:00
obj[0] = items;
2026-08-13 07:00:46 +00:00
return callback3(num(1297).LegacyText, obj, key.key);
2026-07-20 16:05:17 +00:00
};
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.COMMAND_MENTION] = obj17;
const obj18 = {};
const merged17 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.TIMESTAMP]);
obj18.react = function react(node, arg1, key) {
return callback2(callback(9853), { node, style: null }, key.key);
2026-07-20 16:05:17 +00:00
};
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.TIMESTAMP] = obj18;
obj19 = {};
const merged18 = Object.assign(importDefault(4777).RULES[num(undefined, 4775).AST_KEY.LIST]);
obj19.react = function react(arg0, output, state) {
2026-07-20 16:05:17 +00:00
const first = arg0.items[0];
let first1 = first;
if (Array.isArray(first)) {
first1 = first[0];
}
let smartOutputResult = null;
if (null != first1) {
2026-08-13 07:00:46 +00:00
smartOutputResult = num(8241).smartOutput(first1, output, state);
const obj = num(8241);
2026-07-20 16:05:17 +00:00
}
return smartOutputResult;
};
2026-08-13 07:00:46 +00:00
obj[num(4775).AST_KEY.LIST] = obj19;
obj[num(4775).AST_KEY.HEADING] = { react: defaultReactFn };
obj[num(4775).AST_KEY.SUBTEXT] = { react: defaultReactFn };
2026-07-20 16:05:17 +00:00
return obj;
}
2026-07-29 08:29:29 +00:00
({ jsx: c4, jsxs: c5 } = jsxProd);
const regExp = new RegExp(require("regExp").ANSI_CONTROL_SEQUENCE_RE, "g");
2026-07-23 10:11:24 +00:00
const result = require("jsxProd").fileFinishedImporting("modules/markup/native/MarkupMessagePreviewReactRules.tsx");
2026-07-20 16:05:17 +00:00
2026-08-13 07:00:46 +00:00
export default function createChannelListMessagePreviewReactRules(layout) {
let obj = require(9845) /* getLayoutStyles */;
2026-07-20 16:05:17 +00:00
let bound = arg2;
2026-08-13 07:00:46 +00:00
const layoutStyles = obj.getLayoutStyles(layout);
2026-07-20 16:05:17 +00:00
if (null != arg3) {
const _Math = Math;
bound = Math.min(arg2, arg3);
}
2026-08-13 07:00:46 +00:00
let num = require(5817) /* ICON_SIZE */.ICON_SIZE[layoutStyles.messagePreview.messageTypeIconSizeNew];
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
2026-08-13 07:00:46 +00:00
obj = { customEmojiSize: num * bound };
2026-07-20 16:05:17 +00:00
return createMessagePreviewReactRules(obj);
};
export { createMessagePreviewReactRules };