@stacksjs/defaults 0.75.612 → 0.75.614
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/ai/skills/stacks-actions/SKILL.md +209 -1
- package/ai/skills/stacks-api/SKILL.md +1 -1
- package/ai/skills/stacks-buddy/SKILL.md +1 -1
- package/ai/skills/stacks-dashboard/SKILL.md +120 -9
- package/ai/skills/stacks-database/SKILL.md +4 -2
- package/ai/skills/stacks-email/SKILL.md +15 -0
- package/ai/skills/stacks-middleware/SKILL.md +4 -1
- package/ai/skills/stacks-native/CAPABILITIES.md +1 -1
- package/ai/skills/stacks-native/CATALOG.md +12 -12
- package/ai/skills/stacks-validation/SKILL.md +7 -0
- package/app/Actions/Dashboard/Models/ModelDestroyAction.ts +4 -47
- package/app/Actions/Dashboard/Models/ModelSaveAction.ts +257 -0
- package/app/Actions/Dashboard/Models/ModelStoreAction.ts +4 -31
- package/app/Actions/Dashboard/Models/ModelUpdateAction.ts +5 -61
- package/app/Actions/Dashboard/Models/model-related.ts +2 -3
- package/app/Actions/Dashboard/Models/model-row-writes.ts +188 -0
- package/app/Actions/Storefront/AddToCartAction.ts +12 -15
- package/app/Actions/Storefront/CheckoutContactAction.ts +18 -10
- package/app/Actions/Storefront/CheckoutShippingAction.ts +20 -10
- package/app/Actions/Storefront/PlaceOrderAction.ts +9 -12
- package/app/Actions/Storefront/UpdateCartItemAction.ts +11 -9
- package/app/Middleware/Abilities.ts +4 -3
- package/app/Middleware/Csrf.ts +10 -1
- package/app/Middleware/Throttle.ts +4 -4
- package/functions/dashboard-api.ts +9 -3
- package/functions/dashboard-model-bulk.ts +3 -3
- package/functions/dashboard-model-drafts.test.ts +122 -0
- package/functions/dashboard-model-drafts.ts +228 -0
- package/functions/dashboard-model-record.ts +1 -1
- package/ide/vscode/package.json +1 -1
- package/package.json +5 -5
- package/resources/components/Dashboard/Analytics/AnalyticsPageHeader.stx +3 -13
- package/resources/components/Dashboard/App/RequestsOverview.stx +3 -20
- package/resources/components/Dashboard/App/SourceInventory.stx +1 -5
- package/resources/components/Dashboard/Auth/AccessTokenCreateDialog.stx +11 -28
- package/resources/components/Dashboard/Commerce/CommerceCategoriesDashboard.stx +4 -8
- package/resources/components/Dashboard/Commerce/CommerceCategoryDialog.stx +9 -9
- package/resources/components/Dashboard/Commerce/CommerceCouponDialog.stx +14 -14
- package/resources/components/Dashboard/Commerce/CommerceCouponsDashboard.stx +5 -9
- package/resources/components/Dashboard/Commerce/CommerceCustomerDialog.stx +7 -7
- package/resources/components/Dashboard/Commerce/CommerceCustomersDashboard.stx +3 -7
- package/resources/components/Dashboard/Commerce/CommerceGiftCardDialog.stx +15 -15
- package/resources/components/Dashboard/Commerce/CommerceGiftCardsDashboard.stx +5 -9
- package/resources/components/Dashboard/Commerce/CommerceManufacturerDialog.stx +12 -15
- package/resources/components/Dashboard/Commerce/CommerceManufacturersDashboard.stx +4 -28
- package/resources/components/Dashboard/Commerce/CommerceOrderDialog.stx +15 -15
- package/resources/components/Dashboard/Commerce/CommerceOrdersDashboard.stx +4 -8
- package/resources/components/Dashboard/Commerce/CommerceOverviewDashboard.stx +3 -11
- package/resources/components/Dashboard/Commerce/CommercePaymentsDashboard.stx +8 -9
- package/resources/components/Dashboard/Commerce/CommercePosCatalog.stx +3 -20
- package/resources/components/Dashboard/Commerce/CommercePosCheckoutDialog.stx +4 -4
- package/resources/components/Dashboard/Commerce/CommerceProductDialog.stx +14 -14
- package/resources/components/Dashboard/Commerce/CommerceProductsDashboard.stx +4 -8
- package/resources/components/Dashboard/Commerce/CommerceReviewEditDialog.stx +14 -24
- package/resources/components/Dashboard/Commerce/CommerceReviewsDashboard.stx +5 -43
- package/resources/components/Dashboard/Commerce/CommerceTaxDialog.stx +22 -38
- package/resources/components/Dashboard/Commerce/CommerceTaxesDashboard.stx +5 -33
- package/resources/components/Dashboard/Commerce/CommerceUnitDialog.stx +16 -30
- package/resources/components/Dashboard/Commerce/CommerceUnitsDashboard.stx +4 -28
- package/resources/components/Dashboard/Commerce/CommerceVariantDialog.stx +15 -9
- package/resources/components/Dashboard/Commerce/CommerceVariantsDashboard.stx +8 -9
- package/resources/components/Dashboard/Commerce/Delivery/CourierDialog.stx +14 -12
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRouteDialog.stx +9 -11
- package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveryDialog.stx +15 -9
- package/resources/components/Dashboard/Commerce/Delivery/LicenseKeyDialog.stx +11 -7
- package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodDialog.stx +14 -8
- package/resources/components/Dashboard/Commerce/Delivery/ShippingRateDialog.stx +11 -17
- package/resources/components/Dashboard/Commerce/Delivery/ShippingZoneDialog.stx +18 -12
- package/resources/components/Dashboard/Commerce/PaymentRefundDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/PrintDeviceDialog.stx +5 -5
- package/resources/components/Dashboard/Commerce/PrintDevicesDashboard.stx +4 -8
- package/resources/components/Dashboard/Commerce/PrintLogsDashboard.stx +5 -9
- package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +2 -10
- package/resources/components/Dashboard/Commerce/ProductWaitlistEntryDialog.stx +14 -67
- package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +3 -18
- package/resources/components/Dashboard/Commerce/RestaurantWaitlistEntryDialog.stx +23 -69
- package/resources/components/Dashboard/Content/AuthorEditorDialog.stx +4 -16
- package/resources/components/Dashboard/Content/BlogDashboard.stx +2 -19
- package/resources/components/Dashboard/Content/BlogPostEditorDialog.stx +31 -51
- package/resources/components/Dashboard/Content/CommentsDashboard.stx +1 -1
- package/resources/components/Dashboard/Content/ContentDashboard.stx +1 -11
- package/resources/components/Dashboard/Content/CreateFolderDialog.stx +1 -4
- package/resources/components/Dashboard/Content/FileManagerDashboard.stx +2 -2
- package/resources/components/Dashboard/Content/PageEditorDialog.stx +8 -17
- package/resources/components/Dashboard/Content/PostEditorDialog.stx +35 -45
- package/resources/components/Dashboard/Content/PostsDashboard.stx +1 -13
- package/resources/components/Dashboard/Content/SeoDashboard.stx +2 -20
- package/resources/components/Dashboard/Content/SeoEditorDialog.stx +4 -38
- package/resources/components/Dashboard/Content/TaxonomyEditorDialog.stx +8 -15
- package/resources/components/Dashboard/Data/ActivityLog.stx +1 -5
- package/resources/components/Dashboard/Deployments/DeploymentList.stx +2 -11
- package/resources/components/Dashboard/Email/InboxMessageList.stx +1 -5
- package/resources/components/Dashboard/Infrastructure/DnsDashboard.stx +2 -16
- package/resources/components/Dashboard/Infrastructure/LogsDashboard.stx +6 -10
- package/resources/components/Dashboard/Infrastructure/MailboxesDashboard.stx +1 -5
- package/resources/components/Dashboard/Infrastructure/ServersDashboard.stx +1 -5
- package/resources/components/Dashboard/Jobs/JobHistory.stx +3 -12
- package/resources/components/Dashboard/Kanban/KanbanCardDialog.stx +57 -51
- package/resources/components/Dashboard/Library/ComponentsDashboard.stx +4 -14
- package/resources/components/Dashboard/Library/DependenciesDashboard.stx +2 -15
- package/resources/components/Dashboard/Library/PackagesDashboard.stx +1 -8
- package/resources/components/Dashboard/Library/SourceScaffoldDialog.stx +1 -12
- package/resources/components/Dashboard/Management/PermissionsDashboard.stx +3 -3
- package/resources/components/Dashboard/Marketing/AbandonedCartsDashboard.stx +4 -4
- package/resources/components/Dashboard/Marketing/CampaignDeliveryDialog.stx +3 -5
- package/resources/components/Dashboard/Marketing/CampaignDialog.stx +59 -93
- package/resources/components/Dashboard/Marketing/CampaignsDashboard.stx +5 -5
- package/resources/components/Dashboard/Marketing/MarketingListDialog.stx +12 -26
- package/resources/components/Dashboard/Marketing/MarketingListsDashboard.stx +4 -4
- package/resources/components/Dashboard/Marketing/RecoveryCampaignDialog.stx +12 -43
- package/resources/components/Dashboard/Marketing/SocialPostDialog.stx +7 -41
- package/resources/components/Dashboard/Marketing/SocialPostsDashboard.stx +5 -5
- package/resources/components/Dashboard/Models/ModelRecordEdit.stx +240 -28
- package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +7 -23
- package/resources/components/Dashboard/Models/ModelsOverview.stx +2 -12
- package/resources/components/Dashboard/Notifications/NotificationDeliveries.stx +4 -27
- package/resources/components/Dashboard/Notifications/NotificationDeliveryHistory.stx +4 -36
- package/resources/components/Dashboard/Operations/RecoveryDestinationDialog.stx +18 -47
- package/resources/components/Dashboard/Operations/RecoveryPolicyDialog.stx +24 -78
- package/resources/components/Dashboard/Operations/RecoveryRestoreDialog.stx +8 -19
- package/resources/components/Dashboard/Queries/QueryDashboard.stx +3 -21
- package/resources/components/Dashboard/Releases/ReleaseDashboard.stx +2 -9
- package/resources/components/Dashboard/Settings/SettingsDashboard.stx +1 -11
- package/resources/components/Dashboard/UI/Input.stx +50 -1
- package/resources/components/Dashboard/UI/SearchFilter.stx +27 -17
- package/resources/components/Dashboard/UI/Select.stx +4 -1
- package/resources/components/Dashboard/UI/Textarea.stx +16 -1
- package/resources/views/cart.stx +14 -0
- package/resources/views/checkout/contact.stx +15 -1
- package/resources/views/checkout/payment.stx +7 -0
- package/resources/views/checkout/shipping.stx +39 -5
- package/routes/dashboard-api.ts +2 -0
|
@@ -191,10 +191,10 @@ onMount(() => {
|
|
|
191
191
|
|
|
192
192
|
<section class="flex flex-col gap-3">
|
|
193
193
|
<div class="grid gap-3 grid-cols-1 sm:grid-cols-2 xl:grid-cols-4">
|
|
194
|
-
<
|
|
195
|
-
<
|
|
196
|
-
<
|
|
197
|
-
<
|
|
194
|
+
<SearchFilter v-model:searchValue="search" placeholder="Search by customer or product" ariaLabel="Search carts" />
|
|
195
|
+
<Select v-model:value="stateFilter" ariaLabel="Filter cart state" placeholder="" :options="[{ value: 'open', label: 'Still out there' }, { value: 'cold', label: 'Never chased' }, { value: 'chased', label: 'Already chased' }, { value: 'recovered', label: 'Recovered' }, { value: 'all', label: 'Everything' }]" />
|
|
196
|
+
<Select v-model:value="idleFilter" ariaLabel="Filter by how long the cart has been idle" placeholder="" :options="[{ value: 'all', label: 'Any age' }, { value: '4', label: 'Idle 4h or more' }, { value: '24', label: 'Idle a day or more' }, { value: '72', label: 'Idle 3 days or more' }]" />
|
|
197
|
+
<Select v-model:value="sort" ariaLabel="Sort carts" placeholder="" :options="[{ value: 'value', label: 'Highest value' }, { value: 'idle', label: 'Longest idle' }, { value: 'customer', label: 'Customer' }]" />
|
|
198
198
|
</div>
|
|
199
199
|
<AbandonedCartsTable :sort-reset-key="sort()" :page-reset-key="viewKey()" :records="filteredRecords()" :loading="loading()" />
|
|
200
200
|
</section>
|
|
@@ -71,11 +71,9 @@ function submit(): void {
|
|
|
71
71
|
<p class="font-medium text-gray-900 text-sm dark:text-white">{{ record()?.name || '' }}</p>
|
|
72
72
|
<p class="mt-1 text-gray-500 text-xs dark:text-neutral-400">{{ record()?.emailListName || 'Not assigned' }} · {{ record()?.audienceSize.toLocaleString() || '0' }} active recipients</p>
|
|
73
73
|
</div>
|
|
74
|
-
<
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
<span class="block mt-1 text-gray-500 text-xs dark:text-neutral-400">Uses your browser’s local time.</span>
|
|
78
|
-
</label>
|
|
74
|
+
<div :if="mode() === 'schedule'" class="mt-4">
|
|
75
|
+
<Input v-model:value="scheduledAt" label="Delivery time" type="datetime-local" :required="true" hint="Uses your browser’s local time." />
|
|
76
|
+
</div>
|
|
79
77
|
<div :if="error()" role="alert" class="mt-4 p-3 text-red-700 text-sm dark:text-red-300 bg-red-50 dark:bg-red-950/30 border border-red-200 rounded-lg dark:border-red-900">{{ error() }}</div>
|
|
80
78
|
<template #footer>
|
|
81
79
|
<div class="flex gap-2 justify-end w-full">
|
|
@@ -16,7 +16,9 @@ const busy = useReactiveProp('busy', false)
|
|
|
16
16
|
const error = useReactiveProp('error', '')
|
|
17
17
|
const emit = defineEmits(['submit', 'close'])
|
|
18
18
|
const name = state('')
|
|
19
|
-
|
|
19
|
+
// Not `description`: a field bound inside the Modal is first read as the
|
|
20
|
+
// Modal's own `description` prop (stacksjs/stacks#3310).
|
|
21
|
+
const descriptionText = state('')
|
|
20
22
|
const type = state<CampaignType>('email')
|
|
21
23
|
const status = state<CampaignStatus>('draft')
|
|
22
24
|
const subject = state('')
|
|
@@ -63,7 +65,7 @@ effect(() => {
|
|
|
63
65
|
return
|
|
64
66
|
hydrationKey = key
|
|
65
67
|
name.set(current?.name || '')
|
|
66
|
-
|
|
68
|
+
descriptionText.set(current?.description || '')
|
|
67
69
|
type.set(current?.type || 'email')
|
|
68
70
|
status.set(current?.status || 'draft')
|
|
69
71
|
subject.set(current?.subject || '')
|
|
@@ -89,8 +91,30 @@ function spentError(): string {
|
|
|
89
91
|
return moneyInputError(spent(), currency(), { required: false })
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
+
/**
|
|
95
|
+
* The statuses this campaign may be set to. An email campaign is scheduled,
|
|
96
|
+
* sent and sending by its delivery, so those are shown only while it is one.
|
|
97
|
+
*/
|
|
98
|
+
const statusOptions = derived(() => {
|
|
99
|
+
const email = type() === 'email'
|
|
100
|
+
const current = status()
|
|
101
|
+
return [
|
|
102
|
+
{ value: 'draft', label: 'Draft', shown: true },
|
|
103
|
+
{ value: 'scheduled', label: 'Scheduled', shown: !email },
|
|
104
|
+
{ value: 'active', label: 'Active', shown: !email },
|
|
105
|
+
{ value: 'paused', label: 'Paused', shown: true },
|
|
106
|
+
{ value: 'cancelled', label: 'Cancelled', shown: true },
|
|
107
|
+
{ value: 'failed', label: 'Failed', shown: true },
|
|
108
|
+
{ value: 'completed', label: 'Completed', shown: !email },
|
|
109
|
+
{ value: 'archived', label: 'Archived', shown: !email },
|
|
110
|
+
{ value: 'scheduled', label: 'Scheduled', shown: email && current === 'scheduled' },
|
|
111
|
+
{ value: 'sending', label: 'Sending', shown: email && current === 'sending' },
|
|
112
|
+
{ value: 'sent', label: 'Sent', shown: email && current === 'sent' },
|
|
113
|
+
].filter(option => option.shown).map(({ value, label }) => ({ value, label }))
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
function normalizeType(next: string): void {
|
|
117
|
+
const nextType = next as CampaignType
|
|
94
118
|
if (nextType === 'email')
|
|
95
119
|
status.set('draft')
|
|
96
120
|
else if (['sending', 'sent'].includes(status()))
|
|
@@ -103,7 +127,7 @@ function submit(): void {
|
|
|
103
127
|
const code = currency().trim().toUpperCase()
|
|
104
128
|
emit('submit', {
|
|
105
129
|
name: name().trim(),
|
|
106
|
-
description:
|
|
130
|
+
description: descriptionText().trim(),
|
|
107
131
|
type: type(),
|
|
108
132
|
status: type() === 'email' && mode() === 'add' ? 'draft' : status(),
|
|
109
133
|
subject: subject().trim(),
|
|
@@ -133,100 +157,42 @@ function submit(): void {
|
|
|
133
157
|
<div :if="error()" role="alert" class="mb-5 p-3 text-red-700 text-sm dark:text-red-300 bg-red-50 dark:bg-red-950/30 border border-red-200 rounded-lg dark:border-red-900">{{ error() }}</div>
|
|
134
158
|
|
|
135
159
|
<div class="grid gap-4 sm:grid-cols-2">
|
|
136
|
-
<
|
|
137
|
-
<
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
<label class="block">
|
|
145
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Type</span>
|
|
146
|
-
<select x-model="type" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" @change="normalizeType($event)">
|
|
147
|
-
<option value="email">Email</option>
|
|
148
|
-
<option value="sms">SMS</option>
|
|
149
|
-
<option value="push">Push</option>
|
|
150
|
-
<option value="social">Social</option>
|
|
151
|
-
<option value="multi-channel">Multi-channel</option>
|
|
152
|
-
</select>
|
|
153
|
-
</label>
|
|
154
|
-
<label class="block">
|
|
155
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Status</span>
|
|
156
|
-
<select x-model="status" :disabled="type() === 'email' && (mode() === 'add' || ['scheduled', 'sending', 'sent'].includes(status()))" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700 disabled:opacity-60">
|
|
157
|
-
<option value="draft">Draft</option>
|
|
158
|
-
<option :if="type() !== 'email'" value="scheduled">Scheduled</option>
|
|
159
|
-
<option :if="type() !== 'email'" value="active">Active</option>
|
|
160
|
-
<option value="paused">Paused</option>
|
|
161
|
-
<option value="cancelled">Cancelled</option>
|
|
162
|
-
<option value="failed">Failed</option>
|
|
163
|
-
<option :if="type() !== 'email'" value="completed">Completed</option>
|
|
164
|
-
<option :if="type() !== 'email'" value="archived">Archived</option>
|
|
165
|
-
<option :if="type() === 'email' && status() === 'scheduled'" value="scheduled">Scheduled</option>
|
|
166
|
-
<option :if="type() === 'email' && status() === 'sending'" value="sending">Sending</option>
|
|
167
|
-
<option :if="type() === 'email' && status() === 'sent'" value="sent">Sent</option>
|
|
168
|
-
</select>
|
|
169
|
-
</label>
|
|
160
|
+
<div class="sm:col-span-2">
|
|
161
|
+
<Input v-model:value="name" label="Name" :minLength="3" :maxLength="255" :required="true" autocomplete="off" />
|
|
162
|
+
</div>
|
|
163
|
+
<div class="sm:col-span-2">
|
|
164
|
+
<Textarea v-model:value="descriptionText" label="Description" :rows="2" :maxLength="1000" />
|
|
165
|
+
</div>
|
|
166
|
+
<Select v-model:value="type" label="Type" placeholder="" :options="[{ value: 'email', label: 'Email' }, { value: 'sms', label: 'SMS' }, { value: 'push', label: 'Push' }, { value: 'social', label: 'Social' }, { value: 'multi-channel', label: 'Multi-channel' }]" @change="normalizeType" />
|
|
167
|
+
<Select v-model:value="status" label="Status" placeholder="" :options="statusOptions()" :disabled="type() === 'email' && (mode() === 'add' || ['scheduled', 'sending', 'sent'].includes(status()))" />
|
|
170
168
|
|
|
171
169
|
<div :if="type() === 'email'" class="grid gap-4 sm:col-span-2 sm:grid-cols-2 p-4 bg-gray-50 dark:bg-neutral-900/50 border border-gray-200 rounded-lg dark:border-neutral-700">
|
|
172
|
-
<
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
</label>
|
|
187
|
-
<label class="block sm:col-span-2">
|
|
188
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Plain-text fallback</span>
|
|
189
|
-
<textarea x-model="text" rows="3" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700"></textarea>
|
|
190
|
-
</label>
|
|
191
|
-
<label class="block">
|
|
192
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">From name</span>
|
|
193
|
-
<input x-model="fromName" type="text" maxlength="100" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
194
|
-
</label>
|
|
195
|
-
<label class="block">
|
|
196
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">From address</span>
|
|
197
|
-
<input x-model="fromAddress" type="email" maxlength="255" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
198
|
-
</label>
|
|
170
|
+
<div class="sm:col-span-2">
|
|
171
|
+
<Select v-model:value="emailListId" label="Email list" :required="true" placeholder="Select a list" :options="lists().map(list => ({ value: list.id, label: list.name + ' - ' + list.activeMembers.toLocaleString() + ' active' }))" />
|
|
172
|
+
</div>
|
|
173
|
+
<div class="sm:col-span-2">
|
|
174
|
+
<Input v-model:value="subject" label="Subject" :maxLength="255" :required="true" />
|
|
175
|
+
</div>
|
|
176
|
+
<div class="sm:col-span-2">
|
|
177
|
+
<Textarea v-model:value="template" label="Template name or raw HTML" :rows="3" :required="true" :monospace="true" />
|
|
178
|
+
</div>
|
|
179
|
+
<div class="sm:col-span-2">
|
|
180
|
+
<Textarea v-model:value="text" label="Plain-text fallback" :rows="3" />
|
|
181
|
+
</div>
|
|
182
|
+
<Input v-model:value="fromName" label="From name" :maxLength="100" />
|
|
183
|
+
<Input v-model:value="fromAddress" label="From address" type="email" :maxLength="255" />
|
|
199
184
|
</div>
|
|
200
185
|
|
|
201
|
-
<
|
|
202
|
-
<
|
|
203
|
-
|
|
204
|
-
<span :if="type() === 'email'" class="block mt-1 text-gray-500 text-xs dark:text-neutral-400">Email scheduling is managed by the delivery pipeline.</span>
|
|
205
|
-
</label>
|
|
186
|
+
<div :if="status() === 'scheduled'" class="sm:col-span-2">
|
|
187
|
+
<Input v-model:value="scheduledAt" label="Scheduled for" type="datetime-local" :required="true" :disabled="type() === 'email'" :hint="type() === 'email' ? 'Email scheduling is managed by the delivery pipeline.' : ''" />
|
|
188
|
+
</div>
|
|
206
189
|
|
|
207
|
-
<label
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
</label>
|
|
211
|
-
<label class="block">
|
|
212
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Ends</span>
|
|
213
|
-
<input x-model="endDate" type="datetime-local" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
214
|
-
</label>
|
|
215
|
-
<label class="block">
|
|
216
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Budget</span>
|
|
217
|
-
<input x-model="budget" type="number" min="0" :step="moneyInputStep(currency())" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
218
|
-
<span :if="budgetError()" class="block mt-1 text-red-600 text-xs dark:text-red-400">{{ budgetError() }}</span>
|
|
219
|
-
</label>
|
|
190
|
+
<Input v-model:value="startDate" label="Starts" type="datetime-local" />
|
|
191
|
+
<Input v-model:value="endDate" label="Ends" type="datetime-local" />
|
|
192
|
+
<Input v-model:value="budget" label="Budget" type="number" min="0" :step="moneyInputStep(currency())" inputmode="decimal" :error="budgetError()" />
|
|
220
193
|
<div class="grid gap-3 grid-cols-[1fr_7rem]">
|
|
221
|
-
<label
|
|
222
|
-
|
|
223
|
-
<input x-model="spent" type="number" min="0" :step="moneyInputStep(currency())" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
224
|
-
<span :if="spentError()" class="block mt-1 text-red-600 text-xs dark:text-red-400">{{ spentError() }}</span>
|
|
225
|
-
</label>
|
|
226
|
-
<label class="block">
|
|
227
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Currency</span>
|
|
228
|
-
<input x-model="currency" type="text" minlength="3" maxlength="3" required class="mt-1 px-3 py-2 w-full text-gray-900 text-sm uppercase dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
229
|
-
</label>
|
|
194
|
+
<Input v-model:value="spent" label="Spent" type="number" min="0" :step="moneyInputStep(currency())" inputmode="decimal" :error="spentError()" />
|
|
195
|
+
<Input v-model:value="currency" label="Currency" :minLength="3" :maxLength="3" :required="true" class="uppercase" :spellcheck="false" />
|
|
230
196
|
</div>
|
|
231
197
|
</div>
|
|
232
198
|
</form>
|
|
@@ -282,11 +282,11 @@ onMount(() => {
|
|
|
282
282
|
|
|
283
283
|
<section class="flex flex-col gap-3">
|
|
284
284
|
<div class="grid gap-3 grid-cols-1 sm:grid-cols-2 xl:grid-cols-5">
|
|
285
|
-
<
|
|
286
|
-
<
|
|
287
|
-
<
|
|
288
|
-
<
|
|
289
|
-
<
|
|
285
|
+
<SearchFilter v-model:searchValue="search" placeholder="Search campaigns" ariaLabel="Search campaigns" />
|
|
286
|
+
<Select v-model:value="typeFilter" ariaLabel="Filter campaign type" placeholder="" :options="[{ value: 'all', label: 'All types' }, { value: 'email', label: 'Email' }, { value: 'sms', label: 'SMS' }, { value: 'push', label: 'Push' }, { value: 'social', label: 'Social' }, { value: 'multi-channel', label: 'Multi-channel' }]" />
|
|
287
|
+
<Select v-model:value="statusFilter" ariaLabel="Filter campaign status" placeholder="" :options="[{ value: 'all', label: 'All statuses' }, { value: 'draft', label: 'Draft' }, { value: 'scheduled', label: 'Scheduled' }, { value: 'sending', label: 'Sending' }, { value: 'sent', label: 'Sent' }, { value: 'active', label: 'Active' }, { value: 'completed', label: 'Completed' }, { value: 'paused', label: 'Paused' }, { value: 'cancelled', label: 'Cancelled' }, { value: 'failed', label: 'Failed' }, { value: 'archived', label: 'Archived' }]" />
|
|
288
|
+
<Select v-model:value="listFilter" ariaLabel="Filter campaign list" placeholder="" :options="[{ value: 'all', label: 'All email lists' }, ...lists().map(list => ({ value: list.id, label: list.name }))]" />
|
|
289
|
+
<Select v-model:value="sort" ariaLabel="Sort campaigns" placeholder="" :options="[{ value: 'newest', label: 'Newest' }, { value: 'name', label: 'Name' }, { value: 'audience', label: 'Largest audience' }, { value: 'sent', label: 'Most sent' }]" />
|
|
290
290
|
</div>
|
|
291
291
|
<CampaignsTable :sort-reset-key="sort()" :page-reset-key="viewKey()" :records="filteredRecords()" :loading="loading()" @edit="openEdit" @delete="openDelete" @deliver="openDelivery" />
|
|
292
292
|
</section>
|
|
@@ -9,7 +9,9 @@ const error = useReactiveProp('error', '')
|
|
|
9
9
|
const emit = defineEmits(['submit', 'close'])
|
|
10
10
|
const name = state('')
|
|
11
11
|
const slug = state('')
|
|
12
|
-
|
|
12
|
+
// Not `description`: a field bound inside the Modal is first read as the
|
|
13
|
+
// Modal's own `description` prop (stacksjs/stacks#3310).
|
|
14
|
+
const descriptionText = state('')
|
|
13
15
|
const status = state('active')
|
|
14
16
|
const isPublic = state(true)
|
|
15
17
|
const doubleOptIn = state(true)
|
|
@@ -39,7 +41,7 @@ effect(() => {
|
|
|
39
41
|
slugIsManual = Boolean(current?.slug)
|
|
40
42
|
name.set(current?.name || '')
|
|
41
43
|
slug.set(current?.slug || '')
|
|
42
|
-
|
|
44
|
+
descriptionText.set(current?.description || '')
|
|
43
45
|
status.set(current?.status || 'active')
|
|
44
46
|
isPublic.set(current?.isPublic ?? true)
|
|
45
47
|
doubleOptIn.set(current?.doubleOptIn ?? true)
|
|
@@ -51,8 +53,8 @@ effect(() => {
|
|
|
51
53
|
slug.set(slugify(currentName))
|
|
52
54
|
})
|
|
53
55
|
|
|
54
|
-
function markSlugManual(
|
|
55
|
-
slugIsManual =
|
|
56
|
+
function markSlugManual(next: string): void {
|
|
57
|
+
slugIsManual = next.trim() !== ''
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
function submit(): void {
|
|
@@ -61,7 +63,7 @@ function submit(): void {
|
|
|
61
63
|
emit('submit', {
|
|
62
64
|
name: name().trim(),
|
|
63
65
|
slug: slugify(slug()),
|
|
64
|
-
description:
|
|
66
|
+
description: descriptionText().trim(),
|
|
65
67
|
status: status(),
|
|
66
68
|
isPublic: isPublic(),
|
|
67
69
|
doubleOptIn: doubleOptIn(),
|
|
@@ -79,27 +81,11 @@ function submit(): void {
|
|
|
79
81
|
<form id="marketing-list-form" @submit.prevent="submit">
|
|
80
82
|
<div :if="error()" role="alert" class="mb-5 p-3 text-red-700 text-sm dark:text-red-300 bg-red-50 dark:bg-red-950/30 border border-red-200 rounded-lg dark:border-red-900">{{ error() }}</div>
|
|
81
83
|
|
|
82
|
-
<div class="
|
|
83
|
-
<label
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<label class="block">
|
|
88
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Slug</span>
|
|
89
|
-
<input x-model="slug" type="text" maxlength="120" required autocomplete="off" class="mt-1 px-3 py-2 w-full font-mono text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" @input="markSlugManual($event)" />
|
|
90
|
-
</label>
|
|
91
|
-
<label class="block">
|
|
92
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Description</span>
|
|
93
|
-
<textarea x-model="description" rows="3" maxlength="500" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700"></textarea>
|
|
94
|
-
</label>
|
|
95
|
-
<label class="block">
|
|
96
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Status</span>
|
|
97
|
-
<select x-model="status" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700">
|
|
98
|
-
<option value="active">Active</option>
|
|
99
|
-
<option value="inactive">Inactive</option>
|
|
100
|
-
<option value="archived">Archived</option>
|
|
101
|
-
</select>
|
|
102
|
-
</label>
|
|
84
|
+
<div class="grid gap-4">
|
|
85
|
+
<Input v-model:value="name" label="Name" :maxLength="100" :required="true" autocomplete="off" />
|
|
86
|
+
<Input v-model:value="slug" label="Slug" :maxLength="120" :required="true" autocomplete="off" :spellcheck="false" :monospace="true" @input="markSlugManual" />
|
|
87
|
+
<Textarea v-model:value="descriptionText" label="Description" :rows="3" :maxLength="500" />
|
|
88
|
+
<Select v-model:value="status" label="Status" placeholder="" :options="[{ value: 'active', label: 'Active' }, { value: 'inactive', label: 'Inactive' }, { value: 'archived', label: 'Archived' }]" />
|
|
103
89
|
<div class="grid gap-3 sm:grid-cols-2">
|
|
104
90
|
<!-- Yes or no is the shared switch, as in every model form. -->
|
|
105
91
|
<div class="p-3 border border-gray-200 rounded-lg dark:border-neutral-700">
|
|
@@ -215,10 +215,10 @@ onMount(() => {
|
|
|
215
215
|
|
|
216
216
|
<section class="flex flex-col gap-3">
|
|
217
217
|
<div class="grid gap-3 grid-cols-1 sm:grid-cols-2 xl:grid-cols-4">
|
|
218
|
-
<
|
|
219
|
-
<
|
|
220
|
-
<
|
|
221
|
-
<
|
|
218
|
+
<div class="xl:col-span-1"><SearchFilter v-model:searchValue="search" placeholder="Search email lists" ariaLabel="Search email lists" /></div>
|
|
219
|
+
<Select v-model:value="statusFilter" ariaLabel="Filter status" placeholder="" :options="[{ value: 'all', label: 'All statuses' }, { value: 'active', label: 'Active' }, { value: 'inactive', label: 'Inactive' }, { value: 'archived', label: 'Archived' }]" />
|
|
220
|
+
<Select v-model:value="visibilityFilter" ariaLabel="Filter visibility" placeholder="" :options="[{ value: 'all', label: 'All signup modes' }, { value: 'public', label: 'Public' }, { value: 'private', label: 'Private' }]" />
|
|
221
|
+
<Select v-model:value="sort" ariaLabel="Sort email lists" placeholder="" :options="[{ value: 'name', label: 'Name' }, { value: 'members', label: 'Most members' }, { value: 'campaigns', label: 'Most campaigns' }, { value: 'newest', label: 'Newest' }]" />
|
|
222
222
|
</div>
|
|
223
223
|
<MarketingListsTable :sort-reset-key="sort()" :page-reset-key="viewKey()" :records="filteredRecords()" :loading="loading()" @edit="openEdit" @delete="openDelete" />
|
|
224
224
|
</section>
|
|
@@ -16,7 +16,8 @@ const subject = state('')
|
|
|
16
16
|
const text = state('')
|
|
17
17
|
const fromName = state('')
|
|
18
18
|
const fromAddress = state('')
|
|
19
|
-
|
|
19
|
+
// Text, as the input reports it; read as a number where it is used.
|
|
20
|
+
const idleHours = state('4')
|
|
20
21
|
// The threshold as typed, in major units. Carts and the stored rule hold
|
|
21
22
|
// integer minor units (stacksjs/stacks#2851).
|
|
22
23
|
const minimumValue = state('0')
|
|
@@ -36,7 +37,7 @@ effect(() => {
|
|
|
36
37
|
text.set('')
|
|
37
38
|
fromName.set('')
|
|
38
39
|
fromAddress.set('')
|
|
39
|
-
idleHours.set(defaultIdleHours())
|
|
40
|
+
idleHours.set(String(defaultIdleHours()))
|
|
40
41
|
minimumValue.set('0')
|
|
41
42
|
scheduledAt.set('')
|
|
42
43
|
})
|
|
@@ -89,56 +90,24 @@ function submit(): void {
|
|
|
89
90
|
</script>
|
|
90
91
|
|
|
91
92
|
<Modal :isOpen="open()" title="New recovery campaign" description="Writes to the people whose carts went cold. The audience comes from the carts themselves, not from a list." size="lg" @close="emit('close')">
|
|
92
|
-
<div class="
|
|
93
|
+
<div class="grid gap-4 mt-4">
|
|
93
94
|
<div class="grid gap-4 sm:grid-cols-2">
|
|
94
|
-
<label
|
|
95
|
-
|
|
96
|
-
<input x-model="name" type="text" required class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
97
|
-
</label>
|
|
98
|
-
<label class="block">
|
|
99
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Subject line</span>
|
|
100
|
-
<input x-model="subject" type="text" required class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
101
|
-
</label>
|
|
95
|
+
<Input v-model:value="name" label="Campaign name" :required="true" />
|
|
96
|
+
<Input v-model:value="subject" label="Subject line" :required="true" />
|
|
102
97
|
</div>
|
|
103
98
|
|
|
104
99
|
<div class="grid gap-4 sm:grid-cols-2">
|
|
105
|
-
<label
|
|
106
|
-
|
|
107
|
-
<div class="flex gap-2 items-center mt-1">
|
|
108
|
-
<input x-model="idleHours" type="number" min="1" max="336" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
109
|
-
<span class="text-gray-500 text-sm dark:text-neutral-400">hours</span>
|
|
110
|
-
</div>
|
|
111
|
-
<span class="block mt-1 text-gray-500 text-xs dark:text-neutral-400">Writing to somebody who is still shopping is not a recovery, it is an interruption.</span>
|
|
112
|
-
</label>
|
|
113
|
-
<label class="block">
|
|
114
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Minimum cart value</span>
|
|
115
|
-
<input x-model="minimumValue" type="number" min="0" :step="moneyInputStep(defaultCurrency())" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
116
|
-
<span :if="minimumError()" class="block mt-1 text-red-600 text-xs dark:text-red-400">{{ minimumError() }}</span>
|
|
117
|
-
<span :if="!minimumError()" class="block mt-1 text-gray-500 text-xs dark:text-neutral-400">Leave at zero to chase every cart.</span>
|
|
118
|
-
</label>
|
|
100
|
+
<Input v-model:value="idleHours" label="Wait before writing (hours)" type="number" min="1" max="336" step="1" inputmode="numeric" hint="Writing to somebody who is still shopping is not a recovery, it is an interruption." />
|
|
101
|
+
<Input v-model:value="minimumValue" label="Minimum cart value" type="number" min="0" :step="moneyInputStep(defaultCurrency())" inputmode="decimal" :error="minimumError()" hint="Leave at zero to chase every cart." />
|
|
119
102
|
</div>
|
|
120
103
|
|
|
121
104
|
<div class="grid gap-4 sm:grid-cols-2">
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
<input x-model="fromName" type="text" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
125
|
-
</label>
|
|
126
|
-
<label class="block">
|
|
127
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">From address</span>
|
|
128
|
-
<input x-model="fromAddress" type="email" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
129
|
-
</label>
|
|
105
|
+
<Input v-model:value="fromName" label="From name" />
|
|
106
|
+
<Input v-model:value="fromAddress" label="From address" type="email" />
|
|
130
107
|
</div>
|
|
131
108
|
|
|
132
|
-
<label
|
|
133
|
-
|
|
134
|
-
<textarea x-model="text" rows="3" placeholder="Your cart is still here, and so is everything in it." class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700"></textarea>
|
|
135
|
-
</label>
|
|
136
|
-
|
|
137
|
-
<label class="block">
|
|
138
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Send at</span>
|
|
139
|
-
<input x-model="scheduledAt" type="datetime-local" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
140
|
-
<span class="block mt-1 text-gray-500 text-xs dark:text-neutral-400">Leave empty to save it as a draft and send it from the campaigns screen.</span>
|
|
141
|
-
</label>
|
|
109
|
+
<Textarea v-model:value="text" label="Message" :rows="3" placeholder="Your cart is still here, and so is everything in it." />
|
|
110
|
+
<Input v-model:value="scheduledAt" label="Send at" type="datetime-local" hint="Leave empty to save it as a draft and send it from the campaigns screen." />
|
|
142
111
|
|
|
143
112
|
<div class="p-3 bg-gray-50 dark:bg-neutral-900/50 border border-gray-200 rounded-lg dark:border-neutral-700">
|
|
144
113
|
<p class="font-medium text-gray-900 text-sm dark:text-white">{{ reach().carts.toLocaleString() }} carts match these rules</p>
|
|
@@ -62,51 +62,17 @@ function submit(): void {
|
|
|
62
62
|
<form id="social-post-form" @submit.prevent="submit">
|
|
63
63
|
<div :if="error()" role="alert" class="mb-5 p-3 text-red-700 text-sm dark:text-red-300 bg-red-50 dark:bg-red-950/30 border border-red-200 rounded-lg dark:border-red-900">{{ error() }}</div>
|
|
64
64
|
|
|
65
|
-
<div class="
|
|
66
|
-
<label
|
|
67
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Content</span>
|
|
68
|
-
<textarea x-model="content" rows="5" maxlength="2000" required class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700"></textarea>
|
|
69
|
-
<span class="block mt-1 text-gray-500 text-xs dark:text-neutral-400">{{ content().length.toLocaleString() }} of 2,000 characters</span>
|
|
70
|
-
</label>
|
|
65
|
+
<div class="grid gap-4">
|
|
66
|
+
<Textarea v-model:value="content" label="Content" :rows="5" :maxLength="2000" :required="true" :showCount="true" />
|
|
71
67
|
<div class="grid gap-4 sm:grid-cols-2">
|
|
72
|
-
<label
|
|
73
|
-
|
|
74
|
-
<select x-model="platform" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700">
|
|
75
|
-
<option value="twitter">Twitter</option>
|
|
76
|
-
<option value="facebook">Facebook</option>
|
|
77
|
-
<option value="instagram">Instagram</option>
|
|
78
|
-
<option value="linkedin">LinkedIn</option>
|
|
79
|
-
<option value="tiktok">TikTok</option>
|
|
80
|
-
<option value="youtube">YouTube</option>
|
|
81
|
-
</select>
|
|
82
|
-
</label>
|
|
83
|
-
<label class="block">
|
|
84
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Status</span>
|
|
85
|
-
<select x-model="status" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700">
|
|
86
|
-
<option value="draft">Draft</option>
|
|
87
|
-
<option value="scheduled">Scheduled</option>
|
|
88
|
-
<option value="published">Published</option>
|
|
89
|
-
<option value="failed">Failed</option>
|
|
90
|
-
</select>
|
|
91
|
-
</label>
|
|
68
|
+
<Select v-model:value="platform" label="Platform" placeholder="" :options="[{ value: 'twitter', label: 'Twitter' }, { value: 'facebook', label: 'Facebook' }, { value: 'instagram', label: 'Instagram' }, { value: 'linkedin', label: 'LinkedIn' }, { value: 'tiktok', label: 'TikTok' }, { value: 'youtube', label: 'YouTube' }]" />
|
|
69
|
+
<Select v-model:value="status" label="Status" placeholder="" :options="[{ value: 'draft', label: 'Draft' }, { value: 'scheduled', label: 'Scheduled' }, { value: 'published', label: 'Published' }, { value: 'failed', label: 'Failed' }]" />
|
|
92
70
|
</div>
|
|
93
71
|
<div class="grid gap-4 sm:grid-cols-2">
|
|
94
|
-
<label
|
|
95
|
-
|
|
96
|
-
<input x-model="scheduledAt" type="datetime-local" :required="status() === 'scheduled'" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
97
|
-
</label>
|
|
98
|
-
<label class="block">
|
|
99
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Owner</span>
|
|
100
|
-
<select x-model="userId" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700">
|
|
101
|
-
<option value="">Unassigned</option>
|
|
102
|
-
<option :for="user in users()" :key="user.id" :value="user.id">{{ user.name }}{{ user.email ? ' - ' + user.email : '' }}</option>
|
|
103
|
-
</select>
|
|
104
|
-
</label>
|
|
72
|
+
<Input v-model:value="scheduledAt" label="Schedule time" type="datetime-local" :required="status() === 'scheduled'" />
|
|
73
|
+
<Select v-model:value="userId" label="Owner" placeholder="" :options="[{ value: '', label: 'Unassigned' }, ...users().map(user => ({ value: user.id, label: user.name + (user.email ? ' - ' + user.email : '') }))]" />
|
|
105
74
|
</div>
|
|
106
|
-
<label
|
|
107
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Image URL</span>
|
|
108
|
-
<input x-model="imageUrl" type="url" maxlength="2000" placeholder="https://example.com/image.jpg" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
109
|
-
</label>
|
|
75
|
+
<Input v-model:value="imageUrl" label="Image URL" type="url" inputmode="url" :maxLength="2000" placeholder="https://example.com/image.jpg" />
|
|
110
76
|
</div>
|
|
111
77
|
</form>
|
|
112
78
|
<template #footer>
|
|
@@ -197,11 +197,11 @@ onMount(() => {
|
|
|
197
197
|
|
|
198
198
|
<section class="flex flex-col gap-3">
|
|
199
199
|
<div class="grid gap-3 grid-cols-1 sm:grid-cols-2 xl:grid-cols-5">
|
|
200
|
-
<
|
|
201
|
-
<
|
|
202
|
-
<
|
|
203
|
-
<
|
|
204
|
-
<
|
|
200
|
+
<SearchFilter v-model:searchValue="search" placeholder="Search social posts" ariaLabel="Search social posts" />
|
|
201
|
+
<Select v-model:value="statusFilter" ariaLabel="Filter social status" placeholder="" :options="[{ value: 'all', label: 'All statuses' }, { value: 'draft', label: 'Draft' }, { value: 'scheduled', label: 'Scheduled' }, { value: 'published', label: 'Published' }, { value: 'failed', label: 'Failed' }]" />
|
|
202
|
+
<Select v-model:value="platformFilter" ariaLabel="Filter platform" placeholder="" :options="[{ value: 'all', label: 'All platforms' }, { value: 'twitter', label: 'Twitter' }, { value: 'facebook', label: 'Facebook' }, { value: 'instagram', label: 'Instagram' }, { value: 'linkedin', label: 'LinkedIn' }, { value: 'tiktok', label: 'TikTok' }, { value: 'youtube', label: 'YouTube' }]" />
|
|
203
|
+
<Select v-model:value="authorFilter" ariaLabel="Filter owner" placeholder="" :options="[{ value: 'all', label: 'All owners' }, { value: '', label: 'Unassigned' }, ...users().map(user => ({ value: user.id, label: user.name }))]" />
|
|
204
|
+
<Select v-model:value="sort" ariaLabel="Sort social posts" placeholder="" :options="[{ value: 'newest', label: 'Newest' }, { value: 'scheduled', label: 'Latest schedule' }, { value: 'reach', label: 'Most reach' }, { value: 'engagement', label: 'Most engagement' }]" />
|
|
205
205
|
</div>
|
|
206
206
|
<SocialPostsTable :sort-reset-key="sort()" :page-reset-key="viewKey()" :records="filteredRecords()" :loading="loading()" @edit="openEdit" @delete="openDelete" />
|
|
207
207
|
</section>
|