msg-viewer
This commit is contained in:
parent
f4550d7723
commit
362fc9b774
10 changed files with 13 additions and 14 deletions
|
|
@ -53,7 +53,9 @@
|
||||||
'views/res_config_settings_views.xml',
|
'views/res_config_settings_views.xml',
|
||||||
],
|
],
|
||||||
'external_dependencies': {
|
'external_dependencies': {
|
||||||
'python': ['extract-msg'],
|
'python': [
|
||||||
|
'extract-msg'
|
||||||
|
],
|
||||||
},
|
},
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'auto_install': False,
|
'auto_install': False,
|
||||||
|
|
|
||||||
|
|
@ -45,9 +45,6 @@ async function build() {
|
||||||
entrypoints: ["./lib/index.html"],
|
entrypoints: ["./lib/index.html"],
|
||||||
outdir: DEST_DIR,
|
outdir: DEST_DIR,
|
||||||
minify: true,
|
minify: true,
|
||||||
plugins: [
|
|
||||||
html({ inline: true }),
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
console.log("Build succeeded!\n");
|
console.log("Build succeeded!\n");
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
|
|
@ -75,4 +72,4 @@ async function createDestDir(){
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
console.error(`Failed to create destination folder "${DEST_DIR}".`);
|
console.error(`Failed to create destination folder "${DEST_DIR}".`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
BIN
msg_viewer/static/src/lib/msg-viewer-main/bun.lockb
Normal file → Executable file
BIN
msg_viewer/static/src/lib/msg-viewer-main/bun.lockb
Normal file → Executable file
Binary file not shown.
|
|
@ -1,7 +1,7 @@
|
||||||
import type { Message } from "../../scripts/msg/types/message";
|
import type { Message } from "../../scripts/msg/types/message";
|
||||||
import { bytesWithUnits } from "../../scripts/utils/file-size-util";
|
import { bytesWithUnits } from "../../scripts/utils/file-size-util";
|
||||||
import { createFragmentFromTemplate } from "../../scripts/utils/html-template-util";
|
import { createFragmentFromTemplate } from "../../scripts/utils/html-template-util";
|
||||||
import template from "./index.html" with { type: "text" };
|
const template = await Bun.file("./lib/components/attachment/index.html").text();
|
||||||
|
|
||||||
export function attachmentsFragment(message: Message): DocumentFragment {
|
export function attachmentsFragment(message: Message): DocumentFragment {
|
||||||
const attachments = message.attachments
|
const attachments = message.attachments
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { DirectoryEntry } from "../../scripts/msg/compound-file/directory/types/directory-entry";
|
import type { DirectoryEntry } from "../../scripts/msg/compound-file/directory/types/directory-entry";
|
||||||
import type { Message } from "../../scripts/msg/types/message";
|
import type { Message } from "../../scripts/msg/types/message";
|
||||||
import { createFragmentFromTemplate } from "../../scripts/utils/html-template-util";
|
import { createFragmentFromTemplate } from "../../scripts/utils/html-template-util";
|
||||||
import template from "./index.html" with { type: "text" };
|
const template = await Bun.file("./lib/components/embedded-msg/index.html").text();
|
||||||
|
|
||||||
export function embeddedMsgsFragment(message: Message, onClick: (entry: DirectoryEntry) => void): DocumentFragment {
|
export function embeddedMsgsFragment(message: Message, onClick: (entry: DirectoryEntry) => void): DocumentFragment {
|
||||||
const elements = message.attachments
|
const elements = message.attachments
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { createFragmentFromTemplate } from "../../scripts/utils/html-template-util";
|
import { createFragmentFromTemplate } from "../../scripts/utils/html-template-util";
|
||||||
import template from "./index.html" with { type: "text" };
|
const template = await Bun.file("./lib/components/error/index.html").text();
|
||||||
|
|
||||||
export function errorFragment(error: string): DocumentFragment {
|
export function errorFragment(error: string): DocumentFragment {
|
||||||
return createFragmentFromTemplate(template, { error });
|
return createFragmentFromTemplate(template, { error });
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { createFragmentFromTemplate } from "../../scripts/utils/html-template-ut
|
||||||
import { attachmentsFragment } from "../attachment";
|
import { attachmentsFragment } from "../attachment";
|
||||||
import { embeddedMsgsFragment } from "../embedded-msg";
|
import { embeddedMsgsFragment } from "../embedded-msg";
|
||||||
import { recipientsFragments } from "../recipient";
|
import { recipientsFragments } from "../recipient";
|
||||||
import template from "./index.html" with { type: "text" };
|
const template = await Bun.file("./lib/components/message/index.html").text();
|
||||||
|
|
||||||
export function messageFragment(message: Message, renderDir: (dir: DirectoryEntry) => void): DocumentFragment {
|
export function messageFragment(message: Message, renderDir: (dir: DirectoryEntry) => void): DocumentFragment {
|
||||||
const [toRecip, ccRecip] = recipientsFragments(message);
|
const [toRecip, ccRecip] = recipientsFragments(message);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { Message, Recipient } from "../../scripts/msg/types/message";
|
import type { Message, Recipient } from "../../scripts/msg/types/message";
|
||||||
import { createFragmentFromTemplate } from "../../scripts/utils/html-template-util";
|
import { createFragmentFromTemplate } from "../../scripts/utils/html-template-util";
|
||||||
import template from "./index.html" with { type: "text" };
|
const template = await Bun.file("./lib/components/recipient/index.html").text();
|
||||||
|
|
||||||
export function recipientsFragments(message: Message): DocumentFragment[] {
|
export function recipientsFragments(message: Message): DocumentFragment[] {
|
||||||
const toRecipients = toSet(message.content.toRecipients);
|
const toRecipients = toSet(message.content.toRecipients);
|
||||||
|
|
@ -45,4 +45,4 @@ function toSet(recipStr: string) {
|
||||||
interface RecipientViewModel {
|
interface RecipientViewModel {
|
||||||
name: string,
|
name: string,
|
||||||
email: string
|
email: string
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
@import "./lib/styles/root.css";
|
@import "./root.css";
|
||||||
@import "./lib/components/styles.css";
|
@import "../components/styles.css";
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
"bun-plugin-html": "^2.0.0"
|
"bun-plugin-html": "^2.2.8"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf build"
|
"clean": "rm -rf build"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue