@happyvertical/smrt-marketing 0.60.16 → 0.60.17
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/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/smrt-knowledge.json +3 -3
- package/dist/svelte/components/BudgetPacing.svelte +30 -33
- package/dist/svelte/components/CampaignDetail.svelte +63 -64
- package/dist/svelte/components/CampaignList.svelte +56 -50
- package/dist/svelte/components/ChannelMix.svelte +49 -56
- package/dist/svelte/components/MarketingDashboard.svelte +35 -36
- package/package.json +7 -7
|
@@ -23,24 +23,24 @@ let { channels = [], currency = 'USD', locale }: Props = $props();
|
|
|
23
23
|
const mix = $derived(calculateChannelMix(channels));
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
|
-
<section class="channel-
|
|
26
|
+
<section class="smrt-channel-mix__root" data-smrt-component="ChannelMix">
|
|
27
27
|
<h3>Channel mix</h3>
|
|
28
28
|
{#if mix.length === 0}
|
|
29
|
-
<p class="empty">No channel performance yet.</p>
|
|
29
|
+
<p class="smrt-channel-mix__empty" data-smrt-part="empty">No channel performance yet.</p>
|
|
30
30
|
{:else}
|
|
31
|
-
<div class="
|
|
31
|
+
<div class="smrt-channel-mix__rows" data-smrt-part="list">
|
|
32
32
|
{#each mix as channel (channel.id)}
|
|
33
33
|
<Card padding="sm">
|
|
34
|
-
<div class="
|
|
34
|
+
<div class="smrt-channel-mix__head" data-smrt-part="header">
|
|
35
35
|
<div>
|
|
36
|
-
<span class="
|
|
37
|
-
<span class="
|
|
36
|
+
<span class="smrt-channel-mix__name" data-smrt-part="title">{channel.label ?? humanizeKey(channel.channelKind)}</span>
|
|
37
|
+
<span class="smrt-channel-mix__secondary" data-smrt-part="meta">{channel.channelRef}</span>
|
|
38
38
|
</div>
|
|
39
39
|
<Badge variant={campaignStatusBadgeVariant(channel.status)} size="sm">
|
|
40
40
|
{humanizeKey(channel.status)}
|
|
41
41
|
</Badge>
|
|
42
42
|
</div>
|
|
43
|
-
<div class="
|
|
43
|
+
<div class="smrt-channel-mix__progress-label" data-smrt-part="label">
|
|
44
44
|
<span>{formatCents(channel.spendCents, currency, locale)} spent</span>
|
|
45
45
|
<span>{formatPercent(channel.spendFraction, locale)} of mix</span>
|
|
46
46
|
</div>
|
|
@@ -49,7 +49,7 @@ const mix = $derived(calculateChannelMix(channels));
|
|
|
49
49
|
max={1}
|
|
50
50
|
label={`${channel.label ?? channel.channelKind} spend share`}
|
|
51
51
|
/>
|
|
52
|
-
<dl class="
|
|
52
|
+
<dl class="smrt-channel-mix__metrics" data-smrt-part="group">
|
|
53
53
|
<div><dt>Allocation</dt><dd>{formatCents(channel.allocatedBudgetCents, currency, locale)}</dd></div>
|
|
54
54
|
<div><dt>Impressions</dt><dd>{formatNumber(channel.impressions ?? 0, locale)}</dd></div>
|
|
55
55
|
<div><dt>Clicks</dt><dd>{formatNumber(channel.clicks ?? 0, locale)}</dd></div>
|
|
@@ -63,82 +63,75 @@ const mix = $derived(calculateChannelMix(channels));
|
|
|
63
63
|
|
|
64
64
|
<style>
|
|
65
65
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
66
|
-
@layer smrt.
|
|
67
|
-
.channel-
|
|
68
|
-
.
|
|
66
|
+
@layer smrt.structure {
|
|
67
|
+
.smrt-channel-mix__root,
|
|
68
|
+
.smrt-channel-mix__rows {
|
|
69
69
|
display: flex;
|
|
70
70
|
flex-direction: column;
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
.channel-mix {
|
|
72
|
+
.smrt-channel-mix__root {
|
|
74
73
|
gap: var(--smrt-spacing-3);
|
|
75
74
|
}
|
|
76
|
-
|
|
77
|
-
.rows {
|
|
75
|
+
.smrt-channel-mix__rows {
|
|
78
76
|
gap: var(--smrt-spacing-2);
|
|
79
77
|
}
|
|
80
|
-
|
|
81
78
|
h3,
|
|
82
|
-
.
|
|
79
|
+
.smrt-channel-mix__empty {
|
|
83
80
|
margin: 0;
|
|
84
81
|
}
|
|
82
|
+
.smrt-channel-mix__head,
|
|
83
|
+
.smrt-channel-mix__progress-label {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: space-between;
|
|
87
|
+
gap: var(--smrt-spacing-3);
|
|
88
|
+
}
|
|
89
|
+
.smrt-channel-mix__name,
|
|
90
|
+
.smrt-channel-mix__secondary {
|
|
91
|
+
display: block;
|
|
92
|
+
}
|
|
93
|
+
.smrt-channel-mix__progress-label {
|
|
94
|
+
margin: var(--smrt-spacing-3) 0 var(--smrt-spacing-1);
|
|
95
|
+
}
|
|
96
|
+
.smrt-channel-mix__metrics {
|
|
97
|
+
display: grid;
|
|
98
|
+
grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
|
|
99
|
+
gap: var(--smrt-spacing-3);
|
|
100
|
+
margin: var(--smrt-spacing-3) 0 0;
|
|
101
|
+
}
|
|
102
|
+
.smrt-channel-mix__metrics dd {
|
|
103
|
+
margin: var(--smrt-spacing-1) 0 0;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
85
106
|
|
|
107
|
+
@layer smrt.theme {
|
|
86
108
|
h3 {
|
|
87
109
|
color: var(--smrt-color-on-surface);
|
|
88
110
|
font: var(--smrt-typography-title-medium-font);
|
|
89
111
|
}
|
|
90
|
-
|
|
91
|
-
.
|
|
92
|
-
.secondary,
|
|
112
|
+
.smrt-channel-mix__empty,
|
|
113
|
+
.smrt-channel-mix__secondary,
|
|
93
114
|
dt,
|
|
94
|
-
.
|
|
115
|
+
.smrt-channel-mix__progress-label {
|
|
95
116
|
color: var(--smrt-color-on-surface-variant);
|
|
96
117
|
}
|
|
97
|
-
|
|
98
|
-
.
|
|
99
|
-
.name {
|
|
118
|
+
.smrt-channel-mix__empty,
|
|
119
|
+
.smrt-channel-mix__name {
|
|
100
120
|
font: var(--smrt-typography-body-medium-font);
|
|
101
121
|
}
|
|
102
|
-
|
|
103
|
-
.head,
|
|
104
|
-
.progress-label {
|
|
105
|
-
display: flex;
|
|
106
|
-
align-items: center;
|
|
107
|
-
justify-content: space-between;
|
|
108
|
-
gap: var(--smrt-spacing-3);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.name,
|
|
112
|
-
.secondary {
|
|
113
|
-
display: block;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.name {
|
|
122
|
+
.smrt-channel-mix__name {
|
|
117
123
|
color: var(--smrt-color-on-surface);
|
|
118
124
|
font-weight: var(--smrt-typography-weight-medium);
|
|
119
125
|
}
|
|
120
|
-
|
|
121
|
-
.
|
|
122
|
-
.progress-label,
|
|
126
|
+
.smrt-channel-mix__secondary,
|
|
127
|
+
.smrt-channel-mix__progress-label,
|
|
123
128
|
dt {
|
|
124
129
|
font: var(--smrt-typography-body-small-font);
|
|
125
130
|
}
|
|
126
|
-
|
|
127
|
-
.progress-label {
|
|
128
|
-
margin: var(--smrt-spacing-3) 0 var(--smrt-spacing-1);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.metrics {
|
|
132
|
-
display: grid;
|
|
133
|
-
grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
|
|
134
|
-
gap: var(--smrt-spacing-3);
|
|
135
|
-
margin: var(--smrt-spacing-3) 0 0;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.metrics dd {
|
|
139
|
-
margin: var(--smrt-spacing-1) 0 0;
|
|
131
|
+
.smrt-channel-mix__metrics dd {
|
|
140
132
|
color: var(--smrt-color-on-surface);
|
|
141
133
|
font: var(--smrt-typography-body-medium-font);
|
|
142
134
|
}
|
|
143
135
|
}
|
|
136
|
+
|
|
144
137
|
</style>
|
|
@@ -28,46 +28,46 @@ let {
|
|
|
28
28
|
const summary = $derived(summarizeMarketingDashboard(campaigns));
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
|
-
<section class="marketing-
|
|
32
|
-
<div class="
|
|
31
|
+
<section class="smrt-marketing-dashboard__root" data-smrt-component="MarketingDashboard">
|
|
32
|
+
<div class="smrt-marketing-dashboard__tiles" data-smrt-part="list">
|
|
33
33
|
<Card padding="sm">
|
|
34
|
-
<dl class="
|
|
34
|
+
<dl class="smrt-marketing-dashboard__tile" data-smrt-part="item">
|
|
35
35
|
<dt>Campaigns</dt>
|
|
36
36
|
<dd>{summary.activeCampaignCount} active</dd>
|
|
37
|
-
<dd class="
|
|
37
|
+
<dd class="smrt-marketing-dashboard__secondary" data-smrt-part="value">{summary.campaignCount} total</dd>
|
|
38
38
|
</dl>
|
|
39
39
|
</Card>
|
|
40
40
|
<Card padding="sm">
|
|
41
|
-
<dl class="
|
|
41
|
+
<dl class="smrt-marketing-dashboard__tile" data-smrt-part="item">
|
|
42
42
|
<dt>Channels</dt>
|
|
43
43
|
<dd>{summary.channelCount}</dd>
|
|
44
|
-
<dd class="
|
|
44
|
+
<dd class="smrt-marketing-dashboard__secondary" data-smrt-part="value">linked executions</dd>
|
|
45
45
|
</dl>
|
|
46
46
|
</Card>
|
|
47
47
|
<Card padding="sm">
|
|
48
|
-
<dl class="
|
|
48
|
+
<dl class="smrt-marketing-dashboard__tile" data-smrt-part="item">
|
|
49
49
|
<dt>Leads</dt>
|
|
50
50
|
<dd>{formatNumber(summary.leads, locale)}</dd>
|
|
51
|
-
<dd class="
|
|
51
|
+
<dd class="smrt-marketing-dashboard__secondary" data-smrt-part="value">{formatNumber(summary.conversions, locale)} conversions</dd>
|
|
52
52
|
</dl>
|
|
53
53
|
</Card>
|
|
54
54
|
<Card padding="sm">
|
|
55
|
-
<dl class="
|
|
55
|
+
<dl class="smrt-marketing-dashboard__tile" data-smrt-part="item">
|
|
56
56
|
<dt>Reach</dt>
|
|
57
57
|
<dd>{formatNumber(summary.impressions, locale)}</dd>
|
|
58
|
-
<dd class="
|
|
58
|
+
<dd class="smrt-marketing-dashboard__secondary" data-smrt-part="value">{formatNumber(summary.clicks, locale)} clicks</dd>
|
|
59
59
|
</dl>
|
|
60
60
|
</Card>
|
|
61
61
|
</div>
|
|
62
62
|
|
|
63
63
|
{#if summary.currencyTotals.length > 0}
|
|
64
64
|
<Card padding="sm">
|
|
65
|
-
<div class="
|
|
65
|
+
<div class="smrt-marketing-dashboard__currency-totals" data-smrt-part="meta">
|
|
66
66
|
{#each summary.currencyTotals as total (total.currency)}
|
|
67
|
-
<dl class="
|
|
67
|
+
<dl class="smrt-marketing-dashboard__currency-total" data-smrt-part="value">
|
|
68
68
|
<dt>{total.currency}</dt>
|
|
69
69
|
<dd>{formatCents(total.spendCents, total.currency, locale)} spent</dd>
|
|
70
|
-
<dd class="
|
|
70
|
+
<dd class="smrt-marketing-dashboard__secondary" data-smrt-part="value">
|
|
71
71
|
of {formatCents(total.budgetCents, total.currency, locale)} budget
|
|
72
72
|
</dd>
|
|
73
73
|
</dl>
|
|
@@ -77,60 +77,59 @@ const summary = $derived(summarizeMarketingDashboard(campaigns));
|
|
|
77
77
|
{/if}
|
|
78
78
|
|
|
79
79
|
{#if campaignList}
|
|
80
|
-
<div class="
|
|
80
|
+
<div class="smrt-marketing-dashboard__surface" data-smrt-part="body">{@render campaignList()}</div>
|
|
81
81
|
{/if}
|
|
82
82
|
{#if detail}
|
|
83
|
-
<div class="
|
|
83
|
+
<div class="smrt-marketing-dashboard__surface" data-smrt-part="body">{@render detail()}</div>
|
|
84
84
|
{/if}
|
|
85
85
|
{@render children?.()}
|
|
86
86
|
</section>
|
|
87
87
|
|
|
88
88
|
<style>
|
|
89
89
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
90
|
-
@layer smrt.
|
|
91
|
-
.marketing-
|
|
90
|
+
@layer smrt.structure {
|
|
91
|
+
.smrt-marketing-dashboard__root {
|
|
92
92
|
display: flex;
|
|
93
93
|
flex-direction: column;
|
|
94
94
|
gap: var(--smrt-spacing-4);
|
|
95
95
|
}
|
|
96
|
-
|
|
97
|
-
.tiles {
|
|
96
|
+
.smrt-marketing-dashboard__tiles {
|
|
98
97
|
display: grid;
|
|
99
98
|
grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
|
|
100
99
|
gap: var(--smrt-spacing-3);
|
|
101
100
|
}
|
|
102
|
-
|
|
103
|
-
.
|
|
104
|
-
.currency-total {
|
|
101
|
+
.smrt-marketing-dashboard__tile,
|
|
102
|
+
.smrt-marketing-dashboard__currency-total {
|
|
105
103
|
margin: 0;
|
|
106
104
|
}
|
|
105
|
+
dd {
|
|
106
|
+
margin: var(--smrt-spacing-1) 0 0;
|
|
107
|
+
}
|
|
108
|
+
.smrt-marketing-dashboard__currency-totals {
|
|
109
|
+
display: grid;
|
|
110
|
+
grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
|
|
111
|
+
gap: var(--smrt-spacing-4);
|
|
112
|
+
}
|
|
113
|
+
.smrt-marketing-dashboard__surface {
|
|
114
|
+
min-width: 0;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
107
117
|
|
|
118
|
+
@layer smrt.theme {
|
|
108
119
|
dt {
|
|
109
120
|
color: var(--smrt-color-on-surface-variant);
|
|
110
121
|
font: var(--smrt-typography-label-medium-font);
|
|
111
122
|
text-transform: uppercase;
|
|
112
123
|
letter-spacing: var(--smrt-typography-label-medium-tracking);
|
|
113
124
|
}
|
|
114
|
-
|
|
115
125
|
dd {
|
|
116
|
-
margin: var(--smrt-spacing-1) 0 0;
|
|
117
126
|
color: var(--smrt-color-on-surface);
|
|
118
127
|
font: var(--smrt-typography-title-medium-font);
|
|
119
128
|
}
|
|
120
|
-
|
|
121
|
-
.secondary {
|
|
129
|
+
.smrt-marketing-dashboard__secondary {
|
|
122
130
|
color: var(--smrt-color-on-surface-variant);
|
|
123
131
|
font: var(--smrt-typography-body-small-font);
|
|
124
132
|
}
|
|
125
|
-
|
|
126
|
-
.currency-totals {
|
|
127
|
-
display: grid;
|
|
128
|
-
grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
|
|
129
|
-
gap: var(--smrt-spacing-4);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.surface {
|
|
133
|
-
min-width: 0;
|
|
134
|
-
}
|
|
135
133
|
}
|
|
134
|
+
|
|
136
135
|
</style>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-marketing",
|
|
3
|
-
"version": "0.60.
|
|
3
|
+
"version": "0.60.17",
|
|
4
4
|
"smrtJsdoc": "strict",
|
|
5
5
|
"description": "Cross-channel campaign coordination, immutable performance evidence, budget pacing, and reusable Svelte marketing surfaces for SMRT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
"./manifest.json": "./dist/manifest.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@happyvertical/smrt-core": "0.60.
|
|
29
|
-
"@happyvertical/smrt-tenancy": "0.60.
|
|
30
|
-
"@happyvertical/smrt-ui": "0.60.
|
|
28
|
+
"@happyvertical/smrt-core": "0.60.17",
|
|
29
|
+
"@happyvertical/smrt-tenancy": "0.60.17",
|
|
30
|
+
"@happyvertical/smrt-ui": "0.60.17"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"svelte": "^5.57.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@happyvertical/smrt-commerce": "0.60.
|
|
37
|
-
"@happyvertical/smrt-vitest": "0.60.
|
|
38
|
-
"@happyvertical/sql": "^0.
|
|
36
|
+
"@happyvertical/smrt-commerce": "0.60.17",
|
|
37
|
+
"@happyvertical/smrt-vitest": "0.60.17",
|
|
38
|
+
"@happyvertical/sql": "^0.112.2",
|
|
39
39
|
"@sveltejs/package": "^2.5.8",
|
|
40
40
|
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
41
41
|
"@testing-library/svelte": "^5.4.2",
|