decord/source/utils/ChangeLogUtils.tsx

228 lines
7.2 KiB
TypeScript
Raw Normal View History

// Module ID: 8093
// Function ID: 8094
2026-07-29 08:29:29 +00:00
// Name: defaultRules
// Dependencies: [4257, 8094, 5005, 5025, 5026, 4550, 2]
2026-07-20 16:05:17 +00:00
// Exports: renderChangelogMessageMarkup
// Module 8093 (defaultRules)
import tDefault from "t" /* 4257 */;
import get_defaultRulesDefault from "get defaultRules" /* 4550 */;
import textRegexpDefault from "textRegexp" /* 5005 */;
import regExpDefault from "regExp" /* 5025 */;
import _modDef5026 from "module_5026" /* 5026 */;
2026-08-24 06:08:38 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
function defaultRules(uri) {
2026-07-20 16:05:17 +00:00
let obj = {};
const merged = Object.assign(_require(8094).baseRules);
if (null != _require(8094).customRules.strong) {
2026-08-11 06:20:06 +00:00
obj = {};
const merged1 = Object.assign(tmp(8094).baseRules.strong);
if (typeof tmp(8094).customRules.strong === "function") {
const customRules = tmp(8094).customRules;
2026-08-11 06:20:06 +00:00
let strong = customRules.strong(uri);
} else {
strong = tmp(8094).customRules.strong;
2026-08-11 06:20:06 +00:00
}
obj = { strong: null };
const merged2 = Object.assign(strong);
obj[0] = obj;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
obj1 = {};
2026-08-11 06:20:06 +00:00
const merged3 = Object.assign(obj1);
const obj2 = {};
const merged4 = Object.assign(image);
if (typeof tmp(8094).customRules.image === "function") {
const customRules2 = tmp(8094).customRules;
2026-08-11 06:20:06 +00:00
image = customRules2.image(uri);
} else {
image = tmp(8094).customRules.image;
2026-08-11 06:20:06 +00:00
}
const merged5 = Object.assign(image);
obj.image = obj2;
const obj3 = {};
const merged6 = Object.assign(link);
if (typeof tmp(8094).customRules.link === "function") {
const customRules3 = tmp(8094).customRules;
2026-08-11 06:20:06 +00:00
link = customRules3.link(uri);
} else {
link = tmp(8094).customRules.link;
2026-08-11 06:20:06 +00:00
}
const merged7 = Object.assign(link);
obj.link = obj3;
const obj4 = {};
const merged8 = Object.assign(list);
if (typeof tmp(8094).customRules.list === "function") {
const customRules4 = tmp(8094).customRules;
2026-08-11 06:20:06 +00:00
list = customRules4.list(uri);
} else {
list = tmp(8094).customRules.list;
2026-08-11 06:20:06 +00:00
}
const merged9 = Object.assign(list);
obj.list = obj4;
const obj5 = { order: null, match: null, parse: null, react: null };
2026-08-24 06:08:38 +00:00
obj5[0] = textRegexpDefault.order;
2026-08-11 06:20:06 +00:00
obj5[1] = function match(arg0) {
2026-07-29 08:29:29 +00:00
return regex.exec(arg0);
2026-08-11 06:20:06 +00:00
};
obj5[2] = function parse(arg0, arg1, arg2) {
2026-07-20 16:05:17 +00:00
if (null == arg2.interpolations[arg0[1]]) {
2026-07-29 08:29:29 +00:00
let obj = { type: "text", content: null };
obj[1] = arg0[0];
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { type: "interpolation", renderer: null };
obj[1] = tmp;
2026-07-20 16:05:17 +00:00
}
return obj;
2026-08-11 06:20:06 +00:00
};
obj5[3] = function react(renderer) {
2026-07-20 16:05:17 +00:00
return renderer.renderer();
2026-08-11 06:20:06 +00:00
};
obj.interpolation = obj5;
const obj6 = {};
const merged10 = Object.assign(lheading);
_require = true;
obj6.parse = (arg0, arg1, inline) => {
2026-08-24 06:08:38 +00:00
const match = closure_1_10.exec(arg0[1]);
const str2 = arg0[1].replace(closure_1_10, "");
2026-08-11 06:20:06 +00:00
let formatted = str2;
if (c0) {
formatted = str2.toUpperCase();
}
let tmp3 = null;
if (null != match) {
tmp3 = match[1];
}
const obj = { className: tmp3, level: null, content: null };
let num = 2;
if ("=" === arg0[2]) {
num = 1;
}
obj[1] = num;
2026-08-24 06:08:38 +00:00
obj[2] = closure_1_1(closure_1_2[0]).parseInline(arg1, formatted, inline);
2026-08-11 06:20:06 +00:00
return obj;
};
if (typeof tmp(8094).customRules.lheading === "function") {
const customRules5 = tmp(8094).customRules;
2026-08-11 06:20:06 +00:00
lheading = customRules5.lheading(uri);
} else {
lheading = tmp(8094).customRules.lheading;
2026-07-20 16:05:17 +00:00
}
2026-08-11 06:20:06 +00:00
const merged11 = Object.assign(lheading);
obj.lheading = obj6;
const obj7 = {};
const merged12 = Object.assign(heading);
if (typeof tmp(8094).customRules.heading === "function") {
const customRules6 = tmp(8094).customRules;
2026-08-11 06:20:06 +00:00
heading = customRules6.heading(uri);
} else {
heading = tmp(8094).customRules.heading;
2026-07-29 08:29:29 +00:00
}
2026-08-11 06:20:06 +00:00
const merged13 = Object.assign(heading);
obj.heading = obj7;
const obj8 = {};
const merged14 = Object.assign(blockQuote);
if (typeof tmp(8094).customRules.blockQuote === "function") {
const customRules7 = tmp(8094).customRules;
2026-08-11 06:20:06 +00:00
blockQuote = customRules7.blockQuote(uri);
} else {
blockQuote = tmp(8094).customRules.blockQuote;
2026-07-29 08:29:29 +00:00
}
2026-08-11 06:20:06 +00:00
const merged15 = Object.assign(blockQuote);
obj.blockQuote = obj8;
const obj9 = {};
const merged16 = Object.assign(paragraph);
if (typeof tmp(8094).customRules.paragraph === "function") {
const customRules8 = tmp(8094).customRules;
2026-08-11 06:20:06 +00:00
paragraph = customRules8.paragraph(uri);
} else {
paragraph = tmp(8094).customRules.paragraph;
2026-07-29 08:29:29 +00:00
}
2026-08-11 06:20:06 +00:00
const merged17 = Object.assign(paragraph);
obj.paragraph = obj9;
2026-07-29 08:29:29 +00:00
return obj;
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
let lheading = tDefault.defaultRules.lheading;
let heading = tDefault.defaultRules.heading;
let link = tDefault.defaultRules.link;
let image = tDefault.defaultRules.image;
let list = tDefault.defaultRules.list;
let blockQuote = tDefault.defaultRules.blockQuote;
let paragraph = tDefault.defaultRules.paragraph;
2026-07-23 10:11:24 +00:00
const re10 = /\{(.+?)}/;
const re11 = /^\$(\w+?)\$/;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("utils/ChangeLogUtils.tsx");
2026-07-20 16:05:17 +00:00
export default {
2026-07-29 08:29:29 +00:00
getDefaultRules(uri) {
const merged = Object.assign(defaultRules(uri));
2026-07-20 16:05:17 +00:00
return {};
},
2026-07-29 08:29:29 +00:00
getSpecialRules(uri) {
let obj = {};
const merged = Object.assign(defaultRules(uri));
obj = {};
const merged1 = Object.assign(lheading);
const _require = false;
obj.parse = (arg0, arg1, inline) => {
2026-08-24 06:08:38 +00:00
const match = closure_1_10.exec(arg0[1]);
const str2 = arg0[1].replace(closure_1_10, "");
2026-07-29 08:29:29 +00:00
let formatted = str2;
if (c0) {
formatted = str2.toUpperCase();
}
let tmp3 = null;
if (null != match) {
tmp3 = match[1];
}
const obj = { className: tmp3, level: null, content: null };
let num = 2;
if ("=" === arg0[2]) {
num = 1;
}
obj[1] = num;
2026-08-24 06:08:38 +00:00
obj[2] = closure_1_1(closure_1_2[0]).parseInline(arg1, formatted, inline);
2026-07-29 08:29:29 +00:00
return obj;
};
if (typeof _require(8094).customRules.lheading === "function") {
const customRules = tmp3(8094).customRules;
2026-07-29 08:29:29 +00:00
lheading = customRules.lheading(uri);
} else {
lheading = tmp3(8094).customRules.lheading;
2026-07-29 08:29:29 +00:00
}
obj = { lheading: null };
const merged2 = Object.assign(lheading);
obj[0] = obj;
const merged3 = Object.assign(obj);
return obj;
},
getMessageRules(uri) {
let obj = {};
obj = {};
const merged = Object.assign(defaultRules(uri));
obj = {};
2026-08-24 06:08:38 +00:00
const merged1 = Object.assign(tDefault.defaultRules.newline);
2026-07-29 08:29:29 +00:00
obj.newline = obj;
2026-08-24 06:08:38 +00:00
obj.text = textRegexpDefault;
obj.list = regExpDefault;
obj.subtext = _modDef5026;
2026-07-29 08:29:29 +00:00
const merged2 = Object.assign(obj);
return obj;
2026-07-20 16:05:17 +00:00
}
};
2026-07-29 08:29:29 +00:00
export const renderChangelogMessageMarkup = function renderChangelogMessageMarkup(content, uri) {
2026-08-24 06:08:38 +00:00
let obj = get_defaultRulesDefault;
2026-07-29 08:29:29 +00:00
obj = {};
const merged = Object.assign(defaultRules(uri));
if (null != arg2) {
obj = { changeLog: null };
obj[0] = arg2;
2026-08-24 06:08:38 +00:00
obj1 = obj;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj1 = {};
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const reactParserForResult = obj.reactParserFor(obj);
return { hasSpoilerEmbeds: false, hasBailedAst: false, content: obj.reactParserFor(obj)(content.content, false, obj1) };
2026-07-20 16:05:17 +00:00
};