@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.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 { isPresent, hyphenate, noop } from '@bigbinary/neeto-cist';
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__*/React__default.createElement(ImageUploader, {
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__*/React__default.createElement(Modal, {
251
+ return /*#__PURE__*/jsxs(Modal, {
252
252
  isOpen: isOpen,
253
253
  onClose: function onClose() {
254
254
  return setIsOpen(false);
255
- }
256
- }, /*#__PURE__*/React__default.createElement(Modal.Header, null, /*#__PURE__*/React__default.createElement(Typography, {
257
- style: "h3",
258
- weight: "semibold"
259
- }, t("neetoThankYou.common.alert"), "!")), /*#__PURE__*/React__default.createElement(Modal.Body, null, t("neetoThankYou.thankYou.resubmissionWarning")), /*#__PURE__*/React__default.createElement(Modal.Footer, {
260
- className: "space-x-2"
261
- }, /*#__PURE__*/React__default.createElement(Button, {
262
- label: t("neetoThankYou.thankYou.uniqueSubmissionLinkText"),
263
- to: uniqueSubmissionLink
264
- }), /*#__PURE__*/React__default.createElement(Button, {
265
- label: t("neetoThankYou.common.ok"),
266
- style: "text",
267
- onClick: function onClick() {
268
- return setIsOpen(false);
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__*/React__default.createElement("div", {
307
- className: "flex flex-col gap-4"
308
- }, hasImageUploader && /*#__PURE__*/React__default.createElement("div", {
309
- className: "flex flex-col gap-2"
310
- }, /*#__PURE__*/React__default.createElement(Label$1, null, t("neetoThankYou.thankYou.imageLabel")), /*#__PURE__*/React__default.createElement(Image, null)), /*#__PURE__*/React__default.createElement("div", {
311
- className: "flex flex-col gap-2"
312
- }, /*#__PURE__*/React__default.createElement(FormikEditor, {
313
- required: true,
314
- "data-cy": "thank-you-message-editor",
315
- label: t("neetoThankYou.thankYou.messageLabel"),
316
- name: "message",
317
- ref: editorRef
318
- })), !disableSocialShare && /*#__PURE__*/React__default.createElement(Switch, {
319
- label: t("neetoThankYou.thankYou.socialShareIcons"),
320
- name: "socialSharingEnabled"
321
- }), !disableSubmitAnotherResponse && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Switch, {
322
- label: t("neetoThankYou.thankYou.showResubmitLink"),
323
- name: "showResubmitLink",
324
- className: classNames({
325
- "neeto-ui-switch--disabled": uniqueSubmissionEnabled
326
- }),
327
- onChange: handleResubmitLinkChange
328
- }), values.showResubmitLink && /*#__PURE__*/React__default.createElement(Input, {
329
- required: true,
330
- label: t("neetoThankYou.thankYou.resubmitLinkText"),
331
- name: "resubmitLinkText"
332
- })), /*#__PURE__*/React__default.createElement(ResubmissionWarningModal, {
333
- uniqueSubmissionLink: uniqueSubmissionLink,
334
- isOpen: isUniqueSubmissionWarningModalOpen,
335
- setIsOpen: setIsUniqueSubmissionWarningModalOpen
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__*/React__default.createElement("div", {
367
- className: "neeto-thank-you-configuration__branding-wrap"
368
- }, /*#__PURE__*/React__default.createElement("div", {
369
- className: "neeto-thank-you-configuration__nav"
370
- }, /*#__PURE__*/React__default.createElement("div", {
371
- className: "neeto-thank-you-configuration__nav-footer"
372
- }, /*#__PURE__*/React__default.createElement(Trans, {
373
- i18nKey: brandingInfo.displayText,
374
- components: _objectSpread$1({
375
- signUpLink: /*#__PURE__*/React__default.createElement("a", {
376
- className: "neeto-thank-you-configuration__link",
377
- href: buildSignUpUrl(appName),
378
- rel: "noreferrer",
379
- target: "_blank"
380
- }),
381
- span: /*#__PURE__*/React__default.createElement("span", null)
382
- }, (_brandingInfo$additio = brandingInfo.additionalComponents) !== null && _brandingInfo$additio !== void 0 ? _brandingInfo$additio : {})
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__*/React__default.createElement("div", {
419
- className: "neeto-thank-you-configuration__social-share"
420
- }, /*#__PURE__*/React__default.createElement("h3", {
421
- className: "neeto-thank-you-configuration__social-share-title"
422
- }, t("neetoThankYou.thankYou.socialShareHeading")), /*#__PURE__*/React__default.createElement("div", {
423
- className: "neeto-thank-you-configuration-social-follow"
424
- }, socialHandles === null || socialHandles === void 0 ? void 0 : socialHandles.map(function (data, idx) {
425
- var Icon = data.icon,
426
- generateShareUrl = data.generateShareUrl;
427
- return /*#__PURE__*/React__default.createElement("div", {
428
- className: "neeto-thank-you-configuration-social-follow__item",
429
- key: idx
430
- }, /*#__PURE__*/React__default.createElement("a", {
431
- href: generateShareUrl(publicLinkId),
432
- rel: "noreferrer",
433
- target: "_blank"
434
- }, /*#__PURE__*/React__default.createElement(Icon, null)));
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__*/React__default.createElement("div", {
453
- className: "flex flex-col"
454
- }, /*#__PURE__*/React__default.createElement(Typography, {
455
- className: "mb-3 block md:hidden",
456
- lineHeight: "normal",
457
- style: "h3",
458
- weight: "semibold"
459
- }, t("neetoThankYou.thankYou.preview")), /*#__PURE__*/React__default.createElement("div", {
460
- className: classNames("neeto-thank-you-configuration-preview", {
461
- "neeto-thank-you-configuration-alignment--left": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.left,
462
- "neeto-thank-you-configuration-alignment--center": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.center,
463
- "pointer-events-none": !isPublished
464
- })
465
- }, /*#__PURE__*/React__default.createElement("div", {
466
- className: "neeto-thank-you-configuration-preview__browser-header"
467
- }, /*#__PURE__*/React__default.createElement(SvgBrowserControls, null)), /*#__PURE__*/React__default.createElement("div", {
468
- className: "neeto-thank-you-configuration"
469
- }, /*#__PURE__*/React__default.createElement("main", {
470
- className: "neeto-thank-you-configuration__main"
471
- }, /*#__PURE__*/React__default.createElement("div", {
472
- className: "neeto-thank-you-configuration__box"
473
- }, !isEmpty(values === null || values === void 0 ? void 0 : values.imageUrl) && /*#__PURE__*/React__default.createElement("div", {
474
- className: "neeto-thank-you-configuration__img"
475
- }, /*#__PURE__*/React__default.createElement("img", {
476
- alt: "",
477
- src: values.imageUrl
478
- })), (values === null || values === void 0 ? void 0 : values.message) && /*#__PURE__*/React__default.createElement("div", {
479
- className: "neeto-thank-you-configuration__description"
480
- }, /*#__PURE__*/React__default.createElement(MemoizedEditorContent, {
481
- content: values.message,
482
- "data-cy": "preview-editor-content"
483
- })), (values === null || values === void 0 ? void 0 : values.showResubmitLink) && /*#__PURE__*/React__default.createElement("a", {
484
- className: "neeto-thank-you-configuration__resubmit",
485
- href: resubmitLink
486
- }, (_values$resubmitLinkT = values === null || values === void 0 ? void 0 : values.resubmitLinkText) !== null && _values$resubmitLinkT !== void 0 ? _values$resubmitLinkT : t("neetoThankYou.thankYou.resubmit")), (values === null || values === void 0 ? void 0 : values.socialSharingEnabled) && /*#__PURE__*/React__default.createElement(SocialShare, {
487
- publicLinkId: publicLinkId,
488
- socialHandles: socialHandles
489
- })))), (values === null || values === void 0 ? void 0 : values.brandingEnabled) && isPresent(brandingInfo) && /*#__PURE__*/React__default.createElement(BrandingInfo, {
490
- appName: appName,
491
- brandingInfo: brandingInfo
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__*/React__default.createElement(Input, {
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__*/React__default.createElement(Link, null)
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__*/React__default.createElement(Typography, {
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
- }, label, /*#__PURE__*/React__default.createElement("span", {
518
- className: "block text-xs font-normal leading-snug",
519
- "data-cy": "neeto-thank-you-configuration-".concat(hyphenate(kind), "-description")
520
- }, description));
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__*/React__default.createElement("div", {
557
- className: "flex h-full w-full items-center justify-center"
558
- }, /*#__PURE__*/React__default.createElement(PageLoader, null));
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__*/React__default.createElement(NeetoUIForm, {
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
- }, function (_ref2) {
586
- var values = _ref2.values;
587
- return /*#__PURE__*/React__default.createElement("div", {
588
- className: "grid grid-cols-1 gap-10 pb-6 md:grid-cols-2 md:gap-6"
589
- }, /*#__PURE__*/React__default.createElement("div", {
590
- className: "flex flex-col"
591
- }, blockNavigation && /*#__PURE__*/React__default.createElement(BlockNavigation, null), !disableRadioSelection && /*#__PURE__*/React__default.createElement("div", {
592
- className: "mb-6 w-full"
593
- }, /*#__PURE__*/React__default.createElement(Radio, {
594
- containerClassName: "grid grid-cols-1 sm:grid-cols-2 gap-6 items-stretch w-full",
595
- name: "kind"
596
- }, Object.values(FORM_OPTIONS).map(function (option) {
597
- return /*#__PURE__*/React__default.createElement(Radio.Item, {
598
- key: option.kind,
599
- label: /*#__PURE__*/React__default.createElement(Label, option),
600
- name: "kind",
601
- value: option.kind,
602
- className: classNames("neeto-thank-you-configuration-radio__item", {
603
- active: values.kind === option.kind
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
- }))), values.kind === FORM_OPTIONS.customize.kind ? /*#__PURE__*/React__default.createElement(Customize, {
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__*/React__default.createElement("div", {
646
- className: "w-full px-6"
647
- }, /*#__PURE__*/React__default.createElement(NeetoUIHeader, {
648
- breadcrumbs: breadcrumbs,
649
- size: "small",
650
- title: t("neetoThankYou.common.thankYou")
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
- _ref$brandingInfo = _ref.brandingInfo,
682
- brandingInfo = _ref$brandingInfo === void 0 ? {} : _ref$brandingInfo;
683
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, customHeader || /*#__PURE__*/React__default.createElement(Header, {
684
- breadcrumbs: breadcrumbs
685
- }), /*#__PURE__*/React__default.createElement(Scrollable, {
686
- className: "w-full p-6 pt-0"
687
- }, /*#__PURE__*/React__default.createElement("div", {
688
- className: "mx-auto h-full max-w-7xl"
689
- }, /*#__PURE__*/React__default.createElement(Form, {
690
- appName: appName,
691
- blockNavigation: blockNavigation,
692
- brandingInfo: brandingInfo,
693
- disableRadioSelection: disableRadioSelection,
694
- disableSubmitAnotherResponse: disableSubmitAnotherResponse,
695
- entityId: entityId,
696
- hasImageUploader: hasImageUploader,
697
- isPublished: isPublished,
698
- onConfigUpdateSuccess: onConfigUpdateSuccess,
699
- publicLinkId: publicLinkId,
700
- redirectToOnCancel: redirectToOnCancel,
701
- resubmitLink: resubmitLink,
702
- socialHandles: socialHandles,
703
- thankYouTextAlignment: thankYouTextAlignment,
704
- uniqueSubmissionEnabled: uniqueSubmissionEnabled,
705
- uniqueSubmissionLink: uniqueSubmissionLink
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__*/React__default.createElement("div", {
741
- className: "neeto-thank-you-configuration"
742
- }, /*#__PURE__*/React__default.createElement(PageLoader, null));
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
- _ref$brandingInfo = _ref.brandingInfo,
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__*/React__default.createElement(PageLoader, null);
809
+ return /*#__PURE__*/jsx(PageLoader, {});
768
810
  }
769
- return /*#__PURE__*/React__default.createElement("div", {
770
- className: "neeto-thank-you-configuration"
771
- }, /*#__PURE__*/React__default.createElement("main", {
772
- className: "neeto-thank-you-configuration__main"
773
- }, /*#__PURE__*/React__default.createElement("div", {
774
- className: "neeto-thank-you-configuration__box"
775
- }, !isEmpty(thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.imageUrl) && /*#__PURE__*/React__default.createElement("div", {
776
- className: "neeto-thank-you-configuration__img"
777
- }, /*#__PURE__*/React__default.createElement("img", {
778
- alt: "",
779
- src: thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.imageUrl
780
- })), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.message) && /*#__PURE__*/React__default.createElement("div", {
781
- className: "neeto-thank-you-configuration__description"
782
- }, /*#__PURE__*/React__default.createElement(EditorContent, {
783
- content: thankYouConfiguration.message
784
- })), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.showResubmitLink) && /*#__PURE__*/React__default.createElement("a", {
785
- className: "neeto-thank-you-configuration__resubmit",
786
- href: isDraftPreview ? buildDraftUrl(resubmitLink) : resubmitLink
787
- }, (_thankYouConfiguratio = thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.resubmitLinkText) !== null && _thankYouConfiguratio !== void 0 ? _thankYouConfiguratio : t("neetoThankYou.common.resubmit")), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.socialSharingEnabled) && /*#__PURE__*/React__default.createElement(SocialShare, {
788
- publicLinkId: publicLinkId,
789
- socialHandles: socialHandles
790
- }), isDraftPreview && /*#__PURE__*/React__default.createElement(Typography, {
791
- style: "body3"
792
- }, t("neetoThankYou.thankYou.draftVersionForm")))), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.brandingEnabled) && isPresent(brandingInfo) && /*#__PURE__*/React__default.createElement(BrandingInfo, {
793
- appName: appName,
794
- brandingInfo: brandingInfo
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}}