This commit is contained in:
Jaiwanth 2021-06-30 14:08:22 +05:30
parent 551639811b
commit 08d886e9d1
12 changed files with 77 additions and 79 deletions

View file

@ -277,9 +277,9 @@ function textForMessageEvent(ev: MatrixEvent): () => string | null {
if (ev.getContent().msgtype === "m.emote") { if (ev.getContent().msgtype === "m.emote") {
message = "* " + senderDisplayName + " " + message; message = "* " + senderDisplayName + " " + message;
} else if (ev.getContent().msgtype === "m.image") { } else if (ev.getContent().msgtype === "m.image") {
message = _t('%(senderDisplayName)s sent an image.', {senderDisplayName}); message = _t('%(senderDisplayName)s sent an image.', { senderDisplayName });
} else if (ev.getType() == "m.sticker") { } else if (ev.getType() == "m.sticker") {
message = _t('%(senderDisplayName)s sent a sticker.', {senderDisplayName}); message = _t('%(senderDisplayName)s sent a sticker.', { senderDisplayName });
} else message = senderDisplayName + ': ' + message; } else message = senderDisplayName + ': ' + message;
return message; return message;
}; };

View file

@ -194,7 +194,7 @@ export default class MVideoBody extends React.PureComponent<IProps, IState> {
private getFileBody = () => { private getFileBody = () => {
if (this.props.forExport) return null; if (this.props.forExport) return null;
return <MFileBody {...this.props} decryptedBlob={this.state.decryptedBlob} showGenericPlaceholder={false} />; return <MFileBody {...this.props} decryptedBlob={this.state.decryptedBlob} showGenericPlaceholder={false} />;
} };
render() { render() {
const content = this.props.mxEvent.getContent(); const content = this.props.mxEvent.getContent();

View file

@ -234,7 +234,7 @@ const RoomSummaryCard: React.FC<IProps> = ({ room, onClose }) => {
}; };
const onRoomExportClick = async () => { const onRoomExportClick = async () => {
const {default: ExportDialog} = await import("../dialogs/ExportDialog"); const { default: ExportDialog } = await import("../dialogs/ExportDialog");
Modal.createTrackedDialog('export room dialog', '', ExportDialog, { Modal.createTrackedDialog('export room dialog', '', ExportDialog, {
room, room,

View file

@ -32,7 +32,6 @@ import RoomName from "../elements/RoomName";
import { PlaceCallType } from "../../../CallHandler"; import { PlaceCallType } from "../../../CallHandler";
import { replaceableComponent } from "../../../utils/replaceableComponent"; import { replaceableComponent } from "../../../utils/replaceableComponent";
@replaceableComponent("views.rooms.RoomHeader") @replaceableComponent("views.rooms.RoomHeader")
export default class RoomHeader extends React.Component { export default class RoomHeader extends React.Component {
static propTypes = { static propTypes = {

View file

@ -8,7 +8,7 @@ import { mediaFromContent } from "../../customisations/Media";
import { formatFullDateNoDay } from "../../DateUtils"; import { formatFullDateNoDay } from "../../DateUtils";
import { MatrixClient } from "matrix-js-sdk"; import { MatrixClient } from "matrix-js-sdk";
import streamToZIP from "./ZipStream"; import streamToZIP from "./ZipStream";
import * as ponyfill from "web-streams-polyfill/ponyfill" import * as ponyfill from "web-streams-polyfill/ponyfill";
import "web-streams-polyfill/ponyfill"; // to support streams API for older browsers import "web-streams-polyfill/ponyfill"; // to support streams API for older browsers
type FileStream = { type FileStream = {
@ -44,7 +44,7 @@ export default abstract class Exporter {
const file = { const file = {
name: filePath, name: filePath,
stream: () => blob.stream(), stream: () => blob.stream(),
} };
this.files.push(file); this.files.push(file);
} }
@ -52,7 +52,7 @@ export default abstract class Exporter {
const filename = `matrix-export-${formatFullDateNoDay(new Date())}.zip`; const filename = `matrix-export-${formatFullDateNoDay(new Date())}.zip`;
// Support for older browsers // Support for older browsers
streamSaver.WritableStream = ponyfill.WritableStream streamSaver.WritableStream = ponyfill.WritableStream;
// Create a writable stream to the directory // Create a writable stream to the directory
this.fileStream = streamSaver.createWriteStream(filename); this.fileStream = streamSaver.createWriteStream(filename);
@ -72,9 +72,9 @@ export default abstract class Exporter {
if (this.cancelled) return this.cleanUp(); if (this.cancelled) return this.cleanUp();
console.info("Writing to the file system...") console.info("Writing to the file system...");
const reader = readableZipStream.getReader() const reader = readableZipStream.getReader();
await this.pumpToFileStream(reader); await this.pumpToFileStream(reader);
} }
@ -93,7 +93,7 @@ export default abstract class Exporter {
protected async downloadPlainText(fileName: string, text: string): Promise<any> { protected async downloadPlainText(fileName: string, text: string): Promise<any> {
this.fileStream = streamSaver.createWriteStream(fileName); this.fileStream = streamSaver.createWriteStream(fileName);
this.writer = this.fileStream.getWriter() this.writer = this.fileStream.getWriter();
const data = new TextEncoder().encode(text); const data = new TextEncoder().encode(text);
if (this.cancelled) return this.cleanUp(); if (this.cancelled) return this.cleanUp();
await this.writer.write(data); await this.writer.write(data);
@ -142,7 +142,7 @@ export default abstract class Exporter {
return limit; return limit;
} }
protected async getRequiredEvents():Promise<MatrixEvent[]> { protected async getRequiredEvents(): Promise<MatrixEvent[]> {
const eventMapper = this.client.getEventMapper(); const eventMapper = this.client.getEventMapper();
let prevToken: string|null = null; let prevToken: string|null = null;

View file

@ -1,9 +1,9 @@
import React from "react" import React from "react";
import Exporter from "./Exporter"; import Exporter from "./Exporter";
import { mediaFromMxc } from "../../customisations/Media"; import { mediaFromMxc } from "../../customisations/Media";
import { Room } from "matrix-js-sdk/src/models/room"; import { Room } from "matrix-js-sdk/src/models/room";
import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { renderToStaticMarkup } from 'react-dom/server' import { renderToStaticMarkup } from "react-dom/server";
import { Layout } from "../../settings/Layout"; import { Layout } from "../../settings/Layout";
import { shouldFormContinuation } from "../../components/structures/MessagePanel"; import { shouldFormContinuation } from "../../components/structures/MessagePanel";
import { formatFullDateNoDayNoTime, wantsDateSeparator } from "../../DateUtils"; import { formatFullDateNoDayNoTime, wantsDateSeparator } from "../../DateUtils";
@ -191,7 +191,7 @@ export default class HTMLExporter extends Exporter {
</section> </section>
<div id="snackbar"/> <div id="snackbar"/>
</body> </body>
</html>` </html>`;
} }
protected getAvatarURL(event: MatrixEvent): string { protected getAvatarURL(event: MatrixEvent): string {
@ -236,32 +236,35 @@ export default class HTMLExporter extends Exporter {
const hasAvatar = !!this.getAvatarURL(mxEv); const hasAvatar = !!this.getAvatarURL(mxEv);
if (hasAvatar) await this.saveAvatarIfNeeded(mxEv); if (hasAvatar) await this.saveAvatarIfNeeded(mxEv);
const eventTile = <div className="mx_Export_EventWrapper" id={mxEv.getId()}> const eventTile = (
<MatrixClientContext.Provider value = {this.client}> <div className="mx_Export_EventWrapper" id={mxEv.getId()}>
<EventTile <MatrixClientContext.Provider value={this.client}>
mxEvent={mxEv} <EventTile
continuation={continuation} mxEvent={mxEv}
isRedacted={mxEv.isRedacted()} continuation={continuation}
replacingEventId={mxEv.replacingEventId()} isRedacted={mxEv.isRedacted()}
forExport={true} replacingEventId={mxEv.replacingEventId()}
readReceipts={null} forExport={true}
readReceiptMap={null} readReceipts={null}
showUrlPreview={false} readReceiptMap={null}
checkUnmounting={() => false} showUrlPreview={false}
isTwelveHour={false} checkUnmounting={() => false}
last={false} isTwelveHour={false}
lastInSection={false} last={false}
permalinkCreator={this.permalinkCreator} lastInSection={false}
lastSuccessful={false} permalinkCreator={this.permalinkCreator}
isSelectedEvent={false} lastSuccessful={false}
getRelationsForEvent={null} isSelectedEvent={false}
showReactions={false} getRelationsForEvent={null}
layout={Layout.Group} showReactions={false}
enableFlair={false} layout={Layout.Group}
showReadReceipts={false} enableFlair={false}
/> showReadReceipts={false}
</MatrixClientContext.Provider> />
</div> </MatrixClientContext.Provider>
</div>
);
let eventTileMarkup = renderToStaticMarkup(eventTile); let eventTileMarkup = renderToStaticMarkup(eventTile);
if (filePath) { if (filePath) {
const mxc = mxEv.getContent().url || mxEv.getContent().file?.url; const mxc = mxEv.getContent().url || mxEv.getContent().file?.url;
@ -282,7 +285,7 @@ export default class HTMLExporter extends Exporter {
body: `*${text}*`, body: `*${text}*`,
format: "org.matrix.custom.html", format: "org.matrix.custom.html",
formatted_body: `<em>${text}</em>`, formatted_body: `<em>${text}</em>`,
} };
const modifiedEvent = new MatrixEvent(); const modifiedEvent = new MatrixEvent();
modifiedEvent.event = mxEv.event; modifiedEvent.event = mxEv.event;
modifiedEvent.sender = mxEv.sender; modifiedEvent.sender = mxEv.sender;
@ -367,7 +370,7 @@ export default class HTMLExporter extends Exporter {
if (this.cancelled) { if (this.cancelled) {
console.info("Export cancelled successfully"); console.info("Export cancelled successfully");
} else { } else {
console.info("Export successful!") console.info("Export successful!");
console.log(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`); console.log(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`);
} }

View file

@ -7,7 +7,6 @@ import { exportTypes } from "./exportUtils";
import { exportOptions } from "./exportUtils"; import { exportOptions } from "./exportUtils";
import { EventType } from "matrix-js-sdk/src/@types/event"; import { EventType } from "matrix-js-sdk/src/@types/event";
export default class JSONExporter extends Exporter { export default class JSONExporter extends Exporter {
protected totalSize: number; protected totalSize: number;
protected messages: any[]; protected messages: any[];
@ -32,7 +31,7 @@ export default class JSONExporter extends Exporter {
export_date: exportDate, export_date: exportDate,
exported_by: exporterName, exported_by: exporterName,
messages: this.messages, messages: this.messages,
} };
return JSON.stringify(jsonObject, null, 2); return JSON.stringify(jsonObject, null, 2);
} }
@ -90,11 +89,11 @@ export default class JSONExporter extends Exporter {
if (this.cancelled) { if (this.cancelled) {
console.info("Export cancelled successfully"); console.info("Export cancelled successfully");
} else { } else {
console.info("Export successful!") console.info("Export successful!");
console.log(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`); console.log(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`);
} }
this.cleanUp() this.cleanUp();
} }
} }

View file

@ -8,7 +8,6 @@ import { exportTypes } from "./exportUtils";
import { exportOptions } from "./exportUtils"; import { exportOptions } from "./exportUtils";
import { textForEvent } from "../../TextForEvent"; import { textForEvent } from "../../TextForEvent";
export default class PlainTextExporter extends Exporter { export default class PlainTextExporter extends Exporter {
protected totalSize: number; protected totalSize: number;
protected mediaOmitText: string; protected mediaOmitText: string;
@ -21,7 +20,7 @@ export default class PlainTextExporter extends Exporter {
: _t("Media omitted - file size limit exceeded"); : _t("Media omitted - file size limit exceeded");
} }
protected textForReplyEvent = (ev : MatrixEvent) => { protected textForReplyEvent = (ev: MatrixEvent) => {
const REPLY_REGEX = /> <(.*?)>(.*?)\n\n(.*)/; const REPLY_REGEX = /> <(.*?)>(.*?)\n\n(.*)/;
const REPLY_SOURCE_MAX_LENGTH = 32; const REPLY_SOURCE_MAX_LENGTH = 32;
const content = ev.getContent(); const content = ev.getContent();
@ -36,7 +35,7 @@ export default class PlainTextExporter extends Exporter {
rplSource = match[2].substring(1, REPLY_SOURCE_MAX_LENGTH); rplSource = match[2].substring(1, REPLY_SOURCE_MAX_LENGTH);
// Get the first non-blank line from the source. // Get the first non-blank line from the source.
const lines = rplSource.split('\n').filter((line) => !/^\s*$/.test(line)) const lines = rplSource.split('\n').filter((line) => !/^\s*$/.test(line));
if (lines.length > 0) { if (lines.length > 0) {
// Cut to a maximum length. // Cut to a maximum length.
rplSource = lines[0].substring(0, REPLY_SOURCE_MAX_LENGTH); rplSource = lines[0].substring(0, REPLY_SOURCE_MAX_LENGTH);
@ -52,7 +51,7 @@ export default class PlainTextExporter extends Exporter {
} }
return `<${rplName}${rplSource}> ${rplText}`; return `<${rplName}${rplSource}> ${rplText}`;
} };
protected _textForEvent = async (mxEv: MatrixEvent) => { protected _textForEvent = async (mxEv: MatrixEvent) => {
const senderDisplayName = mxEv.sender && mxEv.sender.name ? mxEv.sender.name : mxEv.getSender(); const senderDisplayName = mxEv.sender && mxEv.sender.name ? mxEv.sender.name : mxEv.getSender();
@ -76,7 +75,7 @@ export default class PlainTextExporter extends Exporter {
} }
if (this.isReply(mxEv)) return senderDisplayName + ": " + this.textForReplyEvent(mxEv) + mediaText; if (this.isReply(mxEv)) return senderDisplayName + ": " + this.textForReplyEvent(mxEv) + mediaText;
else return textForEvent(mxEv) + mediaText; else return textForEvent(mxEv) + mediaText;
} };
protected async createOutput(events: MatrixEvent[]) { protected async createOutput(events: MatrixEvent[]) {
let content = ""; let content = "";
@ -115,7 +114,7 @@ export default class PlainTextExporter extends Exporter {
if (this.cancelled) { if (this.cancelled) {
console.info("Export cancelled successfully"); console.info("Export cancelled successfully");
} else { } else {
console.info("Export successful!") console.info("Export successful!");
console.log(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`); console.log(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`);
} }

View file

@ -13,7 +13,6 @@ type TypedArray =
| Float32Array | Float32Array
| Float64Array; | Float64Array;
/** /**
* 32-bit cyclic redundancy check, or CRC-32 - checksum * 32-bit cyclic redundancy check, or CRC-32 - checksum
*/ */
@ -23,8 +22,8 @@ class Crc32 {
constructor() { constructor() {
this.crc = -1; this.crc = -1;
this.table = (() => { this.table = (() => {
let i let i;
let j let j;
let t; let t;
const table = []; const table = [];
@ -37,8 +36,8 @@ class Crc32 {
} }
table[i] = t; table[i] = t;
} }
return table return table;
})() })();
} }
append(data: TypedArray) { append(data: TypedArray) {
@ -55,25 +54,24 @@ class Crc32 {
} }
} }
type DataHelper = { type DataHelper = {
array: Uint8Array, array: Uint8Array,
view: DataView, view: DataView,
} };
const getDataHelper = (byteLength: number): DataHelper => { const getDataHelper = (byteLength: number): DataHelper => {
const uint8 = new Uint8Array(byteLength) const uint8 = new Uint8Array(byteLength);
return { return {
array: uint8, array: uint8,
view: new DataView(uint8.buffer), view: new DataView(uint8.buffer),
}; };
} };
type FileLike = File & { type FileLike = File & {
directory: string, directory: string,
comment: string, comment: string,
stream(): ReadableStream, stream(): ReadableStream,
} };
type ZipObj = { type ZipObj = {
crc?: Crc32, crc?: Crc32,
@ -88,7 +86,7 @@ type ZipObj = {
fileLike: FileLike, fileLike: FileLike,
level: number, level: number,
directory: boolean, directory: boolean,
} };
const pump = (zipObj: ZipObj) => zipObj.reader ? zipObj.reader.read().then(chunk => { const pump = (zipObj: ZipObj) => zipObj.reader ? zipObj.reader.read().then(chunk => {
if (zipObj.crc) { if (zipObj.crc) {
@ -124,7 +122,7 @@ export default function streamToZIP(underlyingSource: UnderlyingSource) {
desiredSize: null, desiredSize: null,
error(err) { error(err) {
console.error(err) console.error(err);
}, },
enqueue(fileLike: FileLike) { enqueue(fileLike: FileLike) {
@ -155,8 +153,8 @@ export default function streamToZIP(underlyingSource: UnderlyingSource) {
offset, offset,
writeHeader() { writeHeader() {
const header = getDataHelper(26) const header = getDataHelper(26);
const data = getDataHelper(30 + nameBuf.length) const data = getDataHelper(30 + nameBuf.length);
zipObject.offset = offset; zipObject.offset = offset;
zipObject.header = header; zipObject.header = header;
@ -200,10 +198,10 @@ export default function streamToZIP(underlyingSource: UnderlyingSource) {
ctrl.enqueue(footer.array); ctrl.enqueue(footer.array);
offset += zipObject.compressedLength + 16; offset += zipObject.compressedLength + 16;
next() next();
}, },
fileLike, fileLike,
} };
if (!activeZipObject) { if (!activeZipObject) {
activeZipObject = zipObject; activeZipObject = zipObject;
@ -220,11 +218,11 @@ export default function streamToZIP(underlyingSource: UnderlyingSource) {
if (!activeZipObject) closeZip(); if (!activeZipObject) closeZip();
closed = true; closed = true;
}, },
} };
function closeZip() { function closeZip() {
let length = 0; let length = 0;
let index = 0 let index = 0;
let indexFilename; let indexFilename;
let file; let file;
@ -232,7 +230,7 @@ export default function streamToZIP(underlyingSource: UnderlyingSource) {
file = files[filenames[indexFilename]]; file = files[filenames[indexFilename]];
length += 46 + file.nameBuf.length + file.comment.length; length += 46 + file.nameBuf.length + file.comment.length;
} }
const data = getDataHelper(length + 22) const data = getDataHelper(length + 22);
for (indexFilename = 0; indexFilename < filenames.length; indexFilename++) { for (indexFilename = 0; indexFilename < filenames.length; indexFilename++) {
file = files[filenames[indexFilename]]; file = files[filenames[indexFilename]];
data.view.setUint32(index, 0x504b0102); data.view.setUint32(index, 0x504b0102);
@ -275,7 +273,7 @@ export default function streamToZIP(underlyingSource: UnderlyingSource) {
return processNextChunk() || ( return processNextChunk() || (
underlyingSource.pull && underlyingSource.pull &&
Promise.resolve(underlyingSource.pull(zipWriter)) Promise.resolve(underlyingSource.pull(zipWriter))
) );
}, },
}); });
} }

View file

@ -19464,7 +19464,7 @@ a.mx_RoomPreviewBar_inviter {
-webkit-transform: scaleX(-1); -webkit-transform: scaleX(-1);
transform: scaleX(-1); transform: scaleX(-1);
} }
` `;
const customCSS = ` const customCSS = `
#snackbar { #snackbar {
display: flex; display: flex;
@ -19567,8 +19567,8 @@ img {
overflow: hidden; overflow: hidden;
} }
` `;
const markdownCSS = `.markdown-body{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;color:#333;overflow:hidden;font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:16px;line-height:1.6;word-wrap:break-word}.markdown-body *{-moz-box-sizing:border-box;box-sizing:border-box}.markdown-body>:first-child{margin-top:0!important}.markdown-body>:last-child{margin-bottom:0!important}.markdown-body a{background:0 0;color:#4183c4;text-decoration:none}.markdown-body a:active,.markdown-body a:hover{outline:0}.markdown-body a:active,.markdown-body a:focus,.markdown-body a:hover{text-decoration:underline}.markdown-body strong{font-weight:700}.markdown-body em{font-style:italic}.markdown-body blockquote,.markdown-body dl,.markdown-body ol,.markdown-body p,.markdown-body pre,.markdown-body table,.markdown-body ul{margin-top:0;margin-bottom:16px}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;position:relative;margin-top:1em;margin-bottom:16px;font-weight:700;line-height:1.4}.markdown-body h1,.markdown-body h2{padding-bottom:.3em;border-bottom:1px solid #eee}.markdown-body h1{font-size:2.25em;line-height:1.2}.markdown-body h2{font-size:1.75em;line-height:1.225}.markdown-body h3{font-size:1.5em}.markdown-body h4{font-size:1.25em}.markdown-body h5{font-size:1em}.markdown-body h6{font-size:1em;color:#777}.markdown-body code,.markdown-body kbd,.markdown-body pre{font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace}.markdown-body code{padding:.2em 0;margin:0;font-size:85%;background-color:rgba(0,0,0,.04);border-radius:3px}.markdown-body code:after,.markdown-body code:before{letter-spacing:-.2em;content:'\\00a0'}.markdown-body pre{word-wrap:normal;padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f7f7f7;border-radius:3px}.markdown-body pre code{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background:0 0}.markdown-body pre code:after,.markdown-body pre code:before{content:normal}.markdown-body pre>code{font-size:1em;word-break:normal;white-space:pre;border:0}.markdown-body kbd{background-color:#e7e7e7;background-image:-webkit-linear-gradient(#fefefe,#e7e7e7);background-image:linear-gradient(#fefefe,#e7e7e7);background-repeat:repeat-x;display:inline-block;padding:5px 5px 1px;margin:0 1px;font-size:11px;line-height:10px;color:#000;border:1px solid #cfcfcf;border-radius:2px;box-shadow:0 1px 0 #ccc}.markdown-body hr:after,.markdown-body hr:before{display:table;content:''}.markdown-body input{color:inherit;font:inherit;margin:0;font-size:13px;line-height:1.4;font-family:Helvetica,Arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol'}.markdown-body input[disabled]{cursor:default}.markdown-body input[type=checkbox]{-moz-box-sizing:border-box;box-sizing:border-box;padding:0}.markdown-body blockquote{margin:0 0 16px;padding:0 15px;color:#777;border-left:4px solid #ddd}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body img{border:0;max-width:100%;-moz-box-sizing:border-box;box-sizing:border-box}.markdown-body hr{-moz-box-sizing:content-box;box-sizing:content-box;overflow:hidden;background:#e7e7e7;height:4px;padding:0;margin:16px 0;border:0}.markdown-body hr:after{clear:both}.markdown-body td,.markdown-body th{padding:0}.markdown-body table{border-collapse:collapse;border-spacing:0;display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}.markdown-body table td,.markdown-body table th{padding:6px 13px;border:1px solid #ddd}.markdown-body table th{font-weight:700}.markdown-body table tr{background-color:#fff;border-top:1px solid #ccc}.markdown-body table tr:nth-child(2n){background-color:#f8f8f8}.markdown-body ol,.markdown-body ul{padding:0 0 0 2em}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ol ol,.markdown-body ol ul,.markdown-body ul ol,.markdown-body ul ul{margin-top:0;margin-bottom:0}.markdown-body ol ol ol,.markdown-body ol ul ol,.markdown-body ul ol ol,.markdown-body ul ul ol{list-style-type:lower-alpha}.markdown-body li>p{margin-top:16px}.markdown-body dd{margin-left:0}.markdown-body dl{padding:0}.markdown-body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:700}.markdown-body dl dd{padding:0 16px;margin-bottom:16px}` const markdownCSS = `.markdown-body{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;color:#333;overflow:hidden;font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:16px;line-height:1.6;word-wrap:break-word}.markdown-body *{-moz-box-sizing:border-box;box-sizing:border-box}.markdown-body>:first-child{margin-top:0!important}.markdown-body>:last-child{margin-bottom:0!important}.markdown-body a{background:0 0;color:#4183c4;text-decoration:none}.markdown-body a:active,.markdown-body a:hover{outline:0}.markdown-body a:active,.markdown-body a:focus,.markdown-body a:hover{text-decoration:underline}.markdown-body strong{font-weight:700}.markdown-body em{font-style:italic}.markdown-body blockquote,.markdown-body dl,.markdown-body ol,.markdown-body p,.markdown-body pre,.markdown-body table,.markdown-body ul{margin-top:0;margin-bottom:16px}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;position:relative;margin-top:1em;margin-bottom:16px;font-weight:700;line-height:1.4}.markdown-body h1,.markdown-body h2{padding-bottom:.3em;border-bottom:1px solid #eee}.markdown-body h1{font-size:2.25em;line-height:1.2}.markdown-body h2{font-size:1.75em;line-height:1.225}.markdown-body h3{font-size:1.5em}.markdown-body h4{font-size:1.25em}.markdown-body h5{font-size:1em}.markdown-body h6{font-size:1em;color:#777}.markdown-body code,.markdown-body kbd,.markdown-body pre{font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace}.markdown-body code{padding:.2em 0;margin:0;font-size:85%;background-color:rgba(0,0,0,.04);border-radius:3px}.markdown-body code:after,.markdown-body code:before{letter-spacing:-.2em;content:'\\00a0'}.markdown-body pre{word-wrap:normal;padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f7f7f7;border-radius:3px}.markdown-body pre code{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background:0 0}.markdown-body pre code:after,.markdown-body pre code:before{content:normal}.markdown-body pre>code{font-size:1em;word-break:normal;white-space:pre;border:0}.markdown-body kbd{background-color:#e7e7e7;background-image:-webkit-linear-gradient(#fefefe,#e7e7e7);background-image:linear-gradient(#fefefe,#e7e7e7);background-repeat:repeat-x;display:inline-block;padding:5px 5px 1px;margin:0 1px;font-size:11px;line-height:10px;color:#000;border:1px solid #cfcfcf;border-radius:2px;box-shadow:0 1px 0 #ccc}.markdown-body hr:after,.markdown-body hr:before{display:table;content:''}.markdown-body input{color:inherit;font:inherit;margin:0;font-size:13px;line-height:1.4;font-family:Helvetica,Arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol'}.markdown-body input[disabled]{cursor:default}.markdown-body input[type=checkbox]{-moz-box-sizing:border-box;box-sizing:border-box;padding:0}.markdown-body blockquote{margin:0 0 16px;padding:0 15px;color:#777;border-left:4px solid #ddd}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body img{border:0;max-width:100%;-moz-box-sizing:border-box;box-sizing:border-box}.markdown-body hr{-moz-box-sizing:content-box;box-sizing:content-box;overflow:hidden;background:#e7e7e7;height:4px;padding:0;margin:16px 0;border:0}.markdown-body hr:after{clear:both}.markdown-body td,.markdown-body th{padding:0}.markdown-body table{border-collapse:collapse;border-spacing:0;display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}.markdown-body table td,.markdown-body table th{padding:6px 13px;border:1px solid #ddd}.markdown-body table th{font-weight:700}.markdown-body table tr{background-color:#fff;border-top:1px solid #ccc}.markdown-body table tr:nth-child(2n){background-color:#f8f8f8}.markdown-body ol,.markdown-body ul{padding:0 0 0 2em}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ol ol,.markdown-body ol ul,.markdown-body ul ol,.markdown-body ul ul{margin-top:0;margin-bottom:0}.markdown-body ol ol ol,.markdown-body ol ul ol,.markdown-body ul ol ol,.markdown-body ul ul ol{list-style-type:lower-alpha}.markdown-body li>p{margin-top:16px}.markdown-body dd{margin-left:0}.markdown-body dl{padding:0}.markdown-body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:700}.markdown-body dl dd{padding:0 16px;margin-bottom:16px}`;
export default lightCSS + markdownCSS + customCSS; export default lightCSS + markdownCSS + customCSS;

View file

@ -24,4 +24,4 @@ document.querySelectorAll('.mx_reply_anchor').forEach(element => {
}) })
} }
` `;

View file

@ -22,7 +22,7 @@ export const textForFormat = (format: string): string => {
case exportFormats.PLAIN_TEXT: case exportFormats.PLAIN_TEXT:
return _t("Plain Text"); return _t("Plain Text");
} }
} };
export const textForType = (type: string): string => { export const textForType = (type: string): string => {
switch (type) { switch (type) {
@ -35,7 +35,7 @@ export const textForType = (type: string): string => {
// case exportTypes.START_DATE: // case exportTypes.START_DATE:
// return _t("From a specific date"); // return _t("From a specific date");
} }
} };
export interface exportOptions { export interface exportOptions {
startDate?: number; startDate?: number;