contentoh-components-library 21.5.99 → 21.6.1

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.
Files changed (64) hide show
  1. package/dist/components/atoms/GeneralButton/styles.js +1 -1
  2. package/dist/components/atoms/GeneralInput/index.js +249 -54
  3. package/dist/components/atoms/GeneralInput/styles.js +7 -3
  4. package/dist/components/atoms/InputFormatter/index.js +223 -68
  5. package/dist/components/atoms/InputFormatter/styles.js +20 -4
  6. package/dist/components/molecules/StatusAsignationInfo/index.js +11 -1
  7. package/dist/components/molecules/TabsMenu/index.js +13 -1
  8. package/dist/components/molecules/TagAndInput/index.js +364 -24
  9. package/dist/components/molecules/TagAndInput/styles.js +2 -2
  10. package/dist/components/organisms/FullProductNameHeader/index.js +6 -22
  11. package/dist/components/organisms/InputGroup/index.js +22 -18
  12. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +150 -337
  13. package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.context.js +15 -15
  14. package/dist/components/pages/ProviderProductEdition/index.js +393 -352
  15. package/dist/components/pages/ProviderProductEdition/utils.js +1 -0
  16. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +125 -211
  17. package/dist/components/pages/RetailerProductEdition/index.js +1743 -2239
  18. package/dist/components/pages/RetailerProductEdition/styles.js +4 -2
  19. package/dist/components/pages/RetailerProductEdition/utils.js +251 -2
  20. package/dist/contexts/AiProductEdition.js +34 -22
  21. package/package.json +4 -2
  22. package/src/ai/utils/compare-strings.js +45 -0
  23. package/src/assets/images/Icons/arrow.png +0 -0
  24. package/src/assets/images/Icons/cancel.png +0 -0
  25. package/src/assets/images/Icons/ia-icon.png +0 -0
  26. package/src/assets/images/Icons/loading.svg +5 -0
  27. package/src/assets/images/Icons/reload.png +0 -0
  28. package/src/components/atoms/GeneralButton/styles.js +4 -0
  29. package/src/components/atoms/GeneralInput/index.js +241 -60
  30. package/src/components/atoms/GeneralInput/styles.js +81 -0
  31. package/src/components/atoms/InputFormatter/index.js +200 -51
  32. package/src/components/atoms/InputFormatter/styles.js +284 -0
  33. package/src/components/atoms/RetailerSelector/RetailerSelector.stories.js +10 -0
  34. package/src/components/atoms/RetailerSelector/index.js +3 -0
  35. package/src/components/atoms/RetailerSelector/styles.js +0 -0
  36. package/src/components/molecules/StatusAsignationInfo/index.js +9 -1
  37. package/src/components/molecules/TabsMenu/index.js +12 -0
  38. package/src/components/molecules/TagAndInput/index.js +294 -21
  39. package/src/components/molecules/TagAndInput/styles.js +59 -17
  40. package/src/components/organisms/ChangeStatusModal/index.jsx +488 -0
  41. package/src/components/organisms/ChangeStatusModal/styles.js +333 -0
  42. package/src/components/organisms/FullProductNameHeader/index.js +4 -28
  43. package/src/components/organisms/FullTabsMenu/index.js +1 -1
  44. package/src/components/organisms/InputGroup/index.js +12 -4
  45. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +174 -202
  46. package/src/components/pages/ProviderProductEdition/context/provider-product-edition.context.jsx +14 -14
  47. package/src/components/pages/ProviderProductEdition/index.js +486 -417
  48. package/src/components/pages/ProviderProductEdition/utils.js +2 -2
  49. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +136 -243
  50. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +575 -0
  51. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +62 -0
  52. package/src/components/pages/RetailerProductEdition/context/reducers/active-state.js +344 -0
  53. package/src/components/pages/RetailerProductEdition/context/reducers/inputs.js +155 -0
  54. package/src/components/pages/RetailerProductEdition/context/reducers/product.js +114 -0
  55. package/src/components/pages/RetailerProductEdition/context/reducers/system.js +60 -0
  56. package/src/components/pages/RetailerProductEdition/index.js +1580 -1719
  57. package/src/components/pages/RetailerProductEdition/index_old.js +1979 -0
  58. package/src/components/pages/RetailerProductEdition/stories/Auditor.stories.js +101 -0
  59. package/src/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +115 -0
  60. package/src/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +174 -0
  61. package/src/components/pages/RetailerProductEdition/styles.js +67 -2
  62. package/src/components/pages/RetailerProductEdition/utils.js +240 -0
  63. package/src/contexts/AiProductEdition.jsx +356 -0
  64. package/src/global-files/statusDictionary.js +103 -0
@@ -21,217 +21,189 @@ ProviderProductEditionFromProducts.args = {
21
21
  category: 102,
22
22
  version: 3,
23
23
  productSelected: {
24
- id_article: 84864,
25
- upc: "295900788",
26
- sku: null,
27
- name: "FUNDA MÓVIL COLGANTE T FUNNY ROJO",
28
- timestamp: "2022-10-24T22:43:39.000Z",
29
- id_user: 533,
30
- categoryName: "Ropa, Accesorios, Fragancias y Joyería|Accesorios|Bolsas",
31
- id_category: 610,
32
- version: 2,
33
- retailersAvailable: [
34
- { name: "Liverpool", id: 10 },
35
- { name: "Palacio de Hierro", id: 47 },
36
- ],
37
- categoryRetailer: [
38
- {
39
- id_category: 6821,
40
- retailer_id: 10,
41
- categoryName:
42
- "Ropa, Accesorios, Fragancias y Joyería|Accesorios|Bolsas",
43
- retailerName: "Liverpool",
44
- },
45
- {
46
- id_category: 6968,
47
- retailer_id: 47,
48
- categoryName:
49
- "Ropa, Accesorios, Fragancias y Joyería|Accesorios|Bolsas",
50
- retailerName: "Palacio de Hierro",
51
- },
24
+ "orderId": 10458,
25
+ "status": "AA",
26
+ "datasheet_status": "AA",
27
+ "prio": "none",
28
+ "version": 3,
29
+ "description_status": "AA",
30
+ "images_status": "AA",
31
+ "brand": "Generico",
32
+ "retailerOrder": 0,
33
+ "missing": {
34
+ "datasheet": null,
35
+ "descriptions": null,
36
+ "images": null
37
+ },
38
+ "services": {
39
+ "datasheets": 1,
40
+ "descriptions": 1,
41
+ "images": 1
42
+ },
43
+ "article": {
44
+ "category": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
45
+ "company_name": "LATAM LOGISTICS",
46
+ "country": "México",
47
+ "id_category": "6186",
48
+ "id_datasheet_especialist": 426,
49
+ "id_datasheet_facilitator": null,
50
+ "id_description_especialist": 426,
51
+ "id_description_facilitator": null,
52
+ "id_images_especialist": 427,
53
+ "id_images_facilitator": null,
54
+ "id_order": 10458,
55
+ "id_article": 145207,
56
+ "id_auditor": 425,
57
+ "name": "Serna Status Bug 5",
58
+ "timestamp": "2026-05-07T15:00:25.000Z",
59
+ "upc": "897654352",
60
+ "sku": "764535242",
61
+ "categoryRetailer": [
62
+ {
63
+ "id_category": 4010,
64
+ "id_retailer": 70,
65
+ "category_name": "Accesorios de Bebés|Cuarto del Bebé Niño|Cuarto del Bebé Niño",
66
+ "retailer_name": "Bodega Aurrera"
67
+ },
68
+ {
69
+ "id_category": 6186,
70
+ "id_retailer": 9,
71
+ "category_name": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
72
+ "retailer_name": "Amazon"
73
+ }
74
+ ]
75
+ },
76
+ "retailers": [
77
+ {
78
+ "id": 9,
79
+ "name": "Amazon"
80
+ },
81
+ {
82
+ "id": 70,
83
+ "name": "Bodega Aurrera"
84
+ }
52
85
  ],
53
- percentages: [
54
- {
55
- id_retailer: 10,
56
- id_category: 6821,
57
- datasheet: { required: 100, general: 79.72 },
58
- descriptions: { required: 100, general: 100 },
59
- images: {
60
- required: 100,
61
- general: 80.01,
62
- details: {
63
- mandatoryShots: { total: 1, completed: 1, percentage: 100 },
64
- optionalShots: { total: 35, completed: 3, percentage: 8.57 },
65
- namingAttributes: { total: 1, completed: 1, percentage: 100 },
66
- },
86
+ "statusByRetailer": {
87
+ "9": {
88
+ "datasheet": "AA",
89
+ "description": "AA",
90
+ "images": "AA"
67
91
  },
68
- percentagesGeneral: { required: 100, general: 63.6 },
69
- },
70
- {
71
- id_retailer: 47,
72
- id_category: 6968,
73
- datasheet: { required: 100, general: 98.46 },
74
- descriptions: { required: 100, general: 100 },
75
- images: {
76
- required: 100,
77
- general: 80.01,
78
- details: {
79
- mandatoryShots: { total: 1, completed: 1, percentage: 100 },
80
- optionalShots: { total: 35, completed: 3, percentage: 8.57 },
81
- namingAttributes: { total: 1, completed: 1, percentage: 100 },
82
- },
92
+ "70": {
93
+ "datasheet": "AA",
94
+ "description": "AA",
95
+ "images": "AA"
96
+ }
97
+ },
98
+ "retailersAvailable": [
99
+ {
100
+ "id": 9,
101
+ "name": "Amazon"
83
102
  },
84
- percentagesGeneral: { required: 100, general: 69.85 },
85
- },
103
+ {
104
+ "id": 70,
105
+ "name": "Bodega Aurrera"
106
+ }
86
107
  ],
87
- summary: { totalRelations: 2, averageRequired: 100, averageGeneral: 66.72 },
88
- article: { id_article: 84864 },
89
- },
108
+ "categoryName": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
109
+ "upc": "897654352",
110
+ "id_article": 145207,
111
+ "id_order": 10458
112
+ },
90
113
  productToEdit: {
91
- idCategory: 1719,
92
- ArticleId: 142443,
93
- product: [
94
- {
95
- id_article: 142443,
96
- upc: "1235125",
97
- sku: "8849443",
98
- name: "Migración instancia 2",
99
- timestamp: "2025-08-07T04:47:06.000Z",
100
- id_user: 1989,
101
- categoryName: "Supermercado|Bebidas|Agua",
102
- id_category: 1719,
103
- version: 6,
104
- retailersAvailable: [
105
- { name: "Walmart Super y Superama", id: 4 },
106
- { name: "Chedraui", id: 5 },
107
- { name: "HEB", id: 6 },
108
- { name: "La Comer", id: 12 },
109
- { name: "Soriana", id: 13 },
110
- ],
111
- categoryRetailer: [
112
- {
113
- id_category: 3430,
114
- retailer_id: 12,
115
- categoryName:
116
- "Departamento General La Comer|Departamento General|Departamento General",
117
- retailerName: "La Comer",
118
- },
119
- {
120
- id_category: 4767,
121
- retailer_id: 6,
122
- categoryName: "Supermercado|Bebidas|Agua",
123
- retailerName: "HEB",
124
- },
125
- {
126
- id_category: 4941,
127
- retailer_id: 13,
128
- categoryName: "Supermercado Soriana|Supermercado|Supermercado",
129
- retailerName: "Soriana",
130
- },
131
- {
132
- id_category: 6098,
133
- retailer_id: 4,
134
- categoryName: "Supermercado|Bebidas|Agua",
135
- retailerName: "Walmart Super y Superama",
136
- },
137
- {
138
- id_category: 6788,
139
- retailer_id: 5,
140
- categoryName:
141
- "Categoría Supermercado|Categoría Supermercado|Categoría Supermercado",
142
- retailerName: "Chedraui",
143
- },
144
- ],
145
- percentages: [
146
- {
147
- id_retailer: 12,
148
- id_category: 3430,
149
- datasheet: { required: 20, general: 10 },
150
- descriptions: { required: 0, general: 0 },
151
- images: {
152
- required: 64.99,
153
- general: 51.99,
154
- details: {
155
- mandatoryShots: { total: 2, completed: 1, percentage: 50 },
156
- optionalShots: { total: 10, completed: 0, percentage: 0 },
157
- namingAttributes: { total: 1, completed: 1, percentage: 100 },
158
- },
159
- },
160
- percentagesGeneral: { required: 23.33, general: 6.11 },
161
- },
162
- {
163
- id_retailer: 6,
164
- id_category: 4767,
165
- datasheet: { required: 25, general: 16.66 },
166
- descriptions: { required: 0, general: 0 },
167
- images: {
168
- required: 100,
169
- general: 80.01,
170
- details: {
171
- mandatoryShots: { total: 1, completed: 1, percentage: 100 },
172
- optionalShots: { total: 36, completed: 2, percentage: 5.55 },
173
- namingAttributes: { total: 1, completed: 1, percentage: 100 },
174
- },
175
- },
176
- percentagesGeneral: { required: 41.67, general: 8.25 },
177
- },
178
- {
179
- id_retailer: 13,
180
- id_category: 4941,
181
- datasheet: { required: 14.28, general: 3.84 },
182
- descriptions: { required: 0, general: 0 },
183
- images: {
184
- required: 100,
185
- general: 80.01,
186
- details: {
187
- mandatoryShots: { total: 1, completed: 1, percentage: 100 },
188
- optionalShots: { total: 37, completed: 2, percentage: 5.4 },
189
- namingAttributes: { total: 1, completed: 1, percentage: 100 },
190
- },
114
+ "ArticleId": 145207,
115
+ "idCategory": "6186",
116
+ "product": {
117
+ "orderId": 10458,
118
+ "status": "AA",
119
+ "datasheet_status": "AA",
120
+ "prio": "none",
121
+ "version": 3,
122
+ "description_status": "AA",
123
+ "images_status": "AA",
124
+ "brand": "Generico",
125
+ "retailerOrder": 0,
126
+ "missing": {
127
+ "datasheet": null,
128
+ "descriptions": null,
129
+ "images": null
130
+ },
131
+ "services": {
132
+ "datasheets": 1,
133
+ "descriptions": 1,
134
+ "images": 1
135
+ },
136
+ "article": {
137
+ "category": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
138
+ "company_name": "LATAM LOGISTICS",
139
+ "country": "México",
140
+ "id_category": "6186",
141
+ "id_datasheet_especialist": 426,
142
+ "id_datasheet_facilitator": null,
143
+ "id_description_especialist": 426,
144
+ "id_description_facilitator": null,
145
+ "id_images_especialist": 427,
146
+ "id_images_facilitator": null,
147
+ "id_order": 10458,
148
+ "id_article": 145207,
149
+ "id_auditor": 425,
150
+ "name": "Serna Status Bug 5",
151
+ "timestamp": "2026-05-07T15:00:25.000Z",
152
+ "upc": "897654352",
153
+ "sku": "764535242",
154
+ "categoryRetailer": [
155
+ {
156
+ "id_category": 4010,
157
+ "id_retailer": 70,
158
+ "category_name": "Accesorios de Bebés|Cuarto del Bebé Niño|Cuarto del Bebé Niño",
159
+ "retailer_name": "Bodega Aurrera"
160
+ },
161
+ {
162
+ "id_category": 6186,
163
+ "id_retailer": 9,
164
+ "category_name": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
165
+ "retailer_name": "Amazon"
166
+ }
167
+ ]
168
+ },
169
+ "retailers": [
170
+ {
171
+ "id": 9,
172
+ "name": "Amazon"
191
173
  },
192
- percentagesGeneral: { required: 38.09, general: 3.91 },
193
- },
194
- {
195
- id_retailer: 4,
196
- id_category: 6098,
197
- datasheet: { required: 20, general: 4.54 },
198
- descriptions: { required: 0, general: 0 },
199
- images: {
200
- required: 100,
201
- general: 80.01,
202
- details: {
203
- mandatoryShots: { total: 1, completed: 1, percentage: 100 },
204
- optionalShots: { total: 37, completed: 3, percentage: 8.1 },
205
- namingAttributes: { total: 1, completed: 1, percentage: 100 },
206
- },
174
+ {
175
+ "id": 70,
176
+ "name": "Bodega Aurrera"
177
+ }
178
+ ],
179
+ "statusByRetailer": {
180
+ "9": {
181
+ "datasheet": "AA",
182
+ "description": "AA",
183
+ "images": "AA"
207
184
  },
208
- percentagesGeneral: { required: 40, general: 5.02 },
209
- },
210
- {
211
- id_retailer: 5,
212
- id_category: 6788,
213
- datasheet: { required: 7.14, general: 2.63 },
214
- descriptions: { required: 0, general: 0 },
215
- images: {
216
- required: 100,
217
- general: 80,
218
- details: {
219
- mandatoryShots: { total: 1, completed: 1, percentage: 100 },
220
- optionalShots: { total: 34, completed: 1, percentage: 2.94 },
221
- namingAttributes: { total: 1, completed: 1, percentage: 100 },
222
- },
185
+ "70": {
186
+ "datasheet": "AA",
187
+ "description": "AA",
188
+ "images": "AA"
189
+ }
190
+ },
191
+ "retailersAvailable": [
192
+ {
193
+ "id": 9,
194
+ "name": "Amazon"
223
195
  },
224
- percentagesGeneral: { required: 35.71, general: 2.78 },
225
- },
196
+ {
197
+ "id": 70,
198
+ "name": "Bodega Aurrera"
199
+ }
226
200
  ],
227
- summary: {
228
- totalRelations: 5,
229
- averageRequired: 35.76,
230
- averageGeneral: 5.21,
231
- },
232
- },
233
- ],
234
- },
201
+ "categoryName": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
202
+ "upc": "897654352",
203
+ "id_article": 145207,
204
+ "id_order": 10458
205
+ }
206
+ },
235
207
  location: {
236
208
  pathname: "/EditProducts",
237
209
  search: "",
@@ -31,6 +31,19 @@ export { ACTIONS };
31
31
  // Create context
32
32
  const ProductEditionContext = createContext();
33
33
 
34
+ // Custom hook to use the context
35
+ export const useProviderProductEdition = () => {
36
+ const context = useContext(ProductEditionContext);
37
+
38
+ if (!context) {
39
+ throw new Error(
40
+ "useProviderProductEdition must be used within a ProviderProductEditionProvider"
41
+ );
42
+ }
43
+
44
+ return context;
45
+ };
46
+
34
47
  // Provider component
35
48
  export const ProviderProductEditionProvider = ({ children }) => {
36
49
  const [state, dispatch] = useReducer(productEditionReducer, initialState);
@@ -404,17 +417,4 @@ export const ProviderProductEditionProvider = ({ children }) => {
404
417
 
405
418
  ProviderProductEditionProvider.propTypes = {
406
419
  children: PropTypes.node.isRequired,
407
- };
408
-
409
- // Custom hook to use the context
410
- export const useProviderProductEdition = () => {
411
- const context = useContext(ProductEditionContext);
412
-
413
- if (!context) {
414
- throw new Error(
415
- "useProviderProductEdition must be used within a ProviderProductEditionProvider"
416
- );
417
- }
418
-
419
- return context;
420
- };
420
+ };