contentoh-components-library 21.6.56 → 21.6.57

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 (43) hide show
  1. package/dist/components/atoms/AsignationOption/index.js +1 -0
  2. package/dist/components/atoms/AsignationOption/styles.js +1 -1
  3. package/dist/components/molecules/GalleryAssetElement/styles.js +1 -1
  4. package/dist/components/molecules/RetailerSelector/RetailerSelector.stories.js +23 -2
  5. package/dist/components/molecules/RetailerSelector/index.js +7 -2
  6. package/dist/components/molecules/RetailerSelectorv2/index.js +6 -2
  7. package/dist/components/organisms/DigitalAssetsTray/DigitalAssetsTray.stories.js +73 -9
  8. package/dist/components/organisms/DigitalAssetsTray/index.js +13 -5
  9. package/dist/components/pages/CreatorsProductEdition/CreatorsProductEditionView.js +905 -0
  10. package/dist/components/pages/CreatorsProductEdition/constants.js +19 -0
  11. package/dist/components/pages/CreatorsProductEdition/hooks/useCreatorsProductEdition.js +2967 -0
  12. package/dist/components/pages/CreatorsProductEdition/index.js +33 -0
  13. package/dist/components/pages/CreatorsProductEdition/mocks/api.fixtures.js +537 -0
  14. package/dist/components/pages/CreatorsProductEdition/mocks/mockApi.js +251 -0
  15. package/dist/components/pages/CreatorsProductEdition/sections/CommentBox.js +311 -0
  16. package/dist/components/pages/CreatorsProductEdition/sections/ImagePanel.js +421 -0
  17. package/dist/components/pages/CreatorsProductEdition/sections/ImagesSection.js +473 -0
  18. package/dist/components/pages/CreatorsProductEdition/sections/ProductHeader.js +379 -0
  19. package/dist/components/pages/CreatorsProductEdition/sections/ProductMedia.js +138 -0
  20. package/dist/components/pages/CreatorsProductEdition/sections/RetailerMenu.js +162 -0
  21. package/dist/components/pages/CreatorsProductEdition/sections/ServiceActions.js +542 -0
  22. package/dist/components/pages/CreatorsProductEdition/sections/StatusChip.js +50 -0
  23. package/dist/components/pages/CreatorsProductEdition/sections/TabsBar.js +247 -0
  24. package/dist/components/pages/CreatorsProductEdition/sections/VariantsPanel.js +389 -0
  25. package/dist/components/pages/CreatorsProductEdition/sections/tokens.js +90 -0
  26. package/dist/components/pages/CreatorsProductEdition/stories/CreatorsProductEdition.stories.js +168 -0
  27. package/dist/components/pages/CreatorsProductEdition/stories/CreatorsProductEditionAPI.stories.js +74 -0
  28. package/dist/components/pages/CreatorsProductEdition/styles.js +46 -0
  29. package/dist/global-files/digital-assets/assetTypes.js +49 -12
  30. package/dist/global-files/digital-assets/uploadAssets.js +39 -16
  31. package/dist/global-files/digital-assets/useDigitalAssets.js +38 -25
  32. package/package.json +1 -1
  33. package/src/components/atoms/AsignationOption/index.js +1 -1
  34. package/src/components/atoms/AsignationOption/styles.js +9 -0
  35. package/src/components/molecules/GalleryAssetElement/styles.js +5 -1
  36. package/src/components/molecules/RetailerSelector/RetailerSelector.stories.js +15 -1
  37. package/src/components/molecules/RetailerSelector/index.js +8 -1
  38. package/src/components/molecules/RetailerSelectorv2/index.js +7 -1
  39. package/src/components/organisms/DigitalAssetsTray/DigitalAssetsTray.stories.js +67 -4
  40. package/src/components/organisms/DigitalAssetsTray/index.js +8 -4
  41. package/src/global-files/digital-assets/assetTypes.js +42 -10
  42. package/src/global-files/digital-assets/uploadAssets.js +38 -23
  43. package/src/global-files/digital-assets/useDigitalAssets.js +19 -8
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.CreatorsProductEdition = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
11
+
12
+ var _providerProductEdition = require("../RetailerProductEdition/context/provider-product-edition.context");
13
+
14
+ var _CreatorsProductEditionView = require("./CreatorsProductEditionView");
15
+
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+
18
+ /**
19
+ * Edición de producto de Creators, responsiva (celular, tablet y desktop).
20
+ *
21
+ * Reemplazo de `RetailerProductEdition` con los mismos props:
22
+ * `tabsSections`, `productSelected`, `user`, `token`, `location` y
23
+ * `enableDigitalAssets`. Comparte el contexto (reducer y guardados) con la vista
24
+ * original; la lógica del componente es una copia en
25
+ * `hooks/useCreatorsProductEdition.js`.
26
+ */
27
+ var CreatorsProductEdition = function CreatorsProductEdition(props) {
28
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_providerProductEdition.ProviderProductEditionProvider, {
29
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CreatorsProductEditionView.CreatorsProductEditionView, (0, _objectSpread2.default)({}, props))
30
+ });
31
+ };
32
+
33
+ exports.CreatorsProductEdition = CreatorsProductEdition;
@@ -0,0 +1,537 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.buildFixtures = void 0;
9
+
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
11
+
12
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
13
+
14
+ /*
15
+ Respuestas de la API para las historias de CreatorsProductEdition.
16
+
17
+ Capturadas de dev (producto 144814, orden 10421, versión 3) el 2026-09-28 y
18
+ recortadas: la lista de tomas de imagen se dejó en seis. Los nombres del
19
+ personal se reemplazaron por genéricos: esta librería se publica en npm.
20
+
21
+ Cada respuesta conserva la envoltura que devuelve su lambda —unas mandan
22
+ `{ statusCode, body: "<json>" }` y otras `{ data }` directo—, porque el código
23
+ de la vista depende de esa forma.
24
+ */
25
+ var ARTICLE_ID = 144814;
26
+ var VERSION = 3;
27
+ /** Envoltura de `integration: lambda`: el cuerpo viaja como cadena. */
28
+
29
+ var lambda = function lambda(body) {
30
+ return {
31
+ statusCode: 200,
32
+ headers: {
33
+ "Access-Control-Allow-Origin": "*"
34
+ },
35
+ body: JSON.stringify(body)
36
+ };
37
+ };
38
+
39
+ var RETAILERS = {
40
+ 36: {
41
+ id: 36,
42
+ name: "Oxxo",
43
+ country: "México",
44
+ id_region: 1,
45
+ is_active: 1,
46
+ active: 1
47
+ },
48
+ 38: {
49
+ id: 38,
50
+ name: "Del Sol",
51
+ country: "México",
52
+ id_region: 1,
53
+ is_active: 1,
54
+ active: 1
55
+ }
56
+ };
57
+
58
+ var comment = function comment(id, concept, message) {
59
+ return {
60
+ id: id,
61
+ user_id: 425,
62
+ article_id: ARTICLE_ID,
63
+ order_id: 10421,
64
+ message: message,
65
+ timestamp: "2025-11-15T21:12:00.000Z",
66
+ completed: 0,
67
+ version_id: VERSION,
68
+ concept: concept
69
+ };
70
+ };
71
+
72
+ var descriptionInputs = [{
73
+ id_version: VERSION,
74
+ id: 4592,
75
+ id_retailer: 38,
76
+ name: "Header Del Sol",
77
+ id_description_type: null,
78
+ description: "Encabezado: Nombre genérico del producto + Marca + Sub Marca (Opcional) + Modelo / Estilo / Tipo / Talla / Color / Capacidad / Tamaño / Edad Mínimo 40 Máximo 70 Caracteres",
79
+ min_words: null,
80
+ max_words: null,
81
+ min_chars: 40,
82
+ max_chars: 70,
83
+ type: "Alfanumérico",
84
+ active: 1,
85
+ required: true,
86
+ value: "Yoghurt Danone Frutas Selectas con trozos de fresa 120 g",
87
+ ai_generated: false,
88
+ isOverridden: false,
89
+ inheritable: true
90
+ }, {
91
+ id_version: VERSION,
92
+ id: 4593,
93
+ id_retailer: 38,
94
+ name: "Descripción Comercial del Producto Del Sol",
95
+ id_description_type: null,
96
+ description: "Descripción Comercial",
97
+ min_words: null,
98
+ max_words: null,
99
+ min_chars: null,
100
+ max_chars: 1200,
101
+ type: "Alfanumérico",
102
+ active: 1,
103
+ required: true,
104
+ value: "Yoghurt batido con trozos de fresa, ahora con más fruta y una textura más cremosa. Ideal para el desayuno o como colación.",
105
+ ai_generated: false,
106
+ isOverridden: false,
107
+ inheritable: true
108
+ }];
109
+
110
+ var service = function service(id_retailer, serviceName, status, task_user_group_id) {
111
+ return {
112
+ id_order: 10421,
113
+ id_retailer: id_retailer,
114
+ id_article: ARTICLE_ID,
115
+ service: serviceName,
116
+ quantity: 1,
117
+ price: 0,
118
+ id_user: 1989,
119
+ datasheet_common: null,
120
+ discount: null,
121
+ status: status,
122
+ task_user_group_id: task_user_group_id,
123
+ is_billing: 0,
124
+ last_modified: "2025-11-15T21:10:26.000Z",
125
+ is_active: 1,
126
+ deleted_by: null,
127
+ deleted_at: null,
128
+ final_version_id: null,
129
+ retailerToProvider: null,
130
+ is_retailer: 0,
131
+ retailersId: null
132
+ };
133
+ }; // Tomas de imagen: seis de las 36 que devuelve dev, con su orden por cadena.
134
+
135
+
136
+ var IMAGE_INPUTS = [{
137
+ id: 1,
138
+ name: "Central (frente comercial)",
139
+ required: 1
140
+ }, {
141
+ id: 11,
142
+ name: "Hero image",
143
+ required: 0
144
+ }, {
145
+ id: 3,
146
+ name: "Trasera (back)",
147
+ required: 0
148
+ }, {
149
+ id: 2,
150
+ name: "Fuera del empaque / Abierto interior",
151
+ required: 0
152
+ }, {
153
+ id: 12,
154
+ name: "Tabla nutrimental / ingredientes",
155
+ required: 0
156
+ }, {
157
+ id: 15,
158
+ name: "Zoom",
159
+ required: 0
160
+ }].map(function (input) {
161
+ return (0, _objectSpread2.default)({
162
+ vertical_dpi: null,
163
+ horizontal_dpi: null,
164
+ vertical_px: null,
165
+ horizontal_px: null
166
+ }, input);
167
+ });
168
+
169
+ var imageValue = function imageValue(id, id_image, src, size) {
170
+ return {
171
+ id: id,
172
+ status: null,
173
+ id_image: id_image,
174
+ packing_type: null,
175
+ image_type: null,
176
+ id_article: ARTICLE_ID,
177
+ src: "id-".concat(ARTICLE_ID, "/").concat(VERSION, "/").concat(src),
178
+ timestamp: "2026-02-11T19:12:38.000Z",
179
+ id_version: VERSION,
180
+ width: size,
181
+ height: size,
182
+ scene_type: null,
183
+ image_shot_type: null,
184
+ last_modified: "2026-08-25T14:31:27.000Z",
185
+ has_leyend: 0,
186
+ onb_status: 1,
187
+ onb_comments: ""
188
+ };
189
+ };
190
+
191
+ var upcAttribute = {
192
+ id: 683,
193
+ name: "UPC",
194
+ is_datasheet: 1,
195
+ is_new_attribute: 0,
196
+ last_modified_by: 275,
197
+ created_at: "2026-07-01T13:56:44.000Z",
198
+ updated_at: "2026-07-01T13:56:44.000Z",
199
+ is_active: 1,
200
+ value: "400080029609"
201
+ };
202
+
203
+ var users = function users(role, count) {
204
+ return {
205
+ data: Array.from({
206
+ length: count
207
+ }, function (_, i) {
208
+ return {
209
+ name: "".concat(role, " ").concat(i + 1),
210
+ last_name: null,
211
+ id_user: 9000 + i
212
+ };
213
+ })
214
+ };
215
+ };
216
+
217
+ var member = function member(articleId, name, upc) {
218
+ var isCurrent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
219
+ return {
220
+ articleId: articleId,
221
+ name: name,
222
+ upc: upc,
223
+ isCurrent: isCurrent
224
+ };
225
+ };
226
+
227
+ var buildFamily = function buildFamily(familia) {
228
+ if (familia === "padre") {
229
+ return {
230
+ articleId: ARTICLE_ID,
231
+ isVariant: false,
232
+ parent: null,
233
+ variants: [member(144821, "Yoghurt Frutas Selectas durazno 120 g", "400080029630"), member(144822, "Yoghurt Frutas Selectas mango 120 g con un nombre bastante largo", "400080029647")]
234
+ };
235
+ }
236
+
237
+ if (familia === "hijo") {
238
+ return {
239
+ articleId: ARTICLE_ID,
240
+ isVariant: true,
241
+ parent: member(144800, "Yoghurt Frutas Selectas (línea)", "400080029500"),
242
+ variants: [member(ARTICLE_ID, "Producto 300080", "400080029609", true), member(144821, "Yoghurt Frutas Selectas durazno 120 g", "400080029630")]
243
+ };
244
+ }
245
+
246
+ return {
247
+ articleId: ARTICLE_ID,
248
+ isVariant: false,
249
+ parent: null,
250
+ variants: []
251
+ };
252
+ };
253
+ /**
254
+ * Crea las respuestas.
255
+ * - `images: false` simula un producto sin imágenes.
256
+ * - `delSolStatus` cambia el estatus de los tres servicios de Del Sol; con
257
+ * "AC" el auditor asignado puede validar o rechazar.
258
+ * - `familia`: "padre" (este producto con dos hijos) o "hijo" (este producto
259
+ * es hijo de otro, con un hermano).
260
+ * - `grupo`: el producto está en un grupo de variantes con otros dos.
261
+ */
262
+
263
+
264
+ var buildFixtures = function buildFixtures() {
265
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
266
+ _ref$images = _ref.images,
267
+ images = _ref$images === void 0 ? true : _ref$images,
268
+ delSolStatus = _ref.delSolStatus,
269
+ familia = _ref.familia,
270
+ _ref$grupo = _ref.grupo,
271
+ grupo = _ref$grupo === void 0 ? false : _ref$grupo;
272
+
273
+ return {
274
+ comments: {
275
+ description: lambda({
276
+ message: "OK",
277
+ data: [comment(15886, "description", "Revisar la longitud del header.")],
278
+ order: null
279
+ }),
280
+ datasheet: lambda({
281
+ message: "OK",
282
+ data: [comment(15885, "datasheet", "Rechazo")],
283
+ order: null
284
+ }),
285
+ images: lambda({
286
+ message: "OK",
287
+ data: [],
288
+ order: null
289
+ })
290
+ },
291
+ datasheets: lambda({
292
+ message: "ok",
293
+ data: {
294
+ 36: {
295
+ retailer: RETAILERS[36],
296
+ data: {}
297
+ },
298
+ 38: {
299
+ retailer: RETAILERS[38],
300
+ data: {
301
+ 6: {
302
+ groupId: "6",
303
+ dataGroup: "Información Básica del Producto",
304
+ inputs: ["683_38"]
305
+ }
306
+ }
307
+ },
308
+ inputs: {
309
+ "683_38": {
310
+ id: 683,
311
+ name: "UPC",
312
+ min_chars: null,
313
+ max_chars: 14,
314
+ type: "Numérico",
315
+ id_group: 6,
316
+ required: true,
317
+ description: "Código de Barras del Producto, GTIN, UPC",
318
+ option_list: null,
319
+ value: "400080029609",
320
+ onb_status: 1,
321
+ onb_comments: null,
322
+ ai_generated: 0,
323
+ isOverridden: false,
324
+ inheritable: false,
325
+ active: 1,
326
+ commercial_model: null
327
+ }
328
+ },
329
+ variant: {
330
+ isVariant: false,
331
+ parentArticleId: null,
332
+ parent: null
333
+ }
334
+ }
335
+ }),
336
+ descriptions: lambda({
337
+ message: "OK",
338
+ data: [(0, _objectSpread2.default)((0, _objectSpread2.default)({}, RETAILERS[36]), {}, {
339
+ inputs: []
340
+ }), (0, _objectSpread2.default)((0, _objectSpread2.default)({}, RETAILERS[38]), {}, {
341
+ inputs: descriptionInputs
342
+ })],
343
+ inputsGeneral: Object.fromEntries(descriptionInputs.map(function (input) {
344
+ return [input.id, input];
345
+ })),
346
+ variant: {
347
+ isVariant: false,
348
+ parentArticleId: null,
349
+ parent: null
350
+ }
351
+ }),
352
+ users: {
353
+ 4: {
354
+ data: [{
355
+ name: "Coordinador Textos",
356
+ last_name: null,
357
+ id_user: 423
358
+ }]
359
+ },
360
+ 5: {
361
+ data: [{
362
+ name: "Coordinador Imágenes",
363
+ last_name: null,
364
+ id_user: 424
365
+ }]
366
+ },
367
+ 6: {
368
+ data: [{
369
+ name: "Auditor QA",
370
+ last_name: null,
371
+ id_user: 425
372
+ }].concat((0, _toConsumableArray2.default)(users("Auditor", 2).data))
373
+ },
374
+ 7: {
375
+ data: [{
376
+ name: "Especialista Textos",
377
+ last_name: null,
378
+ id_user: 426
379
+ }].concat((0, _toConsumableArray2.default)(users("Especialista textos", 3).data))
380
+ },
381
+ 8: {
382
+ data: [{
383
+ name: "Especialista Edición",
384
+ last_name: null,
385
+ id_user: 427
386
+ }].concat((0, _toConsumableArray2.default)(users("Especialista edición", 3).data))
387
+ }
388
+ },
389
+ family: lambda(buildFamily(familia)),
390
+ group: lambda(grupo ? {
391
+ articleId: ARTICLE_ID,
392
+ group: "YOG-FRESA",
393
+ members: [member(ARTICLE_ID, "Producto 300080", "400080029609", true), member(144815, "Yoghurt Frutas Selectas fresa 4 pack", "400080029616"), member(144816, "Yoghurt Frutas Selectas fresa 1 kg", "400080029623")]
394
+ } : {
395
+ articleId: ARTICLE_ID,
396
+ group: null,
397
+ members: []
398
+ }),
399
+ services: lambda({
400
+ message: "OK",
401
+ data: [service(36, "datasheet", "RA/AS", 2), service(36, "description", "RA/AS", 2), service(36, "images", "AA", 5), service(38, "datasheet", delSolStatus !== null && delSolStatus !== void 0 ? delSolStatus : "RA/AS", 2), service(38, "description", delSolStatus !== null && delSolStatus !== void 0 ? delSolStatus : "RA/AS", 2), service(38, "images", delSolStatus !== null && delSolStatus !== void 0 ? delSolStatus : "AA", 5)]
402
+ }),
403
+ percentages: lambda([{
404
+ id_article: ARTICLE_ID,
405
+ version: VERSION,
406
+ relations: [{
407
+ id_retailer: 38,
408
+ id_category: 3513,
409
+ datasheet: {
410
+ required: 100,
411
+ general: 100
412
+ },
413
+ descriptions: {
414
+ required: 100,
415
+ general: 100
416
+ },
417
+ images: {
418
+ required: 100,
419
+ general: 80.01,
420
+ details: {
421
+ mandatoryShots: {
422
+ total: 1,
423
+ completed: 1,
424
+ percentage: 100
425
+ },
426
+ optionalShots: {
427
+ total: 5,
428
+ completed: 2,
429
+ percentage: 40
430
+ },
431
+ namingAttributes: {
432
+ total: 1,
433
+ completed: 1,
434
+ percentage: 100
435
+ }
436
+ }
437
+ },
438
+ percentagesGeneral: {
439
+ required: 100,
440
+ general: 69.43
441
+ }
442
+ }],
443
+ summary: {
444
+ totalRelations: 1,
445
+ averageRequired: 100,
446
+ averageGeneral: 69.43
447
+ }
448
+ }]),
449
+ images: lambda({
450
+ message: "OK",
451
+ data: {
452
+ retailers: [(0, _objectSpread2.default)((0, _objectSpread2.default)({}, RETAILERS[38]), {}, {
453
+ min: 2,
454
+ max: 5
455
+ })],
456
+ attrForImgs: {
457
+ 38: [upcAttribute],
458
+ general: [upcAttribute]
459
+ },
460
+ imagePackagingType: [{
461
+ id: 1,
462
+ name: "Embalaje adicional",
463
+ deliverable_value: "0",
464
+ status: 1
465
+ }, {
466
+ id: 2,
467
+ name: "En paquete",
468
+ deliverable_value: "1",
469
+ status: 1
470
+ }, {
471
+ id: 3,
472
+ name: "Producto expuesto",
473
+ deliverable_value: "2",
474
+ status: 1
475
+ }, {
476
+ id: 4,
477
+ name: "Embalaje multiforme",
478
+ deliverable_value: "3",
479
+ status: 1
480
+ }, {
481
+ id: 5,
482
+ name: "Si no es una imagen / no corresponde",
483
+ deliverable_value: "X",
484
+ status: 1
485
+ }],
486
+ imageType: [{
487
+ id: 1,
488
+ name: "Fotografía del producto",
489
+ deliverable_value: "A",
490
+ status: 1
491
+ }, {
492
+ id: 2,
493
+ name: "Render",
494
+ deliverable_value: "R",
495
+ status: 1
496
+ }],
497
+ imageShotType: [{
498
+ id: 1,
499
+ type_shot: "SKU",
500
+ status: 1
501
+ }, {
502
+ id: 2,
503
+ type_shot: "SKU.1",
504
+ status: 1
505
+ }, {
506
+ id: 3,
507
+ type_shot: "SKU.2",
508
+ status: 1
509
+ }],
510
+ inputs: IMAGE_INPUTS,
511
+ retailerMandatories: [[{
512
+ id_retailer: 38,
513
+ id_category: 3506,
514
+ id_image: 1,
515
+ order: 1,
516
+ priority: 1,
517
+ mandatory: 1
518
+ }]],
519
+ inputsByRetailer: [IMAGE_INPUTS.map(function (input, index) {
520
+ return {
521
+ id_retailer: 38,
522
+ id_category: 3513,
523
+ id_image: input.id,
524
+ order: index + 1,
525
+ priority: 1,
526
+ mandatory: input.required
527
+ };
528
+ })],
529
+ values: images ? [imageValue(1070155, 1, "1-4f5e3461-395f-4a66-b676-c0a4fb9a3069.jpg", 250), imageValue(1070366, 11, "11-b522d019-e845-4921-b28f-5ce4e3c135ba.jpg", 3000), imageValue(1070367, 3, "3-37a15352-c6e9-47db-a0fa-ca277c571b1c.jpg", 3000)] : [],
530
+ assets: []
531
+ },
532
+ retailerWithoutInputs: []
533
+ })
534
+ };
535
+ };
536
+
537
+ exports.buildFixtures = buildFixtures;