@file-viewer/renderer-email 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/email.d.ts CHANGED
@@ -1,2 +1,29 @@
1
1
  import type { FileRenderContext, FileViewerRenderedInstance } from '@file-viewer/core';
2
+ type EmailKind = 'eml' | 'msg' | 'mbox';
3
+ interface EmailAddress {
4
+ name?: string;
5
+ address?: string;
6
+ }
7
+ interface EmailAttachmentView {
8
+ id: string;
9
+ name: string;
10
+ mimeType?: string;
11
+ size: number;
12
+ contentId?: string;
13
+ load(): Promise<ArrayBuffer>;
14
+ }
15
+ export interface ParsedEmailView {
16
+ kind: EmailKind;
17
+ subject: string;
18
+ from: EmailAddress[];
19
+ to: EmailAddress[];
20
+ cc: EmailAddress[];
21
+ date?: string;
22
+ text?: string;
23
+ html?: string;
24
+ headers?: string;
25
+ attachments: EmailAttachmentView[];
26
+ }
27
+ export declare const parseEml: (buffer: ArrayBuffer, filename: string, objectUrls: string[], cidUrls: Map<string, string>) => Promise<ParsedEmailView>;
2
28
  export default function renderEmail(buffer: ArrayBuffer, target: HTMLDivElement, type?: string, context?: FileRenderContext): Promise<FileViewerRenderedInstance>;
29
+ export {};
package/dist/email.js CHANGED
@@ -123,7 +123,9 @@ const createPostalAttachments = (email, objectUrls, cidUrls) => {
123
123
  cidUrls.set(normalizeContentId(attachment.contentId), url);
124
124
  })).then(() => attachments);
125
125
  };
126
- const parseEml = async (buffer, filename, objectUrls, cidUrls) => {
126
+ // Exported for the package-local #232 regression gate (verify-github-232.mjs); it
127
+ // stays out of the public exports map, so the shipped API surface is unchanged.
128
+ export const parseEml = async (buffer, filename, objectUrls, cidUrls) => {
127
129
  var _a, _b;
128
130
  const PostalMime = (await import('postal-mime')).default;
129
131
  const email = await PostalMime.parse(buffer, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@file-viewer/renderer-email",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Standalone email renderer plugin for File Viewer with EML, MSG, MBOX, attachments, and nested previews.",
@@ -56,10 +56,10 @@
56
56
  "LICENSE"
57
57
  ],
58
58
  "dependencies": {
59
- "@file-viewer/core": "3.0.0",
59
+ "@file-viewer/core": "3.0.1",
60
60
  "@kenjiuno/msgreader": "^1.28.0",
61
61
  "buffer": "^6.0.3",
62
- "postal-mime": "^2.7.4"
62
+ "postal-mime": "^3.0.0"
63
63
  },
64
64
  "devDependencies": {
65
65
  "typescript": "^6.0.3"
@@ -70,6 +70,7 @@
70
70
  "license": "Apache-2.0",
71
71
  "scripts": {
72
72
  "build": "tsc -b tsconfig.json",
73
- "type-check": "tsc -b tsconfig.json"
73
+ "type-check": "tsc -b tsconfig.json",
74
+ "verify:github-232": "pnpm --filter @file-viewer/core build && pnpm build && node scripts/verify-github-232.mjs"
74
75
  }
75
76
  }