ecomlab-components-next 0.1.62 → 0.1.64

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.
@@ -90,7 +90,8 @@ var ArticleViewV2 = function ArticleViewV2(_ref) {
90
90
  listLinks = _ref.listLinks,
91
91
  setListLinks = _ref.setListLinks,
92
92
  setBreadcrumbs = _ref.setBreadcrumbs,
93
- fetchDataById = _ref.fetchDataById;
93
+ fetchDataById = _ref.fetchDataById,
94
+ activeLang = _ref.activeLang;
94
95
  var _useState = (0, _react.useState)(false),
95
96
  _useState2 = _slicedToArray(_useState, 2),
96
97
  showAddBlockPopup = _useState2[0],
@@ -108,29 +109,22 @@ var ArticleViewV2 = function ArticleViewV2(_ref) {
108
109
  _useState8 = _slicedToArray(_useState7, 2),
109
110
  changeId = _useState8[0],
110
111
  setChangeId = _useState8[1];
111
- var _useState9 = (0, _react.useState)(function () {
112
- var _localStorage$getItem;
113
- return (_localStorage$getItem = localStorage.getItem('lang')) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : 'ru';
114
- }),
112
+ var _useState9 = (0, _react.useState)(false),
115
113
  _useState10 = _slicedToArray(_useState9, 2),
116
- activeLang = _useState10[0],
117
- setActiveLang = _useState10[1];
114
+ isDropShare = _useState10[0],
115
+ setIsDropShare = _useState10[1];
118
116
  var _useState11 = (0, _react.useState)(false),
119
117
  _useState12 = _slicedToArray(_useState11, 2),
120
- isDropShare = _useState12[0],
121
- setIsDropShare = _useState12[1];
118
+ isModalSocial = _useState12[0],
119
+ setIsModalSocial = _useState12[1];
122
120
  var _useState13 = (0, _react.useState)(false),
123
121
  _useState14 = _slicedToArray(_useState13, 2),
124
- isModalSocial = _useState14[0],
125
- setIsModalSocial = _useState14[1];
122
+ isChangeTypeModal = _useState14[0],
123
+ setIsChangeTypeModal = _useState14[1];
126
124
  var _useState15 = (0, _react.useState)(false),
127
125
  _useState16 = _slicedToArray(_useState15, 2),
128
- isChangeTypeModal = _useState16[0],
129
- setIsChangeTypeModal = _useState16[1];
130
- var _useState17 = (0, _react.useState)(false),
131
- _useState18 = _slicedToArray(_useState17, 2),
132
- isViewMode = _useState18[0],
133
- setIsViewMode = _useState18[1];
126
+ isViewMode = _useState16[0],
127
+ setIsViewMode = _useState16[1];
134
128
  var componentRefs = [];
135
129
  var onSetTitle = function onSetTitle(value) {
136
130
  var url = "".concat(_fetchUrls.RavshanHttps, "/api/v2/article/set_name");
@@ -785,7 +779,8 @@ var ArticleViewV2 = function ArticleViewV2(_ref) {
785
779
  apiData: apiData,
786
780
  articleId: articleId,
787
781
  setListLinks: setListLinks,
788
- fetchDataById: fetchDataById
782
+ fetchDataById: fetchDataById,
783
+ activeLang: activeLang
789
784
  })))));
790
785
  };
791
786
  var _default = exports["default"] = ArticleViewV2;
@@ -24,7 +24,6 @@ var formStubTitle = '';
24
24
  var formStubSubTitle = '';
25
25
  var formStubBitrixToken = 'hxdxe0cpclw65c0j';
26
26
  var FormBtn = exports.FormBtn = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
27
- var _window$location$href;
28
27
  var data = _ref.data,
29
28
  onChange = _ref.onChange,
30
29
  changeContent = _ref.changeContent,
@@ -43,14 +42,15 @@ var FormBtn = exports.FormBtn = /*#__PURE__*/(0, _react.forwardRef)(function (_r
43
42
  setDraggableElement = _ref.setDraggableElement,
44
43
  articleId = _ref.articleId,
45
44
  fetchDataById = _ref.fetchDataById,
46
- changeBlock = _ref.changeBlock;
45
+ changeBlock = _ref.changeBlock,
46
+ activeLang = _ref.activeLang;
47
47
  var _useState = (0, _react.useState)(false),
48
48
  _useState2 = _slicedToArray(_useState, 2),
49
49
  isModalBitrix = _useState2[0],
50
50
  setIsModalBitrix = _useState2[1];
51
- var activeLang = localStorage.getItem('lang');
52
51
  var activePortal = localStorage.getItem('portal_id');
53
- var formStubData = [{
52
+ var url = "https://globalparsing.".concat(activeLang, "/");
53
+ var formStubData_RU = [{
54
54
  id: 'FIELDS[TITLE]',
55
55
  placeholder: 'Название лида',
56
56
  hidden: true,
@@ -60,41 +60,201 @@ var FormBtn = exports.FormBtn = /*#__PURE__*/(0, _react.forwardRef)(function (_r
60
60
  }, {
61
61
  id: 'FIELDS[NAME]',
62
62
  placeholder: 'Имя',
63
- inputType: 'text',
63
+ inputType: 'name',
64
64
  type: 'input',
65
65
  required: true
66
66
  }, {
67
67
  id: 'FIELDS[EMAIL][0][VALUE]',
68
68
  placeholder: 'Email',
69
69
  type: 'input',
70
- inputType: 'email'
70
+ inputType: 'email',
71
+ required: true
71
72
  }, {
72
73
  id: 'FIELDS[PHONE][0][VALUE]',
73
74
  placeholder: 'Номер телефона',
74
75
  type: 'input',
75
- inputType: 'tel'
76
+ inputType: 'tel',
77
+ required: true
78
+ }, {
79
+ id: 'FIELDS[COMMENTS]',
80
+ placeholder: 'Комментарии',
81
+ type: 'textarea',
82
+ inputType: 'description'
83
+ }, {
84
+ id: 'FIELDS[SOURCE_ID]',
85
+ placeholder: 'выбирается из справочника источников в CRM',
86
+ type: 'input',
87
+ hidden: true,
88
+ value: 17
89
+ }, {
90
+ id: 'FIELDS[SOURCE_DESCRIPTION]',
91
+ placeholder: 'URL страницы',
92
+ type: 'input',
93
+ value: url,
94
+ hidden: true
95
+ }, {
96
+ id: 'FIELDS[ASSIGNED_BY_ID]',
97
+ placeholder: 'ФИО ответственного',
98
+ type: 'input',
99
+ value: 219,
100
+ hidden: true
101
+ }, {
102
+ id: 'FIELDS[UTM_CAMPAIGN]',
103
+ placeholder: 'Обозначение рекламной кампании',
104
+ type: 'input',
105
+ value: '',
106
+ hidden: true
107
+ }, {
108
+ id: 'FIELDS[UTM_CONTENT]',
109
+ placeholder: 'Содержание кампании',
110
+ type: 'input',
111
+ value: '',
112
+ hidden: true
113
+ }, {
114
+ id: 'FIELDS[UTM_MEDIUM]',
115
+ placeholder: 'Тип трафика',
116
+ value: '',
117
+ type: 'input',
118
+ hidden: true
119
+ }, {
120
+ id: 'FIELDS[UTM_SOURCE]',
121
+ placeholder: 'Рекламная система',
122
+ value: '',
123
+ type: 'input',
124
+ hidden: true
125
+ }, {
126
+ id: 'FIELDS[UTM_TERM]',
127
+ placeholder: 'Условие поиска кампании',
128
+ value: '',
129
+ type: 'input',
130
+ hidden: true
131
+ }];
132
+ var formStubData_EN = [{
133
+ id: 'FIELDS[TITLE]',
134
+ placeholder: 'Название лида',
135
+ hidden: true,
136
+ value: 'Лид клиент',
137
+ inputType: 'text',
138
+ type: 'input'
139
+ }, {
140
+ id: 'FIELDS[NAME]',
141
+ placeholder: 'Name',
142
+ inputType: 'name',
143
+ type: 'input',
144
+ required: true
145
+ }, {
146
+ id: 'FIELDS[EMAIL][0][VALUE]',
147
+ placeholder: 'Email',
148
+ type: 'input',
149
+ inputType: 'email',
150
+ required: true
151
+ }, {
152
+ id: 'FIELDS[PHONE][0][VALUE]',
153
+ placeholder: 'Phone Number',
154
+ type: 'input',
155
+ inputType: 'tel',
156
+ required: true
157
+ }, {
158
+ id: 'FIELDS[COMMENTS]',
159
+ placeholder: 'Комментарии',
160
+ type: 'textarea',
161
+ inputType: 'description'
162
+ }, {
163
+ id: 'FIELDS[SOURCE_ID]',
164
+ placeholder: 'выбирается из справочника источников в CRM',
165
+ type: 'input',
166
+ hidden: true,
167
+ value: 17
168
+ }, {
169
+ id: 'FIELDS[SOURCE_DESCRIPTION]',
170
+ placeholder: 'URL страницы',
171
+ type: 'input',
172
+ value: url,
173
+ hidden: true
174
+ }, {
175
+ id: 'FIELDS[ASSIGNED_BY_ID]',
176
+ placeholder: 'ФИО ответственного',
177
+ type: 'input',
178
+ value: 219,
179
+ hidden: true
180
+ }, {
181
+ id: 'FIELDS[UTM_CAMPAIGN]',
182
+ placeholder: 'Обозначение рекламной кампании',
183
+ type: 'input',
184
+ value: '',
185
+ hidden: true
186
+ }, {
187
+ id: 'FIELDS[UTM_CONTENT]',
188
+ placeholder: 'Содержание кампании',
189
+ type: 'input',
190
+ value: '',
191
+ hidden: true
192
+ }, {
193
+ id: 'FIELDS[UTM_MEDIUM]',
194
+ placeholder: 'Тип трафика',
195
+ value: '',
196
+ type: 'input',
197
+ hidden: true
198
+ }, {
199
+ id: 'FIELDS[UTM_SOURCE]',
200
+ placeholder: 'Рекламная система',
201
+ value: '',
202
+ type: 'input',
203
+ hidden: true
204
+ }, {
205
+ id: 'FIELDS[UTM_TERM]',
206
+ placeholder: 'Условие поиска кампании',
207
+ value: '',
208
+ type: 'input',
209
+ hidden: true
210
+ }];
211
+ var formStubData_TH = [{
212
+ id: 'FIELDS[TITLE]',
213
+ placeholder: 'Название лида',
214
+ hidden: true,
215
+ value: 'Лид клиент',
216
+ inputType: 'text',
217
+ type: 'input'
218
+ }, {
219
+ id: 'FIELDS[NAME]',
220
+ placeholder: 'ชื่อ',
221
+ inputType: 'name',
222
+ type: 'input',
223
+ required: true
224
+ }, {
225
+ id: 'FIELDS[EMAIL][0][VALUE]',
226
+ placeholder: 'อีเมล',
227
+ type: 'input',
228
+ inputType: 'email',
229
+ required: true
230
+ }, {
231
+ id: 'FIELDS[PHONE][0][VALUE]',
232
+ placeholder: 'หมายเลขโทรศัพท์',
233
+ type: 'input',
234
+ inputType: 'tel',
235
+ required: true
76
236
  }, {
77
237
  id: 'FIELDS[COMMENTS]',
78
238
  placeholder: 'Комментарии',
79
239
  type: 'textarea',
80
- inputType: 'text'
240
+ inputType: 'description'
81
241
  }, {
82
242
  id: 'FIELDS[SOURCE_ID]',
83
243
  placeholder: 'выбирается из справочника источников в CRM',
84
244
  type: 'input',
85
245
  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
246
+ value: 17
87
247
  }, {
88
248
  id: 'FIELDS[SOURCE_DESCRIPTION]',
89
249
  placeholder: 'URL страницы',
90
250
  type: 'input',
91
- value: window.location.href,
251
+ value: url,
92
252
  hidden: true
93
253
  }, {
94
254
  id: 'FIELDS[ASSIGNED_BY_ID]',
95
255
  placeholder: 'ФИО ответственного',
96
256
  type: 'input',
97
- value: 11,
257
+ value: 219,
98
258
  hidden: true
99
259
  }, {
100
260
  id: 'FIELDS[UTM_CAMPAIGN]',
@@ -149,6 +309,22 @@ var FormBtn = exports.FormBtn = /*#__PURE__*/(0, _react.forwardRef)(function (_r
149
309
  if (activeLang == 'tr') return 'danışmanlık';
150
310
  return 'от нашего специалиста';
151
311
  };
312
+ var translateSubmitRequest = function translateSubmitRequest() {
313
+ if (activeLang == 'en') return 'Submit a request';
314
+ if (activeLang == 'th') return 'ส่งคำขอ';
315
+ return 'Заявка на консультацию';
316
+ };
317
+ var translateFreeConsultation = function translateFreeConsultation() {
318
+ if (activeLang == 'en') return 'Submit a request and get a free consultation';
319
+ if (activeLang == 'tr') return 'ส่งคำขอและรับคำปรึกษาฟรี';
320
+ return 'Оставьте заявку и получите бесплатную консультацию';
321
+ };
322
+ var translateformStubData = function translateformStubData() {
323
+ if (activeLang == 'en') return formStubData_EN;
324
+ if (activeLang == 'th') return formStubData_TH;
325
+ return formStubData_RU;
326
+ };
327
+
152
328
  // Удалить блок
153
329
  var handleDeleteBlock = function handleDeleteBlock(e) {
154
330
  // setContent(e.currentTarget.textContent)
@@ -194,13 +370,14 @@ var FormBtn = exports.FormBtn = /*#__PURE__*/(0, _react.forwardRef)(function (_r
194
370
  }
195
371
  }
196
372
  }, 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",
373
+ activeLang: activeLang,
374
+ formTitle: translateSubmitRequest(),
198
375
  setIsModal: function setIsModal(e) {
199
376
  return setIsModalBitrix(e);
200
377
  },
201
- inputArr: formStubData,
378
+ inputArr: translateformStubData(),
202
379
  bitrixToken: formStubBitrixToken,
203
- subTitle: 'Оставьте заявку и получите бесплатную консультацию'
380
+ subTitle: translateFreeConsultation()
204
381
  }), /*#__PURE__*/_react["default"].createElement("p", {
205
382
  className: "text_blue",
206
383
  onClick: function onClick(e) {
@@ -82,6 +82,7 @@ var ModalBitrixForm = exports.ModalBitrixForm = function ModalBitrixForm(_ref) {
82
82
  var translateBtn = function translateBtn() {
83
83
  if (activeLang == 'en') return 'Send';
84
84
  if (activeLang == 'tr') return 'Gönder';
85
+ if (activeLang == 'th') return 'ฝากคำร้องไว้ ';
85
86
  return 'Отправить';
86
87
  };
87
88
  var fetchTest = function fetchTest() {
@@ -40,7 +40,9 @@ var SelectedBlocks = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
40
40
  setListLinks = _ref.setListLinks,
41
41
  readonly = _ref.readonly,
42
42
  fetchDataById = _ref.fetchDataById,
43
- data = _ref.data;
43
+ data = _ref.data,
44
+ _ref$activeLang = _ref.activeLang,
45
+ activeLang = _ref$activeLang === void 0 ? 'ru' : _ref$activeLang;
44
46
  var _useState = (0, _react.useState)([]),
45
47
  _useState2 = _slicedToArray(_useState, 2),
46
48
  content = _useState2[0],
@@ -274,6 +276,7 @@ var SelectedBlocks = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
274
276
  editMode: true
275
277
  }));
276
278
  if (block_type == 'form') return /*#__PURE__*/_react["default"].createElement(_FormBtn.FormBtn, _extends({}, commonProps, {
279
+ activeLang: activeLang,
277
280
  editMode: true
278
281
  }));
279
282
  if (block_type == 'video') return /*#__PURE__*/_react["default"].createElement(_VideoArticle.VideoArticle, _extends({}, commonProps, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecomlab-components-next",
3
- "version": "0.1.62",
3
+ "version": "0.1.64",
4
4
  "description": "A set of common and reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "files": [