ecomlab-components-next 0.1.32 → 0.1.34
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/dist/common/fetchUrls.js +7 -2
- package/dist/common/headers.js +2 -1
- package/dist/common/hooks/useDebounce.js +37 -0
- package/dist/common/hooks/useTextSelectionInModal.js +41 -0
- package/dist/components/Article/ArcticleWiki/ArcticleWiki.stories.js +152 -0
- package/dist/components/Article/ArcticleWiki/ArticleWiki.js +775 -0
- package/dist/components/Article/ArcticleWiki/ArticleWiki.scss +278 -0
- package/dist/components/Article/ArticleViewV2/ArticleViewV2.js +791 -0
- package/dist/components/Article/ArticleViewV2/ArticleViewV2.scss +245 -0
- package/dist/components/Article/ArticleViewV2/ArticleViewV2.stories.js +166 -0
- package/dist/components/Article/ArticleViewV2/img/bell.svg +9 -0
- package/dist/components/Article/ArticleViewV2/img/btn-add-round.svg +4 -0
- package/dist/components/Article/ArticleViewV2/img/calendar_icon.svg +6 -0
- package/dist/components/Article/ArticleViewV2/img/close-round.svg +3 -0
- package/dist/components/Article/ArticleViewV2/img/close.svg +9 -0
- package/dist/components/Article/ArticleViewV2/img/copy_icon.svg +5 -0
- package/dist/components/Article/ArticleViewV2/img/dndMenu.svg +1 -0
- package/dist/components/Article/ArticleViewV2/img/info.svg +9 -0
- package/dist/components/Article/ArticleViewV2/img/ok_icon.svg +5 -0
- package/dist/components/Article/ArticleViewV2/img/plus_circle.svg +6 -0
- package/dist/components/Article/ArticleViewV2/img/share_icon.svg +5 -0
- package/dist/components/Article/ArticleViewV2/img/tg.svg +3 -0
- package/dist/components/Article/ArticleViewV2/img/tg_icon.svg +5 -0
- package/dist/components/Article/ArticleViewV2/img/time_icon.svg +6 -0
- package/dist/components/Article/ArticleViewV2/img/view_icon.svg +6 -0
- package/dist/components/Article/ArticleViewV2/img/vk_icon.svg +5 -0
- package/dist/components/Article/ArticleViewV2/img/whatsapp_icon.svg +5 -0
- package/dist/components/Article/Breadcrumb/Breadcrumb.js +69 -0
- package/dist/components/Article/Breadcrumb/Breadcrumb.scss +96 -0
- package/dist/components/Article/Breadcrumb/img/drop-right.svg +3 -0
- package/dist/components/Article/Breadcrumb/img/home_icon.svg +5 -0
- package/dist/components/Article/EditWrapper/EditWrapper.js +108 -0
- package/dist/components/Article/EditWrapper/EditWrapper.scss +93 -0
- package/dist/components/Article/EditWrapper/img/bx-grid-vertical.svg +5 -0
- package/dist/components/Article/Editor/Editor.js +92 -0
- package/dist/components/Article/Editor/Editor.scss +35 -0
- package/dist/components/Article/Editor/img/copy.svg +6 -0
- package/dist/components/Article/FormBtn/FormBtn.js +229 -0
- package/dist/components/Article/FormBtn/FormBtn.scss +458 -0
- package/dist/components/Article/FormBtn/ModalBitrixForm/ModalBitrixForm.js +282 -0
- package/dist/components/Article/FormBtn/ModalBitrixForm/ModalBitrixForm.scss +140 -0
- package/dist/components/Article/FormBtn/ModalBitrixForm/img/close_icon.svg +3 -0
- package/dist/components/Article/FormBtn/ModalBitrixForm/img/done_icon.svg +3 -0
- package/dist/components/Article/FormBtn/ModalBitrixForm/img/ozon.svg +9 -0
- package/dist/components/Article/FormBtn/ModalBitrixForm/img/ozon_bkg.svg +9 -0
- package/dist/components/Article/FormBtn/ModalBitrixForm/validationFunc.js +14 -0
- package/dist/components/Article/FormBtn/img/clos_icon.svg +6 -0
- package/dist/components/Article/FormBtn/img/close-icon.svg +3 -0
- package/dist/components/Article/ImgArticle/ImgArticle.js +297 -0
- package/dist/components/Article/ImgArticle/ImgArticle.scss +169 -0
- package/dist/components/Article/ImgArticle/img/noPhoto.png +0 -0
- package/dist/components/Article/InformationBlock/InformationBlock.js +200 -0
- package/dist/components/Article/InformationBlock/InformationBlock.scss +89 -0
- package/dist/components/Article/InformationBlock/img/bell.svg +9 -0
- package/dist/components/Article/ListOfContent/ListOfContent.js +110 -0
- package/dist/components/Article/ListOfContent/ListOfContent.scss +115 -0
- package/dist/components/Article/ListOfContent/img/time_icon.svg +3 -0
- package/dist/components/Article/ListOfContent/img/view_icon.svg +3 -0
- package/dist/components/Article/ModalMiltilevelSidebarSettings/ModalMiltilevelSidebarSettings.js +973 -0
- package/dist/components/Article/ModalMiltilevelSidebarSettings/ModalMiltilevelSidebarSettings.scss +254 -0
- package/dist/components/Article/ModalMiltilevelSidebarSettings/ModalMiltilevelSidebarSettings.stories.js +76 -0
- package/dist/components/Article/ModalMiltilevelSidebarSettings/img/bx-cog.png +0 -0
- package/dist/components/Article/ModalMiltilevelSidebarSettings/img/bx-cog.svg +4 -0
- package/dist/components/Article/ModalMiltilevelSidebarSettings/img/bx-trash.png +0 -0
- package/dist/components/Article/ModalMiltilevelSidebarSettings/img/bx-trash.svg +4 -0
- package/dist/components/Article/ModalMiltilevelSidebarSettings/img/drop_icon.svg +5 -0
- package/dist/components/Article/ModalMiltilevelSidebarSettings/img/edit_icon.svg +6 -0
- package/dist/components/Article/ModalMiltilevelSidebarSettings/img/trash_icon.svg +8 -0
- package/dist/components/Article/ModalReplaceBlock/ModalReplaceBlock.js +85 -0
- package/dist/components/Article/ModalReplaceBlock/ModalReplaceBlock.scss +72 -0
- package/dist/components/Article/SelectedBlocks/SelectedBlocks.js +281 -0
- package/dist/components/Article/SelectedBlocks/SelectedBlocks.scss +0 -0
- package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/ModalSelectionSocialMedia.js +130 -0
- package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/ModalSelectionSocialMedia.scss +65 -0
- package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/img/Facebook.svg +4 -0
- package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/img/OK.svg +4 -0
- package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/img/Xcom.svg +9 -0
- package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/img/linkedin.svg +5 -0
- package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/img/tg.svg +4 -0
- package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/img/vk.svg +4 -0
- package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/img/wtsp.svg +4 -0
- package/dist/components/Article/SocialMedia/SocialMedia.js +242 -0
- package/dist/components/Article/SocialMedia/SocialMedia.scss +57 -0
- package/dist/components/Article/SocialMedia/img/dzen.svg +4 -0
- package/dist/components/Article/SocialMedia/img/facebook.svg +4 -0
- package/dist/components/Article/SocialMedia/img/insta.svg +9 -0
- package/dist/components/Article/SocialMedia/img/linkendIn.svg +5 -0
- package/dist/components/Article/SocialMedia/img/ok.svg +4 -0
- package/dist/components/Article/SocialMedia/img/pikabu.svg +9 -0
- package/dist/components/Article/SocialMedia/img/telegram.svg +4 -0
- package/dist/components/Article/SocialMedia/img/vcru.svg +0 -0
- package/dist/components/Article/SocialMedia/img/vk.svg +4 -0
- package/dist/components/Article/SocialMedia/img/wp.svg +4 -0
- package/dist/components/Article/SocialMedia/img/x.svg +9 -0
- package/dist/components/Article/TextArticle/TextArticle.js +257 -0
- package/dist/components/Article/TextArticle/TextArticle.scss +156 -0
- package/dist/components/Article/TextArticle/img/dndMenu.svg +1 -0
- package/dist/components/Article/TitleText/TitleText.js +157 -0
- package/dist/components/Article/TitleText/TitleText.scss +74 -0
- package/dist/components/Article/VideoArticle/VideoArticle.js +248 -0
- package/dist/components/Article/VideoArticle/VideoArticle.scss +147 -0
- package/dist/components/Buttons/ButtonActionDrop/ButtonActionDrop.js +109 -0
- package/dist/components/Buttons/ButtonActionDrop/ButtonActionDrop.scss +97 -0
- package/dist/components/Buttons/ButtonActionDrop/img/bx-dots-horizontal-rounded.svg +3 -0
- package/package.json +3 -2
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Editor = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _htmlReactParser = _interopRequireDefault(require("html-react-parser"));
|
|
11
|
+
require("./Editor.scss");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
15
|
+
var Editor = exports.Editor = function Editor(_ref) {
|
|
16
|
+
var handleInput = _ref.handleInput;
|
|
17
|
+
// const [content, setContent] = useState('<p><a href="https://apps0.ecomru.ru:4453/docs#/" target="_blank" style="color: blue;">Методы</a> для <u><font color="#e0ad2e">редактора</font></u><b style=""><u style=""><font color="#e0ad2e"></font></u></b></p>');
|
|
18
|
+
// const [finalHTML, setFinalHTML] = useState('');
|
|
19
|
+
var editorRef = (0, _react.useRef)(null);
|
|
20
|
+
|
|
21
|
+
// Функция для изменения жирности текста
|
|
22
|
+
var toggleBold = function toggleBold() {
|
|
23
|
+
document.execCommand('bold');
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// Функция для изменения курсива текста
|
|
27
|
+
var toggleItalic = function toggleItalic() {
|
|
28
|
+
document.execCommand('italic');
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// Функция для изменения курсива текста
|
|
32
|
+
var toggleUnderline = function toggleUnderline() {
|
|
33
|
+
document.execCommand('underline');
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Функция для изменения цвета текста
|
|
37
|
+
var changeTextColor = function changeTextColor() {
|
|
38
|
+
var color = prompt('Введите цвет для текста (например, red, #ff5733):', '');
|
|
39
|
+
if (color) {
|
|
40
|
+
document.execCommand('foreColor', false, color); // Изменяем цвет текста
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// Функция для обновления содержимого редактора
|
|
45
|
+
var handleChange = function handleChange() {
|
|
46
|
+
if (editorRef.current) {
|
|
47
|
+
// setContent(editorRef.current.innerHTML); // Обновляем состояние содержимого редактора
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// Функция для записи итоговой разметки
|
|
52
|
+
var saveHTML = function saveHTML() {
|
|
53
|
+
// setFinalHTML(editorRef.current.innerHTML);
|
|
54
|
+
// Сохраняем текущую разметку в состояние finalHTML
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// Функция для добавления текста и ссылки
|
|
58
|
+
var insertLink = function insertLink() {
|
|
59
|
+
var url = prompt('Введите URL ссылки:', '');
|
|
60
|
+
var linkText = prompt('Введите текст ссылки:', '');
|
|
61
|
+
if (url && linkText) {
|
|
62
|
+
var selection = window.getSelection();
|
|
63
|
+
var range = selection.getRangeAt(0);
|
|
64
|
+
var linkNode = document.createElement('a');
|
|
65
|
+
linkNode.href = url;
|
|
66
|
+
linkNode.target = '_blank';
|
|
67
|
+
linkNode.textContent = linkText;
|
|
68
|
+
linkNode.style.color = 'blue';
|
|
69
|
+
range.deleteContents(); // Удаляем выбранный текст
|
|
70
|
+
range.insertNode(linkNode); // Вставляем ссылку
|
|
71
|
+
}
|
|
72
|
+
handleInput();
|
|
73
|
+
};
|
|
74
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
75
|
+
className: "editor-article"
|
|
76
|
+
}, /*#__PURE__*/_react["default"].createElement("button", {
|
|
77
|
+
className: "editor-article__btn",
|
|
78
|
+
onClick: toggleBold
|
|
79
|
+
}, "\u0416\u0438\u0440\u043D\u044B\u0439"), /*#__PURE__*/_react["default"].createElement("button", {
|
|
80
|
+
className: "editor-article__btn",
|
|
81
|
+
onClick: toggleItalic
|
|
82
|
+
}, "\u041A\u0443\u0440\u0441\u0438\u0432"), /*#__PURE__*/_react["default"].createElement("button", {
|
|
83
|
+
className: "editor-article__btn",
|
|
84
|
+
onClick: toggleUnderline
|
|
85
|
+
}, "\u041F\u043E\u0434\u0447\u0435\u0440\u043A\u0438\u0432\u0430\u043D\u0438\u0435"), /*#__PURE__*/_react["default"].createElement("button", {
|
|
86
|
+
className: "editor-article__btn",
|
|
87
|
+
onClick: changeTextColor
|
|
88
|
+
}, "\u0426\u0432\u0435\u0442 \u0442\u0435\u043A\u0441\u0442\u0430"), /*#__PURE__*/_react["default"].createElement("button", {
|
|
89
|
+
className: "editor-article__btn",
|
|
90
|
+
onClick: insertLink
|
|
91
|
+
}, "\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443"));
|
|
92
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.editor-article {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 4px;
|
|
4
|
+
position: relative;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
|
|
7
|
+
&__modal-link {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: 12px;
|
|
11
|
+
padding: 12px;
|
|
12
|
+
top: calc(100% + 4px);
|
|
13
|
+
position: absolute;
|
|
14
|
+
width: 300px;
|
|
15
|
+
height: auto;
|
|
16
|
+
background-color: white;
|
|
17
|
+
border: 1px solid black;
|
|
18
|
+
border-radius: 12px;
|
|
19
|
+
border: 1px solid #EDEFFB;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&__btn {
|
|
23
|
+
padding-left: 4px;
|
|
24
|
+
padding-right: 4px;
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
background-color: #EDEFFB;
|
|
29
|
+
border-radius: 4px;
|
|
30
|
+
min-width: 24px;
|
|
31
|
+
height: 24px;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
border: none;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="18" height="18" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id="bx-link-alt.svg">
|
|
3
|
+
<path id="Vector" d="M2.81466 13.6851C3.12391 13.9948 3.49131 14.2404 3.89574 14.4076C4.30017 14.5749 4.73367 14.6606 5.17133 14.6598C5.60908 14.6606 6.04267 14.5749 6.44721 14.4076C6.85175 14.2403 7.21927 13.9948 7.52866 13.6851L9.41399 11.7991L8.47133 10.8565L6.58599 12.7425C6.21031 13.1165 5.70178 13.3265 5.17166 13.3265C4.64155 13.3265 4.13301 13.1165 3.75733 12.7425C3.383 12.367 3.1728 11.8584 3.1728 11.3281C3.1728 10.7979 3.383 10.2893 3.75733 9.91381L5.64333 8.02848L4.70066 7.08581L2.81466 8.97115C2.19053 9.59678 1.84003 10.4444 1.84003 11.3281C1.84003 12.2119 2.19053 13.0595 2.81466 13.6851ZM13.1853 8.02848C13.8091 7.40267 14.1594 6.55509 14.1594 5.67148C14.1594 4.78787 13.8091 3.94029 13.1853 3.31448C12.5597 2.69035 11.712 2.33984 10.8283 2.33984C9.94461 2.33984 9.09697 2.69035 8.47133 3.31448L6.58599 5.20048L7.52866 6.14315L9.41399 4.25715C9.78968 3.88314 10.2982 3.67316 10.8283 3.67316C11.3584 3.67316 11.867 3.88314 12.2427 4.25715C12.617 4.63266 12.8272 5.14126 12.8272 5.67148C12.8272 6.2017 12.617 6.7103 12.2427 7.08581L10.3567 8.97115L11.2993 9.91381L13.1853 8.02848Z" fill="#636D65"/>
|
|
4
|
+
<path id="Vector_2" d="M5.64267 11.7992L4.69934 10.8566L10.3573 5.19922L11.3 6.14255L5.64267 11.7992Z" fill="#636D65"/>
|
|
5
|
+
</g>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.FormBtn = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _ButtonBasic = _interopRequireDefault(require("../../Buttons/ButtonBasic/ButtonBasic"));
|
|
11
|
+
var _ModalBitrixForm = require("./ModalBitrixForm/ModalBitrixForm");
|
|
12
|
+
var _EditWrapper = require("../EditWrapper/EditWrapper");
|
|
13
|
+
require("./FormBtn.scss");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
17
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
18
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
20
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
21
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
22
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
23
|
+
var formStubTitle = '';
|
|
24
|
+
var formStubSubTitle = '';
|
|
25
|
+
var formStubBitrixToken = 'hxdxe0cpclw65c0j';
|
|
26
|
+
var FormBtn = exports.FormBtn = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
27
|
+
var _window$location$href;
|
|
28
|
+
var data = _ref.data,
|
|
29
|
+
onChange = _ref.onChange,
|
|
30
|
+
changeContent = _ref.changeContent,
|
|
31
|
+
position = _ref.position,
|
|
32
|
+
setContentArr = _ref.setContentArr,
|
|
33
|
+
id = _ref.id,
|
|
34
|
+
setCurrentIndex = _ref.setCurrentIndex,
|
|
35
|
+
ind = _ref.ind,
|
|
36
|
+
setIsModal = _ref.setIsModal,
|
|
37
|
+
before = _ref.before,
|
|
38
|
+
setBeforeBlock = _ref.setBeforeBlock,
|
|
39
|
+
deleteBlock = _ref.deleteBlock,
|
|
40
|
+
_ref$readonly = _ref.readonly,
|
|
41
|
+
readonly = _ref$readonly === void 0 ? false : _ref$readonly,
|
|
42
|
+
draggableElement = _ref.draggableElement,
|
|
43
|
+
setDraggableElement = _ref.setDraggableElement,
|
|
44
|
+
articleId = _ref.articleId,
|
|
45
|
+
fetchDataById = _ref.fetchDataById,
|
|
46
|
+
changeBlock = _ref.changeBlock;
|
|
47
|
+
var _useState = (0, _react.useState)(false),
|
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
+
isModalBitrix = _useState2[0],
|
|
50
|
+
setIsModalBitrix = _useState2[1];
|
|
51
|
+
var activeLang = localStorage.getItem('lang');
|
|
52
|
+
var activePortal = localStorage.getItem('portal_id');
|
|
53
|
+
var formStubData = [{
|
|
54
|
+
id: 'FIELDS[TITLE]',
|
|
55
|
+
placeholder: 'Название лида',
|
|
56
|
+
hidden: true,
|
|
57
|
+
value: 'Лид клиент',
|
|
58
|
+
inputType: 'text',
|
|
59
|
+
type: 'input'
|
|
60
|
+
}, {
|
|
61
|
+
id: 'FIELDS[NAME]',
|
|
62
|
+
placeholder: 'Имя',
|
|
63
|
+
inputType: 'text',
|
|
64
|
+
type: 'input',
|
|
65
|
+
required: true
|
|
66
|
+
}, {
|
|
67
|
+
id: 'FIELDS[EMAIL][0][VALUE]',
|
|
68
|
+
placeholder: 'Email',
|
|
69
|
+
type: 'input',
|
|
70
|
+
inputType: 'email'
|
|
71
|
+
}, {
|
|
72
|
+
id: 'FIELDS[PHONE][0][VALUE]',
|
|
73
|
+
placeholder: 'Номер телефона',
|
|
74
|
+
type: 'input',
|
|
75
|
+
inputType: 'tel'
|
|
76
|
+
}, {
|
|
77
|
+
id: 'FIELDS[COMMENTS]',
|
|
78
|
+
placeholder: 'Комментарии',
|
|
79
|
+
type: 'textarea',
|
|
80
|
+
inputType: 'text'
|
|
81
|
+
}, {
|
|
82
|
+
id: 'FIELDS[SOURCE_ID]',
|
|
83
|
+
placeholder: 'выбирается из справочника источников в CRM',
|
|
84
|
+
type: 'input',
|
|
85
|
+
hidden: true,
|
|
86
|
+
value: ((_window$location$href = window.location.href) === null || _window$location$href === void 0 ? void 0 : _window$location$href.indexOf('ecomru')) > -1 ? 4 : 13
|
|
87
|
+
}, {
|
|
88
|
+
id: 'FIELDS[SOURCE_DESCRIPTION]',
|
|
89
|
+
placeholder: 'URL страницы',
|
|
90
|
+
type: 'input',
|
|
91
|
+
value: window.location.href,
|
|
92
|
+
hidden: true
|
|
93
|
+
}, {
|
|
94
|
+
id: 'FIELDS[ASSIGNED_BY_ID]',
|
|
95
|
+
placeholder: 'ФИО ответственного',
|
|
96
|
+
type: 'input',
|
|
97
|
+
value: 11,
|
|
98
|
+
hidden: true
|
|
99
|
+
}, {
|
|
100
|
+
id: 'FIELDS[UTM_CAMPAIGN]',
|
|
101
|
+
placeholder: 'Обозначение рекламной кампании',
|
|
102
|
+
type: 'input',
|
|
103
|
+
value: '',
|
|
104
|
+
hidden: true
|
|
105
|
+
}, {
|
|
106
|
+
id: 'FIELDS[UTM_CONTENT]',
|
|
107
|
+
placeholder: 'Содержание кампании',
|
|
108
|
+
type: 'input',
|
|
109
|
+
value: '',
|
|
110
|
+
hidden: true
|
|
111
|
+
}, {
|
|
112
|
+
id: 'FIELDS[UTM_MEDIUM]',
|
|
113
|
+
placeholder: 'Тип трафика',
|
|
114
|
+
value: '',
|
|
115
|
+
type: 'input',
|
|
116
|
+
hidden: true
|
|
117
|
+
}, {
|
|
118
|
+
id: 'FIELDS[UTM_SOURCE]',
|
|
119
|
+
placeholder: 'Рекламная система',
|
|
120
|
+
value: '',
|
|
121
|
+
type: 'input',
|
|
122
|
+
hidden: true
|
|
123
|
+
}, {
|
|
124
|
+
id: 'FIELDS[UTM_TERM]',
|
|
125
|
+
placeholder: 'Условие поиска кампании',
|
|
126
|
+
value: '',
|
|
127
|
+
type: 'input',
|
|
128
|
+
hidden: true
|
|
129
|
+
}];
|
|
130
|
+
var currentColor = function currentColor() {
|
|
131
|
+
if (activePortal == '6') return '#22C55E'; //gtcom зел
|
|
132
|
+
if (activePortal == '2') return '#1890FF'; //ecom гол
|
|
133
|
+
if (activePortal == '1') return '#3900B1'; //ecom фиол
|
|
134
|
+
return '#3900B1';
|
|
135
|
+
};
|
|
136
|
+
var translatePlaceholderOpen = function translatePlaceholderOpen() {
|
|
137
|
+
if (activeLang == 'ru') return 'Получить консультацию';
|
|
138
|
+
if (activeLang == 'en') return 'Leave a request';
|
|
139
|
+
if (activeLang == 'tr') return "Bir istek bırakın";
|
|
140
|
+
return 'Получить консультацию';
|
|
141
|
+
};
|
|
142
|
+
var translateTitle = function translateTitle() {
|
|
143
|
+
if (activeLang == 'en') return 'Free consultation';
|
|
144
|
+
if (activeLang == 'tr') return 'Uzmanlarımızdan ücretsiz';
|
|
145
|
+
return 'Бесплатная консультация';
|
|
146
|
+
};
|
|
147
|
+
var translateDescription = function translateDescription() {
|
|
148
|
+
if (activeLang == 'en') return 'from our expert';
|
|
149
|
+
if (activeLang == 'tr') return 'danışmanlık';
|
|
150
|
+
return 'от нашего специалиста';
|
|
151
|
+
};
|
|
152
|
+
// Удалить блок
|
|
153
|
+
var handleDeleteBlock = function handleDeleteBlock(e) {
|
|
154
|
+
// setContent(e.currentTarget.textContent)
|
|
155
|
+
setContentArr(function (prev) {
|
|
156
|
+
return prev.filter(function (el) {
|
|
157
|
+
if ((el === null || el === void 0 ? void 0 : el.block_id) != id) {
|
|
158
|
+
return el;
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
deleteBlock(id);
|
|
163
|
+
};
|
|
164
|
+
(0, _react.useEffect)(function () {
|
|
165
|
+
setCurrentIndex(ind);
|
|
166
|
+
setBeforeBlock(before);
|
|
167
|
+
}, []);
|
|
168
|
+
return /*#__PURE__*/_react["default"].createElement(_EditWrapper.EditWrapper, {
|
|
169
|
+
id: id,
|
|
170
|
+
before: before,
|
|
171
|
+
readonly: readonly,
|
|
172
|
+
deleteFunc: function deleteFunc(e) {
|
|
173
|
+
return handleDeleteBlock(id);
|
|
174
|
+
},
|
|
175
|
+
type: "form",
|
|
176
|
+
articleId: articleId,
|
|
177
|
+
changeBlock: changeBlock,
|
|
178
|
+
draggableElement: draggableElement,
|
|
179
|
+
setDraggableElement: setDraggableElement,
|
|
180
|
+
fetchDataById: fetchDataById,
|
|
181
|
+
child: /*#__PURE__*/_react["default"].createElement("div", {
|
|
182
|
+
className: "form-consultation",
|
|
183
|
+
tabIndex: 0,
|
|
184
|
+
onClick: function onClick(e) {
|
|
185
|
+
console.log(before);
|
|
186
|
+
setCurrentIndex(ind);
|
|
187
|
+
setBeforeBlock(before);
|
|
188
|
+
},
|
|
189
|
+
onContextMenu: function onContextMenu(e) {
|
|
190
|
+
if (!readonly) {
|
|
191
|
+
e.preventDefault();
|
|
192
|
+
setCurrentIndex(ind);
|
|
193
|
+
setIsModal(true);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}, isModalBitrix && /*#__PURE__*/_react["default"].createElement(_ModalBitrixForm.ModalBitrixForm, {
|
|
197
|
+
formTitle: "\u0417\u0430\u044F\u0432\u043A\u0430 \u043D\u0430 \u043A\u043E\u043D\u0441\u0443\u043B\u044C\u0442\u0430\u0446\u0438\u044E",
|
|
198
|
+
setIsModal: function setIsModal(e) {
|
|
199
|
+
return setIsModalBitrix(e);
|
|
200
|
+
},
|
|
201
|
+
inputArr: formStubData,
|
|
202
|
+
bitrixToken: formStubBitrixToken,
|
|
203
|
+
subTitle: 'Оставьте заявку и получите бесплатную консультацию'
|
|
204
|
+
}), /*#__PURE__*/_react["default"].createElement("p", {
|
|
205
|
+
className: "text_blue",
|
|
206
|
+
onClick: function onClick(e) {
|
|
207
|
+
setCurrentIndex(ind);
|
|
208
|
+
setBeforeBlock(before);
|
|
209
|
+
},
|
|
210
|
+
style: {
|
|
211
|
+
color: currentColor()
|
|
212
|
+
}
|
|
213
|
+
}, translateTitle()), /*#__PURE__*/_react["default"].createElement("p", {
|
|
214
|
+
className: "text_grey"
|
|
215
|
+
}, translateDescription()), /*#__PURE__*/_react["default"].createElement(_ButtonBasic["default"], {
|
|
216
|
+
green: true,
|
|
217
|
+
maxWidth: "560px",
|
|
218
|
+
width: "100%",
|
|
219
|
+
size: "60px",
|
|
220
|
+
onClick: function onClick(e) {
|
|
221
|
+
return setIsModalBitrix(true);
|
|
222
|
+
},
|
|
223
|
+
text: translatePlaceholderOpen(),
|
|
224
|
+
style: {
|
|
225
|
+
marginTop: '14px'
|
|
226
|
+
}
|
|
227
|
+
}))
|
|
228
|
+
});
|
|
229
|
+
});
|