contentoh-components-library 21.6.60 → 21.6.61

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 (76) hide show
  1. package/dist/components/organisms/ServicesNavigation/ServiceToolbar.js +210 -0
  2. package/dist/components/organisms/ServicesNavigation/ServicesNavigation.stories.js +138 -0
  3. package/dist/components/organisms/ServicesNavigation/ServicesRail.js +705 -0
  4. package/dist/components/organisms/ServicesNavigation/catalog.js +505 -0
  5. package/dist/components/organisms/ServicesNavigation/index.js +337 -0
  6. package/dist/components/organisms/ServicesNavigation/model.js +167 -0
  7. package/dist/components/organisms/ServicesNavigation/ui.js +371 -0
  8. package/dist/components/organisms/ServicesNavigation/views.js +1237 -0
  9. package/dist/components/organisms/ServicesWorkspace/AssigneePicker.js +459 -0
  10. package/dist/components/organisms/ServicesWorkspace/ServicesWorkspace.stories.js +119 -0
  11. package/dist/components/organisms/ServicesWorkspace/demo.js +137 -0
  12. package/dist/components/organisms/ServicesWorkspace/index.js +813 -0
  13. package/dist/components/organisms/ServicesWorkspace/servicesModel.js +351 -0
  14. package/dist/components/organisms/ServicesWorkspace/tooltipStyles.js +37 -0
  15. package/dist/components/pages/CreatorsProductEdition/mocks/mockApi.js +40 -0
  16. package/dist/components/pages/CreatorsProductEdition/mocks/productServices.fixtures.js +387 -0
  17. package/dist/components/pages/CreatorsProductEdition/sections/StatusChip.js +13 -4
  18. package/dist/components/pages/ProductEdition/ProductEdition.stories.js +148 -0
  19. package/dist/components/pages/ProductEdition/ProductEditionView.js +1355 -0
  20. package/dist/components/pages/ProductEdition/ServiceHeader.js +142 -0
  21. package/dist/components/pages/ProductEdition/api.js +256 -0
  22. package/dist/components/pages/ProductEdition/index.js +37 -0
  23. package/dist/components/pages/ProductEdition/permissions.js +200 -0
  24. package/dist/components/pages/ProductEdition/permissions.test.js +320 -0
  25. package/dist/components/pages/ProductEdition/sections/CatalogServicePanel.js +237 -0
  26. package/dist/components/pages/ProductEdition/sections/EditionTopBar.js +174 -0
  27. package/dist/components/pages/ProductEdition/sections/ImagePanel.js +440 -0
  28. package/dist/components/pages/ProductEdition/sections/ServiceTeam.js +275 -0
  29. package/dist/components/pages/ProductEdition/sections/ServiceTools.js +186 -0
  30. package/dist/components/pages/ProductEdition/services.js +233 -0
  31. package/dist/components/pages/ProductEdition/services.test.js +195 -0
  32. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +15 -2
  33. package/dist/components/pages/RetailerProductEdition/index.js +57 -40
  34. package/dist/components/pages/RetailerProductEdition/utils.js +6 -2
  35. package/dist/index.js +13 -0
  36. package/package.json +1 -1
  37. package/src/components/organisms/ServicesNavigation/ServiceToolbar.jsx +143 -0
  38. package/src/components/organisms/ServicesNavigation/ServicesNavigation.stories.js +101 -0
  39. package/src/components/organisms/ServicesNavigation/ServicesRail.jsx +591 -0
  40. package/src/components/organisms/ServicesNavigation/catalog.js +180 -0
  41. package/src/components/organisms/ServicesNavigation/index.jsx +232 -0
  42. package/src/components/organisms/ServicesNavigation/model.js +85 -0
  43. package/src/components/organisms/ServicesNavigation/ui.jsx +229 -0
  44. package/src/components/organisms/ServicesNavigation/views.jsx +705 -0
  45. package/src/components/organisms/ServicesWorkspace/AssigneePicker.js +348 -0
  46. package/src/components/organisms/ServicesWorkspace/ServicesWorkspace.stories.js +61 -0
  47. package/src/components/organisms/ServicesWorkspace/demo.js +58 -0
  48. package/src/components/organisms/ServicesWorkspace/index.js +556 -0
  49. package/src/components/organisms/ServicesWorkspace/servicesModel.js +203 -0
  50. package/src/components/organisms/ServicesWorkspace/tooltipStyles.js +27 -0
  51. package/src/components/pages/CreatorsProductEdition/mocks/mockApi.js +17 -0
  52. package/src/components/pages/CreatorsProductEdition/mocks/productServices.fixtures.js +175 -0
  53. package/src/components/pages/CreatorsProductEdition/sections/StatusChip.jsx +8 -4
  54. package/src/components/pages/ProductEdition/ProductEdition.stories.js +106 -0
  55. package/src/components/pages/ProductEdition/ProductEditionView.jsx +1142 -0
  56. package/src/components/pages/ProductEdition/ServiceHeader.jsx +104 -0
  57. package/src/components/pages/ProductEdition/api.js +84 -0
  58. package/src/components/pages/ProductEdition/index.js +21 -0
  59. package/src/components/pages/ProductEdition/permissions.js +128 -0
  60. package/src/components/pages/ProductEdition/permissions.test.js +249 -0
  61. package/src/components/pages/ProductEdition/sections/CatalogServicePanel.jsx +123 -0
  62. package/src/components/pages/ProductEdition/sections/EditionTopBar.jsx +134 -0
  63. package/src/components/pages/ProductEdition/sections/ImagePanel.jsx +342 -0
  64. package/src/components/pages/ProductEdition/sections/ServiceTeam.jsx +184 -0
  65. package/src/components/pages/ProductEdition/sections/ServiceTools.jsx +134 -0
  66. package/src/components/pages/ProductEdition/services.js +187 -0
  67. package/src/components/pages/ProductEdition/services.test.js +88 -0
  68. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +12 -0
  69. package/src/components/pages/RetailerProductEdition/index.js +28 -3
  70. package/src/components/pages/RetailerProductEdition/utils.js +5 -0
  71. package/src/index.js +1 -0
  72. package/.claude/settings.local.json +0 -7
  73. package/dist/ai/prompts/attribute.prompt.js +0 -28
  74. package/dist/ai/prompts/description.prompt.js +0 -33
  75. package/dist/ai/schemas/attribute.schema.js +0 -35
  76. package/dist/ai/schemas/description.schema.js +0 -27
@@ -0,0 +1,387 @@
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.buildProductServices = exports.assignablesFor = exports.applyProductServicesChange = exports.PEOPLE = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
11
+
12
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
13
+
14
+ var _excluded = ["legacy", "flow", "retailers", "roles", "assignees", "actions"];
15
+
16
+ /*
17
+ GET /product-services para las historias de la edición unificada
18
+ (ProductEdition): el mismo producto de api.fixtures.js (144814, orden 10421)
19
+ con sus tres servicios de siempre en Oxxo (36) y Del Sol (38), más tres del
20
+ catálogo: A+ (flujo completo, por cadena), Compra de producto en tienda
21
+ (casilla) y Levantamiento y recolección (avance), los dos últimos por
22
+ producto (cadena 0). Nombres, colores e íconos como en cat_service y
23
+ cat_status (docs/sql/catalog 002, 003 y 006 del backend).
24
+
25
+ `applyProductServicesChange` simula PUT /product-services/{action} sobre una
26
+ copia, para que la historia muestre el cambio al volver a pedir la lista.
27
+ */
28
+ var ARTICLE_ID = 144814;
29
+ var ORDER_ID = 10421;
30
+ var STATUS = {
31
+ PA: {
32
+ status_name: "PA",
33
+ display_name: "Por asignar",
34
+ color: "#E57432",
35
+ flow_name: "workflow",
36
+ is_final: false,
37
+ progress_percent: null
38
+ },
39
+ AA: {
40
+ status_name: "AA",
41
+ display_name: "Aprobado auditor",
42
+ color: "#18A0FB",
43
+ flow_name: "workflow",
44
+ is_final: false,
45
+ progress_percent: null
46
+ },
47
+ "RA/AS": {
48
+ status_name: "RA/AS",
49
+ display_name: "Rechazado auditor / Asignado",
50
+ color: "#D74DED",
51
+ flow_name: "workflow",
52
+ is_final: false,
53
+ progress_percent: null
54
+ },
55
+ PE: {
56
+ status_name: "PE",
57
+ display_name: "Pendiente",
58
+ color: "#E57432",
59
+ flow_name: "checkbox",
60
+ is_final: false,
61
+ progress_percent: 0
62
+ },
63
+ HE: {
64
+ status_name: "HE",
65
+ display_name: "Hecho",
66
+ color: "#71DE56",
67
+ flow_name: "checkbox",
68
+ is_final: true,
69
+ progress_percent: 100
70
+ },
71
+ SE: {
72
+ status_name: "SE",
73
+ display_name: "Sin empezar",
74
+ color: "#E57432",
75
+ flow_name: "progress",
76
+ is_final: false,
77
+ progress_percent: 0
78
+ },
79
+ EP: {
80
+ status_name: "EP",
81
+ display_name: "En proceso",
82
+ color: "#ED9A4D",
83
+ flow_name: "progress",
84
+ is_final: false,
85
+ progress_percent: 50
86
+ },
87
+ TE: {
88
+ status_name: "TE",
89
+ display_name: "Terminado",
90
+ color: "#71DE56",
91
+ flow_name: "progress",
92
+ is_final: true,
93
+ progress_percent: 100
94
+ }
95
+ };
96
+ var OPTIONS = {
97
+ checkbox: ["PE", "HE"],
98
+ progress: ["SE", "EP", "TE"]
99
+ };
100
+ var WEIGHT = {
101
+ PA: 1,
102
+ "RA/AS": 7,
103
+ AA: 10,
104
+ PE: 2,
105
+ SE: 2,
106
+ EP: 3,
107
+ HE: 99,
108
+ TE: 99
109
+ };
110
+ var PEOPLE = {
111
+ 423: {
112
+ id_user: 423,
113
+ name: "Coordinador Textos",
114
+ last_name: null,
115
+ id_role: 4
116
+ },
117
+ 424: {
118
+ id_user: 424,
119
+ name: "Coordinador Imágenes",
120
+ last_name: null,
121
+ id_role: 5
122
+ },
123
+ 425: {
124
+ id_user: 425,
125
+ name: "Auditor QA",
126
+ last_name: null,
127
+ id_role: 6
128
+ },
129
+ 426: {
130
+ id_user: 426,
131
+ name: "Especialista Textos",
132
+ last_name: null,
133
+ id_role: 7
134
+ },
135
+ 427: {
136
+ id_user: 427,
137
+ name: "Especialista Edición",
138
+ last_name: null,
139
+ id_role: 8
140
+ }
141
+ };
142
+ exports.PEOPLE = PEOPLE;
143
+ var RETAILER_NAMES = {
144
+ 0: "Sin cadena",
145
+ 36: "Oxxo",
146
+ 38: "Del Sol"
147
+ };
148
+
149
+ var retailer = function retailer(id, statusName) {
150
+ var _STATUS$statusName;
151
+
152
+ return {
153
+ id_retailer: id,
154
+ retailer_name: RETAILER_NAMES[id],
155
+ quantity: 1,
156
+ status: (_STATUS$statusName = STATUS[statusName]) !== null && _STATUS$statusName !== void 0 ? _STATUS$statusName : null
157
+ };
158
+ };
159
+
160
+ var generalOf = function generalOf(retailers) {
161
+ return retailers.filter(function (item) {
162
+ return item.status;
163
+ }).reduce(function (low, item) {
164
+ return !low || WEIGHT[item.status.status_name] < WEIGHT[low.status_name] ? item.status : low;
165
+ }, null);
166
+ };
167
+
168
+ var service = function service(_ref) {
169
+ var _OPTIONS$flow$map, _OPTIONS$flow;
170
+
171
+ var _ref$legacy = _ref.legacy,
172
+ legacy = _ref$legacy === void 0 ? false : _ref$legacy,
173
+ flow = _ref.flow,
174
+ retailers = _ref.retailers,
175
+ roles = _ref.roles,
176
+ assignees = _ref.assignees,
177
+ actions = _ref.actions,
178
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
179
+ return (0, _objectSpread2.default)({
180
+ icon_name: null,
181
+ deliverable_type: null,
182
+ has_workflow: flow !== "flag",
183
+ requires_qa: roles.includes("auditor"),
184
+ per_retailer: !retailers.some(function (item) {
185
+ return item.id_retailer === 0;
186
+ }),
187
+ is_legacy: legacy,
188
+ status_flow: {
189
+ flow_name: flow,
190
+ flow_type: flow === "workflow" || flow === "flag" ? flow : "simple"
191
+ },
192
+ status: generalOf(retailers),
193
+ status_options: (_OPTIONS$flow$map = (_OPTIONS$flow = OPTIONS[flow]) === null || _OPTIONS$flow === void 0 ? void 0 : _OPTIONS$flow.map(function (name) {
194
+ return STATUS[name];
195
+ })) !== null && _OPTIONS$flow$map !== void 0 ? _OPTIONS$flow$map : [],
196
+ retailers: retailers,
197
+ roles: roles,
198
+ assignees: (0, _objectSpread2.default)({
199
+ especialist: null,
200
+ facilitator: null,
201
+ auditor: null
202
+ }, assignees),
203
+ actions: actions
204
+ }, rest);
205
+ };
206
+
207
+ var category = function category(category_name, display_name) {
208
+ return {
209
+ category_name: category_name,
210
+ display_name: display_name
211
+ };
212
+ };
213
+ /** Respuesta de GET /product-services (el cuerpo, sin la envoltura de la lambda). */
214
+
215
+
216
+ var buildProductServices = function buildProductServices() {
217
+ var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
218
+ delSolStatus = _ref2.delSolStatus;
219
+
220
+ return {
221
+ article_id: ARTICLE_ID,
222
+ order_id: ORDER_ID,
223
+ auditor: PEOPLE[425],
224
+ services: [service({
225
+ service_name: "datasheet",
226
+ display_name: "Ficha técnica",
227
+ icon_name: "datasheet",
228
+ category: category("texts", "Textos"),
229
+ legacy: true,
230
+ flow: "workflow",
231
+ retailers: [retailer(36, "RA/AS"), retailer(38, delSolStatus !== null && delSolStatus !== void 0 ? delSolStatus : "RA/AS")],
232
+ roles: ["especialist", "facilitator", "auditor"],
233
+ assignees: {
234
+ especialist: PEOPLE[426],
235
+ facilitator: PEOPLE[423],
236
+ auditor: PEOPLE[425]
237
+ },
238
+ actions: {
239
+ set_status: false,
240
+ assign: false
241
+ }
242
+ }), service({
243
+ service_name: "description",
244
+ display_name: "Descripción",
245
+ icon_name: "description",
246
+ category: category("texts", "Textos"),
247
+ legacy: true,
248
+ flow: "workflow",
249
+ retailers: [retailer(36, "RA/AS"), retailer(38, delSolStatus !== null && delSolStatus !== void 0 ? delSolStatus : "RA/AS")],
250
+ roles: ["especialist", "facilitator", "auditor"],
251
+ assignees: {
252
+ especialist: PEOPLE[426],
253
+ facilitator: PEOPLE[423],
254
+ auditor: PEOPLE[425]
255
+ },
256
+ actions: {
257
+ set_status: false,
258
+ assign: false
259
+ }
260
+ }), service({
261
+ service_name: "images",
262
+ display_name: "Imágenes",
263
+ icon_name: "images",
264
+ category: category("images", "Imágenes"),
265
+ legacy: true,
266
+ flow: "workflow",
267
+ retailers: [retailer(36, "AA"), retailer(38, delSolStatus !== null && delSolStatus !== void 0 ? delSolStatus : "AA")],
268
+ roles: ["especialist", "facilitator", "auditor"],
269
+ assignees: {
270
+ especialist: PEOPLE[427],
271
+ facilitator: PEOPLE[424],
272
+ auditor: PEOPLE[425]
273
+ },
274
+ actions: {
275
+ set_status: false,
276
+ assign: false
277
+ }
278
+ }), service({
279
+ service_name: "aplusPlatinum",
280
+ display_name: "A+ / Platinum SKU",
281
+ icon_name: "aplus",
282
+ category: category("media", "Multimedia y diseño"),
283
+ flow: "workflow",
284
+ retailers: [retailer(36, "PA"), retailer(38, "PA")],
285
+ roles: ["especialist", "facilitator", "auditor"],
286
+ assignees: {
287
+ auditor: PEOPLE[425]
288
+ },
289
+ actions: {
290
+ set_status: false,
291
+ assign: true
292
+ }
293
+ }), service({
294
+ service_name: "productPurchase",
295
+ display_name: "Compra de producto en tienda",
296
+ icon_name: "purchase",
297
+ category: category("logistics", "Logística"),
298
+ flow: "checkbox",
299
+ retailers: [retailer(0, "PE")],
300
+ roles: ["especialist"],
301
+ assignees: {
302
+ especialist: PEOPLE[427]
303
+ },
304
+ actions: {
305
+ set_status: true,
306
+ assign: true
307
+ }
308
+ }), service({
309
+ service_name: "productPickup",
310
+ display_name: "Levantamiento y recolección",
311
+ icon_name: "pickup",
312
+ category: category("logistics", "Logística"),
313
+ flow: "progress",
314
+ retailers: [retailer(0, "SE")],
315
+ roles: ["especialist"],
316
+ assignees: {},
317
+ actions: {
318
+ set_status: true,
319
+ assign: true
320
+ }
321
+ })]
322
+ };
323
+ };
324
+ /** Personas que se pueden asignar (GET /service-catalog?view=assignables). */
325
+
326
+
327
+ exports.buildProductServices = buildProductServices;
328
+
329
+ var assignablesFor = function assignablesFor(role) {
330
+ return Object.values(PEOPLE).filter(function (person) {
331
+ return (role === "facilitator" ? [4, 5] : [7, 8]).includes(person.id_role);
332
+ }).map(function (person) {
333
+ return {
334
+ id_user: person.id_user,
335
+ name: person.name,
336
+ email: null,
337
+ id_role: person.id_role
338
+ };
339
+ });
340
+ };
341
+ /** Aplica PUT /product-services/{action} sobre `body` (se modifica en su lugar). */
342
+
343
+
344
+ exports.assignablesFor = assignablesFor;
345
+
346
+ var applyProductServicesChange = function applyProductServicesChange(body, action, data) {
347
+ var target = body.services.find(function (item) {
348
+ return item.service_name === (data === null || data === void 0 ? void 0 : data.serviceName);
349
+ });
350
+ if (!target) return {
351
+ statusCode: 404,
352
+ message: "El producto no tiene ese servicio en esta orden."
353
+ };
354
+
355
+ if (action === "set-status") {
356
+ var status = STATUS[data.statusName];
357
+ if (!status) return {
358
+ statusCode: 400,
359
+ message: "Estatus no válido."
360
+ };
361
+ target.retailers.forEach(function (item) {
362
+ if (!data.retailerIds || data.retailerIds.includes(item.id_retailer)) item.status = status;
363
+ });
364
+ target.status = generalOf(target.retailers);
365
+ return {
366
+ statusCode: 200
367
+ };
368
+ }
369
+
370
+ if (action === "assign") {
371
+ var _PEOPLE$data$userId;
372
+
373
+ target.assignees[data.role] = data.userId ? (_PEOPLE$data$userId = PEOPLE[data.userId]) !== null && _PEOPLE$data$userId !== void 0 ? _PEOPLE$data$userId : {
374
+ id_user: data.userId
375
+ } : null;
376
+ return {
377
+ statusCode: 200
378
+ };
379
+ }
380
+
381
+ return {
382
+ statusCode: 400,
383
+ message: "Acci\xF3n no v\xE1lida: ".concat(action, ".")
384
+ };
385
+ };
386
+
387
+ exports.applyProductServicesChange = applyProductServicesChange;
@@ -15,19 +15,28 @@ var _jsxRuntime = require("react/jsx-runtime");
15
15
  * Etiqueta de estatus ("RA/AS", "AA"...). Mismo color y tamaño que
16
16
  * `atoms/Status`; el nombre completo va en el tooltip. `oval` es la variante
17
17
  * redondeada de la barra de pestañas.
18
+ *
19
+ * `label`, `color` y `title` (opcionales) reemplazan el texto, el color y el
20
+ * tooltip: los estatus de los flujos simples del catálogo (Pendiente, Hecho…)
21
+ * traen los suyos desde el backend.
18
22
  */
19
23
  var StatusChip = function StatusChip(_ref) {
24
+ var _ref2;
25
+
20
26
  var status = _ref.status,
21
27
  _ref$oval = _ref.oval,
22
- oval = _ref$oval === void 0 ? false : _ref$oval;
23
- var label = status !== null && status !== void 0 ? status : "NS";
28
+ oval = _ref$oval === void 0 ? false : _ref$oval,
29
+ labelProp = _ref.label,
30
+ color = _ref.color,
31
+ title = _ref.title;
32
+ var label = (_ref2 = labelProp !== null && labelProp !== void 0 ? labelProp : status) !== null && _ref2 !== void 0 ? _ref2 : "NS";
24
33
  var chip = /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Chip, {
25
34
  label: label,
26
35
  size: "small",
27
36
  sx: {
28
37
  height: 20,
29
38
  borderRadius: oval ? "10px" : "3px",
30
- backgroundColor: (0, _tokens.statusColor)(status),
39
+ backgroundColor: color !== null && color !== void 0 ? color : (0, _tokens.statusColor)(status),
31
40
  color: _tokens.COLORS.white,
32
41
  fontFamily: _tokens.FONTS.Lato,
33
42
  fontSize: 12,
@@ -38,7 +47,7 @@ var StatusChip = function StatusChip(_ref) {
38
47
  }
39
48
  }
40
49
  });
41
- var name = (0, _tokens.statusName)(status);
50
+ var name = title !== null && title !== void 0 ? title : (0, _tokens.statusName)(status);
42
51
  return name ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
43
52
  title: name,
44
53
  arrow: true,
@@ -0,0 +1,148 @@
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.default = exports.TodosLosServicios = exports.EspecialistaTextos = exports.EspecialistaImagenesCelular = exports.EspecialistaImagenes = exports.ConServiciosDeEjemplo = exports.AuditorQA = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
11
+
12
+ var _index = require("./index");
13
+
14
+ var _mockApi = require("../CreatorsProductEdition/mocks/mockApi");
15
+
16
+ var _catalog = require("../../organisms/ServicesNavigation/catalog");
17
+
18
+ var _ImageEditor = require("../RetailerProductEdition/stories/ImageEditor.stories");
19
+
20
+ var _TextEditor = require("../RetailerProductEdition/stories/TextEditor.stories");
21
+
22
+ var _Auditor = require("../RetailerProductEdition/stories/Auditor.stories");
23
+
24
+ var _jsxRuntime = require("react/jsx-runtime");
25
+
26
+ /*
27
+ Edición de producto unificada con datos locales: no le pega a ninguna API
28
+ (la simula `CreatorsProductEdition/mocks`). Guardar, aprobar o rechazar se
29
+ acepta sin hacer nada y queda en la consola como `[mock API]`.
30
+
31
+ El producto y los usuarios son los mismos de las historias de
32
+ CreatorsProductEdition, para comparar las dos pantallas con lo mismo.
33
+ */
34
+ var _default = {
35
+ title: "Components/pages/ProductEdition",
36
+ component: _index.ProductEdition,
37
+ decorators: [(0, _mockApi.withMockApi)()],
38
+ parameters: {
39
+ layout: "fullscreen"
40
+ }
41
+ }; // Como en la app: la pantalla vive en una caja de altura fija.
42
+
43
+ exports.default = _default;
44
+
45
+ var Template = function Template(args) {
46
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
47
+ style: {
48
+ height: "100vh",
49
+ display: "flex",
50
+ overflow: "hidden"
51
+ },
52
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ProductEdition, (0, _objectSpread2.default)({}, args))
53
+ });
54
+ };
55
+
56
+ var base = {
57
+ app: "creators",
58
+ token: _ImageEditor.ImageEditor.args.token,
59
+ productSelected: _ImageEditor.ImageEditor.args.productSelected,
60
+ enableDigitalAssets: true
61
+ };
62
+ var TODAS_LAS_PESTAÑAS = {
63
+ Descripción: true,
64
+ "Ficha técnica": true,
65
+ Imágenes: true
66
+ };
67
+ /** Servicios del catálogo que todavía no tienen editor (vista de muestra). */
68
+
69
+ var SERVICIOS_DE_EJEMPLO = [{
70
+ service_name: "translation",
71
+ status: "CA"
72
+ }, {
73
+ service_name: "seo",
74
+ status: "AS"
75
+ }, {
76
+ service_name: "photo",
77
+ status: "Ex"
78
+ }, {
79
+ service_name: "videos",
80
+ status: "IE"
81
+ }, {
82
+ service_name: "brandstore",
83
+ status: "AC"
84
+ }, {
85
+ service_name: "quality",
86
+ status: "PA"
87
+ }];
88
+ /** Especialista de imágenes (rol 8): «Míos» le muestra solo Imágenes. */
89
+
90
+ var EspecialistaImagenes = Template.bind({});
91
+ exports.EspecialistaImagenes = EspecialistaImagenes;
92
+ EspecialistaImagenes.storyName = "Especialista de imágenes";
93
+ EspecialistaImagenes.args = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
94
+ tabsSections: _ImageEditor.ImageEditor.args.tabsSections,
95
+ user: _ImageEditor.ImageEditor.args.user
96
+ });
97
+ /** Especialista de textos (rol 7): Ficha técnica y Descripción. */
98
+
99
+ var EspecialistaTextos = Template.bind({});
100
+ exports.EspecialistaTextos = EspecialistaTextos;
101
+ EspecialistaTextos.storyName = "Especialista de textos";
102
+ EspecialistaTextos.args = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
103
+ tabsSections: _TextEditor.TextEditor.args.tabsSections,
104
+ user: _TextEditor.TextEditor.args.user
105
+ });
106
+ /** Auditor QA (rol 6): asignado a todo el producto, ve los tres servicios. */
107
+
108
+ var AuditorQA = Template.bind({});
109
+ exports.AuditorQA = AuditorQA;
110
+ AuditorQA.storyName = "Auditor QA";
111
+ AuditorQA.args = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
112
+ tabsSections: TODAS_LAS_PESTAÑAS,
113
+ user: _Auditor.Auditor.args.user
114
+ });
115
+ /** Auditor con servicios de ejemplo: así se ve con más de los tres de siempre. */
116
+
117
+ var ConServiciosDeEjemplo = Template.bind({});
118
+ exports.ConServiciosDeEjemplo = ConServiciosDeEjemplo;
119
+ ConServiciosDeEjemplo.storyName = "Con servicios de ejemplo";
120
+ ConServiciosDeEjemplo.args = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, AuditorQA.args), {}, {
121
+ demoServices: SERVICIOS_DE_EJEMPLO
122
+ });
123
+ /**
124
+ * Auditor con todos los servicios activos de la plataforma (los de
125
+ * `cat_service`): los tres con editor salen del producto y el resto son de
126
+ * ejemplo, con estatus variados. Sirve para ver la lista lateral llena: los
127
+ * cinco bloques (con Mantenimiento), el buscador y el Resumen.
128
+ */
129
+
130
+ var TodosLosServicios = Template.bind({});
131
+ exports.TodosLosServicios = TodosLosServicios;
132
+ TodosLosServicios.storyName = "Todos los servicios";
133
+ TodosLosServicios.args = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, AuditorQA.args), {}, {
134
+ demoServices: (0, _catalog.allCatalogServices)({
135
+ exclude: ["datasheet", "description", "images"]
136
+ })
137
+ });
138
+ /** En celular la lista se abre como panel con el botón «Servicios». */
139
+
140
+ var EspecialistaImagenesCelular = Template.bind({});
141
+ exports.EspecialistaImagenesCelular = EspecialistaImagenesCelular;
142
+ EspecialistaImagenesCelular.storyName = "Especialista de imágenes · celular";
143
+ EspecialistaImagenesCelular.args = EspecialistaImagenes.args;
144
+ EspecialistaImagenesCelular.parameters = {
145
+ viewport: {
146
+ defaultViewport: "mobile2"
147
+ }
148
+ };