@bigbinary/neeto-thank-you-frontend 3.1.9 → 3.1.10
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 +1 -1
- package/dist/BrandingInfo-C-YUyKe_.js +17 -0
- package/dist/BrandingInfo-C-YUyKe_.js.map +1 -0
- package/dist/ConfigureThankYou.js +4 -5
- package/dist/ConfigureThankYou.js.map +1 -1
- package/dist/ShowThankYou.js +2 -1
- package/dist/ShowThankYou.js.map +1 -1
- package/dist/SocialShare-B0luKbFP.js +93 -0
- package/dist/SocialShare-B0luKbFP.js.map +1 -0
- package/dist/SocialShare-Djluum5G.js +93 -0
- package/dist/SocialShare-Djluum5G.js.map +1 -0
- package/dist/application-DJ9yVgd0.js +5 -0
- package/dist/application-DJ9yVgd0.js.map +1 -0
- package/dist/cjs/BrandingInfo-CxPUChPj.js +19 -0
- package/dist/cjs/BrandingInfo-CxPUChPj.js.map +1 -0
- package/dist/cjs/ConfigureThankYou.js +3 -4
- package/dist/cjs/ConfigureThankYou.js.map +1 -1
- package/dist/cjs/ShowThankYou.js +2 -1
- package/dist/cjs/ShowThankYou.js.map +1 -1
- package/dist/cjs/SocialShare-BFeAkgVT.js +100 -0
- package/dist/cjs/SocialShare-BFeAkgVT.js.map +1 -0
- package/dist/cjs/SocialShare-CVIbFf_m.js +100 -0
- package/dist/cjs/SocialShare-CVIbFf_m.js.map +1 -0
- package/dist/cjs/application-S-s0L8VC.js +7 -0
- package/dist/cjs/application-S-s0L8VC.js.map +1 -0
- package/dist/cjs/index.js +9 -7
- package/dist/{SocialShare-C4rOGmnp.js → cjs/thank-you-BAOIUbgZ.js} +3 -92
- package/dist/cjs/thank-you-BAOIUbgZ.js.map +1 -0
- package/dist/cjs/thank-you-BYHzj8zD.js +7 -0
- package/dist/cjs/thank-you-BYHzj8zD.js.map +1 -0
- package/dist/cjs/v2/ConfigureThankYou.js +698 -0
- package/dist/cjs/v2/ConfigureThankYou.js.map +1 -0
- package/dist/cjs/v2/ShowThankYou.js +281 -0
- package/dist/cjs/v2/ShowThankYou.js.map +1 -0
- package/dist/cjs/v2/commons.js +10 -0
- package/dist/cjs/v2/commons.js.map +1 -0
- package/dist/cjs/v2/constants.js +12 -0
- package/dist/cjs/v2/constants.js.map +1 -0
- package/dist/cjs/v2/index.js +58 -0
- package/dist/cjs/v2/index.js.map +1 -0
- package/dist/cjs/v2/query.js +8 -0
- package/dist/cjs/v2/query.js.map +1 -0
- package/dist/cjs/v2/useCreateThankYouConfiguration.js +16 -0
- package/dist/cjs/v2/useCreateThankYouConfiguration.js.map +1 -0
- package/dist/cjs/v2/useDeleteThankYouConfiguration.js +16 -0
- package/dist/cjs/v2/useDeleteThankYouConfiguration.js.map +1 -0
- package/dist/cjs/v2/useFetchThankYouConfigurations.js +16 -0
- package/dist/cjs/v2/useFetchThankYouConfigurations.js.map +1 -0
- package/dist/cjs/v2/useShowThankYouConfiguration.js +16 -0
- package/dist/cjs/v2/useShowThankYouConfiguration.js.map +1 -0
- package/dist/cjs/v2/useShowThankYouPage.js +12 -0
- package/dist/cjs/v2/useShowThankYouPage.js.map +1 -0
- package/dist/cjs/v2/useUpdateThankYouConfiguration.js +16 -0
- package/dist/cjs/v2/useUpdateThankYouConfiguration.js.map +1 -0
- package/dist/cjs/v2/utils.js +3 -0
- package/dist/cjs/v2/utils.js.map +1 -0
- package/dist/index.js +9 -9
- package/dist/thank-you-B9agG0DC.js +5 -0
- package/dist/thank-you-B9agG0DC.js.map +1 -0
- package/dist/{cjs/SocialShare-abuXAsLb.js → thank-you-CtNe3oCq.js} +2 -101
- package/dist/thank-you-CtNe3oCq.js.map +1 -0
- package/dist/useCreateThankYouConfiguration.js +1 -1
- package/dist/useDeleteThankYouConfiguration.js +1 -1
- package/dist/useFetchThankYouConfigurations.js +1 -1
- package/dist/useShowThankYouConfiguration.js +1 -1
- package/dist/{useThankYouConfigurationApi-DSQ3IBbq.js → useThankYouConfigurationApi-CCdlqC6e.js} +2 -2
- package/dist/{useThankYouConfigurationApi-DSQ3IBbq.js.map → useThankYouConfigurationApi-CCdlqC6e.js.map} +1 -1
- package/dist/useUpdateThankYouConfiguration.js +1 -1
- package/dist/v2/ConfigureThankYou.js +677 -0
- package/dist/v2/ConfigureThankYou.js.map +1 -0
- package/dist/v2/ShowThankYou.js +279 -0
- package/dist/v2/ShowThankYou.js.map +1 -0
- package/dist/v2/commons.js +4 -0
- package/dist/v2/commons.js.map +1 -0
- package/dist/v2/constants.js +9 -0
- package/dist/v2/constants.js.map +1 -0
- package/dist/v2/index.js +45 -0
- package/dist/v2/index.js.map +1 -0
- package/dist/v2/query.js +2 -0
- package/dist/v2/query.js.map +1 -0
- package/dist/v2/useCreateThankYouConfiguration.js +10 -0
- package/dist/v2/useCreateThankYouConfiguration.js.map +1 -0
- package/dist/v2/useDeleteThankYouConfiguration.js +10 -0
- package/dist/v2/useDeleteThankYouConfiguration.js.map +1 -0
- package/dist/v2/useFetchThankYouConfigurations.js +10 -0
- package/dist/v2/useFetchThankYouConfigurations.js.map +1 -0
- package/dist/v2/useShowThankYouConfiguration.js +10 -0
- package/dist/v2/useShowThankYouConfiguration.js.map +1 -0
- package/dist/v2/useShowThankYouPage.js +6 -0
- package/dist/v2/useShowThankYouPage.js.map +1 -0
- package/dist/v2/useUpdateThankYouConfiguration.js +10 -0
- package/dist/v2/useUpdateThankYouConfiguration.js.map +1 -0
- package/dist/v2/utils.js +2 -0
- package/dist/v2/utils.js.map +1 -0
- package/package.json +34 -24
- package/dist/SocialShare-C4rOGmnp.js.map +0 -1
- package/dist/cjs/SocialShare-abuXAsLb.js.map +0 -1
|
@@ -0,0 +1,677 @@
|
|
|
1
|
+
import { isPresent, hyphenate, isNotEmpty, noop } from '@bigbinary/neeto-cist';
|
|
2
|
+
import '../thank-you-B9agG0DC.js';
|
|
3
|
+
import '../thank-you-CtNe3oCq.js';
|
|
4
|
+
import { S as SocialShare, C as CallToAction, R as REDIRECT_DELAY, F as FORM_OPTIONS, T as THANK_YOU_TEXT_ALIGNMENTS, a as THANK_YOU_KINDS } from '../SocialShare-Djluum5G.js';
|
|
5
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
6
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
7
|
+
import { useEffect, memo, useState, useRef } from 'react';
|
|
8
|
+
import { Dialog, Typography, Button, Label as Label$1, Spinner } from '@bigbinary/neeto-atoms';
|
|
9
|
+
import { Switch, Input, Form as Form$1, BlockNavigation, RadioGroup, ActionBlock } from '@bigbinary/neeto-atoms/formik';
|
|
10
|
+
import classNames from 'classnames';
|
|
11
|
+
import MobilePreviewHeader from '@bigbinary/neeto-molecules/v2/MobilePreviewHeader';
|
|
12
|
+
import { isEmpty } from 'ramda';
|
|
13
|
+
import { b as useFetchThankYouConfigurations, c as useShowThankYouConfiguration, d as useUpdateThankYouConfiguration } from '../useThankYouConfigurationApi-CCdlqC6e.js';
|
|
14
|
+
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
15
|
+
import { useFormikContext } from 'formik';
|
|
16
|
+
import FormikEditor from '@bigbinary/neeto-editor/FormikEditor';
|
|
17
|
+
import { useTranslation } from 'react-i18next';
|
|
18
|
+
import { withT } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
|
|
19
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
20
|
+
import BrowserPreview from '@bigbinary/neeto-molecules/v2/BrowserPreview';
|
|
21
|
+
import { B as BrandingInfo } from '../BrandingInfo-C-YUyKe_.js';
|
|
22
|
+
import { IS_PRO_ORGANIZATION } from './constants.js';
|
|
23
|
+
import EditorContent from '@bigbinary/neeto-editor/EditorContent';
|
|
24
|
+
import Link from '@bigbinary/neeto-icons/Link';
|
|
25
|
+
import HelpPopover from '@bigbinary/neeto-molecules/v2/HelpPopover';
|
|
26
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
27
|
+
import NeetoUIHeader from '@bigbinary/neeto-molecules/v2/Header';
|
|
28
|
+
import { t } from 'i18next';
|
|
29
|
+
import { isEditorEmpty } from '@bigbinary/neeto-editor/utils';
|
|
30
|
+
import * as yup from 'yup';
|
|
31
|
+
import '@bigbinary/neeto-commons-frontend/v2/initializers';
|
|
32
|
+
import '@tanstack/react-query';
|
|
33
|
+
import '@bigbinary/neeto-commons-frontend/react-utils';
|
|
34
|
+
import 'axios';
|
|
35
|
+
import '@bigbinary/neeto-commons-frontend/utils';
|
|
36
|
+
import '../index-CJXBMIZP.js';
|
|
37
|
+
import '../query.js';
|
|
38
|
+
import '@bigbinary/neeto-molecules/v2/MadeWith';
|
|
39
|
+
|
|
40
|
+
var ResubmissionWarningModal = withT(function (_ref) {
|
|
41
|
+
var t = _ref.t,
|
|
42
|
+
isOpen = _ref.isOpen,
|
|
43
|
+
setIsOpen = _ref.setIsOpen,
|
|
44
|
+
uniqueSubmissionLink = _ref.uniqueSubmissionLink;
|
|
45
|
+
return /*#__PURE__*/jsxs(Dialog, {
|
|
46
|
+
isOpen: isOpen,
|
|
47
|
+
onClose: function onClose() {
|
|
48
|
+
return setIsOpen(false);
|
|
49
|
+
},
|
|
50
|
+
children: [/*#__PURE__*/jsx(Dialog.Header, {
|
|
51
|
+
children: /*#__PURE__*/jsx(Dialog.Title, {
|
|
52
|
+
children: /*#__PURE__*/jsxs(Typography, {
|
|
53
|
+
variant: "h3",
|
|
54
|
+
weight: "semibold",
|
|
55
|
+
children: [t("neetoThankYou.common.alert"), "!"]
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
}), /*#__PURE__*/jsx(Dialog.Body, {
|
|
59
|
+
children: t("neetoThankYou.thankYou.resubmissionWarning")
|
|
60
|
+
}), /*#__PURE__*/jsxs(Dialog.Footer, {
|
|
61
|
+
className: "space-x-2",
|
|
62
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
63
|
+
label: t("neetoThankYou.common.ok"),
|
|
64
|
+
variant: "outline",
|
|
65
|
+
onClick: function onClick() {
|
|
66
|
+
return setIsOpen(false);
|
|
67
|
+
}
|
|
68
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
69
|
+
label: t("neetoThankYou.thankYou.uniqueSubmissionLinkText"),
|
|
70
|
+
to: uniqueSubmissionLink
|
|
71
|
+
})]
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
var EXTERNAL_URL_PREFIX = "https://";
|
|
77
|
+
var DEFAULT_EDITOR_ADDONS = ["emoji"];
|
|
78
|
+
|
|
79
|
+
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
80
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
81
|
+
var Customize = function Customize(_ref) {
|
|
82
|
+
var editorRef = _ref.editorRef,
|
|
83
|
+
editorProps = _ref.editorProps,
|
|
84
|
+
customMessage = _ref.customMessage,
|
|
85
|
+
hasImageUploader = _ref.hasImageUploader,
|
|
86
|
+
disableSocialShare = _ref.disableSocialShare,
|
|
87
|
+
disableSubmitAnotherResponse = _ref.disableSubmitAnotherResponse,
|
|
88
|
+
uniqueSubmissionEnabled = _ref.uniqueSubmissionEnabled,
|
|
89
|
+
uniqueSubmissionLink = _ref.uniqueSubmissionLink,
|
|
90
|
+
isUniqueSubmissionWarningModalOpen = _ref.isUniqueSubmissionWarningModalOpen,
|
|
91
|
+
setIsUniqueSubmissionWarningModalOpen = _ref.setIsUniqueSubmissionWarningModalOpen;
|
|
92
|
+
var _useTranslation = useTranslation(),
|
|
93
|
+
t = _useTranslation.t;
|
|
94
|
+
var _useFormikContext = useFormikContext(),
|
|
95
|
+
values = _useFormikContext.values,
|
|
96
|
+
setFieldValue = _useFormikContext.setFieldValue;
|
|
97
|
+
var editorAddons = [].concat(_toConsumableArray(DEFAULT_EDITOR_ADDONS), _toConsumableArray(hasImageUploader ? ["image-upload"] : []));
|
|
98
|
+
useEffect(function () {
|
|
99
|
+
var _editorRef$current$ed;
|
|
100
|
+
setFieldValue("message", customMessage);
|
|
101
|
+
(_editorRef$current$ed = editorRef.current.editor) === null || _editorRef$current$ed === void 0 || _editorRef$current$ed.commands.setContent(customMessage);
|
|
102
|
+
}, [customMessage]);
|
|
103
|
+
var handleResubmitLinkChange = function handleResubmitLinkChange(checked) {
|
|
104
|
+
if (!uniqueSubmissionEnabled) return;
|
|
105
|
+
|
|
106
|
+
// atoms' formik Switch commits the new value before invoking this
|
|
107
|
+
// callback, so revert it to keep v1's behaviour of leaving the toggle
|
|
108
|
+
// untouched while the resubmission warning is shown.
|
|
109
|
+
setFieldValue("showResubmitLink", !checked);
|
|
110
|
+
setIsUniqueSubmissionWarningModalOpen(true);
|
|
111
|
+
};
|
|
112
|
+
return /*#__PURE__*/jsxs("div", {
|
|
113
|
+
className: "flex flex-col gap-4",
|
|
114
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
115
|
+
className: "flex flex-col gap-2",
|
|
116
|
+
children: /*#__PURE__*/jsx(FormikEditor, _objectSpread$6({
|
|
117
|
+
required: true,
|
|
118
|
+
addons: editorAddons,
|
|
119
|
+
"data-testid": "thank-you-message-editor",
|
|
120
|
+
label: t("neetoThankYou.thankYou.messageLabel"),
|
|
121
|
+
name: "message",
|
|
122
|
+
ref: editorRef
|
|
123
|
+
}, editorProps))
|
|
124
|
+
}), !disableSocialShare && /*#__PURE__*/jsx(Switch, {
|
|
125
|
+
label: t("neetoThankYou.thankYou.socialShareIcons"),
|
|
126
|
+
name: "socialSharingEnabled"
|
|
127
|
+
}), !disableSubmitAnotherResponse && /*#__PURE__*/jsxs(Fragment, {
|
|
128
|
+
children: [/*#__PURE__*/jsx(Switch, {
|
|
129
|
+
label: t("neetoThankYou.thankYou.showResubmitLink"),
|
|
130
|
+
name: "showResubmitLink",
|
|
131
|
+
onCheckedChange: handleResubmitLinkChange
|
|
132
|
+
}), values.showResubmitLink && /*#__PURE__*/jsx(Input, {
|
|
133
|
+
required: true,
|
|
134
|
+
label: t("neetoThankYou.thankYou.resubmitLinkText"),
|
|
135
|
+
name: "resubmitLinkText"
|
|
136
|
+
})]
|
|
137
|
+
}), /*#__PURE__*/jsx(ResubmissionWarningModal, {
|
|
138
|
+
uniqueSubmissionLink: uniqueSubmissionLink,
|
|
139
|
+
isOpen: isUniqueSubmissionWarningModalOpen,
|
|
140
|
+
setIsOpen: setIsUniqueSubmissionWarningModalOpen
|
|
141
|
+
})]
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
146
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
147
|
+
var MemoizedEditorContent$1 = /*#__PURE__*/memo(EditorContent);
|
|
148
|
+
var CustomMessage = function CustomMessage(_ref) {
|
|
149
|
+
var _values$resubmitLinkT;
|
|
150
|
+
var resubmitLink = _ref.resubmitLink,
|
|
151
|
+
publicLinkId = _ref.publicLinkId,
|
|
152
|
+
socialHandles = _ref.socialHandles,
|
|
153
|
+
editorProps = _ref.editorProps,
|
|
154
|
+
appName = _ref.appName,
|
|
155
|
+
_ref$ctaProps = _ref.ctaProps,
|
|
156
|
+
ctaProps = _ref$ctaProps === void 0 ? {} : _ref$ctaProps;
|
|
157
|
+
var _useTranslation = useTranslation(),
|
|
158
|
+
t = _useTranslation.t;
|
|
159
|
+
var _useFormikContext = useFormikContext(),
|
|
160
|
+
values = _useFormikContext.values;
|
|
161
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
162
|
+
children: [(values === null || values === void 0 ? void 0 : values.message) && /*#__PURE__*/jsx("div", {
|
|
163
|
+
className: "neeto-thank-you-configuration__description text-foreground",
|
|
164
|
+
children: /*#__PURE__*/jsx(MemoizedEditorContent$1, _objectSpread$5({
|
|
165
|
+
content: values.message,
|
|
166
|
+
"data-testid": "preview-editor-content"
|
|
167
|
+
}, editorProps))
|
|
168
|
+
}), (values === null || values === void 0 ? void 0 : values.showResubmitLink) && /*#__PURE__*/jsx("a", {
|
|
169
|
+
className: "neeto-thank-you-configuration__resubmit",
|
|
170
|
+
"data-testid": "preview-resubmit-link",
|
|
171
|
+
href: resubmitLink,
|
|
172
|
+
children: (_values$resubmitLinkT = values === null || values === void 0 ? void 0 : values.resubmitLinkText) !== null && _values$resubmitLinkT !== void 0 ? _values$resubmitLinkT : t("neetoThankYou.thankYou.resubmit")
|
|
173
|
+
}), (values === null || values === void 0 ? void 0 : values.socialSharingEnabled) && /*#__PURE__*/jsx(SocialShare, {
|
|
174
|
+
publicLinkId: publicLinkId,
|
|
175
|
+
socialHandles: socialHandles
|
|
176
|
+
}), isPresent(ctaProps) && /*#__PURE__*/jsx(CallToAction, _objectSpread$5({}, _objectSpread$5({
|
|
177
|
+
appName: appName
|
|
178
|
+
}, ctaProps)))]
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
183
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
184
|
+
var MemoizedEditorContent = /*#__PURE__*/memo(EditorContent);
|
|
185
|
+
var RedirectMessage = function RedirectMessage(_ref) {
|
|
186
|
+
var editorProps = _ref.editorProps,
|
|
187
|
+
appName = _ref.appName,
|
|
188
|
+
_ref$ctaProps = _ref.ctaProps,
|
|
189
|
+
ctaProps = _ref$ctaProps === void 0 ? {} : _ref$ctaProps;
|
|
190
|
+
var _useTranslation = useTranslation(),
|
|
191
|
+
t = _useTranslation.t;
|
|
192
|
+
var _useFormikContext = useFormikContext(),
|
|
193
|
+
values = _useFormikContext.values;
|
|
194
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
195
|
+
children: [(values === null || values === void 0 ? void 0 : values.redirectMessage) && /*#__PURE__*/jsx("div", {
|
|
196
|
+
className: "neeto-thank-you-configuration__description mt-6",
|
|
197
|
+
children: /*#__PURE__*/jsx(MemoizedEditorContent, _objectSpread$4({
|
|
198
|
+
content: values.redirectMessage,
|
|
199
|
+
"data-testid": "preview-editor-content"
|
|
200
|
+
}, editorProps))
|
|
201
|
+
}), /*#__PURE__*/jsx("p", {
|
|
202
|
+
className: "neeto-thank-you-configuration__redirect-message text-foreground",
|
|
203
|
+
children: t("neetoThankYou.thankYou.redirectingInSecondsMessage", {
|
|
204
|
+
seconds: REDIRECT_DELAY
|
|
205
|
+
})
|
|
206
|
+
}), isPresent(ctaProps) && /*#__PURE__*/jsx(CallToAction, _objectSpread$4({}, _objectSpread$4({
|
|
207
|
+
appName: appName
|
|
208
|
+
}, ctaProps)))]
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
213
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
214
|
+
var Preview = function Preview(_ref) {
|
|
215
|
+
var socialHandles = _ref.socialHandles,
|
|
216
|
+
thankYouTextAlignment = _ref.thankYouTextAlignment,
|
|
217
|
+
resubmitLink = _ref.resubmitLink,
|
|
218
|
+
publicLinkId = _ref.publicLinkId,
|
|
219
|
+
appName = _ref.appName,
|
|
220
|
+
appIcon = _ref.appIcon,
|
|
221
|
+
ctaProps = _ref.ctaProps,
|
|
222
|
+
editorProps = _ref.editorProps;
|
|
223
|
+
var _useTranslation = useTranslation(),
|
|
224
|
+
t = _useTranslation.t;
|
|
225
|
+
var _useFormikContext = useFormikContext(),
|
|
226
|
+
values = _useFormikContext.values;
|
|
227
|
+
var isCtaVisible = !IS_PRO_ORGANIZATION && (values === null || values === void 0 ? void 0 : values.brandingEnabled);
|
|
228
|
+
return /*#__PURE__*/jsxs("div", {
|
|
229
|
+
className: "neeto-thank-you-configuration-preview__wrapper",
|
|
230
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
231
|
+
className: "mb-3 block leading-normal md:hidden",
|
|
232
|
+
variant: "h3",
|
|
233
|
+
weight: "semibold",
|
|
234
|
+
children: t("neetoThankYou.thankYou.preview")
|
|
235
|
+
}), /*#__PURE__*/jsxs(BrowserPreview, {
|
|
236
|
+
className: classNames({
|
|
237
|
+
"neeto-thank-you-configuration-alignment--left": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.left,
|
|
238
|
+
"neeto-thank-you-configuration-alignment--center": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.center
|
|
239
|
+
}),
|
|
240
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
241
|
+
className: "neeto-thank-you-configuration",
|
|
242
|
+
children: /*#__PURE__*/jsx("main", {
|
|
243
|
+
className: "neeto-thank-you-configuration__main",
|
|
244
|
+
"data-testid": "neeto-thankyou-preview-main",
|
|
245
|
+
children: /*#__PURE__*/jsx("div", {
|
|
246
|
+
className: classNames("neeto-thank-you-configuration__box", {
|
|
247
|
+
"neeto-thank-you-configuration__box--is-cta-visible": isCtaVisible
|
|
248
|
+
}),
|
|
249
|
+
children: values.kind === FORM_OPTIONS.customize.kind ? /*#__PURE__*/jsx(CustomMessage, _objectSpread$3({}, _objectSpread$3({
|
|
250
|
+
appName: appName,
|
|
251
|
+
editorProps: editorProps,
|
|
252
|
+
publicLinkId: publicLinkId,
|
|
253
|
+
resubmitLink: resubmitLink,
|
|
254
|
+
socialHandles: socialHandles
|
|
255
|
+
}, isCtaVisible && {
|
|
256
|
+
ctaProps: ctaProps
|
|
257
|
+
}))) : /*#__PURE__*/jsx(RedirectMessage, _objectSpread$3({}, _objectSpread$3({
|
|
258
|
+
appName: appName,
|
|
259
|
+
editorProps: editorProps
|
|
260
|
+
}, isCtaVisible && {
|
|
261
|
+
ctaProps: ctaProps
|
|
262
|
+
})))
|
|
263
|
+
})
|
|
264
|
+
})
|
|
265
|
+
}), !IS_PRO_ORGANIZATION && (values === null || values === void 0 ? void 0 : values.brandingEnabled) && /*#__PURE__*/jsx(BrandingInfo, {
|
|
266
|
+
appIcon: appIcon,
|
|
267
|
+
appName: appName
|
|
268
|
+
})]
|
|
269
|
+
})]
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
var _excluded = ["name", "title", "className"];
|
|
274
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
275
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
276
|
+
var SwitchBlock = function SwitchBlock(_ref) {
|
|
277
|
+
var name = _ref.name,
|
|
278
|
+
title = _ref.title,
|
|
279
|
+
_ref$className = _ref.className,
|
|
280
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
281
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
282
|
+
return /*#__PURE__*/jsx(Label$1, {
|
|
283
|
+
className: classNames("flex items-center justify-start gap-2", className),
|
|
284
|
+
"data-testid": "neeto-thank-you-nano-".concat(hyphenate(title && name), "-toggle-label"),
|
|
285
|
+
children: /*#__PURE__*/jsx(Switch, _objectSpread$2(_objectSpread$2({}, _objectSpread$2(_objectSpread$2({}, otherProps), {}, {
|
|
286
|
+
name: name
|
|
287
|
+
})), {}, {
|
|
288
|
+
"data-testid": "neeto-thank-you-nano-".concat(hyphenate(title && name), "-switch"),
|
|
289
|
+
label: title
|
|
290
|
+
}))
|
|
291
|
+
});
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
295
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
296
|
+
var ExternalLink = function ExternalLink(_ref) {
|
|
297
|
+
var editorProps = _ref.editorProps,
|
|
298
|
+
isPassEventDetailsEnabled = _ref.isPassEventDetailsEnabled,
|
|
299
|
+
eventDetailsSwitchLabel = _ref.eventDetailsSwitchLabel,
|
|
300
|
+
passEventDetailsHelpDocUrl = _ref.passEventDetailsHelpDocUrl;
|
|
301
|
+
var _useTranslation = useTranslation(),
|
|
302
|
+
t = _useTranslation.t;
|
|
303
|
+
var passEventDetailsSwitchLabel = isNotEmpty(eventDetailsSwitchLabel) ? eventDetailsSwitchLabel : t("neetoThankYou.thankYou.passEventDetails");
|
|
304
|
+
var _useFormikContext = useFormikContext(),
|
|
305
|
+
showRedirectMessage = _useFormikContext.values.showRedirectMessage;
|
|
306
|
+
return /*#__PURE__*/jsxs("div", {
|
|
307
|
+
className: "flex flex-col gap-4",
|
|
308
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
309
|
+
autoFocus: true,
|
|
310
|
+
required: true,
|
|
311
|
+
className: "grow-0",
|
|
312
|
+
label: t("neetoThankYou.thankYou.link"),
|
|
313
|
+
name: "redirectUrl",
|
|
314
|
+
placeholder: EXTERNAL_URL_PREFIX,
|
|
315
|
+
prefix: /*#__PURE__*/jsx(Link, {})
|
|
316
|
+
}), isPassEventDetailsEnabled && /*#__PURE__*/jsxs("div", {
|
|
317
|
+
className: "flex space-x-2",
|
|
318
|
+
children: [/*#__PURE__*/jsx(Switch, {
|
|
319
|
+
label: passEventDetailsSwitchLabel,
|
|
320
|
+
name: "passEventDetailsToRedirectUrl"
|
|
321
|
+
}), passEventDetailsHelpDocUrl && /*#__PURE__*/jsx(HelpPopover, {
|
|
322
|
+
className: "shrink-0",
|
|
323
|
+
helpLinkProps: {
|
|
324
|
+
href: passEventDetailsHelpDocUrl
|
|
325
|
+
},
|
|
326
|
+
title: passEventDetailsSwitchLabel
|
|
327
|
+
})]
|
|
328
|
+
}), /*#__PURE__*/jsx(SwitchBlock, {
|
|
329
|
+
name: "showRedirectMessage",
|
|
330
|
+
title: t("neetoThankYou.thankYou.showMessageWhileRedirecting")
|
|
331
|
+
}), showRedirectMessage && /*#__PURE__*/jsx("div", {
|
|
332
|
+
className: "flex flex-col gap-2",
|
|
333
|
+
children: /*#__PURE__*/jsx(FormikEditor, _objectSpread$1({
|
|
334
|
+
required: true,
|
|
335
|
+
addons: DEFAULT_EDITOR_ADDONS,
|
|
336
|
+
"data-testid": "neeto-thank-you-redirect-message-editor",
|
|
337
|
+
label: t("neetoThankYou.thankYou.messageLabel"),
|
|
338
|
+
name: "redirectMessage"
|
|
339
|
+
}, editorProps))
|
|
340
|
+
})]
|
|
341
|
+
});
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
var Header = withT(function (_ref) {
|
|
345
|
+
var t = _ref.t,
|
|
346
|
+
breadcrumbs = _ref.breadcrumbs,
|
|
347
|
+
helpPopoverProps = _ref.helpPopoverProps;
|
|
348
|
+
return /*#__PURE__*/jsx("div", {
|
|
349
|
+
className: "w-full",
|
|
350
|
+
children: /*#__PURE__*/jsx(NeetoUIHeader, {
|
|
351
|
+
breadcrumbs: breadcrumbs,
|
|
352
|
+
size: "small",
|
|
353
|
+
title: t("neetoThankYou.common.thankYouPage"),
|
|
354
|
+
titleHelpPopoverProps: helpPopoverProps
|
|
355
|
+
})
|
|
356
|
+
});
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
var Label = function Label(_ref) {
|
|
360
|
+
var label = _ref.label,
|
|
361
|
+
description = _ref.description,
|
|
362
|
+
kind = _ref.kind;
|
|
363
|
+
return /*#__PURE__*/jsxs(Typography, {
|
|
364
|
+
"data-testid": "neeto-thank-you-configuration-".concat(hyphenate(kind), "-label"),
|
|
365
|
+
variant: "body2",
|
|
366
|
+
weight: "semibold",
|
|
367
|
+
children: [label, /*#__PURE__*/jsx("span", {
|
|
368
|
+
className: "block text-xs font-normal leading-snug",
|
|
369
|
+
"data-testid": "neeto-thank-you-configuration-".concat(hyphenate(kind), "-description"),
|
|
370
|
+
children: description
|
|
371
|
+
})]
|
|
372
|
+
});
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
var buildValidationSchema = function buildValidationSchema() {
|
|
376
|
+
var allowEmptyCustomMessage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
377
|
+
return yup.object().shape({
|
|
378
|
+
kind: yup.string().required(),
|
|
379
|
+
message: yup.string().when("kind", {
|
|
380
|
+
is: FORM_OPTIONS.customize.kind,
|
|
381
|
+
then: yup.string().test("message", t("neetoThankYou.thankYou.validations.messageRequired"), function (value) {
|
|
382
|
+
return allowEmptyCustomMessage || !isEditorEmpty(value);
|
|
383
|
+
})
|
|
384
|
+
}),
|
|
385
|
+
socialSharingEnabled: yup.bool(),
|
|
386
|
+
showResubmitLink: yup.bool(),
|
|
387
|
+
resubmitLinkText: yup.string().when("showResubmitLink", {
|
|
388
|
+
is: true,
|
|
389
|
+
then: yup.string().required(t("neetoThankYou.thankYou.validations.resubmitLinkTextIsRequired"))
|
|
390
|
+
}),
|
|
391
|
+
redirectUrl: yup.string().when("kind", {
|
|
392
|
+
is: FORM_OPTIONS.externalLink.kind,
|
|
393
|
+
then: yup.string().url(t("neetoThankYou.thankYou.validations.invalidLink")).required(t("neetoThankYou.thankYou.validations.invalidLink")).when("kind", {
|
|
394
|
+
is: FORM_OPTIONS.customize.kind,
|
|
395
|
+
then: yup.string()
|
|
396
|
+
})
|
|
397
|
+
}),
|
|
398
|
+
redirectMessage: yup.string().when(["kind", "showRedirectMessage"], {
|
|
399
|
+
is: function is(kind, showRedirectMessage) {
|
|
400
|
+
return kind === FORM_OPTIONS.externalLink.kind && showRedirectMessage;
|
|
401
|
+
},
|
|
402
|
+
then: yup.string().test("redirectMessage", t("neetoThankYou.thankYou.validations.redirectMessageRequired"), function (value) {
|
|
403
|
+
return !isEditorEmpty(value);
|
|
404
|
+
})
|
|
405
|
+
})
|
|
406
|
+
});
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
410
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
411
|
+
var Form = function Form(_ref) {
|
|
412
|
+
var id = _ref.id,
|
|
413
|
+
socialHandles = _ref.socialHandles,
|
|
414
|
+
entityId = _ref.entityId,
|
|
415
|
+
publicLinkId = _ref.publicLinkId,
|
|
416
|
+
hasImageUploader = _ref.hasImageUploader,
|
|
417
|
+
uniqueSubmissionEnabled = _ref.uniqueSubmissionEnabled,
|
|
418
|
+
uniqueSubmissionLink = _ref.uniqueSubmissionLink,
|
|
419
|
+
redirectToOnCancel = _ref.redirectToOnCancel,
|
|
420
|
+
thankYouTextAlignment = _ref.thankYouTextAlignment,
|
|
421
|
+
resubmitLink = _ref.resubmitLink,
|
|
422
|
+
isPublished = _ref.isPublished,
|
|
423
|
+
disableSubmitAnotherResponse = _ref.disableSubmitAnotherResponse,
|
|
424
|
+
disableRadioSelection = _ref.disableRadioSelection,
|
|
425
|
+
appName = _ref.appName,
|
|
426
|
+
appIcon = _ref.appIcon,
|
|
427
|
+
blockNavigation = _ref.blockNavigation,
|
|
428
|
+
onConfigUpdateSuccess = _ref.onConfigUpdateSuccess,
|
|
429
|
+
editorProps = _ref.editorProps,
|
|
430
|
+
CustomPreview = _ref.preview,
|
|
431
|
+
allowEmptyCustomMessage = _ref.allowEmptyCustomMessage,
|
|
432
|
+
isPassEventDetailsEnabled = _ref.isPassEventDetailsEnabled,
|
|
433
|
+
passEventDetailsHelpDocUrl = _ref.passEventDetailsHelpDocUrl,
|
|
434
|
+
customHeader = _ref.customHeader,
|
|
435
|
+
breadcrumbs = _ref.breadcrumbs,
|
|
436
|
+
eventDetailsSwitchLabel = _ref.eventDetailsSwitchLabel,
|
|
437
|
+
helpPopoverProps = _ref.helpPopoverProps,
|
|
438
|
+
ctaProps = _ref.ctaProps;
|
|
439
|
+
var _useState = useState(false),
|
|
440
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
441
|
+
isUniqueSubmissionWarningModalOpen = _useState2[0],
|
|
442
|
+
setIsUniqueSubmissionWarningModalOpen = _useState2[1];
|
|
443
|
+
var _useFetchThankYouConf = useFetchThankYouConfigurations(entityId),
|
|
444
|
+
_useFetchThankYouConf2 = _useFetchThankYouConf.data,
|
|
445
|
+
_useFetchThankYouConf3 = _useFetchThankYouConf2 === void 0 ? {} : _useFetchThankYouConf2,
|
|
446
|
+
_useFetchThankYouConf4 = _useFetchThankYouConf3.defaultMessage,
|
|
447
|
+
defaultMessage = _useFetchThankYouConf4 === void 0 ? "" : _useFetchThankYouConf4,
|
|
448
|
+
_useFetchThankYouConf5 = _useFetchThankYouConf3.primaryConfigurationId,
|
|
449
|
+
primaryConfigurationId = _useFetchThankYouConf5 === void 0 ? "" : _useFetchThankYouConf5,
|
|
450
|
+
isLoadingConfigurations = _useFetchThankYouConf.isLoading;
|
|
451
|
+
var configurationId = id !== null && id !== void 0 ? id : primaryConfigurationId;
|
|
452
|
+
var _useShowThankYouConfi = useShowThankYouConfiguration({
|
|
453
|
+
entityId: entityId,
|
|
454
|
+
id: configurationId,
|
|
455
|
+
enabled: isPresent(configurationId)
|
|
456
|
+
}),
|
|
457
|
+
_useShowThankYouConfi2 = _useShowThankYouConfi.data,
|
|
458
|
+
_useShowThankYouConfi3 = _useShowThankYouConfi2 === void 0 ? {} : _useShowThankYouConfi2,
|
|
459
|
+
thankYouConfiguration = _useShowThankYouConfi3.thankYouConfiguration,
|
|
460
|
+
isLoadingConfiguration = _useShowThankYouConfi.isLoading;
|
|
461
|
+
var _useUpdateThankYouCon = useUpdateThankYouConfiguration(configurationId),
|
|
462
|
+
updateThankYouConfiguration = _useUpdateThankYouCon.mutate,
|
|
463
|
+
isUpdatingForm = _useUpdateThankYouCon.isPending;
|
|
464
|
+
var editorRef = useRef({
|
|
465
|
+
editor: {}
|
|
466
|
+
});
|
|
467
|
+
var shouldBlockNavigation = blockNavigation && !isUpdatingForm && !isUniqueSubmissionWarningModalOpen;
|
|
468
|
+
var handleSubmit = function handleSubmit(values) {
|
|
469
|
+
var showResubmitLink = values.showResubmitLink,
|
|
470
|
+
kind = values.kind;
|
|
471
|
+
if (uniqueSubmissionEnabled && kind === THANK_YOU_KINDS.CUSTOM_MESSAGE && showResubmitLink) {
|
|
472
|
+
setIsUniqueSubmissionWarningModalOpen(true);
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
updateThankYouConfiguration({
|
|
476
|
+
entityId: entityId,
|
|
477
|
+
payload: values
|
|
478
|
+
}, {
|
|
479
|
+
onSuccess: function onSuccess() {
|
|
480
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
481
|
+
args[_key] = arguments[_key];
|
|
482
|
+
}
|
|
483
|
+
return onConfigUpdateSuccess(args, thankYouConfiguration);
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
};
|
|
487
|
+
var customMessage = allowEmptyCustomMessage ? thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.message : (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.message) || defaultMessage;
|
|
488
|
+
var resetEditor = function resetEditor() {
|
|
489
|
+
var _editorRef$current$ed;
|
|
490
|
+
return (_editorRef$current$ed = editorRef.current.editor) === null || _editorRef$current$ed === void 0 ? void 0 : _editorRef$current$ed.commands.setContent(customMessage);
|
|
491
|
+
};
|
|
492
|
+
var shouldShowPreview = function shouldShowPreview(_ref2) {
|
|
493
|
+
var kind = _ref2.kind,
|
|
494
|
+
showRedirectMessage = _ref2.showRedirectMessage;
|
|
495
|
+
return kind === FORM_OPTIONS.customize.kind || showRedirectMessage;
|
|
496
|
+
};
|
|
497
|
+
if (isLoadingConfigurations || isLoadingConfiguration) {
|
|
498
|
+
return /*#__PURE__*/jsx("div", {
|
|
499
|
+
className: "flex h-full w-full items-center justify-center",
|
|
500
|
+
children: /*#__PURE__*/jsx(Spinner, {})
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
return /*#__PURE__*/jsx(Form$1, {
|
|
504
|
+
className: "h-full w-full",
|
|
505
|
+
formikProps: {
|
|
506
|
+
enableReinitialize: true,
|
|
507
|
+
initialValues: thankYouConfiguration || {},
|
|
508
|
+
validationSchema: buildValidationSchema(allowEmptyCustomMessage),
|
|
509
|
+
onSubmit: handleSubmit
|
|
510
|
+
},
|
|
511
|
+
children: function children(_ref3) {
|
|
512
|
+
var values = _ref3.values;
|
|
513
|
+
return /*#__PURE__*/jsxs("div", {
|
|
514
|
+
className: "neeto-thankyou-nano-wrapper flex h-full flex-col overflow-y-auto lg:flex-row",
|
|
515
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
516
|
+
className: "neeto-thankyou-nano__left-panel flex w-full flex-col px-5 md:px-10 lg:h-full lg:w-1/2 lg:overflow-y-auto",
|
|
517
|
+
"data-testid": "neeto-thankyou-left-panel",
|
|
518
|
+
children: [customHeader || /*#__PURE__*/jsx(Header, {
|
|
519
|
+
breadcrumbs: breadcrumbs,
|
|
520
|
+
helpPopoverProps: helpPopoverProps
|
|
521
|
+
}), shouldBlockNavigation && /*#__PURE__*/jsx(BlockNavigation, {}), !disableRadioSelection && /*#__PURE__*/jsx("div", {
|
|
522
|
+
className: "mb-6 w-full",
|
|
523
|
+
children: /*#__PURE__*/jsx(RadioGroup, {
|
|
524
|
+
className: "w-full grid-cols-1 items-stretch sm:grid-cols-2",
|
|
525
|
+
name: "kind",
|
|
526
|
+
orientation: "vertical",
|
|
527
|
+
children: Object.values(FORM_OPTIONS).map(function (option) {
|
|
528
|
+
return /*#__PURE__*/jsx(RadioGroup.Item, {
|
|
529
|
+
label: /*#__PURE__*/jsx(Label, _objectSpread({}, option)),
|
|
530
|
+
value: option.kind,
|
|
531
|
+
className: classNames("neeto-thank-you-configuration-radio__item", {
|
|
532
|
+
active: values.kind === option.kind
|
|
533
|
+
})
|
|
534
|
+
}, option.kind);
|
|
535
|
+
})
|
|
536
|
+
})
|
|
537
|
+
}), values.kind === FORM_OPTIONS.customize.kind ? /*#__PURE__*/jsx(Customize, {
|
|
538
|
+
customMessage: customMessage,
|
|
539
|
+
disableSubmitAnotherResponse: disableSubmitAnotherResponse,
|
|
540
|
+
editorProps: editorProps,
|
|
541
|
+
editorRef: editorRef,
|
|
542
|
+
hasImageUploader: hasImageUploader,
|
|
543
|
+
isUniqueSubmissionWarningModalOpen: isUniqueSubmissionWarningModalOpen,
|
|
544
|
+
setIsUniqueSubmissionWarningModalOpen: setIsUniqueSubmissionWarningModalOpen,
|
|
545
|
+
uniqueSubmissionEnabled: uniqueSubmissionEnabled,
|
|
546
|
+
uniqueSubmissionLink: uniqueSubmissionLink,
|
|
547
|
+
disableSocialShare: isEmpty(socialHandles)
|
|
548
|
+
}) : /*#__PURE__*/jsx(ExternalLink, {
|
|
549
|
+
editorProps: editorProps,
|
|
550
|
+
eventDetailsSwitchLabel: eventDetailsSwitchLabel,
|
|
551
|
+
isPassEventDetailsEnabled: isPassEventDetailsEnabled,
|
|
552
|
+
passEventDetailsHelpDocUrl: passEventDetailsHelpDocUrl
|
|
553
|
+
}), /*#__PURE__*/jsx(ActionBlock, {
|
|
554
|
+
className: "bg-background sticky bottom-0 py-5",
|
|
555
|
+
isSubmitting: isUpdatingForm,
|
|
556
|
+
cancelButtonProps: _objectSpread({
|
|
557
|
+
"data-testid": "neeto-thank-you-configuration-cancel-button"
|
|
558
|
+
}, redirectToOnCancel ? {
|
|
559
|
+
to: redirectToOnCancel,
|
|
560
|
+
onClick: noop
|
|
561
|
+
} : {
|
|
562
|
+
type: "reset",
|
|
563
|
+
onClick: resetEditor
|
|
564
|
+
}),
|
|
565
|
+
submitButtonProps: {
|
|
566
|
+
"data-testid": "neeto-thank-you-configuration-save-button"
|
|
567
|
+
}
|
|
568
|
+
})]
|
|
569
|
+
}), shouldShowPreview(values) && (CustomPreview ? /*#__PURE__*/jsxs(Fragment, {
|
|
570
|
+
children: [/*#__PURE__*/jsx(MobilePreviewHeader, {
|
|
571
|
+
className: "block lg:hidden"
|
|
572
|
+
}), /*#__PURE__*/jsx("div", {
|
|
573
|
+
className: "bg-muted neeto-thankyou-nano__right-panel w-full px-6 py-10 lg:h-full lg:w-1/2 lg:overflow-y-auto",
|
|
574
|
+
children: /*#__PURE__*/jsx(CustomPreview, {
|
|
575
|
+
values: values
|
|
576
|
+
})
|
|
577
|
+
})]
|
|
578
|
+
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
579
|
+
children: [/*#__PURE__*/jsx(MobilePreviewHeader, {
|
|
580
|
+
className: "block lg:hidden"
|
|
581
|
+
}), /*#__PURE__*/jsx("div", {
|
|
582
|
+
className: "bg-muted neeto-thankyou-nano__right-panel w-full px-6 py-10 lg:h-full lg:w-1/2 lg:overflow-y-auto",
|
|
583
|
+
children: /*#__PURE__*/jsx(Preview, {
|
|
584
|
+
appIcon: appIcon,
|
|
585
|
+
appName: appName,
|
|
586
|
+
ctaProps: ctaProps,
|
|
587
|
+
editorProps: editorProps,
|
|
588
|
+
isPublished: isPublished,
|
|
589
|
+
publicLinkId: publicLinkId,
|
|
590
|
+
resubmitLink: resubmitLink,
|
|
591
|
+
socialHandles: socialHandles,
|
|
592
|
+
thankYouTextAlignment: thankYouTextAlignment
|
|
593
|
+
})
|
|
594
|
+
})]
|
|
595
|
+
}))]
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
var ConfigureThankYou = function ConfigureThankYou(_ref) {
|
|
602
|
+
var id = _ref.id,
|
|
603
|
+
breadcrumbs = _ref.breadcrumbs,
|
|
604
|
+
isPublished = _ref.isPublished,
|
|
605
|
+
entityId = _ref.entityId,
|
|
606
|
+
publicLinkId = _ref.publicLinkId,
|
|
607
|
+
resubmitLink = _ref.resubmitLink,
|
|
608
|
+
redirectToOnCancel = _ref.redirectToOnCancel,
|
|
609
|
+
_ref$socialHandles = _ref.socialHandles,
|
|
610
|
+
socialHandles = _ref$socialHandles === void 0 ? [] : _ref$socialHandles,
|
|
611
|
+
_ref$uniqueSubmission = _ref.uniqueSubmissionLink,
|
|
612
|
+
uniqueSubmissionLink = _ref$uniqueSubmission === void 0 ? "" : _ref$uniqueSubmission,
|
|
613
|
+
_ref$uniqueSubmission2 = _ref.uniqueSubmissionEnabled,
|
|
614
|
+
uniqueSubmissionEnabled = _ref$uniqueSubmission2 === void 0 ? false : _ref$uniqueSubmission2,
|
|
615
|
+
_ref$hasImageUploader = _ref.hasImageUploader,
|
|
616
|
+
hasImageUploader = _ref$hasImageUploader === void 0 ? false : _ref$hasImageUploader,
|
|
617
|
+
_ref$disableSubmitAno = _ref.disableSubmitAnotherResponse,
|
|
618
|
+
disableSubmitAnotherResponse = _ref$disableSubmitAno === void 0 ? false : _ref$disableSubmitAno,
|
|
619
|
+
_ref$disableRadioSele = _ref.disableRadioSelection,
|
|
620
|
+
disableRadioSelection = _ref$disableRadioSele === void 0 ? false : _ref$disableRadioSele,
|
|
621
|
+
_ref$thankYouTextAlig = _ref.thankYouTextAlignment,
|
|
622
|
+
thankYouTextAlignment = _ref$thankYouTextAlig === void 0 ? THANK_YOU_TEXT_ALIGNMENTS.center : _ref$thankYouTextAlig,
|
|
623
|
+
customHeader = _ref.customHeader,
|
|
624
|
+
appName = _ref.appName,
|
|
625
|
+
appIcon = _ref.appIcon,
|
|
626
|
+
_ref$blockNavigation = _ref.blockNavigation,
|
|
627
|
+
blockNavigation = _ref$blockNavigation === void 0 ? false : _ref$blockNavigation,
|
|
628
|
+
_ref$onConfigUpdateSu = _ref.onConfigUpdateSuccess,
|
|
629
|
+
onConfigUpdateSuccess = _ref$onConfigUpdateSu === void 0 ? noop : _ref$onConfigUpdateSu,
|
|
630
|
+
_ref$editorProps = _ref.editorProps,
|
|
631
|
+
editorProps = _ref$editorProps === void 0 ? {} : _ref$editorProps,
|
|
632
|
+
preview = _ref.preview,
|
|
633
|
+
_ref$allowEmptyCustom = _ref.allowEmptyCustomMessage,
|
|
634
|
+
allowEmptyCustomMessage = _ref$allowEmptyCustom === void 0 ? false : _ref$allowEmptyCustom,
|
|
635
|
+
_ref$isPassEventDetai = _ref.isPassEventDetailsEnabled,
|
|
636
|
+
isPassEventDetailsEnabled = _ref$isPassEventDetai === void 0 ? false : _ref$isPassEventDetai,
|
|
637
|
+
_ref$passEventDetails = _ref.passEventDetailsHelpDocUrl,
|
|
638
|
+
passEventDetailsHelpDocUrl = _ref$passEventDetails === void 0 ? null : _ref$passEventDetails,
|
|
639
|
+
_ref$eventDetailsSwit = _ref.eventDetailsSwitchLabel,
|
|
640
|
+
eventDetailsSwitchLabel = _ref$eventDetailsSwit === void 0 ? "" : _ref$eventDetailsSwit,
|
|
641
|
+
_ref$helpPopoverProps = _ref.helpPopoverProps,
|
|
642
|
+
helpPopoverProps = _ref$helpPopoverProps === void 0 ? {} : _ref$helpPopoverProps,
|
|
643
|
+
_ref$ctaProps = _ref.ctaProps,
|
|
644
|
+
ctaProps = _ref$ctaProps === void 0 ? {} : _ref$ctaProps;
|
|
645
|
+
return /*#__PURE__*/jsx(Form, {
|
|
646
|
+
allowEmptyCustomMessage: allowEmptyCustomMessage,
|
|
647
|
+
appIcon: appIcon,
|
|
648
|
+
appName: appName,
|
|
649
|
+
blockNavigation: blockNavigation,
|
|
650
|
+
breadcrumbs: breadcrumbs,
|
|
651
|
+
ctaProps: ctaProps,
|
|
652
|
+
customHeader: customHeader,
|
|
653
|
+
disableRadioSelection: disableRadioSelection,
|
|
654
|
+
disableSubmitAnotherResponse: disableSubmitAnotherResponse,
|
|
655
|
+
editorProps: editorProps,
|
|
656
|
+
entityId: entityId,
|
|
657
|
+
eventDetailsSwitchLabel: eventDetailsSwitchLabel,
|
|
658
|
+
hasImageUploader: hasImageUploader,
|
|
659
|
+
helpPopoverProps: helpPopoverProps,
|
|
660
|
+
id: id,
|
|
661
|
+
isPassEventDetailsEnabled: isPassEventDetailsEnabled,
|
|
662
|
+
isPublished: isPublished,
|
|
663
|
+
onConfigUpdateSuccess: onConfigUpdateSuccess,
|
|
664
|
+
passEventDetailsHelpDocUrl: passEventDetailsHelpDocUrl,
|
|
665
|
+
preview: preview,
|
|
666
|
+
publicLinkId: publicLinkId,
|
|
667
|
+
redirectToOnCancel: redirectToOnCancel,
|
|
668
|
+
resubmitLink: resubmitLink,
|
|
669
|
+
socialHandles: socialHandles,
|
|
670
|
+
thankYouTextAlignment: thankYouTextAlignment,
|
|
671
|
+
uniqueSubmissionEnabled: uniqueSubmissionEnabled,
|
|
672
|
+
uniqueSubmissionLink: uniqueSubmissionLink
|
|
673
|
+
});
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
export { ConfigureThankYou as default };
|
|
677
|
+
//# sourceMappingURL=ConfigureThankYou.js.map
|