@lasterp/shared 1.0.0-alpha.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/dist/index.cjs +387 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +298 -0
- package/dist/index.d.ts +298 -0
- package/dist/index.js +339 -0
- package/dist/index.js.map +1 -0
- package/package.json +50 -0
- package/src/client/context.tsx +74 -0
- package/src/client/core.ts +261 -0
- package/src/client/hooks.tsx +57 -0
- package/src/client/index.ts +21 -0
- package/src/client/storage.ts +76 -0
- package/src/client/types.ts +24 -0
- package/src/common/index.ts +1 -0
- package/src/common/types.ts +15 -0
- package/src/design/block/types.ts +8 -0
- package/src/design/globals/footer.ts +20 -0
- package/src/design/globals/header.ts +43 -0
- package/src/design/globals/types.ts +7 -0
- package/src/design/index.ts +8 -0
- package/src/design/page/api.ts +11 -0
- package/src/design/page/types.ts +15 -0
- package/src/index.ts +5 -0
- package/src/lasterp/catalog/types.ts +24 -0
- package/src/lasterp/index.ts +5 -0
- package/src/lasterp/shop/api.ts +32 -0
- package/src/lasterp/shop/hooks.tsx +42 -0
- package/src/lasterp/shop/types.ts +42 -0
- package/src/utils/catalog.ts +8 -0
- package/src/utils/index.ts +10 -0
- package/src/utils/types.ts +3 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type {Colour, Item, ItemVariant, ModelNumber} from '../catalog/types'
|
|
2
|
+
|
|
3
|
+
export interface Category {
|
|
4
|
+
name: string
|
|
5
|
+
categoryName: string
|
|
6
|
+
sequenceId: number
|
|
7
|
+
itemCode: string[]
|
|
8
|
+
itemGroup: string[]
|
|
9
|
+
brand: string[]
|
|
10
|
+
os: string[]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface Product extends Item {
|
|
14
|
+
name: string
|
|
15
|
+
image: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ProductVariant extends ItemVariant {
|
|
19
|
+
id: string
|
|
20
|
+
specs: Record<string, string>
|
|
21
|
+
price: number
|
|
22
|
+
stock: number
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ShopContext {
|
|
26
|
+
title?: string
|
|
27
|
+
categories?: Category[]
|
|
28
|
+
selectedCategory?: Category
|
|
29
|
+
grades?: string[]
|
|
30
|
+
selectedGrade?: string
|
|
31
|
+
products: Product[]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface ProductContext {
|
|
35
|
+
currency: string
|
|
36
|
+
product: Product
|
|
37
|
+
specs: Record<string, string[]>
|
|
38
|
+
variants: ProductVariant[]
|
|
39
|
+
modelNumbers: Record<string, ModelNumber>
|
|
40
|
+
colours: Record<string, Colour>
|
|
41
|
+
variantImages: Record<string, string[]>
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Re-export humps utilities with backward-compatible names
|
|
2
|
+
export {
|
|
3
|
+
camelize as snakeToCamel,
|
|
4
|
+
decamelize as camelToSnake,
|
|
5
|
+
camelizeKeys as objectSnakeToCamel,
|
|
6
|
+
decamelizeKeys as objectCamelToSnake,
|
|
7
|
+
} from 'humps';
|
|
8
|
+
|
|
9
|
+
export * from './catalog'
|
|
10
|
+
export * from './types'
|