@develemit/commerce-admin 0.8.0 → 0.9.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.9.0 (2026-11-14)
2
+
3
+ ### Features
4
+
5
+ - Add several uploads up to 3 photos at once (was one at a time); the draft order still follows the picked order and retry only re-sends the failed ones.
6
+ - `AdminProductFlow` takes `taxCodes?: { code, label }[]`. When set, the Basics step shows a "Tax category" select (`labels.products.flow.taxCode`, `taxCodeDefault`) whose empty "Default" option clears the code. Hidden otherwise.
7
+ - The order detail totals show a Tax row (`labels.orders.tax`, default "Tax") between shipping and total when the order has tax. Untaxed orders are unchanged. The refund dialog's default amount already includes tax.
8
+
1
9
  ## 0.8.0 (2026-11-12)
2
10
 
3
11
  ### Deprecated
package/README.md CHANGED
@@ -121,6 +121,7 @@ Override any copy through `AdminProvider`'s `labels` (`nav`, `statuses` and `err
121
121
  initialStep="basics" // optional: photos | basics | story | preview
122
122
  categories={['Necklaces', 'Rings']} // category chips; "Other…" allows any
123
123
  materialSuggestions={['Silver', 'Gold']} // optional chips
124
+ taxCodes={[{ code: 'txcd_20010000', label: 'Clothing' }]} // optional; shows a Tax category select
124
125
  onDone={() => router.push('/admin/products')}
125
126
  onClose={() => router.push('/admin/products')}
126
127
  />
@@ -129,7 +130,7 @@ Override any copy through `AdminProvider`'s `labels` (`nav`, `statuses` and `err
129
130
  - `AdminProductList` — a photo grid of product cards (status pill, featured star, price or what a draft still needs), filter chips with counts from `getProductCounts` (All excludes archived; "Sold" is active with zero stock), name search (behind a header button on phones, inline from 900px), a "N drafts need a few details" banner, paging and a quick-action sheet when a card is tapped. An empty shop shows a welcome state with no filters. Props, all optional: `welcome` (brand art for the welcome state; a neutral illustration by default), `setup` (`SetupStep[]` for the checklist), `onAddMany` (shows the "Add several at once" button) and `onFinishDrafts` (shows the banner's Finish button), `onOpenProduct(product)` (replaces the sheet) and `onEditProduct(product)` (the sheet's Edit button; defaults to a link to `hrefs.product`).
130
131
  - `AdminProductSheet({ productId, onClose, onEdit?, onChanged? })` — quick actions for one product: a bottom sheet below 900px, a 420px side panel from 900px, focus-trapped. One primary action by state (finish, put in the shop, mark sold, back in stock, restore), plus Edit, Photos, Feature on home, Hide from shop, Copy shop link (needs `hrefs.storefrontProduct`) and Archive (a draft that was never live offers Delete draft instead, with a confirm; `client.deleteProduct(id)`). Changes show a toast with Undo. Publishing an incomplete draft lists what is missing. Copy: `labels.products.sheet.*`.
131
132
  - `AdminSetupChecklist({ steps })` — a generic setup card with a progress bar. Each `SetupStep` is `{ id, title, detail?, done, href?, onSelect?, locked?, lockedDetail? }`; the host decides the steps. `AdminProductList` shows it in full while the shop is empty and as a compact pill once it has products; it renders nothing when every step is done. Pass `compact` to force the pill.
132
- - `AdminProductFlow({ productId?, initialStep?, onDone?, onClose?, categories?, materialSuggestions?, isFirstProduct?, imagesSlot? })` — photo-first add and edit. Below 900px it is a full-screen flow of four steps (Photos, Basics, Story, Preview) with a step bar (`aria-current="step"`) and a sticky footer action; from 900px it is one page with a sticky "In the shop" preview and the publish buttons on the right, and `initialStep` scrolls to that section. The first photo or name creates a draft (`createProduct`), later photos upload to it, and edits autosave by PATCH about 600ms after typing stops, with a "Saving…/Saved" note and an inline retry on failure. Tapping a thumbnail makes it the cover (`reorderProductImages`); ✕ removes it. Blank photo descriptions become "name, photo N" when the product is saved. "Put it in the shop" PATCHes `status: 'active'`; a 422 lists what is missing. Publishing a draft shows a success screen ("Add another", "Back to products"); it says "first product" when `isFirstProduct` is true, or, when that prop is omitted, when `getProductCounts().live` is 1. `onDone(product)` runs on Save as draft, Done and Back to products; `onClose(product | null)` runs from ✕, after a "Saved as a draft" toast when a new draft was kept. Without `onClose`, ✕ is a link to `hrefs.products`. Copy: `labels.products.flow.*`, including `photoTip` and `descriptionPrompts` (chips that append text to the description; none by default). The success screen shows "See it in the shop" when `hrefs.storefrontProduct` is set. Placeholders: `descriptionPlaceholder`, `sizePlaceholder`, `altPlaceholder` (empty by default). Editing a live product uses `previewHeadingLive` and `saveChanges`; a disabled Continue explains itself via `continueNeeds`.
133
+ - `AdminProductFlow({ productId?, initialStep?, onDone?, onClose?, categories?, materialSuggestions?, taxCodes?, isFirstProduct?, imagesSlot? })` — photo-first add and edit. Below 900px it is a full-screen flow of four steps (Photos, Basics, Story, Preview) with a step bar (`aria-current="step"`) and a sticky footer action; from 900px it is one page with a sticky "In the shop" preview and the publish buttons on the right, and `initialStep` scrolls to that section. The first photo or name creates a draft (`createProduct`), later photos upload to it, and edits autosave by PATCH about 600ms after typing stops, with a "Saving…/Saved" note and an inline retry on failure. Tapping a thumbnail makes it the cover (`reorderProductImages`); ✕ removes it. Blank photo descriptions become "name, photo N" when the product is saved. "Put it in the shop" PATCHes `status: 'active'`; a 422 lists what is missing. Publishing a draft shows a success screen ("Add another", "Back to products"); it says "first product" when `isFirstProduct` is true, or, when that prop is omitted, when `getProductCounts().live` is 1. `onDone(product)` runs on Save as draft, Done and Back to products; `onClose(product | null)` runs from ✕, after a "Saved as a draft" toast when a new draft was kept. Without `onClose`, ✕ is a link to `hrefs.products`. Copy: `labels.products.flow.*`, including `photoTip` and `descriptionPrompts` (chips that append text to the description; none by default). The success screen shows "See it in the shop" when `hrefs.storefrontProduct` is set. `taxCodes` (`{ code, label }[]`, none by default) adds a "Tax category" select to the Basics step (`labels.products.flow.taxCode`, `taxCodeDefault`); the empty "Default" option clears the code so Stripe uses the account default. The kit ships no list; pick codes from [Stripe's tax code list](https://docs.stripe.com/tax/tax-categories). Placeholders: `descriptionPlaceholder`, `sizePlaceholder`, `altPlaceholder` (empty by default). Editing a live product uses `previewHeadingLive` and `saveChanges`; a disabled Continue explains itself via `continueNeeds`.
133
134
  - `AdminProductImages({ productId, images })` — **deprecated**; the flow's Photos step replaces it, and it is removed in the next major.
134
135
  - `AdminProductEditor({ productId?, onSaved?, imagesSlot?, categories?, initialStep? })` — the previous editor's props, now a thin wrapper around `AdminProductFlow` (`onSaved` is `onDone`). `imagesSlot` replaces the built-in Photos section. Without `initialStep` it reads `?step=` from the URL, which is how the sheet's Edit, Photos and "Add the missing details" links open the right step. `onEditProduct`/`onEdit` receive the step as a second argument.
135
136
  - `Switch({ id, label, checked, onChange })` — a native checkbox with `role="switch"`, styled by `.sfa-switch`.