@lasterp/shared 1.0.0-beta.20 → 1.0.0-beta.21
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 +7 -19
- package/dist/index.d.cts +58 -9
- package/dist/index.d.ts +58 -9
- package/dist/index.js +7 -19
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -75,33 +75,18 @@ __export(exports_src, {
|
|
|
75
75
|
LocaleProvider: () => LocaleProvider,
|
|
76
76
|
FrappeProvider: () => FrappeProvider,
|
|
77
77
|
FrappeContext: () => FrappeContext,
|
|
78
|
-
COLOR_SYSTEMS: () => COLOR_SYSTEMS,
|
|
79
78
|
ATTRIBUTES: () => ATTRIBUTES
|
|
80
79
|
});
|
|
81
80
|
module.exports = __toCommonJS(exports_src);
|
|
82
81
|
// src/catalog/schema.ts
|
|
83
82
|
var import_zod = require("zod");
|
|
84
83
|
var ATTRIBUTES = ["Colour", "Storage", "Memory", "Screen"];
|
|
85
|
-
var COLOR_SYSTEMS = [
|
|
86
|
-
"White",
|
|
87
|
-
"Black",
|
|
88
|
-
"Yellow",
|
|
89
|
-
"Red",
|
|
90
|
-
"Green",
|
|
91
|
-
"Blue",
|
|
92
|
-
"Purple",
|
|
93
|
-
"Orange",
|
|
94
|
-
"Pink",
|
|
95
|
-
"Brown",
|
|
96
|
-
"Gray",
|
|
97
|
-
"Silver",
|
|
98
|
-
"Gold"
|
|
99
|
-
];
|
|
100
84
|
var colourFormSchema = import_zod.z.object({
|
|
101
85
|
color: import_zod.z.string().min(1, "Color is required"),
|
|
102
86
|
color_hex: import_zod.z.string().optional(),
|
|
103
|
-
color_system: import_zod.z.
|
|
104
|
-
|
|
87
|
+
color_system: import_zod.z.string().optional(),
|
|
88
|
+
color_system_hex: import_zod.z.string().optional(),
|
|
89
|
+
images: import_zod.z.array(import_zod.z.string()).default([])
|
|
105
90
|
});
|
|
106
91
|
var screenFormSchema = import_zod.z.object({
|
|
107
92
|
screen: import_zod.z.string().min(1, "Screen is required"),
|
|
@@ -125,7 +110,10 @@ var itemFormSchema = import_zod.z.object({
|
|
|
125
110
|
storages: import_zod.z.array(import_zod.z.string()),
|
|
126
111
|
memories: import_zod.z.array(import_zod.z.string()),
|
|
127
112
|
screens: import_zod.z.array(screenFormSchema),
|
|
128
|
-
models: import_zod.z.array(modelFormSchema)
|
|
113
|
+
models: import_zod.z.array(modelFormSchema),
|
|
114
|
+
width: import_zod.z.number().positive().optional(),
|
|
115
|
+
height: import_zod.z.number().positive().optional(),
|
|
116
|
+
weight: import_zod.z.number().positive().optional()
|
|
129
117
|
});
|
|
130
118
|
// src/frappe/provider.tsx
|
|
131
119
|
var import_react = require("react");
|
package/dist/index.d.cts
CHANGED
|
@@ -11,14 +11,14 @@ interface Item {
|
|
|
11
11
|
attributes: string[];
|
|
12
12
|
storages: string[];
|
|
13
13
|
memories: string[];
|
|
14
|
-
colors:
|
|
14
|
+
colors: Colour2[];
|
|
15
15
|
screens: ScreenSpec[];
|
|
16
16
|
images: Image[];
|
|
17
17
|
height: number;
|
|
18
18
|
width: number;
|
|
19
19
|
weight: number;
|
|
20
20
|
}
|
|
21
|
-
interface
|
|
21
|
+
interface Colour2 {
|
|
22
22
|
color: string;
|
|
23
23
|
hex: string;
|
|
24
24
|
color_system: string;
|
|
@@ -40,11 +40,60 @@ interface Image {
|
|
|
40
40
|
}
|
|
41
41
|
import { z } from "zod";
|
|
42
42
|
declare const ATTRIBUTES: readonly ["Colour", "Storage", "Memory", "Screen"];
|
|
43
|
-
declare const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
declare const colourFormSchema: z.ZodObject<{
|
|
44
|
+
color: z.ZodString;
|
|
45
|
+
color_hex: z.ZodOptional<z.ZodString>;
|
|
46
|
+
color_system: z.ZodOptional<z.ZodString>;
|
|
47
|
+
color_system_hex: z.ZodOptional<z.ZodString>;
|
|
48
|
+
images: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
declare const screenFormSchema: z.ZodObject<{
|
|
51
|
+
screen: z.ZodString;
|
|
52
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
}>;
|
|
56
|
+
declare const modelFormSchema: z.ZodObject<{
|
|
57
|
+
model: z.ZodString;
|
|
58
|
+
sim_card_type: z.ZodOptional<z.ZodString>;
|
|
59
|
+
connectivity: z.ZodArray<z.ZodString>;
|
|
60
|
+
}>;
|
|
61
|
+
declare const itemFormSchema: z.ZodObject<{
|
|
62
|
+
item_code: z.ZodString;
|
|
63
|
+
item_group: z.ZodOptional<z.ZodString>;
|
|
64
|
+
brand: z.ZodOptional<z.ZodString>;
|
|
65
|
+
os: z.ZodOptional<z.ZodString>;
|
|
66
|
+
release_year: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
attributes: z.ZodArray<z.ZodEnum<{
|
|
68
|
+
Colour: "Colour";
|
|
69
|
+
Storage: "Storage";
|
|
70
|
+
Memory: "Memory";
|
|
71
|
+
Screen: "Screen";
|
|
72
|
+
}>>;
|
|
73
|
+
colours: z.ZodArray<z.ZodObject<{
|
|
74
|
+
color: z.ZodString;
|
|
75
|
+
color_hex: z.ZodOptional<z.ZodString>;
|
|
76
|
+
color_system: z.ZodOptional<z.ZodString>;
|
|
77
|
+
color_system_hex: z.ZodOptional<z.ZodString>;
|
|
78
|
+
images: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
storages: z.ZodArray<z.ZodString>;
|
|
81
|
+
memories: z.ZodArray<z.ZodString>;
|
|
82
|
+
screens: z.ZodArray<z.ZodObject<{
|
|
83
|
+
screen: z.ZodString;
|
|
84
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
}, z.core.$strip>>;
|
|
88
|
+
models: z.ZodArray<z.ZodObject<{
|
|
89
|
+
model: z.ZodString;
|
|
90
|
+
sim_card_type: z.ZodOptional<z.ZodString>;
|
|
91
|
+
connectivity: z.ZodArray<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
}>;
|
|
48
97
|
type ColourForm = z.infer<typeof colourFormSchema>;
|
|
49
98
|
type ScreenForm = z.infer<typeof screenFormSchema>;
|
|
50
99
|
type ModelForm = z.infer<typeof modelFormSchema>;
|
|
@@ -718,8 +767,8 @@ interface ProductContext {
|
|
|
718
767
|
specs: Record<string, string[]>;
|
|
719
768
|
variants: ProductVariant[];
|
|
720
769
|
models: Record<string, Model>;
|
|
721
|
-
colors: Record<string,
|
|
770
|
+
colors: Record<string, Colour2>;
|
|
722
771
|
}
|
|
723
772
|
import { camelize, decamelize, camelizeKeys, decamelizeKeys } from "humps";
|
|
724
773
|
declare function equalsIgnoreCase(str1: string, str2: string): boolean;
|
|
725
|
-
export { useVariantSelector, useSearch, useLocale, useFrappeUpdateDoc, useFrappePutCall, useFrappePrefetchDoc, useFrappePostCall, useFrappeGetMeta, useFrappeGetDocList, useFrappeGetDocCount, useFrappeGetDoc, useFrappeGetCall, useFrappeFileUpload, useFrappeEventListener, useFrappeDocumentEventListener, useFrappeDocTypeEventListener, useFrappeDeleteDoc, useFrappeDeleteCall, useFrappeCreateDoc, useFrappeAuth, screenFormSchema, modelFormSchema, itemFormSchema, equalsIgnoreCase, decamelizeKeys, decamelize, colourFormSchema, camelizeKeys, camelize, WorkspaceSidebarItem, WorkspaceSidebar, ViewerEventData, VariantSelectorResult, VariantSelectorProps, VariantSelectorOption, UseFrappeFileUploadReturnType, TopbarItem, Topbar, TokenParams, ShopContext, SearchResult, ScreenSpec, ScreenForm, ProductVariant, ProductContext, Product, Page, NavbarSubItemGroup, NavbarSubItem, NavbarItem, ModelForm, Model, LocaleProvider, ItemForm, Item, Image, Hero, Header, Globals, FrappeResult, FrappeProviderProps, FrappeProvider, FrappeMutationResult, FrappeMetaField, FrappeMeta, FrappeFileUploadResponse, FrappeError, FrappeContext, FrappeConfig, FooterItemGroup, FooterItem, Footer, DocumentUpdateEventData, DocTypeListUpdateEventData, ColourForm, Colour, Category,
|
|
774
|
+
export { useVariantSelector, useSearch, useLocale, useFrappeUpdateDoc, useFrappePutCall, useFrappePrefetchDoc, useFrappePostCall, useFrappeGetMeta, useFrappeGetDocList, useFrappeGetDocCount, useFrappeGetDoc, useFrappeGetCall, useFrappeFileUpload, useFrappeEventListener, useFrappeDocumentEventListener, useFrappeDocTypeEventListener, useFrappeDeleteDoc, useFrappeDeleteCall, useFrappeCreateDoc, useFrappeAuth, screenFormSchema, modelFormSchema, itemFormSchema, equalsIgnoreCase, decamelizeKeys, decamelize, colourFormSchema, camelizeKeys, camelize, WorkspaceSidebarItem, WorkspaceSidebar, ViewerEventData, VariantSelectorResult, VariantSelectorProps, VariantSelectorOption, UseFrappeFileUploadReturnType, TopbarItem, Topbar, TokenParams, ShopContext, SearchResult, ScreenSpec, ScreenForm, ProductVariant, ProductContext, Product, Page, NavbarSubItemGroup, NavbarSubItem, NavbarItem, ModelForm, Model, LocaleProvider, ItemForm, Item, Image, Hero, Header, Globals, FrappeResult, FrappeProviderProps, FrappeProvider, FrappeMutationResult, FrappeMetaField, FrappeMeta, FrappeFileUploadResponse, FrappeError, FrappeContext, FrappeConfig, FooterItemGroup, FooterItem, Footer, DocumentUpdateEventData, DocTypeListUpdateEventData, ColourForm, Colour2 as Colour, Category, Brand, Block, ATTRIBUTES };
|
package/dist/index.d.ts
CHANGED
|
@@ -11,14 +11,14 @@ interface Item {
|
|
|
11
11
|
attributes: string[];
|
|
12
12
|
storages: string[];
|
|
13
13
|
memories: string[];
|
|
14
|
-
colors:
|
|
14
|
+
colors: Colour2[];
|
|
15
15
|
screens: ScreenSpec[];
|
|
16
16
|
images: Image[];
|
|
17
17
|
height: number;
|
|
18
18
|
width: number;
|
|
19
19
|
weight: number;
|
|
20
20
|
}
|
|
21
|
-
interface
|
|
21
|
+
interface Colour2 {
|
|
22
22
|
color: string;
|
|
23
23
|
hex: string;
|
|
24
24
|
color_system: string;
|
|
@@ -40,11 +40,60 @@ interface Image {
|
|
|
40
40
|
}
|
|
41
41
|
import { z } from "zod";
|
|
42
42
|
declare const ATTRIBUTES: readonly ["Colour", "Storage", "Memory", "Screen"];
|
|
43
|
-
declare const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
declare const colourFormSchema: z.ZodObject<{
|
|
44
|
+
color: z.ZodString;
|
|
45
|
+
color_hex: z.ZodOptional<z.ZodString>;
|
|
46
|
+
color_system: z.ZodOptional<z.ZodString>;
|
|
47
|
+
color_system_hex: z.ZodOptional<z.ZodString>;
|
|
48
|
+
images: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
declare const screenFormSchema: z.ZodObject<{
|
|
51
|
+
screen: z.ZodString;
|
|
52
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
}>;
|
|
56
|
+
declare const modelFormSchema: z.ZodObject<{
|
|
57
|
+
model: z.ZodString;
|
|
58
|
+
sim_card_type: z.ZodOptional<z.ZodString>;
|
|
59
|
+
connectivity: z.ZodArray<z.ZodString>;
|
|
60
|
+
}>;
|
|
61
|
+
declare const itemFormSchema: z.ZodObject<{
|
|
62
|
+
item_code: z.ZodString;
|
|
63
|
+
item_group: z.ZodOptional<z.ZodString>;
|
|
64
|
+
brand: z.ZodOptional<z.ZodString>;
|
|
65
|
+
os: z.ZodOptional<z.ZodString>;
|
|
66
|
+
release_year: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
attributes: z.ZodArray<z.ZodEnum<{
|
|
68
|
+
Colour: "Colour";
|
|
69
|
+
Storage: "Storage";
|
|
70
|
+
Memory: "Memory";
|
|
71
|
+
Screen: "Screen";
|
|
72
|
+
}>>;
|
|
73
|
+
colours: z.ZodArray<z.ZodObject<{
|
|
74
|
+
color: z.ZodString;
|
|
75
|
+
color_hex: z.ZodOptional<z.ZodString>;
|
|
76
|
+
color_system: z.ZodOptional<z.ZodString>;
|
|
77
|
+
color_system_hex: z.ZodOptional<z.ZodString>;
|
|
78
|
+
images: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
storages: z.ZodArray<z.ZodString>;
|
|
81
|
+
memories: z.ZodArray<z.ZodString>;
|
|
82
|
+
screens: z.ZodArray<z.ZodObject<{
|
|
83
|
+
screen: z.ZodString;
|
|
84
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
}, z.core.$strip>>;
|
|
88
|
+
models: z.ZodArray<z.ZodObject<{
|
|
89
|
+
model: z.ZodString;
|
|
90
|
+
sim_card_type: z.ZodOptional<z.ZodString>;
|
|
91
|
+
connectivity: z.ZodArray<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
}>;
|
|
48
97
|
type ColourForm = z.infer<typeof colourFormSchema>;
|
|
49
98
|
type ScreenForm = z.infer<typeof screenFormSchema>;
|
|
50
99
|
type ModelForm = z.infer<typeof modelFormSchema>;
|
|
@@ -718,8 +767,8 @@ interface ProductContext {
|
|
|
718
767
|
specs: Record<string, string[]>;
|
|
719
768
|
variants: ProductVariant[];
|
|
720
769
|
models: Record<string, Model>;
|
|
721
|
-
colors: Record<string,
|
|
770
|
+
colors: Record<string, Colour2>;
|
|
722
771
|
}
|
|
723
772
|
import { camelize, decamelize, camelizeKeys, decamelizeKeys } from "humps";
|
|
724
773
|
declare function equalsIgnoreCase(str1: string, str2: string): boolean;
|
|
725
|
-
export { useVariantSelector, useSearch, useLocale, useFrappeUpdateDoc, useFrappePutCall, useFrappePrefetchDoc, useFrappePostCall, useFrappeGetMeta, useFrappeGetDocList, useFrappeGetDocCount, useFrappeGetDoc, useFrappeGetCall, useFrappeFileUpload, useFrappeEventListener, useFrappeDocumentEventListener, useFrappeDocTypeEventListener, useFrappeDeleteDoc, useFrappeDeleteCall, useFrappeCreateDoc, useFrappeAuth, screenFormSchema, modelFormSchema, itemFormSchema, equalsIgnoreCase, decamelizeKeys, decamelize, colourFormSchema, camelizeKeys, camelize, WorkspaceSidebarItem, WorkspaceSidebar, ViewerEventData, VariantSelectorResult, VariantSelectorProps, VariantSelectorOption, UseFrappeFileUploadReturnType, TopbarItem, Topbar, TokenParams, ShopContext, SearchResult, ScreenSpec, ScreenForm, ProductVariant, ProductContext, Product, Page, NavbarSubItemGroup, NavbarSubItem, NavbarItem, ModelForm, Model, LocaleProvider, ItemForm, Item, Image, Hero, Header, Globals, FrappeResult, FrappeProviderProps, FrappeProvider, FrappeMutationResult, FrappeMetaField, FrappeMeta, FrappeFileUploadResponse, FrappeError, FrappeContext, FrappeConfig, FooterItemGroup, FooterItem, Footer, DocumentUpdateEventData, DocTypeListUpdateEventData, ColourForm, Colour, Category,
|
|
774
|
+
export { useVariantSelector, useSearch, useLocale, useFrappeUpdateDoc, useFrappePutCall, useFrappePrefetchDoc, useFrappePostCall, useFrappeGetMeta, useFrappeGetDocList, useFrappeGetDocCount, useFrappeGetDoc, useFrappeGetCall, useFrappeFileUpload, useFrappeEventListener, useFrappeDocumentEventListener, useFrappeDocTypeEventListener, useFrappeDeleteDoc, useFrappeDeleteCall, useFrappeCreateDoc, useFrappeAuth, screenFormSchema, modelFormSchema, itemFormSchema, equalsIgnoreCase, decamelizeKeys, decamelize, colourFormSchema, camelizeKeys, camelize, WorkspaceSidebarItem, WorkspaceSidebar, ViewerEventData, VariantSelectorResult, VariantSelectorProps, VariantSelectorOption, UseFrappeFileUploadReturnType, TopbarItem, Topbar, TokenParams, ShopContext, SearchResult, ScreenSpec, ScreenForm, ProductVariant, ProductContext, Product, Page, NavbarSubItemGroup, NavbarSubItem, NavbarItem, ModelForm, Model, LocaleProvider, ItemForm, Item, Image, Hero, Header, Globals, FrappeResult, FrappeProviderProps, FrappeProvider, FrappeMutationResult, FrappeMetaField, FrappeMeta, FrappeFileUploadResponse, FrappeError, FrappeContext, FrappeConfig, FooterItemGroup, FooterItem, Footer, DocumentUpdateEventData, DocTypeListUpdateEventData, ColourForm, Colour2 as Colour, Category, Brand, Block, ATTRIBUTES };
|
package/dist/index.js
CHANGED
|
@@ -2,26 +2,12 @@
|
|
|
2
2
|
// src/catalog/schema.ts
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
var ATTRIBUTES = ["Colour", "Storage", "Memory", "Screen"];
|
|
5
|
-
var COLOR_SYSTEMS = [
|
|
6
|
-
"White",
|
|
7
|
-
"Black",
|
|
8
|
-
"Yellow",
|
|
9
|
-
"Red",
|
|
10
|
-
"Green",
|
|
11
|
-
"Blue",
|
|
12
|
-
"Purple",
|
|
13
|
-
"Orange",
|
|
14
|
-
"Pink",
|
|
15
|
-
"Brown",
|
|
16
|
-
"Gray",
|
|
17
|
-
"Silver",
|
|
18
|
-
"Gold"
|
|
19
|
-
];
|
|
20
5
|
var colourFormSchema = z.object({
|
|
21
6
|
color: z.string().min(1, "Color is required"),
|
|
22
7
|
color_hex: z.string().optional(),
|
|
23
|
-
color_system: z.
|
|
24
|
-
|
|
8
|
+
color_system: z.string().optional(),
|
|
9
|
+
color_system_hex: z.string().optional(),
|
|
10
|
+
images: z.array(z.string()).default([])
|
|
25
11
|
});
|
|
26
12
|
var screenFormSchema = z.object({
|
|
27
13
|
screen: z.string().min(1, "Screen is required"),
|
|
@@ -45,7 +31,10 @@ var itemFormSchema = z.object({
|
|
|
45
31
|
storages: z.array(z.string()),
|
|
46
32
|
memories: z.array(z.string()),
|
|
47
33
|
screens: z.array(screenFormSchema),
|
|
48
|
-
models: z.array(modelFormSchema)
|
|
34
|
+
models: z.array(modelFormSchema),
|
|
35
|
+
width: z.number().positive().optional(),
|
|
36
|
+
height: z.number().positive().optional(),
|
|
37
|
+
weight: z.number().positive().optional()
|
|
49
38
|
});
|
|
50
39
|
// src/frappe/provider.tsx
|
|
51
40
|
import { useMemo, createContext } from "react";
|
|
@@ -739,6 +728,5 @@ export {
|
|
|
739
728
|
LocaleProvider,
|
|
740
729
|
FrappeProvider,
|
|
741
730
|
FrappeContext,
|
|
742
|
-
COLOR_SYSTEMS,
|
|
743
731
|
ATTRIBUTES
|
|
744
732
|
};
|