feat: update vue-letter and allow transform css (#10865)

Emails from iOS and MacOS clients can often come with size
transformation. This results in a broken layout when sanitizing with Vue
letter.

This PR updates the vue-letter to include the [recent changes made
there](https://github.com/mat-sz/vue-letter/pull/2). And adds the
`transform` and `transform-origin` properties to the allow list

Ref: https://www.caniemail.com/features/css-transform/

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Shivam Mishra
2025-02-19 09:07:00 +05:30
committed by GitHub
parent 69e3926db6
commit 8a5b007bc4
3 changed files with 25 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
<script setup>
import { computed, useTemplateRef, ref, onMounted } from 'vue';
import { Letter } from 'vue-letter';
import { allowedCssProperties } from 'lettersanitizer';
import Icon from 'next/icon/Icon.vue';
import { EmailQuoteExtractor } from './removeReply.js';
@@ -93,6 +94,11 @@ const hasQuotedMessage = computed(() => {
<Letter
v-if="showQuotedMessage"
class-name="prose prose-bubble !max-w-none"
:allowed-css-properties="[
...allowedCssProperties,
'transform',
'transform-origin',
]"
:html="fullHTML"
:text="textToShow"
/>
@@ -100,6 +106,11 @@ const hasQuotedMessage = computed(() => {
v-else
class-name="prose prose-bubble !max-w-none"
:html="unquotedHTML"
:allowed-css-properties="[
...allowedCssProperties,
'transform',
'transform-origin',
]"
:text="textToShow"
/>
</template>