@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.cjs.js
CHANGED
|
@@ -24,6 +24,7 @@ var Input = require('@bigbinary/neetoui/formik/Input');
|
|
|
24
24
|
var Switch = require('@bigbinary/neetoui/formik/Switch');
|
|
25
25
|
var reactI18next = require('react-i18next');
|
|
26
26
|
var neetoImageUploaderFrontend = require('@bigbinary/neeto-image-uploader-frontend');
|
|
27
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
27
28
|
var Button = require('@bigbinary/neetoui/Button');
|
|
28
29
|
var Typography = require('@bigbinary/neetoui/Typography');
|
|
29
30
|
var Modal = require('@bigbinary/neetoui/Modal');
|
|
@@ -52,8 +53,8 @@ function _interopNamespace(e) {
|
|
|
52
53
|
return Object.freeze(n);
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
56
56
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
57
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
57
58
|
var Scrollable__default = /*#__PURE__*/_interopDefaultLegacy(Scrollable);
|
|
58
59
|
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
59
60
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
@@ -275,13 +276,12 @@ var Image = function Image() {
|
|
|
275
276
|
setFieldValue("imageUrl", image.url);
|
|
276
277
|
setFieldValue("imageSignedId", image.signedId);
|
|
277
278
|
};
|
|
278
|
-
return /*#__PURE__*/
|
|
279
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoImageUploaderFrontend.ImageUploader, {
|
|
279
280
|
className: "h-60",
|
|
280
|
-
key: values.imageUrl,
|
|
281
281
|
src: values.imageUrl,
|
|
282
282
|
uploadConfig: IMAGE_UPLOADER_CONFIG,
|
|
283
283
|
onUploadComplete: handleImageChange
|
|
284
|
-
});
|
|
284
|
+
}, values.imageUrl);
|
|
285
285
|
};
|
|
286
286
|
|
|
287
287
|
var ResubmissionWarningModal = function ResubmissionWarningModal(_ref) {
|
|
@@ -290,26 +290,33 @@ var ResubmissionWarningModal = function ResubmissionWarningModal(_ref) {
|
|
|
290
290
|
uniqueSubmissionLink = _ref.uniqueSubmissionLink;
|
|
291
291
|
var _useTranslation = reactI18next.useTranslation(),
|
|
292
292
|
t = _useTranslation.t;
|
|
293
|
-
return /*#__PURE__*/
|
|
293
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Modal__default["default"], {
|
|
294
294
|
isOpen: isOpen,
|
|
295
295
|
onClose: function onClose() {
|
|
296
296
|
return setIsOpen(false);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
297
|
+
},
|
|
298
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Modal__default["default"].Header, {
|
|
299
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(Typography__default["default"], {
|
|
300
|
+
style: "h3",
|
|
301
|
+
weight: "semibold",
|
|
302
|
+
children: [t("neetoThankYou.common.alert"), "!"]
|
|
303
|
+
})
|
|
304
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Modal__default["default"].Body, {
|
|
305
|
+
children: t("neetoThankYou.thankYou.resubmissionWarning")
|
|
306
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Modal__default["default"].Footer, {
|
|
307
|
+
className: "space-x-2",
|
|
308
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
309
|
+
label: t("neetoThankYou.thankYou.uniqueSubmissionLinkText"),
|
|
310
|
+
to: uniqueSubmissionLink
|
|
311
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
312
|
+
label: t("neetoThankYou.common.ok"),
|
|
313
|
+
style: "text",
|
|
314
|
+
onClick: function onClick() {
|
|
315
|
+
return setIsOpen(false);
|
|
316
|
+
}
|
|
317
|
+
})]
|
|
318
|
+
})]
|
|
319
|
+
});
|
|
313
320
|
};
|
|
314
321
|
|
|
315
322
|
var Customize = function Customize(_ref) {
|
|
@@ -345,37 +352,44 @@ var Customize = function Customize(_ref) {
|
|
|
345
352
|
var handleResubmitLinkChange = function handleResubmitLinkChange(event) {
|
|
346
353
|
uniqueSubmissionEnabled ? setIsUniqueSubmissionWarningModalOpen(true) : setFieldValue("showResubmitLink", event.target.checked);
|
|
347
354
|
};
|
|
348
|
-
return /*#__PURE__*/
|
|
349
|
-
className: "flex flex-col gap-4"
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
355
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
356
|
+
className: "flex flex-col gap-4",
|
|
357
|
+
children: [hasImageUploader && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
358
|
+
className: "flex flex-col gap-2",
|
|
359
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Label__default["default"], {
|
|
360
|
+
children: t("neetoThankYou.thankYou.imageLabel")
|
|
361
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Image, {})]
|
|
362
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
363
|
+
className: "flex flex-col gap-2",
|
|
364
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoEditor.FormikEditor, {
|
|
365
|
+
required: true,
|
|
366
|
+
"data-cy": "thank-you-message-editor",
|
|
367
|
+
label: t("neetoThankYou.thankYou.messageLabel"),
|
|
368
|
+
name: "message",
|
|
369
|
+
ref: editorRef
|
|
370
|
+
})
|
|
371
|
+
}), !disableSocialShare && /*#__PURE__*/jsxRuntime.jsx(Switch__default["default"], {
|
|
372
|
+
label: t("neetoThankYou.thankYou.socialShareIcons"),
|
|
373
|
+
name: "socialSharingEnabled"
|
|
374
|
+
}), !disableSubmitAnotherResponse && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
375
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Switch__default["default"], {
|
|
376
|
+
label: t("neetoThankYou.thankYou.showResubmitLink"),
|
|
377
|
+
name: "showResubmitLink",
|
|
378
|
+
className: classNames__default["default"]({
|
|
379
|
+
"neeto-ui-switch--disabled": uniqueSubmissionEnabled
|
|
380
|
+
}),
|
|
381
|
+
onChange: handleResubmitLinkChange
|
|
382
|
+
}), values.showResubmitLink && /*#__PURE__*/jsxRuntime.jsx(Input__default["default"], {
|
|
383
|
+
required: true,
|
|
384
|
+
label: t("neetoThankYou.thankYou.resubmitLinkText"),
|
|
385
|
+
name: "resubmitLinkText"
|
|
386
|
+
})]
|
|
387
|
+
}), /*#__PURE__*/jsxRuntime.jsx(ResubmissionWarningModal, {
|
|
388
|
+
uniqueSubmissionLink: uniqueSubmissionLink,
|
|
389
|
+
isOpen: isUniqueSubmissionWarningModalOpen,
|
|
390
|
+
setIsOpen: setIsUniqueSubmissionWarningModalOpen
|
|
391
|
+
})]
|
|
392
|
+
});
|
|
379
393
|
};
|
|
380
394
|
|
|
381
395
|
var ENVIRONMENTS = {
|
|
@@ -405,24 +419,27 @@ var BrandingInfo = function BrandingInfo(_ref) {
|
|
|
405
419
|
var _brandingInfo$additio;
|
|
406
420
|
var brandingInfo = _ref.brandingInfo,
|
|
407
421
|
appName = _ref.appName;
|
|
408
|
-
return /*#__PURE__*/
|
|
409
|
-
className: "neeto-thank-you-configuration__branding-wrap"
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
422
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
423
|
+
className: "neeto-thank-you-configuration__branding-wrap",
|
|
424
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
425
|
+
className: "neeto-thank-you-configuration__nav",
|
|
426
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
427
|
+
className: "neeto-thank-you-configuration__nav-footer",
|
|
428
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
429
|
+
i18nKey: brandingInfo.displayText,
|
|
430
|
+
components: _objectSpread$1({
|
|
431
|
+
signUpLink: /*#__PURE__*/jsxRuntime.jsx("a", {
|
|
432
|
+
className: "neeto-thank-you-configuration__link",
|
|
433
|
+
href: buildSignUpUrl(appName),
|
|
434
|
+
rel: "noreferrer",
|
|
435
|
+
target: "_blank"
|
|
436
|
+
}),
|
|
437
|
+
span: /*#__PURE__*/jsxRuntime.jsx("span", {})
|
|
438
|
+
}, (_brandingInfo$additio = brandingInfo.additionalComponents) !== null && _brandingInfo$additio !== void 0 ? _brandingInfo$additio : {})
|
|
439
|
+
})
|
|
440
|
+
})
|
|
441
|
+
})
|
|
442
|
+
});
|
|
426
443
|
};
|
|
427
444
|
|
|
428
445
|
var _ellipse, _ellipse2, _ellipse3;
|
|
@@ -457,24 +474,28 @@ var SocialShare = function SocialShare(_ref) {
|
|
|
457
474
|
publicLinkId = _ref.publicLinkId;
|
|
458
475
|
var _useTranslation = reactI18next.useTranslation(),
|
|
459
476
|
t = _useTranslation.t;
|
|
460
|
-
return /*#__PURE__*/
|
|
461
|
-
className: "neeto-thank-you-configuration__social-share"
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
477
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
478
|
+
className: "neeto-thank-you-configuration__social-share",
|
|
479
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
480
|
+
className: "neeto-thank-you-configuration__social-share-title",
|
|
481
|
+
children: t("neetoThankYou.thankYou.socialShareHeading")
|
|
482
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
483
|
+
className: "neeto-thank-you-configuration-social-follow",
|
|
484
|
+
children: socialHandles === null || socialHandles === void 0 ? void 0 : socialHandles.map(function (data, idx) {
|
|
485
|
+
var Icon = data.icon,
|
|
486
|
+
generateShareUrl = data.generateShareUrl;
|
|
487
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
488
|
+
className: "neeto-thank-you-configuration-social-follow__item",
|
|
489
|
+
children: /*#__PURE__*/jsxRuntime.jsx("a", {
|
|
490
|
+
href: generateShareUrl(publicLinkId),
|
|
491
|
+
rel: "noreferrer",
|
|
492
|
+
target: "_blank",
|
|
493
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Icon, {})
|
|
494
|
+
})
|
|
495
|
+
}, idx);
|
|
496
|
+
})
|
|
497
|
+
})]
|
|
498
|
+
});
|
|
478
499
|
};
|
|
479
500
|
|
|
480
501
|
var MemoizedEditorContent = /*#__PURE__*/React__default["default"].memo(neetoEditor.EditorContent);
|
|
@@ -491,59 +512,69 @@ var Preview = function Preview(_ref) {
|
|
|
491
512
|
values = _useFormikContext.values;
|
|
492
513
|
var _useTranslation = reactI18next.useTranslation(),
|
|
493
514
|
t = _useTranslation.t;
|
|
494
|
-
return /*#__PURE__*/
|
|
495
|
-
className: "flex flex-col"
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
"neeto-thank-you-configuration-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
515
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
516
|
+
className: "flex flex-col",
|
|
517
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
518
|
+
className: "mb-3 block md:hidden",
|
|
519
|
+
lineHeight: "normal",
|
|
520
|
+
style: "h3",
|
|
521
|
+
weight: "semibold",
|
|
522
|
+
children: t("neetoThankYou.thankYou.preview")
|
|
523
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
524
|
+
className: classNames__default["default"]("neeto-thank-you-configuration-preview", {
|
|
525
|
+
"neeto-thank-you-configuration-alignment--left": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.left,
|
|
526
|
+
"neeto-thank-you-configuration-alignment--center": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.center,
|
|
527
|
+
"pointer-events-none": !isPublished
|
|
528
|
+
}),
|
|
529
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
530
|
+
className: "neeto-thank-you-configuration-preview__browser-header",
|
|
531
|
+
children: /*#__PURE__*/jsxRuntime.jsx(SvgBrowserControls, {})
|
|
532
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
533
|
+
className: "neeto-thank-you-configuration",
|
|
534
|
+
children: /*#__PURE__*/jsxRuntime.jsx("main", {
|
|
535
|
+
className: "neeto-thank-you-configuration__main",
|
|
536
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
537
|
+
className: "neeto-thank-you-configuration__box",
|
|
538
|
+
children: [!ramda.isEmpty(values === null || values === void 0 ? void 0 : values.imageUrl) && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
539
|
+
className: "neeto-thank-you-configuration__img",
|
|
540
|
+
children: /*#__PURE__*/jsxRuntime.jsx("img", {
|
|
541
|
+
alt: "",
|
|
542
|
+
src: values.imageUrl
|
|
543
|
+
})
|
|
544
|
+
}), (values === null || values === void 0 ? void 0 : values.message) && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
545
|
+
className: "neeto-thank-you-configuration__description",
|
|
546
|
+
children: /*#__PURE__*/jsxRuntime.jsx(MemoizedEditorContent, {
|
|
547
|
+
content: values.message,
|
|
548
|
+
"data-cy": "preview-editor-content"
|
|
549
|
+
})
|
|
550
|
+
}), (values === null || values === void 0 ? void 0 : values.showResubmitLink) && /*#__PURE__*/jsxRuntime.jsx("a", {
|
|
551
|
+
className: "neeto-thank-you-configuration__resubmit",
|
|
552
|
+
href: resubmitLink,
|
|
553
|
+
children: (_values$resubmitLinkT = values === null || values === void 0 ? void 0 : values.resubmitLinkText) !== null && _values$resubmitLinkT !== void 0 ? _values$resubmitLinkT : t("neetoThankYou.thankYou.resubmit")
|
|
554
|
+
}), (values === null || values === void 0 ? void 0 : values.socialSharingEnabled) && /*#__PURE__*/jsxRuntime.jsx(SocialShare, {
|
|
555
|
+
publicLinkId: publicLinkId,
|
|
556
|
+
socialHandles: socialHandles
|
|
557
|
+
})]
|
|
558
|
+
})
|
|
559
|
+
})
|
|
560
|
+
}), (values === null || values === void 0 ? void 0 : values.brandingEnabled) && /*#__PURE__*/jsxRuntime.jsx(BrandingInfo, {
|
|
561
|
+
appName: appName,
|
|
562
|
+
brandingInfo: brandingInfo
|
|
563
|
+
})]
|
|
564
|
+
})]
|
|
565
|
+
});
|
|
535
566
|
};
|
|
536
567
|
|
|
537
568
|
var ExternalLink = function ExternalLink() {
|
|
538
569
|
var _useTranslation = reactI18next.useTranslation(),
|
|
539
570
|
t = _useTranslation.t;
|
|
540
|
-
return /*#__PURE__*/
|
|
571
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input__default["default"], {
|
|
541
572
|
autoFocus: true,
|
|
542
573
|
required: true,
|
|
543
574
|
label: t("neetoThankYou.thankYou.link"),
|
|
544
575
|
name: "redirectUrl",
|
|
545
576
|
placeholder: EXTERNAL_URL_PREFIX,
|
|
546
|
-
prefix: /*#__PURE__*/
|
|
577
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx(neetoIcons.Link, {})
|
|
547
578
|
});
|
|
548
579
|
};
|
|
549
580
|
|
|
@@ -551,15 +582,17 @@ var Label = function Label(_ref) {
|
|
|
551
582
|
var label = _ref.label,
|
|
552
583
|
description = _ref.description,
|
|
553
584
|
kind = _ref.kind;
|
|
554
|
-
return /*#__PURE__*/
|
|
585
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Typography__default["default"], {
|
|
555
586
|
className: "neeto-ui-text-gray-700",
|
|
556
587
|
"data-cy": "neeto-thank-you-configuration-".concat(neetoCist.hyphenate(kind), "-label"),
|
|
557
588
|
style: "body2",
|
|
558
|
-
weight: "semibold"
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
589
|
+
weight: "semibold",
|
|
590
|
+
children: [label, /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
591
|
+
className: "block text-xs font-normal leading-snug",
|
|
592
|
+
"data-cy": "neeto-thank-you-configuration-".concat(neetoCist.hyphenate(kind), "-description"),
|
|
593
|
+
children: description
|
|
594
|
+
})]
|
|
595
|
+
});
|
|
563
596
|
};
|
|
564
597
|
|
|
565
598
|
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; }
|
|
@@ -595,15 +628,16 @@ var Form = function Form(_ref) {
|
|
|
595
628
|
editor: {}
|
|
596
629
|
});
|
|
597
630
|
if (isLoading) {
|
|
598
|
-
return /*#__PURE__*/
|
|
599
|
-
className: "flex h-full w-full items-center justify-center"
|
|
600
|
-
|
|
631
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
632
|
+
className: "flex h-full w-full items-center justify-center",
|
|
633
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {})
|
|
634
|
+
});
|
|
601
635
|
}
|
|
602
636
|
var resetEditor = function resetEditor() {
|
|
603
637
|
var _editorRef$current$ed;
|
|
604
638
|
return (_editorRef$current$ed = editorRef.current.editor) === null || _editorRef$current$ed === void 0 ? void 0 : _editorRef$current$ed.commands.setContent(thankYouConfiguration.message);
|
|
605
639
|
};
|
|
606
|
-
return /*#__PURE__*/
|
|
640
|
+
return /*#__PURE__*/jsxRuntime.jsx(NeetoUIForm__default["default"], {
|
|
607
641
|
formikProps: {
|
|
608
642
|
enableReinitialize: true,
|
|
609
643
|
initialValues: _objectSpread(_objectSpread({}, DEFAULT_IMAGE_PROPERTIES), thankYouConfiguration),
|
|
@@ -623,60 +657,64 @@ var Form = function Form(_ref) {
|
|
|
623
657
|
}
|
|
624
658
|
});
|
|
625
659
|
}
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
660
|
+
},
|
|
661
|
+
children: function children(_ref2) {
|
|
662
|
+
var values = _ref2.values;
|
|
663
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
664
|
+
className: "grid grid-cols-1 gap-10 pb-6 md:grid-cols-2 md:gap-6",
|
|
665
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
666
|
+
className: "flex flex-col",
|
|
667
|
+
children: [blockNavigation && /*#__PURE__*/jsxRuntime.jsx(BlockNavigation__default["default"], {}), !disableRadioSelection && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
668
|
+
className: "mb-6 w-full",
|
|
669
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Radio__default["default"], {
|
|
670
|
+
containerClassName: "grid grid-cols-1 sm:grid-cols-2 gap-6 items-stretch w-full",
|
|
671
|
+
name: "kind",
|
|
672
|
+
children: Object.values(FORM_OPTIONS).map(function (option) {
|
|
673
|
+
return /*#__PURE__*/jsxRuntime.jsx(Radio__default["default"].Item, {
|
|
674
|
+
label: /*#__PURE__*/jsxRuntime.jsx(Label, _objectSpread({}, option)),
|
|
675
|
+
name: "kind",
|
|
676
|
+
value: option.kind,
|
|
677
|
+
className: classNames__default["default"]("neeto-thank-you-configuration-radio__item", {
|
|
678
|
+
active: values.kind === option.kind
|
|
679
|
+
})
|
|
680
|
+
}, option.kind);
|
|
681
|
+
})
|
|
682
|
+
})
|
|
683
|
+
}), values.kind === FORM_OPTIONS.customize.kind ? /*#__PURE__*/jsxRuntime.jsx(Customize, {
|
|
684
|
+
disableSubmitAnotherResponse: disableSubmitAnotherResponse,
|
|
685
|
+
editorRef: editorRef,
|
|
686
|
+
entityId: entityId,
|
|
687
|
+
hasImageUploader: hasImageUploader,
|
|
688
|
+
uniqueSubmissionEnabled: uniqueSubmissionEnabled,
|
|
689
|
+
uniqueSubmissionLink: uniqueSubmissionLink,
|
|
690
|
+
disableSocialShare: ramda.isEmpty(socialHandles)
|
|
691
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(ExternalLink, {}), /*#__PURE__*/jsxRuntime.jsx(ActionBlock__default["default"], {
|
|
692
|
+
className: "mt-6",
|
|
693
|
+
isSubmitting: isUpdatingForm,
|
|
694
|
+
cancelButtonProps: _objectSpread({
|
|
695
|
+
"data-cy": "neeto-thank-you-configuration-cancel-button"
|
|
696
|
+
}, redirectToOnCancel ? {
|
|
697
|
+
to: redirectToOnCancel,
|
|
698
|
+
onClick: neetoCist.noop
|
|
699
|
+
} : {
|
|
700
|
+
type: "reset",
|
|
701
|
+
onClick: resetEditor
|
|
702
|
+
}),
|
|
703
|
+
submitButtonProps: {
|
|
704
|
+
"data-cy": "neeto-thank-you-configuration-save-button"
|
|
705
|
+
}
|
|
706
|
+
})]
|
|
707
|
+
}), values.kind === FORM_OPTIONS.customize.kind && /*#__PURE__*/jsxRuntime.jsx(Preview, {
|
|
708
|
+
appName: appName,
|
|
709
|
+
brandingInfo: brandingInfo,
|
|
710
|
+
isPublished: isPublished,
|
|
711
|
+
publicLinkId: publicLinkId,
|
|
712
|
+
resubmitLink: resubmitLink,
|
|
713
|
+
socialHandles: socialHandles,
|
|
714
|
+
thankYouTextAlignment: thankYouTextAlignment
|
|
715
|
+
})]
|
|
647
716
|
});
|
|
648
|
-
}
|
|
649
|
-
disableSubmitAnotherResponse: disableSubmitAnotherResponse,
|
|
650
|
-
editorRef: editorRef,
|
|
651
|
-
entityId: entityId,
|
|
652
|
-
hasImageUploader: hasImageUploader,
|
|
653
|
-
uniqueSubmissionEnabled: uniqueSubmissionEnabled,
|
|
654
|
-
uniqueSubmissionLink: uniqueSubmissionLink,
|
|
655
|
-
disableSocialShare: ramda.isEmpty(socialHandles)
|
|
656
|
-
}) : /*#__PURE__*/React__default["default"].createElement(ExternalLink, null), /*#__PURE__*/React__default["default"].createElement(ActionBlock__default["default"], {
|
|
657
|
-
className: "mt-6",
|
|
658
|
-
isSubmitting: isUpdatingForm,
|
|
659
|
-
cancelButtonProps: _objectSpread({
|
|
660
|
-
"data-cy": "neeto-thank-you-configuration-cancel-button"
|
|
661
|
-
}, redirectToOnCancel ? {
|
|
662
|
-
to: redirectToOnCancel,
|
|
663
|
-
onClick: neetoCist.noop
|
|
664
|
-
} : {
|
|
665
|
-
type: "reset",
|
|
666
|
-
onClick: resetEditor
|
|
667
|
-
}),
|
|
668
|
-
submitButtonProps: {
|
|
669
|
-
"data-cy": "neeto-thank-you-configuration-save-button"
|
|
670
|
-
}
|
|
671
|
-
})), values.kind === FORM_OPTIONS.customize.kind && /*#__PURE__*/React__default["default"].createElement(Preview, {
|
|
672
|
-
appName: appName,
|
|
673
|
-
brandingInfo: brandingInfo,
|
|
674
|
-
isPublished: isPublished,
|
|
675
|
-
publicLinkId: publicLinkId,
|
|
676
|
-
resubmitLink: resubmitLink,
|
|
677
|
-
socialHandles: socialHandles,
|
|
678
|
-
thankYouTextAlignment: thankYouTextAlignment
|
|
679
|
-
}));
|
|
717
|
+
}
|
|
680
718
|
});
|
|
681
719
|
};
|
|
682
720
|
|
|
@@ -684,13 +722,14 @@ var Header = function Header(_ref) {
|
|
|
684
722
|
var breadcrumbs = _ref.breadcrumbs;
|
|
685
723
|
var _useTranslation = reactI18next.useTranslation(),
|
|
686
724
|
t = _useTranslation.t;
|
|
687
|
-
return /*#__PURE__*/
|
|
688
|
-
className: "w-full px-6"
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
725
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
726
|
+
className: "w-full px-6",
|
|
727
|
+
children: /*#__PURE__*/jsxRuntime.jsx(NeetoUIHeader__default["default"], {
|
|
728
|
+
breadcrumbs: breadcrumbs,
|
|
729
|
+
size: "small",
|
|
730
|
+
title: t("neetoThankYou.common.thankYou")
|
|
731
|
+
})
|
|
732
|
+
});
|
|
694
733
|
};
|
|
695
734
|
|
|
696
735
|
var ConfigureThankYou = function ConfigureThankYou(_ref) {
|
|
@@ -720,32 +759,35 @@ var ConfigureThankYou = function ConfigureThankYou(_ref) {
|
|
|
720
759
|
blockNavigation = _ref$blockNavigation === void 0 ? false : _ref$blockNavigation,
|
|
721
760
|
_ref$onConfigUpdateSu = _ref.onConfigUpdateSuccess,
|
|
722
761
|
onConfigUpdateSuccess = _ref$onConfigUpdateSu === void 0 ? neetoCist.noop : _ref$onConfigUpdateSu,
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
762
|
+
brandingInfo = _ref.brandingInfo;
|
|
763
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
764
|
+
children: [customHeader || /*#__PURE__*/jsxRuntime.jsx(Header, {
|
|
765
|
+
breadcrumbs: breadcrumbs
|
|
766
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Scrollable__default["default"], {
|
|
767
|
+
className: "w-full p-6 pt-0",
|
|
768
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
769
|
+
className: "mx-auto h-full max-w-7xl",
|
|
770
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Form, {
|
|
771
|
+
appName: appName,
|
|
772
|
+
blockNavigation: blockNavigation,
|
|
773
|
+
brandingInfo: brandingInfo,
|
|
774
|
+
disableRadioSelection: disableRadioSelection,
|
|
775
|
+
disableSubmitAnotherResponse: disableSubmitAnotherResponse,
|
|
776
|
+
entityId: entityId,
|
|
777
|
+
hasImageUploader: hasImageUploader,
|
|
778
|
+
isPublished: isPublished,
|
|
779
|
+
onConfigUpdateSuccess: onConfigUpdateSuccess,
|
|
780
|
+
publicLinkId: publicLinkId,
|
|
781
|
+
redirectToOnCancel: redirectToOnCancel,
|
|
782
|
+
resubmitLink: resubmitLink,
|
|
783
|
+
socialHandles: socialHandles,
|
|
784
|
+
thankYouTextAlignment: thankYouTextAlignment,
|
|
785
|
+
uniqueSubmissionEnabled: uniqueSubmissionEnabled,
|
|
786
|
+
uniqueSubmissionLink: uniqueSubmissionLink
|
|
787
|
+
})
|
|
788
|
+
})
|
|
789
|
+
})]
|
|
790
|
+
});
|
|
749
791
|
};
|
|
750
792
|
|
|
751
793
|
var baseUrl = "".concat(THANK_YOU_ENGINE_BASE_URL, "/thank_you_page");
|
|
@@ -779,9 +821,10 @@ var buildDraftUrl = function buildDraftUrl(url) {
|
|
|
779
821
|
};
|
|
780
822
|
|
|
781
823
|
var DefaultPageLoader = function DefaultPageLoader() {
|
|
782
|
-
return /*#__PURE__*/
|
|
783
|
-
className: "neeto-thank-you-configuration"
|
|
784
|
-
|
|
824
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
825
|
+
className: "neeto-thank-you-configuration",
|
|
826
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {})
|
|
827
|
+
});
|
|
785
828
|
};
|
|
786
829
|
var ShowThankYou = function ShowThankYou(_ref) {
|
|
787
830
|
var _thankYouConfiguratio;
|
|
@@ -793,8 +836,7 @@ var ShowThankYou = function ShowThankYou(_ref) {
|
|
|
793
836
|
publicLinkId = _ref.publicLinkId,
|
|
794
837
|
appName = _ref.appName,
|
|
795
838
|
CustomPageLoader = _ref.customPageLoader,
|
|
796
|
-
|
|
797
|
-
brandingInfo = _ref$brandingInfo === void 0 ? {} : _ref$brandingInfo;
|
|
839
|
+
brandingInfo = _ref.brandingInfo;
|
|
798
840
|
var _useTranslation = reactI18next.useTranslation(),
|
|
799
841
|
t = _useTranslation.t;
|
|
800
842
|
var _useShowThankYouPage = useShowThankYouPage({
|
|
@@ -806,35 +848,42 @@ var ShowThankYou = function ShowThankYou(_ref) {
|
|
|
806
848
|
isLoading = _useShowThankYouPage.isLoading;
|
|
807
849
|
var PageLoader = CustomPageLoader || DefaultPageLoader;
|
|
808
850
|
if (isLoading && isThankYouPageLoading) {
|
|
809
|
-
return /*#__PURE__*/
|
|
851
|
+
return /*#__PURE__*/jsxRuntime.jsx(PageLoader, {});
|
|
810
852
|
}
|
|
811
|
-
return /*#__PURE__*/
|
|
812
|
-
className: "neeto-thank-you-configuration"
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
853
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
854
|
+
className: "neeto-thank-you-configuration",
|
|
855
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("main", {
|
|
856
|
+
className: "neeto-thank-you-configuration__main",
|
|
857
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
858
|
+
className: "neeto-thank-you-configuration__box",
|
|
859
|
+
children: [!ramda.isEmpty(thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.imageUrl) && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
860
|
+
className: "neeto-thank-you-configuration__img",
|
|
861
|
+
children: /*#__PURE__*/jsxRuntime.jsx("img", {
|
|
862
|
+
alt: "",
|
|
863
|
+
src: thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.imageUrl
|
|
864
|
+
})
|
|
865
|
+
}), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.message) && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
866
|
+
className: "neeto-thank-you-configuration__description",
|
|
867
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoEditor.EditorContent, {
|
|
868
|
+
content: thankYouConfiguration.message
|
|
869
|
+
})
|
|
870
|
+
}), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.showResubmitLink) && /*#__PURE__*/jsxRuntime.jsx("a", {
|
|
871
|
+
className: "neeto-thank-you-configuration__resubmit",
|
|
872
|
+
href: isDraftPreview ? buildDraftUrl(resubmitLink) : resubmitLink,
|
|
873
|
+
children: (_thankYouConfiguratio = thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.resubmitLinkText) !== null && _thankYouConfiguratio !== void 0 ? _thankYouConfiguratio : t("neetoThankYou.common.resubmit")
|
|
874
|
+
}), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.socialSharingEnabled) && /*#__PURE__*/jsxRuntime.jsx(SocialShare, {
|
|
875
|
+
publicLinkId: publicLinkId,
|
|
876
|
+
socialHandles: socialHandles
|
|
877
|
+
}), isDraftPreview && /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
878
|
+
style: "body3",
|
|
879
|
+
children: t("neetoThankYou.thankYou.draftVersionForm")
|
|
880
|
+
})]
|
|
881
|
+
})
|
|
882
|
+
}), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.brandingEnabled) && /*#__PURE__*/jsxRuntime.jsx(BrandingInfo, {
|
|
883
|
+
appName: appName,
|
|
884
|
+
brandingInfo: brandingInfo
|
|
885
|
+
})]
|
|
886
|
+
});
|
|
838
887
|
};
|
|
839
888
|
|
|
840
889
|
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}}
|