@123usmanhaider321/ui 0.1.8 → 1.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.
- package/README.md +416 -31
- package/dist/images/icon/1LINK.svg +50 -0
- package/dist/images/icon/CreditCard.svg +83 -0
- package/dist/images/icon/Easypaisa.png +0 -0
- package/dist/images/icon/MobileWallet.png +0 -0
- package/dist/images/icon/Raast-Logo.png +0 -0
- package/dist/images/icon/VISA.png +0 -0
- package/dist/images/icon/add-circle-1.svg +5 -0
- package/dist/images/icon/check-circle-broken.svg +3 -0
- package/dist/images/icon/close-circle.svg +5 -0
- package/dist/images/icon/jazzcash.png +0 -0
- package/dist/images/icon/loading_icon.json +3347 -0
- package/dist/images/icon/mastercard-logo.webp +0 -0
- package/dist/images/icon/paymo.jpeg +0 -0
- package/dist/images/icon/preview-svgrepo-com.svg +36 -0
- package/dist/images/icon/trash.svg +7 -0
- package/dist/images/icon/unionpay-logo.svg +9 -0
- package/dist/index-87FQZHOs.js +11119 -0
- package/dist/index-87FQZHOs.js.map +1 -0
- package/dist/index-Tl9g213f.js +60475 -0
- package/dist/index-Tl9g213f.js.map +1 -0
- package/dist/index.d.ts +1 -10
- package/dist/index.es-CpgTaa1Y.js +16734 -0
- package/dist/index.es-CpgTaa1Y.js.map +1 -0
- package/dist/index.js +40 -12
- package/dist/index.js.map +1 -1
- package/dist/loading_icon-n5H5dQBl.js +3375 -0
- package/dist/loading_icon-n5H5dQBl.js.map +1 -0
- package/dist/src/components/Alert/ErrorAlert.d.ts +6 -0
- package/dist/src/components/Alert/SuccessAlert.d.ts +6 -0
- package/dist/{components → src/components}/FormBuilder/DiscountInput.d.ts +3 -6
- package/dist/{components → src/components}/FormBuilder/FormBuilder.d.ts +2 -11
- package/dist/{components → src/components}/FormBuilder/QuestionCard.d.ts +0 -5
- package/dist/{components → src/components}/FormBuilder/QuestionEditor.d.ts +0 -5
- package/dist/{components → src/components}/FormBuilder/SortableQuestionList.d.ts +0 -5
- package/dist/src/components/FormBuilder/questionIcons.d.ts +5 -0
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/AddEventLayout.d.ts +2 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/AddEventStepper.d.ts +2 -2
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/common/ConfirmationModal.d.ts +1 -1
- package/dist/src/components/NewAddEvent/components/EventSubmissionConfirmationModal.d.ts +14 -0
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/StepTwo/TicketTierSection.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/TicketTierForm.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/hooks/useStepperForm.d.ts +22 -22
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/hooks/useTicketTierForm.d.ts +63 -15
- package/dist/src/components/NewAddEvent/schemas/step1.d.ts +211 -0
- package/dist/src/components/NewAddEvent/schemas/step2.d.ts +411 -0
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/schemas/utils.d.ts +8 -2
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/IndividualFormStep.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/SocialProfilesStep.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/TeamFormStep.d.ts +1 -1
- package/dist/src/components/Spinner/spinner.d.ts +4 -0
- package/dist/src/components/TicketlyUIProvider.d.ts +35 -0
- package/dist/src/components/common/Loader/index.d.ts +8 -0
- package/dist/src/components/common/Modals/ConfirmationModal.d.ts +7 -0
- package/dist/{components/FormInput → src/components/ui}/FormInput.d.ts +1 -1
- package/dist/src/components/ui/Loader.d.ts +4 -0
- package/dist/{components/Button/Button.d.ts → src/components/ui/button.d.ts} +1 -1
- package/dist/src/index.d.ts +10 -0
- package/dist/{lib → src/lib}/actions.d.ts +0 -126
- package/dist/src/lib/dom-utils.d.ts +2 -0
- package/dist/src/lib/storage-utils.d.ts +5 -0
- package/dist/src/lib/types.d.ts +258 -0
- package/dist/src/redux/baseQuery.d.ts +16 -0
- package/dist/{services → src/redux/features}/eventApi.d.ts +1053 -1745
- package/dist/src/redux/features/globalSlice.d.ts +17 -0
- package/dist/{services → src/redux/features/single-event}/single-event-api.d.ts +856 -1190
- package/dist/src/redux/types.d.ts +2 -0
- package/dist/src/services/library-services.d.ts +15 -0
- package/dist/src/services/remote-config.d.ts +27 -0
- package/dist/{services → src/services}/utils.d.ts +1 -1
- package/dist/src/theme/colors.d.ts +127 -0
- package/dist/src/theme/typography.d.ts +13 -0
- package/dist/src/types/api.d.ts +18 -0
- package/dist/style.css +2984 -0
- package/dist/styles.css +3758 -4012
- package/package.json +78 -68
- package/dist/_virtual/_commonjsHelpers.js +0 -9
- package/dist/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/_virtual/customParseFormat.js +0 -5
- package/dist/_virtual/customParseFormat.js.map +0 -1
- package/dist/_virtual/dayjs.min.js +0 -5
- package/dist/_virtual/dayjs.min.js.map +0 -1
- package/dist/_virtual/duration.js +0 -5
- package/dist/_virtual/duration.js.map +0 -1
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index.js.map +0 -1
- package/dist/_virtual/isBetween.js +0 -5
- package/dist/_virtual/isBetween.js.map +0 -1
- package/dist/_virtual/relativeTime.js +0 -5
- package/dist/_virtual/relativeTime.js.map +0 -1
- package/dist/_virtual/use-sync-external-store-shim.development.js +0 -5
- package/dist/_virtual/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/_virtual/use-sync-external-store-shim.production.js +0 -5
- package/dist/_virtual/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/_virtual/with-selector.development.js +0 -5
- package/dist/_virtual/with-selector.development.js.map +0 -1
- package/dist/_virtual/with-selector.js +0 -5
- package/dist/_virtual/with-selector.js.map +0 -1
- package/dist/_virtual/with-selector.production.js +0 -5
- package/dist/_virtual/with-selector.production.js.map +0 -1
- package/dist/components/Alert/Alert.js +0 -51
- package/dist/components/Alert/Alert.js.map +0 -1
- package/dist/components/Button/Button.js +0 -52
- package/dist/components/Button/Button.js.map +0 -1
- package/dist/components/Button/Button.test.d.ts +0 -1
- package/dist/components/Button/index.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.js +0 -50
- package/dist/components/Checkbox/Checkbox.js.map +0 -1
- package/dist/components/Checkbox/Checkbox.test.d.ts +0 -1
- package/dist/components/Checkbox/index.d.ts +0 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +0 -25
- package/dist/components/CheckboxGroup/CheckboxGroup.js +0 -99
- package/dist/components/CheckboxGroup/CheckboxGroup.js.map +0 -1
- package/dist/components/ConfirmationModal/ConfirmationModal.d.ts +0 -15
- package/dist/components/ConfirmationModal/ConfirmationModal.js +0 -136
- package/dist/components/ConfirmationModal/ConfirmationModal.js.map +0 -1
- package/dist/components/ConfirmationModal/index.d.ts +0 -2
- package/dist/components/CustomSelect/CustomSelect.js +0 -259
- package/dist/components/CustomSelect/CustomSelect.js.map +0 -1
- package/dist/components/EventAddForm/AddEventLayout.js +0 -227
- package/dist/components/EventAddForm/AddEventLayout.js.map +0 -1
- package/dist/components/EventAddForm/AddEventStepper.js +0 -719
- package/dist/components/EventAddForm/AddEventStepper.js.map +0 -1
- package/dist/components/EventAddForm/common/ConfirmationModal.js +0 -136
- package/dist/components/EventAddForm/common/ConfirmationModal.js.map +0 -1
- package/dist/components/EventAddForm/common/DescriptionModal.js +0 -70
- package/dist/components/EventAddForm/common/DescriptionModal.js.map +0 -1
- package/dist/components/EventAddForm/components/AnimatedBackground.d.ts +0 -8
- package/dist/components/EventAddForm/components/ApprovalConfirmationModal.d.ts +0 -7
- package/dist/components/EventAddForm/components/CheckboxGroup.js +0 -92
- package/dist/components/EventAddForm/components/CheckboxGroup.js.map +0 -1
- package/dist/components/EventAddForm/components/CustomMeetingForm.js +0 -237
- package/dist/components/EventAddForm/components/CustomMeetingForm.js.map +0 -1
- package/dist/components/EventAddForm/components/DateTimeField.js +0 -173
- package/dist/components/EventAddForm/components/DateTimeField.js.map +0 -1
- package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.d.ts +0 -33
- package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.js +0 -366
- package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.js.map +0 -1
- package/dist/components/EventAddForm/components/FileUpload.js +0 -412
- package/dist/components/EventAddForm/components/FileUpload.js.map +0 -1
- package/dist/components/EventAddForm/components/FormBuilderProceedModal.js +0 -197
- package/dist/components/EventAddForm/components/FormBuilderProceedModal.js.map +0 -1
- package/dist/components/EventAddForm/components/GoogleMapsAutocompleteInput.js +0 -1179
- package/dist/components/EventAddForm/components/GoogleMapsAutocompleteInput.js.map +0 -1
- package/dist/components/EventAddForm/components/InputField.d.ts +0 -15
- package/dist/components/EventAddForm/components/RadioGroupButton.d.ts +0 -14
- package/dist/components/EventAddForm/components/SelectField.d.ts +0 -19
- package/dist/components/EventAddForm/components/SingleDateTimeInput.js +0 -102
- package/dist/components/EventAddForm/components/SingleDateTimeInput.js.map +0 -1
- package/dist/components/EventAddForm/components/StepTwo/CustomFormSection.js +0 -277
- package/dist/components/EventAddForm/components/StepTwo/CustomFormSection.js.map +0 -1
- package/dist/components/EventAddForm/components/StepTwo/TicketTierSection.js +0 -148
- package/dist/components/EventAddForm/components/StepTwo/TicketTierSection.js.map +0 -1
- package/dist/components/EventAddForm/components/TicketTierForm.js +0 -418
- package/dist/components/EventAddForm/components/TicketTierForm.js.map +0 -1
- package/dist/components/EventAddForm/components/TicketTypeSelection.js +0 -93
- package/dist/components/EventAddForm/components/TicketTypeSelection.js.map +0 -1
- package/dist/components/EventAddForm/hooks/useStepperForm.js +0 -371
- package/dist/components/EventAddForm/hooks/useStepperForm.js.map +0 -1
- package/dist/components/EventAddForm/hooks/useTicketTierForm.js +0 -237
- package/dist/components/EventAddForm/hooks/useTicketTierForm.js.map +0 -1
- package/dist/components/EventAddForm/index.d.ts +0 -3
- package/dist/components/EventAddForm/index.js +0 -41
- package/dist/components/EventAddForm/index.js.map +0 -1
- package/dist/components/EventAddForm/schemas/index.d.ts +0 -2
- package/dist/components/EventAddForm/schemas/step1.d.ts +0 -47
- package/dist/components/EventAddForm/schemas/step1.js +0 -135
- package/dist/components/EventAddForm/schemas/step1.js.map +0 -1
- package/dist/components/EventAddForm/schemas/step2.d.ts +0 -138
- package/dist/components/EventAddForm/schemas/step2.js +0 -94
- package/dist/components/EventAddForm/schemas/step2.js.map +0 -1
- package/dist/components/EventAddForm/schemas/utils.js +0 -28
- package/dist/components/EventAddForm/schemas/utils.js.map +0 -1
- package/dist/components/EventAddForm/steps/IndividualFormStep.js +0 -85
- package/dist/components/EventAddForm/steps/IndividualFormStep.js.map +0 -1
- package/dist/components/EventAddForm/steps/SocialProfilesStep.js +0 -123
- package/dist/components/EventAddForm/steps/SocialProfilesStep.js.map +0 -1
- package/dist/components/EventAddForm/steps/StepOne.js +0 -462
- package/dist/components/EventAddForm/steps/StepOne.js.map +0 -1
- package/dist/components/EventAddForm/steps/StepTwo.js +0 -173
- package/dist/components/EventAddForm/steps/StepTwo.js.map +0 -1
- package/dist/components/EventAddForm/steps/TeamFormStep.js +0 -13
- package/dist/components/EventAddForm/steps/TeamFormStep.js.map +0 -1
- package/dist/components/FormBuilder/CategoryList.js +0 -242
- package/dist/components/FormBuilder/CategoryList.js.map +0 -1
- package/dist/components/FormBuilder/DiscountInput.js +0 -366
- package/dist/components/FormBuilder/DiscountInput.js.map +0 -1
- package/dist/components/FormBuilder/FormBuilder.js +0 -918
- package/dist/components/FormBuilder/FormBuilder.js.map +0 -1
- package/dist/components/FormBuilder/OptionList.js +0 -120
- package/dist/components/FormBuilder/OptionList.js.map +0 -1
- package/dist/components/FormBuilder/PaymentPreview.d.ts +0 -12
- package/dist/components/FormBuilder/PaymentPreview.js +0 -70
- package/dist/components/FormBuilder/PaymentPreview.js.map +0 -1
- package/dist/components/FormBuilder/PreviewInput.d.ts +0 -10
- package/dist/components/FormBuilder/PreviewInput.js +0 -143
- package/dist/components/FormBuilder/PreviewInput.js.map +0 -1
- package/dist/components/FormBuilder/QuestionCard.js +0 -252
- package/dist/components/FormBuilder/QuestionCard.js.map +0 -1
- package/dist/components/FormBuilder/QuestionEditor.js +0 -166
- package/dist/components/FormBuilder/QuestionEditor.js.map +0 -1
- package/dist/components/FormBuilder/RequiredToggle.js +0 -43
- package/dist/components/FormBuilder/RequiredToggle.js.map +0 -1
- package/dist/components/FormBuilder/SortableQuestionList.js +0 -137
- package/dist/components/FormBuilder/SortableQuestionList.js.map +0 -1
- package/dist/components/FormBuilder/index.d.ts +0 -4
- package/dist/components/FormBuilder/utils.js +0 -229
- package/dist/components/FormBuilder/utils.js.map +0 -1
- package/dist/components/FormInput/FormInput.js +0 -126
- package/dist/components/FormInput/FormInput.js.map +0 -1
- package/dist/components/FormInput/FormInput.test.d.ts +0 -1
- package/dist/components/FormInput/index.d.ts +0 -2
- package/dist/components/ImageCropModal/index.js +0 -464
- package/dist/components/ImageCropModal/index.js.map +0 -1
- package/dist/components/InformationPopover/InformationPopover.d.ts +0 -7
- package/dist/components/InformationPopover/InformationPopover.js +0 -19
- package/dist/components/InformationPopover/InformationPopover.js.map +0 -1
- package/dist/components/InformationPopover.js +0 -19
- package/dist/components/InformationPopover.js.map +0 -1
- package/dist/components/InputErrorMessage/InputErrorMessage.js +0 -21
- package/dist/components/InputErrorMessage/InputErrorMessage.js.map +0 -1
- package/dist/components/Modal/Modal.d.ts +0 -15
- package/dist/components/Modal/Modal.js +0 -73
- package/dist/components/Modal/Modal.js.map +0 -1
- package/dist/components/Radio/Radio.js +0 -35
- package/dist/components/Radio/Radio.js.map +0 -1
- package/dist/components/Spinner/spinner.d.ts +0 -2
- package/dist/components/Spinner/spinner.js +0 -22
- package/dist/components/Spinner/spinner.js.map +0 -1
- package/dist/components/Toggle/Toggle.d.ts +0 -16
- package/dist/components/Toggle/index.d.ts +0 -2
- package/dist/components/Tooltip/Tooltip.d.ts +0 -12
- package/dist/components/Tooltip/Tooltip.js +0 -134
- package/dist/components/Tooltip/Tooltip.js.map +0 -1
- package/dist/components/common/FallbackImage.js +0 -47
- package/dist/components/common/FallbackImage.js.map +0 -1
- package/dist/components/ui/Calendar/calendar-utils.js +0 -51
- package/dist/components/ui/Calendar/calendar-utils.js.map +0 -1
- package/dist/components/ui/Calendar/index.js +0 -142
- package/dist/components/ui/Calendar/index.js.map +0 -1
- package/dist/components/ui/Checkbox.d.ts +0 -9
- package/dist/components/ui/Checkbox.js +0 -50
- package/dist/components/ui/Checkbox.js.map +0 -1
- package/dist/components/ui/DatePicker/index.js +0 -188
- package/dist/components/ui/DatePicker/index.js.map +0 -1
- package/dist/components/ui/FormInput.js +0 -129
- package/dist/components/ui/FormInput.js.map +0 -1
- package/dist/components/ui/InputErrorMessage.d.ts +0 -7
- package/dist/components/ui/InputErrorMessage.js +0 -21
- package/dist/components/ui/InputErrorMessage.js.map +0 -1
- package/dist/components/ui/Modal/index.js +0 -73
- package/dist/components/ui/Modal/index.js.map +0 -1
- package/dist/components/ui/Radio.d.ts +0 -6
- package/dist/components/ui/Radio.js +0 -35
- package/dist/components/ui/Radio.js.map +0 -1
- package/dist/components/ui/RichTextEditor.js +0 -242
- package/dist/components/ui/RichTextEditor.js.map +0 -1
- package/dist/components/ui/TimePicker/index.js +0 -215
- package/dist/components/ui/TimePicker/index.js.map +0 -1
- package/dist/components/ui/TimeSelector/index.js +0 -138
- package/dist/components/ui/TimeSelector/index.js.map +0 -1
- package/dist/components/ui/Tooltip.d.ts +0 -12
- package/dist/components/ui/Tooltip.js +0 -136
- package/dist/components/ui/Tooltip.js.map +0 -1
- package/dist/hooks/useDropdownPosition.d.ts +0 -11
- package/dist/hooks/useFirebaseAuthState.d.ts +0 -6
- package/dist/hooks/useFirebaseAuthState.js +0 -23
- package/dist/hooks/useFirebaseAuthState.js.map +0 -1
- package/dist/hooks/useTicketTierForm.d.ts +0 -61
- package/dist/lib/actions.js +0 -32
- package/dist/lib/actions.js.map +0 -1
- package/dist/lib/cropImage.js +0 -113
- package/dist/lib/cropImage.js.map +0 -1
- package/dist/lib/imageAnalysis.js +0 -58
- package/dist/lib/imageAnalysis.js.map +0 -1
- package/dist/lib/utils.js +0 -9
- package/dist/lib/utils.js.map +0 -1
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +0 -60
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js.map +0 -1
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +0 -3458
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js.map +0 -1
- package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +0 -593
- package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js.map +0 -1
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +0 -302
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js.map +0 -1
- package/dist/node_modules/@firebase/app/dist/esm/index.esm.js +0 -768
- package/dist/node_modules/@firebase/app/dist/esm/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/component/dist/esm/index.esm.js +0 -340
- package/dist/node_modules/@firebase/component/dist/esm/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/logger/dist/esm/index.esm.js +0 -123
- package/dist/node_modules/@firebase/logger/dist/esm/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/storage/dist/index.esm.js +0 -2623
- package/dist/node_modules/@firebase/storage/dist/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/util/dist/index.esm.js +0 -658
- package/dist/node_modules/@firebase/util/dist/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/util/dist/postinstall.js +0 -5
- package/dist/node_modules/@firebase/util/dist/postinstall.js.map +0 -1
- package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js +0 -3179
- package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js.map +0 -1
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js +0 -60
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js.map +0 -1
- package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js +0 -400
- package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js.map +0 -1
- package/dist/node_modules/@heroicons/react/20/solid/esm/CheckIcon.js +0 -27
- package/dist/node_modules/@heroicons/react/20/solid/esm/CheckIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/20/solid/esm/ChevronDownIcon.js +0 -27
- package/dist/node_modules/@heroicons/react/20/solid/esm/ChevronDownIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowRightIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowRightIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ClockIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/ClockIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentDuplicateIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentDuplicateIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/InformationCircleIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/InformationCircleIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/LinkIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/LinkIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/MagnifyingGlassIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/MagnifyingGlassIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/MapPinIcon.js +0 -33
- package/dist/node_modules/@heroicons/react/24/outline/esm/MapPinIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/VideoCameraIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/VideoCameraIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/XMarkIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/XMarkIcon.js.map +0 -1
- package/dist/node_modules/@tiptap/core/dist/index.js +0 -5446
- package/dist/node_modules/@tiptap/core/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +0 -21
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +0 -78
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js +0 -100
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-code/dist/index.js +0 -70
- package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +0 -317
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-document/dist/index.js +0 -16
- package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +0 -66
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js +0 -86
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +0 -80
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js +0 -98
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-link/dist/index.js +0 -423
- package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +0 -1039
- package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +0 -61
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +0 -7
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js +0 -79
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-text/dist/index.js +0 -16
- package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js +0 -76
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extensions/dist/index.js +0 -376
- package/dist/node_modules/@tiptap/extensions/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/react/dist/index.js +0 -650
- package/dist/node_modules/@tiptap/react/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js +0 -97
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +0 -1
- package/dist/node_modules/dayjs/dayjs.min.js +0 -283
- package/dist/node_modules/dayjs/dayjs.min.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/customParseFormat.js +0 -130
- package/dist/node_modules/dayjs/plugin/customParseFormat.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/duration.js +0 -137
- package/dist/node_modules/dayjs/plugin/duration.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/isBetween.js +0 -20
- package/dist/node_modules/dayjs/plugin/isBetween.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/relativeTime.js +0 -49
- package/dist/node_modules/dayjs/plugin/relativeTime.js.map +0 -1
- package/dist/node_modules/fast-equals/dist/es/index.js +0 -442
- package/dist/node_modules/fast-equals/dist/es/index.js.map +0 -1
- package/dist/node_modules/idb/build/index.js +0 -70
- package/dist/node_modules/idb/build/index.js.map +0 -1
- package/dist/node_modules/idb/build/wrap-idb-value.js +0 -149
- package/dist/node_modules/idb/build/wrap-idb-value.js.map +0 -1
- package/dist/node_modules/linkifyjs/dist/linkify.js +0 -1159
- package/dist/node_modules/linkifyjs/dist/linkify.js.map +0 -1
- package/dist/node_modules/orderedmap/dist/index.js +0 -120
- package/dist/node_modules/orderedmap/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-commands/dist/index.js +0 -527
- package/dist/node_modules/prosemirror-commands/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js +0 -137
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js +0 -221
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-history/dist/index.js +0 -357
- package/dist/node_modules/prosemirror-history/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-keymap/dist/index.js +0 -84
- package/dist/node_modules/prosemirror-keymap/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-model/dist/index.js +0 -3209
- package/dist/node_modules/prosemirror-model/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-schema-list/dist/index.js +0 -131
- package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-state/dist/index.js +0 -936
- package/dist/node_modules/prosemirror-state/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-transform/dist/index.js +0 -1881
- package/dist/node_modules/prosemirror-transform/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-view/dist/index.js +0 -5232
- package/dist/node_modules/prosemirror-view/dist/index.js.map +0 -1
- package/dist/node_modules/rope-sequence/dist/index.js +0 -184
- package/dist/node_modules/rope-sequence/dist/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +0 -82
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +0 -78
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -78
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -63
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +0 -13
- package/dist/node_modules/use-sync-external-store/shim/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js +0 -13
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +0 -1
- package/dist/node_modules/w3c-keyname/index.js +0 -106
- package/dist/node_modules/w3c-keyname/index.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/coerce.js +0 -10
- package/dist/node_modules/zod/v4/classic/coerce.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/compat.js +0 -8
- package/dist/node_modules/zod/v4/classic/compat.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/errors.js +0 -45
- package/dist/node_modules/zod/v4/classic/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/iso.js +0 -44
- package/dist/node_modules/zod/v4/classic/iso.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/parse.js +0 -30
- package/dist/node_modules/zod/v4/classic/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/schemas.js +0 -711
- package/dist/node_modules/zod/v4/classic/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/api.js +0 -588
- package/dist/node_modules/zod/v4/core/api.js.map +0 -1
- package/dist/node_modules/zod/v4/core/checks.js +0 -411
- package/dist/node_modules/zod/v4/core/checks.js.map +0 -1
- package/dist/node_modules/zod/v4/core/core.js +0 -75
- package/dist/node_modules/zod/v4/core/core.js.map +0 -1
- package/dist/node_modules/zod/v4/core/doc.js +0 -38
- package/dist/node_modules/zod/v4/core/doc.js.map +0 -1
- package/dist/node_modules/zod/v4/core/errors.js +0 -73
- package/dist/node_modules/zod/v4/core/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -359
- package/dist/node_modules/zod/v4/core/json-schema-processors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/parse.js +0 -96
- package/dist/node_modules/zod/v4/core/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/core/regexes.js +0 -84
- package/dist/node_modules/zod/v4/core/regexes.js.map +0 -1
- package/dist/node_modules/zod/v4/core/registries.js +0 -52
- package/dist/node_modules/zod/v4/core/registries.js.map +0 -1
- package/dist/node_modules/zod/v4/core/schemas.js +0 -1391
- package/dist/node_modules/zod/v4/core/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -363
- package/dist/node_modules/zod/v4/core/to-json-schema.js.map +0 -1
- package/dist/node_modules/zod/v4/core/util.js +0 -431
- package/dist/node_modules/zod/v4/core/util.js.map +0 -1
- package/dist/node_modules/zod/v4/core/versions.js +0 -9
- package/dist/node_modules/zod/v4/core/versions.js.map +0 -1
- package/dist/redux/baseQuery.d.ts +0 -1
- package/dist/redux/baseQuery.js +0 -24
- package/dist/redux/baseQuery.js.map +0 -1
- package/dist/services/eventApi.js +0 -411
- package/dist/services/eventApi.js.map +0 -1
- package/dist/services/helpers.js +0 -115
- package/dist/services/helpers.js.map +0 -1
- package/dist/services/initialize-firebase.d.ts +0 -2
- package/dist/services/initialize-firebase.js +0 -20
- package/dist/services/initialize-firebase.js.map +0 -1
- package/dist/services/process-image-on-server.js +0 -30
- package/dist/services/process-image-on-server.js.map +0 -1
- package/dist/services/remote-config.d.ts +0 -5
- package/dist/services/remote-config.js +0 -9
- package/dist/services/remote-config.js.map +0 -1
- package/dist/services/single-event-api.js +0 -301
- package/dist/services/single-event-api.js.map +0 -1
- package/dist/services/utils.js +0 -107
- package/dist/services/utils.js.map +0 -1
- package/dist/setupTests.d.ts +0 -1
- package/dist/stories/Alert.stories.d.ts +0 -10
- package/dist/stories/Button.stories.d.ts +0 -13
- package/dist/types/redux-types.d.ts +0 -15
- package/dist/types/types.d.ts +0 -60
- package/dist/types/types.js +0 -10
- package/dist/types/types.js.map +0 -1
- package/dist/utils/cn.d.ts +0 -6
- package/dist/utils/cn.js +0 -9
- package/dist/utils/cn.js.map +0 -1
- package/dist/utils/date-range.d.ts +0 -4
- package/dist/utils/date-range.js +0 -13
- package/dist/utils/date-range.js.map +0 -1
- package/dist/utils/single-event-helpers.d.ts +0 -50
- package/dist/utils/single-event-helpers.js +0 -18
- package/dist/utils/single-event-helpers.js.map +0 -1
- package/dist/utils/social-validation.js +0 -42
- package/dist/utils/social-validation.js.map +0 -1
- package/dist/utils/utils.js +0 -20
- package/dist/utils/utils.js.map +0 -1
- /package/dist/{components/Alert/Alert.d.ts → src/components/Alert/index.d.ts} +0 -0
- /package/dist/{components → src/components}/FormBuilder/CategoryList.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/OptionList.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/RequiredToggle.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/types.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/utils.d.ts +0 -0
- /package/dist/{components → src/components}/ImageCropModal/index.d.ts +0 -0
- /package/dist/{components → src/components}/InformationPopover.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/common/DescriptionModal.d.ts +0 -0
- /package/dist/{components/ui/FormInput.d.ts → src/components/NewAddEvent/components/AddEventFormInput.d.ts} +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/CheckboxGroup.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/CustomMeetingForm.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/DateTimeField.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/FileUpload.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/FormBuilderProceedModal.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/GoogleMapsAutocompleteInput.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/SingleDateTimeInput.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/StepTwo/CustomFormSection.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/TicketTypeSelection.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/StepOne.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/StepTwo.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/types.d.ts +0 -0
- /package/dist/{components → src/components}/common/FallbackImage.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Calendar/calendar-utils.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Calendar/index.d.ts +0 -0
- /package/dist/{components/Checkbox → src/components/ui}/Checkbox.d.ts +0 -0
- /package/dist/{components/CustomSelect → src/components/ui}/CustomSelect.d.ts +0 -0
- /package/dist/{components → src/components}/ui/DatePicker/index.d.ts +0 -0
- /package/dist/{components/InputErrorMessage → src/components/ui}/InputErrorMessage.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Modal/index.d.ts +0 -0
- /package/dist/{components/Radio → src/components/ui}/Radio.d.ts +0 -0
- /package/dist/{components → src/components}/ui/RichTextEditor.d.ts +0 -0
- /package/dist/{components → src/components}/ui/TimePicker/index.d.ts +0 -0
- /package/dist/{components → src/components}/ui/TimeSelector/index.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Tooltip/index.d.ts +0 -0
- /package/dist/{lib → src/lib}/constants.d.ts +0 -0
- /package/dist/{lib → src/lib}/cropImage.d.ts +0 -0
- /package/dist/{lib → src/lib}/imageAnalysis.d.ts +0 -0
- /package/dist/{utils → src/lib}/social-validation.d.ts +0 -0
- /package/dist/{lib/utils.d.ts → src/lib/tailwind-merge.d.ts} +0 -0
- /package/dist/{utils → src/lib}/utils.d.ts +0 -0
- /package/dist/{services → src/redux/features/single-event}/helpers.d.ts +0 -0
- /package/dist/{services → src/services}/process-image-on-server.d.ts +0 -0
- /package/dist/{types → src/types}/events.d.ts +0 -0
- /package/dist/{types → src/types}/question.d.ts +0 -0
|
@@ -1,918 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { memo, forwardRef, useState, useRef, useEffect, useCallback, useMemo, useImperativeHandle } from "react";
|
|
3
|
-
import { useSensors, useSensor, DndContext, closestCenter, DragOverlay, KeyboardSensor, PointerSensor } from "../../node_modules/@dnd-kit/core/dist/core.esm.js";
|
|
4
|
-
import { SortableContext, verticalListSortingStrategy, arrayMove, sortableKeyboardCoordinates } from "../../node_modules/@dnd-kit/sortable/dist/sortable.esm.js";
|
|
5
|
-
import { ChevronDown, Plus, ClipboardList } from "lucide-react";
|
|
6
|
-
import { AnimatePresence, motion } from "framer-motion";
|
|
7
|
-
import { SortableQuestionList } from "./SortableQuestionList.js";
|
|
8
|
-
import QuestionCard from "./QuestionCard.js";
|
|
9
|
-
import { normalizeFormSchema, denormalizeFormSchema, getDiscountFilePath, validateQuestionError } from "./utils.js";
|
|
10
|
-
import Alert from "../Alert/Alert.js";
|
|
11
|
-
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
12
|
-
import { cn } from "../../utils/cn.js";
|
|
13
|
-
import ForwardRef from "../../node_modules/@heroicons/react/24/outline/esm/InformationCircleIcon.js";
|
|
14
|
-
import { Button } from "../Button/Button.js";
|
|
15
|
-
const EmptyState = ({ onAdd, isAddingNew }) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-12 px-4 border-2 border-dashed border-grey-200 rounded-xl bg-grey-50/50 text-center", children: [
|
|
16
|
-
/* @__PURE__ */ jsx("div", { className: "bg-white p-3 rounded-full shadow-sm mb-4", children: /* @__PURE__ */ jsx(ClipboardList, { className: "w-6 h-6 text-purple-600" }) }),
|
|
17
|
-
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-1", children: "No questions yet" }),
|
|
18
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-grey-500 mb-6 max-w-sm", children: "Start building your form by adding your first question." }),
|
|
19
|
-
/* @__PURE__ */ jsxs(
|
|
20
|
-
Button,
|
|
21
|
-
{
|
|
22
|
-
type: "button",
|
|
23
|
-
onClick: (e) => {
|
|
24
|
-
e.stopPropagation();
|
|
25
|
-
if (!isAddingNew) onAdd();
|
|
26
|
-
},
|
|
27
|
-
disabled: isAddingNew,
|
|
28
|
-
className: cn("gap-2", isAddingNew && "opacity-50 cursor-not-allowed"),
|
|
29
|
-
children: [
|
|
30
|
-
/* @__PURE__ */ jsx(Plus, { className: "w-4 h-4" }),
|
|
31
|
-
"Add Question"
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
)
|
|
35
|
-
] });
|
|
36
|
-
const FormBuilder = forwardRef(({
|
|
37
|
-
eventId,
|
|
38
|
-
initialFields,
|
|
39
|
-
participationType,
|
|
40
|
-
scope,
|
|
41
|
-
isSameQuestionTitleAllowed = true,
|
|
42
|
-
allowedDiscountQuestions = 1,
|
|
43
|
-
onQuestionsChange,
|
|
44
|
-
onBusyStateChange,
|
|
45
|
-
onPolluted,
|
|
46
|
-
discountFilePath,
|
|
47
|
-
individualDiscountFilePath,
|
|
48
|
-
userUid,
|
|
49
|
-
addQuestion,
|
|
50
|
-
editQuestion,
|
|
51
|
-
deleteQuestion,
|
|
52
|
-
updateOrder,
|
|
53
|
-
storageService
|
|
54
|
-
}, ref) => {
|
|
55
|
-
const [questions, setQuestions] = useState({});
|
|
56
|
-
const [questionOrder, setQuestionOrder] = useState([]);
|
|
57
|
-
const [isLocked, setIsLocked] = useState(false);
|
|
58
|
-
const [isLoaded, setIsLoaded] = useState(false);
|
|
59
|
-
const questionsRef = useRef(questions);
|
|
60
|
-
const questionOrderRef = useRef(questionOrder);
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
questionsRef.current = questions;
|
|
63
|
-
}, [questions]);
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
questionOrderRef.current = questionOrder;
|
|
66
|
-
}, [questionOrder]);
|
|
67
|
-
const dirtyQuestionsRef = useRef(/* @__PURE__ */ new Set());
|
|
68
|
-
const newQuestionsRef = useRef(/* @__PURE__ */ new Set());
|
|
69
|
-
const isOrderDirtyRef = useRef(false);
|
|
70
|
-
const [isDirtyForUI, setIsDirtyForUI] = useState(false);
|
|
71
|
-
const snapshotRef = useRef(null);
|
|
72
|
-
const isCurrentSessionNewRef = useRef(false);
|
|
73
|
-
const isSavingRef = useRef(false);
|
|
74
|
-
const [editingQuestionId, setEditingQuestionId] = useState(null);
|
|
75
|
-
const [showValidationErrors, setShowValidationErrors] = useState(false);
|
|
76
|
-
const [activeId, setActiveId] = useState(null);
|
|
77
|
-
const [alertState, setAlertState] = useState({
|
|
78
|
-
isVisible: false,
|
|
79
|
-
message: "",
|
|
80
|
-
type: "success"
|
|
81
|
-
});
|
|
82
|
-
const [isTeamOpen, setIsTeamOpen] = useState(true);
|
|
83
|
-
const [isIndividualOpen, setIsIndividualOpen] = useState(true);
|
|
84
|
-
const [isTeamMemberOpen, setIsTeamMemberOpen] = useState(true);
|
|
85
|
-
const isBusy = isSavingRef.current || isDirtyForUI;
|
|
86
|
-
useEffect(() => {
|
|
87
|
-
if (onBusyStateChange) {
|
|
88
|
-
onBusyStateChange(isBusy);
|
|
89
|
-
}
|
|
90
|
-
}, [isBusy, onBusyStateChange]);
|
|
91
|
-
const showAlert = useCallback((message, type) => {
|
|
92
|
-
setAlertState({ isVisible: true, message, type });
|
|
93
|
-
setTimeout(() => setAlertState((prev) => ({ ...prev, isVisible: false })), 3e3);
|
|
94
|
-
}, []);
|
|
95
|
-
const formId = useMemo(() => `event-form-${eventId || "new"}`, [eventId]);
|
|
96
|
-
useEffect(() => {
|
|
97
|
-
if (initialFields) {
|
|
98
|
-
const hasUnsavedChanges = dirtyQuestionsRef.current.size > 0 || isOrderDirtyRef.current || newQuestionsRef.current.size > 0;
|
|
99
|
-
if (!isLoaded || !hasUnsavedChanges) {
|
|
100
|
-
const normalizedData = normalizeFormSchema(initialFields, discountFilePath, individualDiscountFilePath);
|
|
101
|
-
setQuestions(normalizedData.questions || {});
|
|
102
|
-
setQuestionOrder(normalizedData.questionOrder || []);
|
|
103
|
-
setIsLocked(normalizedData.status === "LOCKED");
|
|
104
|
-
if (!isLoaded) setIsLoaded(true);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}, [initialFields, isLoaded]);
|
|
108
|
-
const notifyParentOfChange = useCallback((newQuestions, newOrder) => {
|
|
109
|
-
if (onQuestionsChange) {
|
|
110
|
-
const arrayFormat = denormalizeFormSchema(newQuestions, newOrder);
|
|
111
|
-
onQuestionsChange(arrayFormat);
|
|
112
|
-
}
|
|
113
|
-
}, [onQuestionsChange]);
|
|
114
|
-
const isTeamEvent = participationType === "2" || participationType === "TEAM";
|
|
115
|
-
const discountQuestionsCount = useMemo(() => {
|
|
116
|
-
return Object.values(questions).filter((q) => {
|
|
117
|
-
if (q.kind !== "DISCOUNT") return false;
|
|
118
|
-
if (scope) {
|
|
119
|
-
if (scope === "INDIVIDUAL") {
|
|
120
|
-
const isBothParticipation = participationType === "3" || participationType === "BOTH";
|
|
121
|
-
return q.scope === "INDIVIDUAL" || isBothParticipation && q.scope === "BOTH";
|
|
122
|
-
} else if (scope === "TEAM") {
|
|
123
|
-
return q.scope === "TEAM" || q.scope === "BOTH";
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
if (participationType === "INDIVIDUAL") {
|
|
127
|
-
return q.scope === "INDIVIDUAL" || q.scope === "BOTH";
|
|
128
|
-
} else if (isTeamEvent) {
|
|
129
|
-
return q.scope === "TEAM" || q.scope === "BOTH";
|
|
130
|
-
}
|
|
131
|
-
return true;
|
|
132
|
-
}).length;
|
|
133
|
-
}, [questions, scope, participationType, isTeamEvent]);
|
|
134
|
-
const disableDiscountOption = discountQuestionsCount >= allowedDiscountQuestions;
|
|
135
|
-
const { teamQuestionsOrder, teamMemberQuestionsOrder, individualQuestionsOrder } = useMemo(() => {
|
|
136
|
-
const team = [];
|
|
137
|
-
const teamMember = [];
|
|
138
|
-
const individual = [];
|
|
139
|
-
questionOrder.forEach((id) => {
|
|
140
|
-
const q = questions[id];
|
|
141
|
-
if (!q) return;
|
|
142
|
-
if (scope) {
|
|
143
|
-
if (scope === "INDIVIDUAL") {
|
|
144
|
-
const isBothParticipation = participationType === "3" || participationType === "BOTH";
|
|
145
|
-
if (q.scope === "INDIVIDUAL" || isBothParticipation && q.scope === "BOTH") {
|
|
146
|
-
individual.push(id);
|
|
147
|
-
}
|
|
148
|
-
} else if (scope === "TEAM" && (q.scope === "TEAM" || q.scope === "BOTH")) {
|
|
149
|
-
if (q.individual === false) team.push(id);
|
|
150
|
-
else teamMember.push(id);
|
|
151
|
-
}
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
if (participationType === "INDIVIDUAL") {
|
|
155
|
-
if (q.scope === "INDIVIDUAL" || q.scope === "BOTH") individual.push(id);
|
|
156
|
-
} else if (isTeamEvent) {
|
|
157
|
-
if (q.scope === "TEAM" || q.scope === "BOTH") {
|
|
158
|
-
if (q.individual === false) team.push(id);
|
|
159
|
-
else teamMember.push(id);
|
|
160
|
-
}
|
|
161
|
-
} else {
|
|
162
|
-
if (q.individual === false) team.push(id);
|
|
163
|
-
else individual.push(id);
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
return {
|
|
167
|
-
teamQuestionsOrder: team,
|
|
168
|
-
teamMemberQuestionsOrder: teamMember,
|
|
169
|
-
individualQuestionsOrder: individual
|
|
170
|
-
};
|
|
171
|
-
}, [questionOrder, questions, scope, participationType, isTeamEvent]);
|
|
172
|
-
const autoSaveTimerRef = useRef(null);
|
|
173
|
-
const markDirty = (desc, delay = 3e4) => {
|
|
174
|
-
setIsDirtyForUI(true);
|
|
175
|
-
if (autoSaveTimerRef.current) clearTimeout(autoSaveTimerRef.current);
|
|
176
|
-
autoSaveTimerRef.current = setTimeout(() => {
|
|
177
|
-
saveRoutine();
|
|
178
|
-
}, delay);
|
|
179
|
-
};
|
|
180
|
-
useEffect(() => {
|
|
181
|
-
return () => {
|
|
182
|
-
if (autoSaveTimerRef.current) clearTimeout(autoSaveTimerRef.current);
|
|
183
|
-
};
|
|
184
|
-
}, []);
|
|
185
|
-
const saveRoutine = async (retryCount = 0) => {
|
|
186
|
-
var _a, _b;
|
|
187
|
-
if (isSavingRef.current) {
|
|
188
|
-
return new Promise((resolve) => {
|
|
189
|
-
const check = () => {
|
|
190
|
-
if (!isSavingRef.current) resolve();
|
|
191
|
-
else setTimeout(check, 100);
|
|
192
|
-
};
|
|
193
|
-
check();
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
isSavingRef.current = true;
|
|
197
|
-
autoSaveTimerRef.current = null;
|
|
198
|
-
const dirtyIds = Array.from(dirtyQuestionsRef.current);
|
|
199
|
-
const orderDirty = isOrderDirtyRef.current;
|
|
200
|
-
if (dirtyIds.length === 0 && !orderDirty) {
|
|
201
|
-
setIsDirtyForUI(false);
|
|
202
|
-
isSavingRef.current = false;
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
const questionPromises = [];
|
|
206
|
-
let hasSkippedQuestions = false;
|
|
207
|
-
for (const id of dirtyIds) {
|
|
208
|
-
const q = questionsRef.current[id];
|
|
209
|
-
if (!q) {
|
|
210
|
-
dirtyQuestionsRef.current.delete(id);
|
|
211
|
-
continue;
|
|
212
|
-
}
|
|
213
|
-
const stateBeingSaved = JSON.stringify(q);
|
|
214
|
-
const isNew = newQuestionsRef.current.has(id);
|
|
215
|
-
const isChoice = ["MULTIPLE_CHOICE", "CHECKBOX", "DROPDOWN"].includes(q.kind);
|
|
216
|
-
const isPayment = ["PAYMENT", "PAYMENT_CHECKBOX"].includes(q.kind);
|
|
217
|
-
const effectiveScope = scope || q.scope || (q.individual === false ? "TEAM" : "INDIVIDUAL");
|
|
218
|
-
const path = `/data/${userUid}/events/discounts/${eventId}.csv`;
|
|
219
|
-
const individualPath = `/data/${userUid}/events/discounts/${eventId}_individual.csv`;
|
|
220
|
-
const discountPath = userUid ? path : q.discount_file_path;
|
|
221
|
-
const individualDiscountPath = userUid ? individualPath : discountPath;
|
|
222
|
-
if (q.kind === "DISCOUNT" && q.file && userUid && storageService) {
|
|
223
|
-
try {
|
|
224
|
-
const targetUploadPath = getDiscountFilePath(eventId, userUid, participationType, scope, q);
|
|
225
|
-
await storageService.uploadFile(targetUploadPath, q.file);
|
|
226
|
-
} catch (err) {
|
|
227
|
-
console.error("Failed to upload discount file", err);
|
|
228
|
-
showAlert("Failed to upload discount file", "error");
|
|
229
|
-
continue;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
const basePayload = {
|
|
233
|
-
event_id: eventId,
|
|
234
|
-
question_type: q.kind,
|
|
235
|
-
placeholder: q.placeholder || "",
|
|
236
|
-
validation: q.required,
|
|
237
|
-
individual: q.individual !== false,
|
|
238
|
-
scope: effectiveScope,
|
|
239
|
-
conditions: {},
|
|
240
|
-
options: isChoice ? ((_a = q.options) == null ? void 0 : _a.map((o) => ({ value: o.value || o.label }))) || [] : [],
|
|
241
|
-
Categories: isPayment ? ((_b = q.Categories) == null ? void 0 : _b.map((c) => ({ name: c.name, price: c.price }))) || [] : [],
|
|
242
|
-
additional_fee: isPayment,
|
|
243
|
-
applies_on: q.kind === "DISCOUNT" ? q.applies_on || [] : [],
|
|
244
|
-
discount_file_path: effectiveScope === "TEAM" || effectiveScope === "BOTH" || effectiveScope === "INDIVIDUAL" ? discountPath || "" : "",
|
|
245
|
-
individual_discount_file_path: effectiveScope === "INDIVIDUAL" || effectiveScope === "BOTH" ? individualDiscountPath || "" : ""
|
|
246
|
-
};
|
|
247
|
-
if (isNew) {
|
|
248
|
-
if (addQuestion) {
|
|
249
|
-
const apiPayload = { ...basePayload, question: q.label };
|
|
250
|
-
if (!apiPayload.question || isChoice && apiPayload.options.length === 0 || isPayment && apiPayload.Categories.length === 0 || q.kind === "DISCOUNT" && apiPayload.applies_on.length === 0 || q.kind === "DISCOUNT" && effectiveScope === "TEAM" && !apiPayload.discount_file_path || q.kind === "DISCOUNT" && effectiveScope === "INDIVIDUAL" && !apiPayload.individual_discount_file_path) {
|
|
251
|
-
hasSkippedQuestions = true;
|
|
252
|
-
continue;
|
|
253
|
-
}
|
|
254
|
-
questionPromises.push(
|
|
255
|
-
addQuestion(apiPayload).then(() => {
|
|
256
|
-
const currentState = JSON.stringify(questionsRef.current[id]);
|
|
257
|
-
newQuestionsRef.current.delete(id);
|
|
258
|
-
setQuestions((prev) => {
|
|
259
|
-
if (!prev[id]) return prev;
|
|
260
|
-
return { ...prev, [id]: { ...prev[id], originalLabel: q.label } };
|
|
261
|
-
});
|
|
262
|
-
if (currentState === stateBeingSaved) dirtyQuestionsRef.current.delete(id);
|
|
263
|
-
if (onPolluted) onPolluted();
|
|
264
|
-
})
|
|
265
|
-
);
|
|
266
|
-
}
|
|
267
|
-
} else {
|
|
268
|
-
if (editQuestion) {
|
|
269
|
-
const apiPayload = {
|
|
270
|
-
...basePayload,
|
|
271
|
-
question: q.originalLabel || q.label,
|
|
272
|
-
new_question: q.label
|
|
273
|
-
};
|
|
274
|
-
if (!apiPayload.new_question || isChoice && apiPayload.options.length === 0 || isPayment && apiPayload.Categories.length === 0 || q.kind === "DISCOUNT" && apiPayload.applies_on.length === 0) {
|
|
275
|
-
hasSkippedQuestions = true;
|
|
276
|
-
continue;
|
|
277
|
-
}
|
|
278
|
-
questionPromises.push(
|
|
279
|
-
editQuestion(apiPayload).then(() => {
|
|
280
|
-
const currentState = JSON.stringify(questionsRef.current[id]);
|
|
281
|
-
setQuestions((prev) => {
|
|
282
|
-
if (!prev[id]) return prev;
|
|
283
|
-
return { ...prev, [id]: { ...prev[id], originalLabel: q.label } };
|
|
284
|
-
});
|
|
285
|
-
if (currentState === stateBeingSaved) dirtyQuestionsRef.current.delete(id);
|
|
286
|
-
if (onPolluted) onPolluted();
|
|
287
|
-
})
|
|
288
|
-
);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
try {
|
|
293
|
-
if (questionPromises.length > 0) await Promise.all(questionPromises);
|
|
294
|
-
if (orderDirty && !hasSkippedQuestions && updateOrder) {
|
|
295
|
-
const orderSnapshot = [...questionOrderRef.current];
|
|
296
|
-
const orderPayload = {
|
|
297
|
-
event_id: eventId,
|
|
298
|
-
questions: orderSnapshot.map((id, index) => {
|
|
299
|
-
const q = questionsRef.current[id];
|
|
300
|
-
return q ? { question: q.label, order: 900 + index } : null;
|
|
301
|
-
}).filter(Boolean)
|
|
302
|
-
};
|
|
303
|
-
await updateOrder(orderPayload).then(() => {
|
|
304
|
-
const currentOrderJSON = JSON.stringify(questionOrderRef.current);
|
|
305
|
-
const sentOrderJSON = JSON.stringify(orderSnapshot);
|
|
306
|
-
if (currentOrderJSON === sentOrderJSON) isOrderDirtyRef.current = false;
|
|
307
|
-
if (onPolluted) onPolluted();
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
if (dirtyQuestionsRef.current.size === 0 && !isOrderDirtyRef.current) {
|
|
311
|
-
setIsDirtyForUI(false);
|
|
312
|
-
}
|
|
313
|
-
} catch (e) {
|
|
314
|
-
console.error("Auto-save failed", e);
|
|
315
|
-
if (!autoSaveTimerRef.current && retryCount < 3) {
|
|
316
|
-
autoSaveTimerRef.current = setTimeout(() => {
|
|
317
|
-
saveRoutine(retryCount + 1);
|
|
318
|
-
}, 3e4);
|
|
319
|
-
setIsDirtyForUI(true);
|
|
320
|
-
} else {
|
|
321
|
-
showAlert("Failed to save changes. Please try again.", "error");
|
|
322
|
-
}
|
|
323
|
-
} finally {
|
|
324
|
-
isSavingRef.current = false;
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
useImperativeHandle(ref, () => ({
|
|
328
|
-
save: async () => {
|
|
329
|
-
if (editingQuestionId) {
|
|
330
|
-
handleCancel(editingQuestionId);
|
|
331
|
-
setShowValidationErrors(false);
|
|
332
|
-
}
|
|
333
|
-
if (!isSameQuestionTitleAllowed) {
|
|
334
|
-
const titles = /* @__PURE__ */ new Set();
|
|
335
|
-
const duplicates = /* @__PURE__ */ new Set();
|
|
336
|
-
Object.values(questions).forEach((q) => {
|
|
337
|
-
var _a;
|
|
338
|
-
const normalized = (_a = q.label) == null ? void 0 : _a.trim().toLowerCase();
|
|
339
|
-
if (!normalized) return;
|
|
340
|
-
if (titles.has(normalized)) duplicates.add(q.label);
|
|
341
|
-
titles.add(normalized);
|
|
342
|
-
});
|
|
343
|
-
if (duplicates.size > 0) {
|
|
344
|
-
const dupList = Array.from(duplicates).join(", ");
|
|
345
|
-
showAlert(`Duplicate titles: ${dupList}`, "error");
|
|
346
|
-
throw new Error(`Duplicate titles: ${dupList}`);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
return await saveRoutine();
|
|
350
|
-
},
|
|
351
|
-
validateNavigation: () => {
|
|
352
|
-
if (editingQuestionId) {
|
|
353
|
-
handleCancel(editingQuestionId);
|
|
354
|
-
setShowValidationErrors(false);
|
|
355
|
-
}
|
|
356
|
-
return true;
|
|
357
|
-
},
|
|
358
|
-
isSaving: () => isSavingRef.current || isBusy,
|
|
359
|
-
isDirty: () => isDirtyForUI
|
|
360
|
-
}));
|
|
361
|
-
useEffect(() => {
|
|
362
|
-
if (!isDirtyForUI) return;
|
|
363
|
-
const handleBeforeUnload = (e) => {
|
|
364
|
-
e.preventDefault();
|
|
365
|
-
e.returnValue = "";
|
|
366
|
-
saveRoutine();
|
|
367
|
-
};
|
|
368
|
-
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
369
|
-
return () => window.removeEventListener("beforeunload", handleBeforeUnload);
|
|
370
|
-
}, [isDirtyForUI]);
|
|
371
|
-
const updateQuestionLocal = (id, updates) => {
|
|
372
|
-
setQuestions((prev) => {
|
|
373
|
-
const current = prev[id];
|
|
374
|
-
if (!current) return prev;
|
|
375
|
-
const updated = { ...prev, [id]: { ...current, ...updates } };
|
|
376
|
-
questionsRef.current = updated;
|
|
377
|
-
if (updates.options || updates.Categories || updates.label !== void 0 || updates.file !== void 0 || updates.applies_on !== void 0) {
|
|
378
|
-
setShowValidationErrors(false);
|
|
379
|
-
}
|
|
380
|
-
if (onQuestionsChange) {
|
|
381
|
-
clearTimeout(window._notifyTimer);
|
|
382
|
-
window._notifyTimer = setTimeout(() => {
|
|
383
|
-
notifyParentOfChange(updated, questionOrderRef.current);
|
|
384
|
-
}, 500);
|
|
385
|
-
}
|
|
386
|
-
return updated;
|
|
387
|
-
});
|
|
388
|
-
dirtyQuestionsRef.current.add(id);
|
|
389
|
-
markDirty();
|
|
390
|
-
};
|
|
391
|
-
const addQuestionLocal = (question, indexToInsert) => {
|
|
392
|
-
const updatedQuestions = { ...questionsRef.current, [question.id]: question };
|
|
393
|
-
setQuestions(updatedQuestions);
|
|
394
|
-
questionsRef.current = updatedQuestions;
|
|
395
|
-
setQuestionOrder((prev) => {
|
|
396
|
-
const newOrder = [...prev];
|
|
397
|
-
newOrder.push(question.id);
|
|
398
|
-
questionOrderRef.current = newOrder;
|
|
399
|
-
notifyParentOfChange(questionsRef.current, newOrder);
|
|
400
|
-
return newOrder;
|
|
401
|
-
});
|
|
402
|
-
newQuestionsRef.current.add(question.id);
|
|
403
|
-
dirtyQuestionsRef.current.add(question.id);
|
|
404
|
-
isOrderDirtyRef.current = true;
|
|
405
|
-
markDirty();
|
|
406
|
-
};
|
|
407
|
-
const deleteQuestionLocal = async (id) => {
|
|
408
|
-
const q = questions[id];
|
|
409
|
-
if (!q) return;
|
|
410
|
-
if (["TEAM_SIZE", "NAME_ON_TICKET"].includes(q.kind)) {
|
|
411
|
-
showAlert("System questions cannot be deleted", "error");
|
|
412
|
-
return;
|
|
413
|
-
}
|
|
414
|
-
const nextQuestions = { ...questionsRef.current };
|
|
415
|
-
delete nextQuestions[id];
|
|
416
|
-
setQuestions(nextQuestions);
|
|
417
|
-
questionsRef.current = nextQuestions;
|
|
418
|
-
const nextOrder = questionOrderRef.current.filter((qid) => qid !== id);
|
|
419
|
-
setQuestionOrder(nextOrder);
|
|
420
|
-
questionOrderRef.current = nextOrder;
|
|
421
|
-
notifyParentOfChange(nextQuestions, nextOrder);
|
|
422
|
-
if (editingQuestionId === id) setEditingQuestionId(null);
|
|
423
|
-
if (newQuestionsRef.current.has(id)) {
|
|
424
|
-
dirtyQuestionsRef.current.delete(id);
|
|
425
|
-
newQuestionsRef.current.delete(id);
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
if (deleteQuestion) {
|
|
429
|
-
try {
|
|
430
|
-
await deleteQuestion({ event_id: eventId, question: q.originalLabel || q.label });
|
|
431
|
-
dirtyQuestionsRef.current.delete(id);
|
|
432
|
-
newQuestionsRef.current.delete(id);
|
|
433
|
-
if (onPolluted) onPolluted();
|
|
434
|
-
} catch (e) {
|
|
435
|
-
console.error("Delete failed", e);
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
};
|
|
439
|
-
const startEditing = (id, questionOverride) => {
|
|
440
|
-
const q = questions[id];
|
|
441
|
-
if (q) {
|
|
442
|
-
snapshotRef.current = JSON.parse(JSON.stringify(q));
|
|
443
|
-
isCurrentSessionNewRef.current = false;
|
|
444
|
-
}
|
|
445
|
-
setEditingQuestionId(id);
|
|
446
|
-
};
|
|
447
|
-
const handleCancel = (id) => {
|
|
448
|
-
if (isCurrentSessionNewRef.current) {
|
|
449
|
-
const nextQuestions = { ...questionsRef.current };
|
|
450
|
-
delete nextQuestions[id];
|
|
451
|
-
setQuestions(nextQuestions);
|
|
452
|
-
questionsRef.current = nextQuestions;
|
|
453
|
-
const nextOrder = questionOrderRef.current.filter((qid) => qid !== id);
|
|
454
|
-
setQuestionOrder(nextOrder);
|
|
455
|
-
questionOrderRef.current = nextOrder;
|
|
456
|
-
dirtyQuestionsRef.current.delete(id);
|
|
457
|
-
newQuestionsRef.current.delete(id);
|
|
458
|
-
setEditingQuestionId(null);
|
|
459
|
-
setShowValidationErrors(false);
|
|
460
|
-
return;
|
|
461
|
-
}
|
|
462
|
-
if (snapshotRef.current) {
|
|
463
|
-
setQuestions((prev) => {
|
|
464
|
-
const updated = { ...prev, [id]: { ...snapshotRef.current, file: void 0 } };
|
|
465
|
-
questionsRef.current = updated;
|
|
466
|
-
return updated;
|
|
467
|
-
});
|
|
468
|
-
}
|
|
469
|
-
dirtyQuestionsRef.current.delete(id);
|
|
470
|
-
if (dirtyQuestionsRef.current.size === 0 && !isOrderDirtyRef.current) setIsDirtyForUI(false);
|
|
471
|
-
setEditingQuestionId(null);
|
|
472
|
-
setShowValidationErrors(false);
|
|
473
|
-
};
|
|
474
|
-
const triggerSave = () => {
|
|
475
|
-
snapshotRef.current = null;
|
|
476
|
-
isCurrentSessionNewRef.current = false;
|
|
477
|
-
if (autoSaveTimerRef.current) clearTimeout(autoSaveTimerRef.current);
|
|
478
|
-
autoSaveTimerRef.current = setTimeout(() => saveRoutine(), 100);
|
|
479
|
-
};
|
|
480
|
-
const handleSetActiveQuestion = (newId) => {
|
|
481
|
-
if (newId === null) {
|
|
482
|
-
if (editingQuestionId) handleCancel(editingQuestionId);
|
|
483
|
-
return;
|
|
484
|
-
}
|
|
485
|
-
if (editingQuestionId && editingQuestionId !== newId) {
|
|
486
|
-
const current = questions[editingQuestionId];
|
|
487
|
-
if (!current) {
|
|
488
|
-
startEditing(newId);
|
|
489
|
-
setShowValidationErrors(false);
|
|
490
|
-
return;
|
|
491
|
-
}
|
|
492
|
-
if (validateQuestionError(current, questions, participationType, isSameQuestionTitleAllowed) !== null) {
|
|
493
|
-
setShowValidationErrors(true);
|
|
494
|
-
showAlert("Please complete the current question to proceed.", "error");
|
|
495
|
-
return;
|
|
496
|
-
} else {
|
|
497
|
-
triggerSave();
|
|
498
|
-
setShowValidationErrors(false);
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
startEditing(newId);
|
|
502
|
-
setShowValidationErrors(false);
|
|
503
|
-
};
|
|
504
|
-
const sensors = useSensors(
|
|
505
|
-
useSensor(PointerSensor, { activationConstraint: { distance: 3 } }),
|
|
506
|
-
useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates })
|
|
507
|
-
);
|
|
508
|
-
const handleDragStart = (event) => {
|
|
509
|
-
setActiveId(event.active.id);
|
|
510
|
-
if (editingQuestionId) setEditingQuestionId(null);
|
|
511
|
-
};
|
|
512
|
-
const handleDragEnd = (event) => {
|
|
513
|
-
const { active, over } = event;
|
|
514
|
-
setActiveId(null);
|
|
515
|
-
if (!over || active.id === over.id) return;
|
|
516
|
-
const oldIndex = questionOrder.indexOf(active.id);
|
|
517
|
-
const newIndex = questionOrder.indexOf(over.id);
|
|
518
|
-
const activeQ = questions[active.id];
|
|
519
|
-
const overQ = questions[over.id];
|
|
520
|
-
if (isTeamEvent && activeQ && overQ && activeQ.individual !== overQ.individual) return;
|
|
521
|
-
if (["TEAM_SIZE", "NAME_ON_TICKET"].includes(activeQ == null ? void 0 : activeQ.kind)) return;
|
|
522
|
-
if (oldIndex !== -1 && newIndex !== -1) {
|
|
523
|
-
const newOrder = arrayMove(questionOrder, oldIndex, newIndex);
|
|
524
|
-
setQuestionOrder(newOrder);
|
|
525
|
-
questionOrderRef.current = newOrder;
|
|
526
|
-
isOrderDirtyRef.current = true;
|
|
527
|
-
markDirty();
|
|
528
|
-
notifyParentOfChange(questions, newOrder);
|
|
529
|
-
}
|
|
530
|
-
};
|
|
531
|
-
const handleAddClick = (isIndividual = true) => {
|
|
532
|
-
if (editingQuestionId) {
|
|
533
|
-
const q = questions[editingQuestionId];
|
|
534
|
-
if (q && validateQuestionError(q, questions, participationType, isSameQuestionTitleAllowed) !== null) {
|
|
535
|
-
setShowValidationErrors(true);
|
|
536
|
-
showAlert("Please complete the current question to proceed.", "error");
|
|
537
|
-
return;
|
|
538
|
-
}
|
|
539
|
-
triggerSave();
|
|
540
|
-
setShowValidationErrors(false);
|
|
541
|
-
}
|
|
542
|
-
const newId = crypto.randomUUID();
|
|
543
|
-
let defaultScope = scope || (isTeamEvent ? "TEAM" : "INDIVIDUAL");
|
|
544
|
-
const newQuestion = {
|
|
545
|
-
id: newId,
|
|
546
|
-
kind: "INPUT_STR",
|
|
547
|
-
label: "",
|
|
548
|
-
required: false,
|
|
549
|
-
options: [],
|
|
550
|
-
individual: isIndividual,
|
|
551
|
-
scope: defaultScope
|
|
552
|
-
};
|
|
553
|
-
addQuestionLocal(newQuestion);
|
|
554
|
-
isCurrentSessionNewRef.current = true;
|
|
555
|
-
snapshotRef.current = JSON.parse(JSON.stringify(newQuestion));
|
|
556
|
-
setEditingQuestionId(newId);
|
|
557
|
-
};
|
|
558
|
-
const handleDuplicate = (id) => {
|
|
559
|
-
var _a, _b;
|
|
560
|
-
const original = questions[id];
|
|
561
|
-
if (!original) return;
|
|
562
|
-
if (["TEAM_SIZE", "NAME_ON_TICKET"].includes(original.kind)) {
|
|
563
|
-
showAlert("System questions cannot be duplicated", "error");
|
|
564
|
-
return;
|
|
565
|
-
}
|
|
566
|
-
const newId = crypto.randomUUID();
|
|
567
|
-
const baseName = (original.label || "").replace(/\s+copy\s+\(\d+\)$/i, "").trim();
|
|
568
|
-
let nextNumber = 1;
|
|
569
|
-
const labels = Object.values(questions).map((q) => {
|
|
570
|
-
var _a2;
|
|
571
|
-
return ((_a2 = q.label) == null ? void 0 : _a2.toLowerCase()) || "";
|
|
572
|
-
});
|
|
573
|
-
while (labels.includes(`${baseName} copy (${nextNumber})`.toLowerCase())) nextNumber++;
|
|
574
|
-
const newQuestion = {
|
|
575
|
-
...original,
|
|
576
|
-
id: newId,
|
|
577
|
-
label: `${baseName} copy (${nextNumber})`,
|
|
578
|
-
options: ((_a = original.options) == null ? void 0 : _a.map((o) => ({ ...o, id: crypto.randomUUID() }))) || [],
|
|
579
|
-
Categories: ((_b = original.Categories) == null ? void 0 : _b.map((c) => ({ ...c, id: crypto.randomUUID() }))) || []
|
|
580
|
-
};
|
|
581
|
-
const originalIndex = questionOrder.indexOf(id);
|
|
582
|
-
const newOrder = [...questionOrder];
|
|
583
|
-
newOrder.splice(originalIndex + 1, 0, newId);
|
|
584
|
-
setQuestions((prev) => {
|
|
585
|
-
const updated = { ...prev, [newId]: newQuestion };
|
|
586
|
-
questionsRef.current = updated;
|
|
587
|
-
return updated;
|
|
588
|
-
});
|
|
589
|
-
setQuestionOrder(newOrder);
|
|
590
|
-
questionOrderRef.current = newOrder;
|
|
591
|
-
newQuestionsRef.current.add(newId);
|
|
592
|
-
dirtyQuestionsRef.current.add(newId);
|
|
593
|
-
isOrderDirtyRef.current = true;
|
|
594
|
-
markDirty();
|
|
595
|
-
isCurrentSessionNewRef.current = true;
|
|
596
|
-
setEditingQuestionId(newId);
|
|
597
|
-
};
|
|
598
|
-
const handleManualSave = (id) => {
|
|
599
|
-
const q = questions[id];
|
|
600
|
-
if (!q) return;
|
|
601
|
-
if (validateQuestionError(q, questions, participationType, isSameQuestionTitleAllowed) !== null) {
|
|
602
|
-
setShowValidationErrors(true);
|
|
603
|
-
return;
|
|
604
|
-
}
|
|
605
|
-
triggerSave();
|
|
606
|
-
setShowValidationErrors(false);
|
|
607
|
-
setEditingQuestionId(null);
|
|
608
|
-
};
|
|
609
|
-
const activeQuestionProps = (id) => {
|
|
610
|
-
const q = questions[id];
|
|
611
|
-
const err = validateQuestionError(q, questions, participationType, isSameQuestionTitleAllowed);
|
|
612
|
-
return {
|
|
613
|
-
isDirty: dirtyQuestionsRef.current.has(id),
|
|
614
|
-
isSaving: isSavingRef.current,
|
|
615
|
-
isNew: newQuestionsRef.current.has(id),
|
|
616
|
-
isValid: err === null,
|
|
617
|
-
errorMessage: showValidationErrors ? err || void 0 : void 0
|
|
618
|
-
};
|
|
619
|
-
};
|
|
620
|
-
const handleSectionToggle = (section) => {
|
|
621
|
-
let currentIsOpen = false;
|
|
622
|
-
let setOpen = () => {
|
|
623
|
-
};
|
|
624
|
-
let qOrder = [];
|
|
625
|
-
if (section === "TEAM") {
|
|
626
|
-
currentIsOpen = isTeamOpen;
|
|
627
|
-
setOpen = setIsTeamOpen;
|
|
628
|
-
qOrder = teamQuestionsOrder;
|
|
629
|
-
} else if (section === "TEAM_MEMBER") {
|
|
630
|
-
currentIsOpen = isTeamMemberOpen;
|
|
631
|
-
setOpen = setIsTeamMemberOpen;
|
|
632
|
-
qOrder = teamMemberQuestionsOrder;
|
|
633
|
-
} else {
|
|
634
|
-
currentIsOpen = isIndividualOpen;
|
|
635
|
-
setOpen = setIsIndividualOpen;
|
|
636
|
-
qOrder = individualQuestionsOrder;
|
|
637
|
-
}
|
|
638
|
-
if (currentIsOpen && editingQuestionId && qOrder.includes(editingQuestionId)) {
|
|
639
|
-
handleSetActiveQuestion(null);
|
|
640
|
-
}
|
|
641
|
-
setOpen(!currentIsOpen);
|
|
642
|
-
};
|
|
643
|
-
if (!isLoaded && initialFields) return /* @__PURE__ */ jsx("div", { className: "p-8 text-center text-gray-500", children: "Loading Form Builder..." });
|
|
644
|
-
const isAddingNew = editingQuestionId ? newQuestionsRef.current.has(editingQuestionId) : false;
|
|
645
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 relative", children: [
|
|
646
|
-
/* @__PURE__ */ jsx(
|
|
647
|
-
Alert,
|
|
648
|
-
{
|
|
649
|
-
isVisible: alertState.isVisible,
|
|
650
|
-
message: alertState.message,
|
|
651
|
-
type: alertState.type,
|
|
652
|
-
onClose: () => setAlertState((prev) => ({ ...prev, isVisible: false }))
|
|
653
|
-
}
|
|
654
|
-
),
|
|
655
|
-
/* @__PURE__ */ jsxs(
|
|
656
|
-
DndContext,
|
|
657
|
-
{
|
|
658
|
-
sensors,
|
|
659
|
-
collisionDetection: closestCenter,
|
|
660
|
-
onDragStart: handleDragStart,
|
|
661
|
-
onDragEnd: handleDragEnd,
|
|
662
|
-
children: [
|
|
663
|
-
(scope === "TEAM" || isTeamEvent && !scope) && /* @__PURE__ */ jsxs("div", { className: "space-y-8 overflow-y-hidden", children: [
|
|
664
|
-
/* @__PURE__ */ jsxs("div", { className: "border border-gray-200 rounded-xl bg-white", children: [
|
|
665
|
-
/* @__PURE__ */ jsxs(
|
|
666
|
-
"div",
|
|
667
|
-
{
|
|
668
|
-
className: "p-4 flex items-center space-x-2 cursor-pointer transition-colors",
|
|
669
|
-
onClick: () => handleSectionToggle("TEAM"),
|
|
670
|
-
children: [
|
|
671
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: cn(
|
|
672
|
-
"w-5 h-5 text-gray-900 transition-transform duration-300",
|
|
673
|
-
isTeamOpen ? "rotate-180" : "rotate-0"
|
|
674
|
-
) }),
|
|
675
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
676
|
-
/* @__PURE__ */ jsx("h3", { className: "text-xl font-semibold text-gray-800 flex items-center gap-2", children: "Team questions" }),
|
|
677
|
-
/* @__PURE__ */ jsx(
|
|
678
|
-
Tooltip,
|
|
679
|
-
{
|
|
680
|
-
placement: "bottom",
|
|
681
|
-
content: "Questions that apply to the entire team and only need to be specified once",
|
|
682
|
-
children: /* @__PURE__ */ jsx(ForwardRef, { className: "h-5 w-5 text-gray-400" })
|
|
683
|
-
}
|
|
684
|
-
)
|
|
685
|
-
] })
|
|
686
|
-
]
|
|
687
|
-
}
|
|
688
|
-
),
|
|
689
|
-
/* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: isTeamOpen && /* @__PURE__ */ jsx(
|
|
690
|
-
motion.div,
|
|
691
|
-
{
|
|
692
|
-
initial: { height: 0, opacity: 0 },
|
|
693
|
-
animate: { height: "auto", opacity: 1 },
|
|
694
|
-
exit: { height: 0, opacity: 0 },
|
|
695
|
-
transition: { duration: 0.2 },
|
|
696
|
-
children: /* @__PURE__ */ jsx("div", { className: "p-6 pt-0", children: teamQuestionsOrder.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
697
|
-
/* @__PURE__ */ jsx(SortableContext, { items: teamQuestionsOrder, strategy: verticalListSortingStrategy, children: /* @__PURE__ */ jsx(
|
|
698
|
-
SortableQuestionList,
|
|
699
|
-
{
|
|
700
|
-
questions,
|
|
701
|
-
questionOrder: teamQuestionsOrder,
|
|
702
|
-
formId,
|
|
703
|
-
eventId,
|
|
704
|
-
userUid,
|
|
705
|
-
storageService,
|
|
706
|
-
isLocked,
|
|
707
|
-
activeQuestionId: editingQuestionId,
|
|
708
|
-
onSetActiveQuestion: handleSetActiveQuestion,
|
|
709
|
-
onDelete: deleteQuestionLocal,
|
|
710
|
-
onDuplicate: handleDuplicate,
|
|
711
|
-
onSave: handleManualSave,
|
|
712
|
-
onUpdate: updateQuestionLocal,
|
|
713
|
-
onCancel: handleCancel,
|
|
714
|
-
activeQuestionProps: editingQuestionId ? activeQuestionProps(editingQuestionId) : void 0,
|
|
715
|
-
disabled: isAddingNew,
|
|
716
|
-
scope,
|
|
717
|
-
participationType,
|
|
718
|
-
disableDiscountOption,
|
|
719
|
-
showValidationErrors
|
|
720
|
-
}
|
|
721
|
-
) }),
|
|
722
|
-
!activeId && !isLocked && /* @__PURE__ */ jsx("div", { className: "flex justify-center mt-6", children: /* @__PURE__ */ jsxs(
|
|
723
|
-
Button,
|
|
724
|
-
{
|
|
725
|
-
type: "button",
|
|
726
|
-
variant: "outline",
|
|
727
|
-
onClick: (e) => {
|
|
728
|
-
e.stopPropagation();
|
|
729
|
-
if (!isAddingNew) handleAddClick(false);
|
|
730
|
-
},
|
|
731
|
-
size: "lg",
|
|
732
|
-
className: cn("gap-x-2 px-4 py-2.5 text-sm", isAddingNew && "opacity-50 cursor-not-allowed"),
|
|
733
|
-
disabled: isAddingNew,
|
|
734
|
-
children: [
|
|
735
|
-
/* @__PURE__ */ jsx(Plus, { className: "font-bold w-5 h-5" }),
|
|
736
|
-
"Add New Question"
|
|
737
|
-
]
|
|
738
|
-
}
|
|
739
|
-
) })
|
|
740
|
-
] }) : /* @__PURE__ */ jsx(EmptyState, { onAdd: () => handleAddClick(false), isAddingNew }) })
|
|
741
|
-
}
|
|
742
|
-
) })
|
|
743
|
-
] }),
|
|
744
|
-
/* @__PURE__ */ jsxs("div", { className: "border border-gray-200 rounded-xl bg-white", children: [
|
|
745
|
-
/* @__PURE__ */ jsxs(
|
|
746
|
-
"div",
|
|
747
|
-
{
|
|
748
|
-
className: "p-4 flex items-center space-x-2 cursor-pointer transition-colors",
|
|
749
|
-
onClick: () => handleSectionToggle("TEAM_MEMBER"),
|
|
750
|
-
children: [
|
|
751
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: cn(
|
|
752
|
-
"w-5 h-5 text-gray-900 transition-transform duration-300",
|
|
753
|
-
isTeamMemberOpen ? "rotate-180" : "rotate-0"
|
|
754
|
-
) }),
|
|
755
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
756
|
-
/* @__PURE__ */ jsx("h3", { className: "text-xl font-semibold text-gray-800 flex items-center gap-2", children: "Team Member Questions" }),
|
|
757
|
-
/* @__PURE__ */ jsx(
|
|
758
|
-
Tooltip,
|
|
759
|
-
{
|
|
760
|
-
placement: "bottom",
|
|
761
|
-
content: "Questions that are specific to each individual team member and need to be asked separately for each person.",
|
|
762
|
-
children: /* @__PURE__ */ jsx(ForwardRef, { className: "h-5 w-5 text-gray-400" })
|
|
763
|
-
}
|
|
764
|
-
)
|
|
765
|
-
] })
|
|
766
|
-
]
|
|
767
|
-
}
|
|
768
|
-
),
|
|
769
|
-
/* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: isTeamMemberOpen && /* @__PURE__ */ jsx(
|
|
770
|
-
motion.div,
|
|
771
|
-
{
|
|
772
|
-
initial: { height: 0, opacity: 0 },
|
|
773
|
-
animate: { height: "auto", opacity: 1 },
|
|
774
|
-
exit: { height: 0, opacity: 0 },
|
|
775
|
-
transition: { duration: 0.2 },
|
|
776
|
-
children: /* @__PURE__ */ jsx("div", { className: "p-6 pt-0", children: teamMemberQuestionsOrder.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
777
|
-
/* @__PURE__ */ jsx(SortableContext, { items: teamMemberQuestionsOrder, strategy: verticalListSortingStrategy, children: /* @__PURE__ */ jsx(
|
|
778
|
-
SortableQuestionList,
|
|
779
|
-
{
|
|
780
|
-
questions,
|
|
781
|
-
questionOrder: teamMemberQuestionsOrder,
|
|
782
|
-
formId,
|
|
783
|
-
eventId,
|
|
784
|
-
userUid,
|
|
785
|
-
storageService,
|
|
786
|
-
isLocked,
|
|
787
|
-
activeQuestionId: editingQuestionId,
|
|
788
|
-
onSetActiveQuestion: handleSetActiveQuestion,
|
|
789
|
-
onDelete: deleteQuestionLocal,
|
|
790
|
-
onDuplicate: handleDuplicate,
|
|
791
|
-
onSave: handleManualSave,
|
|
792
|
-
onUpdate: updateQuestionLocal,
|
|
793
|
-
onCancel: handleCancel,
|
|
794
|
-
activeQuestionProps: editingQuestionId ? activeQuestionProps(editingQuestionId) : void 0,
|
|
795
|
-
disabled: isAddingNew,
|
|
796
|
-
scope,
|
|
797
|
-
participationType,
|
|
798
|
-
disableDiscountOption,
|
|
799
|
-
showValidationErrors
|
|
800
|
-
}
|
|
801
|
-
) }),
|
|
802
|
-
!activeId && !isLocked && /* @__PURE__ */ jsx("div", { className: "flex justify-center mt-6", children: /* @__PURE__ */ jsxs(
|
|
803
|
-
Button,
|
|
804
|
-
{
|
|
805
|
-
type: "button",
|
|
806
|
-
variant: "outline",
|
|
807
|
-
onClick: (e) => {
|
|
808
|
-
e.stopPropagation();
|
|
809
|
-
if (!isAddingNew) handleAddClick(true);
|
|
810
|
-
},
|
|
811
|
-
size: "lg",
|
|
812
|
-
className: cn("gap-x-2 px-4 py-2.5 text-sm", isAddingNew && "opacity-50 cursor-not-allowed"),
|
|
813
|
-
disabled: isAddingNew,
|
|
814
|
-
children: [
|
|
815
|
-
/* @__PURE__ */ jsx(Plus, { className: "font-bold w-5 h-5" }),
|
|
816
|
-
"Add New Question"
|
|
817
|
-
]
|
|
818
|
-
}
|
|
819
|
-
) })
|
|
820
|
-
] }) : /* @__PURE__ */ jsx(EmptyState, { onAdd: () => handleAddClick(true), isAddingNew }) })
|
|
821
|
-
}
|
|
822
|
-
) })
|
|
823
|
-
] })
|
|
824
|
-
] }),
|
|
825
|
-
(scope === "INDIVIDUAL" || !isTeamEvent && !scope) && /* @__PURE__ */ jsxs("div", { className: "border border-gray-200 rounded-xl bg-white overflow-y-hidden", children: [
|
|
826
|
-
/* @__PURE__ */ jsxs(
|
|
827
|
-
"div",
|
|
828
|
-
{
|
|
829
|
-
className: "p-4 flex items-center space-x-2 cursor-pointer transition-colors",
|
|
830
|
-
onClick: () => handleSectionToggle("INDIVIDUAL"),
|
|
831
|
-
children: [
|
|
832
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: cn(
|
|
833
|
-
"w-5 h-5 text-gray-900 transition-transform duration-300",
|
|
834
|
-
isIndividualOpen ? "rotate-180" : "rotate-0"
|
|
835
|
-
) }),
|
|
836
|
-
/* @__PURE__ */ jsx("h3", { className: "text-xl font-semibold text-gray-800 flex items-center gap-2", children: "Individual questions" })
|
|
837
|
-
]
|
|
838
|
-
}
|
|
839
|
-
),
|
|
840
|
-
/* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: isIndividualOpen && /* @__PURE__ */ jsx(
|
|
841
|
-
motion.div,
|
|
842
|
-
{
|
|
843
|
-
initial: { height: 0, opacity: 0 },
|
|
844
|
-
animate: { height: "auto", opacity: 1 },
|
|
845
|
-
exit: { height: 0, opacity: 0 },
|
|
846
|
-
transition: { duration: 0.2 },
|
|
847
|
-
children: /* @__PURE__ */ jsx("div", { className: "p-6 pt-0", children: individualQuestionsOrder.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
848
|
-
/* @__PURE__ */ jsx(SortableContext, { items: individualQuestionsOrder, strategy: verticalListSortingStrategy, children: /* @__PURE__ */ jsx(
|
|
849
|
-
SortableQuestionList,
|
|
850
|
-
{
|
|
851
|
-
questions,
|
|
852
|
-
questionOrder: individualQuestionsOrder,
|
|
853
|
-
formId,
|
|
854
|
-
eventId,
|
|
855
|
-
userUid,
|
|
856
|
-
storageService,
|
|
857
|
-
isLocked,
|
|
858
|
-
activeQuestionId: editingQuestionId,
|
|
859
|
-
onSetActiveQuestion: handleSetActiveQuestion,
|
|
860
|
-
onDelete: deleteQuestionLocal,
|
|
861
|
-
onDuplicate: handleDuplicate,
|
|
862
|
-
onSave: handleManualSave,
|
|
863
|
-
onUpdate: updateQuestionLocal,
|
|
864
|
-
onCancel: handleCancel,
|
|
865
|
-
activeQuestionProps: editingQuestionId ? activeQuestionProps(editingQuestionId) : void 0,
|
|
866
|
-
disabled: isAddingNew,
|
|
867
|
-
scope,
|
|
868
|
-
participationType,
|
|
869
|
-
disableDiscountOption,
|
|
870
|
-
showValidationErrors
|
|
871
|
-
}
|
|
872
|
-
) }),
|
|
873
|
-
!activeId && !isLocked && /* @__PURE__ */ jsx("div", { className: "flex justify-center mt-6", children: /* @__PURE__ */ jsxs(
|
|
874
|
-
Button,
|
|
875
|
-
{
|
|
876
|
-
type: "button",
|
|
877
|
-
onClick: () => !isAddingNew && handleAddClick(true),
|
|
878
|
-
variant: "outline",
|
|
879
|
-
size: "lg",
|
|
880
|
-
className: cn("gap-x-2 px-4 py-2.5 text-sm", isAddingNew && "opacity-50 cursor-not-allowed"),
|
|
881
|
-
disabled: isAddingNew,
|
|
882
|
-
children: [
|
|
883
|
-
/* @__PURE__ */ jsx(Plus, { className: "font-bold w-5 h-5" }),
|
|
884
|
-
"Add New Question"
|
|
885
|
-
]
|
|
886
|
-
}
|
|
887
|
-
) })
|
|
888
|
-
] }) : /* @__PURE__ */ jsx(EmptyState, { onAdd: () => handleAddClick(true), isAddingNew }) })
|
|
889
|
-
}
|
|
890
|
-
) })
|
|
891
|
-
] }),
|
|
892
|
-
/* @__PURE__ */ jsx(DragOverlay, { children: activeId && questions[activeId] ? /* @__PURE__ */ jsx("div", { className: "opacity-80 rotate-2 cursor-grabbing", children: /* @__PURE__ */ jsx(
|
|
893
|
-
QuestionCard,
|
|
894
|
-
{
|
|
895
|
-
question: questions[activeId],
|
|
896
|
-
formId,
|
|
897
|
-
eventId,
|
|
898
|
-
isLocked,
|
|
899
|
-
isOpen: false,
|
|
900
|
-
onToggle: () => {
|
|
901
|
-
},
|
|
902
|
-
onDelete: () => {
|
|
903
|
-
},
|
|
904
|
-
onUpdate: () => {
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
) }) : null })
|
|
908
|
-
]
|
|
909
|
-
}
|
|
910
|
-
)
|
|
911
|
-
] });
|
|
912
|
-
});
|
|
913
|
-
FormBuilder.displayName = "FormBuilder";
|
|
914
|
-
const FormBuilder$1 = memo(FormBuilder);
|
|
915
|
-
export {
|
|
916
|
-
FormBuilder$1 as default
|
|
917
|
-
};
|
|
918
|
-
//# sourceMappingURL=FormBuilder.js.map
|