@bigbinary/neeto-message-templates-frontend 1.2.0 → 1.3.0

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 (52) hide show
  1. package/README.md +1 -6
  2. package/app/javascript/src/translations/en.json +4 -2
  3. package/dist/ApiTemplates.js +4 -4
  4. package/dist/MessageTemplates.js +5 -33
  5. package/dist/MessageTemplates.js.map +1 -1
  6. package/dist/SendMessagePane.js +96 -26
  7. package/dist/SendMessagePane.js.map +1 -1
  8. package/dist/SendToApiPane.js +50 -21
  9. package/dist/SendToApiPane.js.map +1 -1
  10. package/dist/cjs/ApiTemplates.js +12 -12
  11. package/dist/cjs/ApiTemplates.js.map +1 -1
  12. package/dist/cjs/MessageTemplates.js +18 -46
  13. package/dist/cjs/MessageTemplates.js.map +1 -1
  14. package/dist/cjs/SendMessagePane.js +99 -28
  15. package/dist/cjs/SendMessagePane.js.map +1 -1
  16. package/dist/cjs/SendToApiPane.js +49 -19
  17. package/dist/cjs/SendToApiPane.js.map +1 -1
  18. package/dist/cjs/index.js +10 -7
  19. package/dist/cjs/index.js.map +1 -1
  20. package/dist/{slicedToArray-f320d9e7.js → constants-237a4b54.js} +47 -1
  21. package/dist/constants-237a4b54.js.map +1 -0
  22. package/dist/constants-73e7bb3b.js +99 -0
  23. package/dist/constants-73e7bb3b.js.map +1 -0
  24. package/dist/index.js +10 -7
  25. package/dist/index.js.map +1 -1
  26. package/dist/objectWithoutProperties-2fed2d7d.js +33 -0
  27. package/dist/objectWithoutProperties-2fed2d7d.js.map +1 -0
  28. package/dist/objectWithoutProperties-a0edb288.js +31 -0
  29. package/dist/objectWithoutProperties-a0edb288.js.map +1 -0
  30. package/dist/{toConsumableArray-9abb3858.js → toConsumableArray-62a645c0.js} +4 -4
  31. package/dist/{toConsumableArray-9abb3858.js.map → toConsumableArray-62a645c0.js.map} +1 -1
  32. package/dist/{toConsumableArray-1cc38429.js → toConsumableArray-dd34dc19.js} +2 -2
  33. package/dist/{toConsumableArray-1cc38429.js.map → toConsumableArray-dd34dc19.js.map} +1 -1
  34. package/dist/{useTemplatesApi-45d43d41.js → useTemplatesApi-983b3584.js} +2 -43
  35. package/dist/useTemplatesApi-983b3584.js.map +1 -0
  36. package/dist/{useTemplatesApi-943ef380.js → useTemplatesApi-d8923769.js} +1 -46
  37. package/dist/useTemplatesApi-d8923769.js.map +1 -0
  38. package/dist/utils-733df41c.js +80 -0
  39. package/dist/utils-733df41c.js.map +1 -0
  40. package/dist/utils-900aa952.js +91 -0
  41. package/dist/utils-900aa952.js.map +1 -0
  42. package/package.json +11 -11
  43. package/types.d.ts +1 -2
  44. package/dist/NoDataPage-00b22095.js +0 -58
  45. package/dist/NoDataPage-00b22095.js.map +0 -1
  46. package/dist/NoDataPage-4ba91a9f.js +0 -51
  47. package/dist/NoDataPage-4ba91a9f.js.map +0 -1
  48. package/dist/slicedToArray-b4278ecd.js +0 -57
  49. package/dist/slicedToArray-b4278ecd.js.map +0 -1
  50. package/dist/slicedToArray-f320d9e7.js.map +0 -1
  51. package/dist/useTemplatesApi-45d43d41.js.map +0 -1
  52. package/dist/useTemplatesApi-943ef380.js.map +0 -1
package/README.md CHANGED
@@ -194,9 +194,6 @@ to compose and send messages.
194
194
  - `handleSubmit`: The function within the host app used to send SMS and email.
195
195
  - `type`: Represents the type of message, with accepted values of `email`,
196
196
  `sms`, or `whatsapp`.
197
- - `addNewTemplateRoute`: A redirect route to the add template page. If there are
198
- no message templates present, users can be redirected to this route to add new
199
- message templates.
200
197
 
201
198
  ##### Optional Props
202
199
 
@@ -207,6 +204,7 @@ to compose and send messages.
207
204
  - `templateVariables`: To add dynamic variables to form body field.
208
205
  - `ownerId`: To provide the `ID` of the owner if it is not an Organization
209
206
  model. If the owner is an Organization, this prop can be left unspecified.
207
+ - `isSaveAsTemplateEnabled` - To allow users to save the contents of current message as a new template.
210
208
 
211
209
  ##### Usage
212
210
 
@@ -308,9 +306,6 @@ it if needed and send the data to the specified HTTP(S) endpoint.
308
306
  - `onClose`: This function will be executed while closing the pane.
309
307
  - `onSubmit`: This function will be executed while submitting the form.
310
308
  - `isSubmitting`: A boolean to know the form submission status
311
- - `addNewTemplateRoute`: A redirect route to the API template page. If there are
312
- no API templates present, users can be redirected to this route to add new API
313
- templates.
314
309
 
315
310
  ##### Usage
316
311
 
@@ -51,7 +51,8 @@
51
51
  "emailAddressPresence": "Email address is required",
52
52
  "emailAddressFormatValidation": "Invalid email address",
53
53
  "validPhoneNumber": "Enter valid phone number",
54
- "variablePresence": "Variable should not be empty"
54
+ "variablePresence": "Variable should not be empty",
55
+ "requiredEntity": "{{entity}} is required"
55
56
  },
56
57
  "templateName": "Template name",
57
58
  "emailSubject": "Email subject",
@@ -64,7 +65,8 @@
64
65
  "email": "Send email",
65
66
  "sms": "Send SMS",
66
67
  "selectTemplate": "Select a template",
67
- "testSmsNote": "Note: Variable values will be empty for test SMS."
68
+ "testSmsNote": "Note: Variable values will be empty for test SMS.",
69
+ "saveAsTemplate": "Save as template"
68
70
  },
69
71
  "common": {
70
72
  "send": "Send"
@@ -1,6 +1,6 @@
1
- import { _ as _defineProperty, c as useCreateTemplate, u as useUpdateTemplate, a as DEFAULT_PAGE_PROPERTIES, b as useFetchTemplates, d as useDeleteTemplate } from './useTemplatesApi-45d43d41.js';
2
- import { _ as _toConsumableArray } from './toConsumableArray-1cc38429.js';
3
- import { _ as _slicedToArray } from './slicedToArray-b4278ecd.js';
1
+ import { _ as _defineProperty, b as useCreateTemplate, u as useUpdateTemplate, a as useFetchTemplates, c as useDeleteTemplate } from './useTemplatesApi-983b3584.js';
2
+ import { _ as _toConsumableArray } from './toConsumableArray-dd34dc19.js';
3
+ import { a as DEFAULT_PAGE_PROPERTIES, _ as _slicedToArray } from './constants-73e7bb3b.js';
4
4
  import { useState } from 'react';
5
5
  import { isNotEmpty, noop } from '@bigbinary/neeto-cist';
6
6
  import { useQueryParams } from '@bigbinary/neeto-commons-frontend/react-utils';
@@ -25,10 +25,10 @@ import NeetoUIForm from '@bigbinary/neetoui/formik/Form';
25
25
  import { t } from 'i18next';
26
26
  import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
27
27
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
28
- import '@bigbinary/neeto-commons-frontend/constants';
29
28
  import '@tanstack/react-query';
30
29
  import 'axios';
31
30
  import 'util';
31
+ import '@bigbinary/neeto-commons-frontend/constants';
32
32
  import 'yup';
33
33
  import 'formik';
34
34
  import '@bigbinary/neeto-icons/Delete';
@@ -1,5 +1,5 @@
1
- import { u as useUpdateTemplate, _ as _defineProperty, g as getDefaultExportFromCjs, D as DEFAULT_EDITOR_ROW_COUNT, a as DEFAULT_PAGE_PROPERTIES, M as MESSAGE_TEMPLATES, b as useFetchTemplates, c as useCreateTemplate, d as useDeleteTemplate, e as MESSAGE_TYPES } from './useTemplatesApi-45d43d41.js';
2
- import { _ as _slicedToArray } from './slicedToArray-b4278ecd.js';
1
+ import { u as useUpdateTemplate, _ as _defineProperty, g as getDefaultExportFromCjs, a as useFetchTemplates, b as useCreateTemplate, c as useDeleteTemplate } from './useTemplatesApi-983b3584.js';
2
+ import { _ as _slicedToArray, D as DEFAULT_EDITOR_ROW_COUNT, a as DEFAULT_PAGE_PROPERTIES, M as MESSAGE_TEMPLATES, b as MESSAGE_TYPES } from './constants-73e7bb3b.js';
3
3
  import { useState, useRef, useEffect } from 'react';
4
4
  import { hyphenate, noop, isNotEmpty } from '@bigbinary/neeto-cist';
5
5
  import { buildFiltersFromURL, Bar } from '@bigbinary/neeto-filters-frontend';
@@ -21,20 +21,21 @@ import FormikEditor from '@bigbinary/neeto-editor/FormikEditor';
21
21
  import NeetoUIForm from '@bigbinary/neetoui/formik/Form';
22
22
  import Input from '@bigbinary/neetoui/formik/Input';
23
23
  import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
24
+ import { _ as _objectWithoutProperties } from './objectWithoutProperties-a0edb288.js';
24
25
  import { useFormikContext } from 'formik';
25
26
  import Textarea from '@bigbinary/neetoui/formik/Textarea';
26
27
  import 'stylesheets/application.scss';
27
28
  import { isPhoneNumberValid } from '@bigbinary/neeto-molecules/PhoneNumber';
28
29
  import * as yup from 'yup';
29
- import { _ as _toConsumableArray } from './toConsumableArray-1cc38429.js';
30
+ import { _ as _toConsumableArray } from './toConsumableArray-dd34dc19.js';
30
31
  import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
31
32
  import Alert from '@bigbinary/neetoui/Alert';
32
33
  import Table from '@bigbinary/neetoui/Table';
33
34
  import NoData from '@bigbinary/neetoui/NoData';
34
- import '@bigbinary/neeto-commons-frontend/constants';
35
35
  import '@tanstack/react-query';
36
36
  import 'axios';
37
37
  import 'util';
38
+ import '@bigbinary/neeto-commons-frontend/constants';
38
39
 
39
40
  var MESSAGE_TEMPLATE_INITIAL_STATE = {
40
41
  isOpen: false,
@@ -199,35 +200,6 @@ var buildTableColumnData = function buildTableColumnData(setManageTemplatePane,
199
200
  }];
200
201
  };
201
202
 
202
- function _objectWithoutPropertiesLoose(source, excluded) {
203
- if (source == null) return {};
204
- var target = {};
205
- var sourceKeys = Object.keys(source);
206
- var key, i;
207
- for (i = 0; i < sourceKeys.length; i++) {
208
- key = sourceKeys[i];
209
- if (excluded.indexOf(key) >= 0) continue;
210
- target[key] = source[key];
211
- }
212
- return target;
213
- }
214
-
215
- function _objectWithoutProperties(source, excluded) {
216
- if (source == null) return {};
217
- var target = _objectWithoutPropertiesLoose(source, excluded);
218
- var key, i;
219
- if (Object.getOwnPropertySymbols) {
220
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
221
- for (i = 0; i < sourceSymbolKeys.length; i++) {
222
- key = sourceSymbolKeys[i];
223
- if (excluded.indexOf(key) >= 0) continue;
224
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
225
- target[key] = source[key];
226
- }
227
- }
228
- return target;
229
- }
230
-
231
203
  var _excluded = ["label", "name"];
232
204
  function ownKeys$4(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; }
233
205
  function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }