@bigbinary/neeto-thank-you-frontend 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +309 -260
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +309 -260
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/types.d.ts +26 -8
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { useState, useEffect, useRef } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { hyphenate, noop } from '@bigbinary/neeto-cist';
|
|
4
4
|
import Scrollable from '@bigbinary/neeto-molecules/Scrollable';
|
|
5
5
|
import { t as t$1 } from 'i18next';
|
|
6
6
|
import { isEditorEmpty, FormikEditor, EditorContent } from '@bigbinary/neeto-editor';
|
|
@@ -21,6 +21,7 @@ import Input from '@bigbinary/neetoui/formik/Input';
|
|
|
21
21
|
import Switch from '@bigbinary/neetoui/formik/Switch';
|
|
22
22
|
import { useTranslation, Trans } from 'react-i18next';
|
|
23
23
|
import { ImageUploader } from '@bigbinary/neeto-image-uploader-frontend';
|
|
24
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
24
25
|
import Button from '@bigbinary/neetoui/Button';
|
|
25
26
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
26
27
|
import Modal from '@bigbinary/neetoui/Modal';
|
|
@@ -233,13 +234,12 @@ var Image = function Image() {
|
|
|
233
234
|
setFieldValue("imageUrl", image.url);
|
|
234
235
|
setFieldValue("imageSignedId", image.signedId);
|
|
235
236
|
};
|
|
236
|
-
return /*#__PURE__*/
|
|
237
|
+
return /*#__PURE__*/jsx(ImageUploader, {
|
|
237
238
|
className: "h-60",
|
|
238
|
-
key: values.imageUrl,
|
|
239
239
|
src: values.imageUrl,
|
|
240
240
|
uploadConfig: IMAGE_UPLOADER_CONFIG,
|
|
241
241
|
onUploadComplete: handleImageChange
|
|
242
|
-
});
|
|
242
|
+
}, values.imageUrl);
|
|
243
243
|
};
|
|
244
244
|
|
|
245
245
|
var ResubmissionWarningModal = function ResubmissionWarningModal(_ref) {
|
|
@@ -248,26 +248,33 @@ var ResubmissionWarningModal = function ResubmissionWarningModal(_ref) {
|
|
|
248
248
|
uniqueSubmissionLink = _ref.uniqueSubmissionLink;
|
|
249
249
|
var _useTranslation = useTranslation(),
|
|
250
250
|
t = _useTranslation.t;
|
|
251
|
-
return /*#__PURE__*/
|
|
251
|
+
return /*#__PURE__*/jsxs(Modal, {
|
|
252
252
|
isOpen: isOpen,
|
|
253
253
|
onClose: function onClose() {
|
|
254
254
|
return setIsOpen(false);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
255
|
+
},
|
|
256
|
+
children: [/*#__PURE__*/jsx(Modal.Header, {
|
|
257
|
+
children: /*#__PURE__*/jsxs(Typography, {
|
|
258
|
+
style: "h3",
|
|
259
|
+
weight: "semibold",
|
|
260
|
+
children: [t("neetoThankYou.common.alert"), "!"]
|
|
261
|
+
})
|
|
262
|
+
}), /*#__PURE__*/jsx(Modal.Body, {
|
|
263
|
+
children: t("neetoThankYou.thankYou.resubmissionWarning")
|
|
264
|
+
}), /*#__PURE__*/jsxs(Modal.Footer, {
|
|
265
|
+
className: "space-x-2",
|
|
266
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
267
|
+
label: t("neetoThankYou.thankYou.uniqueSubmissionLinkText"),
|
|
268
|
+
to: uniqueSubmissionLink
|
|
269
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
270
|
+
label: t("neetoThankYou.common.ok"),
|
|
271
|
+
style: "text",
|
|
272
|
+
onClick: function onClick() {
|
|
273
|
+
return setIsOpen(false);
|
|
274
|
+
}
|
|
275
|
+
})]
|
|
276
|
+
})]
|
|
277
|
+
});
|
|
271
278
|
};
|
|
272
279
|
|
|
273
280
|
var Customize = function Customize(_ref) {
|
|
@@ -303,37 +310,44 @@ var Customize = function Customize(_ref) {
|
|
|
303
310
|
var handleResubmitLinkChange = function handleResubmitLinkChange(event) {
|
|
304
311
|
uniqueSubmissionEnabled ? setIsUniqueSubmissionWarningModalOpen(true) : setFieldValue("showResubmitLink", event.target.checked);
|
|
305
312
|
};
|
|
306
|
-
return /*#__PURE__*/
|
|
307
|
-
className: "flex flex-col gap-4"
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
313
|
+
return /*#__PURE__*/jsxs("div", {
|
|
314
|
+
className: "flex flex-col gap-4",
|
|
315
|
+
children: [hasImageUploader && /*#__PURE__*/jsxs("div", {
|
|
316
|
+
className: "flex flex-col gap-2",
|
|
317
|
+
children: [/*#__PURE__*/jsx(Label$1, {
|
|
318
|
+
children: t("neetoThankYou.thankYou.imageLabel")
|
|
319
|
+
}), /*#__PURE__*/jsx(Image, {})]
|
|
320
|
+
}), /*#__PURE__*/jsx("div", {
|
|
321
|
+
className: "flex flex-col gap-2",
|
|
322
|
+
children: /*#__PURE__*/jsx(FormikEditor, {
|
|
323
|
+
required: true,
|
|
324
|
+
"data-cy": "thank-you-message-editor",
|
|
325
|
+
label: t("neetoThankYou.thankYou.messageLabel"),
|
|
326
|
+
name: "message",
|
|
327
|
+
ref: editorRef
|
|
328
|
+
})
|
|
329
|
+
}), !disableSocialShare && /*#__PURE__*/jsx(Switch, {
|
|
330
|
+
label: t("neetoThankYou.thankYou.socialShareIcons"),
|
|
331
|
+
name: "socialSharingEnabled"
|
|
332
|
+
}), !disableSubmitAnotherResponse && /*#__PURE__*/jsxs(Fragment, {
|
|
333
|
+
children: [/*#__PURE__*/jsx(Switch, {
|
|
334
|
+
label: t("neetoThankYou.thankYou.showResubmitLink"),
|
|
335
|
+
name: "showResubmitLink",
|
|
336
|
+
className: classNames({
|
|
337
|
+
"neeto-ui-switch--disabled": uniqueSubmissionEnabled
|
|
338
|
+
}),
|
|
339
|
+
onChange: handleResubmitLinkChange
|
|
340
|
+
}), values.showResubmitLink && /*#__PURE__*/jsx(Input, {
|
|
341
|
+
required: true,
|
|
342
|
+
label: t("neetoThankYou.thankYou.resubmitLinkText"),
|
|
343
|
+
name: "resubmitLinkText"
|
|
344
|
+
})]
|
|
345
|
+
}), /*#__PURE__*/jsx(ResubmissionWarningModal, {
|
|
346
|
+
uniqueSubmissionLink: uniqueSubmissionLink,
|
|
347
|
+
isOpen: isUniqueSubmissionWarningModalOpen,
|
|
348
|
+
setIsOpen: setIsUniqueSubmissionWarningModalOpen
|
|
349
|
+
})]
|
|
350
|
+
});
|
|
337
351
|
};
|
|
338
352
|
|
|
339
353
|
var ENVIRONMENTS = {
|
|
@@ -363,24 +377,27 @@ var BrandingInfo = function BrandingInfo(_ref) {
|
|
|
363
377
|
var _brandingInfo$additio;
|
|
364
378
|
var brandingInfo = _ref.brandingInfo,
|
|
365
379
|
appName = _ref.appName;
|
|
366
|
-
return /*#__PURE__*/
|
|
367
|
-
className: "neeto-thank-you-configuration__branding-wrap"
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
380
|
+
return /*#__PURE__*/jsx("div", {
|
|
381
|
+
className: "neeto-thank-you-configuration__branding-wrap",
|
|
382
|
+
children: /*#__PURE__*/jsx("div", {
|
|
383
|
+
className: "neeto-thank-you-configuration__nav",
|
|
384
|
+
children: /*#__PURE__*/jsx("div", {
|
|
385
|
+
className: "neeto-thank-you-configuration__nav-footer",
|
|
386
|
+
children: /*#__PURE__*/jsx(Trans, {
|
|
387
|
+
i18nKey: brandingInfo.displayText,
|
|
388
|
+
components: _objectSpread$1({
|
|
389
|
+
signUpLink: /*#__PURE__*/jsx("a", {
|
|
390
|
+
className: "neeto-thank-you-configuration__link",
|
|
391
|
+
href: buildSignUpUrl(appName),
|
|
392
|
+
rel: "noreferrer",
|
|
393
|
+
target: "_blank"
|
|
394
|
+
}),
|
|
395
|
+
span: /*#__PURE__*/jsx("span", {})
|
|
396
|
+
}, (_brandingInfo$additio = brandingInfo.additionalComponents) !== null && _brandingInfo$additio !== void 0 ? _brandingInfo$additio : {})
|
|
397
|
+
})
|
|
398
|
+
})
|
|
399
|
+
})
|
|
400
|
+
});
|
|
384
401
|
};
|
|
385
402
|
|
|
386
403
|
var _ellipse, _ellipse2, _ellipse3;
|
|
@@ -415,24 +432,28 @@ var SocialShare = function SocialShare(_ref) {
|
|
|
415
432
|
publicLinkId = _ref.publicLinkId;
|
|
416
433
|
var _useTranslation = useTranslation(),
|
|
417
434
|
t = _useTranslation.t;
|
|
418
|
-
return /*#__PURE__*/
|
|
419
|
-
className: "neeto-thank-you-configuration__social-share"
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
435
|
+
return /*#__PURE__*/jsxs("div", {
|
|
436
|
+
className: "neeto-thank-you-configuration__social-share",
|
|
437
|
+
children: [/*#__PURE__*/jsx("h3", {
|
|
438
|
+
className: "neeto-thank-you-configuration__social-share-title",
|
|
439
|
+
children: t("neetoThankYou.thankYou.socialShareHeading")
|
|
440
|
+
}), /*#__PURE__*/jsx("div", {
|
|
441
|
+
className: "neeto-thank-you-configuration-social-follow",
|
|
442
|
+
children: socialHandles === null || socialHandles === void 0 ? void 0 : socialHandles.map(function (data, idx) {
|
|
443
|
+
var Icon = data.icon,
|
|
444
|
+
generateShareUrl = data.generateShareUrl;
|
|
445
|
+
return /*#__PURE__*/jsx("div", {
|
|
446
|
+
className: "neeto-thank-you-configuration-social-follow__item",
|
|
447
|
+
children: /*#__PURE__*/jsx("a", {
|
|
448
|
+
href: generateShareUrl(publicLinkId),
|
|
449
|
+
rel: "noreferrer",
|
|
450
|
+
target: "_blank",
|
|
451
|
+
children: /*#__PURE__*/jsx(Icon, {})
|
|
452
|
+
})
|
|
453
|
+
}, idx);
|
|
454
|
+
})
|
|
455
|
+
})]
|
|
456
|
+
});
|
|
436
457
|
};
|
|
437
458
|
|
|
438
459
|
var MemoizedEditorContent = /*#__PURE__*/React__default.memo(EditorContent);
|
|
@@ -449,59 +470,69 @@ var Preview = function Preview(_ref) {
|
|
|
449
470
|
values = _useFormikContext.values;
|
|
450
471
|
var _useTranslation = useTranslation(),
|
|
451
472
|
t = _useTranslation.t;
|
|
452
|
-
return /*#__PURE__*/
|
|
453
|
-
className: "flex flex-col"
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
"neeto-thank-you-configuration-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
473
|
+
return /*#__PURE__*/jsxs("div", {
|
|
474
|
+
className: "flex flex-col",
|
|
475
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
476
|
+
className: "mb-3 block md:hidden",
|
|
477
|
+
lineHeight: "normal",
|
|
478
|
+
style: "h3",
|
|
479
|
+
weight: "semibold",
|
|
480
|
+
children: t("neetoThankYou.thankYou.preview")
|
|
481
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
482
|
+
className: classNames("neeto-thank-you-configuration-preview", {
|
|
483
|
+
"neeto-thank-you-configuration-alignment--left": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.left,
|
|
484
|
+
"neeto-thank-you-configuration-alignment--center": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.center,
|
|
485
|
+
"pointer-events-none": !isPublished
|
|
486
|
+
}),
|
|
487
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
488
|
+
className: "neeto-thank-you-configuration-preview__browser-header",
|
|
489
|
+
children: /*#__PURE__*/jsx(SvgBrowserControls, {})
|
|
490
|
+
}), /*#__PURE__*/jsx("div", {
|
|
491
|
+
className: "neeto-thank-you-configuration",
|
|
492
|
+
children: /*#__PURE__*/jsx("main", {
|
|
493
|
+
className: "neeto-thank-you-configuration__main",
|
|
494
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
495
|
+
className: "neeto-thank-you-configuration__box",
|
|
496
|
+
children: [!isEmpty(values === null || values === void 0 ? void 0 : values.imageUrl) && /*#__PURE__*/jsx("div", {
|
|
497
|
+
className: "neeto-thank-you-configuration__img",
|
|
498
|
+
children: /*#__PURE__*/jsx("img", {
|
|
499
|
+
alt: "",
|
|
500
|
+
src: values.imageUrl
|
|
501
|
+
})
|
|
502
|
+
}), (values === null || values === void 0 ? void 0 : values.message) && /*#__PURE__*/jsx("div", {
|
|
503
|
+
className: "neeto-thank-you-configuration__description",
|
|
504
|
+
children: /*#__PURE__*/jsx(MemoizedEditorContent, {
|
|
505
|
+
content: values.message,
|
|
506
|
+
"data-cy": "preview-editor-content"
|
|
507
|
+
})
|
|
508
|
+
}), (values === null || values === void 0 ? void 0 : values.showResubmitLink) && /*#__PURE__*/jsx("a", {
|
|
509
|
+
className: "neeto-thank-you-configuration__resubmit",
|
|
510
|
+
href: resubmitLink,
|
|
511
|
+
children: (_values$resubmitLinkT = values === null || values === void 0 ? void 0 : values.resubmitLinkText) !== null && _values$resubmitLinkT !== void 0 ? _values$resubmitLinkT : t("neetoThankYou.thankYou.resubmit")
|
|
512
|
+
}), (values === null || values === void 0 ? void 0 : values.socialSharingEnabled) && /*#__PURE__*/jsx(SocialShare, {
|
|
513
|
+
publicLinkId: publicLinkId,
|
|
514
|
+
socialHandles: socialHandles
|
|
515
|
+
})]
|
|
516
|
+
})
|
|
517
|
+
})
|
|
518
|
+
}), (values === null || values === void 0 ? void 0 : values.brandingEnabled) && /*#__PURE__*/jsx(BrandingInfo, {
|
|
519
|
+
appName: appName,
|
|
520
|
+
brandingInfo: brandingInfo
|
|
521
|
+
})]
|
|
522
|
+
})]
|
|
523
|
+
});
|
|
493
524
|
};
|
|
494
525
|
|
|
495
526
|
var ExternalLink = function ExternalLink() {
|
|
496
527
|
var _useTranslation = useTranslation(),
|
|
497
528
|
t = _useTranslation.t;
|
|
498
|
-
return /*#__PURE__*/
|
|
529
|
+
return /*#__PURE__*/jsx(Input, {
|
|
499
530
|
autoFocus: true,
|
|
500
531
|
required: true,
|
|
501
532
|
label: t("neetoThankYou.thankYou.link"),
|
|
502
533
|
name: "redirectUrl",
|
|
503
534
|
placeholder: EXTERNAL_URL_PREFIX,
|
|
504
|
-
prefix: /*#__PURE__*/
|
|
535
|
+
prefix: /*#__PURE__*/jsx(Link, {})
|
|
505
536
|
});
|
|
506
537
|
};
|
|
507
538
|
|
|
@@ -509,15 +540,17 @@ var Label = function Label(_ref) {
|
|
|
509
540
|
var label = _ref.label,
|
|
510
541
|
description = _ref.description,
|
|
511
542
|
kind = _ref.kind;
|
|
512
|
-
return /*#__PURE__*/
|
|
543
|
+
return /*#__PURE__*/jsxs(Typography, {
|
|
513
544
|
className: "neeto-ui-text-gray-700",
|
|
514
545
|
"data-cy": "neeto-thank-you-configuration-".concat(hyphenate(kind), "-label"),
|
|
515
546
|
style: "body2",
|
|
516
|
-
weight: "semibold"
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
547
|
+
weight: "semibold",
|
|
548
|
+
children: [label, /*#__PURE__*/jsx("span", {
|
|
549
|
+
className: "block text-xs font-normal leading-snug",
|
|
550
|
+
"data-cy": "neeto-thank-you-configuration-".concat(hyphenate(kind), "-description"),
|
|
551
|
+
children: description
|
|
552
|
+
})]
|
|
553
|
+
});
|
|
521
554
|
};
|
|
522
555
|
|
|
523
556
|
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; }
|
|
@@ -553,15 +586,16 @@ var Form = function Form(_ref) {
|
|
|
553
586
|
editor: {}
|
|
554
587
|
});
|
|
555
588
|
if (isLoading) {
|
|
556
|
-
return /*#__PURE__*/
|
|
557
|
-
className: "flex h-full w-full items-center justify-center"
|
|
558
|
-
|
|
589
|
+
return /*#__PURE__*/jsx("div", {
|
|
590
|
+
className: "flex h-full w-full items-center justify-center",
|
|
591
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
592
|
+
});
|
|
559
593
|
}
|
|
560
594
|
var resetEditor = function resetEditor() {
|
|
561
595
|
var _editorRef$current$ed;
|
|
562
596
|
return (_editorRef$current$ed = editorRef.current.editor) === null || _editorRef$current$ed === void 0 ? void 0 : _editorRef$current$ed.commands.setContent(thankYouConfiguration.message);
|
|
563
597
|
};
|
|
564
|
-
return /*#__PURE__*/
|
|
598
|
+
return /*#__PURE__*/jsx(NeetoUIForm, {
|
|
565
599
|
formikProps: {
|
|
566
600
|
enableReinitialize: true,
|
|
567
601
|
initialValues: _objectSpread(_objectSpread({}, DEFAULT_IMAGE_PROPERTIES), thankYouConfiguration),
|
|
@@ -581,60 +615,64 @@ var Form = function Form(_ref) {
|
|
|
581
615
|
}
|
|
582
616
|
});
|
|
583
617
|
}
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
618
|
+
},
|
|
619
|
+
children: function children(_ref2) {
|
|
620
|
+
var values = _ref2.values;
|
|
621
|
+
return /*#__PURE__*/jsxs("div", {
|
|
622
|
+
className: "grid grid-cols-1 gap-10 pb-6 md:grid-cols-2 md:gap-6",
|
|
623
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
624
|
+
className: "flex flex-col",
|
|
625
|
+
children: [blockNavigation && /*#__PURE__*/jsx(BlockNavigation, {}), !disableRadioSelection && /*#__PURE__*/jsx("div", {
|
|
626
|
+
className: "mb-6 w-full",
|
|
627
|
+
children: /*#__PURE__*/jsx(Radio, {
|
|
628
|
+
containerClassName: "grid grid-cols-1 sm:grid-cols-2 gap-6 items-stretch w-full",
|
|
629
|
+
name: "kind",
|
|
630
|
+
children: Object.values(FORM_OPTIONS).map(function (option) {
|
|
631
|
+
return /*#__PURE__*/jsx(Radio.Item, {
|
|
632
|
+
label: /*#__PURE__*/jsx(Label, _objectSpread({}, option)),
|
|
633
|
+
name: "kind",
|
|
634
|
+
value: option.kind,
|
|
635
|
+
className: classNames("neeto-thank-you-configuration-radio__item", {
|
|
636
|
+
active: values.kind === option.kind
|
|
637
|
+
})
|
|
638
|
+
}, option.kind);
|
|
639
|
+
})
|
|
640
|
+
})
|
|
641
|
+
}), values.kind === FORM_OPTIONS.customize.kind ? /*#__PURE__*/jsx(Customize, {
|
|
642
|
+
disableSubmitAnotherResponse: disableSubmitAnotherResponse,
|
|
643
|
+
editorRef: editorRef,
|
|
644
|
+
entityId: entityId,
|
|
645
|
+
hasImageUploader: hasImageUploader,
|
|
646
|
+
uniqueSubmissionEnabled: uniqueSubmissionEnabled,
|
|
647
|
+
uniqueSubmissionLink: uniqueSubmissionLink,
|
|
648
|
+
disableSocialShare: isEmpty(socialHandles)
|
|
649
|
+
}) : /*#__PURE__*/jsx(ExternalLink, {}), /*#__PURE__*/jsx(ActionBlock, {
|
|
650
|
+
className: "mt-6",
|
|
651
|
+
isSubmitting: isUpdatingForm,
|
|
652
|
+
cancelButtonProps: _objectSpread({
|
|
653
|
+
"data-cy": "neeto-thank-you-configuration-cancel-button"
|
|
654
|
+
}, redirectToOnCancel ? {
|
|
655
|
+
to: redirectToOnCancel,
|
|
656
|
+
onClick: noop
|
|
657
|
+
} : {
|
|
658
|
+
type: "reset",
|
|
659
|
+
onClick: resetEditor
|
|
660
|
+
}),
|
|
661
|
+
submitButtonProps: {
|
|
662
|
+
"data-cy": "neeto-thank-you-configuration-save-button"
|
|
663
|
+
}
|
|
664
|
+
})]
|
|
665
|
+
}), values.kind === FORM_OPTIONS.customize.kind && /*#__PURE__*/jsx(Preview, {
|
|
666
|
+
appName: appName,
|
|
667
|
+
brandingInfo: brandingInfo,
|
|
668
|
+
isPublished: isPublished,
|
|
669
|
+
publicLinkId: publicLinkId,
|
|
670
|
+
resubmitLink: resubmitLink,
|
|
671
|
+
socialHandles: socialHandles,
|
|
672
|
+
thankYouTextAlignment: thankYouTextAlignment
|
|
673
|
+
})]
|
|
605
674
|
});
|
|
606
|
-
}
|
|
607
|
-
disableSubmitAnotherResponse: disableSubmitAnotherResponse,
|
|
608
|
-
editorRef: editorRef,
|
|
609
|
-
entityId: entityId,
|
|
610
|
-
hasImageUploader: hasImageUploader,
|
|
611
|
-
uniqueSubmissionEnabled: uniqueSubmissionEnabled,
|
|
612
|
-
uniqueSubmissionLink: uniqueSubmissionLink,
|
|
613
|
-
disableSocialShare: isEmpty(socialHandles)
|
|
614
|
-
}) : /*#__PURE__*/React__default.createElement(ExternalLink, null), /*#__PURE__*/React__default.createElement(ActionBlock, {
|
|
615
|
-
className: "mt-6",
|
|
616
|
-
isSubmitting: isUpdatingForm,
|
|
617
|
-
cancelButtonProps: _objectSpread({
|
|
618
|
-
"data-cy": "neeto-thank-you-configuration-cancel-button"
|
|
619
|
-
}, redirectToOnCancel ? {
|
|
620
|
-
to: redirectToOnCancel,
|
|
621
|
-
onClick: noop
|
|
622
|
-
} : {
|
|
623
|
-
type: "reset",
|
|
624
|
-
onClick: resetEditor
|
|
625
|
-
}),
|
|
626
|
-
submitButtonProps: {
|
|
627
|
-
"data-cy": "neeto-thank-you-configuration-save-button"
|
|
628
|
-
}
|
|
629
|
-
})), values.kind === FORM_OPTIONS.customize.kind && /*#__PURE__*/React__default.createElement(Preview, {
|
|
630
|
-
appName: appName,
|
|
631
|
-
brandingInfo: brandingInfo,
|
|
632
|
-
isPublished: isPublished,
|
|
633
|
-
publicLinkId: publicLinkId,
|
|
634
|
-
resubmitLink: resubmitLink,
|
|
635
|
-
socialHandles: socialHandles,
|
|
636
|
-
thankYouTextAlignment: thankYouTextAlignment
|
|
637
|
-
}));
|
|
675
|
+
}
|
|
638
676
|
});
|
|
639
677
|
};
|
|
640
678
|
|
|
@@ -642,13 +680,14 @@ var Header = function Header(_ref) {
|
|
|
642
680
|
var breadcrumbs = _ref.breadcrumbs;
|
|
643
681
|
var _useTranslation = useTranslation(),
|
|
644
682
|
t = _useTranslation.t;
|
|
645
|
-
return /*#__PURE__*/
|
|
646
|
-
className: "w-full px-6"
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
683
|
+
return /*#__PURE__*/jsx("div", {
|
|
684
|
+
className: "w-full px-6",
|
|
685
|
+
children: /*#__PURE__*/jsx(NeetoUIHeader, {
|
|
686
|
+
breadcrumbs: breadcrumbs,
|
|
687
|
+
size: "small",
|
|
688
|
+
title: t("neetoThankYou.common.thankYou")
|
|
689
|
+
})
|
|
690
|
+
});
|
|
652
691
|
};
|
|
653
692
|
|
|
654
693
|
var ConfigureThankYou = function ConfigureThankYou(_ref) {
|
|
@@ -678,32 +717,35 @@ var ConfigureThankYou = function ConfigureThankYou(_ref) {
|
|
|
678
717
|
blockNavigation = _ref$blockNavigation === void 0 ? false : _ref$blockNavigation,
|
|
679
718
|
_ref$onConfigUpdateSu = _ref.onConfigUpdateSuccess,
|
|
680
719
|
onConfigUpdateSuccess = _ref$onConfigUpdateSu === void 0 ? noop : _ref$onConfigUpdateSu,
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
720
|
+
brandingInfo = _ref.brandingInfo;
|
|
721
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
722
|
+
children: [customHeader || /*#__PURE__*/jsx(Header, {
|
|
723
|
+
breadcrumbs: breadcrumbs
|
|
724
|
+
}), /*#__PURE__*/jsx(Scrollable, {
|
|
725
|
+
className: "w-full p-6 pt-0",
|
|
726
|
+
children: /*#__PURE__*/jsx("div", {
|
|
727
|
+
className: "mx-auto h-full max-w-7xl",
|
|
728
|
+
children: /*#__PURE__*/jsx(Form, {
|
|
729
|
+
appName: appName,
|
|
730
|
+
blockNavigation: blockNavigation,
|
|
731
|
+
brandingInfo: brandingInfo,
|
|
732
|
+
disableRadioSelection: disableRadioSelection,
|
|
733
|
+
disableSubmitAnotherResponse: disableSubmitAnotherResponse,
|
|
734
|
+
entityId: entityId,
|
|
735
|
+
hasImageUploader: hasImageUploader,
|
|
736
|
+
isPublished: isPublished,
|
|
737
|
+
onConfigUpdateSuccess: onConfigUpdateSuccess,
|
|
738
|
+
publicLinkId: publicLinkId,
|
|
739
|
+
redirectToOnCancel: redirectToOnCancel,
|
|
740
|
+
resubmitLink: resubmitLink,
|
|
741
|
+
socialHandles: socialHandles,
|
|
742
|
+
thankYouTextAlignment: thankYouTextAlignment,
|
|
743
|
+
uniqueSubmissionEnabled: uniqueSubmissionEnabled,
|
|
744
|
+
uniqueSubmissionLink: uniqueSubmissionLink
|
|
745
|
+
})
|
|
746
|
+
})
|
|
747
|
+
})]
|
|
748
|
+
});
|
|
707
749
|
};
|
|
708
750
|
|
|
709
751
|
var baseUrl = "".concat(THANK_YOU_ENGINE_BASE_URL, "/thank_you_page");
|
|
@@ -737,9 +779,10 @@ var buildDraftUrl = function buildDraftUrl(url) {
|
|
|
737
779
|
};
|
|
738
780
|
|
|
739
781
|
var DefaultPageLoader = function DefaultPageLoader() {
|
|
740
|
-
return /*#__PURE__*/
|
|
741
|
-
className: "neeto-thank-you-configuration"
|
|
742
|
-
|
|
782
|
+
return /*#__PURE__*/jsx("div", {
|
|
783
|
+
className: "neeto-thank-you-configuration",
|
|
784
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
785
|
+
});
|
|
743
786
|
};
|
|
744
787
|
var ShowThankYou = function ShowThankYou(_ref) {
|
|
745
788
|
var _thankYouConfiguratio;
|
|
@@ -751,8 +794,7 @@ var ShowThankYou = function ShowThankYou(_ref) {
|
|
|
751
794
|
publicLinkId = _ref.publicLinkId,
|
|
752
795
|
appName = _ref.appName,
|
|
753
796
|
CustomPageLoader = _ref.customPageLoader,
|
|
754
|
-
|
|
755
|
-
brandingInfo = _ref$brandingInfo === void 0 ? {} : _ref$brandingInfo;
|
|
797
|
+
brandingInfo = _ref.brandingInfo;
|
|
756
798
|
var _useTranslation = useTranslation(),
|
|
757
799
|
t = _useTranslation.t;
|
|
758
800
|
var _useShowThankYouPage = useShowThankYouPage({
|
|
@@ -764,35 +806,42 @@ var ShowThankYou = function ShowThankYou(_ref) {
|
|
|
764
806
|
isLoading = _useShowThankYouPage.isLoading;
|
|
765
807
|
var PageLoader = CustomPageLoader || DefaultPageLoader;
|
|
766
808
|
if (isLoading && isThankYouPageLoading) {
|
|
767
|
-
return /*#__PURE__*/
|
|
809
|
+
return /*#__PURE__*/jsx(PageLoader, {});
|
|
768
810
|
}
|
|
769
|
-
return /*#__PURE__*/
|
|
770
|
-
className: "neeto-thank-you-configuration"
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
811
|
+
return /*#__PURE__*/jsxs("div", {
|
|
812
|
+
className: "neeto-thank-you-configuration",
|
|
813
|
+
children: [/*#__PURE__*/jsx("main", {
|
|
814
|
+
className: "neeto-thank-you-configuration__main",
|
|
815
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
816
|
+
className: "neeto-thank-you-configuration__box",
|
|
817
|
+
children: [!isEmpty(thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.imageUrl) && /*#__PURE__*/jsx("div", {
|
|
818
|
+
className: "neeto-thank-you-configuration__img",
|
|
819
|
+
children: /*#__PURE__*/jsx("img", {
|
|
820
|
+
alt: "",
|
|
821
|
+
src: thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.imageUrl
|
|
822
|
+
})
|
|
823
|
+
}), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.message) && /*#__PURE__*/jsx("div", {
|
|
824
|
+
className: "neeto-thank-you-configuration__description",
|
|
825
|
+
children: /*#__PURE__*/jsx(EditorContent, {
|
|
826
|
+
content: thankYouConfiguration.message
|
|
827
|
+
})
|
|
828
|
+
}), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.showResubmitLink) && /*#__PURE__*/jsx("a", {
|
|
829
|
+
className: "neeto-thank-you-configuration__resubmit",
|
|
830
|
+
href: isDraftPreview ? buildDraftUrl(resubmitLink) : resubmitLink,
|
|
831
|
+
children: (_thankYouConfiguratio = thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.resubmitLinkText) !== null && _thankYouConfiguratio !== void 0 ? _thankYouConfiguratio : t("neetoThankYou.common.resubmit")
|
|
832
|
+
}), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.socialSharingEnabled) && /*#__PURE__*/jsx(SocialShare, {
|
|
833
|
+
publicLinkId: publicLinkId,
|
|
834
|
+
socialHandles: socialHandles
|
|
835
|
+
}), isDraftPreview && /*#__PURE__*/jsx(Typography, {
|
|
836
|
+
style: "body3",
|
|
837
|
+
children: t("neetoThankYou.thankYou.draftVersionForm")
|
|
838
|
+
})]
|
|
839
|
+
})
|
|
840
|
+
}), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.brandingEnabled) && /*#__PURE__*/jsx(BrandingInfo, {
|
|
841
|
+
appName: appName,
|
|
842
|
+
brandingInfo: brandingInfo
|
|
843
|
+
})]
|
|
844
|
+
});
|
|
796
845
|
};
|
|
797
846
|
|
|
798
847
|
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|