@develemit/commerce-admin 0.7.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 +69 -0
- package/README.md +8 -4
- package/dist/client/admin-client.d.ts +1 -0
- package/dist/client/errors.d.ts +4 -0
- package/dist/client/index.js +1 -1
- package/dist/{client-DCL5DSHP.js → client-ClTCzt-p.js} +34 -28
- package/dist/client-ClTCzt-p.js.map +1 -0
- package/dist/components/admin-layout/admin-layout.d.ts +2 -1
- package/dist/components/admin-layout/current-item.d.ts +1 -0
- package/dist/components/admin-layout/nav-items.d.ts +3 -0
- package/dist/components/admin-layout/use-current-href.d.ts +1 -0
- package/dist/components/empty-state/empty-state.d.ts +1 -1
- package/dist/index.js +1428 -1057
- package/dist/index.js.map +1 -1
- package/dist/lib/admin-labels.d.ts +3 -0
- package/dist/lib/currency-symbol.d.ts +1 -0
- package/dist/lib/fill-alts.d.ts +1 -1
- package/dist/lib/order-action-labels.d.ts +2 -0
- package/dist/lib/order-labels.d.ts +2 -1
- package/dist/lib/product-draft.d.ts +3 -0
- package/dist/lib/product-flow-labels.d.ts +11 -0
- package/dist/lib/product-form.d.ts +2 -1
- package/dist/lib/product-labels.d.ts +8 -0
- package/dist/lib/provider.d.ts +2 -0
- package/dist/lib/stock-labels.d.ts +2 -0
- package/dist/lib/use-batch-upload.d.ts +7 -1
- package/dist/lib/use-order-pages.d.ts +1 -0
- package/dist/lib/use-product-autosave.d.ts +8 -0
- package/dist/lib/use-product-pages.d.ts +2 -0
- package/dist/styles.css +470 -29
- package/dist/views/orders/admin-order-detail.d.ts +2 -1
- package/dist/views/orders/order-actions.d.ts +2 -1
- package/dist/views/orders/resolve-button.d.ts +3 -1
- package/dist/views/orders/ship-form.d.ts +4 -1
- package/dist/views/products/add-several/photo-picker.d.ts +3 -1
- package/dist/views/products/admin-product-images.d.ts +2 -0
- package/dist/views/products/finish-drafts/piece-summary.d.ts +2 -1
- package/dist/views/products/finish-drafts/use-publish-pieces.d.ts +4 -0
- package/dist/views/products/product-flow/admin-product-flow.d.ts +4 -0
- package/dist/views/products/product-flow/basics-section.d.ts +5 -1
- package/dist/views/products/product-flow/flow-actions.d.ts +3 -0
- package/dist/views/products/product-flow/flow-frame.d.ts +4 -2
- package/dist/views/products/product-flow/materials-field.d.ts +6 -0
- package/dist/views/products/product-flow/use-product-flow.d.ts +10 -0
- package/dist/views/products/product-sheet/delete-draft-button.d.ts +9 -0
- package/dist/views/shipping/shipping-rate-row.d.ts +2 -1
- package/package.json +2 -2
- package/dist/client-DCL5DSHP.js.map +0 -1
|
@@ -17,6 +17,9 @@ export interface AdminLabels {
|
|
|
17
17
|
shippingRates: string;
|
|
18
18
|
more: string;
|
|
19
19
|
closeMore: string;
|
|
20
|
+
viewShop: string;
|
|
21
|
+
badge: (count: number | string) => string;
|
|
22
|
+
productsBadge: (count: number | string) => string;
|
|
20
23
|
};
|
|
21
24
|
statuses: Record<string, string>;
|
|
22
25
|
errors: Record<AdminErrorKey, string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function currencySymbol(currency: string, locale: string): string;
|
package/dist/lib/fill-alts.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AdminProduct } from '@develemit/commerce-contracts';
|
|
2
2
|
import { AdminClient } from '../client';
|
|
3
|
-
export declare function fillBlankAlts(client: AdminClient, product: AdminProduct, template: string): Promise<AdminProduct>;
|
|
3
|
+
export declare function fillBlankAlts(client: AdminClient, product: AdminProduct, template: string, displayName?: string): Promise<AdminProduct>;
|
|
@@ -6,8 +6,8 @@ export interface OrderLabels {
|
|
|
6
6
|
searchPlaceholder: string;
|
|
7
7
|
tabs: Record<OrderTab, string>;
|
|
8
8
|
empty: Record<OrderTab, string>;
|
|
9
|
-
noMatches: string;
|
|
10
9
|
emptyHint: string;
|
|
10
|
+
noMatches: string;
|
|
11
11
|
loadMore: string;
|
|
12
12
|
columns: {
|
|
13
13
|
order: string;
|
|
@@ -31,6 +31,7 @@ export interface OrderLabels {
|
|
|
31
31
|
};
|
|
32
32
|
subtotal: string;
|
|
33
33
|
shipping: string;
|
|
34
|
+
tax: string;
|
|
34
35
|
total: string;
|
|
35
36
|
shippingAddress: string;
|
|
36
37
|
noAddress: string;
|
|
@@ -4,8 +4,11 @@ export declare function hasDraftContent(form: ProductForm): boolean;
|
|
|
4
4
|
export declare function draftInput(form: ProductForm, currency?: string): AdminProductInput;
|
|
5
5
|
export declare function draftPatch(base: AdminProduct, form: ProductForm): AdminProductPatch;
|
|
6
6
|
export declare function basicsReady(form: ProductForm): boolean;
|
|
7
|
+
export declare function basicsMissing(form: ProductForm): Array<'name' | 'price' | 'category'>;
|
|
8
|
+
export declare function titleCase(value: string): string;
|
|
7
9
|
export declare function splitMaterials(value: string): string[];
|
|
8
10
|
export declare function toggleMaterial(value: string, material: string): string;
|
|
11
|
+
export declare function mergeMaterials(picked: string[], custom: string): string;
|
|
9
12
|
export declare function appendPrompt(description: string, prompt: string): string;
|
|
10
13
|
export declare function currencySymbol(locale: string, currency: string): string;
|
|
11
14
|
export declare function fillText(template: string, values: Record<string, string>): string;
|
|
@@ -24,8 +24,19 @@ export interface ProductFlowLabels {
|
|
|
24
24
|
oneOfAKind: string;
|
|
25
25
|
howMany: string;
|
|
26
26
|
descriptionPrompts: string[];
|
|
27
|
+
descriptionPlaceholder: string;
|
|
28
|
+
sizePlaceholder: string;
|
|
29
|
+
altPlaceholder: string;
|
|
30
|
+
previewHeadingLive: string;
|
|
31
|
+
saveChanges: string;
|
|
32
|
+
seeInShop: string;
|
|
33
|
+
continueNeeds: string;
|
|
34
|
+
addPhotoTile: string;
|
|
35
|
+
stepCount: string;
|
|
27
36
|
materialsOther: string;
|
|
28
37
|
size: string;
|
|
38
|
+
taxCode: string;
|
|
39
|
+
taxCodeDefault: string;
|
|
29
40
|
altTitle: string;
|
|
30
41
|
altHelp: string;
|
|
31
42
|
altFallback: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AdminProduct, AdminProductInput, AdminProductPatch, ProductStatus } from '@develemit/commerce-contracts';
|
|
2
2
|
import { ProductLabels } from './product-labels';
|
|
3
|
-
export declare const FIELD_ORDER: readonly ["name", "category", "description", "materials", "dimensions", "price", "quantity", "status", "featured"];
|
|
3
|
+
export declare const FIELD_ORDER: readonly ["name", "category", "description", "materials", "dimensions", "price", "quantity", "status", "featured", "taxCode"];
|
|
4
4
|
export type FieldName = (typeof FIELD_ORDER)[number];
|
|
5
5
|
export type FieldErrors = Partial<Record<FieldName, string>>;
|
|
6
6
|
export interface ProductForm {
|
|
@@ -13,6 +13,7 @@ export interface ProductForm {
|
|
|
13
13
|
quantity: string;
|
|
14
14
|
status: ProductStatus;
|
|
15
15
|
featured: boolean;
|
|
16
|
+
taxCode: string;
|
|
16
17
|
}
|
|
17
18
|
export declare const emptyForm: ProductForm;
|
|
18
19
|
export declare function formFromProduct(product: AdminProduct): ProductForm;
|
|
@@ -10,6 +10,10 @@ export interface ProductLabels {
|
|
|
10
10
|
filters: Record<ProductFilter, string>;
|
|
11
11
|
empty: Record<ProductFilter, string>;
|
|
12
12
|
noMatches: string;
|
|
13
|
+
emptyActions: {
|
|
14
|
+
start: string;
|
|
15
|
+
clearSearch: string;
|
|
16
|
+
};
|
|
13
17
|
loadMore: string;
|
|
14
18
|
welcome: {
|
|
15
19
|
title: string;
|
|
@@ -46,6 +50,10 @@ export interface ProductLabels {
|
|
|
46
50
|
copyLink: string;
|
|
47
51
|
linkCopied: string;
|
|
48
52
|
archive: string;
|
|
53
|
+
deleteDraft: string;
|
|
54
|
+
deleteTitle: string;
|
|
55
|
+
deleteBody: string;
|
|
56
|
+
deleteConfirm: string;
|
|
49
57
|
undo: string;
|
|
50
58
|
missingTitle: string;
|
|
51
59
|
missing: Record<string, string>;
|
package/dist/lib/provider.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface LinkProps {
|
|
|
7
7
|
href: string;
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
className?: string;
|
|
10
|
+
'aria-current'?: 'page';
|
|
10
11
|
}
|
|
11
12
|
export interface AdminImageProps {
|
|
12
13
|
src: string;
|
|
@@ -31,6 +32,7 @@ export interface AdminConfig {
|
|
|
31
32
|
discount: (id: string) => string;
|
|
32
33
|
newDiscount: string;
|
|
33
34
|
storefrontProduct?: (slug: string) => string;
|
|
35
|
+
storefront?: string;
|
|
34
36
|
};
|
|
35
37
|
client: AdminClient | null;
|
|
36
38
|
labels: AdminLabels;
|
|
@@ -4,6 +4,7 @@ export interface StockLabels {
|
|
|
4
4
|
introTitle: string;
|
|
5
5
|
introBody: string;
|
|
6
6
|
choose: string;
|
|
7
|
+
dropHint: string;
|
|
7
8
|
progress: string;
|
|
8
9
|
failedTitle: string;
|
|
9
10
|
retry: string;
|
|
@@ -29,6 +30,7 @@ export interface StockLabels {
|
|
|
29
30
|
title: string;
|
|
30
31
|
lede: string;
|
|
31
32
|
needsDetails: string;
|
|
33
|
+
openPiece: string;
|
|
32
34
|
untitled: string;
|
|
33
35
|
publish: string;
|
|
34
36
|
keepDrafts: string;
|
|
@@ -8,7 +8,11 @@ export interface BatchItem {
|
|
|
8
8
|
reason?: string;
|
|
9
9
|
error?: unknown;
|
|
10
10
|
}
|
|
11
|
-
export declare
|
|
11
|
+
export declare const DEFAULT_BATCH_CONCURRENCY = 3;
|
|
12
|
+
export interface BatchUploadOptions {
|
|
13
|
+
concurrency?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function useBatchUpload({ concurrency, }?: BatchUploadOptions): {
|
|
12
16
|
items: BatchItem[];
|
|
13
17
|
add: (files: File[]) => void;
|
|
14
18
|
retry: () => void;
|
|
@@ -28,6 +32,8 @@ export declare function useBatchUpload(): {
|
|
|
28
32
|
quantity: number;
|
|
29
33
|
status: "draft" | "active" | "archived";
|
|
30
34
|
featured: boolean;
|
|
35
|
+
everPublished: boolean;
|
|
36
|
+
taxCode: string | null;
|
|
31
37
|
images: {
|
|
32
38
|
id: string;
|
|
33
39
|
url: string;
|
|
@@ -4,6 +4,7 @@ export declare function useOrderPages(query: Omit<AdminOrderQuery, 'cursor'>): {
|
|
|
4
4
|
id: string;
|
|
5
5
|
status: "pending" | "paid" | "shipped" | "cancelled" | "expired" | "needs_attention" | "refunded";
|
|
6
6
|
email: string | null;
|
|
7
|
+
taxCents: number;
|
|
7
8
|
totalCents: number;
|
|
8
9
|
currency: string;
|
|
9
10
|
itemCount: number;
|
|
@@ -21,6 +21,8 @@ export declare function useProductAutosave({ initial, form, currency, delayMs, }
|
|
|
21
21
|
quantity: number;
|
|
22
22
|
status: "draft" | "active" | "archived";
|
|
23
23
|
featured: boolean;
|
|
24
|
+
everPublished: boolean;
|
|
25
|
+
taxCode: string | null;
|
|
24
26
|
images: {
|
|
25
27
|
id: string;
|
|
26
28
|
url: string;
|
|
@@ -44,6 +46,8 @@ export declare function useProductAutosave({ initial, form, currency, delayMs, }
|
|
|
44
46
|
quantity: number;
|
|
45
47
|
status: "draft" | "active" | "archived";
|
|
46
48
|
featured: boolean;
|
|
49
|
+
everPublished: boolean;
|
|
50
|
+
taxCode: string | null;
|
|
47
51
|
images: {
|
|
48
52
|
id: string;
|
|
49
53
|
url: string;
|
|
@@ -64,6 +68,8 @@ export declare function useProductAutosave({ initial, form, currency, delayMs, }
|
|
|
64
68
|
quantity: number;
|
|
65
69
|
status: "draft" | "active" | "archived";
|
|
66
70
|
featured: boolean;
|
|
71
|
+
everPublished: boolean;
|
|
72
|
+
taxCode: string | null;
|
|
67
73
|
images: {
|
|
68
74
|
id: string;
|
|
69
75
|
url: string;
|
|
@@ -84,6 +90,8 @@ export declare function useProductAutosave({ initial, form, currency, delayMs, }
|
|
|
84
90
|
quantity: number;
|
|
85
91
|
status: "draft" | "active" | "archived";
|
|
86
92
|
featured: boolean;
|
|
93
|
+
everPublished: boolean;
|
|
94
|
+
taxCode: string | null;
|
|
87
95
|
images: {
|
|
88
96
|
id: string;
|
|
89
97
|
url: string;
|
|
@@ -13,6 +13,8 @@ export declare function useProductPages(query: Omit<AdminProductQuery, 'cursor'>
|
|
|
13
13
|
quantity: number;
|
|
14
14
|
status: "draft" | "active" | "archived";
|
|
15
15
|
featured: boolean;
|
|
16
|
+
everPublished: boolean;
|
|
17
|
+
taxCode: string | null;
|
|
16
18
|
images: {
|
|
17
19
|
id: string;
|
|
18
20
|
url: string;
|