contentoh-components-library 21.6.55 → 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.
- package/.claude/launch.json +14 -0
- package/.env.test +1 -0
- package/dist/ai/prompts/attribute.prompt.js +28 -0
- package/dist/ai/prompts/description.prompt.js +33 -0
- package/dist/ai/schemas/attribute.schema.js +35 -0
- package/dist/ai/schemas/description.schema.js +27 -0
- package/dist/components/atoms/AsignationOption/index.js +1 -0
- package/dist/components/atoms/AsignationOption/styles.js +1 -1
- package/dist/components/atoms/AssetPreview/AssetPreview.stories.js +118 -0
- package/dist/components/atoms/AssetPreview/index.js +150 -0
- package/dist/components/atoms/AssetPreview/styles.js +28 -0
- package/dist/components/atoms/IconFile/index.js +85 -2
- package/dist/components/atoms/IconFile/styles.js +1 -1
- package/dist/components/atoms/ProductImage/ProductImage.stories.js +70 -2
- package/dist/components/atoms/ProductImage/index.js +100 -27
- package/dist/components/atoms/ProductImage/styles.js +3 -1
- package/dist/components/molecules/EditionActiveImage/index.js +4 -2
- package/dist/components/molecules/GalleryAssetElement/GalleryAssetElement.stories.js +147 -0
- package/dist/components/molecules/GalleryAssetElement/index.js +178 -0
- package/dist/components/molecules/GalleryAssetElement/styles.js +26 -0
- package/dist/components/molecules/GalleryElement/index.js +13 -4
- package/dist/components/molecules/GalleryHeader/index.js +96 -24
- package/dist/components/molecules/GalleryHeader/styles.js +4 -1
- package/dist/components/molecules/GalleryTrayTabs/GalleryTrayTabs.stories.js +56 -0
- package/dist/components/molecules/GalleryTrayTabs/index.js +60 -0
- package/dist/components/molecules/GalleryTrayTabs/styles.js +20 -0
- package/dist/components/molecules/ImageSelector/index.js +1 -0
- package/dist/components/molecules/RetailerSelector/RetailerSelector.stories.js +23 -2
- package/dist/components/molecules/RetailerSelector/index.js +7 -2
- package/dist/components/molecules/RetailerSelectorv2/index.js +6 -2
- package/dist/components/organisms/DigitalAssetsTray/DigitalAssetsTray.stories.js +235 -0
- package/dist/components/organisms/DigitalAssetsTray/index.js +219 -0
- package/dist/components/organisms/DigitalAssetsTray/styles.js +22 -0
- package/dist/components/organisms/ImagePreviewer/index.js +1 -0
- package/dist/components/organisms/ProductImageModal/index.js +3 -2
- package/dist/components/pages/CreatorsProductEdition/CreatorsProductEditionView.js +905 -0
- package/dist/components/pages/CreatorsProductEdition/constants.js +19 -0
- package/dist/components/pages/CreatorsProductEdition/hooks/useCreatorsProductEdition.js +2967 -0
- package/dist/components/pages/CreatorsProductEdition/index.js +33 -0
- package/dist/components/pages/CreatorsProductEdition/mocks/api.fixtures.js +537 -0
- package/dist/components/pages/CreatorsProductEdition/mocks/mockApi.js +251 -0
- package/dist/components/pages/CreatorsProductEdition/sections/CommentBox.js +311 -0
- package/dist/components/pages/CreatorsProductEdition/sections/ImagePanel.js +421 -0
- package/dist/components/pages/CreatorsProductEdition/sections/ImagesSection.js +473 -0
- package/dist/components/pages/CreatorsProductEdition/sections/ProductHeader.js +379 -0
- package/dist/components/pages/CreatorsProductEdition/sections/ProductMedia.js +138 -0
- package/dist/components/pages/CreatorsProductEdition/sections/RetailerMenu.js +162 -0
- package/dist/components/pages/CreatorsProductEdition/sections/ServiceActions.js +542 -0
- package/dist/components/pages/CreatorsProductEdition/sections/StatusChip.js +50 -0
- package/dist/components/pages/CreatorsProductEdition/sections/TabsBar.js +247 -0
- package/dist/components/pages/CreatorsProductEdition/sections/VariantsPanel.js +389 -0
- package/dist/components/pages/CreatorsProductEdition/sections/tokens.js +90 -0
- package/dist/components/pages/CreatorsProductEdition/stories/CreatorsProductEdition.stories.js +168 -0
- package/dist/components/pages/CreatorsProductEdition/stories/CreatorsProductEditionAPI.stories.js +74 -0
- package/dist/components/pages/CreatorsProductEdition/styles.js +46 -0
- package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.context.js +330 -15
- package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +12 -2
- package/dist/components/pages/RetailerProductEdition/index.js +606 -425
- package/dist/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +1 -0
- package/dist/global-files/data.js +16 -3
- package/dist/global-files/digital-assets/assetTypes.js +517 -0
- package/dist/global-files/digital-assets/assets.actions.js +64 -0
- package/dist/global-files/digital-assets/assets.adapter.js +304 -0
- package/dist/global-files/digital-assets/assets.mock.js +136 -0
- package/dist/global-files/digital-assets/assets.reducer.js +220 -0
- package/dist/global-files/digital-assets/uploadAssets.js +202 -0
- package/dist/global-files/digital-assets/useDigitalAssets.js +535 -0
- package/dist/index.js +142 -90
- package/docs/activos-digitales.md +273 -0
- package/package.json +1 -1
- package/src/components/atoms/AsignationOption/index.js +1 -1
- package/src/components/atoms/AsignationOption/styles.js +9 -0
- package/src/components/atoms/AssetPreview/AssetPreview.stories.js +78 -0
- package/src/components/atoms/AssetPreview/index.js +119 -0
- package/src/components/atoms/AssetPreview/styles.js +190 -0
- package/src/components/atoms/IconFile/index.js +28 -1
- package/src/components/atoms/IconFile/styles.js +8 -0
- package/src/components/atoms/ProductImage/ProductImage.stories.js +38 -0
- package/src/components/atoms/ProductImage/index.js +95 -20
- package/src/components/atoms/ProductImage/styles.js +92 -7
- package/src/components/molecules/EditionActiveImage/index.js +2 -2
- package/src/components/molecules/GalleryAssetElement/GalleryAssetElement.stories.js +102 -0
- package/src/components/molecules/GalleryAssetElement/index.js +162 -0
- package/src/components/molecules/GalleryAssetElement/styles.js +163 -0
- package/src/components/molecules/GalleryElement/index.js +9 -0
- package/src/components/molecules/GalleryHeader/index.js +65 -13
- package/src/components/molecules/GalleryHeader/styles.js +2 -1
- package/src/components/molecules/GalleryTrayTabs/GalleryTrayTabs.stories.js +32 -0
- package/src/components/molecules/GalleryTrayTabs/index.js +41 -0
- package/src/components/molecules/GalleryTrayTabs/styles.js +52 -0
- package/src/components/molecules/ImageSelector/index.js +1 -0
- package/src/components/molecules/RetailerSelector/RetailerSelector.stories.js +15 -1
- package/src/components/molecules/RetailerSelector/index.js +8 -1
- package/src/components/molecules/RetailerSelectorv2/index.js +7 -1
- package/src/components/organisms/DigitalAssetsTray/DigitalAssetsTray.stories.js +164 -0
- package/src/components/organisms/DigitalAssetsTray/index.js +193 -0
- package/src/components/organisms/DigitalAssetsTray/styles.js +183 -0
- package/src/components/organisms/ImagePreviewer/index.js +1 -0
- package/src/components/organisms/ProductImageModal/index.js +1 -0
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +201 -0
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +12 -0
- package/src/components/pages/RetailerProductEdition/index.js +356 -139
- package/src/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +1 -0
- package/src/global-files/data.js +17 -2
- package/src/global-files/digital-assets/assetTypes.js +451 -0
- package/src/global-files/digital-assets/assets.actions.js +50 -0
- package/src/global-files/digital-assets/assets.adapter.js +229 -0
- package/src/global-files/digital-assets/assets.mock.js +122 -0
- package/src/global-files/digital-assets/assets.reducer.js +197 -0
- package/src/global-files/digital-assets/uploadAssets.js +124 -0
- package/src/global-files/digital-assets/useDigitalAssets.js +340 -0
- package/src/index.js +4 -0
|
@@ -0,0 +1,542 @@
|
|
|
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.ServiceActions = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _react = require("react");
|
|
15
|
+
|
|
16
|
+
var _material = require("@mui/material");
|
|
17
|
+
|
|
18
|
+
var _data = require("../../../../global-files/data");
|
|
19
|
+
|
|
20
|
+
var _AiProductEdition = require("../../../../contexts/AiProductEdition");
|
|
21
|
+
|
|
22
|
+
var _defaultProfileImage = _interopRequireDefault(require("../../../../assets/images/defaultImages/defaultProfileImage.svg"));
|
|
23
|
+
|
|
24
|
+
var _infoIcon = _interopRequireDefault(require("../../../../assets/images/sliderToolTip/infoIcon.svg"));
|
|
25
|
+
|
|
26
|
+
var _slide = _interopRequireDefault(require("../../../../assets/images/sliderToolTip/slide21.svg"));
|
|
27
|
+
|
|
28
|
+
var _slide2 = _interopRequireDefault(require("../../../../assets/images/sliderToolTip/slide22.svg"));
|
|
29
|
+
|
|
30
|
+
var _slide3 = _interopRequireDefault(require("../../../../assets/images/sliderToolTip/slide23.svg"));
|
|
31
|
+
|
|
32
|
+
var _saveIcon = _interopRequireDefault(require("../../../../assets/images/generalButton/saveIcon.svg"));
|
|
33
|
+
|
|
34
|
+
var _saveIconHover = _interopRequireDefault(require("../../../../assets/images/generalButton/saveIconHover.svg"));
|
|
35
|
+
|
|
36
|
+
var _deleteIcon = _interopRequireDefault(require("../../../../assets/images/generalButton/deleteIcon.svg"));
|
|
37
|
+
|
|
38
|
+
var _deleteIconHover = _interopRequireDefault(require("../../../../assets/images/generalButton/deleteIconHover.svg"));
|
|
39
|
+
|
|
40
|
+
var _downloadIcon = _interopRequireDefault(require("../../../../assets/images/generalButton/downloadIcon.svg"));
|
|
41
|
+
|
|
42
|
+
var _rowLayout = _interopRequireDefault(require("../../../../assets/images/generalButton/rowLayout.svg"));
|
|
43
|
+
|
|
44
|
+
var _gridLayout = _interopRequireDefault(require("../../../../assets/images/generalButton/gridLayout.svg"));
|
|
45
|
+
|
|
46
|
+
var _StatusChip = require("./StatusChip");
|
|
47
|
+
|
|
48
|
+
var _tokens = require("./tokens");
|
|
49
|
+
|
|
50
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
51
|
+
|
|
52
|
+
/*
|
|
53
|
+
Acciones de un servicio: ayuda, versión, estatus, guardar, (en imágenes)
|
|
54
|
+
borrar/descargar/cambiar vista, y asignaciones con su panel.
|
|
55
|
+
|
|
56
|
+
Es lo que hacía `molecules/StatusAsignationInfo`, que la vista original usa en
|
|
57
|
+
DOS lugares: junto a las pestañas y en la cabecera de los datos de la imagen.
|
|
58
|
+
Aquí también se comparte: TabsBar e ImagePanel usan este mismo componente.
|
|
59
|
+
*/
|
|
60
|
+
var SLIDES = [{
|
|
61
|
+
slide: _slide.default,
|
|
62
|
+
title: "Valida tu producto en cada activo digital",
|
|
63
|
+
description: "Al solicitar a Content-oh! podrás validar la información, imágenes y documentación de tu producto, esto hará más sencillo que puedas aprobar o rechazar el contenido."
|
|
64
|
+
}, {
|
|
65
|
+
slide: _slide2.default,
|
|
66
|
+
title: "Aprueba o rechaza con un clic",
|
|
67
|
+
description: "Cuando termines de revisar tu información, elige si aproebas o rechazas, esto enviara una notificiación a nuestro equipo, para continuar o corregir el producto."
|
|
68
|
+
}, {
|
|
69
|
+
slide: _slide3.default,
|
|
70
|
+
title: "Estatus de tu producto en el proceso",
|
|
71
|
+
description: "La mayor parte del proceso podrás identificar que estatus tiene tu producto, esto dara visibilidad a todo tu equipo para saber la etapa se encuentra."
|
|
72
|
+
}];
|
|
73
|
+
|
|
74
|
+
var HelpSlides = function HelpSlides() {
|
|
75
|
+
var _useState = (0, _react.useState)(null),
|
|
76
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
77
|
+
anchor = _useState2[0],
|
|
78
|
+
setAnchor = _useState2[1];
|
|
79
|
+
|
|
80
|
+
var _useState3 = (0, _react.useState)(0),
|
|
81
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
82
|
+
step = _useState4[0],
|
|
83
|
+
setStep = _useState4[1];
|
|
84
|
+
|
|
85
|
+
var last = step === SLIDES.length - 1;
|
|
86
|
+
|
|
87
|
+
var close = function close() {
|
|
88
|
+
setAnchor(null);
|
|
89
|
+
setStep(0);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
93
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
94
|
+
"aria-label": "Ayuda",
|
|
95
|
+
size: "small",
|
|
96
|
+
onClick: function onClick(e) {
|
|
97
|
+
return setAnchor(e.currentTarget);
|
|
98
|
+
},
|
|
99
|
+
sx: {
|
|
100
|
+
p: 0
|
|
101
|
+
},
|
|
102
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
103
|
+
src: _infoIcon.default,
|
|
104
|
+
alt: "",
|
|
105
|
+
width: 30,
|
|
106
|
+
height: 30,
|
|
107
|
+
style: {
|
|
108
|
+
filter: "brightness(.35)"
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Popover, {
|
|
112
|
+
open: Boolean(anchor),
|
|
113
|
+
anchorEl: anchor,
|
|
114
|
+
onClose: close,
|
|
115
|
+
anchorOrigin: {
|
|
116
|
+
vertical: "bottom",
|
|
117
|
+
horizontal: "center"
|
|
118
|
+
},
|
|
119
|
+
transformOrigin: {
|
|
120
|
+
vertical: "top",
|
|
121
|
+
horizontal: "center"
|
|
122
|
+
},
|
|
123
|
+
PaperProps: {
|
|
124
|
+
sx: {
|
|
125
|
+
width: 300,
|
|
126
|
+
maxWidth: "calc(100vw - 24px)",
|
|
127
|
+
p: 2,
|
|
128
|
+
mt: 1
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
132
|
+
component: "img",
|
|
133
|
+
src: SLIDES[step].slide,
|
|
134
|
+
alt: "",
|
|
135
|
+
sx: {
|
|
136
|
+
width: "100%",
|
|
137
|
+
height: 150,
|
|
138
|
+
objectFit: "contain"
|
|
139
|
+
}
|
|
140
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
141
|
+
sx: {
|
|
142
|
+
fontFamily: _tokens.FONTS.Raleway_700,
|
|
143
|
+
fontSize: 14,
|
|
144
|
+
color: _tokens.COLORS.s5,
|
|
145
|
+
mt: 1
|
|
146
|
+
},
|
|
147
|
+
children: SLIDES[step].title
|
|
148
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
149
|
+
sx: {
|
|
150
|
+
fontFamily: _tokens.FONTS.AvenirNext,
|
|
151
|
+
fontSize: 12,
|
|
152
|
+
color: _tokens.COLORS.s4,
|
|
153
|
+
mt: 0.5
|
|
154
|
+
},
|
|
155
|
+
children: SLIDES[step].description
|
|
156
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MobileStepper, {
|
|
157
|
+
variant: "dots",
|
|
158
|
+
steps: SLIDES.length,
|
|
159
|
+
position: "static",
|
|
160
|
+
activeStep: step,
|
|
161
|
+
sx: {
|
|
162
|
+
bgcolor: "transparent",
|
|
163
|
+
px: 0,
|
|
164
|
+
mt: 1,
|
|
165
|
+
"& .MuiMobileStepper-dotActive": {
|
|
166
|
+
bgcolor: _tokens.COLORS.magenta_s2
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
backButton: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
170
|
+
size: "small",
|
|
171
|
+
disabled: step === 0,
|
|
172
|
+
onClick: function onClick() {
|
|
173
|
+
return setStep(function (s) {
|
|
174
|
+
return s - 1;
|
|
175
|
+
});
|
|
176
|
+
},
|
|
177
|
+
sx: {
|
|
178
|
+
color: _tokens.COLORS.s5
|
|
179
|
+
},
|
|
180
|
+
children: "Anterior"
|
|
181
|
+
}),
|
|
182
|
+
nextButton: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
183
|
+
size: "small",
|
|
184
|
+
onClick: function onClick() {
|
|
185
|
+
return last ? close() : setStep(function (s) {
|
|
186
|
+
return s + 1;
|
|
187
|
+
});
|
|
188
|
+
},
|
|
189
|
+
sx: {
|
|
190
|
+
color: _tokens.COLORS.magenta_s2
|
|
191
|
+
},
|
|
192
|
+
children: last ? "Cerrar" : "Siguiente"
|
|
193
|
+
})
|
|
194
|
+
})]
|
|
195
|
+
})]
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
/** Botón redondo de 25px con el ícono de siempre y su versión "hover". */
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
var RoundIcon = function RoundIcon(_ref) {
|
|
202
|
+
var label = _ref.label,
|
|
203
|
+
icon = _ref.icon,
|
|
204
|
+
hoverIcon = _ref.hoverIcon,
|
|
205
|
+
onClick = _ref.onClick,
|
|
206
|
+
_ref$bordered = _ref.bordered,
|
|
207
|
+
bordered = _ref$bordered === void 0 ? _tokens.COLORS.s3 : _ref$bordered,
|
|
208
|
+
_ref$hoverBg = _ref.hoverBg,
|
|
209
|
+
hoverBg = _ref$hoverBg === void 0 ? _tokens.COLORS.magenta_s2 : _ref$hoverBg,
|
|
210
|
+
_ref$size = _ref.size,
|
|
211
|
+
size = _ref$size === void 0 ? 15 : _ref$size;
|
|
212
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
213
|
+
title: label,
|
|
214
|
+
arrow: true,
|
|
215
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
216
|
+
"aria-label": label,
|
|
217
|
+
onClick: onClick,
|
|
218
|
+
sx: {
|
|
219
|
+
width: 25,
|
|
220
|
+
height: 25,
|
|
221
|
+
p: 0,
|
|
222
|
+
border: bordered ? "1px solid ".concat(bordered) : "none",
|
|
223
|
+
backgroundImage: "url(".concat(icon, ")"),
|
|
224
|
+
backgroundRepeat: "no-repeat",
|
|
225
|
+
backgroundPosition: "center",
|
|
226
|
+
backgroundSize: size,
|
|
227
|
+
"&:hover": (0, _objectSpread2.default)({
|
|
228
|
+
backgroundColor: hoverBg,
|
|
229
|
+
borderColor: hoverBg
|
|
230
|
+
}, hoverIcon ? {
|
|
231
|
+
backgroundImage: "url(".concat(hoverIcon, ")")
|
|
232
|
+
} : {})
|
|
233
|
+
}
|
|
234
|
+
})
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
var ServiceActions = function ServiceActions(_ref2) {
|
|
239
|
+
var _assig$collaborators, _assig$assignations;
|
|
240
|
+
|
|
241
|
+
var _ref2$status = _ref2.status,
|
|
242
|
+
status = _ref2$status === void 0 ? "" : _ref2$status,
|
|
243
|
+
_ref2$imagesSection = _ref2.imagesSection,
|
|
244
|
+
imagesSection = _ref2$imagesSection === void 0 ? false : _ref2$imagesSection,
|
|
245
|
+
imageLayout = _ref2.imageLayout,
|
|
246
|
+
setImageLayout = _ref2.setImageLayout,
|
|
247
|
+
assig = _ref2.assig,
|
|
248
|
+
setAssignation = _ref2.setAssignation,
|
|
249
|
+
isRetailer = _ref2.isRetailer,
|
|
250
|
+
downloadImages = _ref2.downloadImages,
|
|
251
|
+
askToDeleteImages = _ref2.askToDeleteImages,
|
|
252
|
+
onClickSave = _ref2.onClickSave,
|
|
253
|
+
showSaveButton = _ref2.showSaveButton,
|
|
254
|
+
canAssign = _ref2.canAssign,
|
|
255
|
+
version = _ref2.version,
|
|
256
|
+
setShowVersionSelector = _ref2.setShowVersionSelector,
|
|
257
|
+
resetKey = _ref2.resetKey;
|
|
258
|
+
var isImagesTab = imagesSection;
|
|
259
|
+
|
|
260
|
+
var _useAiProductEdition = (0, _AiProductEdition.useAiProductEdition)(),
|
|
261
|
+
inputsUsingAi = _useAiProductEdition.inputsUsingAi;
|
|
262
|
+
|
|
263
|
+
var _useState5 = (0, _react.useState)(null),
|
|
264
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
265
|
+
assignAnchor = _useState6[0],
|
|
266
|
+
setAssignAnchor = _useState6[1];
|
|
267
|
+
|
|
268
|
+
var _useState7 = (0, _react.useState)("facilitator"),
|
|
269
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
270
|
+
assignationType = _useState8[0],
|
|
271
|
+
setAssignationType = _useState8[1];
|
|
272
|
+
|
|
273
|
+
var collaborators = assig === null || assig === void 0 ? void 0 : (_assig$collaborators = assig.collaborators) === null || _assig$collaborators === void 0 ? void 0 : _assig$collaborators[assignationType];
|
|
274
|
+
(0, _react.useEffect)(function () {
|
|
275
|
+
return setAssignAnchor(null);
|
|
276
|
+
}, [resetKey]);
|
|
277
|
+
|
|
278
|
+
var save = function save() {
|
|
279
|
+
if (Object.values(inputsUsingAi !== null && inputsUsingAi !== void 0 ? inputsUsingAi : {}).some(function (input) {
|
|
280
|
+
return !!(input !== null && input !== void 0 && input.using);
|
|
281
|
+
})) {
|
|
282
|
+
console.warn("Para guardar se debe de dejar de usar la generación con IA");
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
onClickSave && onClickSave();
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
290
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
291
|
+
direction: "row",
|
|
292
|
+
alignItems: "center",
|
|
293
|
+
flexWrap: "wrap",
|
|
294
|
+
gap: "10px",
|
|
295
|
+
justifyContent: "flex-end",
|
|
296
|
+
sx: {
|
|
297
|
+
flex: "0 1 auto",
|
|
298
|
+
ml: "auto"
|
|
299
|
+
},
|
|
300
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(HelpSlides, {}), version && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
301
|
+
title: "Cambiar de versi\xF3n",
|
|
302
|
+
arrow: true,
|
|
303
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Button, {
|
|
304
|
+
onClick: function onClick(e) {
|
|
305
|
+
e.stopPropagation();
|
|
306
|
+
setShowVersionSelector(true);
|
|
307
|
+
},
|
|
308
|
+
sx: {
|
|
309
|
+
minWidth: 25,
|
|
310
|
+
width: 25,
|
|
311
|
+
height: 25,
|
|
312
|
+
p: 0,
|
|
313
|
+
borderRadius: "50%",
|
|
314
|
+
border: "1px solid ".concat(_tokens.COLORS.color_purple),
|
|
315
|
+
color: _tokens.COLORS.color_purple,
|
|
316
|
+
fontFamily: _tokens.FONTS.AvenirNext,
|
|
317
|
+
fontSize: 11,
|
|
318
|
+
lineHeight: "25px"
|
|
319
|
+
},
|
|
320
|
+
children: ["V", version]
|
|
321
|
+
})
|
|
322
|
+
}), status !== "-" && status !== "" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_StatusChip.StatusChip, {
|
|
323
|
+
status: status,
|
|
324
|
+
oval: true
|
|
325
|
+
}), showSaveButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(RoundIcon, {
|
|
326
|
+
label: "Guardar",
|
|
327
|
+
icon: _saveIcon.default,
|
|
328
|
+
hoverIcon: _saveIconHover.default,
|
|
329
|
+
bordered: _tokens.COLORS.color_gray,
|
|
330
|
+
hoverBg: _tokens.COLORS.color_pink,
|
|
331
|
+
size: undefined,
|
|
332
|
+
onClick: save
|
|
333
|
+
}), isImagesTab && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
334
|
+
children: [showSaveButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(RoundIcon, {
|
|
335
|
+
label: "Borrar seleccionadas",
|
|
336
|
+
icon: _deleteIcon.default,
|
|
337
|
+
hoverIcon: _deleteIconHover.default,
|
|
338
|
+
onClick: function onClick() {
|
|
339
|
+
return askToDeleteImages && askToDeleteImages();
|
|
340
|
+
}
|
|
341
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(RoundIcon, {
|
|
342
|
+
label: "Descargar",
|
|
343
|
+
icon: _downloadIcon.default,
|
|
344
|
+
onClick: function onClick() {
|
|
345
|
+
return downloadImages && downloadImages();
|
|
346
|
+
}
|
|
347
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
348
|
+
title: imageLayout ? "Ver como lista" : "Ver como cuadrícula",
|
|
349
|
+
arrow: true,
|
|
350
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
351
|
+
"aria-label": imageLayout ? "Ver como lista" : "Ver como cuadrícula",
|
|
352
|
+
onClick: function onClick() {
|
|
353
|
+
return setImageLayout && setImageLayout(!imageLayout);
|
|
354
|
+
},
|
|
355
|
+
sx: {
|
|
356
|
+
width: 24,
|
|
357
|
+
height: 24,
|
|
358
|
+
p: 0
|
|
359
|
+
},
|
|
360
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
361
|
+
src: imageLayout ? _rowLayout.default : _gridLayout.default,
|
|
362
|
+
alt: "",
|
|
363
|
+
width: 24,
|
|
364
|
+
height: 24
|
|
365
|
+
})
|
|
366
|
+
})
|
|
367
|
+
})]
|
|
368
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
369
|
+
direction: "row",
|
|
370
|
+
alignItems: "center",
|
|
371
|
+
gap: "6px",
|
|
372
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.AvatarGroup, {
|
|
373
|
+
max: 4,
|
|
374
|
+
sx: {
|
|
375
|
+
"& .MuiAvatar-root": {
|
|
376
|
+
width: 20,
|
|
377
|
+
height: 20,
|
|
378
|
+
fontSize: 10,
|
|
379
|
+
border: 0
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
children: assig === null || assig === void 0 ? void 0 : (_assig$assignations = assig.assignations) === null || _assig$assignations === void 0 ? void 0 : _assig$assignations.map(function (assignation, index) {
|
|
383
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
384
|
+
src: (0, _data.getProfilePicture)(assignation.id, 20, 20),
|
|
385
|
+
alt: "Persona asignada",
|
|
386
|
+
onClick: function onClick(e) {
|
|
387
|
+
e.stopPropagation();
|
|
388
|
+
setAssignationType(assignation === null || assignation === void 0 ? void 0 : assignation.collaboratorType);
|
|
389
|
+
setAssignAnchor(e.currentTarget);
|
|
390
|
+
},
|
|
391
|
+
sx: {
|
|
392
|
+
cursor: "pointer"
|
|
393
|
+
},
|
|
394
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
395
|
+
src: _defaultProfileImage.default,
|
|
396
|
+
alt: "",
|
|
397
|
+
width: 20,
|
|
398
|
+
height: 20
|
|
399
|
+
})
|
|
400
|
+
}, "".concat(index, "-").concat(assignation.id));
|
|
401
|
+
})
|
|
402
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
403
|
+
sx: {
|
|
404
|
+
fontFamily: _tokens.FONTS.AvenirNext,
|
|
405
|
+
fontSize: 14,
|
|
406
|
+
color: _tokens.COLORS.color_gray
|
|
407
|
+
},
|
|
408
|
+
children: "Asig."
|
|
409
|
+
})]
|
|
410
|
+
})]
|
|
411
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Popover, {
|
|
412
|
+
open: Boolean(assignAnchor) && canAssign,
|
|
413
|
+
anchorEl: assignAnchor,
|
|
414
|
+
onClose: function onClose() {
|
|
415
|
+
return setAssignAnchor(null);
|
|
416
|
+
},
|
|
417
|
+
anchorOrigin: {
|
|
418
|
+
vertical: "bottom",
|
|
419
|
+
horizontal: "right"
|
|
420
|
+
},
|
|
421
|
+
transformOrigin: {
|
|
422
|
+
vertical: "top",
|
|
423
|
+
horizontal: "right"
|
|
424
|
+
},
|
|
425
|
+
PaperProps: {
|
|
426
|
+
sx: {
|
|
427
|
+
width: 260,
|
|
428
|
+
maxWidth: "calc(100vw - 24px)",
|
|
429
|
+
mt: 1,
|
|
430
|
+
p: 1.5
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
434
|
+
direction: "row",
|
|
435
|
+
alignItems: "center",
|
|
436
|
+
gap: 1,
|
|
437
|
+
sx: {
|
|
438
|
+
mb: 1
|
|
439
|
+
},
|
|
440
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
441
|
+
sx: {
|
|
442
|
+
fontFamily: _tokens.FONTS.AvenirNext,
|
|
443
|
+
fontSize: 13,
|
|
444
|
+
color: _tokens.COLORS.s4
|
|
445
|
+
},
|
|
446
|
+
children: "Estatus"
|
|
447
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_StatusChip.StatusChip, {
|
|
448
|
+
status: status,
|
|
449
|
+
oval: true
|
|
450
|
+
})]
|
|
451
|
+
}), collaborators !== null && collaborators !== void 0 && collaborators.length ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.List, {
|
|
452
|
+
dense: true,
|
|
453
|
+
disablePadding: true,
|
|
454
|
+
sx: {
|
|
455
|
+
maxHeight: 280,
|
|
456
|
+
overflowY: "auto"
|
|
457
|
+
},
|
|
458
|
+
children: collaborators.map(function (person, index) {
|
|
459
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.ListItemButton, {
|
|
460
|
+
onClick: function onClick() {
|
|
461
|
+
setAssignation && setAssignation(assignationType, person === null || person === void 0 ? void 0 : person.id_user);
|
|
462
|
+
setAssignAnchor(null);
|
|
463
|
+
},
|
|
464
|
+
sx: {
|
|
465
|
+
borderRadius: "3px"
|
|
466
|
+
},
|
|
467
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemAvatar, {
|
|
468
|
+
sx: {
|
|
469
|
+
minWidth: 40
|
|
470
|
+
},
|
|
471
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
472
|
+
src: (0, _data.getProfilePicture)(person === null || person === void 0 ? void 0 : person.id_user, 40, 40),
|
|
473
|
+
sx: {
|
|
474
|
+
width: 26,
|
|
475
|
+
height: 26
|
|
476
|
+
},
|
|
477
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
478
|
+
src: _defaultProfileImage.default,
|
|
479
|
+
alt: "",
|
|
480
|
+
width: 26,
|
|
481
|
+
height: 26
|
|
482
|
+
})
|
|
483
|
+
})
|
|
484
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
485
|
+
primary: person.name,
|
|
486
|
+
primaryTypographyProps: {
|
|
487
|
+
sx: {
|
|
488
|
+
fontFamily: _tokens.FONTS.AvenirNext,
|
|
489
|
+
fontSize: 14,
|
|
490
|
+
color: _tokens.COLORS.s5
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
})]
|
|
494
|
+
}, "".concat(index, "-").concat(person.name));
|
|
495
|
+
})
|
|
496
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
497
|
+
sx: {
|
|
498
|
+
fontFamily: _tokens.FONTS.AvenirNext,
|
|
499
|
+
fontSize: 13,
|
|
500
|
+
color: _tokens.COLORS.s4,
|
|
501
|
+
py: 1
|
|
502
|
+
},
|
|
503
|
+
children: "Sin personas para asignar"
|
|
504
|
+
}), isRetailer === 1 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.List, {
|
|
505
|
+
dense: true,
|
|
506
|
+
disablePadding: true,
|
|
507
|
+
sx: {
|
|
508
|
+
mt: 1,
|
|
509
|
+
borderTop: "1px solid ".concat(_tokens.COLORS.s2),
|
|
510
|
+
pt: 1
|
|
511
|
+
},
|
|
512
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
513
|
+
primary: "Solicitar a",
|
|
514
|
+
secondary: "Proveedor",
|
|
515
|
+
sx: {
|
|
516
|
+
px: 2
|
|
517
|
+
},
|
|
518
|
+
primaryTypographyProps: {
|
|
519
|
+
sx: {
|
|
520
|
+
fontSize: 14,
|
|
521
|
+
color: _tokens.COLORS.s5
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
525
|
+
primary: "Solicitar a",
|
|
526
|
+
secondary: "Content-oh!",
|
|
527
|
+
sx: {
|
|
528
|
+
px: 2
|
|
529
|
+
},
|
|
530
|
+
primaryTypographyProps: {
|
|
531
|
+
sx: {
|
|
532
|
+
fontSize: 14,
|
|
533
|
+
color: _tokens.COLORS.s5
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
})]
|
|
537
|
+
})]
|
|
538
|
+
})]
|
|
539
|
+
});
|
|
540
|
+
};
|
|
541
|
+
|
|
542
|
+
exports.ServiceActions = ServiceActions;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StatusChip = void 0;
|
|
7
|
+
|
|
8
|
+
var _material = require("@mui/material");
|
|
9
|
+
|
|
10
|
+
var _tokens = require("./tokens");
|
|
11
|
+
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Etiqueta de estatus ("RA/AS", "AA"...). Mismo color y tamaño que
|
|
16
|
+
* `atoms/Status`; el nombre completo va en el tooltip. `oval` es la variante
|
|
17
|
+
* redondeada de la barra de pestañas.
|
|
18
|
+
*/
|
|
19
|
+
var StatusChip = function StatusChip(_ref) {
|
|
20
|
+
var status = _ref.status,
|
|
21
|
+
_ref$oval = _ref.oval,
|
|
22
|
+
oval = _ref$oval === void 0 ? false : _ref$oval;
|
|
23
|
+
var label = status !== null && status !== void 0 ? status : "NS";
|
|
24
|
+
var chip = /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Chip, {
|
|
25
|
+
label: label,
|
|
26
|
+
size: "small",
|
|
27
|
+
sx: {
|
|
28
|
+
height: 20,
|
|
29
|
+
borderRadius: oval ? "10px" : "3px",
|
|
30
|
+
backgroundColor: (0, _tokens.statusColor)(status),
|
|
31
|
+
color: _tokens.COLORS.white,
|
|
32
|
+
fontFamily: _tokens.FONTS.Lato,
|
|
33
|
+
fontSize: 12,
|
|
34
|
+
cursor: "default",
|
|
35
|
+
"& .MuiChip-label": {
|
|
36
|
+
px: "10px",
|
|
37
|
+
lineHeight: "20px"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
var name = (0, _tokens.statusName)(status);
|
|
42
|
+
return name ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
43
|
+
title: name,
|
|
44
|
+
arrow: true,
|
|
45
|
+
placement: "top",
|
|
46
|
+
children: chip
|
|
47
|
+
}) : chip;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports.StatusChip = StatusChip;
|