You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
330 lines
40 KiB
330 lines
40 KiB
3 years ago
|
/*
|
||
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||
|
if you want to view the source, please visit the github repository of this plugin
|
||
|
*/
|
||
|
|
||
|
var __create = Object.create;
|
||
|
var __defProp = Object.defineProperty;
|
||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||
|
var __getProtoOf = Object.getPrototypeOf;
|
||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
||
|
var __export = (target, all) => {
|
||
|
__markAsModule(target);
|
||
|
for (var name in all)
|
||
|
__defProp(target, name, { get: all[name], enumerable: true });
|
||
|
};
|
||
|
var __reExport = (target, module2, desc) => {
|
||
|
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
||
|
for (let key of __getOwnPropNames(module2))
|
||
|
if (!__hasOwnProp.call(target, key) && key !== "default")
|
||
|
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
||
|
}
|
||
|
return target;
|
||
|
};
|
||
|
var __toModule = (module2) => {
|
||
|
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
||
|
};
|
||
|
var __async = (__this, __arguments, generator) => {
|
||
|
return new Promise((resolve, reject) => {
|
||
|
var fulfilled = (value) => {
|
||
|
try {
|
||
|
step(generator.next(value));
|
||
|
} catch (e) {
|
||
|
reject(e);
|
||
|
}
|
||
|
};
|
||
|
var rejected = (value) => {
|
||
|
try {
|
||
|
step(generator.throw(value));
|
||
|
} catch (e) {
|
||
|
reject(e);
|
||
|
}
|
||
|
};
|
||
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
||
|
step((generator = generator.apply(__this, __arguments)).next());
|
||
|
});
|
||
|
};
|
||
|
|
||
|
// src/main.ts
|
||
|
__export(exports, {
|
||
|
default: () => DialoguePlugin
|
||
|
});
|
||
|
var import_obsidian2 = __toModule(require("obsidian"));
|
||
|
|
||
|
// src/constants/dialogueTitleMode.ts
|
||
|
var DialogueTitleMode;
|
||
|
(function(DialogueTitleMode2) {
|
||
|
DialogueTitleMode2["Disabled"] = "disabled";
|
||
|
DialogueTitleMode2["First"] = "first";
|
||
|
DialogueTitleMode2["All"] = "all";
|
||
|
})(DialogueTitleMode || (DialogueTitleMode = {}));
|
||
|
|
||
|
// src/constants/classes.ts
|
||
|
var CLASSES = class {
|
||
|
};
|
||
|
CLASSES.DIALOGUE_WRAPPER = "dialogue-plugin-wrapper";
|
||
|
CLASSES.BLOCK_WRAPPER = "dialogue-plugin-block-wrapper";
|
||
|
CLASSES.MESSAGE_WRAPPER_LEFT = "dialogue-plugin-message-wrapper-left";
|
||
|
CLASSES.MESSAGE_WRAPPER_RIGHT = "dialogue-plugin-message-wrapper-right";
|
||
|
CLASSES.MESSAGE = "dialogue-plugin-message";
|
||
|
CLASSES.MESSAGE_TITLE = "dialogue-plugin-message-title";
|
||
|
CLASSES.MESSAGE_CONTENT = "dialogue-plugin-message-content";
|
||
|
CLASSES.DELIMITER_WRAPPER = "dialogue-plugin-delimiter-wrapper";
|
||
|
CLASSES.DELIMITER = "dialogue-plugin-delimiter";
|
||
|
CLASSES.DELIMITER_DOT = "dialogue-plugin-delimiter-dot";
|
||
|
CLASSES.COMMENT_WRAPPER = "dialogue-plugin-comment-wrapper";
|
||
|
CLASSES.COMMENT = "dialogue-plugin-comment";
|
||
|
|
||
|
// src/components/message.ts
|
||
|
var SIDES = class {
|
||
|
};
|
||
|
SIDES.LEFT = "left";
|
||
|
SIDES.RIGHT = "right";
|
||
|
var Message = class {
|
||
|
constructor(content, side, dialogueSettings) {
|
||
|
this.content = content;
|
||
|
this.side = side;
|
||
|
this.dialogueSettings = dialogueSettings;
|
||
|
this.title = this.side == SIDES.LEFT ? this.dialogueSettings.leftTitle : this.dialogueSettings.rightTitle;
|
||
|
this.renderMessage();
|
||
|
}
|
||
|
renderMessage() {
|
||
|
const messageEl = this.createMessageEl();
|
||
|
if (this.titleShouldRender()) {
|
||
|
messageEl.createDiv({ cls: CLASSES.MESSAGE_TITLE, text: this.title });
|
||
|
}
|
||
|
messageEl.createDiv({ cls: CLASSES.MESSAGE_CONTENT, text: this.content });
|
||
|
}
|
||
|
createMessageEl() {
|
||
|
const sideClass = this.side == SIDES.LEFT ? CLASSES.MESSAGE_WRAPPER_LEFT : CLASSES.MESSAGE_WRAPPER_RIGHT;
|
||
|
const messageWrapperEl = this.dialogueSettings.parent.createDiv({
|
||
|
cls: `${CLASSES.BLOCK_WRAPPER} ${sideClass}`
|
||
|
});
|
||
|
return messageWrapperEl.createDiv({
|
||
|
cls: CLASSES.MESSAGE,
|
||
|
attr: {
|
||
|
style: `max-width: ${this.dialogueSettings.messageMaxWidth};`,
|
||
|
"data-participant-name": this.title,
|
||
|
"data-participant-id": this.dialogueSettings.participants.get(this.title)
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
titleShouldRender() {
|
||
|
if (this.title.length < 1)
|
||
|
return false;
|
||
|
switch (this.dialogueSettings.titleMode) {
|
||
|
case DialogueTitleMode.Disabled:
|
||
|
return false;
|
||
|
case DialogueTitleMode.All:
|
||
|
return true;
|
||
|
case DialogueTitleMode.First: {
|
||
|
if (this.side == SIDES.LEFT && !this.dialogueSettings.leftTitleRenderedOnce) {
|
||
|
this.dialogueSettings.leftTitleRenderedOnce = true;
|
||
|
return true;
|
||
|
} else if (this.side == SIDES.RIGHT && !this.dialogueSettings.rightTitleRenderedOnce) {
|
||
|
this.dialogueSettings.rightTitleRenderedOnce = true;
|
||
|
return true;
|
||
|
} else {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
default:
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
// src/components/delimiter.ts
|
||
|
var Delimiter = class {
|
||
|
constructor(dialogueSettings) {
|
||
|
this.dialogueSettings = dialogueSettings;
|
||
|
this.renderDelimiter();
|
||
|
}
|
||
|
renderDelimiter() {
|
||
|
const delimiterWrapperEl = this.dialogueSettings.parent.createDiv({
|
||
|
cls: `${CLASSES.BLOCK_WRAPPER} ${CLASSES.DELIMITER_WRAPPER}`
|
||
|
});
|
||
|
const delimiterEl = delimiterWrapperEl.createDiv({ cls: CLASSES.DELIMITER });
|
||
|
delimiterEl.createEl("div", { cls: CLASSES.DELIMITER_DOT });
|
||
|
delimiterEl.createEl("div", { cls: CLASSES.DELIMITER_DOT });
|
||
|
delimiterEl.createEl("div", { cls: CLASSES.DELIMITER_DOT });
|
||
|
}
|
||
|
};
|
||
|
|
||
|
// src/components/comment.ts
|
||
|
var Comment = class {
|
||
|
constructor(content, dialogueSettings) {
|
||
|
this.content = content;
|
||
|
this.dialogueSettings = dialogueSettings;
|
||
|
this.renderComment();
|
||
|
}
|
||
|
renderComment() {
|
||
|
const commentEl = this.dialogueSettings.parent.createDiv({
|
||
|
cls: `${CLASSES.BLOCK_WRAPPER} ${CLASSES.COMMENT_WRAPPER}`
|
||
|
});
|
||
|
return commentEl.createDiv({
|
||
|
cls: CLASSES.COMMENT,
|
||
|
text: this.content,
|
||
|
attr: {
|
||
|
style: `max-width: ${this.dialogueSettings.commentMaxWidth};`
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
|
||
|
// src/dialogue.ts
|
||
|
var KEYWORDS = class {
|
||
|
};
|
||
|
KEYWORDS.LEFT = "left:";
|
||
|
KEYWORDS.RIGHT = "right:";
|
||
|
KEYWORDS.TITLE_MODE = "titleMode:";
|
||
|
KEYWORDS.MESSAGE_MAX_WIDTH = "messageMaxWidth:";
|
||
|
KEYWORDS.COMMENT_MAX_WIDTH = "commentMaxWidth:";
|
||
|
KEYWORDS.DELIMITER = "delimiter";
|
||
|
KEYWORDS.COMMENT = "#";
|
||
|
KEYWORDS.MESSAGE_LEFT = "<";
|
||
|
KEYWORDS.MESSAGE_RIGHT = ">";
|
||
|
var DialogueRenderer = class {
|
||
|
constructor(src, parent, settings) {
|
||
|
this.src = src;
|
||
|
this.dialogueWrapperEl = parent.createDiv({ cls: CLASSES.DIALOGUE_WRAPPER });
|
||
|
this.dialogueSettings = {
|
||
|
parent: this.dialogueWrapperEl,
|
||
|
leftTitle: settings.defaultLeftTitle,
|
||
|
rightTitle: settings.defaultRightTitle,
|
||
|
titleMode: settings.defaultTitleMode,
|
||
|
messageMaxWidth: settings.defaultMessageMaxWidth,
|
||
|
commentMaxWidth: settings.defaultCommentMaxWidth,
|
||
|
leftTitleRenderedOnce: false,
|
||
|
rightTitleRenderedOnce: false,
|
||
|
participants: new Map()
|
||
|
};
|
||
|
this.renderDialogue();
|
||
|
}
|
||
|
registerParticipant(participant) {
|
||
|
if (!this.dialogueSettings.participants.has(participant)) {
|
||
|
this.dialogueSettings.participants.set(participant, this.dialogueSettings.participants.size + 1);
|
||
|
}
|
||
|
}
|
||
|
renderDialogue() {
|
||
|
const lines = this.src.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 1);
|
||
|
for (const line of lines) {
|
||
|
if (line.startsWith(KEYWORDS.LEFT)) {
|
||
|
this.dialogueSettings.leftTitle = line.substr(KEYWORDS.LEFT.length).trim();
|
||
|
this.dialogueSettings.leftTitleRenderedOnce = false;
|
||
|
} else if (line.startsWith(KEYWORDS.RIGHT)) {
|
||
|
this.dialogueSettings.rightTitle = line.substr(KEYWORDS.RIGHT.length).trim();
|
||
|
this.dialogueSettings.rightTitleRenderedOnce = false;
|
||
|
} else if (line.startsWith(KEYWORDS.TITLE_MODE)) {
|
||
|
const modeName = line.substr(KEYWORDS.TITLE_MODE.length).trim().toLowerCase();
|
||
|
if (Object.values(DialogueTitleMode).some((mode) => mode == modeName)) {
|
||
|
this.dialogueSettings.titleMode = modeName;
|
||
|
}
|
||
|
} else if (line.startsWith(KEYWORDS.MESSAGE_MAX_WIDTH)) {
|
||
|
this.dialogueSettings.messageMaxWidth = line.substr(KEYWORDS.MESSAGE_MAX_WIDTH.length).trim();
|
||
|
} else if (line.startsWith(KEYWORDS.COMMENT_MAX_WIDTH)) {
|
||
|
this.dialogueSettings.commentMaxWidth = line.substr(KEYWORDS.COMMENT_MAX_WIDTH.length).trim();
|
||
|
} else if (line.startsWith(KEYWORDS.DELIMITER)) {
|
||
|
new Delimiter(this.dialogueSettings);
|
||
|
} else if (line.startsWith(KEYWORDS.COMMENT)) {
|
||
|
const content = line.substr(KEYWORDS.COMMENT.length);
|
||
|
new Comment(content, this.dialogueSettings);
|
||
|
} else if (line.startsWith(KEYWORDS.MESSAGE_LEFT)) {
|
||
|
const content = line.substr(KEYWORDS.MESSAGE_LEFT.length);
|
||
|
this.registerParticipant(this.dialogueSettings.leftTitle);
|
||
|
new Message(content, SIDES.LEFT, this.dialogueSettings);
|
||
|
} else if (line.startsWith(KEYWORDS.MESSAGE_RIGHT)) {
|
||
|
const content = line.substr(KEYWORDS.MESSAGE_RIGHT.length);
|
||
|
this.registerParticipant(this.dialogueSettings.rightTitle);
|
||
|
new Message(content, SIDES.RIGHT, this.dialogueSettings);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
// src/settings.ts
|
||
|
var import_obsidian = __toModule(require("obsidian"));
|
||
|
var DEFAULT_SETTINGS = {
|
||
|
defaultLeftTitle: "",
|
||
|
defaultRightTitle: "",
|
||
|
defaultTitleMode: DialogueTitleMode.First,
|
||
|
defaultMessageMaxWidth: "60%",
|
||
|
defaultCommentMaxWidth: "60%"
|
||
|
};
|
||
|
var DialogueSettingTab = class extends import_obsidian.PluginSettingTab {
|
||
|
constructor(app, plugin) {
|
||
|
super(app, plugin);
|
||
|
this.plugin = plugin;
|
||
|
}
|
||
|
display() {
|
||
|
const { containerEl } = this;
|
||
|
containerEl.empty();
|
||
|
containerEl.createEl("h2", { text: "Dialogue Settings" });
|
||
|
const coffeeEl = containerEl.createEl("div", {
|
||
|
attr: {
|
||
|
style: "text-align: center; margin-bottom: 10px;"
|
||
|
}
|
||
|
});
|
||
|
const coffeeLinkEl = coffeeEl.createEl("a", { href: "https://www.buymeacoffee.com/holubj" });
|
||
|
coffeeLinkEl.createEl("img", {
|
||
|
attr: {
|
||
|
src: "https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png",
|
||
|
alt: "Buy Me A Coffee",
|
||
|
style: "height: 60px; width: 217px;"
|
||
|
}
|
||
|
});
|
||
|
new import_obsidian.Setting(containerEl).setName("Default left title").setDesc("Default value for left title in all dialogues.").addText((text) => text.setPlaceholder("Enter default left title").setValue(this.plugin.settings.defaultLeftTitle).onChange((value) => __async(this, null, function* () {
|
||
|
this.plugin.settings.defaultLeftTitle = value;
|
||
|
yield this.plugin.saveSettings();
|
||
|
})));
|
||
|
new import_obsidian.Setting(containerEl).setName("Default right title").setDesc("Default value for right title in all dialogues.").addText((text) => text.setPlaceholder("Enter default right title").setValue(this.plugin.settings.defaultRightTitle).onChange((value) => __async(this, null, function* () {
|
||
|
this.plugin.settings.defaultRightTitle = value;
|
||
|
yield this.plugin.saveSettings();
|
||
|
})));
|
||
|
new import_obsidian.Setting(containerEl).setName("Default title mode").setDesc("Default title mode in all dialogues.").addDropdown((cb) => {
|
||
|
Object.values(DialogueTitleMode).forEach((titleMode) => {
|
||
|
const mode = titleMode.toString();
|
||
|
cb.addOption(mode, mode.charAt(0).toUpperCase() + mode.slice(1));
|
||
|
});
|
||
|
cb.setValue(this.plugin.settings.defaultTitleMode).onChange((value) => __async(this, null, function* () {
|
||
|
this.plugin.settings.defaultTitleMode = value;
|
||
|
yield this.plugin.saveSettings();
|
||
|
}));
|
||
|
});
|
||
|
new import_obsidian.Setting(containerEl).setName("Default max message width").setDesc("Default max message width in all dialogues.").addText((text) => text.setPlaceholder("Enter default max message width").setValue(this.plugin.settings.defaultMessageMaxWidth).onChange((value) => __async(this, null, function* () {
|
||
|
this.plugin.settings.defaultMessageMaxWidth = value;
|
||
|
yield this.plugin.saveSettings();
|
||
|
})));
|
||
|
new import_obsidian.Setting(containerEl).setName("Default max comment width").setDesc("Default max comment width in all dialogues.").addText((text) => text.setPlaceholder("Enter default max comment width").setValue(this.plugin.settings.defaultCommentMaxWidth).onChange((value) => __async(this, null, function* () {
|
||
|
this.plugin.settings.defaultCommentMaxWidth = value;
|
||
|
yield this.plugin.saveSettings();
|
||
|
})));
|
||
|
}
|
||
|
};
|
||
|
|
||
|
// src/main.ts
|
||
|
var DialoguePlugin = class extends import_obsidian2.Plugin {
|
||
|
onload() {
|
||
|
return __async(this, null, function* () {
|
||
|
yield this.loadSettings();
|
||
|
this.registerMarkdownCodeBlockProcessor(`dialogue`, (src, el, ctx) => {
|
||
|
new DialogueRenderer(src, el, this.settings);
|
||
|
});
|
||
|
this.addSettingTab(new DialogueSettingTab(this.app, this));
|
||
|
});
|
||
|
}
|
||
|
loadSettings() {
|
||
|
return __async(this, null, function* () {
|
||
|
this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData());
|
||
|
});
|
||
|
}
|
||
|
saveSettings() {
|
||
|
return __async(this, null, function* () {
|
||
|
yield this.saveData(this.settings);
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL21haW4udHMiLCAic3JjL2NvbnN0YW50cy9kaWFsb2d1ZVRpdGxlTW9kZS50cyIsICJzcmMvY29uc3RhbnRzL2NsYXNzZXMudHMiLCAic3JjL2NvbXBvbmVudHMvbWVzc2FnZS50cyIsICJzcmMvY29tcG9uZW50cy9kZWxpbWl0ZXIudHMiLCAic3JjL2NvbXBvbmVudHMvY29tbWVudC50cyIsICJzcmMvZGlhbG9ndWUudHMiLCAic3JjL3NldHRpbmdzLnRzIl0sCiAgInNvdXJjZXNDb250ZW50I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