107 lines
6.7 KiB
TypeScript
107 lines
6.7 KiB
TypeScript
/* Metro module 10978; source: modules/message_previews/native/MessagePreviewMarkup.tsx; dependencies: [6623, 6624, 10979, 3855, 6622, 3834, 1393, 2] */
|
|
import Module01393 from '../../../by-id/module-01393.js'; /* Metro dependency 1393 */
|
|
import Module03855 from '../../../by-id/module-03855.js'; /* Metro dependency 3855 */
|
|
import MarkupUtils from '../../markup/MarkupUtils.tsx'; /* Metro dependency 6622 */
|
|
import CombineMarkupRules from '../../markup/combineMarkupRules.tsx'; /* Metro dependency 6623 */
|
|
import MarkupRules from '../../markup/MarkupRules.tsx'; /* Metro dependency 6624 */
|
|
import MarkupMessagePreviewReactRules from '../../markup/native/MarkupMessagePreviewReactRules.tsx'; /* Metro dependency 10979 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 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 renderASTToReact2 = renderASTToReact;
|
|
const getMessagePreviewASTParser2 = getMessagePreviewASTParser;
|
|
const getOrParseMessagePreviewMarkupAST2 = getOrParseMessagePreviewMarkupAST;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = Module01393;
|
|
value = new value({max: 2000});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/message_previews/native/MessagePreviewMarkup.tsx');
|
|
exports.renderASTToReact = renderASTToReact2;
|
|
exports.getMessagePreviewASTParser = getMessagePreviewASTParser2;
|
|
exports.renderMessagePreviewMarkup = renderMessagePreviewMarkup;
|
|
exports.messagePreviewASTCache = value;
|
|
exports.getOrParseMessagePreviewMarkupAST = getOrParseMessagePreviewMarkupAST2;
|
|
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 RULES = (MarkupRules).RULES;
|
|
return CombineMarkupRules([RULES,
|
|
(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 reactFor = Module03855.reactFor;
|
|
const defaultImport = Module03855;
|
|
return Reflect.apply(reactFor, Module03855, [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 (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 object = {'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};
|
|
object.mentionChannels = [];
|
|
const Map = global.Map;
|
|
object.mentionGames = new Map();
|
|
object.soundboardSounds = [];
|
|
object.disableAnimatedEmoji = disableAnimatedEmoji;
|
|
object.unknownUserMentionPlaceholder = true;
|
|
object.guildId = guildId;
|
|
object.channelId = channelId;
|
|
object.muted = muted != null && muted;
|
|
const renderASTToReactBinding = renderASTToReact;
|
|
const object2 = {};
|
|
object2.tree = getOrParseMessagePreviewMarkupAST({content: content, layout: r6, color: color,
|
|
initialParserState: object, fontScale: fontScale, maxFontSizeMultiplier: maxFontSizeMultiplier,
|
|
postProcessor: postProcessor});
|
|
object2.initialParserState = object;
|
|
object2.layout = r6;
|
|
object2.color = color;
|
|
object2.fontScale = fontScale;
|
|
object2.maxFontSizeMultiplier = maxFontSizeMultiplier;
|
|
return renderASTToReactBinding(object2);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun84044, 10978, [6623, 6624, 10979, 3855, 6622, 3834, 1393,
|
|
2]) /* metro module 10978, dependencies: [6623, 6624, 10979, 3855, 6622, 3834, 1393, 2] */;
|