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.
Files changed (105) hide show
  1. package/dist/common/fetchUrls.js +7 -2
  2. package/dist/common/headers.js +2 -1
  3. package/dist/common/hooks/useDebounce.js +37 -0
  4. package/dist/common/hooks/useTextSelectionInModal.js +41 -0
  5. package/dist/components/Article/ArcticleWiki/ArcticleWiki.stories.js +152 -0
  6. package/dist/components/Article/ArcticleWiki/ArticleWiki.js +775 -0
  7. package/dist/components/Article/ArcticleWiki/ArticleWiki.scss +278 -0
  8. package/dist/components/Article/ArticleViewV2/ArticleViewV2.js +791 -0
  9. package/dist/components/Article/ArticleViewV2/ArticleViewV2.scss +245 -0
  10. package/dist/components/Article/ArticleViewV2/ArticleViewV2.stories.js +166 -0
  11. package/dist/components/Article/ArticleViewV2/img/bell.svg +9 -0
  12. package/dist/components/Article/ArticleViewV2/img/btn-add-round.svg +4 -0
  13. package/dist/components/Article/ArticleViewV2/img/calendar_icon.svg +6 -0
  14. package/dist/components/Article/ArticleViewV2/img/close-round.svg +3 -0
  15. package/dist/components/Article/ArticleViewV2/img/close.svg +9 -0
  16. package/dist/components/Article/ArticleViewV2/img/copy_icon.svg +5 -0
  17. package/dist/components/Article/ArticleViewV2/img/dndMenu.svg +1 -0
  18. package/dist/components/Article/ArticleViewV2/img/info.svg +9 -0
  19. package/dist/components/Article/ArticleViewV2/img/ok_icon.svg +5 -0
  20. package/dist/components/Article/ArticleViewV2/img/plus_circle.svg +6 -0
  21. package/dist/components/Article/ArticleViewV2/img/share_icon.svg +5 -0
  22. package/dist/components/Article/ArticleViewV2/img/tg.svg +3 -0
  23. package/dist/components/Article/ArticleViewV2/img/tg_icon.svg +5 -0
  24. package/dist/components/Article/ArticleViewV2/img/time_icon.svg +6 -0
  25. package/dist/components/Article/ArticleViewV2/img/view_icon.svg +6 -0
  26. package/dist/components/Article/ArticleViewV2/img/vk_icon.svg +5 -0
  27. package/dist/components/Article/ArticleViewV2/img/whatsapp_icon.svg +5 -0
  28. package/dist/components/Article/Breadcrumb/Breadcrumb.js +69 -0
  29. package/dist/components/Article/Breadcrumb/Breadcrumb.scss +96 -0
  30. package/dist/components/Article/Breadcrumb/img/drop-right.svg +3 -0
  31. package/dist/components/Article/Breadcrumb/img/home_icon.svg +5 -0
  32. package/dist/components/Article/EditWrapper/EditWrapper.js +108 -0
  33. package/dist/components/Article/EditWrapper/EditWrapper.scss +93 -0
  34. package/dist/components/Article/EditWrapper/img/bx-grid-vertical.svg +5 -0
  35. package/dist/components/Article/Editor/Editor.js +92 -0
  36. package/dist/components/Article/Editor/Editor.scss +35 -0
  37. package/dist/components/Article/Editor/img/copy.svg +6 -0
  38. package/dist/components/Article/FormBtn/FormBtn.js +229 -0
  39. package/dist/components/Article/FormBtn/FormBtn.scss +458 -0
  40. package/dist/components/Article/FormBtn/ModalBitrixForm/ModalBitrixForm.js +282 -0
  41. package/dist/components/Article/FormBtn/ModalBitrixForm/ModalBitrixForm.scss +140 -0
  42. package/dist/components/Article/FormBtn/ModalBitrixForm/img/close_icon.svg +3 -0
  43. package/dist/components/Article/FormBtn/ModalBitrixForm/img/done_icon.svg +3 -0
  44. package/dist/components/Article/FormBtn/ModalBitrixForm/img/ozon.svg +9 -0
  45. package/dist/components/Article/FormBtn/ModalBitrixForm/img/ozon_bkg.svg +9 -0
  46. package/dist/components/Article/FormBtn/ModalBitrixForm/validationFunc.js +14 -0
  47. package/dist/components/Article/FormBtn/img/clos_icon.svg +6 -0
  48. package/dist/components/Article/FormBtn/img/close-icon.svg +3 -0
  49. package/dist/components/Article/ImgArticle/ImgArticle.js +297 -0
  50. package/dist/components/Article/ImgArticle/ImgArticle.scss +169 -0
  51. package/dist/components/Article/ImgArticle/img/noPhoto.png +0 -0
  52. package/dist/components/Article/InformationBlock/InformationBlock.js +200 -0
  53. package/dist/components/Article/InformationBlock/InformationBlock.scss +89 -0
  54. package/dist/components/Article/InformationBlock/img/bell.svg +9 -0
  55. package/dist/components/Article/ListOfContent/ListOfContent.js +110 -0
  56. package/dist/components/Article/ListOfContent/ListOfContent.scss +115 -0
  57. package/dist/components/Article/ListOfContent/img/time_icon.svg +3 -0
  58. package/dist/components/Article/ListOfContent/img/view_icon.svg +3 -0
  59. package/dist/components/Article/ModalMiltilevelSidebarSettings/ModalMiltilevelSidebarSettings.js +973 -0
  60. package/dist/components/Article/ModalMiltilevelSidebarSettings/ModalMiltilevelSidebarSettings.scss +254 -0
  61. package/dist/components/Article/ModalMiltilevelSidebarSettings/ModalMiltilevelSidebarSettings.stories.js +76 -0
  62. package/dist/components/Article/ModalMiltilevelSidebarSettings/img/bx-cog.png +0 -0
  63. package/dist/components/Article/ModalMiltilevelSidebarSettings/img/bx-cog.svg +4 -0
  64. package/dist/components/Article/ModalMiltilevelSidebarSettings/img/bx-trash.png +0 -0
  65. package/dist/components/Article/ModalMiltilevelSidebarSettings/img/bx-trash.svg +4 -0
  66. package/dist/components/Article/ModalMiltilevelSidebarSettings/img/drop_icon.svg +5 -0
  67. package/dist/components/Article/ModalMiltilevelSidebarSettings/img/edit_icon.svg +6 -0
  68. package/dist/components/Article/ModalMiltilevelSidebarSettings/img/trash_icon.svg +8 -0
  69. package/dist/components/Article/ModalReplaceBlock/ModalReplaceBlock.js +85 -0
  70. package/dist/components/Article/ModalReplaceBlock/ModalReplaceBlock.scss +72 -0
  71. package/dist/components/Article/SelectedBlocks/SelectedBlocks.js +281 -0
  72. package/dist/components/Article/SelectedBlocks/SelectedBlocks.scss +0 -0
  73. package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/ModalSelectionSocialMedia.js +130 -0
  74. package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/ModalSelectionSocialMedia.scss +65 -0
  75. package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/img/Facebook.svg +4 -0
  76. package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/img/OK.svg +4 -0
  77. package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/img/Xcom.svg +9 -0
  78. package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/img/linkedin.svg +5 -0
  79. package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/img/tg.svg +4 -0
  80. package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/img/vk.svg +4 -0
  81. package/dist/components/Article/SocialMedia/ModalSelectionSocialMedia/img/wtsp.svg +4 -0
  82. package/dist/components/Article/SocialMedia/SocialMedia.js +242 -0
  83. package/dist/components/Article/SocialMedia/SocialMedia.scss +57 -0
  84. package/dist/components/Article/SocialMedia/img/dzen.svg +4 -0
  85. package/dist/components/Article/SocialMedia/img/facebook.svg +4 -0
  86. package/dist/components/Article/SocialMedia/img/insta.svg +9 -0
  87. package/dist/components/Article/SocialMedia/img/linkendIn.svg +5 -0
  88. package/dist/components/Article/SocialMedia/img/ok.svg +4 -0
  89. package/dist/components/Article/SocialMedia/img/pikabu.svg +9 -0
  90. package/dist/components/Article/SocialMedia/img/telegram.svg +4 -0
  91. package/dist/components/Article/SocialMedia/img/vcru.svg +0 -0
  92. package/dist/components/Article/SocialMedia/img/vk.svg +4 -0
  93. package/dist/components/Article/SocialMedia/img/wp.svg +4 -0
  94. package/dist/components/Article/SocialMedia/img/x.svg +9 -0
  95. package/dist/components/Article/TextArticle/TextArticle.js +257 -0
  96. package/dist/components/Article/TextArticle/TextArticle.scss +156 -0
  97. package/dist/components/Article/TextArticle/img/dndMenu.svg +1 -0
  98. package/dist/components/Article/TitleText/TitleText.js +157 -0
  99. package/dist/components/Article/TitleText/TitleText.scss +74 -0
  100. package/dist/components/Article/VideoArticle/VideoArticle.js +248 -0
  101. package/dist/components/Article/VideoArticle/VideoArticle.scss +147 -0
  102. package/dist/components/Buttons/ButtonActionDrop/ButtonActionDrop.js +109 -0
  103. package/dist/components/Buttons/ButtonActionDrop/ButtonActionDrop.scss +97 -0
  104. package/dist/components/Buttons/ButtonActionDrop/img/bx-dots-horizontal-rounded.svg +3 -0
  105. package/package.json +3 -2
@@ -0,0 +1,281 @@
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["default"] = void 0;
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _TextArticle = require("../TextArticle/TextArticle");
11
+ var _TitleText = require("../TitleText/TitleText");
12
+ var _SocialMedia = require("../SocialMedia/SocialMedia");
13
+ var _InformationBlock = require("../InformationBlock/InformationBlock");
14
+ var _ModalReplaceBlock = require("../ModalReplaceBlock/ModalReplaceBlock");
15
+ var _ImgArticle = require("../ImgArticle/ImgArticle");
16
+ var _FormBtn = require("../FormBtn/FormBtn");
17
+ var _VideoArticle = require("../VideoArticle/VideoArticle");
18
+ var _headers = _interopRequireDefault(require("../../../common/headers"));
19
+ require("./SelectedBlocks.scss");
20
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
21
+ 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); }
22
+ 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; }
23
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
24
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
25
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
26
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
27
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
28
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
29
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
30
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
31
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
32
+ 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."); }
33
+ 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; } }
34
+ 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; }
35
+ 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; } }
36
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
37
+ var SelectedBlocks = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
38
+ var apiData = _ref.apiData,
39
+ articleId = _ref.articleId,
40
+ setListLinks = _ref.setListLinks,
41
+ readonly = _ref.readonly,
42
+ fetchDataById = _ref.fetchDataById,
43
+ data = _ref.data;
44
+ var _useState = (0, _react.useState)([]),
45
+ _useState2 = _slicedToArray(_useState, 2),
46
+ content = _useState2[0],
47
+ setContent = _useState2[1];
48
+ var _useState3 = (0, _react.useState)(),
49
+ _useState4 = _slicedToArray(_useState3, 2),
50
+ isModal = _useState4[0],
51
+ setIsModal = _useState4[1];
52
+ var _useState5 = (0, _react.useState)(null),
53
+ _useState6 = _slicedToArray(_useState5, 2),
54
+ currentIndex = _useState6[0],
55
+ setCurrentIndex = _useState6[1];
56
+ var _useState7 = (0, _react.useState)(null),
57
+ _useState8 = _slicedToArray(_useState7, 2),
58
+ beforeBlock = _useState8[0],
59
+ setBeforeBlock = _useState8[1];
60
+ var _useState9 = (0, _react.useState)(null),
61
+ _useState10 = _slicedToArray(_useState9, 2),
62
+ draggableElement = _useState10[0],
63
+ setDraggableElement = _useState10[1];
64
+
65
+ // Первоначальный рендер
66
+ // записываем контент если есть, если нет - создаем 1 новый блок
67
+ (0, _react.useEffect)(function () {
68
+ var _apiData$blocks;
69
+ if ((apiData === null || apiData === void 0 || (_apiData$blocks = apiData.blocks) === null || _apiData$blocks === void 0 ? void 0 : _apiData$blocks.length) > 0 || readonly) {
70
+ var blocks = apiData === null || apiData === void 0 ? void 0 : apiData.blocks;
71
+ setContent(blocks);
72
+ } else {
73
+ if (articleId && articleId !== -1 && (content === null || content === void 0 ? void 0 : content.length) === 0) {
74
+ fetchCreateBlock('text', null);
75
+ }
76
+ }
77
+ }, [apiData, articleId]);
78
+
79
+ // Создание блока, в ответ получаем id созданного
80
+ var fetchCreateBlock = function fetchCreateBlock(type) {
81
+ var before = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
82
+ var url;
83
+ if (!window.location.hostname.match('localhost')) {
84
+ url = "https://apps0.ecomru.ru:4447/api/v2/article/create_block";
85
+ } else {
86
+ url = "https://apps0.ecomru.ru:4447/api/v2/article/create_block";
87
+ }
88
+ var body = JSON.stringify({
89
+ type: type ? type : 'text',
90
+ before: before,
91
+ article_id: articleId
92
+ });
93
+ fetch(url, {
94
+ body: body,
95
+ method: 'POST',
96
+ headers: _headers["default"]
97
+ }).then(function (res) {
98
+ return res.json();
99
+ }).then(function (json) {
100
+ var init_data = {
101
+ block_type: 'text',
102
+ block_before: before,
103
+ block_id: json,
104
+ content: [{
105
+ value: ''
106
+ }]
107
+ };
108
+ if (content.length > 0) {
109
+ var index = content.findIndex(function (item) {
110
+ return item.block_id === before;
111
+ });
112
+ var newArr = [].concat(_toConsumableArray(content.slice(0, currentIndex + 1)), [
113
+ // Все элементы до индекса
114
+ init_data], _toConsumableArray(content.slice(currentIndex + 1)));
115
+ setContent(newArr);
116
+
117
+ // let content_init = content
118
+ // console.log(content_init)
119
+ // let current_content = content_init.splice(0, 0, init_data);
120
+ // console.log(current_content)
121
+ //setContent((prev) => [...prev, init_data])
122
+ } else {
123
+ setContent([init_data]);
124
+ }
125
+ })["catch"](function (err) {
126
+ return console.error(err);
127
+ });
128
+ };
129
+
130
+ // Изменение контента блока
131
+ var changeContent = function changeContent(id, content) {
132
+ var url;
133
+ if (!window.location.hostname.match('localhost')) {
134
+ url = "https://apps0.ecomru.ru:4447/api/v2/article/article_content";
135
+ } else {
136
+ url = "https://apps0.ecomru.ru:4447/api/v2/article/article_content";
137
+ }
138
+ var body = JSON.stringify({
139
+ block_id: id,
140
+ content: content
141
+ });
142
+ fetch(url, {
143
+ body: body,
144
+ method: 'POST',
145
+ headers: _headers["default"]
146
+ }).then(function (res) {
147
+ return res.json();
148
+ }).then(function (json) {
149
+ console.log(json);
150
+ })["catch"](function (err) {
151
+ return console.error(err);
152
+ });
153
+ };
154
+
155
+ // Изменение блока
156
+ var changeBlock = function changeBlock(type, article_id, block_id, before) {
157
+ var url;
158
+ if (!window.location.hostname.match('localhost')) {
159
+ url = "https://apps0.ecomru.ru:4447/api/v2/article/change_block";
160
+ } else {
161
+ url = "https://apps0.ecomru.ru:4447/api/v2/article/change_block";
162
+ }
163
+ var body = JSON.stringify({
164
+ type: type,
165
+ before: before,
166
+ article_id: article_id,
167
+ block_id: block_id
168
+ });
169
+ fetch(url, {
170
+ body: body,
171
+ method: 'PUT',
172
+ headers: _headers["default"]
173
+ }).then(function (res) {
174
+ return res.json();
175
+ }).then(function (json) {
176
+ console.log(json);
177
+ })["catch"](function (err) {
178
+ return console.error(err);
179
+ });
180
+ };
181
+
182
+ // Удаление блока
183
+ var deleteBlock = function deleteBlock(delete_id) {
184
+ var url;
185
+ if (!window.location.hostname.match('localhost')) {
186
+ url = "https://apps0.ecomru.ru:4447/api/v2/article/delete_block?block_id=".concat(delete_id);
187
+ } else {
188
+ url = "https://apps0.ecomru.ru:4447/api/v2/article/delete_block?block_id=".concat(delete_id);
189
+ }
190
+ fetch(url, {
191
+ method: 'DELETE',
192
+ headers: _headers["default"]
193
+ }).then(function (res) {
194
+ return res.json();
195
+ }).then(function (json) {
196
+ console.log(json);
197
+ })["catch"](function (err) {
198
+ return console.error(err);
199
+ });
200
+ };
201
+
202
+ // Добавление блока
203
+ var addNewBlock = function addNewBlock() {
204
+ if (articleId && articleId !== -1) {
205
+ fetchCreateBlock('text', beforeBlock);
206
+ }
207
+ };
208
+ (0, _react.useEffect)(function () {
209
+ var links = content === null || content === void 0 ? void 0 : content.filter(function (el) {
210
+ return el.block_type === 'title';
211
+ }).map(function (el) {
212
+ var _el$content;
213
+ return {
214
+ title: el === null || el === void 0 || (_el$content = el.content) === null || _el$content === void 0 || (_el$content = _el$content[0]) === null || _el$content === void 0 ? void 0 : _el$content.value,
215
+ id: el.block_id
216
+ };
217
+ });
218
+ if (setListLinks) {
219
+ setListLinks(links);
220
+ }
221
+ }, [content]);
222
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, isModal && /*#__PURE__*/_react["default"].createElement(_ModalReplaceBlock.ModalReplaceBlock, {
223
+ currentIndex: currentIndex,
224
+ setIsModal: setIsModal,
225
+ setContent: setContent,
226
+ changeBlock: changeBlock,
227
+ articleId: articleId
228
+ }), /*#__PURE__*/_react["default"].createElement("div", {
229
+ onKeyDown: function onKeyDown(e) {
230
+ if (e.key === 'Enter') {
231
+ console.log(e.key);
232
+ e.preventDefault(e.key);
233
+ addNewBlock();
234
+ }
235
+ }
236
+ }, content === null || content === void 0 ? void 0 : content.map(function (_ref2, ind) {
237
+ var block_type = _ref2.block_type,
238
+ content = _ref2.content,
239
+ block_id = _ref2.block_id,
240
+ block_before = _ref2.block_before;
241
+ var commonProps = _defineProperty({
242
+ id: block_id,
243
+ key: block_id,
244
+ // Используем уникальный блок ID для ключа
245
+ ind: ind,
246
+ setIsModal: setIsModal,
247
+ setCurrentIndex: setCurrentIndex,
248
+ editMode: true,
249
+ data: content,
250
+ changeContent: changeContent,
251
+ before: block_id,
252
+ setBeforeBlock: setBeforeBlock,
253
+ setContentArr: setContent,
254
+ deleteBlock: deleteBlock,
255
+ changeBlock: changeBlock,
256
+ readonly: readonly,
257
+ draggableElement: draggableElement,
258
+ setDraggableElement: setDraggableElement,
259
+ articleId: articleId,
260
+ fetchDataById: fetchDataById
261
+ }, "before", block_before);
262
+ if (block_type == 'text') return /*#__PURE__*/_react["default"].createElement(_TextArticle.TextArticle, commonProps);
263
+ if (block_type == 'title') return /*#__PURE__*/_react["default"].createElement(_TitleText.TitleText, commonProps);
264
+ if (block_type == 'social') return /*#__PURE__*/_react["default"].createElement(_SocialMedia.SocialMedia, _extends({}, commonProps, {
265
+ editMode: true
266
+ }));
267
+ if (block_type == 'info') return /*#__PURE__*/_react["default"].createElement(_InformationBlock.InformationBlock, _extends({}, commonProps, {
268
+ editMode: true
269
+ }));
270
+ if (block_type == 'image') return /*#__PURE__*/_react["default"].createElement(_ImgArticle.ImgArticle, _extends({}, commonProps, {
271
+ editMode: true
272
+ }));
273
+ if (block_type == 'form') return /*#__PURE__*/_react["default"].createElement(_FormBtn.FormBtn, _extends({}, commonProps, {
274
+ editMode: true
275
+ }));
276
+ if (block_type == 'video') return /*#__PURE__*/_react["default"].createElement(_VideoArticle.VideoArticle, _extends({}, commonProps, {
277
+ editMode: true
278
+ }));
279
+ })));
280
+ });
281
+ var _default = exports["default"] = SelectedBlocks;
@@ -0,0 +1,130 @@
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.ModalSelectionSocialMedia = void 0;
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _ButtonBasic = _interopRequireDefault(require("../../../Buttons/ButtonBasic/ButtonBasic"));
11
+ var _InputDinamycPlaceholder = _interopRequireDefault(require("../../../Inputs/InputDinamycPlaceholder/InputDinamycPlaceholder"));
12
+ require("./ModalSelectionSocialMedia.scss");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
14
+ 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); }
15
+ 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; }
16
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
19
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
20
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
21
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
22
+ 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."); }
23
+ 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; } }
24
+ 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; }
25
+ 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; } }
26
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
27
+ var social_list_rus = [{
28
+ name: 'Telegram',
29
+ img: "https://dl.ecomru.ru:9001/dev-images/tg.svg",
30
+ id: 1
31
+ }, {
32
+ name: 'WhatsApp',
33
+ img: "https://dl.ecomru.ru:9001/dev-images/wtsp.svg",
34
+ id: 2
35
+ }, {
36
+ name: 'Одноклассники',
37
+ img: "https://dl.ecomru.ru:9001/dev-images/ok.svg",
38
+ id: 3
39
+ }, {
40
+ name: 'ВКонтакте',
41
+ img: "https://dl.ecomru.ru:9001/dev-images/vk.svg",
42
+ id: 4
43
+ }, {
44
+ name: 'X (Twitter)',
45
+ img: "https://dl.ecomru.ru:9001/dev-images/xcom.svg",
46
+ id: 5
47
+ }, {
48
+ name: 'Linkedin',
49
+ img: "https://dl.ecomru.ru:9001/dev-images/linkedin.svg",
50
+ id: 6
51
+ }, {
52
+ name: 'Facebook',
53
+ img: "https://dl.ecomru.ru:9001/dev-images/facebook.svg",
54
+ id: 7
55
+ }, {
56
+ name: 'Дзен',
57
+ img: "https://dl.ecomru.ru:9001/dev-images/dzen.svg",
58
+ id: 8
59
+ }];
60
+ var social_list_eng = [{
61
+ name: 'X (Twitter)',
62
+ img: "https://dl.ecomru.ru:9001/dev-images/xcom.svg",
63
+ id: 4
64
+ }, {
65
+ name: 'Linkedin',
66
+ img: "https://dl.ecomru.ru:9001/dev-images/linkedin.svg",
67
+ id: 5
68
+ }, {
69
+ name: 'Facebook',
70
+ img: "https://dl.ecomru.ru:9001/dev-images/facebook.svg",
71
+ id: 6
72
+ }];
73
+ var list_media = {
74
+ 'facebook': 'facebook',
75
+ 'dzen.ru': 'dzen',
76
+ 'instagram.com': 'instagram',
77
+ 'linkedin.com': 'linkedin',
78
+ 'vc.ru': 'vc.ru',
79
+ 'ok.ru': 'ok',
80
+ 'pikabu.ru': 'pikabu',
81
+ 't.me': 'telegram',
82
+ 'vk.com': 'vk',
83
+ 'whatsapp.com': 'whatsapp',
84
+ 'x.com': 'x'
85
+ };
86
+ var ModalSelectionSocialMedia = exports.ModalSelectionSocialMedia = function ModalSelectionSocialMedia(_ref) {
87
+ var setIsModal = _ref.setIsModal,
88
+ _ref$activeLang = _ref.activeLang,
89
+ activeLang = _ref$activeLang === void 0 ? 'ru' : _ref$activeLang,
90
+ inputValue = _ref.inputValue,
91
+ setInputValue = _ref.setInputValue;
92
+ var current_list = activeLang == 'ru' ? social_list_rus : social_list_eng;
93
+ var _useState = (0, _react.useState)(''),
94
+ _useState2 = _slicedToArray(_useState, 2),
95
+ insideValue = _useState2[0],
96
+ setInsideValue = _useState2[1];
97
+ var onChangeLink = function onChangeLink(e) {
98
+ setInsideValue(e);
99
+ };
100
+ var saveValue = function saveValue(value) {
101
+ var current;
102
+ for (var key in list_media) {
103
+ if (value.includes(key)) {
104
+ current = list_media[key];
105
+ }
106
+ if (current) {
107
+ setInputValue(_objectSpread(_objectSpread({}, inputValue), {}, _defineProperty({}, current, insideValue)));
108
+ }
109
+ }
110
+ };
111
+ return /*#__PURE__*/_react["default"].createElement("div", {
112
+ className: "modal-selection-social-media"
113
+ }, /*#__PURE__*/_react["default"].createElement(_InputDinamycPlaceholder["default"], {
114
+ placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u0441\u044B\u043B\u043A\u0443",
115
+ onChange: function onChange(e) {
116
+ return onChangeLink(e);
117
+ },
118
+ size: "s"
119
+ }), /*#__PURE__*/_react["default"].createElement(_ButtonBasic["default"], {
120
+ green: true,
121
+ text: "+",
122
+ minWidth: "40px",
123
+ width: "40px",
124
+ size: "40px",
125
+ onClick: function onClick(e) {
126
+ saveValue(insideValue);
127
+ setIsModal(false);
128
+ }
129
+ }));
130
+ };
@@ -0,0 +1,65 @@
1
+ .modal-selection-social-media {
2
+ display: flex;
3
+ width: 100%;
4
+ gap: 12px;
5
+
6
+ &__title {
7
+ color: #2B2B46;
8
+ font-family: "Golos Text";
9
+ font-size: 18px;
10
+ font-style: normal;
11
+ font-weight: 600;
12
+ line-height: 24px;
13
+ margin-left: auto;
14
+ margin-right: auto;
15
+ text-align: center;
16
+ }
17
+
18
+ &__content {
19
+ display: flex;
20
+ height: 100%;
21
+ width: 100%;
22
+ gap: 24px;
23
+ flex-wrap: wrap;
24
+ }
25
+
26
+ &__item-social {
27
+ display: flex;
28
+ flex-direction: column;
29
+ flex-wrap: wrap;
30
+ gap: 8px;
31
+ width: calc(50% - 12px);
32
+ }
33
+
34
+ &__info {
35
+ display: flex;
36
+ align-items: center;
37
+ gap: 8px;
38
+ overflow: hidden;
39
+
40
+ img {
41
+ width: 24px;
42
+ height: 24px;
43
+ object-fit: contain;
44
+ }
45
+ }
46
+
47
+ &__name-social {
48
+ color: #2B2B46;
49
+ font-family: "Golos Text";
50
+ font-size: 15px;
51
+ font-style: normal;
52
+ font-weight: 400;
53
+ line-height: 28px;
54
+ display: -webkit-box;
55
+ -webkit-line-clamp: 1; // количество строк
56
+ -webkit-box-orient: vertical;
57
+ overflow: hidden;
58
+ word-break: break-word;
59
+ hyphens: auto;
60
+ }
61
+
62
+ .btn-basic {
63
+ margin-top: auto;
64
+ }
65
+ }
@@ -0,0 +1,4 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="28" height="28" rx="4" fill="#0863F7"/>
3
+ <path d="M15.0468 20.7476V14.6006H17.1205L17.4288 12.1939H15.0468V10.6609C15.0468 9.96638 15.2403 9.49088 16.237 9.49088H17.5V7.34513C16.8855 7.27928 16.2678 7.24748 15.6498 7.24988C13.8168 7.24988 12.5583 8.36888 12.5583 10.4231V12.1894H10.498V14.5961H12.5628V20.7476H15.0468Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="28" height="28" rx="4" fill="#FF7600"/>
3
+ <path d="M13.9878 14.3125C11.3982 14.3125 9.24585 12.162 9.24585 9.61733C9.24585 6.98467 11.3982 4.83325 13.9887 4.83325C16.6672 4.83325 18.7306 6.98375 18.7306 9.61733C18.726 10.8668 18.2255 12.0633 17.339 12.9439C16.4526 13.8245 15.2528 14.3171 14.0034 14.3134L13.9878 14.3125ZM13.9878 7.59884C12.8914 7.59884 12.0573 8.52008 12.0573 9.61825C12.0573 10.7146 12.8914 11.5488 13.9887 11.5488C15.1299 11.5488 15.9201 10.7146 15.9201 9.61825C15.921 8.51917 15.1299 7.59884 13.9878 7.59884ZM15.8761 18.2193L18.5555 20.8089C19.0826 21.3782 19.0826 22.2123 18.5555 22.7394C17.9854 23.3087 17.1063 23.3087 16.6672 22.7394L13.9887 20.1058L11.3982 22.7394C11.1351 23.0025 10.7831 23.1336 10.3871 23.1336C10.08 23.1336 9.72894 23.0016 9.42094 22.7394C8.89385 22.2123 8.89385 21.3782 9.42094 20.808L12.1434 18.2184C11.1602 17.9273 10.2171 17.515 9.33569 16.991C8.6766 16.6399 8.54552 15.7627 8.8966 15.1036C9.33569 14.4454 10.1259 14.2703 10.8289 14.7094C11.781 15.2904 12.8747 15.5978 13.9901 15.5978C15.1054 15.5978 16.1991 15.2904 17.1512 14.7094C17.8543 14.2703 18.6875 14.4454 19.0826 15.1036C19.4786 15.7627 19.3017 16.639 18.6866 16.991C17.8534 17.5181 16.8872 17.9132 15.877 18.2203L15.8761 18.2193Z" fill="white"/>
4
+ </svg>