@bigbinary/neeto-form-frontend 3.13.10 → 3.14.1

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 (86) hide show
  1. package/README.md +131 -81
  2. package/app/javascript/src/translations/ar.json +12 -1
  3. package/app/javascript/src/translations/bg.json +10 -1
  4. package/app/javascript/src/translations/ca.json +10 -1
  5. package/app/javascript/src/translations/cs.json +12 -1
  6. package/app/javascript/src/translations/da.json +10 -1
  7. package/app/javascript/src/translations/de.json +12 -1
  8. package/app/javascript/src/translations/en.json +10 -1
  9. package/app/javascript/src/translations/es-MX.json +10 -1
  10. package/app/javascript/src/translations/es.json +12 -1
  11. package/app/javascript/src/translations/et.json +10 -1
  12. package/app/javascript/src/translations/fi.json +10 -1
  13. package/app/javascript/src/translations/fil.json +10 -1
  14. package/app/javascript/src/translations/fr.json +12 -1
  15. package/app/javascript/src/translations/hi.json +10 -1
  16. package/app/javascript/src/translations/hr.json +10 -1
  17. package/app/javascript/src/translations/id.json +10 -1
  18. package/app/javascript/src/translations/it.json +12 -1
  19. package/app/javascript/src/translations/ja.json +10 -1
  20. package/app/javascript/src/translations/ko.json +10 -1
  21. package/app/javascript/src/translations/nl.json +12 -1
  22. package/app/javascript/src/translations/pl.json +12 -1
  23. package/app/javascript/src/translations/pt-BR.json +10 -1
  24. package/app/javascript/src/translations/pt.json +12 -1
  25. package/app/javascript/src/translations/ro.json +12 -1
  26. package/app/javascript/src/translations/ru.json +12 -1
  27. package/app/javascript/src/translations/sk.json +10 -1
  28. package/app/javascript/src/translations/sl.json +10 -1
  29. package/app/javascript/src/translations/sv.json +10 -1
  30. package/app/javascript/src/translations/th.json +10 -1
  31. package/app/javascript/src/translations/tr.json +10 -1
  32. package/app/javascript/src/translations/uk.json +10 -1
  33. package/app/javascript/src/translations/vi.json +10 -1
  34. package/app/javascript/src/translations/zh-CN.json +10 -1
  35. package/app/javascript/src/translations/zh-TW.json +10 -1
  36. package/dist/BuildForm.js +32 -7
  37. package/dist/BuildForm.js.map +1 -1
  38. package/dist/ExternalForm.js +39 -32
  39. package/dist/ExternalForm.js.map +1 -1
  40. package/dist/Submission.js +1 -1
  41. package/dist/UrlBuilder.js +10 -6
  42. package/dist/UrlBuilder.js.map +1 -1
  43. package/dist/{buildForm-miMj_S28.js → buildForm-CXy5L1RP.js} +2 -2
  44. package/dist/{buildForm-miMj_S28.js.map → buildForm-CXy5L1RP.js.map} +1 -1
  45. package/dist/{buildForm-DQ2wgwuW.js → buildForm-DNCW7prR.js} +2 -2
  46. package/dist/{buildForm-DQ2wgwuW.js.map → buildForm-DNCW7prR.js.map} +1 -1
  47. package/dist/cjs/BuildForm.js +32 -7
  48. package/dist/cjs/BuildForm.js.map +1 -1
  49. package/dist/cjs/ExternalForm.js +38 -31
  50. package/dist/cjs/ExternalForm.js.map +1 -1
  51. package/dist/cjs/Submission.js +1 -1
  52. package/dist/cjs/UrlBuilder.js +10 -6
  53. package/dist/cjs/UrlBuilder.js.map +1 -1
  54. package/dist/cjs/hooks.js +4 -4
  55. package/dist/cjs/index.js +8 -7
  56. package/dist/cjs/index.js.map +1 -1
  57. package/dist/{constants-Dq9-rvtB.js → constants-BVZZfXua.js} +5 -1
  58. package/dist/constants-BVZZfXua.js.map +1 -0
  59. package/dist/{constants-R6y-Scns.js → constants-Bw2NSI7-.js} +5 -4
  60. package/dist/constants-Bw2NSI7-.js.map +1 -0
  61. package/dist/{constants-CDhYxmSQ.js → constants-VzpftVgP.js} +5 -3
  62. package/dist/constants-VzpftVgP.js.map +1 -0
  63. package/dist/{constants-DBuFEVFA.js → constants-b1EQ6-AS.js} +4 -2
  64. package/dist/constants-b1EQ6-AS.js.map +1 -0
  65. package/dist/hooks.js +4 -4
  66. package/dist/{index-CAtNQTCZ.js → index-BARvqe7c.js} +2 -2
  67. package/dist/{index-CAtNQTCZ.js.map → index-BARvqe7c.js.map} +1 -1
  68. package/dist/{index-BGEdOqsc.js → index-BkNaYmLc.js} +2 -2
  69. package/dist/{index-BGEdOqsc.js.map → index-BkNaYmLc.js.map} +1 -1
  70. package/dist/index.js +8 -7
  71. package/dist/index.js.map +1 -1
  72. package/dist/{useFormSubmission-Bor3TuEO.js → useFormSubmission-CYqHLtkA.js} +2 -2
  73. package/dist/{useFormSubmission-Bor3TuEO.js.map → useFormSubmission-CYqHLtkA.js.map} +1 -1
  74. package/dist/{useFormSubmission-D3Bxhy6g.js → useFormSubmission-DMoyM44A.js} +2 -2
  75. package/dist/{useFormSubmission-D3Bxhy6g.js.map → useFormSubmission-DMoyM44A.js.map} +1 -1
  76. package/dist/{utils-BThu7JWp.js → utils-BjgmM0Qs.js} +521 -55
  77. package/dist/utils-BjgmM0Qs.js.map +1 -0
  78. package/dist/{utils-1blEk5zb.js → utils-DdrUdmyb.js} +512 -45
  79. package/dist/utils-DdrUdmyb.js.map +1 -0
  80. package/package.json +12 -12
  81. package/dist/constants-CDhYxmSQ.js.map +0 -1
  82. package/dist/constants-DBuFEVFA.js.map +0 -1
  83. package/dist/constants-Dq9-rvtB.js.map +0 -1
  84. package/dist/constants-R6y-Scns.js.map +0 -1
  85. package/dist/utils-1blEk5zb.js.map +0 -1
  86. package/dist/utils-BThu7JWp.js.map +0 -1
package/dist/BuildForm.js CHANGED
@@ -3,14 +3,14 @@ import classnames from 'classnames';
3
3
  import { isPresent, truncate, findBy, isNotPresent, slugify, existsBy, hyphenate, noop, nullSafe, removeBy } from '@bigbinary/neeto-cist';
4
4
  import Spinner from '@bigbinary/neetoui/Spinner';
5
5
  import { equals, path, curry, assoc, prop, dissoc, when, includes, isEmpty, reject, keys, pick, omit, evolve, map, mergeLeft, isNil, pipe, filter, isNotNil, uniq, join, pluck, test, paths, difference, split, last, either, T, F } from 'ramda';
6
- import { j as useDeleteQuestion, Q as QUESTION_TYPES, a as useForm, k as useCreateQuestion, l as useUpdateQuestion, C as CAPTCHA_TYPES, m as useReorderQuestions, i as QUERY_KEYS } from './constants-DBuFEVFA.js';
7
- import { d as buildDisplayLabel, e as INDEPENDENT_LABELS_MAP, f as QUESTION_ACTIONS, i as isElementOverflowing, D as Drag, h as SELECTABLE_KINDS, j as isAutoGeneratedQuestion, k as isRichTextQuestion, N as NON_BASIC_LATIN_CHARACTERS_REGEX, l as RESERVED_FIELD_CODES, L as LABEL_FIELDS, m as isDefaultLanguage, n as buildAddQuestionButtonProps, v as validateEditorContent, F as FIELD_CODES_REJECT_CHARS_REGEX, o as isImmutableField, Q as QUESTIONS_WITHOUT_FIELD_CODE, p as NON_HIDEABLE_FIELDS, q as NON_READ_ONLY_FIELDS, r as RICH_TEXT_QUESTIONS, s as FILE_TYPES_MAP, t as FILE_GROUPS, M as MINIMUM_OPTIONS, u as RATING_OPTIONS, w as STAR_RATING_MIN_VALUE_OPTIONS, x as STAR_RATING_MAX_VALUE_OPTIONS, y as STAR_RATING_ICONS_MAP, z as buildDisabledAddButtonHelpPopoverProps, A as buildReorderPayload, B as isMandatoryField, G as QUESTION_KINDS, a as QUESTION_KIND, H as getActiveQuestionKindDetails, J as DEFAULT_AVAILABLE_LANGUAGES, K as DEFAULT_ADVANCED_FEATURES, O as QUESTIONS_INITIAL_VALUE } from './constants-R6y-Scns.js';
6
+ import { k as useDeleteQuestion, Q as QUESTION_TYPES, a as useForm, l as useCreateQuestion, m as useUpdateQuestion, C as CAPTCHA_TYPES, n as useReorderQuestions, i as QUERY_KEYS } from './constants-b1EQ6-AS.js';
7
+ import { e as buildDisplayLabel, f as INDEPENDENT_LABELS_MAP, h as QUESTION_ACTIONS, i as isElementOverflowing, D as Drag, j as SELECTABLE_KINDS, k as isAutoGeneratedQuestion, l as isRichTextQuestion, N as NON_BASIC_LATIN_CHARACTERS_REGEX, m as RESERVED_FIELD_CODES, L as LABEL_FIELDS, n as isDefaultLanguage, o as buildAddQuestionButtonProps, v as validateEditorContent, F as FIELD_CODES_REJECT_CHARS_REGEX, p as isImmutableField, Q as QUESTIONS_WITHOUT_FIELD_CODE, q as NON_HIDEABLE_FIELDS, r as NON_READ_ONLY_FIELDS, s as RICH_TEXT_QUESTIONS, t as FILE_TYPES_MAP, u as FILE_GROUPS, M as MINIMUM_OPTIONS, w as RATING_OPTIONS, x as STAR_RATING_MIN_VALUE_OPTIONS, y as STAR_RATING_MAX_VALUE_OPTIONS, z as STAR_RATING_ICONS_MAP, A as buildDisabledAddButtonHelpPopoverProps, B as buildReorderPayload, G as isMandatoryField, H as QUESTION_KINDS, a as QUESTION_KIND, J as getActiveQuestionKindDetails, K as DEFAULT_AVAILABLE_LANGUAGES, O as DEFAULT_ADVANCED_FEATURES, P as QUESTIONS_INITIAL_VALUE } from './constants-Bw2NSI7-.js';
8
8
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
9
9
  import { useState, useRef, useEffect, createElement } from 'react';
10
10
  import { Droppable, Draggable, DragDropContext } from '@hello-pangea/dnd';
11
11
  import { withT, isMetaKeyPressed, useStateWithDependency, useFuncDebounce, useOnClickOutside } from '@bigbinary/neeto-commons-frontend/react-utils';
12
12
  import { showThumbsUpToastr, withEventTargetValue, hyphenize } from '@bigbinary/neeto-commons-frontend/utils';
13
- import { a as useBuildFormStore } from './buildForm-DQ2wgwuW.js';
13
+ import { a as useBuildFormStore } from './buildForm-DNCW7prR.js';
14
14
  import { shallow } from 'zustand/shallow';
15
15
  import Alert from '@bigbinary/neetoui/Alert';
16
16
  import { useTranslation, Trans } from 'react-i18next';
@@ -21,7 +21,7 @@ import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
21
21
  import Dropdown from '@bigbinary/neetoui/Dropdown';
22
22
  import Tooltip from '@bigbinary/neetoui/Tooltip';
23
23
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
24
- import { i as isFunction, f as fieldWithFallback, c as isNameQuestion } from './index-BGEdOqsc.js';
24
+ import { i as isFunction, f as fieldWithFallback, c as isNameQuestion } from './index-BkNaYmLc.js';
25
25
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
26
26
  import { t } from 'i18next';
27
27
  import { v4 } from 'uuid';
@@ -1409,6 +1409,10 @@ var DOMAIN_RESTRICTION_TRANSLATIONS = {
1409
1409
  popoverDescription: t("neetoForm.domainRestriction.blacklistedDomains.popoverDescription")
1410
1410
  }
1411
1411
  };
1412
+ var EMAIL_VERIFICATION_TRANSLATIONS = {
1413
+ title: t("neetoForm.emailVerification.label"),
1414
+ popoverDescription: t("neetoForm.emailVerification.popoverDescription")
1415
+ };
1412
1416
 
1413
1417
  var _excluded$2 = ["children"];
1414
1418
  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; }
@@ -1712,7 +1716,6 @@ var RestrictDomainsBlock = function RestrictDomainsBlock(_ref) {
1712
1716
  className: "flex flex-col space-y-4",
1713
1717
  "data-cy": "".concat(hyphenate(switchName), "-container"),
1714
1718
  children: [/*#__PURE__*/jsx(SwitchBlock, {
1715
- className: "mt-4",
1716
1719
  name: switchName,
1717
1720
  title: /*#__PURE__*/jsx(TitleWithHelpPopover, {
1718
1721
  helpLink: helpLink,
@@ -1726,6 +1729,28 @@ var RestrictDomainsBlock = function RestrictDomainsBlock(_ref) {
1726
1729
  });
1727
1730
  };
1728
1731
 
1732
+ var VerifyEmails = function VerifyEmails() {
1733
+ var _useBuildFormStore = useBuildFormStore(paths([["formState", "helpDocUrls", "emailVerification"], ["formState", "hostSpecificData", "emailVerification"]])),
1734
+ _useBuildFormStore2 = _slicedToArray(_useBuildFormStore, 2),
1735
+ helpLink = _useBuildFormStore2[0],
1736
+ hostSpecificTranslations = _useBuildFormStore2[1];
1737
+ var _mergeLeft = mergeLeft(hostSpecificTranslations, EMAIL_VERIFICATION_TRANSLATIONS),
1738
+ title = _mergeLeft.title,
1739
+ popoverDescription = _mergeLeft.popoverDescription;
1740
+ return /*#__PURE__*/jsx(Switch, {
1741
+ name: "isVerificationEnabled",
1742
+ label: /*#__PURE__*/jsx(Typography, {
1743
+ component: "span",
1744
+ style: "body1",
1745
+ children: /*#__PURE__*/jsx(TitleWithHelpPopover, {
1746
+ helpLink: helpLink,
1747
+ title: title,
1748
+ description: popoverDescription
1749
+ })
1750
+ })
1751
+ });
1752
+ };
1753
+
1729
1754
  var Email = function Email(_ref) {
1730
1755
  var usesCustomSubmissionComponent = _ref.usesCustomSubmissionComponent;
1731
1756
  var _useFormikContext = useFormikContext(),
@@ -1735,7 +1760,7 @@ var Email = function Email(_ref) {
1735
1760
  _useFormikContext$val3 = _useFormikContext$val.isDomainBlacklistingEnabled,
1736
1761
  isDomainBlacklistingEnabled = _useFormikContext$val3 === void 0 ? false : _useFormikContext$val3;
1737
1762
  return /*#__PURE__*/jsx("div", {
1738
- className: "flex flex-col",
1763
+ className: "flex flex-col space-y-4",
1739
1764
  children: !usesCustomSubmissionComponent && /*#__PURE__*/jsxs(Fragment, {
1740
1765
  children: [/*#__PURE__*/jsx(RestrictDomainsBlock, {
1741
1766
  domainName: "whitelistedDomains",
@@ -1745,7 +1770,7 @@ var Email = function Email(_ref) {
1745
1770
  domainName: "blacklistedDomains",
1746
1771
  isDomainRestrictionEnabled: isDomainBlacklistingEnabled,
1747
1772
  switchName: "isDomainBlacklistingEnabled"
1748
- })]
1773
+ }), /*#__PURE__*/jsx(VerifyEmails, {})]
1749
1774
  })
1750
1775
  });
1751
1776
  };