ecomlab-components-next 0.1.49 → 0.1.50

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.
@@ -129,27 +129,29 @@ var SelectedBlocks = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
129
129
 
130
130
  // Изменение контента блока
131
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";
132
+ if (!readonly) {
133
+ var url;
134
+ if (!window.location.hostname.match('localhost')) {
135
+ url = "https://apps0.ecomru.ru:4447/api/v2/article/article_content";
136
+ } else {
137
+ url = "https://apps0.ecomru.ru:4447/api/v2/article/article_content";
138
+ }
139
+ var body = JSON.stringify({
140
+ block_id: id,
141
+ content: content
142
+ });
143
+ fetch(url, {
144
+ body: body,
145
+ method: 'POST',
146
+ headers: _headers["default"]
147
+ }).then(function (res) {
148
+ return res.json();
149
+ }).then(function (json) {
150
+ console.log(json);
151
+ })["catch"](function (err) {
152
+ return console.error(err);
153
+ });
137
154
  }
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
155
  };
154
156
 
155
157
  // Изменение блока
@@ -228,9 +230,10 @@ var SelectedBlocks = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
228
230
  }), /*#__PURE__*/_react["default"].createElement("div", {
229
231
  onKeyDown: function onKeyDown(e) {
230
232
  if (e.key === 'Enter') {
231
- console.log(e.key);
232
- e.preventDefault(e.key);
233
- addNewBlock();
233
+ if (!readonly) {
234
+ e.preventDefault(e.key);
235
+ addNewBlock();
236
+ }
234
237
  }
235
238
  }
236
239
  }, content === null || content === void 0 ? void 0 : content.map(function (_ref2, ind) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecomlab-components-next",
3
- "version": "0.1.49",
3
+ "version": "0.1.50",
4
4
  "description": "A set of common and reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "files": [