@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
|
@@ -124,8 +124,8 @@ effect(() => {
|
|
|
124
124
|
void loadCustomers('')
|
|
125
125
|
})
|
|
126
126
|
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
/** The customer just chosen, by the id the select reports. */
|
|
128
|
+
function hydrateCustomer(selectedId: string): void {
|
|
129
129
|
const customer = customers().find(option => option.id === selectedId)
|
|
130
130
|
if (!customer)
|
|
131
131
|
return
|
|
@@ -178,77 +178,31 @@ function errorMessages(): string[] {
|
|
|
178
178
|
</ul>
|
|
179
179
|
|
|
180
180
|
<div class="grid gap-4 sm:grid-cols-2 mt-6">
|
|
181
|
-
<
|
|
182
|
-
<span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Existing customer</span>
|
|
183
|
-
<input x-model="customerQuery" @input="searchCustomersSoon()" type="search" name="customer_search" aria-label="Search customers by name, email or phone" placeholder="Search customers by name, email or phone" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
|
|
184
|
-
</label>
|
|
181
|
+
<div class="sm:col-span-2"><Input v-model:value="customerQuery" label="Existing customer" type="search" name="customer_search" ariaLabel="Search customers by name, email or phone" placeholder="Search customers by name, email or phone" @input="searchCustomersSoon()" /></div>
|
|
185
182
|
<div class="sm:col-span-2 -mt-2">
|
|
186
|
-
<
|
|
187
|
-
<option value="">No linked customer</option>
|
|
188
|
-
<option :for="option in customers()" :key="option.id" :value="option.id" :selected="option.id === String(customerId())">{{ option.label }}{{ option.detail ? ' · ' + option.detail : '' }}</option>
|
|
189
|
-
</select>
|
|
183
|
+
<Select v-model:value="customerId" ariaLabel="Existing customer" placeholder="" :options="[{ value: '', label: 'No linked customer' }, ...customers().map(option => ({ value: option.id, label: option.label + (option.detail ? ' · ' + option.detail : '') }))]" @change="hydrateCustomer($event)" />
|
|
190
184
|
<p :if="moreCustomersLabel()" class="mt-1 text-gray-500 text-xs dark:text-neutral-400" :text="moreCustomersLabel()"></p>
|
|
191
185
|
</div>
|
|
192
186
|
|
|
193
|
-
<label
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
<label
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
<label class="block">
|
|
214
|
-
<span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Check in time</span>
|
|
215
|
-
<input type="datetime-local" x-model="checkInTime" required class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
|
|
216
|
-
</label>
|
|
217
|
-
|
|
218
|
-
<label class="block">
|
|
219
|
-
<span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Quoted wait in minutes</span>
|
|
220
|
-
<input type="number" x-model.number="quotedWaitTime" required min="0" step="1" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
|
|
221
|
-
</label>
|
|
222
|
-
|
|
223
|
-
<label class="block">
|
|
224
|
-
<span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Table preference</span>
|
|
225
|
-
<select x-model="tablePreference" required class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600">
|
|
226
|
-
<option value="no_preference">No preference</option>
|
|
227
|
-
<option value="indoor">Indoor</option>
|
|
228
|
-
<option value="bar">Bar</option>
|
|
229
|
-
<option value="booth">Booth</option>
|
|
230
|
-
</select>
|
|
231
|
-
</label>
|
|
232
|
-
|
|
233
|
-
<label class="block">
|
|
234
|
-
<span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Status</span>
|
|
235
|
-
<select x-model="status" required class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600">
|
|
236
|
-
<option value="waiting">Waiting</option>
|
|
237
|
-
<option value="seated">Seated</option>
|
|
238
|
-
<option value="cancelled">Cancelled</option>
|
|
239
|
-
<option value="no_show">No show</option>
|
|
240
|
-
</select>
|
|
241
|
-
</label>
|
|
242
|
-
|
|
243
|
-
<label class="block">
|
|
244
|
-
<span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Actual wait in minutes</span>
|
|
245
|
-
<input type="number" x-model.number="actualWaitTime" min="0" step="1" placeholder="Not recorded" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
|
|
246
|
-
</label>
|
|
247
|
-
|
|
248
|
-
<label class="block">
|
|
249
|
-
<span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Queue position</span>
|
|
250
|
-
<input type="number" x-model.number="queuePosition" min="1" step="1" placeholder="Not assigned" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
|
|
251
|
-
</label>
|
|
187
|
+
<Input v-model:value="name" label="Name" :required="true" :maxLength="255" autocomplete="name" />
|
|
188
|
+
|
|
189
|
+
<Input type="email" label="Email" v-model:value="email" :required="true" :maxLength="255" autocomplete="email" />
|
|
190
|
+
|
|
191
|
+
<Input type="tel" label="Phone" v-model:value="phone" :maxLength="100" autocomplete="tel" />
|
|
192
|
+
|
|
193
|
+
<Input type="number" label="Party size" v-model:value="partySize" :required="true" min="1" step="1" />
|
|
194
|
+
|
|
195
|
+
<Input type="datetime-local" label="Check in time" v-model:value="checkInTime" :required="true" />
|
|
196
|
+
|
|
197
|
+
<Input type="number" label="Quoted wait in minutes" v-model:value="quotedWaitTime" :required="true" min="0" step="1" />
|
|
198
|
+
|
|
199
|
+
<Select v-model:value="tablePreference" label="Table preference" :required="true" placeholder="" :options="[{ value: 'no_preference', label: 'No preference' }, { value: 'indoor', label: 'Indoor' }, { value: 'bar', label: 'Bar' }, { value: 'booth', label: 'Booth' }]" />
|
|
200
|
+
|
|
201
|
+
<Select v-model:value="status" label="Status" :required="true" placeholder="" :options="[{ value: 'waiting', label: 'Waiting' }, { value: 'seated', label: 'Seated' }, { value: 'cancelled', label: 'Cancelled' }, { value: 'no_show', label: 'No show' }]" />
|
|
202
|
+
|
|
203
|
+
<Input type="number" label="Actual wait in minutes" v-model:value="actualWaitTime" min="0" step="1" placeholder="Not recorded" />
|
|
204
|
+
|
|
205
|
+
<Input type="number" label="Queue position" v-model:value="queuePosition" min="1" step="1" placeholder="Not assigned" />
|
|
252
206
|
</div>
|
|
253
207
|
|
|
254
208
|
</form>
|
|
@@ -61,22 +61,10 @@ function submit(): void {
|
|
|
61
61
|
@close="close"
|
|
62
62
|
>
|
|
63
63
|
<form id="author-editor-form" class="grid gap-4" @submit.prevent="submit">
|
|
64
|
-
<label
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
<label>
|
|
69
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Email</span>
|
|
70
|
-
<input x-model="email" name="email" type="email" required autocomplete="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" />
|
|
71
|
-
</label>
|
|
72
|
-
<label>
|
|
73
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Bio</span>
|
|
74
|
-
<textarea x-model="bio" name="bio" maxlength="500" 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>
|
|
75
|
-
</label>
|
|
76
|
-
<label>
|
|
77
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Avatar URL</span>
|
|
78
|
-
<input x-model="avatar" name="avatar" type="url" inputmode="url" placeholder="https://example.com/avatar.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" />
|
|
79
|
-
</label>
|
|
64
|
+
<Input v-model:value="name" name="name" label="Name" :required="true" :minLength="5" :maxLength="255" autocomplete="name" />
|
|
65
|
+
<Input v-model:value="email" name="email" label="Email" type="email" :required="true" autocomplete="email" />
|
|
66
|
+
<Textarea v-model:value="bio" name="bio" label="Bio" :rows="3" :maxLength="500" />
|
|
67
|
+
<Input v-model:value="avatar" name="avatar" label="Avatar URL" type="url" inputmode="url" placeholder="https://example.com/avatar.jpg" />
|
|
80
68
|
</form>
|
|
81
69
|
|
|
82
70
|
<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">
|
|
@@ -55,27 +55,10 @@ defineClientPayload({ blogUrl })
|
|
|
55
55
|
<section class="overflow-hidden max-w-full min-w-0 bg-white dark:bg-neutral-900 border border-neutral-200 rounded-md dark:border-neutral-800">
|
|
56
56
|
<div class="flex flex-col gap-3 md:flex-row md:items-center md:justify-between p-4 border-b border-neutral-200 dark:border-neutral-800">
|
|
57
57
|
<div class="relative flex-1 max-w-md">
|
|
58
|
-
<
|
|
59
|
-
<label for="blog-search" class="sr-only">Search posts</label>
|
|
60
|
-
<input
|
|
61
|
-
id="blog-search"
|
|
62
|
-
type="search"
|
|
63
|
-
x-model="searchQuery"
|
|
64
|
-
placeholder="Search posts"
|
|
65
|
-
class="placeholder-neutral-500 pl-9 pr-3 py-2 w-full text-neutral-900 text-sm dark:text-neutral-100 bg-white dark:bg-neutral-950 border border-neutral-300 outline-none rounded-md dark:border-neutral-700 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30"
|
|
66
|
-
/>
|
|
58
|
+
<SearchFilter v-model:searchValue="searchQuery" placeholder="Search posts" ariaLabel="Search posts" class="w-full" />
|
|
67
59
|
</div>
|
|
68
60
|
<div>
|
|
69
|
-
<
|
|
70
|
-
<select
|
|
71
|
-
id="blog-status"
|
|
72
|
-
x-model="statusFilter"
|
|
73
|
-
class="px-3 py-2 text-neutral-900 text-sm dark:text-neutral-100 bg-white dark:bg-neutral-950 border border-neutral-300 rounded-md dark:border-neutral-700"
|
|
74
|
-
>
|
|
75
|
-
<option value="all">All statuses</option>
|
|
76
|
-
<option value="published">Published</option>
|
|
77
|
-
<option value="draft">Draft</option>
|
|
78
|
-
</select>
|
|
61
|
+
<Select v-model:value="statusFilter" id="blog-status" ariaLabel="Filter by status" placeholder="" :options="[{ value: 'all', label: 'All statuses' }, { value: 'published', label: 'Published' }, { value: 'draft', label: 'Draft' }]" />
|
|
79
62
|
</div>
|
|
80
63
|
</div>
|
|
81
64
|
|
|
@@ -34,9 +34,11 @@ const bodyLoading = useReactiveProp('bodyLoading', false)
|
|
|
34
34
|
const bodyLoadFailed = useReactiveProp('bodyLoadFailed', false)
|
|
35
35
|
const busy = useReactiveProp('busy', false)
|
|
36
36
|
const error = useReactiveProp('error', '')
|
|
37
|
-
|
|
37
|
+
// Not `title` and `description`: a field bound inside the Modal is first read
|
|
38
|
+
// as the Modal's own prop of that name (stacksjs/stacks#3310).
|
|
39
|
+
const postTitle = state('')
|
|
38
40
|
const slug = state('')
|
|
39
|
-
const
|
|
41
|
+
const descriptionText = state('')
|
|
40
42
|
const date = state('')
|
|
41
43
|
const author = state('')
|
|
42
44
|
const poster = state('')
|
|
@@ -55,7 +57,7 @@ function slugify(input: string): string {
|
|
|
55
57
|
.slice(0, 80)
|
|
56
58
|
}
|
|
57
59
|
|
|
58
|
-
const suggestedSlug = derived(() => slugify(
|
|
60
|
+
const suggestedSlug = derived(() => slugify(postTitle()))
|
|
59
61
|
const wordCount = derived(() => body().split(/\s+/).filter(Boolean).length)
|
|
60
62
|
const readingTime = derived(() => Math.max(1, Math.round(wordCount() / 200)))
|
|
61
63
|
const dialogTitle = derived(() => editing() ? 'Edit post' : 'New post')
|
|
@@ -66,9 +68,9 @@ effect(() => {
|
|
|
66
68
|
if (isOpen && !wasOpen) {
|
|
67
69
|
const record = editing()
|
|
68
70
|
activeSlug = record?.slug || ''
|
|
69
|
-
|
|
71
|
+
postTitle.set(record?.title || '')
|
|
70
72
|
slug.set(record?.slug || '')
|
|
71
|
-
|
|
73
|
+
descriptionText.set(record?.description || '')
|
|
72
74
|
date.set(record?.date || new Date().toISOString().slice(0, 10))
|
|
73
75
|
author.set(record?.author || '')
|
|
74
76
|
poster.set(record?.poster || '')
|
|
@@ -85,7 +87,7 @@ effect(() => {
|
|
|
85
87
|
})
|
|
86
88
|
|
|
87
89
|
function valid(): boolean {
|
|
88
|
-
return
|
|
90
|
+
return postTitle().trim().length > 0 && !bodyLoading() && !bodyLoadFailed()
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
function close(): void {
|
|
@@ -99,8 +101,8 @@ function submit(): void {
|
|
|
99
101
|
|
|
100
102
|
const postDraft: BlogPostDraft = {
|
|
101
103
|
slug: slug().trim() || suggestedSlug(),
|
|
102
|
-
title:
|
|
103
|
-
description:
|
|
104
|
+
title: postTitle().trim(),
|
|
105
|
+
description: descriptionText().trim(),
|
|
104
106
|
date: date(),
|
|
105
107
|
author: author().trim(),
|
|
106
108
|
authorBio: '',
|
|
@@ -131,49 +133,27 @@ function submit(): void {
|
|
|
131
133
|
</div>
|
|
132
134
|
|
|
133
135
|
<div class="grid gap-4 sm:grid-cols-2">
|
|
134
|
-
<
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
<
|
|
146
|
-
<
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
</
|
|
155
|
-
|
|
156
|
-
<label class="flex flex-col gap-2">
|
|
157
|
-
<span class="font-medium text-sm">Author</span>
|
|
158
|
-
<input x-model="author" name="author" type="text" class="px-3 py-2 text-neutral-900 text-sm dark:text-neutral-100 bg-white dark:bg-neutral-950 border border-neutral-300 outline-none rounded-md dark:border-neutral-700 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30" />
|
|
159
|
-
</label>
|
|
160
|
-
|
|
161
|
-
<label class="flex flex-col gap-2 sm:col-span-2">
|
|
162
|
-
<span class="font-medium text-sm">Poster image</span>
|
|
163
|
-
<input x-model="poster" name="poster" type="text" placeholder="/assets/images/example.svg" class="placeholder-neutral-500 px-3 py-2 text-neutral-900 text-sm dark:text-neutral-100 bg-white dark:bg-neutral-950 border border-neutral-300 outline-none rounded-md dark:border-neutral-700 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30" />
|
|
164
|
-
</label>
|
|
165
|
-
|
|
166
|
-
<label class="flex flex-col gap-2 sm:col-span-2">
|
|
167
|
-
<span class="flex gap-3 items-center justify-between">
|
|
168
|
-
<span class="font-medium text-sm">Content</span>
|
|
169
|
-
<span :if="bodyLoading()" role="status" class="inline-flex gap-1.5 items-center text-neutral-500 text-xs dark:text-neutral-400">
|
|
170
|
-
<span class="h-3.5 w-3.5 animate-spin i-hugeicons-loading-03"></span>
|
|
171
|
-
Loading content
|
|
172
|
-
</span>
|
|
173
|
-
</span>
|
|
174
|
-
<textarea x-model="body" name="body" rows="14" :disabled="bodyLoading() || bodyLoadFailed()" class="px-3 py-2 font-mono text-neutral-900 text-sm dark:text-neutral-100 bg-white dark:bg-neutral-950 border border-neutral-300 outline-none rounded-md dark:border-neutral-700 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30 disabled:opacity-60 resize-y"></textarea>
|
|
175
|
-
<span class="text-neutral-500 text-xs dark:text-neutral-400">Markdown. {{ wordCount() }} words, about {{ readingTime() }} min read.</span>
|
|
176
|
-
</label>
|
|
136
|
+
<div class="sm:col-span-2">
|
|
137
|
+
<Input v-model:value="postTitle" name="title" label="Title" :required="true" :autofocus="true" />
|
|
138
|
+
</div>
|
|
139
|
+
<div class="sm:col-span-2">
|
|
140
|
+
<Input v-model:value="slug" name="slug" label="Slug" :placeholder="suggestedSlug()" :spellcheck="false" :monospace="true" :hint="'The file name and public URL: /blog/' + (slug() || suggestedSlug() || 'your-post')" />
|
|
141
|
+
</div>
|
|
142
|
+
<div class="sm:col-span-2">
|
|
143
|
+
<Input v-model:value="descriptionText" name="description" label="Description" hint="Used as the excerpt, meta description, and RSS summary." />
|
|
144
|
+
</div>
|
|
145
|
+
<Input v-model:value="date" name="date" label="Date" type="date" />
|
|
146
|
+
<Input v-model:value="author" name="author" label="Author" />
|
|
147
|
+
<div class="sm:col-span-2">
|
|
148
|
+
<Input v-model:value="poster" name="poster" label="Poster image" placeholder="/assets/images/example.svg" />
|
|
149
|
+
</div>
|
|
150
|
+
<div class="sm:col-span-2">
|
|
151
|
+
<Textarea v-model:value="body" name="body" label="Content" :rows="14" :monospace="true" :disabled="bodyLoading() || bodyLoadFailed()" :hint="'Markdown. ' + wordCount() + ' words, about ' + readingTime() + ' min read.'" />
|
|
152
|
+
<p :if="bodyLoading()" role="status" class="inline-flex gap-1.5 items-center mt-1.5 text-neutral-500 text-xs dark:text-neutral-400">
|
|
153
|
+
<span aria-hidden="true" class="h-3.5 w-3.5 animate-spin i-hugeicons-loading-03"></span>
|
|
154
|
+
Loading content
|
|
155
|
+
</p>
|
|
156
|
+
</div>
|
|
177
157
|
</div>
|
|
178
158
|
|
|
179
159
|
<div class="flex flex-col gap-3 sm:flex-row sm:gap-6 pt-2 border-neutral-200 border-t dark:border-neutral-800">
|
|
@@ -207,7 +207,7 @@ onMount(() => {
|
|
|
207
207
|
</section>
|
|
208
208
|
|
|
209
209
|
<section class="overflow-hidden bg-white dark:bg-neutral-800 border border-gray-200 rounded-lg dark:border-neutral-700">
|
|
210
|
-
<div class="flex flex-col gap-3 sm:flex-row p-4 border-b border-gray-200 dark:border-neutral-700"><
|
|
210
|
+
<div class="flex flex-col gap-3 sm:flex-row p-4 border-b border-gray-200 dark:border-neutral-700"><div class="flex-1"><SearchFilter v-model:searchValue="search" placeholder="Search comments" ariaLabel="Search comments" /></div><Select v-model:value="statusFilter" ariaLabel="Filter comment status" placeholder="" :options="[{ value: 'all', label: 'All statuses' }, { value: 'pending', label: 'Pending' }, { value: 'approved', label: 'Approved' }, { value: 'spam', label: 'Spam' }, { value: 'trash', label: 'Trash' }]" /></div>
|
|
211
211
|
<div class="divide-gray-200 divide-y dark:divide-neutral-700">
|
|
212
212
|
<div :if="loading()" class="px-4 py-14 text-center text-gray-500 text-sm dark:text-neutral-400"><span class="inline-block mr-2 h-4 w-4 animate-spin i-hugeicons-loading-03"></span>Loading comments</div>
|
|
213
213
|
<div :else-if="visibleComments().length === 0" class="px-4 py-14 text-center"><span class="inline-block h-6 w-6 text-gray-400 i-hugeicons-comment-01"></span><p class="mt-2 font-medium text-gray-900 text-sm dark:text-white">No comments found</p><p class="mt-1 text-gray-500 text-sm dark:text-neutral-400">Adjust the search or status filter.</p></div>
|
|
@@ -245,17 +245,7 @@ onDestroy(() => {
|
|
|
245
245
|
<p class="mt-1 text-gray-500 text-sm dark:text-neutral-400">What was written, published and read in the selected period.</p>
|
|
246
246
|
</div>
|
|
247
247
|
<div class="flex gap-2">
|
|
248
|
-
<
|
|
249
|
-
<span class="sr-only">Content reporting period</span>
|
|
250
|
-
<select
|
|
251
|
-
x-model="selectedRange"
|
|
252
|
-
aria-label="Content reporting period"
|
|
253
|
-
class="block pl-3 pr-10 py-2 text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"
|
|
254
|
-
@change="changeRange"
|
|
255
|
-
>
|
|
256
|
-
<option :for="range in rangeOptions" :value="range.value">{{ range.label }}</option>
|
|
257
|
-
</select>
|
|
258
|
-
</label>
|
|
248
|
+
<Select v-model:value="selectedRange" ariaLabel="Content reporting period" placeholder="" :options="rangeOptions" @change="changeRange" />
|
|
259
249
|
<Button variant="secondary" :loading="loading()" @click="loadOverview()">
|
|
260
250
|
<span :if="!loading()" class="h-4 w-4 i-hugeicons-refresh"></span>
|
|
261
251
|
Refresh
|
|
@@ -28,10 +28,7 @@ function submit(): void {
|
|
|
28
28
|
|
|
29
29
|
<Modal :isOpen="open()" title="Create folder" :description="'Add a folder inside ' + location() + '.'" size="sm" :closable="!busy()" @close="close">
|
|
30
30
|
<form id="create-folder-form" @submit.prevent="submit">
|
|
31
|
-
<label
|
|
32
|
-
<span class="font-medium text-sm text-stone-700 dark:text-neutral-200">Folder name</span>
|
|
33
|
-
<input x-model.trim="folderName" name="name" required maxlength="255" autocomplete="off" class="mt-1 px-3 py-2 w-full text-sm text-stone-900 dark:text-white bg-white dark:bg-neutral-900 border border-stone-300 rounded-lg dark:border-neutral-700" />
|
|
34
|
-
</label>
|
|
31
|
+
<Input v-model:value="folderName" name="name" label="Folder name" :required="true" :maxLength="255" autocomplete="off" />
|
|
35
32
|
</form>
|
|
36
33
|
|
|
37
34
|
<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>
|
|
@@ -458,9 +458,9 @@ onMount(() => { void loadFiles() })
|
|
|
458
458
|
<div class="ml-3 min-w-0"><p class="font-semibold text-stone-900 truncate dark:text-white">{{ currentFolderLabel }}</p><p class="mt-0.5 text-stone-500 text-xs dark:text-neutral-400">{{ selectedDisk }} disk</p></div>
|
|
459
459
|
</div>
|
|
460
460
|
<div class="flex flex-wrap gap-2 items-center">
|
|
461
|
-
<
|
|
461
|
+
<SearchFilter v-model:searchValue="searchQuery" placeholder="Search this folder" ariaLabel="Search current folder" />
|
|
462
462
|
<div class="flex gap-0.5 p-0.5 bg-black/[0.05] dark:bg-white/[0.06] rounded-lg"><button type="button" aria-label="Grid view" :class="gridViewClass()" @click="viewMode.set('grid')"><span class="h-5 w-5 i-hugeicons-grid-view"></span></button><button type="button" aria-label="List view" :class="listViewClass()" @click="viewMode.set('list')"><span class="h-5 w-5 i-hugeicons-right-to-left-list-number"></span></button></div>
|
|
463
|
-
<
|
|
463
|
+
<Select v-model:value="sortBy" ariaLabel="Sort files" placeholder="" :options="[{ value: 'name', label: 'Name' }, { value: 'lastModified', label: 'Date' }, { value: 'size', label: 'Size' }]" />
|
|
464
464
|
<Button variant="ghost" iconOnly ariaLabel="Reverse sort order" @click="toggleSortOrder()"><span :class="sortOrderIconClass()"></span></Button>
|
|
465
465
|
<Button :loading="loading()" variant="secondary" @click="loadFiles()"><span :if="!loading()" aria-hidden="true" class="h-4 w-4 i-hugeicons-refresh"></span>Refresh</Button>
|
|
466
466
|
<Button @click="openCreateFolder()"><span aria-hidden="true" class="h-4 w-4 i-hugeicons-folder-add"></span>New folder</Button>
|
|
@@ -16,7 +16,9 @@ const open = useReactiveProp('open', false)
|
|
|
16
16
|
const page = useReactiveProp('page', null as PageRecord | null)
|
|
17
17
|
const busy = useReactiveProp('busy', false)
|
|
18
18
|
const error = useReactiveProp('error', '')
|
|
19
|
-
|
|
19
|
+
// Not `title`: a field bound inside the Modal is first read as the Modal's own
|
|
20
|
+
// `title` prop (stacksjs/stacks#3310).
|
|
21
|
+
const pageTitle = state('')
|
|
20
22
|
const template = state('default')
|
|
21
23
|
const published = state(false)
|
|
22
24
|
const emit = defineEmits(['close', 'submit'])
|
|
@@ -26,7 +28,7 @@ effect(() => {
|
|
|
26
28
|
const isOpen = open()
|
|
27
29
|
if (isOpen && !wasOpen) {
|
|
28
30
|
const record = page()
|
|
29
|
-
|
|
31
|
+
pageTitle.set(record?.title || '')
|
|
30
32
|
template.set(record?.template || 'default')
|
|
31
33
|
published.set(Boolean(record?.publishedAt))
|
|
32
34
|
}
|
|
@@ -40,7 +42,7 @@ function close(): void {
|
|
|
40
42
|
|
|
41
43
|
function submit(): void {
|
|
42
44
|
const draft: PageDraft = {
|
|
43
|
-
title:
|
|
45
|
+
title: pageTitle().trim(),
|
|
44
46
|
template: template(),
|
|
45
47
|
published: published(),
|
|
46
48
|
}
|
|
@@ -56,19 +58,8 @@ function submit(): void {
|
|
|
56
58
|
@close="close"
|
|
57
59
|
>
|
|
58
60
|
<form id="page-editor-form" class="grid gap-4" @submit.prevent="submit">
|
|
59
|
-
<label
|
|
60
|
-
|
|
61
|
-
<input x-model="title" name="title" required minlength="3" 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" />
|
|
62
|
-
</label>
|
|
63
|
-
<label>
|
|
64
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Template</span>
|
|
65
|
-
<select x-model="template" name="template" 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">
|
|
66
|
-
<option value="default">Default</option>
|
|
67
|
-
<option value="landing">Landing</option>
|
|
68
|
-
<option value="blog">Blog</option>
|
|
69
|
-
<option value="contact">Contact</option>
|
|
70
|
-
</select>
|
|
71
|
-
</label>
|
|
61
|
+
<Input v-model:value="pageTitle" name="title" label="Title" :required="true" :minLength="3" :maxLength="255" />
|
|
62
|
+
<Select v-model:value="template" name="template" label="Template" placeholder="" :options="[{ value: 'default', label: 'Default' }, { value: 'landing', label: 'Landing' }, { value: 'blog', label: 'Blog' }, { value: 'contact', label: 'Contact' }]" />
|
|
72
63
|
<div class="p-3 bg-gray-50 dark:bg-neutral-900/50 border border-gray-200 rounded-lg dark:border-neutral-700">
|
|
73
64
|
<Toggle v-model:checked="published" name="published" label="Published" description="Published pages receive a timestamp. Clearing this returns the page to draft." labelPosition="left" />
|
|
74
65
|
</div>
|
|
@@ -81,7 +72,7 @@ function submit(): void {
|
|
|
81
72
|
<template #footer>
|
|
82
73
|
<div class="flex gap-2 justify-end w-full">
|
|
83
74
|
<Button :disabled="busy()" variant="secondary" @click="close">Cancel</Button>
|
|
84
|
-
<Button type="submit" form="page-editor-form" :disabled="
|
|
75
|
+
<Button type="submit" form="page-editor-form" :disabled="pageTitle().trim().length < 3" :loading="busy()">
|
|
85
76
|
{{ page() ? 'Save changes' : 'Create page' }}
|
|
86
77
|
</Button>
|
|
87
78
|
</div>
|
|
@@ -43,7 +43,9 @@ const contentLoading = useReactiveProp('contentLoading', false)
|
|
|
43
43
|
const contentLoadFailed = useReactiveProp('contentLoadFailed', false)
|
|
44
44
|
const busy = useReactiveProp('busy', false)
|
|
45
45
|
const error = useReactiveProp('error', '')
|
|
46
|
-
|
|
46
|
+
// Not `title`: a field bound inside the Modal is first read as the Modal's own
|
|
47
|
+
// `title` prop (stacksjs/stacks#3310).
|
|
48
|
+
const postTitle = state('')
|
|
47
49
|
const excerpt = state('')
|
|
48
50
|
const content = state('')
|
|
49
51
|
const poster = state('')
|
|
@@ -61,7 +63,7 @@ effect(() => {
|
|
|
61
63
|
if (isOpen && !wasOpen) {
|
|
62
64
|
const record = editing()
|
|
63
65
|
activeId = record?.id || ''
|
|
64
|
-
|
|
66
|
+
postTitle.set(record?.title || '')
|
|
65
67
|
excerpt.set(record?.excerpt || '')
|
|
66
68
|
content.set('')
|
|
67
69
|
poster.set(record?.poster || '')
|
|
@@ -82,11 +84,22 @@ effect(() => {
|
|
|
82
84
|
function valid(): boolean {
|
|
83
85
|
const excerptLength = excerpt().trim().length
|
|
84
86
|
return !contentLoading() && !contentLoadFailed()
|
|
85
|
-
&&
|
|
87
|
+
&& postTitle().trim().length >= 3 && postTitle().trim().length <= 255
|
|
86
88
|
&& content().trim().length >= 10 && content().length <= 100000
|
|
87
89
|
&& (excerptLength === 0 || excerptLength >= 10) && excerpt().length <= 500
|
|
88
90
|
}
|
|
89
91
|
|
|
92
|
+
/** Tick or untick one category or tag, as its box reports. */
|
|
93
|
+
function chooseCategory(id: string, chosen: boolean): void {
|
|
94
|
+
const current = categoryIds()
|
|
95
|
+
categoryIds.set(chosen ? (current.includes(id) ? current : [...current, id]) : current.filter(entry => entry !== id))
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function chooseTag(id: string, chosen: boolean): void {
|
|
99
|
+
const current = tagIds()
|
|
100
|
+
tagIds.set(chosen ? (current.includes(id) ? current : [...current, id]) : current.filter(entry => entry !== id))
|
|
101
|
+
}
|
|
102
|
+
|
|
90
103
|
function close(): void {
|
|
91
104
|
if (!busy())
|
|
92
105
|
emit('close')
|
|
@@ -94,7 +107,7 @@ function close(): void {
|
|
|
94
107
|
|
|
95
108
|
function submit(): void {
|
|
96
109
|
const draft: PostDraft = {
|
|
97
|
-
title:
|
|
110
|
+
title: postTitle().trim(),
|
|
98
111
|
excerpt: excerpt().trim(),
|
|
99
112
|
content: content().trim(),
|
|
100
113
|
poster: poster().trim(),
|
|
@@ -117,63 +130,40 @@ function submit(): void {
|
|
|
117
130
|
@close="close"
|
|
118
131
|
>
|
|
119
132
|
<form id="post-editor-form" class="grid gap-5" @submit.prevent="submit">
|
|
120
|
-
<label
|
|
121
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Title</span>
|
|
122
|
-
<input x-model.trim="title" name="title" required minlength="3" 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" />
|
|
123
|
-
</label>
|
|
133
|
+
<Input v-model:value="postTitle" name="title" label="Title" :required="true" :minLength="3" :maxLength="255" />
|
|
124
134
|
<div class="grid gap-4 sm:grid-cols-3">
|
|
125
|
-
<label
|
|
126
|
-
|
|
127
|
-
<select x-model="status" name="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">
|
|
128
|
-
<option value="draft">Draft</option>
|
|
129
|
-
<option value="published">Published</option>
|
|
130
|
-
<option value="archived">Archived</option>
|
|
131
|
-
</select>
|
|
132
|
-
</label>
|
|
133
|
-
<label>
|
|
134
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Author</span>
|
|
135
|
-
<select x-model="authorId" name="author_id" 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">
|
|
136
|
-
<option value="">No author</option>
|
|
137
|
-
<option :for="author in authors()" :value="author.id">{{ author.name }} ({{ author.email }})</option>
|
|
138
|
-
</select>
|
|
139
|
-
</label>
|
|
135
|
+
<Select v-model:value="status" name="status" label="Status" placeholder="" :options="[{ value: 'draft', label: 'Draft' }, { value: 'published', label: 'Published' }, { value: 'archived', label: 'Archived' }]" />
|
|
136
|
+
<Select v-model:value="authorId" name="author_id" label="Author" placeholder="" :options="[{ value: '', label: 'No author' }, ...authors().map(author => ({ value: author.id, label: author.name + ' (' + author.email + ')' }))]" />
|
|
140
137
|
<div class="self-end px-3 py-2 min-h-10 bg-gray-50 dark:bg-neutral-900/60 border border-gray-200 rounded-md dark:border-neutral-700">
|
|
141
138
|
<Toggle v-model:checked="featured" name="featured" label="Featured post" labelPosition="left" />
|
|
142
139
|
</div>
|
|
143
140
|
</div>
|
|
144
|
-
<label
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
</
|
|
153
|
-
<label>
|
|
154
|
-
<span class="flex gap-3 items-center justify-between">
|
|
155
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Content</span>
|
|
156
|
-
<span :if="contentLoading()" role="status" class="inline-flex gap-1.5 items-center text-gray-500 text-xs dark:text-neutral-400">
|
|
157
|
-
<span aria-hidden="true" class="h-3.5 w-3.5 animate-spin i-hugeicons-loading-03"></span>
|
|
158
|
-
Loading content
|
|
159
|
-
</span>
|
|
160
|
-
</span>
|
|
161
|
-
<textarea x-model="content" name="content" required minlength="10" maxlength="100000" rows="10" :disabled="contentLoading() || contentLoadFailed()" 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 disabled:opacity-60"></textarea>
|
|
162
|
-
<span class="block mt-1 text-gray-500 text-xs dark:text-gray-400">{{ content().length }}/100000</span>
|
|
163
|
-
</label>
|
|
141
|
+
<Input v-model:value="poster" name="poster" label="Poster URL" type="url" inputmode="url" :maxLength="255" placeholder="https://example.com/poster.jpg" />
|
|
142
|
+
<Textarea v-model:value="excerpt" name="excerpt" label="Excerpt" :rows="3" :maxLength="500" :showCount="true" placeholder="Optional, at least 10 characters when provided" />
|
|
143
|
+
<div>
|
|
144
|
+
<Textarea v-model:value="content" name="content" label="Content" :required="true" :minLength="10" :maxLength="100000" :showCount="true" :rows="10" :monospace="true" :disabled="contentLoading() || contentLoadFailed()" />
|
|
145
|
+
<p :if="contentLoading()" role="status" class="inline-flex gap-1.5 items-center mt-1.5 text-gray-500 text-xs dark:text-neutral-400">
|
|
146
|
+
<span aria-hidden="true" class="h-3.5 w-3.5 animate-spin i-hugeicons-loading-03"></span>
|
|
147
|
+
Loading content
|
|
148
|
+
</p>
|
|
149
|
+
</div>
|
|
164
150
|
<div class="grid gap-4 lg:grid-cols-2">
|
|
165
151
|
<fieldset class="p-4 border border-gray-200 rounded-lg dark:border-neutral-700">
|
|
166
152
|
<legend class="px-1 font-semibold text-gray-700 text-sm dark:text-neutral-200">Categories, {{ categoryIds().length }} selected</legend>
|
|
167
153
|
<div :if="categories().length === 0" class="text-gray-500 text-sm dark:text-neutral-400">No categories available.</div>
|
|
168
154
|
<div :else class="grid gap-2">
|
|
169
|
-
<
|
|
155
|
+
<span :for="categoryOption in categories()" class="contents">
|
|
156
|
+
<Checkbox size="sm" :label="categoryOption.name" :checked="categoryIds().includes(categoryOption.id)" @update:checked="chooseCategory(categoryOption.id, $event)" />
|
|
157
|
+
</span>
|
|
170
158
|
</div>
|
|
171
159
|
</fieldset>
|
|
172
160
|
<fieldset class="p-4 border border-gray-200 rounded-lg dark:border-neutral-700">
|
|
173
161
|
<legend class="px-1 font-semibold text-gray-700 text-sm dark:text-neutral-200">Tags, {{ tagIds().length }} selected</legend>
|
|
174
162
|
<div :if="tags().length === 0" class="text-gray-500 text-sm dark:text-neutral-400">No tags available.</div>
|
|
175
163
|
<div :else class="grid gap-2 sm:grid-cols-2">
|
|
176
|
-
<
|
|
164
|
+
<span :for="tagOption in tags()" class="contents">
|
|
165
|
+
<Checkbox size="sm" :label="tagOption.name" :checked="tagIds().includes(tagOption.id)" @update:checked="chooseTag(tagOption.id, $event)" />
|
|
166
|
+
</span>
|
|
177
167
|
</div>
|
|
178
168
|
</fieldset>
|
|
179
169
|
</div>
|
|
@@ -238,10 +238,6 @@ function changeSearch(term: string): void {
|
|
|
238
238
|
search.set(String(term || ''))
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
function changeStatus(event: Event): void {
|
|
242
|
-
statusFilter.set((event.target as HTMLSelectElement).value)
|
|
243
|
-
}
|
|
244
|
-
|
|
245
241
|
async function loadEditorContent(post: PostRecord): Promise<void> {
|
|
246
242
|
const requestId = ++contentRequestId
|
|
247
243
|
contentLoading.set(true)
|
|
@@ -388,15 +384,7 @@ onMount(() => { void loadPosts() })
|
|
|
388
384
|
@sort="changeSort"
|
|
389
385
|
>
|
|
390
386
|
<template #toolbar>
|
|
391
|
-
<label
|
|
392
|
-
<span class="sr-only">Filter by status</span>
|
|
393
|
-
<select :value="statusFilter()" @change="changeStatus($event)" class="px-2.5 py-1.5 text-sm bg-white dark:bg-neutral-800 border border-stone-300 rounded-lg dark:border-neutral-600">
|
|
394
|
-
<option value="all">All statuses</option>
|
|
395
|
-
<option value="published">Published</option>
|
|
396
|
-
<option value="draft">Draft</option>
|
|
397
|
-
<option value="archived">Archived</option>
|
|
398
|
-
</select>
|
|
399
|
-
</label>
|
|
387
|
+
<Select v-model:value="statusFilter" ariaLabel="Filter by status" size="sm" placeholder="" :options="[{ value: 'all', label: 'All statuses' }, { value: 'published', label: 'Published' }, { value: 'draft', label: 'Draft' }, { value: 'archived', label: 'Archived' }]" />
|
|
400
388
|
</template>
|
|
401
389
|
|
|
402
390
|
<template #cell="{ row, column }">
|