@bigbinary/neeto-form-frontend 4.4.19 → 4.4.20

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/.ready CHANGED
@@ -1 +1 @@
1
- Built at 2026-05-08T05:05:46.191Z
1
+ Built at 2026-05-08T15:58:59.942Z
package/dist/BuildForm.js CHANGED
@@ -4,7 +4,7 @@ import { isPresent, truncate, findBy, isNotPresent, slugify, existsBy, findById,
4
4
  import Spinner from '@bigbinary/neetoui/Spinner';
5
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, append, pluck, test, paths, difference, prop, startsWith, split, last, either, F, T } from 'ramda';
6
6
  import { k as useDeleteQuestion, Q as QUESTION_TYPES, b as useForm, l as useCreateQuestion, m as useUpdateQuestion, C as CAPTCHA_TYPES, n as useReorderQuestions, i as QUERY_KEYS } from './constants-Cj0XxE8a.js';
7
- import { j as QUESTION_ACTIONS, k as INDEPENDENT_LABELS_MAP, l as buildDisplayLabel, m as isElementOverflowing, n as Drag, o as SELECTABLE_KINDS, p as isAutoGeneratedQuestion, q as isRichTextQuestion, r as SPOT_QUESTION_FIELD_CODE, N as NON_BASIC_LATIN_CHARACTERS_REGEX, s as RESERVED_FIELD_CODES, t as renameKey, f as LABEL_FIELDS, u as isDefaultLanguage, v as buildAddQuestionButtonProps, w as validateEditorContent, F as FIELD_CODES_REJECT_CHARS_REGEX, M as MIN_WORDS_SWITCH_LABEL_PROPS, x as MIN_WORDS, y as isImmutableField, Q as QUESTIONS_WITHOUT_FIELD_CODE, z as NON_HIDEABLE_FIELDS, B as NON_READ_ONLY_FIELDS, O as OPINION_LABEL_MAX_LENGTH, G as RICH_TEXT_QUESTIONS, e as ADDRESS_FIELD_WIDTHS, A as ADDRESS_FIELD_TYPES, H as generateDefaultOptions, J as MINIMUM_ADDRESS_FIELDS, K as getDeletedRecords, T as randomId, U as getActiveRecords, V as FILE_TYPES_MAP, W as FILE_GROUPS, X as OPINION_SCALE_MIN_VALUE_OPTIONS, Y as OPINION_SCALE_MAX_VALUE_OPTIONS, D as DEFAULT_CHOICE_QUESTION_ATTRIBUTES, Z as MINIMUM_OPTIONS, _ as IMAGE_HEIGHT_SLIDER_DEFAULTS, $ as RATING_OPTIONS, a0 as STAR_RATING_MIN_VALUE_OPTIONS, a1 as STAR_RATING_MAX_VALUE_OPTIONS, a2 as STAR_RATING_ICONS_MAP, a3 as buildDisabledAddButtonHelpPopoverProps, a4 as buildReorderPayload, a5 as QUESTIONS_INITIAL_VALUE, a6 as isMandatoryField, a7 as QUESTION_KINDS, a as QUESTION_KIND, a8 as getActiveQuestionKindDetails, a9 as DEFAULT_AVAILABLE_LANGUAGES, aa as DEFAULT_ADVANCED_FEATURES } from './yup-CBPWSDXh.js';
7
+ import { j as QUESTION_ACTIONS, k as INDEPENDENT_LABELS_MAP, l as buildDisplayLabel, m as isElementOverflowing, n as SELECTABLE_KINDS, o as isAutoGeneratedQuestion, p as isRichTextQuestion, q as SPOT_QUESTION_FIELD_CODE, N as NON_BASIC_LATIN_CHARACTERS_REGEX, r as RESERVED_FIELD_CODES, s as renameKey, f as LABEL_FIELDS, t as isDefaultLanguage, u as buildAddQuestionButtonProps, v as validateEditorContent, F as FIELD_CODES_REJECT_CHARS_REGEX, M as MIN_WORDS_SWITCH_LABEL_PROPS, w as MIN_WORDS, x as isImmutableField, Q as QUESTIONS_WITHOUT_FIELD_CODE, y as NON_HIDEABLE_FIELDS, z as NON_READ_ONLY_FIELDS, O as OPINION_LABEL_MAX_LENGTH, B as RICH_TEXT_QUESTIONS, e as ADDRESS_FIELD_WIDTHS, A as ADDRESS_FIELD_TYPES, G as generateDefaultOptions, H as MINIMUM_ADDRESS_FIELDS, J as getDeletedRecords, K as randomId, T as getActiveRecords, U as FILE_TYPES_MAP, V as FILE_GROUPS, W as OPINION_SCALE_MIN_VALUE_OPTIONS, X as OPINION_SCALE_MAX_VALUE_OPTIONS, D as DEFAULT_CHOICE_QUESTION_ATTRIBUTES, Y as MINIMUM_OPTIONS, Z as IMAGE_HEIGHT_SLIDER_DEFAULTS, _ as RATING_OPTIONS, $ as STAR_RATING_MIN_VALUE_OPTIONS, a0 as STAR_RATING_MAX_VALUE_OPTIONS, a1 as STAR_RATING_ICONS_MAP, a2 as buildDisabledAddButtonHelpPopoverProps, a3 as buildReorderPayload, a4 as QUESTIONS_INITIAL_VALUE, a5 as isMandatoryField, a6 as QUESTION_KINDS, a as QUESTION_KIND, a7 as getActiveQuestionKindDetails, a8 as DEFAULT_AVAILABLE_LANGUAGES, a9 as DEFAULT_ADVANCED_FEATURES } from './yup-bkiiTZT4.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';
@@ -21,6 +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 Equals from '@bigbinary/neeto-icons/Equals';
24
25
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
25
26
  import { i as isFunction, f as fieldWithFallback, c as isNameQuestion } from './index-DhtQJpD_.js';
26
27
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
@@ -314,7 +315,8 @@ var Card = function Card(_ref) {
314
315
  allQuestionKinds: allQuestionKinds,
315
316
  item: question
316
317
  }),
317
- isSingular = _getActiveKindDetails.isSingular;
318
+ isSingular = _getActiveKindDetails.isSingular,
319
+ KindIcon = _getActiveKindDetails.icon;
318
320
  var questionLabel = buildDisplayLabel(question);
319
321
  useEffect(function () {
320
322
  var element = questionLabelRef.current;
@@ -322,62 +324,60 @@ var Card = function Card(_ref) {
322
324
  setIsTooltipEnabled(isElementOverflowing(element));
323
325
  }, [questionLabel]);
324
326
  return /*#__PURE__*/jsxs("div", {
325
- className: "flex items-center gap-0.5",
326
- children: [canManageQuestions && /*#__PURE__*/jsx(Drag, {
327
- className: "neeto-ui-text-gray-400 hover:neeto-ui-text-gray-500 transition-all ease-in-out duration-300 shrink-0 cursor-grab -ml-1",
328
- size: 16
329
- }), /*#__PURE__*/jsxs("div", {
330
- "data-testid": "neeto-form-engine-".concat(slugify(questionLabel)),
331
- className: classnames("neeto-ui-rounded neeto-ui-border-gray-300 neeto-ui-bg-white neeto-form-nano-form__card flex h-10 grow items-center justify-between gap-1 border p-2 overflow-hidden", {
332
- "neeto-ui-border-primary-500 neeto-form-nano-form__card--active": isActive
333
- }),
334
- onClick: function onClick() {
335
- return onSelect(question);
336
- },
337
- children: [/*#__PURE__*/jsx("div", {
338
- className: "flex min-w-0 grow items-center gap-1",
339
- children: /*#__PURE__*/jsx(Tooltip, {
340
- content: questionLabel,
341
- disabled: !isTooltipEnabled,
342
- position: "top",
343
- children: /*#__PURE__*/jsx(Typography, {
344
- className: "line-clamp-2 min-w-0 grow truncate break-words",
345
- "data-testid": "".concat(slugify(questionLabel), "-question-card-label"),
346
- lineHeight: "snug",
347
- ref: questionLabelRef,
348
- style: "body2",
349
- weight: "medium",
350
- children: questionLabel
351
- })
327
+ "data-testid": "neeto-form-engine-".concat(slugify(questionLabel)),
328
+ className: classnames("neeto-ui-rounded neeto-ui-border-gray-300 neeto-ui-bg-white neeto-form-nano-form__card flex h-10 w-full items-center justify-between gap-2 overflow-hidden border p-2", {
329
+ "neeto-ui-border-primary-500 neeto-form-nano-form__card--active": isActive
330
+ }),
331
+ onClick: function onClick() {
332
+ return onSelect(question);
333
+ },
334
+ children: [/*#__PURE__*/jsxs("div", {
335
+ className: "flex min-w-0 grow items-center gap-2",
336
+ children: [KindIcon && /*#__PURE__*/jsx(KindIcon, {
337
+ className: "neeto-ui-text-gray-600 shrink-0",
338
+ "data-testid": "question-card-kind-icon",
339
+ size: 16
340
+ }), /*#__PURE__*/jsx(Tooltip, {
341
+ content: questionLabel,
342
+ disabled: !isTooltipEnabled,
343
+ position: "top",
344
+ children: /*#__PURE__*/jsx(Typography, {
345
+ className: "min-w-0 grow truncate",
346
+ "data-testid": "".concat(slugify(questionLabel), "-question-card-label"),
347
+ lineHeight: "snug",
348
+ ref: questionLabelRef,
349
+ style: "body2",
350
+ weight: "medium",
351
+ children: questionLabel
352
352
  })
353
- }), canManageQuestions && /*#__PURE__*/jsx(MoreDropdown, {
354
- dropdownButtonProps: {
355
- className: "shrink-0"
356
- },
357
- dropdownProps: {
358
- strategy: "fixed"
359
- },
360
- menuItems: [{
361
- "data-testid": "edit-question",
362
- key: "edit",
363
- label: t("neetoForm.common.edit"),
364
- onClick: onEdit
365
- }, {
366
- "data-testid": "clone-question",
367
- key: "clone",
368
- label: t("neetoForm.common.clone"),
369
- isVisible: !isSingular && isFunction(onClone),
370
- onClick: onClone
371
- }].concat(_toConsumableArray(extraMenuItems), [{
372
- "data-testid": "delete-question",
373
- key: "delete",
374
- label: t("neetoForm.common.delete"),
375
- isVisible: isFunction(onDelete),
376
- onClick: function onClick() {
377
- return onDelete(question);
378
- }
379
- }])
380
353
  })]
354
+ }), canManageQuestions && /*#__PURE__*/jsx(MoreDropdown, {
355
+ dropdownButtonProps: {
356
+ className: "shrink-0"
357
+ },
358
+ dropdownProps: {
359
+ strategy: "fixed"
360
+ },
361
+ menuItems: [{
362
+ "data-testid": "edit-question",
363
+ key: "edit",
364
+ label: t("neetoForm.common.edit"),
365
+ onClick: onEdit
366
+ }, {
367
+ "data-testid": "clone-question",
368
+ key: "clone",
369
+ label: t("neetoForm.common.clone"),
370
+ isVisible: !isSingular && isFunction(onClone),
371
+ onClick: onClone
372
+ }].concat(_toConsumableArray(extraMenuItems), [{
373
+ "data-testid": "delete-question",
374
+ key: "delete",
375
+ label: t("neetoForm.common.delete"),
376
+ isVisible: isFunction(onDelete),
377
+ onClick: function onClick() {
378
+ return onDelete(question);
379
+ }
380
+ }])
381
381
  })]
382
382
  });
383
383
  };
@@ -418,20 +418,30 @@ var Questions = function Questions(_ref) {
418
418
  var draggableProps = _ref3.draggableProps,
419
419
  dragHandleProps = _ref3.dragHandleProps,
420
420
  innerRef = _ref3.innerRef;
421
- return /*#__PURE__*/jsx("div", _objectSpread$j(_objectSpread$j(_objectSpread$j({}, draggableProps), dragHandleProps), {}, {
421
+ return /*#__PURE__*/jsxs("div", _objectSpread$j(_objectSpread$j({}, draggableProps), {}, {
422
+ className: "flex items-center gap-1",
422
423
  ref: innerRef,
423
- children: /*#__PURE__*/jsx(Card, {
424
- allQuestionKinds: allQuestionKinds,
425
- canManageQuestions: canManageQuestions,
426
- getActiveKindDetails: getActiveKindDetails,
427
- onClone: onClone,
428
- onEdit: onEdit,
429
- onSelect: onSelect,
430
- question: question,
431
- extraMenuItems: (_getQuestionMenuExtra = getQuestionMenuExtras === null || getQuestionMenuExtras === void 0 ? void 0 : getQuestionMenuExtras(question)) !== null && _getQuestionMenuExtra !== void 0 ? _getQuestionMenuExtra : [],
432
- isActive: equals(selectedQuestion, question),
433
- onDelete: isDeletable(question) && onDelete
434
- })
424
+ children: [canManageQuestions && /*#__PURE__*/jsx("span", _objectSpread$j(_objectSpread$j({}, dragHandleProps), {}, {
425
+ className: "neeto-ui-text-gray-400 hover:neeto-ui-text-gray-500 shrink-0 cursor-grab transition-all duration-300 ease-in-out",
426
+ "data-testid": "question-card-drag-handle",
427
+ children: /*#__PURE__*/jsx(Equals, {
428
+ size: 16
429
+ })
430
+ })), /*#__PURE__*/jsx("div", {
431
+ className: "min-w-0 grow",
432
+ children: /*#__PURE__*/jsx(Card, {
433
+ allQuestionKinds: allQuestionKinds,
434
+ canManageQuestions: canManageQuestions,
435
+ getActiveKindDetails: getActiveKindDetails,
436
+ onClone: onClone,
437
+ onEdit: onEdit,
438
+ onSelect: onSelect,
439
+ question: question,
440
+ extraMenuItems: (_getQuestionMenuExtra = getQuestionMenuExtras === null || getQuestionMenuExtras === void 0 ? void 0 : getQuestionMenuExtras(question)) !== null && _getQuestionMenuExtra !== void 0 ? _getQuestionMenuExtra : [],
441
+ isActive: equals(selectedQuestion, question),
442
+ onDelete: isDeletable(question) && onDelete
443
+ })
444
+ })]
435
445
  }));
436
446
  });
437
447
  }), placeholder]