@bigbinary/neeto-form-frontend 3.9.2 → 3.9.4

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.
@@ -90,8 +90,8 @@
90
90
  "hiddenQuestion": "This field is hidden to the public. However you can still edit it."
91
91
  },
92
92
  "successPage": {
93
- "title1": "Thanks for completing this form.",
94
- "title2": "Your response has been accepted."
93
+ "title1": "Thank You.",
94
+ "title2": "Your response has been received."
95
95
  },
96
96
  "emptyState": {
97
97
  "noData": "No data found"
package/dist/BuildForm.js CHANGED
@@ -3,17 +3,18 @@ import { useState, useRef, useEffect, createElement } from 'react';
3
3
  import { useQueryClient } from '@tanstack/react-query';
4
4
  import classnames from 'classnames';
5
5
  import { useFormikContext, useField, FieldArray, Form as Form$3, Formik } from 'formik';
6
- import { isPresent, truncate, findBy, isNotPresent, slugify, filterBy, hyphenate, noop, nullSafe, removeBy } from '@bigbinary/neeto-cist';
7
- import { showThumbsUpToastr, hyphenize } from '@bigbinary/neeto-commons-frontend/utils';
6
+ import { isPresent, truncate, findBy, isNotPresent, slugify, hyphenate, noop, nullSafe, filterBy, removeBy } from '@bigbinary/neeto-cist';
7
+ import { showThumbsUpToastr, withEventTargetValue, hyphenize } from '@bigbinary/neeto-commons-frontend/utils';
8
8
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
9
- import { equals, includes, __, reduce, assoc, path, when, isEmpty, reject, keys, pick, omit, pluck, modify, without, mergeLeft, isNil, pipe, filter, isNotNil, uniq, join, map, test, difference, prop, split, last, concat, F } from 'ramda';
9
+ import { equals, includes, __, reduce, assoc, path, when, isEmpty, reject, keys, pick, omit, modify, without, mergeLeft, isNil, pipe, filter, isNotNil, uniq, join, pluck, map, test, difference, prop, split, last, concat, F } from 'ramda';
10
10
  import { h as useDeleteQuestion, i as useFetchQuestions, j as useCreateQuestion, k as useUpdateQuestion, l as useReorderQuestions, Q as QUERY_KEYS } from './useFormApi-BS-TCKwR.js';
11
11
  import { Q as QUESTION_KIND } from './constants-DlRX5mcQ.js';
12
- import { I as INDEPENDENT_LABELS_MAP, R as RICH_TEXT_QUESTIONS, A as AUTO_GENERATED_KINDS, a as IMMUTABLE_KINDS, h as htmlToPlainText, i as isElementOverflowing, D as Drag, b as QUESTION_TYPES, S as SELECTABLE_KINDS, c as RESERVED_FIELD_CODES, Q as QUESTIONS_WITHOUT_FIELD_CODE, N as NON_HIDEABLE_FIELDS, C as CAPTCHA_TYPES, F as FILE_TYPES_MAP, d as FILE_GROUPS, M as MINIMUM_OPTIONS, e as RATING_OPTIONS, f as STAR_RATING_MIN_VALUE_OPTIONS, j as STAR_RATING_MAX_VALUE_OPTIONS, k as STAR_RATING_ICONS_MAP, l as QUESTION_ACTIONS, m as QUESTION_KINDS, n as getActiveQuestionKindDetails, o as DEFAULT_AVAILABLE_LANGUAGES, p as QUESTIONS_INITIAL_VALUE, q as MANDATORY_KINDS } from './constants-pb1PsblC.js';
12
+ import { I as INDEPENDENT_LABELS_MAP, R as RICH_TEXT_QUESTIONS, A as AUTO_GENERATED_KINDS, a as IMMUTABLE_KINDS, h as htmlToPlainText, i as isElementOverflowing, D as Drag, b as QUESTION_TYPES, S as SELECTABLE_KINDS, N as NON_BASIC_LATIN_CHARACTERS_REGEX, c as RESERVED_FIELD_CODES, F as FIELD_CODES_REJECT_CHARS_REGEX, Q as QUESTIONS_WITHOUT_FIELD_CODE, d as NON_HIDEABLE_FIELDS, C as CAPTCHA_TYPES, e as FILE_TYPES_MAP, f as FILE_GROUPS, M as MINIMUM_OPTIONS, j as RATING_OPTIONS, k as STAR_RATING_MIN_VALUE_OPTIONS, l as STAR_RATING_MAX_VALUE_OPTIONS, m as STAR_RATING_ICONS_MAP, n as QUESTION_ACTIONS, o as QUESTION_KINDS, p as getActiveQuestionKindDetails, q as DEFAULT_AVAILABLE_LANGUAGES, r as QUESTIONS_INITIAL_VALUE, s as MANDATORY_KINDS } from './constants-CEOQLu3J.js';
13
13
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
14
14
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
15
15
  import { Droppable, Draggable, DragDropContext } from '@hello-pangea/dnd';
16
16
  import { isMetaKeyPressed, withT, useStateWithDependency, useOnClickOutside } from '@bigbinary/neeto-commons-frontend/react-utils';
17
+ import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
17
18
  import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
18
19
  import { useTranslation, Trans } from 'react-i18next';
19
20
  import { a as useBuildFormStore } from './buildForm-GdQQ62ve.js';
@@ -25,7 +26,6 @@ import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
25
26
  import Typography from '@bigbinary/neetoui/Typography';
26
27
  import Dropdown from '@bigbinary/neetoui/Dropdown';
27
28
  import Tooltip from '@bigbinary/neetoui/Tooltip';
28
- import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
29
29
  import { t } from 'i18next';
30
30
  import Plus from '@bigbinary/neeto-icons/Plus';
31
31
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
@@ -443,18 +443,43 @@ function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t
443
443
  var isChoiceQuestion = function isChoiceQuestion(question) {
444
444
  return includes(question === null || question === void 0 ? void 0 : question.kind, SELECTABLE_KINDS);
445
445
  };
446
- var generateUniqueFieldCode = function generateUniqueFieldCode(type, questions) {
447
- var fieldCodes = pluck("fieldCode", filterBy({
448
- kind: type
449
- }, questions));
450
- var uniqueNumber = fieldCodes.length;
446
+ var underscoredWithoutSpecialCharacters = function underscoredWithoutSpecialCharacters(string) {
447
+ return string.toLowerCase().replace(/[\s-]/g, "_").replace(/[\W]/gi, "").replace(/_+/g, "_").replace(/^_+|_+$/, "");
448
+ };
449
+ var addSuffixForReservedFieldCode = function addSuffixForReservedFieldCode(fieldCode) {
450
+ return RESERVED_FIELD_CODES.includes(fieldCode) ? "".concat(fieldCode, "_field") : fieldCode;
451
+ };
452
+ var getUniqueNumbersFromExistingFieldCodes = function getUniqueNumbersFromExistingFieldCodes(prefix, questions) {
453
+ return questions.filter(function (question) {
454
+ return question.fieldCode.startsWith(prefix);
455
+ }).map(function (question) {
456
+ return parseInt(question.fieldCode.replace(prefix, "")) || 0;
457
+ });
458
+ };
459
+ var generateFieldCodePrefix = function generateFieldCodePrefix(label, kind) {
460
+ var prefix;
461
+ if (NON_BASIC_LATIN_CHARACTERS_REGEX.test(label) || isEmpty(label)) {
462
+ prefix = kind;
463
+ } else {
464
+ var sanitizedLabel = underscoredWithoutSpecialCharacters(label).slice(0, 30);
465
+ prefix = isEmpty(sanitizedLabel) ? kind : sanitizedLabel;
466
+ }
467
+ return addSuffixForReservedFieldCode(prefix) || "";
468
+ };
469
+ var generateUniqueFieldCode = function generateUniqueFieldCode(_ref) {
470
+ var questions = _ref.questions,
471
+ _ref$label = _ref.label,
472
+ label = _ref$label === void 0 ? "" : _ref$label,
473
+ _ref$kind = _ref.kind,
474
+ kind = _ref$kind === void 0 ? "" : _ref$kind;
475
+ var prefix = generateFieldCodePrefix(label, kind);
476
+ var uniqueNumber = Math.max.apply(Math, [0].concat(_toConsumableArray(getUniqueNumbersFromExistingFieldCodes(prefix, questions))));
451
477
  var candidateFieldCode = "";
452
- var prefix = RESERVED_FIELD_CODES.includes(type) ? "".concat(type, "_field") : type;
453
478
 
454
479
  //We need to continue this while loop until we can generate a unique fieldCode
455
480
  // eslint-disable-next-line no-constant-condition
456
481
  while (true) {
457
- candidateFieldCode = "".concat(prefix).concat(uniqueNumber || "");
482
+ candidateFieldCode = "".concat(prefix).concat(uniqueNumber === 0 ? "" : uniqueNumber);
458
483
  if (!findBy({
459
484
  fieldCode: candidateFieldCode
460
485
  }, questions)) break;
@@ -462,18 +487,18 @@ var generateUniqueFieldCode = function generateUniqueFieldCode(type, questions)
462
487
  }
463
488
  return candidateFieldCode;
464
489
  };
465
- var isQuestionKindAlreadyActive = function isQuestionKindAlreadyActive(_ref) {
466
- var activeQuestions = _ref.activeQuestions,
467
- kind = _ref.kind;
490
+ var isQuestionKindAlreadyActive = function isQuestionKindAlreadyActive(_ref2) {
491
+ var activeQuestions = _ref2.activeQuestions,
492
+ kind = _ref2.kind;
468
493
  return activeQuestions.some(function (activeQuestion) {
469
494
  return activeQuestion.kind === kind.type && activeQuestion._destroy !== true;
470
495
  });
471
496
  };
472
- var handleFieldDragEnd = function handleFieldDragEnd(_ref2) {
473
- var items = _ref2.items,
474
- setValue = _ref2.setValue,
475
- source = _ref2.source,
476
- destination = _ref2.destination;
497
+ var handleFieldDragEnd = function handleFieldDragEnd(_ref3) {
498
+ var items = _ref3.items,
499
+ setValue = _ref3.setValue,
500
+ source = _ref3.source,
501
+ destination = _ref3.destination;
477
502
  if (!(destination && items instanceof Array)) return;
478
503
  var nextItems = _toConsumableArray(items);
479
504
  arrayHelpers.moveItem(nextItems, source.index, destination.index);
@@ -484,32 +509,36 @@ var handleFieldDragEnd = function handleFieldDragEnd(_ref2) {
484
509
  });
485
510
  setValue("questions", orderedItems);
486
511
  };
487
- var createFieldData = function createFieldData(_ref3) {
488
- var _ref3$kind = _ref3.kind,
489
- defaults = _ref3$kind.defaults,
490
- type = _ref3$kind.type,
491
- metadata = _ref3$kind.metadata,
492
- _ref3$isRequired = _ref3.isRequired,
493
- isRequired = _ref3$isRequired === void 0 ? undefined : _ref3$isRequired,
494
- questions = _ref3.questions;
512
+ var createFieldData = function createFieldData(_ref4) {
513
+ var _ref4$kind = _ref4.kind,
514
+ defaults = _ref4$kind.defaults,
515
+ type = _ref4$kind.type,
516
+ metadata = _ref4$kind.metadata,
517
+ _ref4$isRequired = _ref4.isRequired,
518
+ isRequired = _ref4$isRequired === void 0 ? undefined : _ref4$isRequired,
519
+ questions = _ref4.questions;
495
520
  return _objectSpread$e(_objectSpread$e({}, defaults), {}, {
496
521
  metadata: metadata,
497
522
  isRequired: isRequired,
498
523
  kind: type,
499
524
  nodeId: v4(),
500
- fieldCode: generateUniqueFieldCode(type, questions)
525
+ fieldCode: generateUniqueFieldCode({
526
+ questions: questions,
527
+ kind: type,
528
+ label: defaults["label"]
529
+ })
501
530
  });
502
531
  };
503
- var duplicateFieldData = function duplicateFieldData(_ref4) {
504
- var item = _ref4.item,
505
- questionKinds = _ref4.questionKinds,
506
- questions = _ref4.questions;
507
- var questionKind = findBy({
508
- type: item.kind
509
- }, questionKinds);
532
+ var duplicateFieldData = function duplicateFieldData(_ref5) {
533
+ var item = _ref5.item,
534
+ questionKinds = _ref5.questionKinds,
535
+ questions = _ref5.questions;
510
536
  var isRequired = item.isRequired,
511
537
  kind = item.kind,
512
538
  optionsAttributes = item.optionsAttributes;
539
+ var questionKind = findBy({
540
+ type: kind
541
+ }, questionKinds);
513
542
  var label = fieldWithFallback(item, "label");
514
543
  var defaultAttributeNames = keys(questionKind.defaults || {});
515
544
  var defaultAttributes = pick(defaultAttributeNames, item);
@@ -522,15 +551,19 @@ var duplicateFieldData = function duplicateFieldData(_ref4) {
522
551
  label: newQuestionLabel,
523
552
  optionsAttributes: optionsAttributes && optionsAttributes.map(omit(["id"])),
524
553
  nodeId: v4(),
525
- fieldCode: generateUniqueFieldCode(item.kind, questions),
554
+ fieldCode: generateUniqueFieldCode({
555
+ questions: questions,
556
+ kind: kind,
557
+ label: newQuestionLabel
558
+ }),
526
559
  displayOrder: item.displayOrder + 1
527
560
  });
528
561
  };
529
- var getAvailableQuestionKinds = function getAvailableQuestionKinds(_ref5) {
530
- var allQuestionKinds = _ref5.allQuestionKinds,
531
- _ref5$activeQuestions = _ref5.activeQuestions,
532
- activeQuestions = _ref5$activeQuestions === void 0 ? [] : _ref5$activeQuestions,
533
- isKindAlreadyActive = _ref5.isKindAlreadyActive;
562
+ var getAvailableQuestionKinds = function getAvailableQuestionKinds(_ref6) {
563
+ var allQuestionKinds = _ref6.allQuestionKinds,
564
+ _ref6$activeQuestions = _ref6.activeQuestions,
565
+ activeQuestions = _ref6$activeQuestions === void 0 ? [] : _ref6$activeQuestions,
566
+ isKindAlreadyActive = _ref6.isKindAlreadyActive;
534
567
  if (isEmpty(activeQuestions)) return allQuestionKinds;
535
568
  return reject(function (kind) {
536
569
  var isSingularKind = kind.isSingular;
@@ -593,6 +626,7 @@ var INITIAL_VALUES = {
593
626
  label: "",
594
627
  fieldCode: ""
595
628
  };
629
+ var VALID_FIELD_CODE_REGEX = /^[a-z0-9]+(_[a-z0-9]+)*$/;
596
630
 
597
631
  var _excluded$8 = ["label", "name"];
598
632
  function ownKeys$d(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; }
@@ -803,6 +837,7 @@ var FieldCode = function FieldCode() {
803
837
  required: true,
804
838
  label: t("neetoForm.questions.common.questionFields.field.fieldCode"),
805
839
  name: "fieldCode",
840
+ rejectCharsRegex: FIELD_CODES_REJECT_CHARS_REGEX,
806
841
  helpText: helpDocUrl && /*#__PURE__*/jsx(Trans, {
807
842
  i18nKey: "neetoForm.questions.common.questionFields.field.fieldCodeHelpDescription",
808
843
  components: {
@@ -837,7 +872,8 @@ var Form$1 = function Form(_ref) {
837
872
  values = _useFormikContext.values,
838
873
  setValues = _useFormikContext.setValues,
839
874
  setErrors = _useFormikContext.setErrors,
840
- setTouched = _useFormikContext.setTouched;
875
+ setTouched = _useFormikContext.setTouched,
876
+ setFieldValue = _useFormikContext.setFieldValue;
841
877
  var hideQuestionHelpDoc = useBuildFormStore(path(["formState", "helpDocUrls", "hideQuestion"]));
842
878
  var _useBuildFormStore = useBuildFormStore(function (store) {
843
879
  var _store$formState, _store$formState2;
@@ -896,6 +932,16 @@ var Form$1 = function Form(_ref) {
896
932
  setErrors({});
897
933
  setTouched({});
898
934
  };
935
+ var handleLabelChange = function handleLabelChange(label) {
936
+ setFieldValue("label", label);
937
+ if (isEdit) return;
938
+ var uniqueFieldCode = generateUniqueFieldCode({
939
+ questions: questions,
940
+ label: label,
941
+ kind: kind
942
+ });
943
+ setFieldValue("fieldCode", uniqueFieldCode);
944
+ };
899
945
  return /*#__PURE__*/jsx(Pane.Body, {
900
946
  children: /*#__PURE__*/jsxs("div", {
901
947
  className: "w-full space-y-4",
@@ -920,7 +966,8 @@ var Form$1 = function Form(_ref) {
920
966
  disabled: isLabelDisabled,
921
967
  name: "label",
922
968
  placeholder: DEFAULT_PLACEHOLDERS[kind],
923
- label: t("neetoForm.questions.common.questionFields.field.question")
969
+ label: t("neetoForm.questions.common.questionFields.field.question"),
970
+ onChange: withEventTargetValue(handleLabelChange)
924
971
  }), shouldShowPlaceholder && /*#__PURE__*/jsx(FormikAdaptiveInput, {
925
972
  name: "placeholder",
926
973
  label: t("neetoForm.questions.common.questionFields.field.placeholder")
@@ -950,38 +997,48 @@ var requiredLabelValidation = function requiredLabelValidation(schema, field) {
950
997
  field: field
951
998
  }));
952
999
  };
1000
+ var fieldCodeValidation = function fieldCodeValidation(schema, field) {
1001
+ return schema.trim().required(t("neetoForm.common.fieldReq", {
1002
+ field: field
1003
+ })).matches(VALID_FIELD_CODE_REGEX, t("neetoForm.error.invalidField", {
1004
+ label: field
1005
+ }));
1006
+ };
953
1007
  var richTextFieldMissingErrorMessage = function richTextFieldMissingErrorMessage(kind) {
954
1008
  var field = equals(kind, QUESTION_TYPES.PARAGRAPH) ? t("neetoForm.fields.def") : t("neetoForm.fields.tcf");
955
1009
  return t("neetoForm.error.fieldCantBeEmpty", {
956
1010
  field: field
957
1011
  });
958
1012
  };
959
- var formValidationSchema = yup.object().shape({
960
- kind: yup.string().trim().required(t("neetoForm.common.fieldReq", {
961
- field: t("neetoForm.questions.common.questionFields.field.questionType")
962
- })),
963
- label: yup.string().when("kind", function (kind, schema) {
964
- return includes(kind, RICH_TEXT_QUESTIONS) ? schema.test("required", richTextFieldMissingErrorMessage(kind), function (value) {
965
- return !isEditorEmpty(value);
966
- }) : requiredLabelValidation(schema, t("neetoForm.questions.common.questionFields.field.question"));
967
- }),
968
- fieldCode: yup.string().trim().notOneOf(RESERVED_FIELD_CODES, t("neetoForm.error.invalidFieldCode")).when("kind", function (kind, schema) {
969
- return includes(kind, QUESTIONS_WITHOUT_FIELD_CODE) ? schema.notRequired() : requiredLabelValidation(schema, t("neetoForm.questions.common.questionFields.field.fieldCode"));
970
- }),
971
- optionsAttributes: yup.array().when("_destroy", {
972
- is: true,
973
- otherwise: function otherwise(schema) {
974
- return schema.when("kind", function (kind, schema) {
975
- return includes(kind, SELECTABLE_KINDS) ? schema.of(yup.object().shape({
976
- label: requiredLabelValidation(yup.string(), t("neetoForm.questions.common.questionFields.field.option"))
977
- })) : schema.notRequired();
978
- });
979
- }
980
- }),
981
- highestRatingLabel: yup.string().nullable(),
982
- averageRatingLabel: yup.string().nullable(),
983
- lowestRatingLabel: yup.string().nullable()
984
- });
1013
+ var formValidationSchema = function formValidationSchema() {
1014
+ var enableFieldCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1015
+ return yup.object().shape({
1016
+ kind: yup.string().trim().required(t("neetoForm.common.fieldReq", {
1017
+ field: t("neetoForm.questions.common.questionFields.field.questionType")
1018
+ })),
1019
+ label: yup.string().when("kind", function (kind, schema) {
1020
+ return includes(kind, RICH_TEXT_QUESTIONS) ? schema.test(richTextFieldMissingErrorMessage(kind), function (value) {
1021
+ return !isEditorEmpty(value);
1022
+ }) : requiredLabelValidation(schema, t("neetoForm.questions.common.questionFields.field.question"));
1023
+ }),
1024
+ fieldCode: yup.string().trim().notOneOf(RESERVED_FIELD_CODES, t("neetoForm.error.invalidFieldCode")).when("kind", function (kind, schema) {
1025
+ return enableFieldCode && !includes(kind, QUESTIONS_WITHOUT_FIELD_CODE) ? fieldCodeValidation(schema, t("neetoForm.questions.common.questionFields.field.fieldCode")) : schema.notRequired();
1026
+ }),
1027
+ optionsAttributes: yup.array().when("_destroy", {
1028
+ is: true,
1029
+ otherwise: function otherwise(schema) {
1030
+ return schema.when("kind", function (kind, schema) {
1031
+ return includes(kind, SELECTABLE_KINDS) ? schema.of(yup.object().shape({
1032
+ label: requiredLabelValidation(yup.string(), t("neetoForm.questions.common.questionFields.field.option"))
1033
+ })) : schema.notRequired();
1034
+ });
1035
+ }
1036
+ }),
1037
+ highestRatingLabel: yup.string().nullable(),
1038
+ averageRatingLabel: yup.string().nullable(),
1039
+ lowestRatingLabel: yup.string().nullable()
1040
+ });
1041
+ };
985
1042
 
986
1043
  var _excluded$6 = ["question", "onClose", "questions", "handleSelect", "buildRequestArgs", "isOpen"];
987
1044
  function ownKeys$b(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; }
@@ -1041,7 +1098,7 @@ var Add = function Add(_ref) {
1041
1098
  }), /*#__PURE__*/jsx(Form$2, {
1042
1099
  formikProps: {
1043
1100
  initialValues: INITIAL_VALUES,
1044
- validationSchema: formValidationSchema,
1101
+ validationSchema: formValidationSchema(props["enableFieldCode"]),
1045
1102
  onSubmit: handleSubmit
1046
1103
  },
1047
1104
  children: /*#__PURE__*/jsxs(Fragment, {
@@ -1111,7 +1168,7 @@ var Edit = function Edit(_ref) {
1111
1168
  }), /*#__PURE__*/jsx(Form$2, {
1112
1169
  formikProps: {
1113
1170
  initialValues: question,
1114
- validationSchema: formValidationSchema,
1171
+ validationSchema: formValidationSchema(props["enableFieldCode"]),
1115
1172
  onSubmit: handleSubmit
1116
1173
  },
1117
1174
  children: /*#__PURE__*/jsxs(Fragment, {
@@ -2004,7 +2061,7 @@ var AddQuestion = function AddQuestion(_ref) {
2004
2061
  }));
2005
2062
  };
2006
2063
 
2007
- var _excluded = ["questionKinds", "onValueChange", "formId", "isDeletable", "isRequiredField", "submitButtonProps", "cancelButtonProps", "isKindAlreadyActive", "getActiveKindDetails", "isDisabledFieldLabel", "disabledAddButtonTooltipProps", "enableFieldCode", "isFormEnabled", "savedTitle", "formTitle", "formDescription", "selectedLanguage", "availableLanguages", "onLanguageChange", "additionalActionOptions", "isReordering", "additionalQuestionKindPattern", "showActionBlock", "buildRequestArgs", "enableDomainBlacklisting", "enableDomainWhitelisting", "helpDocUrls"];
2064
+ var _excluded = ["questionKinds", "onValueChange", "formId", "isDeletable", "isRequiredField", "submitButtonProps", "cancelButtonProps", "isKindAlreadyActive", "getActiveKindDetails", "isDisabledFieldLabel", "disabledAddButtonTooltipProps", "enableFieldCode", "isFormEnabled", "savedTitle", "formTitle", "formDescription", "selectedLanguage", "availableLanguages", "onLanguageChange", "additionalActionOptions", "isReordering", "additionalQuestionKindPattern", "showActionBlock", "buildRequestArgs", "enableDomainBlacklisting", "enableDomainWhitelisting", "helpDocUrls", "questionsHelpProps"];
2008
2065
  function ownKeys$1(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; }
2009
2066
  function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2010
2067
  var Form = function Form(_ref) {
@@ -2035,6 +2092,7 @@ var Form = function Form(_ref) {
2035
2092
  enableDomainBlacklisting = _ref.enableDomainBlacklisting,
2036
2093
  enableDomainWhitelisting = _ref.enableDomainWhitelisting,
2037
2094
  helpDocUrls = _ref.helpDocUrls,
2095
+ questionsHelpProps = _ref.questionsHelpProps,
2038
2096
  formDomProps = _objectWithoutProperties(_ref, _excluded);
2039
2097
  var containerRef = useRef();
2040
2098
  var _useTranslation = useTranslation(),
@@ -2165,7 +2223,7 @@ var Form = function Form(_ref) {
2165
2223
  return setIsDeleteAlertOpen(false);
2166
2224
  }
2167
2225
  }), /*#__PURE__*/jsxs(Form$3, _objectSpread$1(_objectSpread$1({
2168
- className: "flex flex-col h-full neeto-form-nano-form-wrapper"
2226
+ className: "neeto-form-nano-form-wrapper flex h-full flex-col"
2169
2227
  }, formDomProps), {}, {
2170
2228
  noValidate: true,
2171
2229
  children: [formTitle && /*#__PURE__*/jsx(Overview, {
@@ -2176,7 +2234,7 @@ var Form = function Form(_ref) {
2176
2234
  title: formTitle,
2177
2235
  onLanguageChange: handleLanguageChange
2178
2236
  }), /*#__PURE__*/jsx("div", {
2179
- className: "flex-grow w-full min-h-0 pb-6 space-y-6 overflow-y-auto neeto-form-nano-form-wrapper__body md:px-6",
2237
+ className: "neeto-form-nano-form-wrapper__body min-h-0 w-full flex-grow space-y-6 overflow-y-auto pb-6 md:px-6",
2180
2238
  children: hasActiveQuestions ? /*#__PURE__*/jsxs("div", {
2181
2239
  className: "space-y-6",
2182
2240
  ref: containerRef,
@@ -2202,13 +2260,15 @@ var Form = function Form(_ref) {
2202
2260
  onEdit: handleEdit,
2203
2261
  onSelect: handleSelect
2204
2262
  })
2205
- }), /*#__PURE__*/jsx("div", {
2206
- className: "w-full mb-8",
2207
- children: /*#__PURE__*/jsx(AddQuestion, {
2263
+ }), /*#__PURE__*/jsxs("div", {
2264
+ className: "mb-8 flex w-full items-center gap-x-1",
2265
+ children: [/*#__PURE__*/jsx(AddQuestion, {
2208
2266
  disabledAddButtonTooltipProps: disabledAddButtonTooltipProps,
2209
2267
  isDisabled: isEmpty(availableQuestionKinds),
2210
2268
  onAdd: handleAdd
2211
- })
2269
+ }), isPresent(questionsHelpProps) && /*#__PURE__*/jsx("span", {
2270
+ children: /*#__PURE__*/jsx(HelpPopover, _objectSpread$1({}, questionsHelpProps))
2271
+ })]
2212
2272
  })]
2213
2273
  }) : /*#__PURE__*/jsx(AddFirstQuestion, {
2214
2274
  disabledAddButtonTooltipProps: disabledAddButtonTooltipProps,
@@ -2216,7 +2276,7 @@ var Form = function Form(_ref) {
2216
2276
  onAdd: handleAdd
2217
2277
  })
2218
2278
  }), (showActionBlock || dirty) && /*#__PURE__*/jsx("div", {
2219
- className: "sticky bottom-0 flex justify-end flex-shrink-0 px-6 py-4 border-t neeto-ui-border-gray-300 neeto-form-nano-form-wrapper__footer neeto-ui-bg-white",
2279
+ className: "neeto-ui-border-gray-300 neeto-form-nano-form-wrapper__footer neeto-ui-bg-white sticky bottom-0 flex flex-shrink-0 justify-end border-t px-6 py-4",
2220
2280
  children: /*#__PURE__*/jsx(ActionBlock, {
2221
2281
  submitButtonProps: submitButtonProps,
2222
2282
  isSubmitting: isReordering,
@@ -2296,7 +2356,9 @@ var BuildForm = function BuildForm(_ref) {
2296
2356
  _ref$enableDomainWhit = _ref.enableDomainWhitelisting,
2297
2357
  enableDomainWhitelisting = _ref$enableDomainWhit === void 0 ? true : _ref$enableDomainWhit,
2298
2358
  helpDocUrls = _ref.helpDocUrls,
2299
- className = _ref.className;
2359
+ className = _ref.className,
2360
+ _ref$questionsHelpPro = _ref.questionsHelpProps,
2361
+ questionsHelpProps = _ref$questionsHelpPro === void 0 ? {} : _ref$questionsHelpPro;
2300
2362
  var queryClient = useQueryClient();
2301
2363
  var _useReorderQuestions = useReorderQuestions(id, {
2302
2364
  onSuccess: showThumbsUpToastr
@@ -2394,6 +2456,7 @@ var BuildForm = function BuildForm(_ref) {
2394
2456
  kindUniqueOn: kindUniqueOn,
2395
2457
  onLanguageChange: onLanguageChange,
2396
2458
  onValueChange: onValueChange,
2459
+ questionsHelpProps: questionsHelpProps,
2397
2460
  savedTitle: savedTitle,
2398
2461
  selectedLanguage: selectedLanguage,
2399
2462
  showActionBlock: showActionBlock,