@reltio/components 1.4.1144 → 1.4.1147

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.
@@ -12,17 +12,19 @@ exports.useStyles = styles_1.makeStyles(function (theme) { return ({
12
12
  }
13
13
  },
14
14
  dragIndicator: {
15
+ height: '100%',
15
16
  opacity: 0,
16
17
  position: 'absolute',
17
- top: '50%',
18
+ top: 0,
18
19
  left: 0,
19
- transform: 'translateY(-50%)',
20
20
  cursor: 'move',
21
21
  transition: 'opacity 0.3s'
22
22
  },
23
23
  dragIndicatorIcon: {
24
+ top: '15px',
24
25
  width: '14.4px',
25
26
  height: '18px',
26
- color: theme.palette.text.secondary
27
+ color: theme.palette.text.secondary,
28
+ position: 'relative'
27
29
  }
28
30
  }); });
@@ -172,7 +172,7 @@ var useAPI = function (config) {
172
172
  }
173
173
  };
174
174
  react_1.useEffect(function () {
175
- if (!mdm_sdk_1.isEmptyValue(config.action)) {
175
+ if (!mdm_sdk_1.isEmptyValue(config.action) && config.action.platform !== mdm_sdk_1.CustomScriptPlatform.CLASSIC) {
176
176
  workerRef.current = mdm_sdk_1.initializeWebWorker(workerUrl, config.action.files, process);
177
177
  return function () {
178
178
  workerRef.current.terminate();
@@ -29,6 +29,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  __setModuleDefault(result, mod);
30
30
  return result;
31
31
  };
32
+ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
33
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
34
+ to[j] = from[i];
35
+ return to;
36
+ };
32
37
  var __importDefault = (this && this.__importDefault) || function (mod) {
33
38
  return (mod && mod.__esModule) ? mod : { "default": mod };
34
39
  };
@@ -51,7 +56,12 @@ var isURLtoProcess = function (processApi, url) {
51
56
  };
52
57
  var useCustomScripts = function (config, _a) {
53
58
  var addInternalRequestInterceptor = _a.addInternalRequestInterceptor, addInternalResponseInterceptor = _a.addInternalResponseInterceptor, removeInternalRequestInterceptor = _a.removeInternalRequestInterceptor, removeInternalResponseInterceptor = _a.removeInternalResponseInterceptor;
54
- var customScripts = config.map(function (customScript) { return (__assign(__assign({}, customScript), { actionId: nanoid_1.default() })); });
59
+ var customScripts = config.reduce(function (acc, customScript) {
60
+ if (customScript.platform !== mdm_sdk_1.CustomScriptPlatform.CLASSIC) {
61
+ return __spreadArray(__spreadArray([], acc), [__assign(__assign({}, customScript), { actionId: nanoid_1.default() })]);
62
+ }
63
+ return acc;
64
+ }, []);
55
65
  var dispatch = react_redux_1.useDispatch();
56
66
  var metadata = react_redux_1.useSelector(mdm_module_1.default.selectors.getMetadata) || {};
57
67
  var entity = react_redux_1.useSelector(mdm_module_1.default.selectors.getEntity) || {};
@@ -115,8 +125,7 @@ var useCustomScripts = function (config, _a) {
115
125
  react_1.useEffect(function () {
116
126
  workers.current = customScripts.reduce(function (acc, customScript) {
117
127
  var _a;
118
- acc = __assign(__assign({}, acc), (_a = {}, _a[customScript.actionId] = mdm_sdk_1.initializeWebWorker(workerUrl, customScript.files, process), _a));
119
- return acc;
128
+ return __assign(__assign({}, acc), (_a = {}, _a[customScript.actionId] = mdm_sdk_1.initializeWebWorker(workerUrl, customScript.files, process), _a));
120
129
  }, workers.current);
121
130
  return function () {
122
131
  Object.keys(workers.current).forEach(function (actionId) {
@@ -202,7 +211,7 @@ var useCustomScripts = function (config, _a) {
202
211
  }
203
212
  };
204
213
  react_1.useEffect(function () {
205
- if (!mdm_sdk_1.isEmptyValue(config)) {
214
+ if (!mdm_sdk_1.isEmptyValue(customScripts)) {
206
215
  addInternalRequestInterceptor(customScriptRequestInterceptor);
207
216
  addInternalResponseInterceptor(customScriptResponseInterceptor);
208
217
  return function () {
@@ -9,17 +9,19 @@ export var useStyles = makeStyles(function (theme) { return ({
9
9
  }
10
10
  },
11
11
  dragIndicator: {
12
+ height: '100%',
12
13
  opacity: 0,
13
14
  position: 'absolute',
14
- top: '50%',
15
+ top: 0,
15
16
  left: 0,
16
- transform: 'translateY(-50%)',
17
17
  cursor: 'move',
18
18
  transition: 'opacity 0.3s'
19
19
  },
20
20
  dragIndicatorIcon: {
21
+ top: '15px',
21
22
  width: '14.4px',
22
23
  height: '18px',
23
- color: theme.palette.text.secondary
24
+ color: theme.palette.text.secondary,
25
+ position: 'relative'
24
26
  }
25
27
  }); });
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { useCallback, useContext, useEffect, useRef, useState } from 'react';
13
13
  import { useDispatch, useSelector } from 'react-redux';
14
14
  import mdmModule, { ui } from '@reltio/mdm-module';
15
- import { initializeWebWorker, isEmptyValue } from '@reltio/mdm-sdk';
15
+ import { CustomScriptPlatform, initializeWebWorker, isEmptyValue } from '@reltio/mdm-sdk';
16
16
  import { useWorkflowCheckPermission } from '../../components/workflow';
17
17
  import { SandboxAPIContext } from '../../contexts';
18
18
  import { processRequest } from './API';
@@ -150,7 +150,7 @@ export var useAPI = function (config) {
150
150
  }
151
151
  };
152
152
  useEffect(function () {
153
- if (!isEmptyValue(config.action)) {
153
+ if (!isEmptyValue(config.action) && config.action.platform !== CustomScriptPlatform.CLASSIC) {
154
154
  workerRef.current = initializeWebWorker(workerUrl, config.action.files, process);
155
155
  return function () {
156
156
  workerRef.current.terminate();
@@ -9,10 +9,15 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
13
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
14
+ to[j] = from[i];
15
+ return to;
16
+ };
12
17
  import { useContext, useEffect, useRef } from 'react';
13
18
  import { useDispatch, useSelector } from 'react-redux';
14
19
  import mdmModule, { ui } from '@reltio/mdm-module';
15
- import { initializeWebWorker, isEmptyValue } from '@reltio/mdm-sdk';
20
+ import { CustomScriptPlatform, initializeWebWorker, isEmptyValue } from '@reltio/mdm-sdk';
16
21
  import nanoid from 'nanoid';
17
22
  import { find, map, pick, pipe, prop, omit } from 'ramda';
18
23
  import { useWorkflowCheckPermission } from '../components/workflow';
@@ -26,7 +31,12 @@ var isURLtoProcess = function (processApi, url) {
26
31
  };
27
32
  export var useCustomScripts = function (config, _a) {
28
33
  var addInternalRequestInterceptor = _a.addInternalRequestInterceptor, addInternalResponseInterceptor = _a.addInternalResponseInterceptor, removeInternalRequestInterceptor = _a.removeInternalRequestInterceptor, removeInternalResponseInterceptor = _a.removeInternalResponseInterceptor;
29
- var customScripts = config.map(function (customScript) { return (__assign(__assign({}, customScript), { actionId: nanoid() })); });
34
+ var customScripts = config.reduce(function (acc, customScript) {
35
+ if (customScript.platform !== CustomScriptPlatform.CLASSIC) {
36
+ return __spreadArray(__spreadArray([], acc), [__assign(__assign({}, customScript), { actionId: nanoid() })]);
37
+ }
38
+ return acc;
39
+ }, []);
30
40
  var dispatch = useDispatch();
31
41
  var metadata = useSelector(mdmModule.selectors.getMetadata) || {};
32
42
  var entity = useSelector(mdmModule.selectors.getEntity) || {};
@@ -90,8 +100,7 @@ export var useCustomScripts = function (config, _a) {
90
100
  useEffect(function () {
91
101
  workers.current = customScripts.reduce(function (acc, customScript) {
92
102
  var _a;
93
- acc = __assign(__assign({}, acc), (_a = {}, _a[customScript.actionId] = initializeWebWorker(workerUrl, customScript.files, process), _a));
94
- return acc;
103
+ return __assign(__assign({}, acc), (_a = {}, _a[customScript.actionId] = initializeWebWorker(workerUrl, customScript.files, process), _a));
95
104
  }, workers.current);
96
105
  return function () {
97
106
  Object.keys(workers.current).forEach(function (actionId) {
@@ -177,7 +186,7 @@ export var useCustomScripts = function (config, _a) {
177
186
  }
178
187
  };
179
188
  useEffect(function () {
180
- if (!isEmptyValue(config)) {
189
+ if (!isEmptyValue(customScripts)) {
181
190
  addInternalRequestInterceptor(customScriptRequestInterceptor);
182
191
  addInternalResponseInterceptor(customScriptResponseInterceptor);
183
192
  return function () {
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1144",
3
+ "version": "1.4.1147",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
7
7
  "dependencies": {
8
8
  "@date-io/moment": "^1.3.5",
9
9
  "@react-google-maps/api": "2.7.0",
10
- "@reltio/mdm-module": "^1.4.1144",
11
- "@reltio/mdm-sdk": "^1.4.1144",
10
+ "@reltio/mdm-module": "^1.4.1147",
11
+ "@reltio/mdm-sdk": "^1.4.1147",
12
12
  "classnames": "^2.2.5",
13
13
  "d3-cloud": "^1.2.5",
14
14
  "d3-geo": "^2.0.1",