@bigbinary/neeto-message-templates-frontend 0.7.4 → 0.7.5

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.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useState, useRef, useEffect } from 'react';
2
- import { hyphenate, noop, isNotEmpty, renameKeys, findBy, capitalize, nullSafe } from '@bigbinary/neeto-cist';
2
+ import { hyphenate, noop, isNotEmpty, renameKeys, findBy, capitalize, nullSafe, isPresent } from '@bigbinary/neeto-cist';
3
3
  import { buildFiltersFromURL, Bar } from '@bigbinary/neeto-filters-frontend';
4
4
  import Container from '@bigbinary/neeto-molecules/Container';
5
5
  import NeetoHeader from '@bigbinary/neeto-molecules/Header';
@@ -19,7 +19,7 @@ import require$$0 from 'util';
19
19
  import { create } from 'zustand';
20
20
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
21
21
  import Pane from '@bigbinary/neetoui/Pane';
22
- import { FormikEditor } from '@bigbinary/neeto-editor';
22
+ import FormikEditor from '@bigbinary/neeto-editor/FormikEditor';
23
23
  import NeetoUIForm from '@bigbinary/neetoui/formik/Form';
24
24
  import Input from '@bigbinary/neetoui/formik/Input';
25
25
  import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
@@ -4466,6 +4466,10 @@ var SEND_TO_API_FORM_VALIDATION_SCHEMA = yup.object({
4466
4466
  }))
4467
4467
  });
4468
4468
 
4469
+ var formatAdditionalData = function formatAdditionalData(additionalData) {
4470
+ return isPresent(additionalData) ? additionalData : [ADDITIONAL_DATA_INITIAL_VALUE];
4471
+ };
4472
+
4469
4473
  function ownKeys(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; }
4470
4474
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4471
4475
  var SendToApiPane = function SendToApiPane(props) {
@@ -4502,7 +4506,7 @@ var SendToApiForm = function SendToApiForm(_ref) {
4502
4506
  isLoadingTemplates = _useFetchTemplates.isLoading;
4503
4507
  var handleTemplateChange = function handleTemplateChange(setFieldValue, template) {
4504
4508
  setFieldValue("endpoint", template.endpoint);
4505
- setFieldValue("additionalData", template.additionalData);
4509
+ setFieldValue("additionalData", formatAdditionalData(template.additionalData));
4506
4510
  };
4507
4511
  var handleSubmit = function handleSubmit(formValues) {
4508
4512
  var additionalDataModifiedFormValues = modify("additionalData", rejectEmptyKeyValuePairs, formValues);