@bigbinary/neeto-form-frontend 3.14.8 → 4.0.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 (42) hide show
  1. package/README.md +5 -3
  2. package/dist/BuildForm.js +21 -11
  3. package/dist/BuildForm.js.map +1 -1
  4. package/dist/ExternalForm.js +4 -4
  5. package/dist/Submission.js +1 -1
  6. package/dist/UrlBuilder.js +4 -4
  7. package/dist/{buildForm-CXy5L1RP.js → buildForm-BwhLCvEE.js} +2 -2
  8. package/dist/{buildForm-CXy5L1RP.js.map → buildForm-BwhLCvEE.js.map} +1 -1
  9. package/dist/{buildForm-DNCW7prR.js → buildForm-CsVQHcC7.js} +2 -2
  10. package/dist/{buildForm-DNCW7prR.js.map → buildForm-CsVQHcC7.js.map} +1 -1
  11. package/dist/cjs/BuildForm.js +21 -11
  12. package/dist/cjs/BuildForm.js.map +1 -1
  13. package/dist/cjs/ExternalForm.js +4 -4
  14. package/dist/cjs/Submission.js +1 -1
  15. package/dist/cjs/UrlBuilder.js +4 -4
  16. package/dist/cjs/hooks.js +4 -4
  17. package/dist/cjs/index.js +6 -6
  18. package/dist/{constants-b1EQ6-AS.js → constants-51SEJjzI.js} +2 -2
  19. package/dist/constants-51SEJjzI.js.map +1 -0
  20. package/dist/{constants-BVZZfXua.js → constants-C9wKMfgo.js} +2 -2
  21. package/dist/constants-C9wKMfgo.js.map +1 -0
  22. package/dist/{constants-CrLEqZUc.js → constants-Dmtgr5z3.js} +3 -3
  23. package/dist/{constants-CrLEqZUc.js.map → constants-Dmtgr5z3.js.map} +1 -1
  24. package/dist/{constants-CuzR2B5C.js → constants-gYwz1n9Z.js} +3 -3
  25. package/dist/{constants-CuzR2B5C.js.map → constants-gYwz1n9Z.js.map} +1 -1
  26. package/dist/hooks.js +4 -4
  27. package/dist/{index-BARvqe7c.js → index-D4URTv1p.js} +2 -2
  28. package/dist/{index-BARvqe7c.js.map → index-D4URTv1p.js.map} +1 -1
  29. package/dist/{index-BkNaYmLc.js → index-DnHrq-hl.js} +2 -2
  30. package/dist/{index-BkNaYmLc.js.map → index-DnHrq-hl.js.map} +1 -1
  31. package/dist/index.js +6 -6
  32. package/dist/{useFormSubmission-CYqHLtkA.js → useFormSubmission-BGNEnxvm.js} +2 -2
  33. package/dist/{useFormSubmission-CYqHLtkA.js.map → useFormSubmission-BGNEnxvm.js.map} +1 -1
  34. package/dist/{useFormSubmission-DMoyM44A.js → useFormSubmission-BUPnuOSG.js} +2 -2
  35. package/dist/{useFormSubmission-DMoyM44A.js.map → useFormSubmission-BUPnuOSG.js.map} +1 -1
  36. package/dist/{utils-3vf7iBuC.js → utils-Bhu45zuy.js} +4 -4
  37. package/dist/{utils-3vf7iBuC.js.map → utils-Bhu45zuy.js.map} +1 -1
  38. package/dist/{utils-E-UQc-9z.js → utils-DsI2Nrwl.js} +4 -4
  39. package/dist/{utils-E-UQc-9z.js.map → utils-DsI2Nrwl.js.map} +1 -1
  40. package/package.json +12 -12
  41. package/dist/constants-BVZZfXua.js.map +0 -1
  42. package/dist/constants-b1EQ6-AS.js.map +0 -1
@@ -19,14 +19,14 @@ import NeetoUICallout from '@bigbinary/neetoui/Callout';
19
19
  import NoData from '@bigbinary/neetoui/NoData';
20
20
  import { not, path, equals, isEmpty } from 'ramda';
21
21
  import { I18nextProvider, useTranslation } from 'react-i18next';
22
- import { b as usePublicForm, g as useCreateSubmission, h as useUpdateSubmission, f as useSubmission, i as QUERY_KEYS } from './constants-b1EQ6-AS.js';
22
+ import { b as usePublicForm, g as useCreateSubmission, h as useUpdateSubmission, f as useSubmission, i as QUERY_KEYS } from './constants-51SEJjzI.js';
23
23
  import Close from '@bigbinary/neeto-icons/Close';
24
- import { a as isBlank, g as getComponentDisplayName, p as parseServerError } from './index-BkNaYmLc.js';
24
+ import { a as isBlank, g as getComponentDisplayName, p as parseServerError } from './index-DnHrq-hl.js';
25
25
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
26
26
  import Check from '@bigbinary/neeto-icons/Check';
27
27
  import { jsx, jsxs } from 'react/jsx-runtime';
28
- import { C as CALLOUT_STYLES, b as CALLOUT_POSITIONS } from './constants-CuzR2B5C.js';
29
- import { c as clientI18nInstance, d as getWithExpiry, e as clearEmailVerificationDetails, g as generateInitValues, F as FormikWrap, a as getFieldComponent, b as buildAutoCompleteAttribute, r as renderButtonsInOrder, m as mergeRefs, f as generateFormResponse, h as clearLocalStorageValues } from './utils-E-UQc-9z.js';
28
+ import { C as CALLOUT_STYLES, b as CALLOUT_POSITIONS } from './constants-gYwz1n9Z.js';
29
+ import { c as clientI18nInstance, d as getWithExpiry, e as clearEmailVerificationDetails, g as generateInitValues, F as FormikWrap, a as getFieldComponent, b as buildAutoCompleteAttribute, r as renderButtonsInOrder, m as mergeRefs, f as generateFormResponse, h as clearLocalStorageValues } from './utils-DsI2Nrwl.js';
30
30
  import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
31
31
  import '@babel/runtime/helpers/toConsumableArray';
32
32
  import '@bigbinary/neeto-commons-frontend/constants';
@@ -3,7 +3,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
3
  import classnames from 'classnames';
4
4
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
5
5
  import Typography from '@bigbinary/neetoui/Typography';
6
- import { Q as QUESTION_TYPES, f as useSubmission } from './constants-b1EQ6-AS.js';
6
+ import { Q as QUESTION_TYPES, f as useSubmission } from './constants-51SEJjzI.js';
7
7
  import { t } from 'i18next';
8
8
  import { isNotPresent } from '@bigbinary/neeto-cist';
9
9
  import { dateFormat } from '@bigbinary/neeto-commons-frontend/utils';
@@ -10,12 +10,12 @@ import Button from '@bigbinary/neetoui/Button';
10
10
  import NoData from '@bigbinary/neetoui/NoData';
11
11
  import { map, mergeLeft, filter, pluck, isEmpty } from 'ramda';
12
12
  import { useTranslation } from 'react-i18next';
13
- import { g as generateInitValues, F as FormikWrap, a as getFieldComponent, b as buildAutoCompleteAttribute, m as mergeRefs } from './utils-E-UQc-9z.js';
14
- import { b as usePublicForm } from './constants-b1EQ6-AS.js';
13
+ import { g as generateInitValues, F as FormikWrap, a as getFieldComponent, b as buildAutoCompleteAttribute, m as mergeRefs } from './utils-DsI2Nrwl.js';
14
+ import { b as usePublicForm } from './constants-51SEJjzI.js';
15
15
  import { parsePhoneNumber } from 'libphonenumber-js';
16
- import { Q as QUESTIONS_WITHOUT_FIELD_CODE, a as QUESTION_KIND } from './constants-CuzR2B5C.js';
16
+ import { Q as QUESTIONS_WITHOUT_FIELD_CODE, a as QUESTION_KIND } from './constants-gYwz1n9Z.js';
17
17
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
18
- import './index-BkNaYmLc.js';
18
+ import './index-DnHrq-hl.js';
19
19
  import '@babel/runtime/helpers/typeof';
20
20
  import 'i18next';
21
21
  import '@bigbinary/neeto-editor/utils';
@@ -5,7 +5,7 @@ var neetoCist = require('@bigbinary/neeto-cist');
5
5
  var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
6
6
  var ramda = require('ramda');
7
7
  var zustand = require('zustand');
8
- var index = require('./index-BARvqe7c.js');
8
+ var index = require('./index-D4URTv1p.js');
9
9
 
10
10
  /** @type {import("neetocommons/react-utils").ZustandStoreHook} */
11
11
  var useBuildFormStore = zustand.create(reactUtils.withImmutableActions(function (set) {
@@ -34,4 +34,4 @@ var useBuildFormState = function useBuildFormState() {
34
34
 
35
35
  exports.useBuildFormState = useBuildFormState;
36
36
  exports.useBuildFormStore = useBuildFormStore;
37
- //# sourceMappingURL=buildForm-CXy5L1RP.js.map
37
+ //# sourceMappingURL=buildForm-BwhLCvEE.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildForm-CXy5L1RP.js","sources":["../app/javascript/src/stores/buildForm.js"],"sourcesContent":["import i18next from \"i18next\";\nimport { noop } from \"neetocist\";\nimport { withImmutableActions } from \"neetocommons/react-utils\";\nimport { mergeLeft, modify, prop } from \"ramda\";\nimport { create } from \"zustand\";\n\nimport { isFunction } from \"utils\";\n\n/** @type {import(\"neetocommons/react-utils\").ZustandStoreHook} */\nconst useBuildFormStore = create(\n withImmutableActions(set => ({\n formState: {\n selectedLanguage: i18next.resolvedLanguage,\n onLanguageChange: noop,\n formId: null,\n enabled: false,\n title: \"\",\n helpDocUrls: {},\n isUsingDefaultQuestionKinds: true,\n usesCustomSubmissionComponent: false,\n hostSpecificData: {},\n isReorderingQuestions: false,\n onMutateSuccess: noop,\n },\n\n setFormData: arg =>\n set(modify(\"formState\", isFunction(arg) ? arg : mergeLeft(arg))),\n }))\n);\n\nexport const useBuildFormState = () => useBuildFormStore(prop(\"formState\"));\n\nexport default useBuildFormStore;\n"],"names":["useBuildFormStore","create","withImmutableActions","set","formState","selectedLanguage","i18next","resolvedLanguage","onLanguageChange","noop","formId","enabled","title","helpDocUrls","isUsingDefaultQuestionKinds","usesCustomSubmissionComponent","hostSpecificData","isReorderingQuestions","onMutateSuccess","setFormData","arg","modify","isFunction","mergeLeft","useBuildFormState","prop"],"mappings":";;;;;;;;;AAQA;AACA,IAAMA,iBAAiB,GAAGC,cAAM,CAC9BC,+BAAoB,CAAC,UAAAC,GAAG,EAAA;EAAA,OAAK;AAC3BC,IAAAA,SAAS,EAAE;MACTC,gBAAgB,EAAEC,OAAO,CAACC,gBAAgB;AAC1CC,MAAAA,gBAAgB,EAAEC,cAAI;AACtBC,MAAAA,MAAM,EAAE,IAAI;AACZC,MAAAA,OAAO,EAAE,KAAK;AACdC,MAAAA,KAAK,EAAE,EAAE;MACTC,WAAW,EAAE,EAAE;AACfC,MAAAA,2BAA2B,EAAE,IAAI;AACjCC,MAAAA,6BAA6B,EAAE,KAAK;MACpCC,gBAAgB,EAAE,EAAE;AACpBC,MAAAA,qBAAqB,EAAE,KAAK;AAC5BC,MAAAA,eAAe,EAAET;KAClB;AAEDU,IAAAA,WAAW,EAAE,SAAbA,WAAWA,CAAEC,GAAG,EAAA;AAAA,MAAA,OACdjB,GAAG,CAACkB,YAAM,CAAC,WAAW,EAAEC,gBAAU,CAACF,GAAG,CAAC,GAAGA,GAAG,GAAGG,eAAS,CAACH,GAAG,CAAC,CAAC,CAAC;AAAA;GACnE;AAAA,CAAC,CACJ;AAEaI,IAAAA,iBAAiB,GAAG,SAApBA,iBAAiBA,GAAA;AAAA,EAAA,OAASxB,iBAAiB,CAACyB,UAAI,CAAC,WAAW,CAAC,CAAC;AAAA;;;;;"}
1
+ {"version":3,"file":"buildForm-BwhLCvEE.js","sources":["../app/javascript/src/stores/buildForm.js"],"sourcesContent":["import i18next from \"i18next\";\nimport { noop } from \"neetocist\";\nimport { withImmutableActions } from \"neetocommons/react-utils\";\nimport { mergeLeft, modify, prop } from \"ramda\";\nimport { create } from \"zustand\";\n\nimport { isFunction } from \"utils\";\n\n/** @type {import(\"neetocommons/react-utils\").ZustandStoreHook} */\nconst useBuildFormStore = create(\n withImmutableActions(set => ({\n formState: {\n selectedLanguage: i18next.resolvedLanguage,\n onLanguageChange: noop,\n formId: null,\n enabled: false,\n title: \"\",\n helpDocUrls: {},\n isUsingDefaultQuestionKinds: true,\n usesCustomSubmissionComponent: false,\n hostSpecificData: {},\n isReorderingQuestions: false,\n onMutateSuccess: noop,\n },\n\n setFormData: arg =>\n set(modify(\"formState\", isFunction(arg) ? arg : mergeLeft(arg))),\n }))\n);\n\nexport const useBuildFormState = () => useBuildFormStore(prop(\"formState\"));\n\nexport default useBuildFormStore;\n"],"names":["useBuildFormStore","create","withImmutableActions","set","formState","selectedLanguage","i18next","resolvedLanguage","onLanguageChange","noop","formId","enabled","title","helpDocUrls","isUsingDefaultQuestionKinds","usesCustomSubmissionComponent","hostSpecificData","isReorderingQuestions","onMutateSuccess","setFormData","arg","modify","isFunction","mergeLeft","useBuildFormState","prop"],"mappings":";;;;;;;;;AAQA;AACA,IAAMA,iBAAiB,GAAGC,cAAM,CAC9BC,+BAAoB,CAAC,UAAAC,GAAG,EAAA;EAAA,OAAK;AAC3BC,IAAAA,SAAS,EAAE;MACTC,gBAAgB,EAAEC,OAAO,CAACC,gBAAgB;AAC1CC,MAAAA,gBAAgB,EAAEC,cAAI;AACtBC,MAAAA,MAAM,EAAE,IAAI;AACZC,MAAAA,OAAO,EAAE,KAAK;AACdC,MAAAA,KAAK,EAAE,EAAE;MACTC,WAAW,EAAE,EAAE;AACfC,MAAAA,2BAA2B,EAAE,IAAI;AACjCC,MAAAA,6BAA6B,EAAE,KAAK;MACpCC,gBAAgB,EAAE,EAAE;AACpBC,MAAAA,qBAAqB,EAAE,KAAK;AAC5BC,MAAAA,eAAe,EAAET;KAClB;AAEDU,IAAAA,WAAW,EAAE,SAAbA,WAAWA,CAAEC,GAAG,EAAA;AAAA,MAAA,OACdjB,GAAG,CAACkB,YAAM,CAAC,WAAW,EAAEC,gBAAU,CAACF,GAAG,CAAC,GAAGA,GAAG,GAAGG,eAAS,CAACH,GAAG,CAAC,CAAC,CAAC;AAAA;GACnE;AAAA,CAAC,CACJ;AAEaI,IAAAA,iBAAiB,GAAG,SAApBA,iBAAiBA,GAAA;AAAA,EAAA,OAASxB,iBAAiB,CAACyB,UAAI,CAAC,WAAW,CAAC,CAAC;AAAA;;;;;"}
@@ -3,7 +3,7 @@ import { noop } from '@bigbinary/neeto-cist';
3
3
  import { withImmutableActions } from '@bigbinary/neeto-commons-frontend/react-utils';
4
4
  import { modify, mergeLeft, prop } from 'ramda';
5
5
  import { create } from 'zustand';
6
- import { i as isFunction } from './index-BkNaYmLc.js';
6
+ import { i as isFunction } from './index-DnHrq-hl.js';
7
7
 
8
8
  /** @type {import("neetocommons/react-utils").ZustandStoreHook} */
9
9
  var useBuildFormStore = create(withImmutableActions(function (set) {
@@ -31,4 +31,4 @@ var useBuildFormState = function useBuildFormState() {
31
31
  };
32
32
 
33
33
  export { useBuildFormStore as a, useBuildFormState as u };
34
- //# sourceMappingURL=buildForm-DNCW7prR.js.map
34
+ //# sourceMappingURL=buildForm-CsVQHcC7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildForm-DNCW7prR.js","sources":["../app/javascript/src/stores/buildForm.js"],"sourcesContent":["import i18next from \"i18next\";\nimport { noop } from \"neetocist\";\nimport { withImmutableActions } from \"neetocommons/react-utils\";\nimport { mergeLeft, modify, prop } from \"ramda\";\nimport { create } from \"zustand\";\n\nimport { isFunction } from \"utils\";\n\n/** @type {import(\"neetocommons/react-utils\").ZustandStoreHook} */\nconst useBuildFormStore = create(\n withImmutableActions(set => ({\n formState: {\n selectedLanguage: i18next.resolvedLanguage,\n onLanguageChange: noop,\n formId: null,\n enabled: false,\n title: \"\",\n helpDocUrls: {},\n isUsingDefaultQuestionKinds: true,\n usesCustomSubmissionComponent: false,\n hostSpecificData: {},\n isReorderingQuestions: false,\n onMutateSuccess: noop,\n },\n\n setFormData: arg =>\n set(modify(\"formState\", isFunction(arg) ? arg : mergeLeft(arg))),\n }))\n);\n\nexport const useBuildFormState = () => useBuildFormStore(prop(\"formState\"));\n\nexport default useBuildFormStore;\n"],"names":["useBuildFormStore","create","withImmutableActions","set","formState","selectedLanguage","i18next","resolvedLanguage","onLanguageChange","noop","formId","enabled","title","helpDocUrls","isUsingDefaultQuestionKinds","usesCustomSubmissionComponent","hostSpecificData","isReorderingQuestions","onMutateSuccess","setFormData","arg","modify","isFunction","mergeLeft","useBuildFormState","prop"],"mappings":";;;;;;;AAQA;AACA,IAAMA,iBAAiB,GAAGC,MAAM,CAC9BC,oBAAoB,CAAC,UAAAC,GAAG,EAAA;EAAA,OAAK;AAC3BC,IAAAA,SAAS,EAAE;MACTC,gBAAgB,EAAEC,OAAO,CAACC,gBAAgB;AAC1CC,MAAAA,gBAAgB,EAAEC,IAAI;AACtBC,MAAAA,MAAM,EAAE,IAAI;AACZC,MAAAA,OAAO,EAAE,KAAK;AACdC,MAAAA,KAAK,EAAE,EAAE;MACTC,WAAW,EAAE,EAAE;AACfC,MAAAA,2BAA2B,EAAE,IAAI;AACjCC,MAAAA,6BAA6B,EAAE,KAAK;MACpCC,gBAAgB,EAAE,EAAE;AACpBC,MAAAA,qBAAqB,EAAE,KAAK;AAC5BC,MAAAA,eAAe,EAAET;KAClB;AAEDU,IAAAA,WAAW,EAAE,SAAbA,WAAWA,CAAEC,GAAG,EAAA;AAAA,MAAA,OACdjB,GAAG,CAACkB,MAAM,CAAC,WAAW,EAAEC,UAAU,CAACF,GAAG,CAAC,GAAGA,GAAG,GAAGG,SAAS,CAACH,GAAG,CAAC,CAAC,CAAC;AAAA;GACnE;AAAA,CAAC,CACJ;AAEaI,IAAAA,iBAAiB,GAAG,SAApBA,iBAAiBA,GAAA;AAAA,EAAA,OAASxB,iBAAiB,CAACyB,IAAI,CAAC,WAAW,CAAC,CAAC;AAAA;;;;"}
1
+ {"version":3,"file":"buildForm-CsVQHcC7.js","sources":["../app/javascript/src/stores/buildForm.js"],"sourcesContent":["import i18next from \"i18next\";\nimport { noop } from \"neetocist\";\nimport { withImmutableActions } from \"neetocommons/react-utils\";\nimport { mergeLeft, modify, prop } from \"ramda\";\nimport { create } from \"zustand\";\n\nimport { isFunction } from \"utils\";\n\n/** @type {import(\"neetocommons/react-utils\").ZustandStoreHook} */\nconst useBuildFormStore = create(\n withImmutableActions(set => ({\n formState: {\n selectedLanguage: i18next.resolvedLanguage,\n onLanguageChange: noop,\n formId: null,\n enabled: false,\n title: \"\",\n helpDocUrls: {},\n isUsingDefaultQuestionKinds: true,\n usesCustomSubmissionComponent: false,\n hostSpecificData: {},\n isReorderingQuestions: false,\n onMutateSuccess: noop,\n },\n\n setFormData: arg =>\n set(modify(\"formState\", isFunction(arg) ? arg : mergeLeft(arg))),\n }))\n);\n\nexport const useBuildFormState = () => useBuildFormStore(prop(\"formState\"));\n\nexport default useBuildFormStore;\n"],"names":["useBuildFormStore","create","withImmutableActions","set","formState","selectedLanguage","i18next","resolvedLanguage","onLanguageChange","noop","formId","enabled","title","helpDocUrls","isUsingDefaultQuestionKinds","usesCustomSubmissionComponent","hostSpecificData","isReorderingQuestions","onMutateSuccess","setFormData","arg","modify","isFunction","mergeLeft","useBuildFormState","prop"],"mappings":";;;;;;;AAQA;AACA,IAAMA,iBAAiB,GAAGC,MAAM,CAC9BC,oBAAoB,CAAC,UAAAC,GAAG,EAAA;EAAA,OAAK;AAC3BC,IAAAA,SAAS,EAAE;MACTC,gBAAgB,EAAEC,OAAO,CAACC,gBAAgB;AAC1CC,MAAAA,gBAAgB,EAAEC,IAAI;AACtBC,MAAAA,MAAM,EAAE,IAAI;AACZC,MAAAA,OAAO,EAAE,KAAK;AACdC,MAAAA,KAAK,EAAE,EAAE;MACTC,WAAW,EAAE,EAAE;AACfC,MAAAA,2BAA2B,EAAE,IAAI;AACjCC,MAAAA,6BAA6B,EAAE,KAAK;MACpCC,gBAAgB,EAAE,EAAE;AACpBC,MAAAA,qBAAqB,EAAE,KAAK;AAC5BC,MAAAA,eAAe,EAAET;KAClB;AAEDU,IAAAA,WAAW,EAAE,SAAbA,WAAWA,CAAEC,GAAG,EAAA;AAAA,MAAA,OACdjB,GAAG,CAACkB,MAAM,CAAC,WAAW,EAAEC,UAAU,CAACF,GAAG,CAAC,GAAGA,GAAG,GAAGG,SAAS,CAACH,GAAG,CAAC,CAAC,CAAC;AAAA;GACnE;AAAA,CAAC,CACJ;AAEaI,IAAAA,iBAAiB,GAAG,SAApBA,iBAAiBA,GAAA;AAAA,EAAA,OAASxB,iBAAiB,CAACyB,IAAI,CAAC,WAAW,CAAC,CAAC;AAAA;;;;"}
@@ -5,14 +5,14 @@ var classnames = require('classnames');
5
5
  var neetoCist = require('@bigbinary/neeto-cist');
6
6
  var Spinner = require('@bigbinary/neetoui/Spinner');
7
7
  var ramda = require('ramda');
8
- var constants = require('../constants-BVZZfXua.js');
9
- var constants$1 = require('../constants-CrLEqZUc.js');
8
+ var constants = require('../constants-C9wKMfgo.js');
9
+ var constants$1 = require('../constants-Dmtgr5z3.js');
10
10
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
11
11
  var React = require('react');
12
12
  var dnd = require('@hello-pangea/dnd');
13
13
  var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
14
14
  var utils = require('@bigbinary/neeto-commons-frontend/utils');
15
- var buildForm = require('../buildForm-CXy5L1RP.js');
15
+ var buildForm = require('../buildForm-BwhLCvEE.js');
16
16
  var shallow = require('zustand/shallow');
17
17
  var Alert = require('@bigbinary/neetoui/Alert');
18
18
  var reactI18next = require('react-i18next');
@@ -23,7 +23,7 @@ var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
23
23
  var Dropdown = require('@bigbinary/neetoui/Dropdown');
24
24
  var Tooltip = require('@bigbinary/neetoui/Tooltip');
25
25
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
26
- var index = require('../index-BARvqe7c.js');
26
+ var index = require('../index-D4URTv1p.js');
27
27
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
28
28
  var i18next = require('i18next');
29
29
  var uuid = require('uuid');
@@ -268,7 +268,8 @@ var Card = function Card(_ref) {
268
268
  onSelect = _ref.onSelect,
269
269
  onEdit = _ref.onEdit,
270
270
  onClone = _ref.onClone,
271
- onDelete = _ref.onDelete;
271
+ onDelete = _ref.onDelete,
272
+ canManageQuestions = _ref.canManageQuestions;
272
273
  var _useState = React.useState(false),
273
274
  _useState2 = _slicedToArray(_useState, 2),
274
275
  isTooltipEnabled = _useState2[0],
@@ -297,7 +298,7 @@ var Card = function Card(_ref) {
297
298
  },
298
299
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
299
300
  className: "flex min-w-0 flex-grow items-center gap-1",
300
- children: [/*#__PURE__*/jsxRuntime.jsx(constants$1.Drag, {
301
+ children: [canManageQuestions && /*#__PURE__*/jsxRuntime.jsx(constants$1.Drag, {
301
302
  className: "neeto-ui-text-gray-600 flex-shrink-0"
302
303
  }), /*#__PURE__*/jsxRuntime.jsx(Tooltip, {
303
304
  content: questionLabel,
@@ -313,7 +314,7 @@ var Card = function Card(_ref) {
313
314
  children: questionLabel
314
315
  })
315
316
  })]
316
- }), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, {
317
+ }), canManageQuestions && /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, {
317
318
  dropdownButtonProps: {
318
319
  className: "shrink-0"
319
320
  },
@@ -355,9 +356,11 @@ var Questions = function Questions(_ref) {
355
356
  onEdit = _ref.onEdit,
356
357
  onClone = _ref.onClone,
357
358
  onDelete = _ref.onDelete,
358
- onSelect = _ref.onSelect;
359
+ onSelect = _ref.onSelect,
360
+ canManageQuestions = _ref.canManageQuestions;
359
361
  return /*#__PURE__*/jsxRuntime.jsx(dnd.Droppable, {
360
362
  droppableId: "droppable",
363
+ isDropDisabled: !canManageQuestions,
361
364
  children: function children(_ref2) {
362
365
  var droppableProps = _ref2.droppableProps,
363
366
  placeholder = _ref2.placeholder,
@@ -370,6 +373,7 @@ var Questions = function Questions(_ref) {
370
373
  return /*#__PURE__*/React.createElement(dnd.Draggable, {
371
374
  index: index,
372
375
  draggableId: "question-".concat((_question$id = question.id) !== null && _question$id !== void 0 ? _question$id : question.nodeId),
376
+ isDragDisabled: !canManageQuestions,
373
377
  key: "question-".concat((_question$id2 = question.id) !== null && _question$id2 !== void 0 ? _question$id2 : question.nodeId)
374
378
  }, function (_ref3) {
375
379
  var draggableProps = _ref3.draggableProps,
@@ -379,6 +383,7 @@ var Questions = function Questions(_ref) {
379
383
  ref: innerRef,
380
384
  children: /*#__PURE__*/jsxRuntime.jsx(Card, {
381
385
  allQuestionKinds: allQuestionKinds,
386
+ canManageQuestions: canManageQuestions,
382
387
  getActiveKindDetails: getActiveKindDetails,
383
388
  onClone: onClone,
384
389
  onEdit: onEdit,
@@ -2185,6 +2190,7 @@ var Form = function Form(_ref) {
2185
2190
  isDisabledFieldLabel = _ref.isDisabledFieldLabel,
2186
2191
  disabledAddButtonHelpPopoverProps = _ref.disabledAddButtonHelpPopoverProps,
2187
2192
  isFormEnabled = _ref.isFormEnabled,
2193
+ canManageQuestions = _ref.canManageQuestions,
2188
2194
  savedTitle = _ref.savedTitle,
2189
2195
  formTitle = _ref.formTitle,
2190
2196
  formDescription = _ref.formDescription,
@@ -2374,6 +2380,7 @@ var Form = function Form(_ref) {
2374
2380
  });
2375
2381
  },
2376
2382
  children: /*#__PURE__*/jsxRuntime.jsx(Questions, {
2383
+ canManageQuestions: canManageQuestions,
2377
2384
  getActiveKindDetails: getActiveKindDetails,
2378
2385
  isDeletable: isDeletable,
2379
2386
  questions: questions,
@@ -2384,7 +2391,7 @@ var Form = function Form(_ref) {
2384
2391
  onEdit: handleEdit,
2385
2392
  onSelect: handleSelect
2386
2393
  })
2387
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
2394
+ }), canManageQuestions && /*#__PURE__*/jsxRuntime.jsx("div", {
2388
2395
  className: "mb-8 flex w-full items-center gap-x-1",
2389
2396
  children: /*#__PURE__*/jsxRuntime.jsx(AddQuestion, {
2390
2397
  addQuestionHelpProps: addQuestionHelpProps,
@@ -2395,7 +2402,7 @@ var Form = function Form(_ref) {
2395
2402
  })]
2396
2403
  }) : /*#__PURE__*/jsxRuntime.jsx(AddFirstQuestion, {
2397
2404
  disabledAddButtonHelpPopoverProps: disabledAddButtonHelpPopoverProps,
2398
- isDisabled: ramda.isEmpty(availableQuestionKinds),
2405
+ isDisabled: ramda.isEmpty(availableQuestionKinds) || !canManageQuestions,
2399
2406
  onAdd: handleAdd
2400
2407
  })
2401
2408
  }), /*#__PURE__*/jsxRuntime.jsx(ManageQuestionPane, {
@@ -2456,7 +2463,9 @@ var BuildForm = function BuildForm(_ref) {
2456
2463
  usesCustomSubmissionComponent = _ref$usesCustomSubmis === void 0 ? false : _ref$usesCustomSubmis,
2457
2464
  _ref$onMutateSuccess = _ref.onMutateSuccess,
2458
2465
  onMutateSuccess = _ref$onMutateSuccess === void 0 ? neetoCist.noop : _ref$onMutateSuccess,
2459
- hostSpecificData = _ref.hostSpecificData;
2466
+ hostSpecificData = _ref.hostSpecificData,
2467
+ _ref$canManageQuestio = _ref.canManageQuestions,
2468
+ canManageQuestions = _ref$canManageQuestio === void 0 ? false : _ref$canManageQuestio;
2460
2469
  var queryClient = reactQuery.useQueryClient();
2461
2470
  var _useForm = constants.useForm({
2462
2471
  formId: id,
@@ -2498,6 +2507,7 @@ var BuildForm = function BuildForm(_ref) {
2498
2507
  additionalActionOptions: additionalActionOptions,
2499
2508
  advancedFeatures: advancedFeatures,
2500
2509
  availableLanguages: availableLanguages,
2510
+ canManageQuestions: canManageQuestions,
2501
2511
  disabledAddButtonHelpPopoverProps: disabledAddButtonHelpPopoverProps,
2502
2512
  formDescription: formDescription,
2503
2513
  formTitle: formTitle,