@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 +8 -0
- package/README.md +2 -1
- package/dist/index.js +524 -496
- package/dist/index.js.map +1 -1
- package/dist/lib/fill-alts.d.ts +1 -1
- package/dist/lib/order-labels.d.ts +1 -0
- package/dist/lib/product-flow-labels.d.ts +2 -0
- package/dist/lib/product-form.d.ts +2 -1
- package/dist/lib/use-batch-upload.d.ts +6 -1
- package/dist/lib/use-order-pages.d.ts +1 -0
- package/dist/lib/use-product-autosave.d.ts +4 -0
- package/dist/lib/use-product-pages.d.ts +1 -0
- package/dist/views/products/finish-drafts/use-publish-pieces.d.ts +2 -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/use-product-flow.d.ts +5 -0
- package/package.json +2 -2
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>;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -29,6 +33,7 @@ export declare function useBatchUpload(): {
|
|
|
29
33
|
status: "draft" | "active" | "archived";
|
|
30
34
|
featured: boolean;
|
|
31
35
|
everPublished: boolean;
|
|
36
|
+
taxCode: string | null;
|
|
32
37
|
images: {
|
|
33
38
|
id: string;
|
|
34
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;
|
|
@@ -22,6 +22,7 @@ export declare function useProductAutosave({ initial, form, currency, delayMs, }
|
|
|
22
22
|
status: "draft" | "active" | "archived";
|
|
23
23
|
featured: boolean;
|
|
24
24
|
everPublished: boolean;
|
|
25
|
+
taxCode: string | null;
|
|
25
26
|
images: {
|
|
26
27
|
id: string;
|
|
27
28
|
url: string;
|
|
@@ -46,6 +47,7 @@ export declare function useProductAutosave({ initial, form, currency, delayMs, }
|
|
|
46
47
|
status: "draft" | "active" | "archived";
|
|
47
48
|
featured: boolean;
|
|
48
49
|
everPublished: boolean;
|
|
50
|
+
taxCode: string | null;
|
|
49
51
|
images: {
|
|
50
52
|
id: string;
|
|
51
53
|
url: string;
|
|
@@ -67,6 +69,7 @@ export declare function useProductAutosave({ initial, form, currency, delayMs, }
|
|
|
67
69
|
status: "draft" | "active" | "archived";
|
|
68
70
|
featured: boolean;
|
|
69
71
|
everPublished: boolean;
|
|
72
|
+
taxCode: string | null;
|
|
70
73
|
images: {
|
|
71
74
|
id: string;
|
|
72
75
|
url: string;
|
|
@@ -88,6 +91,7 @@ export declare function useProductAutosave({ initial, form, currency, delayMs, }
|
|
|
88
91
|
status: "draft" | "active" | "archived";
|
|
89
92
|
featured: boolean;
|
|
90
93
|
everPublished: boolean;
|
|
94
|
+
taxCode: string | null;
|
|
91
95
|
images: {
|
|
92
96
|
id: string;
|
|
93
97
|
url: string;
|
|
@@ -19,6 +19,7 @@ export declare function usePublishPieces(): {
|
|
|
19
19
|
status: "draft" | "active" | "archived";
|
|
20
20
|
featured: boolean;
|
|
21
21
|
everPublished: boolean;
|
|
22
|
+
taxCode: string | null;
|
|
22
23
|
images: {
|
|
23
24
|
id: string;
|
|
24
25
|
url: string;
|
|
@@ -40,6 +41,7 @@ export declare function usePublishPieces(): {
|
|
|
40
41
|
status: "draft" | "active" | "archived";
|
|
41
42
|
featured: boolean;
|
|
42
43
|
everPublished: boolean;
|
|
44
|
+
taxCode: string | null;
|
|
43
45
|
images: {
|
|
44
46
|
id: string;
|
|
45
47
|
url: string;
|
|
@@ -9,6 +9,10 @@ export interface AdminProductFlowProps {
|
|
|
9
9
|
onClose?: (product: AdminProduct | null) => void;
|
|
10
10
|
categories?: string[];
|
|
11
11
|
materialSuggestions?: string[];
|
|
12
|
+
taxCodes?: {
|
|
13
|
+
code: string;
|
|
14
|
+
label: string;
|
|
15
|
+
}[];
|
|
12
16
|
isFirstProduct?: boolean;
|
|
13
17
|
imagesSlot?: ReactNode;
|
|
14
18
|
}
|
|
@@ -2,5 +2,9 @@ import { FlowSectionProps } from './flow-section-props';
|
|
|
2
2
|
export interface BasicsSectionProps extends FlowSectionProps {
|
|
3
3
|
categories?: string[];
|
|
4
4
|
currency: string;
|
|
5
|
+
taxCodes?: {
|
|
6
|
+
code: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}[];
|
|
5
9
|
}
|
|
6
|
-
export declare function BasicsSection({ form, update, categories, currency, }: BasicsSectionProps): import('react').JSX.Element;
|
|
10
|
+
export declare function BasicsSection({ form, update, categories, currency, taxCodes, }: BasicsSectionProps): import('react').JSX.Element;
|
|
@@ -31,6 +31,7 @@ export declare function useProductFlow({ initial, initialStep, isFirstProduct, o
|
|
|
31
31
|
status: "draft" | "active" | "archived";
|
|
32
32
|
featured: boolean;
|
|
33
33
|
everPublished: boolean;
|
|
34
|
+
taxCode: string | null;
|
|
34
35
|
images: {
|
|
35
36
|
id: string;
|
|
36
37
|
url: string;
|
|
@@ -54,6 +55,7 @@ export declare function useProductFlow({ initial, initialStep, isFirstProduct, o
|
|
|
54
55
|
status: "draft" | "active" | "archived";
|
|
55
56
|
featured: boolean;
|
|
56
57
|
everPublished: boolean;
|
|
58
|
+
taxCode: string | null;
|
|
57
59
|
images: {
|
|
58
60
|
id: string;
|
|
59
61
|
url: string;
|
|
@@ -78,6 +80,7 @@ export declare function useProductFlow({ initial, initialStep, isFirstProduct, o
|
|
|
78
80
|
status: "draft" | "active" | "archived";
|
|
79
81
|
featured: boolean;
|
|
80
82
|
everPublished: boolean;
|
|
83
|
+
taxCode: string | null;
|
|
81
84
|
images: {
|
|
82
85
|
id: string;
|
|
83
86
|
url: string;
|
|
@@ -99,6 +102,7 @@ export declare function useProductFlow({ initial, initialStep, isFirstProduct, o
|
|
|
99
102
|
status: "draft" | "active" | "archived";
|
|
100
103
|
featured: boolean;
|
|
101
104
|
everPublished: boolean;
|
|
105
|
+
taxCode: string | null;
|
|
102
106
|
images: {
|
|
103
107
|
id: string;
|
|
104
108
|
url: string;
|
|
@@ -120,6 +124,7 @@ export declare function useProductFlow({ initial, initialStep, isFirstProduct, o
|
|
|
120
124
|
status: "draft" | "active" | "archived";
|
|
121
125
|
featured: boolean;
|
|
122
126
|
everPublished: boolean;
|
|
127
|
+
taxCode: string | null;
|
|
123
128
|
images: {
|
|
124
129
|
id: string;
|
|
125
130
|
url: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@develemit/commerce-admin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "React admin UI for products, orders, discounts and shipping rates, backed by the commerce-server admin API.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@develemit/commerce-contracts": "0.
|
|
50
|
+
"@develemit/commerce-contracts": "0.9.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@testing-library/user-event": "^14.6.8"
|