versacall-dashboards-library-react 2.0.39 → 2.0.40

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 (102) hide show
  1. package/package.json +2 -2
  2. package/dist/components/DashboardsCell/DashboardsCell.js +0 -267
  3. package/dist/components/DashboardsCell/index.js +0 -15
  4. package/dist/components/DashboardsCellContent/DashboardsCellContent.js +0 -438
  5. package/dist/components/DashboardsCellContent/index.js +0 -15
  6. package/dist/components/DashboardsCellFindAndReplace/DashboardsCellFindAndReplace.js +0 -190
  7. package/dist/components/DashboardsCellFindAndReplace/index.js +0 -15
  8. package/dist/components/DashboardsCellGlobalActions/DashboardsCellGlobalActions.js +0 -218
  9. package/dist/components/DashboardsCellGlobalActions/index.js +0 -15
  10. package/dist/components/DashboardsCellGlobalConditions/DashboardsCellGlobalConditions.js +0 -1043
  11. package/dist/components/DashboardsCellGlobalConditions/DashboardsCellGlobalConditionsNestable.js +0 -927
  12. package/dist/components/DashboardsCellGlobalConditions/DashboardsCellGlobalConditionsOld.js +0 -816
  13. package/dist/components/DashboardsCellGlobalConditions/index.js +0 -15
  14. package/dist/components/DashboardsCellGlobalStyles/DashboardsCellGlobalStyles.js +0 -394
  15. package/dist/components/DashboardsCellGlobalStyles/index.js +0 -15
  16. package/dist/components/DashboardsCellMergeUnmerge/DashboardsCellMergeUnmerge.js +0 -152
  17. package/dist/components/DashboardsCellMergeUnmerge/index.js +0 -15
  18. package/dist/components/DashboardsCellPosition/DashboardsCellPosition.js +0 -85
  19. package/dist/components/DashboardsCellPosition/index.js +0 -15
  20. package/dist/components/DashboardsCellSize/DashboardsCellSize.js +0 -89
  21. package/dist/components/DashboardsCellSize/index.js +0 -15
  22. package/dist/components/DashboardsCellStyle/DashboardsCellStyle.js +0 -83
  23. package/dist/components/DashboardsCellStyle/index.js +0 -15
  24. package/dist/components/DashboardsCellStyleAlignItems/DashboardsCellStyleAlignItems.js +0 -152
  25. package/dist/components/DashboardsCellStyleAlignItems/index.js +0 -15
  26. package/dist/components/DashboardsCellStyleBackgroundColor/DashboardsCellStyleBackgroundColor.js +0 -198
  27. package/dist/components/DashboardsCellStyleBackgroundColor/index.js +0 -15
  28. package/dist/components/DashboardsCellStyleClear/DashboardsCellStyleClear.js +0 -50
  29. package/dist/components/DashboardsCellStyleClear/index.js +0 -15
  30. package/dist/components/DashboardsCellStyleColor/DashboardsCellStyleColor.js +0 -198
  31. package/dist/components/DashboardsCellStyleColor/index.js +0 -15
  32. package/dist/components/DashboardsCellStyleDisplay/DashboardsCellStyleDisplay.js +0 -65
  33. package/dist/components/DashboardsCellStyleDisplay/index.js +0 -15
  34. package/dist/components/DashboardsCellStyleFontFamily/DashboardsCellStyleFontFamily.js +0 -64
  35. package/dist/components/DashboardsCellStyleFontFamily/index.js +0 -15
  36. package/dist/components/DashboardsCellStyleFontSize/DashboardsCellStyleFontSize.js +0 -89
  37. package/dist/components/DashboardsCellStyleFontSize/index.js +0 -15
  38. package/dist/components/DashboardsCellStyleJustifyContent/DashboardsCellStyleJustifyContent.js +0 -152
  39. package/dist/components/DashboardsCellStyleJustifyContent/index.js +0 -15
  40. package/dist/components/DashboardsCellStyleObjectFit/DashboardsCellStyleObjectFit.js +0 -81
  41. package/dist/components/DashboardsCellStyleObjectFit/index.js +0 -15
  42. package/dist/components/DashboardsCellStylePadding/DashboardsCellStylePadding.js +0 -105
  43. package/dist/components/DashboardsCellStylePadding/index.js +0 -15
  44. package/dist/components/DashboardsCellStyleWeightStyleDecoration/DashboardsCellStyleWeightStyleDecoration.js +0 -154
  45. package/dist/components/DashboardsCellStyleWeightStyleDecoration/index.js +0 -15
  46. package/dist/components/DashboardsCopyAndPaste/DashboardsCopyAndPaste.js +0 -112
  47. package/dist/components/DashboardsCopyAndPaste/index.js +0 -15
  48. package/dist/components/DashboardsEditor/DashboardsEditor.js +0 -415
  49. package/dist/components/DashboardsEditor/index.js +0 -15
  50. package/dist/components/DashboardsGlobalStylesPicker/DashboardsGlobalStylesPicker.js +0 -90
  51. package/dist/components/DashboardsGlobalStylesPicker/index.js +0 -15
  52. package/dist/components/DashboardsGrid/DashboardsGrid.js +0 -139
  53. package/dist/components/DashboardsGrid/index.js +0 -15
  54. package/dist/components/DashboardsMainFreehand/DashboardsMainFreehand.js +0 -466
  55. package/dist/components/DashboardsMainFreehand/index.js +0 -15
  56. package/dist/components/DashboardsMainMessaging/DashboardsMainMessaging.js +0 -628
  57. package/dist/components/DashboardsMainMessaging/index.js +0 -15
  58. package/dist/components/DashboardsMainTable/DashboardsMainTable.js +0 -626
  59. package/dist/components/DashboardsMainTable/index.js +0 -15
  60. package/dist/components/DashboardsPreview/DashboardsPreview.js +0 -113
  61. package/dist/components/DashboardsPreview/index.js +0 -15
  62. package/dist/components/DashboardsRatio/DashboardsRatio.js +0 -288
  63. package/dist/components/DashboardsRatio/DashboardsRatioOld.js +0 -211
  64. package/dist/components/DashboardsRatio/index.js +0 -15
  65. package/dist/components/DashboardsStatusBar/DashboardsStatusBar.css +0 -1
  66. package/dist/components/DashboardsStatusBar/DashboardsStatusBar.js +0 -137
  67. package/dist/components/DashboardsStatusBar/index.js +0 -15
  68. package/dist/components/DashboardsUndoRedo/DashboardsUndoRedo.js +0 -144
  69. package/dist/components/DashboardsUndoRedo/index.js +0 -15
  70. package/dist/components/DashboardsViewer/DashboardsViewer.js +0 -74
  71. package/dist/components/DashboardsViewer/index.js +0 -15
  72. package/dist/components/DashboardsWidthHeight/DashboardsWidthHeight.js +0 -98
  73. package/dist/components/DashboardsWidthHeight/index.js +0 -15
  74. package/dist/components/WidgetParameters/WidgetParameters.js +0 -383
  75. package/dist/components/WidgetParameters/index.js +0 -15
  76. package/dist/components/index.js +0 -287
  77. package/dist/constants/defaultFreehandCell.js +0 -23
  78. package/dist/constants/defaultFreehandDashboard.js +0 -23
  79. package/dist/constants/defaultMessagingDashboard.js +0 -53
  80. package/dist/constants/defaultStyle.js +0 -11
  81. package/dist/constants/defaultTableCell.js +0 -27
  82. package/dist/constants/defaultTableDashboard.js +0 -25
  83. package/dist/constants/index.js +0 -55
  84. package/dist/functions/addTranslations.js +0 -28
  85. package/dist/functions/calculateDashboardVariables.js +0 -146
  86. package/dist/functions/convertColorObject.js +0 -10
  87. package/dist/functions/convertColorString.js +0 -26
  88. package/dist/functions/convertPercentToInt.js +0 -10
  89. package/dist/functions/convertSecondsToElapsedTime.js +0 -37
  90. package/dist/functions/generateFreehandCell.js +0 -24
  91. package/dist/functions/generateFreehandDashboard.js +0 -19
  92. package/dist/functions/generateMessagingDashboard.js +0 -14
  93. package/dist/functions/generateSelected.js +0 -18
  94. package/dist/functions/generateTableCell.js +0 -18
  95. package/dist/functions/generateTableDashboard.js +0 -37
  96. package/dist/functions/index.js +0 -119
  97. package/dist/functions/mergeSelected.js +0 -22
  98. package/dist/functions/sortCells.js +0 -26
  99. package/dist/images/BackgroundTransparency.png +0 -0
  100. package/dist/index.js +0 -44
  101. package/dist/translations/en.json +0 -11
  102. package/dist/translations/es.json +0 -3
package/package.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "versacall": {
3
3
  "title": "Versacall Dashboards Library React",
4
4
  "applicationType": "react-library",
5
- "build": 39
5
+ "build": 40
6
6
  },
7
7
  "name": "versacall-dashboards-library-react",
8
- "version": "2.0.39",
8
+ "version": "2.0.40",
9
9
  "description": "Versacall Dashboards Library",
10
10
  "main": "dist/index.js",
11
11
  "module": "dist/index.js",
@@ -1,267 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _versacallCoreLibraryReact = require("versacall-core-library-react");
11
-
12
- var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
17
-
18
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
19
-
20
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
-
22
- function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
23
-
24
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
25
-
26
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
27
-
28
- // import BackgroundTransparencyImage from '../../images/BackgroundTransparency.png';
29
- var style = {
30
- root: {
31
- display: 'block',
32
- boxSizing: 'border-box',
33
- width: '100%',
34
- height: '100%',
35
- overflow: 'hidden'
36
- },
37
- url: {
38
- width: '100%',
39
- height: '100%'
40
- }
41
- };
42
-
43
- function formatAnimationName(name) {
44
- /* let nameAdjusted = name.split(' ').join('_');
45
- nameAdjusted = nameAdjusted.toLowerCase();
46
- nameAdjusted = nameAdjusted.split('');
47
- let newName = '';
48
- nameAdjusted.forEach(character => { if (/[a-z0-9_]+/.exec(character) !== null) newName += character; }); */
49
- var code = '';
50
- var addUnderscore = false;
51
- var haveLetterOrDigit = false; // const isLetter = char => (/[a-zA-Z]+/.exec(char) !== null);
52
- // const isDigit = char => (/[0-9]+/.exec(char) !== null);
53
-
54
- var isLetterOrDigit = char => /[a-zA-Z0-9]+/.exec(char) !== null; // eslint-disable-next-line no-restricted-syntax
55
-
56
-
57
- var _iterator = _createForOfIteratorHelper(name),
58
- _step;
59
-
60
- try {
61
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
62
- var char = _step.value;
63
-
64
- if (isLetterOrDigit(char)) {
65
- haveLetterOrDigit = true;
66
-
67
- if (addUnderscore) {
68
- addUnderscore = false;
69
- code += '_';
70
- }
71
-
72
- code += char;
73
- } else if (haveLetterOrDigit) {
74
- addUnderscore = true;
75
- }
76
- }
77
- } catch (err) {
78
- _iterator.e(err);
79
- } finally {
80
- _iterator.f();
81
- }
82
-
83
- return code.toLowerCase();
84
- }
85
-
86
- function DashboardsCell(props) {
87
- var widget = props.widget,
88
- viewer = props.viewer,
89
- cell = props.cell,
90
- core = props.core,
91
- showEditor = props.showEditor;
92
-
93
- var spanStyle = _objectSpread(_objectSpread({}, style.root), {}, {
94
- gridColumn: "span ".concat(cell.columnSpan),
95
- gridRow: "span ".concat(cell.rowSpan)
96
- });
97
-
98
- var styles = _objectSpread({}, cell.custom.style);
99
-
100
- var backgroundColorFadeStyle = {}; // NOTE: Definitely don't want this when viewing... It is debatable if we want it will editing. Could
101
- // through an "&& showEditor" in the below condition if we want it to show in edit mode.
102
-
103
- /* if (!styles.backgroundColor) {
104
- styles.backgroundImage = `url(${BackgroundTransparencyImage})`;
105
- } */
106
-
107
- if (styles.backgroundColor && styles.backgroundColorFade && styles.backgroundColorFade !== 'none') {
108
- // const name = `backgroundColorFade${styles.backgroundColor.replace(/[., ()]+/g, '')}${styles.backgroundColorFade.replace(/[., ()]+/g, '')}`;
109
- var name = formatAnimationName("backgroundColorFade_".concat(styles.backgroundColor, "_").concat(styles.backgroundColorFade));
110
- var canAddRule = true;
111
-
112
- for (var i = 0; i < document.styleSheets[0].cssRules.length; i++) {
113
- if (document.styleSheets[0].cssRules[i].name === name) {
114
- canAddRule = false;
115
- break;
116
- }
117
- }
118
-
119
- if (canAddRule) {
120
- document.styleSheets[0].insertRule("@-webkit-keyframes ".concat(name, " {\n 0% {\n background-color: ").concat(styles.backgroundColor, ";\n }\n 50% {\n background-color: ").concat(styles.backgroundColorFade, ";\n }\n 100% {\n background-color: ").concat(styles.backgroundColor, ";\n }\n }"), document.styleSheets[0].cssRules.length);
121
- }
122
-
123
- backgroundColorFadeStyle = {
124
- animationName: name,
125
- animationDuration: styles.fadeDuration ? styles.fadeDuration : '1s',
126
- animationIterationCount: 'infinite'
127
- };
128
- }
129
-
130
- var prepareMainStyle = _objectSpread(_objectSpread(_objectSpread({}, style.root), {}, {
131
- borderWidth: (cell.custom.viewWidth <= cell.custom.viewHeight ? cell.custom.viewWidth : cell.custom.viewHeight) / 200 * Number(styles.borderSize ? styles.borderSize : 2)
132
- }, backgroundColorFadeStyle), {}, {
133
- padding: "".concat(styles.paddingVertical ? cell.custom.viewHeight / 200 * styles.paddingVertical : 0, "px ").concat(styles.paddingHorizontal ? cell.custom.viewWidth / 200 * styles.paddingHorizontal : 0, "px"),
134
- fontSize: styles.fontSize ? styles.fontSize : '12%'
135
- });
136
-
137
- if (cell.content.type !== 'text') {
138
- prepareMainStyle.fontSize = '0%';
139
- }
140
-
141
- var flexStyle = {
142
- display: 'flex',
143
- width: '100%',
144
- height: '100%',
145
- overflow: 'hidden',
146
- justifyContent: styles.justifyContent ? styles.justifyContent : 'flex-start',
147
- alignItems: styles.alignItems ? styles.alignItems : 'flex-start'
148
- };
149
- var colorFadeStyle = {};
150
-
151
- if (styles.color && styles.colorFade && styles.colorFade !== 'none') {
152
- // const name = `colorFade${styles.color.replace(/[., ()]+/g, '')}${styles.colorFade.replace(/[., ()]+/g, '')}`;
153
- var _name = formatAnimationName("colorFade_".concat(styles.color, "_").concat(styles.colorFade));
154
-
155
- var _canAddRule = true;
156
-
157
- for (var _i = 0; _i < document.styleSheets[0].cssRules.length; _i++) {
158
- if (document.styleSheets[0].cssRules[_i].name === _name) {
159
- _canAddRule = false;
160
- break;
161
- }
162
- }
163
-
164
- if (_canAddRule) {
165
- document.styleSheets[0].insertRule("@-webkit-keyframes ".concat(_name, " {\n 0% {\n color: ").concat(styles.color, ";\n }\n 50% {\n color: ").concat(styles.colorFade, ";\n }\n 100% {\n color: ").concat(styles.color, ";\n }\n }"), document.styleSheets[0].cssRules.length);
166
- }
167
-
168
- colorFadeStyle = {
169
- animationName: _name,
170
- animationDuration: styles.fadeDuration ? styles.fadeDuration : '1s',
171
- animationIterationCount: 'infinite'
172
- };
173
- }
174
-
175
- var contentStyle = _objectSpread(_objectSpread({
176
- display: 'block',
177
- boxSizing: 'border-box',
178
- overflow: 'hidden',
179
- color: styles.color ? styles.color : 'black'
180
- }, colorFadeStyle), {}, {
181
- textDecoration: styles.textDecoration ? styles.textDecoration : 'none',
182
- width: cell.content.type === 'text' ? 'auto' : '100%',
183
- height: cell.content.type === 'text' ? 'auto' : '100%',
184
- textAlign: 'left'
185
- });
186
-
187
- if (styles.justifyContent) {
188
- switch (styles.justifyContent) {
189
- case 'center':
190
- contentStyle.textAlign = 'center';
191
- break;
192
-
193
- case 'flex-end':
194
- contentStyle.textAlign = 'right';
195
- break;
196
-
197
- default:
198
- }
199
- }
200
-
201
- var imageStyle = {
202
- width: '100%',
203
- height: '100%',
204
- objectFit: styles.objectFit ? styles.objectFit : 'none',
205
- display: 'block'
206
- };
207
- delete styles.borderSize;
208
- delete styles.backgroundColorFade;
209
- delete styles.paddingHorizontal;
210
- delete styles.paddingVertical;
211
- delete styles.fontSize;
212
- delete styles.justifyContent;
213
- delete styles.alignItems;
214
- delete styles.color;
215
- delete styles.colorFade;
216
- delete styles.textDecoration;
217
- delete styles.objectFit;
218
-
219
- var mainStyle = _objectSpread(_objectSpread({}, prepareMainStyle), styles);
220
-
221
- return /*#__PURE__*/_react.default.createElement("div", {
222
- style: spanStyle
223
- }, /*#__PURE__*/_react.default.createElement("div", {
224
- style: mainStyle
225
- }, /*#__PURE__*/_react.default.createElement("div", {
226
- style: flexStyle
227
- }, /*#__PURE__*/_react.default.createElement("div", {
228
- style: contentStyle
229
- }, cell.content.type === 'text' && cell.content.text.split('\n').map((item, index) => /*#__PURE__*/_react.default.createElement("span", {
230
- key: String(index)
231
- }, item, /*#__PURE__*/_react.default.createElement("br", null))), cell.content.type === 'url' && /*#__PURE__*/_react.default.createElement("iframe", {
232
- frameBorder: "0",
233
- title: "DashboardsFrame",
234
- sandbox: "allow-scripts allow-same-origin allow-popups",
235
- src: cell.content.url,
236
- style: style.url
237
- }), cell.content.type === 'image' && cell.content.id && /*#__PURE__*/_react.default.createElement("img", {
238
- style: imageStyle,
239
- src: "".concat(core.baseUrl, "/api/contentstorage/").concat(cell.content.id),
240
- alt: "altImg"
241
- }), cell.content.type === 'widget' && cell.content.id && widget && /*#__PURE__*/_react.default.createElement(_versacallCoreLibraryReact.CoreWidget, {
242
- sandbox: "allow-scripts allow-same-origin allow-popups",
243
- controller: {
244
- properties: cell.content.properties
245
- },
246
- url: viewer ? "".concat(core.baseUrl).concat(viewer.metadata.url, "?type=widget&id=").concat(widget.id).concat(showEditor ? '&editor=true' : '', "&version=").concat(viewer.version) : "".concat(core.baseUrl).concat(widget.viewerUrl).concat(showEditor ? '&editor=true' : ''),
247
- withAuthentication: true,
248
- withOrganization: true
249
- })))));
250
- }
251
-
252
- DashboardsCell.propTypes = {
253
- viewer: _propTypes.default.shape(),
254
- widget: _propTypes.default.shape(),
255
- showEditor: _propTypes.default.bool,
256
- cell: _propTypes.default.shape().isRequired,
257
- core: _propTypes.default.shape().isRequired
258
- };
259
- DashboardsCell.defaultProps = {
260
- viewer: null,
261
- widget: null,
262
- showEditor: false
263
- };
264
-
265
- var _default = (0, _versacallCoreLibraryReact.withCore)(DashboardsCell);
266
-
267
- exports.default = _default;
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "default", {
7
- enumerable: true,
8
- get: function get() {
9
- return _DashboardsCell.default;
10
- }
11
- });
12
-
13
- var _DashboardsCell = _interopRequireDefault(require("./DashboardsCell"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }