@dev.smartpricing/message-composer-layer 4.2.7-maizzle.1 → 4.2.7
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/app/components/Email/Editor/Blocks/ButtonBlock.vue +2 -2
- package/app/components/Email/Editor/Blocks/DiscountCodeBlock.vue +4 -5
- package/app/components/Email/Editor/Blocks/DividerBlock.vue +1 -0
- package/app/components/Email/Editor/Blocks/FooterBlock.vue +1 -1
- package/app/components/Email/Editor/Blocks/GridBlock.vue +10 -6
- package/app/components/Email/Editor/Blocks/HeadingBlock.vue +1 -1
- package/app/components/Email/Editor/Blocks/IndexBlock.vue +3 -14
- package/app/components/Email/Editor/Blocks/ParagraphBlock.vue +1 -1
- package/app/components/Email/Editor/Blocks/UnsubscribeLinkBlock.vue +1 -1
- package/app/components/Email/InlinePreview.vue +1 -3
- package/app/components/Email/Preview.vue +4 -3
- package/app/components/Email/SendTestEmailModal.vue +0 -2
- package/package.json +2 -2
- package/app/composables/useEmailRenderer.ts +0 -23
|
@@ -44,7 +44,7 @@ const buttonStyles = computed(() => {
|
|
|
44
44
|
props.block.settings.shape === 'square'
|
|
45
45
|
? '0px'
|
|
46
46
|
: props.block.settings.shape === 'rounded'
|
|
47
|
-
? '
|
|
47
|
+
? '8px'
|
|
48
48
|
: '50px',
|
|
49
49
|
padding: '12px 24px',
|
|
50
50
|
border: 'none',
|
|
@@ -69,7 +69,7 @@ const containerStyles = computed(() => ({
|
|
|
69
69
|
: props.block.settings.alignment === 'center'
|
|
70
70
|
? 'center'
|
|
71
71
|
: 'flex-end',
|
|
72
|
-
padding: '
|
|
72
|
+
padding: '16px',
|
|
73
73
|
}))
|
|
74
74
|
|
|
75
75
|
defineOptions({
|
|
@@ -35,16 +35,15 @@ const discountCodeStyles = computed(() => {
|
|
|
35
35
|
props.block.settings.style === 'square'
|
|
36
36
|
? '0px'
|
|
37
37
|
: props.block.settings.style === 'rounded'
|
|
38
|
-
? '
|
|
38
|
+
? '8px'
|
|
39
39
|
: '50px',
|
|
40
|
-
padding: '
|
|
40
|
+
padding: '16px 24px',
|
|
41
41
|
textAlign: 'center',
|
|
42
|
+
display: 'inline-block',
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
if (props.block.settings.width === 'full_width') {
|
|
45
46
|
styles.width = '100%'
|
|
46
|
-
} else {
|
|
47
|
-
styles.display = 'inline-block'
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
return styles
|
|
@@ -53,7 +52,7 @@ const discountCodeStyles = computed(() => {
|
|
|
53
52
|
const containerStyles = computed(() => {
|
|
54
53
|
return {
|
|
55
54
|
backgroundColor: props.block.settings.backgroundBlock,
|
|
56
|
-
padding: '
|
|
55
|
+
padding: '16px',
|
|
57
56
|
textAlign: 'center' as const,
|
|
58
57
|
}
|
|
59
58
|
})
|
|
@@ -72,18 +72,22 @@ defineOptions({
|
|
|
72
72
|
|
|
73
73
|
<template>
|
|
74
74
|
<div
|
|
75
|
+
class="rounded p-4"
|
|
75
76
|
:style="{ backgroundColor: block.settings.backgroundColor }"
|
|
76
77
|
:data-testid="gridBlockTestIds.container"
|
|
77
78
|
>
|
|
78
|
-
<div
|
|
79
|
+
<div
|
|
80
|
+
class="grid gap-4"
|
|
81
|
+
:class="{
|
|
82
|
+
'grid-cols-1': block.settings.columns === 1,
|
|
83
|
+
'grid-cols-2': block.settings.columns === 2,
|
|
84
|
+
'grid-cols-3': block.settings.columns === 3,
|
|
85
|
+
}"
|
|
86
|
+
>
|
|
79
87
|
<div
|
|
80
88
|
v-for="(column, index) in block.settings.columnData"
|
|
81
89
|
:key="column.id"
|
|
82
|
-
class="
|
|
83
|
-
:class="
|
|
84
|
-
column.blocks.length === 0 ? 'min-h-32 border border-dashed border-neutral-300/50' : ''
|
|
85
|
-
"
|
|
86
|
-
:style="{ width: `${100 / block.settings.columns}%` }"
|
|
90
|
+
class="min-h-32 space-y-2 rounded border border-dashed border-neutral-300 p-2 overflow-hidden"
|
|
87
91
|
:data-testid="`${gridBlockTestIds.column}-${column.id}`"
|
|
88
92
|
>
|
|
89
93
|
<!-- Column blocks -->
|
|
@@ -96,10 +96,10 @@ defineOptions({
|
|
|
96
96
|
:data-block-id="block.id"
|
|
97
97
|
:data-block-type="block.type"
|
|
98
98
|
:data-testid="`${indexBlockTestIds.container}-${block.id}`"
|
|
99
|
-
class="group relative transition-colors"
|
|
99
|
+
class="group relative rounded border-2 transition-colors"
|
|
100
100
|
:class="{
|
|
101
|
-
'
|
|
102
|
-
'
|
|
101
|
+
'border-primary-500': isSelected,
|
|
102
|
+
'border-transparent hover:border-neutral-300': !isSelected,
|
|
103
103
|
'cursor-move': showDragHandle,
|
|
104
104
|
}"
|
|
105
105
|
@click.stop="handleClick"
|
|
@@ -153,14 +153,3 @@ defineOptions({
|
|
|
153
153
|
</div>
|
|
154
154
|
</UPopover>
|
|
155
155
|
</template>
|
|
156
|
-
|
|
157
|
-
<style scoped>
|
|
158
|
-
:deep(.ProseMirror ul) {
|
|
159
|
-
list-style-type: disc;
|
|
160
|
-
padding-left: 1.5em;
|
|
161
|
-
}
|
|
162
|
-
:deep(.ProseMirror ol) {
|
|
163
|
-
list-style-type: decimal;
|
|
164
|
-
padding-left: 1.5em;
|
|
165
|
-
}
|
|
166
|
-
</style>
|
|
@@ -25,7 +25,6 @@ const iframeWidth = computed(() => {
|
|
|
25
25
|
return props.view === 'mobile' ? '400px' : '600px'
|
|
26
26
|
})
|
|
27
27
|
|
|
28
|
-
const { renderer } = useEmailRenderer()
|
|
29
28
|
const { mutate: preview, data: previewed, isLoading: isPreviewing } = usePreviewEmailMutation()
|
|
30
29
|
|
|
31
30
|
const previewEmail = useDebounceFn(() => {
|
|
@@ -39,12 +38,11 @@ const previewEmail = useDebounceFn(() => {
|
|
|
39
38
|
logo_url: props.brand.logo_url,
|
|
40
39
|
}
|
|
41
40
|
: null,
|
|
42
|
-
renderer: renderer.value,
|
|
43
41
|
})
|
|
44
42
|
}, 0)
|
|
45
43
|
|
|
46
44
|
watch(
|
|
47
|
-
|
|
45
|
+
() => props.message,
|
|
48
46
|
() => {
|
|
49
47
|
previewEmail()
|
|
50
48
|
},
|
|
@@ -27,7 +27,6 @@ const { data: resolvedParams } = useResolvedParametersQuery(
|
|
|
27
27
|
() => props.message.language_id,
|
|
28
28
|
)
|
|
29
29
|
|
|
30
|
-
const { renderer } = useEmailRenderer()
|
|
31
30
|
const { mutate: compile, data: compiled, isLoading: isCompiling } = useCompileEmailMutation()
|
|
32
31
|
|
|
33
32
|
const compileEmail = useDebounceFn(() => {
|
|
@@ -38,7 +37,6 @@ const compileEmail = useDebounceFn(() => {
|
|
|
38
37
|
language: props.message.language_id,
|
|
39
38
|
parameters: resolvedParams.value.parameters,
|
|
40
39
|
brand_id: props.brandId,
|
|
41
|
-
renderer: renderer.value,
|
|
42
40
|
},
|
|
43
41
|
})
|
|
44
42
|
}, 0)
|
|
@@ -49,7 +47,10 @@ watch(
|
|
|
49
47
|
{ immediate: true },
|
|
50
48
|
)
|
|
51
49
|
|
|
52
|
-
watch(
|
|
50
|
+
watch(
|
|
51
|
+
() => props.brandId,
|
|
52
|
+
() => compileEmail(),
|
|
53
|
+
)
|
|
53
54
|
|
|
54
55
|
// Compilation
|
|
55
56
|
const iframeContent = ref<string>('')
|
|
@@ -85,7 +85,6 @@ const { t } = useI18n()
|
|
|
85
85
|
const toast = useToast()
|
|
86
86
|
const emailEditorStore = useEmailEditorStore()
|
|
87
87
|
const composerContext = useComposerContext()
|
|
88
|
-
const { renderer } = useEmailRenderer()
|
|
89
88
|
const { mutate: sendTest, isLoading: isSending, status } = useSendTestEmailMutation()
|
|
90
89
|
|
|
91
90
|
const defaultSenderEmail = computed(
|
|
@@ -157,7 +156,6 @@ function onSubmit() {
|
|
|
157
156
|
brand_id: resolvedBrandId.value,
|
|
158
157
|
...(sender_name ? { sender_name } : {}),
|
|
159
158
|
from: state.value.from || undefined,
|
|
160
|
-
renderer: renderer.value,
|
|
161
159
|
})
|
|
162
160
|
}
|
|
163
161
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dev.smartpricing/message-composer-layer",
|
|
3
|
-
"version": "4.2.7
|
|
3
|
+
"version": "4.2.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./nuxt.config.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"vue-router": "^5.0.7",
|
|
37
37
|
"vue3-emoji-picker": "^1.1.8",
|
|
38
38
|
"zod": "^4.4.3",
|
|
39
|
-
"@dev.smartpricing/message-composer-utils": "4.2.7
|
|
39
|
+
"@dev.smartpricing/message-composer-utils": "4.2.7"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@nuxt/eslint": "^1.15.2",
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { EmailRenderer } from '@dev.smartpricing/message-composer-utils/types'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Session-level toggle for email renderer selection.
|
|
5
|
-
* Defaults to "maizzle". Can be driven by A/B flags or dev toggle.
|
|
6
|
-
*/
|
|
7
|
-
export function useEmailRenderer() {
|
|
8
|
-
const renderer = useState<EmailRenderer>('email-renderer', () => 'maizzle')
|
|
9
|
-
|
|
10
|
-
function toggle() {
|
|
11
|
-
renderer.value = renderer.value === 'mjml' ? 'maizzle' : 'mjml'
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function setRenderer(value: EmailRenderer) {
|
|
15
|
-
renderer.value = value
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return {
|
|
19
|
-
renderer: readonly(renderer),
|
|
20
|
-
toggle,
|
|
21
|
-
setRenderer,
|
|
22
|
-
}
|
|
23
|
-
}
|