@bigbinary/neeto-form-frontend 4.4.71 → 4.5.0-beta1
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/app/javascript/src/translations/en.json +4 -1
- package/dist/.ready +1 -1
- package/dist/BuildForm.js +28 -4
- package/dist/BuildForm.js.map +1 -1
- package/dist/ExternalForm.js +22 -17
- package/dist/ExternalForm.js.map +1 -1
- package/dist/Submission.js +30 -10
- package/dist/Submission.js.map +1 -1
- package/dist/UrlBuilder.js +2 -2
- package/dist/cjs/BuildForm.js +27 -3
- package/dist/cjs/BuildForm.js.map +1 -1
- package/dist/cjs/ExternalForm.js +21 -16
- package/dist/cjs/ExternalForm.js.map +1 -1
- package/dist/cjs/Submission.js +29 -9
- package/dist/cjs/Submission.js.map +1 -1
- package/dist/cjs/UrlBuilder.js +2 -2
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/{utils-BHn1TXSC.js → utils-CMHI5Y0n.js} +56 -26
- package/dist/cjs/utils-CMHI5Y0n.js.map +1 -0
- package/dist/cjs/v2/BuildForm.js +27 -3
- package/dist/cjs/v2/BuildForm.js.map +1 -1
- package/dist/cjs/v2/ExternalForm.js +19 -13
- package/dist/cjs/v2/ExternalForm.js.map +1 -1
- package/dist/cjs/v2/Submission.js +30 -10
- package/dist/cjs/v2/Submission.js.map +1 -1
- package/dist/cjs/v2/UrlBuilder.js +3 -2
- package/dist/cjs/v2/UrlBuilder.js.map +1 -1
- package/dist/cjs/v2/index.js +2 -2
- package/dist/cjs/v2/{utils-7ObrGr4O.js → utils-EWbfo6xy.js} +29 -5
- package/dist/cjs/v2/utils-EWbfo6xy.js.map +1 -0
- package/dist/cjs/v2/{yup-D2FUYjqU.js → yup-IIVrobcB.js} +8 -2
- package/dist/cjs/v2/yup-IIVrobcB.js.map +1 -0
- package/dist/cjs/{yup-DD46Fc7X.js → yup--rmEVYDi.js} +8 -2
- package/dist/cjs/yup--rmEVYDi.js.map +1 -0
- package/dist/index.js +4 -4
- package/dist/{utils-DQC5qi6q.js → utils-BQ-x2S1l.js} +56 -26
- package/dist/utils-BQ-x2S1l.js.map +1 -0
- package/dist/v2/BuildForm.js +29 -5
- package/dist/v2/BuildForm.js.map +1 -1
- package/dist/v2/ExternalForm.js +20 -14
- package/dist/v2/ExternalForm.js.map +1 -1
- package/dist/v2/Submission.js +31 -11
- package/dist/v2/Submission.js.map +1 -1
- package/dist/v2/UrlBuilder.js +3 -2
- package/dist/v2/UrlBuilder.js.map +1 -1
- package/dist/v2/index.js +2 -2
- package/dist/v2/{utils-Do7H0nQ3.js → utils-BgLYgJEU.js} +29 -5
- package/dist/v2/utils-BgLYgJEU.js.map +1 -0
- package/dist/v2/{yup-BRPSFuNj.js → yup-CnlHwBP1.js} +8 -3
- package/dist/v2/yup-CnlHwBP1.js.map +1 -0
- package/dist/{yup-Ccwwlg6e.js → yup-BWdsrAJJ.js} +8 -3
- package/dist/yup-BWdsrAJJ.js.map +1 -0
- package/package.json +9 -9
- package/types.d.ts +5 -0
- package/dist/cjs/utils-BHn1TXSC.js.map +0 -1
- package/dist/cjs/v2/utils-7ObrGr4O.js.map +0 -1
- package/dist/cjs/v2/yup-D2FUYjqU.js.map +0 -1
- package/dist/cjs/yup-DD46Fc7X.js.map +0 -1
- package/dist/utils-DQC5qi6q.js.map +0 -1
- package/dist/v2/utils-Do7H0nQ3.js.map +0 -1
- package/dist/v2/yup-BRPSFuNj.js.map +0 -1
- package/dist/yup-Ccwwlg6e.js.map +0 -1
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"hideQuestion": "Hide question",
|
|
28
28
|
"readOnly": "Read-only",
|
|
29
29
|
"sendSmsUpdates": "Send SMS updates",
|
|
30
|
+
"sendWhatsappUpdates": "Send WhatsApp updates",
|
|
30
31
|
"responseVisibleOnlyToHost": "Response visible only to host",
|
|
31
32
|
"invalidURL": "Invalid URL",
|
|
32
33
|
"generateLink": "Generate link",
|
|
@@ -105,7 +106,8 @@
|
|
|
105
106
|
"callouts": {
|
|
106
107
|
"submitError": "Couldn't submit the form",
|
|
107
108
|
"hiddenQuestion": "This is a hidden field. People filling out this form will not see this field.",
|
|
108
|
-
"responseVisibleOnlyToHost": "This field is visible to everyone. But its response will only be visible to the host."
|
|
109
|
+
"responseVisibleOnlyToHost": "This field is visible to everyone. But its response will only be visible to the host.",
|
|
110
|
+
"whatsappUpdatesSingleField": "You can send WhatsApp updates to only one phone field in this form. Turning it on here turns it off for the other phone fields."
|
|
109
111
|
},
|
|
110
112
|
"successPage": {
|
|
111
113
|
"title1": "Thank You.",
|
|
@@ -161,6 +163,7 @@
|
|
|
161
163
|
"hideQuestionHelpDescription": "When enabled, this question will not be visible in the created form. It can be used to track \"reference ids\" and UTM parameters.",
|
|
162
164
|
"sendSmsUpdatesHelpDescription": "When enabled, SMS notifications will be sent to this number.",
|
|
163
165
|
"sendSmsUpdatesIntegrationNote": "An SMS integration must be connected to send SMS notifications.",
|
|
166
|
+
"sendWhatsappUpdatesHelpDescription": "When enabled, WhatsApp updates will be sent to this number.",
|
|
164
167
|
"responseVisibleOnlyToHostHelpDescription": "When enabled, the response to this question will only be visible to the host",
|
|
165
168
|
"readOnlyHelpDescription": "When enabled, the client will only be able to see the answer of this question, but will not be able to change the answer of this question. Since you are marking this question as \"read-only\". You should pre-fill the question with an answer.",
|
|
166
169
|
"fitImagesHelpDescription": "When enabled, images zoom to fill the entire space (some edges may get cut off). When disabled, the complete image is shown (may have empty space around it).",
|
package/dist/.ready
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Built at 2026-10-
|
|
1
|
+
Built at 2026-10-23T15:10:14.768Z
|
package/dist/BuildForm.js
CHANGED
|
@@ -2,9 +2,9 @@ import { useQueryClient } from '@tanstack/react-query';
|
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { isPresent, truncate, findBy, isNotPresent, slugify, existsBy, noop, findById, findIndexById, hyphenate, nullSafe, modifyBy, removeBy } from '@bigbinary/neeto-cist';
|
|
4
4
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
5
|
-
import { equals, path, when, assoc, includes, isEmpty, reject, keys, pick, omit, evolve, map, mergeLeft, isNil, pipe, filter, isNotNil, values, uniq, join, pathSatisfies, assocPath, dissoc, pluck, append, test, paths, difference,
|
|
5
|
+
import { equals, path, when, assoc, includes, isEmpty, reject, keys, pick, omit, evolve, map, mergeLeft, isNil, prop, pipe, filter, isNotNil, values, uniq, join, pathSatisfies, assocPath, dissoc, pluck, append, test, paths, difference, startsWith, split, last, union, either, F, T } from 'ramda';
|
|
6
6
|
import { m as useDeleteQuestion, Q as QUESTION_TYPES, b as useForm, n as useCreateQuestion, o as useUpdateQuestion, C as CAPTCHA_TYPES, D as DATE_INPUT_MODES, p as useReorderQuestions, i as QUERY_KEYS } from './constants-CA-b_gMT.js';
|
|
7
|
-
import { m as QUESTION_ACTIONS, n as INDEPENDENT_LABELS_MAP, o as buildDisplayLabel, p as isElementOverflowing, q as SELECTABLE_KINDS, r as isAutoGeneratedQuestion, s as isRichTextQuestion, t as isLayoutQuestion, u as SPOT_QUESTION_FIELD_CODE, N as NON_BASIC_LATIN_CHARACTERS_REGEX, v as RESERVED_FIELD_CODES, w as renameKey, f as LABEL_FIELDS, x as isDefaultLanguage, y as buildAddQuestionButtonProps, z as validateEditorContent, H as HEADING_IMAGE_UPLOAD_CONFIG, B as HEADING_IMAGE_WIDTH, F as FIELD_CODES_REJECT_CHARS_REGEX, M as MIN_WORDS_SWITCH_LABEL_PROPS, G as MIN_WORDS, J as isImmutableField, a as QUESTIONS_WITHOUT_FIELD_CODE, K as NON_HIDEABLE_FIELDS, O as NON_READ_ONLY_FIELDS, T as OPINION_LABEL_MAX_LENGTH, U as RICH_TEXT_QUESTIONS, e as ADDRESS_FIELD_WIDTHS, A as ADDRESS_FIELD_TYPES, V as generateDefaultOptions,
|
|
7
|
+
import { m as QUESTION_ACTIONS, n as INDEPENDENT_LABELS_MAP, o as buildDisplayLabel, p as isElementOverflowing, q as SELECTABLE_KINDS, r as isAutoGeneratedQuestion, s as isRichTextQuestion, t as isLayoutQuestion, u as SPOT_QUESTION_FIELD_CODE, N as NON_BASIC_LATIN_CHARACTERS_REGEX, v as RESERVED_FIELD_CODES, w as renameKey, f as LABEL_FIELDS, x as isDefaultLanguage, y as buildAddQuestionButtonProps, z as validateEditorContent, H as HEADING_IMAGE_UPLOAD_CONFIG, B as HEADING_IMAGE_WIDTH, F as FIELD_CODES_REJECT_CHARS_REGEX, M as MIN_WORDS_SWITCH_LABEL_PROPS, G as MIN_WORDS, J as isImmutableField, a as QUESTIONS_WITHOUT_FIELD_CODE, K as NON_HIDEABLE_FIELDS, O as NON_READ_ONLY_FIELDS, T as OPINION_LABEL_MAX_LENGTH, U as RICH_TEXT_QUESTIONS, e as ADDRESS_FIELD_WIDTHS, A as ADDRESS_FIELD_TYPES, V as generateDefaultOptions, X as MINIMUM_ADDRESS_FIELDS, Z as getDeletedRecords, _ as randomId, $ as getActiveRecords, a0 as FILE_TYPES_MAP, a1 as FILE_GROUPS, a2 as OPINION_SCALE_MIN_VALUE_OPTIONS, a3 as OPINION_SCALE_MAX_VALUE_OPTIONS, h as DEFAULT_CHOICE_QUESTION_ATTRIBUTES, a4 as MINIMUM_OPTIONS, a5 as IMAGE_HEIGHT_SLIDER_DEFAULTS, a6 as RATING_OPTIONS, a7 as STAR_RATING_MIN_VALUE_OPTIONS, a8 as STAR_RATING_MAX_VALUE_OPTIONS, a9 as STAR_RATING_ICONS_MAP, aa as YES_NO_ICONS_MAP, ab as buildDisabledAddButtonHelpPopoverProps, ac as buildReorderPayload, ad as QUESTIONS_INITIAL_VALUE, ae as isMandatoryField, af as QUESTION_KINDS, Q as QUESTION_KIND, ag as getActiveQuestionKindDetails, ah as DEFAULT_AVAILABLE_LANGUAGES, ai as DEFAULT_ADVANCED_FEATURES } from './yup-BWdsrAJJ.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';
|
|
@@ -33,7 +33,9 @@ import Pane from '@bigbinary/neetoui/Pane';
|
|
|
33
33
|
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
34
34
|
import Form$2 from '@bigbinary/neetoui/formik/Form';
|
|
35
35
|
import { useFormikContext, useField } from 'formik';
|
|
36
|
+
import Info from '@bigbinary/neeto-icons/Info';
|
|
36
37
|
import Accordion from '@bigbinary/neetoui/Accordion';
|
|
38
|
+
import Callout from '@bigbinary/neetoui/Callout';
|
|
37
39
|
import Select from '@bigbinary/neetoui/formik/Select';
|
|
38
40
|
import Switch from '@bigbinary/neetoui/formik/Switch';
|
|
39
41
|
import Textarea$1 from '@bigbinary/neetoui/formik/Textarea';
|
|
@@ -1264,6 +1266,7 @@ var Form$1 = function Form(_ref) {
|
|
|
1264
1266
|
submitCount = _useFormikContext.submitCount;
|
|
1265
1267
|
var hideQuestionHelpDocUrl = useHelpDoc("hideQuestion");
|
|
1266
1268
|
var sendSmsUpdatesHelpDocUrl = useHelpDoc("smsUpdates");
|
|
1269
|
+
var sendWhatsappUpdatesHelpDocUrl = useHelpDoc("whatsappUpdates");
|
|
1267
1270
|
var readOnlyHelpDocUrl = useHelpDoc("readOnly");
|
|
1268
1271
|
var responseVisibleOnlyToHostHelpDocUrl = useHelpDoc("responseVisibleOnlyToHost");
|
|
1269
1272
|
var _useBuildFormStore = useBuildFormStore(function (store) {
|
|
@@ -1285,7 +1288,9 @@ var Form$1 = function Form(_ref) {
|
|
|
1285
1288
|
enforceMinWordsInMultiLineTexts = advancedFeatures.enforceMinWordsInMultiLineTexts,
|
|
1286
1289
|
showSmsUpdatesToggle = advancedFeatures.smsUpdates,
|
|
1287
1290
|
isSmsUpdatesDisabled = advancedFeatures.smsUpdatesDisabled,
|
|
1288
|
-
isSmsUpdatesEnabledByDefault = advancedFeatures.smsUpdatesEnabledByDefault
|
|
1291
|
+
isSmsUpdatesEnabledByDefault = advancedFeatures.smsUpdatesEnabledByDefault,
|
|
1292
|
+
showWhatsappUpdatesToggle = advancedFeatures.whatsappUpdates,
|
|
1293
|
+
isWhatsappUpdatesEnabledByDefault = advancedFeatures.whatsappUpdatesEnabledByDefault;
|
|
1289
1294
|
var kind = values.kind;
|
|
1290
1295
|
var questionKinds = isEdit ? allQuestionKinds : availableQuestionKinds;
|
|
1291
1296
|
var questionKindUniquenessPattern = mergeLeft(isEdit && kindUniqueOn ? kindUniqueOn(values) : {}, {
|
|
@@ -1316,9 +1321,10 @@ var Form$1 = function Form(_ref) {
|
|
|
1316
1321
|
var canConfigureDecimals = isUsingDefaultQuestionKinds && isNumber;
|
|
1317
1322
|
var isTextarea = kind === QUESTION_TYPES.TEXTAREA;
|
|
1318
1323
|
var shouldShowSendSmsUpdatesSwitch = kind === QUESTION_TYPES.PHONE && showSmsUpdatesToggle;
|
|
1324
|
+
var shouldShowSendWhatsappUpdatesSwitch = kind === QUESTION_TYPES.PHONE && showWhatsappUpdatesToggle;
|
|
1319
1325
|
var isBasicSettingsVisible = !isRequired && (!isImmutable || shouldShowHideSwitch);
|
|
1320
1326
|
var shouldShowRequiredSwitch = isBasicSettingsVisible && !isImmutable && !includes(kind, [QUESTION_TYPES.PARAGRAPH, QUESTION_TYPES.ADDRESS, QUESTION_TYPES.SPOT]);
|
|
1321
|
-
var isSettingsBlockVisible = kind !== QUESTION_TYPES.SPOT && !isLayoutQuestion(kind) && (isBasicSettingsVisible || canMarkResponsesAsReadOnly || isTextarea || canConfigureDecimals || shouldShowSendSmsUpdatesSwitch);
|
|
1327
|
+
var isSettingsBlockVisible = kind !== QUESTION_TYPES.SPOT && !isLayoutQuestion(kind) && (isBasicSettingsVisible || canMarkResponsesAsReadOnly || isTextarea || canConfigureDecimals || shouldShowSendSmsUpdatesSwitch || shouldShowSendWhatsappUpdatesSwitch);
|
|
1322
1328
|
var handleKindChange = function handleKindChange(option) {
|
|
1323
1329
|
var data = buildQuestionData(option);
|
|
1324
1330
|
updateFormState(data);
|
|
@@ -1344,6 +1350,9 @@ var Form$1 = function Form(_ref) {
|
|
|
1344
1350
|
if (kind === QUESTION_TYPES.PHONE && showSmsUpdatesToggle) {
|
|
1345
1351
|
data.sendSmsUpdates = Boolean(isSmsUpdatesEnabledByDefault);
|
|
1346
1352
|
}
|
|
1353
|
+
if (kind === QUESTION_TYPES.PHONE && showWhatsappUpdatesToggle) {
|
|
1354
|
+
data.sendWhatsappUpdates = Boolean(isWhatsappUpdatesEnabledByDefault) && !questions.some(prop("sendWhatsappUpdates"));
|
|
1355
|
+
}
|
|
1347
1356
|
return data;
|
|
1348
1357
|
};
|
|
1349
1358
|
var updateFormState = function updateFormState(data) {
|
|
@@ -1416,6 +1425,18 @@ var Form$1 = function Form(_ref) {
|
|
|
1416
1425
|
label: t("neetoForm.common.sendSmsUpdates"),
|
|
1417
1426
|
name: "sendSmsUpdates",
|
|
1418
1427
|
labelProps: sendSmsUpdatesSwitchLabelProps(sendSmsUpdatesHelpDocUrl)
|
|
1428
|
+
}), shouldShowSendWhatsappUpdatesSwitch && /*#__PURE__*/jsx(Switch, {
|
|
1429
|
+
label: t("neetoForm.common.sendWhatsappUpdates"),
|
|
1430
|
+
name: "sendWhatsappUpdates",
|
|
1431
|
+
labelProps: sendWhatsappUpdatesSwitchLabelProps(sendWhatsappUpdatesHelpDocUrl)
|
|
1432
|
+
}), shouldShowSendWhatsappUpdatesSwitch && /*#__PURE__*/jsx(Callout, {
|
|
1433
|
+
"data-testid": "whatsapp-updates-single-field-callout",
|
|
1434
|
+
icon: Info,
|
|
1435
|
+
style: "warning",
|
|
1436
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
1437
|
+
style: "body2",
|
|
1438
|
+
children: t("neetoForm.callouts.whatsappUpdatesSingleField")
|
|
1439
|
+
})
|
|
1419
1440
|
}), canConfigureDecimals && /*#__PURE__*/jsx(Switch, {
|
|
1420
1441
|
label: t("neetoForm.questions.common.allowDecimals"),
|
|
1421
1442
|
name: "allowDecimals"
|
|
@@ -3130,6 +3151,9 @@ var hideSwitchLabelProps = function hideSwitchLabelProps(helpUrl) {
|
|
|
3130
3151
|
}
|
|
3131
3152
|
} : undefined;
|
|
3132
3153
|
};
|
|
3154
|
+
var sendWhatsappUpdatesSwitchLabelProps = function sendWhatsappUpdatesSwitchLabelProps(helpUrl) {
|
|
3155
|
+
return buildHelpPopoverLabelProps(t("neetoForm.questions.common.questionFields.field.sendWhatsappUpdatesHelpDescription"), helpUrl);
|
|
3156
|
+
};
|
|
3133
3157
|
var sendSmsUpdatesSwitchLabelProps = function sendSmsUpdatesSwitchLabelProps(helpUrl) {
|
|
3134
3158
|
return helpUrl ? {
|
|
3135
3159
|
helpIconProps: {
|