99 lines
5.9 KiB
TypeScript
99 lines
5.9 KiB
TypeScript
/* Metro module 10978; source: modules/message_previews/native/MessagePreviewMarkup.tsx; dependencies: [6623, 6624, 10979, 3855, 6622, 3834, 1393, 2] */
|
|
function _fun84044(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11164:6, offset: 0x01f35b26, size: 228 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const closure = renderASTToReact;
|
|
const closure2 = getMessagePreviewASTParser;
|
|
const closure3 = getOrParseMessagePreviewMarkupAST;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = importDefault(1393) /* metro dependency 1393 */;
|
|
value = new value({max: 2000});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/message_previews/native/MessagePreviewMarkup.tsx');
|
|
exports.renderASTToReact = closure;
|
|
exports.getMessagePreviewASTParser = closure2;
|
|
exports.renderMessagePreviewMarkup = renderMessagePreviewMarkup;
|
|
exports.messagePreviewASTCache = value;
|
|
exports.getOrParseMessagePreviewMarkupAST = closure3;
|
|
}
|
|
|
|
function getRules({layout, color, fontScale, maxFontSizeMultiplier}) { // fn#84045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11164:43, offset: 0x01f35c0a, size: 108 bytes, params: 2, frame: 21
|
|
const combineMarkupRules = importDefault(6623) /* metro dependency 6623: combineMarkupRules */;
|
|
const RULES = (importDefault(6624) /* metro dependency 6624: MarkupRules */).RULES;
|
|
return combineMarkupRules([RULES,
|
|
(importDefault(10979) /* metro dependency 10979: MarkupMessagePreviewReactRules */)(layout, color, fontScale,
|
|
maxFontSizeMultiplier)]);
|
|
}
|
|
|
|
function renderASTToReact({tree, initialParserState, layout, color, fontScale, maxFontSizeMultiplier}) { // fn#84046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11164:166, offset: 0x01f35c76, size: 137 bytes, params: 2, frame: 18
|
|
const rules = getRules({layout: layout, color: color, fontScale: fontScale,
|
|
maxFontSizeMultiplier: maxFontSizeMultiplier});
|
|
const value = importDefault(3855) /* metro dependency 3855 */;
|
|
const reactFor = value.reactFor;
|
|
const defaultImport = value;
|
|
return Reflect.apply(reactFor, value, [defaultImport.ruleOutput(rules, 'react')])(tree, initialParserState);
|
|
}
|
|
|
|
function getMessagePreviewASTParser({layout, color, fontScale, maxFontSizeMultiplier}) { // fn#84047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11164:407, offset: 0x01f35cff, size: 94 bytes, params: 2, frame: 15
|
|
return (importDefault(6622) /* metro dependency 6622: MarkupUtils */).astParserFor(getRules({layout: layout,
|
|
color: color, fontScale: fontScale, maxFontSizeMultiplier: maxFontSizeMultiplier}));
|
|
}
|
|
|
|
function getOrParseMessagePreviewMarkupAST({content, layout, color, initialParserState, postProcessor, fontScale, maxFontSizeMultiplier}) { // fn#84048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11164:680, offset: 0x01f35d5d, size: 204 bytes, params: 2, frame: 23
|
|
var r1;
|
|
var r3;
|
|
var property;
|
|
const value2 = env0_3.get(content);
|
|
if (value2 != null) {
|
|
return value2;
|
|
}
|
|
const messagePreviewASTParser = getMessagePreviewASTParser({layout: layout, color: color, fontScale: fontScale,
|
|
maxFontSizeMultiplier: maxFontSizeMultiplier});
|
|
const value5 = content.startsWith('```');
|
|
if (value5) {
|
|
r1 = value5;
|
|
r3 = undefined;
|
|
} else {
|
|
property = content.split('\n')[0];
|
|
r1 = property.includes('||');
|
|
r3 = property;
|
|
}
|
|
r3 = r1 ? content : r3;
|
|
const value8 = messagePreviewASTParser(r3, true, initialParserState, postProcessor);
|
|
env0_3.set(content, value8);
|
|
return value8;
|
|
}
|
|
|
|
function renderMessagePreviewMarkup({content, muted, guildId, channelId, layout, color, postProcessor, disableAnimatedEmoji, fontScale, maxFontSizeMultiplier}) { // fn#84049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11164:1262, offset: 0x01f35e29, size: 322 bytes, params: 2, frame: 23
|
|
const r6 = layout !== undefined ? layout : (require(3834) /* metro dependency 3834: ChannelListLayoutTypes */).ChannelListLayoutTypes.COMPACT;
|
|
disableAnimatedEmoji = disableAnimatedEmoji === undefined || disableAnimatedEmoji;
|
|
fontScale = fontScale === undefined ? 1 : fontScale;
|
|
if (content === '') {
|
|
return null;
|
|
}
|
|
const object3 = {'allowLinks': true, 'allowDevLinks': false, 'allowEmojiLinks': false, 'allowGameMentions': false,
|
|
'mentionChannels': null, 'mentionGames': null, 'soundboardSounds': null, 'formatInline': true,
|
|
'noStyleAndInteraction': true, 'allowHeading': true, 'allowList': true, 'disableAutoBlockNewlines': true,
|
|
'previewLinkTarget': false};
|
|
object3.mentionChannels = [];
|
|
const Map = global.Map;
|
|
object3.mentionGames = new Map();
|
|
object3.soundboardSounds = [];
|
|
object3.disableAnimatedEmoji = disableAnimatedEmoji;
|
|
object3.unknownUserMentionPlaceholder = true;
|
|
object3.guildId = guildId;
|
|
object3.channelId = channelId;
|
|
object3.muted = muted != null && muted;
|
|
const renderASTToReactBinding = renderASTToReact;
|
|
const object4 = {};
|
|
object4.tree = getOrParseMessagePreviewMarkupAST({content: content, layout: r6, color: color,
|
|
initialParserState: object3, fontScale: fontScale, maxFontSizeMultiplier: maxFontSizeMultiplier,
|
|
postProcessor: postProcessor});
|
|
object4.initialParserState = object3;
|
|
object4.layout = r6;
|
|
object4.color = color;
|
|
object4.fontScale = fontScale;
|
|
object4.maxFontSizeMultiplier = maxFontSizeMultiplier;
|
|
return renderASTToReactBinding(object4);
|
|
}
|
|
|