This commit is contained in:
Tom Moor committed 2021-06-20 23:15:04 -07:00
1 parent 1560e3c9f7
commit f6837b4742
6 files changed
+47 -19

No files matched your search

+1 -1
View File
@@ -170,7 +170,7 @@
"react-window": "^1.8.6",
"reakit": "^1.3.6",
"regenerator-runtime": "^0.13.7",
"rich-markdown-editor": "^11.11.1",
"rich-markdown-editor": "^11.12.0-0",
"semver": "^7.3.2",
"sequelize": "^6.3.4",
"sequelize-cli": "^6.2.0",
@@ -1,5 +1,6 @@
// @flow
import * as React from "react";
import theme from "../../shared/styles/theme";
import { User, Document, Team, Collection } from "../models";
import Body from "./components/Body";
import Button from "./components/Button";
@@ -73,3 +74,39 @@ export const DocumentNotificationEmail = ({
</EmailTemplate>
);
};
export const css = `
ins {
background-color: #128a2929;
text-decoration: none;
}
del {
background-color: ${theme.slateLight};
color: ${theme.slate};
text-decoration: strikethrough;
}
ul {
padding-left: 0;
}
.checkbox-list-item {
list-style: none;
padding: 4px 0;
margin: 0;
}
.checkbox {
font-size: 0;
display: block;
float: left;
white-space: nowrap;
width: 12px;
height: 12px;
margin-top: 2px;
margin-right: 8px;
border: 1px solid ${theme.textSecondary};
border-radius: 3px;
}
`;
-11
View File
@@ -23,15 +23,4 @@ export const baseStyles = `
font-size: 16px;
line-height: 1.5;
}
ins {
background-color: #128a2929;
text-decoration: none;
}
del {
background-color: ${theme.slateLight};
color: ${theme.slate};
text-decoration: strikethrough;
}
`;
+2
View File
@@ -13,6 +13,7 @@ import {
type Props as DocumentNotificationEmailT,
DocumentNotificationEmail,
documentNotificationEmailText,
css as documentNotificationEmailCSS,
} from "./emails/DocumentNotificationEmail";
import { ExportEmail, exportEmailText } from "./emails/ExportEmail";
import {
@@ -148,6 +149,7 @@ export class Mailer {
title: `“${opts.document.title}” ${opts.eventName}`,
previewText: `${opts.actor.name} ${opts.eventName} a document`,
html: <DocumentNotificationEmail {...opts} />,
headCSS: documentNotificationEmailCSS,
text: documentNotificationEmailText(opts),
});
};
+3 -3
View File
@@ -1,5 +1,5 @@
// @flow
import { findLastIndex } from "lodash";
import { findIndex, findLastIndex } from "lodash";
import diff from "node-htmldiff";
import { renderToHtml } from "rich-markdown-editor";
@@ -28,9 +28,9 @@ export default function markdownDiff(
// so we can chop around those lines rather than return the entire document.
let lines = diffHtml.split("\n");
const firstChangedLineIndex = findLastIndex(
const firstChangedLineIndex = findIndex(
lines,
(value) => value.includes("<ins>") || value.includes("<del>")
(value) => value.includes("<ins ") || value.includes("<del ")
);
const lastChangedLineIndex = findLastIndex(
lines,
+4 -4
View File
@@ -11317,10 +11317,10 @@ retry-as-promised@^3.2.0:
dependencies:
any-promise "^1.3.0"
rich-markdown-editor@^11.11.1:
version "11.11.1"
resolved "https://registry.yarnpkg.com/rich-markdown-editor/-/rich-markdown-editor-11.11.1.tgz#15426ab0a163e268fa53e67585142f9463aebd49"
integrity sha512-qTeOGQrfpB/LjjAXdKwhn52FtPzPpuIw/A/FVDO9N+MFyphGN+cCjTJQ2h1AqPHakARh5ZNuOT5sMaM6O7lJYg==
rich-markdown-editor@^11.12.0-0:
version "11.12.0-0"
resolved "https://registry.yarnpkg.com/rich-markdown-editor/-/rich-markdown-editor-11.12.0-0.tgz#d18ac03cd8438c6b7cbe2da7ec07b3df074dd2bf"
integrity sha512-I+8X4B6+9ru9WMaFC664xaKQ2zjgzlTvFF5o/M5v8Z+2AAYHGvSPg9gt+87QmxNqwkT9SvWq0QhZaUVuDvVKiQ==
dependencies:
copy-to-clipboard "^3.0.8"
lodash "^4.17.11"