contentoh-components-library 21.6.19 → 21.6.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.test +2 -1
- package/dist/components/atoms/InheritanceTag/index.js +8 -0
- package/dist/components/molecules/TagAndInput/index.js +1 -0
- package/dist/components/molecules/TagAndInputv2/index.js +1 -0
- package/dist/components/organisms/LinkVariantsModal/api.js +102 -0
- package/dist/components/organisms/LinkVariantsModal/index.js +620 -0
- package/dist/components/organisms/LinkVariantsModal/styles.js +60 -0
- package/dist/components/pages/ProviderProductEdition/context/reducers/inputs.js +8 -2
- package/dist/components/pages/ProviderProductEdition/index.js +198 -89
- package/dist/components/pages/ProviderProductEdition/styles.js +2 -2
- package/dist/components/pages/ProviderProductEdition/utils.js +8 -0
- package/dist/index.js +25 -12
- package/package.json +1 -1
- package/src/components/atoms/InheritanceTag/index.js +7 -0
- package/src/components/molecules/TagAndInput/index.js +1 -0
- package/src/components/molecules/TagAndInputv2/index.js +1 -0
- package/src/components/organisms/LinkVariantsModal/api.js +61 -0
- package/src/components/organisms/LinkVariantsModal/index.js +479 -0
- package/src/components/organisms/LinkVariantsModal/styles.js +264 -0
- package/src/components/pages/ProviderProductEdition/context/reducers/inputs.js +21 -13
- package/src/components/pages/ProviderProductEdition/index.js +76 -0
- package/src/components/pages/ProviderProductEdition/styles.js +23 -0
- package/src/components/pages/ProviderProductEdition/utils.js +8 -0
- package/src/index.js +1 -0
- package/dist/ai/prompts/attribute.prompt.js +0 -28
- package/dist/ai/prompts/description.prompt.js +0 -33
- package/dist/ai/schemas/attribute.schema.js +0 -35
- package/dist/ai/schemas/description.schema.js +0 -27
|
@@ -0,0 +1,60 @@
|
|
|
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.Section = exports.SearchRow = exports.Panel = exports.Overlay = exports.ModeSwitch = exports.Message = exports.List = exports.Header = exports.Footer = exports.Body = exports.AttributeList = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
require("../../../global-files/global-styles.css");
|
|
15
|
+
|
|
16
|
+
var _variables = require("../../../global-files/variables");
|
|
17
|
+
|
|
18
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
19
|
+
|
|
20
|
+
var Overlay = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: fixed;\n inset: 0;\n z-index: 100;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: rgba(40, 31, 51, 0.45);\n"])));
|
|
21
|
+
|
|
22
|
+
exports.Overlay = Overlay;
|
|
23
|
+
|
|
24
|
+
var Panel = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n width: min(680px, 92vw);\n max-height: 86vh;\n border-radius: 10px;\n background-color: ", ";\n font-family: ", ";\n overflow: hidden;\n"])), _variables.GlobalColors.white, _variables.FontFamily.Raleway);
|
|
25
|
+
|
|
26
|
+
exports.Panel = Panel;
|
|
27
|
+
|
|
28
|
+
var Header = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 16px;\n padding: 20px 24px 12px;\n\n h2 {\n margin: 0;\n font-family: ", ";\n font-size: 16px;\n color: ", ";\n }\n\n p {\n margin: 4px 0 0;\n font-size: 12px;\n color: ", ";\n }\n\n .close {\n border: none;\n background: none;\n cursor: pointer;\n font-size: 20px;\n line-height: 1;\n color: ", ";\n }\n"])), _variables.FontFamily.Raleway_700, _variables.GlobalColors.deep_gray, _variables.GlobalColors.gray, _variables.GlobalColors.gray);
|
|
29
|
+
|
|
30
|
+
exports.Header = Header;
|
|
31
|
+
|
|
32
|
+
var ModeSwitch = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n gap: 8px;\n padding: 0 24px 16px;\n\n button {\n flex: 1;\n padding: 10px 12px;\n border-radius: 6px;\n border: 1px solid ", ";\n background-color: ", ";\n font-family: ", ";\n font-size: 12px;\n color: ", ";\n cursor: pointer;\n text-align: left;\n }\n\n button.active {\n border-color: ", ";\n color: ", ";\n background-color: rgba(", ", 0.08);\n }\n"])), _variables.GlobalColors.s2, _variables.GlobalColors.white, _variables.FontFamily.Raleway_600, _variables.GlobalColors.gray, _variables.GlobalColors.original_magenta, _variables.GlobalColors.original_magenta, _variables.GlobalColors.rgb_color_pink);
|
|
33
|
+
|
|
34
|
+
exports.ModeSwitch = ModeSwitch;
|
|
35
|
+
|
|
36
|
+
var Body = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n flex: 1;\n overflow-y: auto;\n padding: 0 24px;\n"])));
|
|
37
|
+
|
|
38
|
+
exports.Body = Body;
|
|
39
|
+
|
|
40
|
+
var SearchRow = _styledComponents.default.form(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n gap: 8px;\n margin-bottom: 12px;\n\n input {\n flex: 1;\n height: 36px;\n padding: 0 12px;\n border: 1px solid ", ";\n border-radius: 6px;\n font-family: ", ";\n font-size: 12px;\n color: ", ";\n }\n\n button {\n height: 36px;\n padding: 0 18px;\n border: none;\n border-radius: 6px;\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n font-size: 12px;\n cursor: pointer;\n }\n\n button:disabled {\n opacity: 0.5;\n cursor: default;\n }\n"])), _variables.GlobalColors.s2, _variables.FontFamily.Raleway, _variables.GlobalColors.deep_gray, _variables.GlobalColors.original_magenta, _variables.GlobalColors.white, _variables.FontFamily.Raleway_600);
|
|
41
|
+
|
|
42
|
+
exports.SearchRow = SearchRow;
|
|
43
|
+
|
|
44
|
+
var List = _styledComponents.default.ul(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n list-style: none;\n margin: 0 0 16px;\n padding: 0;\n border: 1px solid ", ";\n border-radius: 6px;\n\n li + li {\n border-top: 1px solid ", ";\n }\n\n label {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 10px 12px;\n cursor: pointer;\n font-size: 12px;\n color: ", ";\n }\n\n .meta {\n display: block;\n font-size: 11px;\n color: ", ";\n }\n\n .count {\n margin-left: auto;\n font-size: 11px;\n color: ", ";\n white-space: nowrap;\n }\n"])), _variables.GlobalColors.s2, _variables.GlobalColors.s2, _variables.GlobalColors.deep_gray, _variables.GlobalColors.gray, _variables.GlobalColors.original_magenta);
|
|
45
|
+
|
|
46
|
+
exports.List = List;
|
|
47
|
+
var AttributeList = (0, _styledComponents.default)(List)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n max-height: 220px;\n overflow-y: auto;\n\n .note {\n display: block;\n font-size: 10px;\n font-style: italic;\n color: ", ";\n }\n\n .value {\n margin-left: auto;\n max-width: 45%;\n font-size: 11px;\n color: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n"])), _variables.GlobalColors.gray, _variables.GlobalColors.gray);
|
|
48
|
+
exports.AttributeList = AttributeList;
|
|
49
|
+
|
|
50
|
+
var Section = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: 16px;\n\n h3 {\n margin: 0 0 8px;\n font-family: ", ";\n font-size: 13px;\n color: ", ";\n }\n\n label.choice {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 6px 0;\n font-size: 12px;\n color: ", ";\n cursor: pointer;\n }\n\n label.choice span.hint {\n display: block;\n font-size: 11px;\n color: ", ";\n }\n"])), _variables.FontFamily.Raleway_600, _variables.GlobalColors.deep_gray, _variables.GlobalColors.deep_gray, _variables.GlobalColors.gray);
|
|
51
|
+
|
|
52
|
+
exports.Section = Section;
|
|
53
|
+
|
|
54
|
+
var Message = _styledComponents.default.p(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 0 12px;\n padding: 10px 12px;\n border-radius: 6px;\n font-size: 12px;\n line-height: 1.4;\n background-color: ", ";\n color: ", ";\n\n &.error {\n background-color: rgba(", ", 0.1);\n color: ", ";\n }\n"])), _variables.GlobalColors.s2, _variables.GlobalColors.deep_gray, _variables.GlobalColors.rgb_color_pink, _variables.GlobalColors.original_magenta);
|
|
55
|
+
|
|
56
|
+
exports.Message = Message;
|
|
57
|
+
|
|
58
|
+
var Footer = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 16px 24px;\n border-top: 1px solid ", ";\n\n .summary {\n font-size: 12px;\n color: ", ";\n }\n\n .actions {\n display: flex;\n gap: 8px;\n margin-left: auto;\n }\n\n button {\n height: 36px;\n padding: 0 18px;\n border-radius: 6px;\n font-family: ", ";\n font-size: 12px;\n cursor: pointer;\n }\n\n button.secondary {\n border: 1px solid ", ";\n background-color: ", ";\n color: ", ";\n }\n\n button.primary {\n border: none;\n background-color: ", ";\n color: ", ";\n }\n\n button:disabled {\n opacity: 0.5;\n cursor: default;\n }\n"])), _variables.GlobalColors.s2, _variables.GlobalColors.gray, _variables.FontFamily.Raleway_600, _variables.GlobalColors.s2, _variables.GlobalColors.white, _variables.GlobalColors.gray, _variables.GlobalColors.original_magenta, _variables.GlobalColors.white);
|
|
59
|
+
|
|
60
|
+
exports.Footer = Footer;
|
|
@@ -98,11 +98,14 @@ var inputsReducer = function inputsReducer(state, action) {
|
|
|
98
98
|
var updatedServiceInputs = (0, _objectSpread2.default)({}, state.services.datasheets.inputs);
|
|
99
99
|
action.payload.forEach(function (_ref) {
|
|
100
100
|
var attributeId = _ref.attributeId,
|
|
101
|
-
value = _ref.value
|
|
101
|
+
value = _ref.value,
|
|
102
|
+
isOverridden = _ref.isOverridden;
|
|
102
103
|
var key = "".concat(attributeId, "_").concat(_retailerId);
|
|
103
104
|
if (!updatedServiceInputs[key]) return;
|
|
104
105
|
updatedServiceInputs[key] = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, updatedServiceInputs[key]), {}, {
|
|
105
106
|
value: value
|
|
107
|
+
}, isOverridden === undefined ? {} : {
|
|
108
|
+
isOverridden: isOverridden
|
|
106
109
|
});
|
|
107
110
|
});
|
|
108
111
|
/* ---------- 2. Actualizar datasheets_inputs ---------- */
|
|
@@ -111,11 +114,14 @@ var inputsReducer = function inputsReducer(state, action) {
|
|
|
111
114
|
if (index !== 1) return group;
|
|
112
115
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, group), action.payload.reduce(function (acc, _ref2) {
|
|
113
116
|
var attributeId = _ref2.attributeId,
|
|
114
|
-
value = _ref2.value
|
|
117
|
+
value = _ref2.value,
|
|
118
|
+
isOverridden = _ref2.isOverridden;
|
|
115
119
|
var key = "".concat(attributeId, "_").concat(_retailerId);
|
|
116
120
|
if (!group[key]) return acc;
|
|
117
121
|
acc[key] = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, group[key]), {}, {
|
|
118
122
|
value: value
|
|
123
|
+
}, isOverridden === undefined ? {} : {
|
|
124
|
+
isOverridden: isOverridden
|
|
119
125
|
});
|
|
120
126
|
return acc;
|
|
121
127
|
}, {}));
|