@hhgtech/hhg-components 1.29.80 → 1.29.82
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/build/{index-1250dd06.js → WhatsApp-46f4f408.js} +24 -276
- package/build/adapters.js +17 -16
- package/build/atoms.js +102 -0
- package/build/babyGrowth.js +162 -164
- package/build/cache.js +3 -3
- package/build/care.js +17 -17
- package/build/components.js +181 -163
- package/build/{constants-ca71f9e5.js → constants-223c01fc.js} +2 -2
- package/build/{constants-4e7c419e.js → constants-8743b014.js} +0 -136
- package/build/constants-a78fa8b3.js +318 -0
- package/build/constants-f182fc32.js +425 -0
- package/build/constants.js +3 -3
- package/build/{core-bb2587e7.js → core-9d69a722.js} +2 -2
- package/build/{dataTransform-469b75eb.js → dataTransform-ded2692d.js} +1 -1
- package/build/{index-5d9ad07e.js → dataTransform-e39297c1.js} +3 -52
- package/build/defaultClassWrapper-b7719693.js +21 -0
- package/build/ecom.js +5 -5
- package/build/esm/WhatsApp-c599b715.js +46 -0
- package/build/esm/adapters.js +17 -16
- package/build/esm/atoms.js +59 -0
- package/build/esm/babyGrowth.js +87 -89
- package/build/esm/cache.js +3 -3
- package/build/esm/care.js +17 -17
- package/build/esm/components.js +91 -73
- package/build/esm/constants-a5827634.js +307 -0
- package/build/esm/{constants-7661ce64.js → constants-bb470362.js} +2 -2
- package/build/esm/{constants-508ba335.js → constants-f6b2e49d.js} +1 -127
- package/build/esm/constants-fa475b0f.js +417 -0
- package/build/esm/constants.js +3 -3
- package/build/esm/{core-5a22b83e.js → core-80bfe8b7.js} +2 -2
- package/build/esm/{dataTransform-f5db5afb.js → dataTransform-55f67eed.js} +1 -1
- package/build/esm/{index-9b54376f.js → dataTransform-623716c3.js} +5 -53
- package/build/esm/defaultClassWrapper-00903c00.js +15 -0
- package/build/esm/ecom.js +5 -5
- package/build/esm/fixedBottomAdBlock-60a5d48f.js +3474 -0
- package/build/esm/footer.js +18 -18
- package/build/esm/gAssets.js +4 -4
- package/build/esm/{getDynamicHealthTool-09fda8b3.js → getDynamicHealthTool-82855adc.js} +4 -4
- package/build/esm/{getSocialList-96301dbb.js → getSocialList-7d2cf48d.js} +5 -6
- package/build/esm/healthToolsForm.js +40 -0
- package/build/esm/healthToolsForms.d.ts +7 -0
- package/build/esm/hooks.js +17 -17
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-da2b8f22.js → index-01405723.js} +12 -11
- package/build/esm/index-01b5d2e9.js +202 -0
- package/build/esm/index-02d3f05b.js +1681 -0
- package/build/esm/{index-82861dba.js → index-046778af.js} +2 -2
- package/build/esm/{index-df29c4e0.js → index-049e0270.js} +33 -5
- package/build/esm/index-07f3f47e.js +14 -0
- package/build/esm/index-0b745f46.js +1349 -0
- package/build/esm/{index-e68d4285.js → index-0ca9b175.js} +2 -2
- package/build/esm/{index-c4699d44.js → index-0cd3523c.js} +35 -176
- package/build/esm/index-0ee66974.js +95 -0
- package/build/esm/index-10ab6596.js +489 -0
- package/build/esm/{index-5773eb18.js → index-13d8dd4b.js} +6 -6
- package/build/esm/{index.styled-9e147e72.js → index-1c9b481b.js} +21 -3
- package/build/esm/index-1d3c6ce7.js +195 -0
- package/build/esm/{index-474e0ae5.js → index-21256394.js} +2 -13
- package/build/esm/{index-2d47a346.js → index-219e3a35.js} +11 -10
- package/build/esm/{index-679d5383.js → index-29908d2c.js} +1 -1
- package/build/esm/{utils-ff5d88a2.js → index-2dc7803d.js} +71 -105
- package/build/esm/{index-4dcdce19.js → index-5723381f.js} +2 -2
- package/build/esm/{index-c807ef87.js → index-6210f454.js} +3 -3
- package/build/esm/index-7a1ea734.js +100 -0
- package/build/esm/{index-53a86337.js → index-7c384ae6.js} +5 -5
- package/build/esm/index-8eb04f36.js +130 -0
- package/build/esm/index-8fcf671c.js +335 -0
- package/build/esm/{index-80f4d7df.js → index-9471fca1.js} +2 -2
- package/build/esm/{index-92eedeb0.js → index-9b3a8b6d.js} +12 -201
- package/build/esm/{index-3c7f109c.js → index-9b9c1499.js} +2 -2
- package/build/esm/index-9f99909b.js +54 -0
- package/build/esm/index-ac2a8f95.js +1114 -0
- package/build/esm/index-acf8b60e.js +42 -0
- package/build/esm/index-ad1c7c38.js +275 -0
- package/build/esm/{index-bcd13f1d.js → index-bcedec73.js} +13 -12
- package/build/esm/{index-ef855343.js → index-c013ba1b.js} +4 -4
- package/build/esm/index-c2584051.js +262 -0
- package/build/esm/{types-957334f2.js → index-c430773c.js} +559 -3519
- package/build/esm/index-cdc50618.js +25 -0
- package/build/esm/{index-77dddeb9.js → index-cfedca38.js} +2 -2
- package/build/esm/index-d6a5f5cf.js +557 -0
- package/build/esm/index-e0b0d6a2.js +847 -0
- package/build/esm/index-ea63e0d2.js +148 -0
- package/build/esm/{index-32e2b169.js → index-f22f6e6e.js} +65 -28
- package/build/esm/index-f4b938f2.js +18 -0
- package/build/esm/index-f660abb7.js +156 -0
- package/build/esm/index-fa67d66e.js +789 -0
- package/build/esm/index.js +98 -73
- package/build/esm/labelSorting-7351409a.js +47 -0
- package/build/esm/lead.js +23 -33
- package/build/esm/logoIcon-3a581efb.js +104 -0
- package/build/esm/mantine.js +22 -20
- package/build/esm/misc.js +21 -21
- package/build/esm/molecules.js +88 -0
- package/build/esm/navigation.js +37 -37
- package/build/esm/onboardingV2.js +26 -35
- package/build/esm/organisms.js +57 -0
- package/build/esm/pwg.js +19 -19
- package/build/esm/{routing-7bc3e320.js → routing-9e330438.js} +2 -2
- package/build/esm/subot.js +31 -27
- package/build/esm/surveyOrPremiumBanner.js +45 -0
- package/build/esm/surveyQuestionCard.js +13 -0
- package/build/esm/surveyThankyouCard-ec204631.js +446 -0
- package/build/esm/together.js +52 -45
- package/build/esm/togetherAtoms.js +41 -0
- package/build/esm/togetherComponentGlobalContext.js +12 -0
- package/build/esm/togetherMolecules.js +53 -0
- package/build/esm/togetherOrganisms.js +57 -0
- package/build/esm/treePopoverMenu-cb214db6.js +332 -0
- package/build/esm/types-721e7a66.js +5 -0
- package/build/esm/{types-ee1be1e3.js → types-ffcf5fb4.js} +13 -13
- package/build/esm/types.js +1 -1
- package/build/esm/{useCategory-7e020652.js → useCategory-553bee0b.js} +5 -5
- package/build/esm/{useHealthToolCache-c70e4fd5.js → useHealthToolCache-6ce1724e.js} +2 -2
- package/build/esm/{useMantineLocale-1373e175.js → useMantineLocale-453f8013.js} +3 -3
- package/build/esm/{usePlacesAutocomplete-4bfe976e.js → usePlacesAutocomplete-8925d4fb.js} +1 -1
- package/build/esm/useTogetherAuthRequiredAction.js +60 -0
- package/build/esm/{useTranslations-adad3b06.js → useTranslations-b970f667.js} +1 -1
- package/build/esm/{utils-dee27bfd.js → utils-3b29eb79.js} +8 -356
- package/build/esm/{utils-b14c10f9.js → utils-6d45bdd1.js} +1 -1
- package/build/esm/vaccination.js +18 -29
- package/build/fixedBottomAdBlock-0129a006.js +3521 -0
- package/build/footer.js +18 -18
- package/build/gAssets.js +4 -4
- package/build/{getDynamicHealthTool-357666f7.js → getDynamicHealthTool-f08b5fab.js} +4 -4
- package/build/{getSocialList-c1404aff.js → getSocialList-8cc32f7c.js} +8 -9
- package/build/healthToolsForm.js +54 -0
- package/build/healthToolsForms.d.ts +7 -0
- package/build/hooks.js +17 -17
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/index-00a78d81.js +565 -0
- package/build/index-077bf48f.js +803 -0
- package/build/{index-bf6e5e4e.js → index-0b727664.js} +5 -5
- package/build/{index-917c975c.js → index-10760994.js} +37 -9
- package/build/index-130e0f35.js +1693 -0
- package/build/{index-82a3ba38.js → index-16ed0d98.js} +68 -33
- package/build/{index-040620f6.js → index-1e1d8eb1.js} +13 -12
- package/build/{index-e60c98f8.js → index-1fdf2f01.js} +2 -2
- package/build/{index-61ef343d.js → index-206afefb.js} +4 -4
- package/build/{types-c8956642.js → index-2afbeb3d.js} +761 -3727
- package/build/{index.styled-8aca5145.js → index-2fd9063e.js} +22 -4
- package/build/index-33432b02.js +270 -0
- package/build/index-3eb666e6.js +202 -0
- package/build/{index-94a2b0f9.js → index-405faafa.js} +2 -2
- package/build/index-4357a324.js +136 -0
- package/build/index-466a2c32.js +1362 -0
- package/build/index-4b7d4b5b.js +156 -0
- package/build/{index-5029b5d8.js → index-4bc690c9.js} +1 -1
- package/build/index-4cdcdbbe.js +498 -0
- package/build/index-53e14542.js +102 -0
- package/build/{index-91027d35.js → index-54aeefca.js} +2 -2
- package/build/index-60f6d762.js +1127 -0
- package/build/{index-858f60e0.js → index-64d8db08.js} +2 -2
- package/build/index-6aeb5ff5.js +866 -0
- package/build/index-71843eb4.js +61 -0
- package/build/index-765ed75d.js +209 -0
- package/build/index-7953fb8e.js +167 -0
- package/build/{index-d710511f.js → index-7ecc69af.js} +12 -11
- package/build/index-82c85f9d.js +277 -0
- package/build/index-9e8877c0.js +25 -0
- package/build/index-a2664204.js +107 -0
- package/build/{index-c67602d7.js → index-a6a9855f.js} +1 -13
- package/build/index-a8680a58.js +49 -0
- package/build/{index-ed587907.js → index-a9bbb5aa.js} +11 -10
- package/build/{utils-263a60f7.js → index-a9bdf889.js} +76 -120
- package/build/{index-f0a532c7.js → index-b66ae554.js} +6 -6
- package/build/index-ca616373.js +20 -0
- package/build/{index-b0414701.js → index-d9919cd2.js} +57 -200
- package/build/index-dd074159.js +32 -0
- package/build/{index-94fd9ea6.js → index-dff7ee1b.js} +32 -222
- package/build/{index-3a03bb34.js → index-e3bbd009.js} +2 -2
- package/build/index-ec34e358.js +343 -0
- package/build/{index-8c826f3e.js → index-f222ee45.js} +2 -2
- package/build/{index-2b32b21e.js → index-fd3e1d16.js} +2 -2
- package/build/index.js +251 -226
- package/build/labelSorting-f86081b7.js +53 -0
- package/build/lead.js +29 -39
- package/build/logoIcon-21a16853.js +110 -0
- package/build/mantine.js +24 -23
- package/build/misc.js +21 -21
- package/build/molecules.js +149 -0
- package/build/navigation.js +37 -37
- package/build/onboardingV2.js +45 -54
- package/build/organisms.js +74 -0
- package/build/pwg.js +19 -19
- package/build/{routing-bc8197d8.js → routing-d6c9099a.js} +2 -2
- package/build/subot.js +115 -111
- package/build/surveyOrPremiumBanner.js +53 -0
- package/build/surveyQuestionCard.js +22 -0
- package/build/surveyThankyouCard-5b23b8f6.js +454 -0
- package/build/together.js +100 -93
- package/build/togetherAtoms.js +55 -0
- package/build/togetherComponentGlobalContext.js +26 -0
- package/build/togetherMolecules.js +86 -0
- package/build/togetherOrganisms.js +71 -0
- package/build/treePopoverMenu-c0cb395f.js +343 -0
- package/build/{types-6996fb20.js → types-8d9c5f21.js} +13 -13
- package/build/types-b25ffde0.js +7 -0
- package/build/types.js +1 -1
- package/build/{useCategory-7d1f8a7d.js → useCategory-b695fd3a.js} +5 -5
- package/build/{useHealthToolCache-b7dea4aa.js → useHealthToolCache-048807ea.js} +2 -2
- package/build/{useMantineLocale-b243f628.js → useMantineLocale-0d63dfea.js} +3 -3
- package/build/{usePlacesAutocomplete-08b86d2d.js → usePlacesAutocomplete-9520e525.js} +1 -1
- package/build/useTogetherAuthRequiredAction.js +70 -0
- package/build/{useTranslations-d5456a98.js → useTranslations-685f989b.js} +1 -1
- package/build/{utils-9f62698f.js → utils-169c6a7d.js} +16 -375
- package/build/{utils-d421a448.js → utils-1a00c0f8.js} +1 -1
- package/build/vaccination.js +58 -69
- package/package.json +1 -1
- package/build/Instagram-91ba1e26.js +0 -32
- package/build/esm/Instagram-319a8e34.js +0 -26
- package/build/esm/index-13bf84f4.js +0 -298
- package/build/esm/index-1a3f36c3.js +0 -1086
- package/build/esm/index-800b956a.js +0 -7245
- package/build/esm/index-aebf96f3.js +0 -33
- package/build/esm/index-d48b5db6.js +0 -71
- package/build/esm/index-d5b66388.js +0 -23
- package/build/esm/index.styles-0ef0135c.js +0 -1322
- package/build/index-0523771b.js +0 -7324
- package/build/index-20ebc0bd.js +0 -30
- package/build/index-dbf560f2.js +0 -1100
- package/build/index-efcbac97.js +0 -39
- package/build/index-f5103542.js +0 -77
- package/build/index.styles-2bdfde5f.js +0 -1361
- /package/build/{BMI_BOYS.percentile.monthly-c38ce03a.js → BMI_BOYS.percentile.monthly-1aa95e30.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-1eccee42.js → BMI_BOYS.percentile.weekly-61d78e1c.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-0e7d5cb6.js → BMI_BOYS.percentile.yearly-f80e040e.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-f72f392f.js → BMI_BOYS.zscore.monthly-a6c7c8ff.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-94fd04e6.js → BMI_BOYS.zscore.weekly-742f7028.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-90d5e091.js → BMI_BOYS.zscore.yearly-c19cccd5.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-de3a9a14.js → BMI_GIRLS.percentile.monthly-089d3981.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-1e1ce2b7.js → BMI_GIRLS.percentile.weekly-0cc52cda.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-70a44f31.js → BMI_GIRLS.percentile.yearly-10bc603f.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-be4399a5.js → BMI_GIRLS.zscore.monthly-c3fe57f3.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-6121376b.js → BMI_GIRLS.zscore.weekly-b83a54db.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-822e7686.js → BMI_GIRLS.zscore.yearly-5f13cda2.js} +0 -0
- /package/build/{ChevronDown-f9d31306.js → ChevronDown-2fd86d66.js} +0 -0
- /package/build/{Close-27e0dcf1.js → Close-711196b0.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-5e094c3e.js → HEAD CIRCUM_BOYS.percentile.monthly-03b8d7fb.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-24f827d8.js → HEAD CIRCUM_BOYS.percentile.weekly-9ebd3eb6.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-d7478410.js → HEAD CIRCUM_BOYS.percentile.yearly-8e97b738.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-1123cad6.js → HEAD CIRCUM_BOYS.zscore.monthly-e7892261.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-a5b55615.js → HEAD CIRCUM_BOYS.zscore.weekly-47c5af84.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-0d818764.js → HEAD CIRCUM_BOYS.zscore.yearly-9a1bc325.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-dddf5ad9.js → HEAD CIRCUM_GIRLS.percentile.monthly-d84491d7.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-a80d6989.js → HEAD CIRCUM_GIRLS.percentile.weekly-a6f38c3e.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-01850b67.js → HEAD CIRCUM_GIRLS.percentile.yearly-5771d277.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-82890053.js → HEAD CIRCUM_GIRLS.zscore.monthly-e3633bcc.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-069f8c8f.js → HEAD CIRCUM_GIRLS.zscore.weekly-23b0ab1a.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-ae5ef237.js → HEAD CIRCUM_GIRLS.zscore.yearly-20f29cf1.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-d0da1664.js → HEIGHT_BOYS.percentile.monthly-57cc12ee.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-55446b8a.js → HEIGHT_BOYS.percentile.weekly-c788506a.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-f2f5b19f.js → HEIGHT_BOYS.percentile.yearly-ac56c1f2.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-e6ed98ef.js → HEIGHT_BOYS.zscore.monthly-1bb78253.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-d0d37479.js → HEIGHT_BOYS.zscore.weekly-22737c43.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-4023b808.js → HEIGHT_BOYS.zscore.yearly-90f6cd0a.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-6d9aeadc.js → HEIGHT_GIRLS.percentile.monthly-019f80d2.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-2087c9b4.js → HEIGHT_GIRLS.percentile.weekly-ceed9817.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-f98d8b05.js → HEIGHT_GIRLS.percentile.yearly-3e5192ac.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-99d299e3.js → HEIGHT_GIRLS.zscore.monthly-f8fca0b6.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-c46ed349.js → HEIGHT_GIRLS.zscore.weekly-827b17e8.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-fddefca4.js → HEIGHT_GIRLS.zscore.yearly-3cdb483d.js} +0 -0
- /package/build/{Visible-01dfaec9.js → Visible-515a4eec.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-cead8ece.js → WEIGHT_BOYS.percentile.monthly-2ecbd498.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-a97fa31a.js → WEIGHT_BOYS.percentile.weekly-75c9c25c.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-c2c41945.js → WEIGHT_BOYS.percentile.yearly-03e7cea6.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-d8de7dc2.js → WEIGHT_BOYS.zscore.monthly-2ff9fb56.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-41a6f6bf.js → WEIGHT_BOYS.zscore.weekly-e9f7fe2d.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-5762fa8a.js → WEIGHT_BOYS.zscore.yearly-4a96f34f.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-526fb18a.js → WEIGHT_GIRLS.percentile.monthly-5bf09e30.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-6c63ed2b.js → WEIGHT_GIRLS.percentile.weekly-f737ae23.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-0ecdbd3a.js → WEIGHT_GIRLS.percentile.yearly-56ebc8eb.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-0c353536.js → WEIGHT_GIRLS.zscore.monthly-4697d3b5.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-97898ff6.js → WEIGHT_GIRLS.zscore.weekly-3633820e.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-cbebe807.js → WEIGHT_GIRLS.zscore.yearly-a9a04790.js} +0 -0
- /package/build/{animation-8605b5bb.js → animation-85d012ee.js} +0 -0
- /package/build/{cart-ab5762b8.js → cart-8877bd63.js} +0 -0
- /package/build/{cookieHelper-b2132ffc.js → cookieHelper-86ae022e.js} +0 -0
- /package/build/{doctor-f121fd79.js → doctor-2c14fed1.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-e507536d.js → BMI_BOYS.percentile.monthly-42ff2c64.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-3cbf7392.js → BMI_BOYS.percentile.weekly-b4a6c521.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-c7d54bc3.js → BMI_BOYS.percentile.yearly-d3bc1a77.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-4d09aca0.js → BMI_BOYS.zscore.monthly-c4506dfa.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-319b78c5.js → BMI_BOYS.zscore.weekly-ddf3b3f9.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-764732c5.js → BMI_BOYS.zscore.yearly-e0e3139e.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-5a8e4069.js → BMI_GIRLS.percentile.monthly-96686bcc.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-a2fe6df1.js → BMI_GIRLS.percentile.weekly-c3106a65.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-810fe911.js → BMI_GIRLS.percentile.yearly-b38c1f1f.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-afab03b0.js → BMI_GIRLS.zscore.monthly-f8a7836f.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-8f4e7198.js → BMI_GIRLS.zscore.weekly-4c1fc771.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-7f043621.js → BMI_GIRLS.zscore.yearly-dce5e66a.js} +0 -0
- /package/build/esm/{ChevronDown-d24fd24b.js → ChevronDown-31ea3e19.js} +0 -0
- /package/build/esm/{Close-6243d246.js → Close-40d598bc.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-91c12176.js → HEAD CIRCUM_BOYS.percentile.monthly-34e3fa1c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-40e77c68.js → HEAD CIRCUM_BOYS.percentile.weekly-d3f3568f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-1a284ec4.js → HEAD CIRCUM_BOYS.percentile.yearly-dfae3ad2.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-16f716a6.js → HEAD CIRCUM_BOYS.zscore.monthly-95840c2f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-07d20112.js → HEAD CIRCUM_BOYS.zscore.weekly-8b198c1c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-1201a10a.js → HEAD CIRCUM_BOYS.zscore.yearly-b7d639ad.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-a6348baf.js → HEAD CIRCUM_GIRLS.percentile.monthly-47caa070.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-af26363f.js → HEAD CIRCUM_GIRLS.percentile.weekly-bae46665.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-e7637928.js → HEAD CIRCUM_GIRLS.percentile.yearly-81989cdd.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-9be0e0ca.js → HEAD CIRCUM_GIRLS.zscore.monthly-f2f7d985.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-3ffe9dcd.js → HEAD CIRCUM_GIRLS.zscore.weekly-e287ddb7.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-d7226db1.js → HEAD CIRCUM_GIRLS.zscore.yearly-8790b62a.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-c2e21892.js → HEIGHT_BOYS.percentile.monthly-5d2b6466.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-22018f1e.js → HEIGHT_BOYS.percentile.weekly-a38ad13e.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-391cd377.js → HEIGHT_BOYS.percentile.yearly-e4841712.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-e11f50f4.js → HEIGHT_BOYS.zscore.monthly-d8e722f8.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-8e2c8306.js → HEIGHT_BOYS.zscore.weekly-a92ea3ca.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-78e974bb.js → HEIGHT_BOYS.zscore.yearly-3af1adce.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-0a49ff89.js → HEIGHT_GIRLS.percentile.monthly-c5203801.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-5e158a8e.js → HEIGHT_GIRLS.percentile.weekly-4c25d07f.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-f5544ab2.js → HEIGHT_GIRLS.percentile.yearly-f91e2e27.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-92f67ec2.js → HEIGHT_GIRLS.zscore.monthly-b2a60aca.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-f5d11f32.js → HEIGHT_GIRLS.zscore.weekly-0a98c520.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-4fe6aad9.js → HEIGHT_GIRLS.zscore.yearly-8070d58f.js} +0 -0
- /package/build/esm/{Visible-7f408f98.js → Visible-e3e4fb6f.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-b09ae73a.js → WEIGHT_BOYS.percentile.monthly-b262b97d.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-733a24a9.js → WEIGHT_BOYS.percentile.weekly-7e817f9f.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-2bfcfc93.js → WEIGHT_BOYS.percentile.yearly-b7f1786a.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-c0d3a746.js → WEIGHT_BOYS.zscore.monthly-014af835.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-b41ff498.js → WEIGHT_BOYS.zscore.weekly-4577f724.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-15bb7570.js → WEIGHT_BOYS.zscore.yearly-08fd3f13.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-5b79dea8.js → WEIGHT_GIRLS.percentile.monthly-a6e1aa0d.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-33052637.js → WEIGHT_GIRLS.percentile.weekly-4c0b6f94.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-64382b53.js → WEIGHT_GIRLS.percentile.yearly-bf689a3a.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-63f19584.js → WEIGHT_GIRLS.zscore.monthly-f82fc3c8.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-938ebce2.js → WEIGHT_GIRLS.zscore.weekly-854ce987.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-016e1cfc.js → WEIGHT_GIRLS.zscore.yearly-2a3b869a.js} +0 -0
- /package/build/esm/{animation-bf170ee9.js → animation-85d9a0ed.js} +0 -0
- /package/build/esm/{cart-5bdb4fa5.js → cart-1ac23ce7.js} +0 -0
- /package/build/esm/{cookieHelper-ff6c13b4.js → cookieHelper-6c3b4790.js} +0 -0
- /package/build/esm/{doctor-f4cadffb.js → doctor-e0c2476d.js} +0 -0
- /package/build/esm/{index-eeedf0f0.js → index-189d7601.js} +0 -0
- /package/build/esm/{index-b87433a0.js → index-21bca818.js} +0 -0
- /package/build/esm/{index-6c0f560b.js → index-266a32ff.js} +0 -0
- /package/build/esm/{index-528e64f4.js → index-8684181f.js} +0 -0
- /package/build/esm/{isProduction-2838b9ae.js → isProduction-1937d355.js} +0 -0
- /package/build/esm/{localizeNumberFormat-9303c122.js → localizeNumberFormat-1f000110.js} +0 -0
- /package/build/esm/{normalizeLink-38ab69f4.js → normalizeLink-7a93ebb9.js} +0 -0
- /package/build/esm/{number-fcae69c7.js → number-1d1ba14a.js} +0 -0
- /package/build/esm/{paths-d1c61fa8.js → paths-b83be1a0.js} +0 -0
- /package/build/esm/{theme-0af1cc3d.js → theme-7dadf4a1.js} +0 -0
- /package/build/esm/{translationsContext-036458b7.js → translationsContext-42a1fa63.js} +0 -0
- /package/build/esm/{tslib.es6-2673b49d.js → tslib.es6-06ba3978.js} +0 -0
- /package/build/esm/{useIsInit-2c5ff93d.js → useIsInit-f4dec279.js} +0 -0
- /package/build/esm/{useOutsideClick-7023de23.js → useOutsideClick-210c1134.js} +0 -0
- /package/build/esm/{useScrollbarSize-dfdab229.js → useScrollbarSize-909ae7ec.js} +0 -0
- /package/build/esm/{useUniqueId-d4b0bdd3.js → useUniqueId-5885911d.js} +0 -0
- /package/build/esm/{utils-511a24f4.js → utils-d7bbdb52.js} +0 -0
- /package/build/{index-18ddaa1b.js → index-1f3fc2e3.js} +0 -0
- /package/build/{index-5c400e5e.js → index-2de1eb4a.js} +0 -0
- /package/build/{index-bced434a.js → index-6fdcd09d.js} +0 -0
- /package/build/{index-c524c362.js → index-bc9e8eae.js} +0 -0
- /package/build/{isProduction-2e55aee3.js → isProduction-20cd663d.js} +0 -0
- /package/build/{localizeNumberFormat-2befc6e4.js → localizeNumberFormat-7ff6bd3a.js} +0 -0
- /package/build/{normalizeLink-0fd36e61.js → normalizeLink-d307f624.js} +0 -0
- /package/build/{number-92da0262.js → number-dddf656c.js} +0 -0
- /package/build/{paths-350514c4.js → paths-7da79c64.js} +0 -0
- /package/build/{theme-f410baf6.js → theme-be20929b.js} +0 -0
- /package/build/{translationsContext-11cafcfc.js → translationsContext-00fdb62e.js} +0 -0
- /package/build/{tslib.es6-4bc45883.js → tslib.es6-bd3f8718.js} +0 -0
- /package/build/{useIsInit-0f6d1879.js → useIsInit-e06b96f5.js} +0 -0
- /package/build/{useOutsideClick-e067cc79.js → useOutsideClick-d95a32b6.js} +0 -0
- /package/build/{useScrollbarSize-ed50b4a6.js → useScrollbarSize-1499b1c3.js} +0 -0
- /package/build/{useUniqueId-4ce69bff.js → useUniqueId-1af8848e.js} +0 -0
- /package/build/{utils-4849d92a.js → utils-15a9772e.js} +0 -0
|
@@ -0,0 +1,789 @@
|
|
|
1
|
+
import { a as __awaiter, _ as __rest } from './tslib.es6-06ba3978.js';
|
|
2
|
+
import React__default, { useState, useRef, useEffect, useCallback, useContext, useMemo } from 'react';
|
|
3
|
+
import { Info, Ask } from '@hhgtech/icons/other';
|
|
4
|
+
import { Checkbox, useMantineTheme, Popover } from '@mantine/core';
|
|
5
|
+
import { D as Dropdown } from './index-29908d2c.js';
|
|
6
|
+
import { u as useTranslations } from './useTranslations-b970f667.js';
|
|
7
|
+
import innertext from 'innertext';
|
|
8
|
+
import { t as theme } from './theme-7dadf4a1.js';
|
|
9
|
+
import './index-9b3a8b6d.js';
|
|
10
|
+
import '@mantine/dates';
|
|
11
|
+
import './index-6210f454.js';
|
|
12
|
+
import './index-189d7601.js';
|
|
13
|
+
import { C as CommonGAssets } from './index-9471fca1.js';
|
|
14
|
+
import './useMantineLocale-453f8013.js';
|
|
15
|
+
import { T as Text } from './index-5723381f.js';
|
|
16
|
+
import { B as Button } from './index-1d3c6ce7.js';
|
|
17
|
+
import '@mantine/hooks';
|
|
18
|
+
import './utils-d7bbdb52.js';
|
|
19
|
+
import { T as TogetherComponentGlobalContext, c as callApi, d as getApiPath, P as PATHS, b as callApiWithAuth } from './utils-3b29eb79.js';
|
|
20
|
+
import { u as useImagePicker, n as StyledCreatePostDescription, R as RichTextEditor, L as Loading, o as IconCloseCircle, p as highlightBadWords, q as decodeMention, r as decodePostUrl, s as getDefaultFailNoti, t as getPostFormData, v as editPost, w as createPost } from './index-c430773c.js';
|
|
21
|
+
import styled from '@emotion/styled';
|
|
22
|
+
import { B as BtnChoice } from './index-cdc50618.js';
|
|
23
|
+
import { g as formatTopic, b as formatPost } from './dataTransform-623716c3.js';
|
|
24
|
+
import { M as MAX_IMAGE_UPLOADS } from './constants-a5827634.js';
|
|
25
|
+
import { C as CardLink } from './index-10ab6596.js';
|
|
26
|
+
import { I as Input } from './index-f660abb7.js';
|
|
27
|
+
import debounce from 'lodash/debounce';
|
|
28
|
+
import ContentEditable from 'react-contenteditable';
|
|
29
|
+
import { Close, Check } from '@hhgtech/icons/core';
|
|
30
|
+
|
|
31
|
+
const StyledCreateNewPost = styled.div `
|
|
32
|
+
position: relative;
|
|
33
|
+
display: flex;
|
|
34
|
+
height: 100%;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
padding: 16px 24px;
|
|
37
|
+
|
|
38
|
+
.input-group-container {
|
|
39
|
+
flex: 1;
|
|
40
|
+
padding-right: 2px;
|
|
41
|
+
padding-left: 2px;
|
|
42
|
+
margin-bottom: 0.5rem;
|
|
43
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
44
|
+
overflow-y: auto;
|
|
45
|
+
scrollbar-width: none; /* Firefox */
|
|
46
|
+
&::-webkit-scrollbar {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.input-group {
|
|
52
|
+
:not(:last-child) {
|
|
53
|
+
margin-bottom: 0.6rem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
input:focus,
|
|
57
|
+
textarea:focus,
|
|
58
|
+
[contenteditable='true'] {
|
|
59
|
+
outline: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
label {
|
|
63
|
+
margin-bottom: 5px;
|
|
64
|
+
color: ${theme.colors.gray600};
|
|
65
|
+
/* font-family: 'Open Sans', sans-serif; */
|
|
66
|
+
font-size: 13px;
|
|
67
|
+
font-weight: bold;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.input-group-label {
|
|
71
|
+
margin-bottom: 5px;
|
|
72
|
+
color: ${theme.colors.gray600};
|
|
73
|
+
/* font-family: 'Open Sans', sans-serif; */
|
|
74
|
+
font-size: 13px;
|
|
75
|
+
font-weight: bold;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.input-notification {
|
|
79
|
+
display: flex;
|
|
80
|
+
|
|
81
|
+
& > img {
|
|
82
|
+
width: 16px;
|
|
83
|
+
height: 16px;
|
|
84
|
+
margin-top: 1.5px;
|
|
85
|
+
margin-right: 8px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.tag-list {
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.warning {
|
|
94
|
+
margin-top: 16px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.submit-btn {
|
|
98
|
+
width: 100%;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.switch-label {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.swich-input-group {
|
|
107
|
+
padding: 12px 16px;
|
|
108
|
+
border-radius: 8px;
|
|
109
|
+
background: ${theme.colors.neutral50};
|
|
110
|
+
|
|
111
|
+
&.askdoctor-switch {
|
|
112
|
+
background: ${theme.colors.primary50};
|
|
113
|
+
&.mb-color {
|
|
114
|
+
background: ${theme.mbColors.tonePink};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.mantine-Switch-labelWrapper {
|
|
119
|
+
flex-grow: 1;
|
|
120
|
+
}
|
|
121
|
+
.mantine-Checkbox-body {
|
|
122
|
+
display: flex;
|
|
123
|
+
width: 100%;
|
|
124
|
+
align-items: center;
|
|
125
|
+
justify-content: space-between;
|
|
126
|
+
}
|
|
127
|
+
.mantine-Switch-track {
|
|
128
|
+
margin-bottom: 0;
|
|
129
|
+
}
|
|
130
|
+
.label-txt {
|
|
131
|
+
font-weight: normal;
|
|
132
|
+
font-size: 14px;
|
|
133
|
+
color: ${theme.colors.gray800};
|
|
134
|
+
margin-left: 10px;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
`;
|
|
138
|
+
const StyledIsQuestion = styled.div `
|
|
139
|
+
display: flex;
|
|
140
|
+
width: 100%;
|
|
141
|
+
align-items: center;
|
|
142
|
+
justify-content: space-between;
|
|
143
|
+
padding: 12px 16px;
|
|
144
|
+
border-radius: 8px;
|
|
145
|
+
background: ${theme.colors.primary50};
|
|
146
|
+
|
|
147
|
+
&[data-is-marry-baby='true'] {
|
|
148
|
+
background: ${theme.mbColors.tonePink};
|
|
149
|
+
}
|
|
150
|
+
.switch-label {
|
|
151
|
+
display: flex;
|
|
152
|
+
align-items: center;
|
|
153
|
+
gap: 12px;
|
|
154
|
+
}
|
|
155
|
+
margin-bottom: 12px;
|
|
156
|
+
`;
|
|
157
|
+
const StyledError = styled.div `
|
|
158
|
+
margin-bottom: 12px;
|
|
159
|
+
color: ${theme.colors.red700};
|
|
160
|
+
svg {
|
|
161
|
+
margin-right: 5px;
|
|
162
|
+
}
|
|
163
|
+
svg,
|
|
164
|
+
span {
|
|
165
|
+
vertical-align: middle;
|
|
166
|
+
}
|
|
167
|
+
`;
|
|
168
|
+
|
|
169
|
+
var img$1 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cpath fill='%232D87F3' d='M8 14.5a6 6 0 1 0 0-12 6 6 0 0 0 0 12'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 5.5v3M8 11.5h.007'/%3e%3c/svg%3e";
|
|
170
|
+
var IconAlertCirclePrimary = img$1;
|
|
171
|
+
|
|
172
|
+
var img = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cpath fill='%23FE921D' d='M8 14.5a6 6 0 1 0 0-12 6 6 0 0 0 0 12'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 5.5v3M8 11.5h.007'/%3e%3c/svg%3e";
|
|
173
|
+
var IconAlertCircleWarning = img;
|
|
174
|
+
|
|
175
|
+
const CreatePostDescription = ({ className, style, bannedWords = [], value, onChange, onPreviewUrlChange, onInvalidUrlsChange, onImageFilesChange, imageFiles: imageFilesProp, isReplying, }) => {
|
|
176
|
+
const { t } = useTranslations();
|
|
177
|
+
const [previewUrl, setPreviewUrl] = useState(null);
|
|
178
|
+
const imagePicker = useRef(null);
|
|
179
|
+
const { onSelectImages, onRemoveImage, imageSrcs,
|
|
180
|
+
// imageFiles,
|
|
181
|
+
} = useImagePicker(imageFilesProp, onImageFilesChange);
|
|
182
|
+
useEffect(() => {
|
|
183
|
+
if (onPreviewUrlChange) {
|
|
184
|
+
if (previewUrl === null || previewUrl === void 0 ? void 0 : previewUrl.url)
|
|
185
|
+
onPreviewUrlChange({
|
|
186
|
+
title: previewUrl.title || '',
|
|
187
|
+
url: previewUrl.url || '',
|
|
188
|
+
image: previewUrl.image || '',
|
|
189
|
+
description: previewUrl.description || '',
|
|
190
|
+
});
|
|
191
|
+
else
|
|
192
|
+
onPreviewUrlChange(null);
|
|
193
|
+
}
|
|
194
|
+
}, [previewUrl]);
|
|
195
|
+
return (React__default.createElement(StyledCreatePostDescription, { className: className, style: style },
|
|
196
|
+
React__default.createElement(Text, { size: "p4", className: "description-label" }, t('createPost.popup.description')),
|
|
197
|
+
React__default.createElement("div", { className: `textarea-control` },
|
|
198
|
+
React__default.createElement("div", { className: "textarea-wrapper" },
|
|
199
|
+
React__default.createElement(RichTextEditor, { html: value || '', onChange: onChange, bannedWords: bannedWords, onImagePickerClick: () => { var _a; return (_a = imagePicker.current) === null || _a === void 0 ? void 0 : _a.click(); }, onPreviewUrlChange: setPreviewUrl, onInvalidUrlsChange: onInvalidUrlsChange, isReplying: isReplying }))),
|
|
200
|
+
React__default.createElement(Text, { size: "p4", className: "count-string" },
|
|
201
|
+
t('character'),
|
|
202
|
+
": ",
|
|
203
|
+
innertext(value || '').length),
|
|
204
|
+
(!imageSrcs || imageSrcs.length === 0) && previewUrl && (React__default.createElement("div", { className: "link-preview-wrapper" }, previewUrl.isFetching ? (React__default.createElement(Loading, null)) : (React__default.createElement(React__default.Fragment, null,
|
|
205
|
+
React__default.createElement(CardLink, { title: previewUrl.title, url: previewUrl.url || '#', image: previewUrl.image, noRefetch: true }),
|
|
206
|
+
React__default.createElement("img", { src: IconCloseCircle, className: "icon-close", onClick: () => setPreviewUrl(null), loading: "lazy" }))))),
|
|
207
|
+
React__default.createElement("input", { ref: imagePicker, type: "file", accept: "image/png, image/gif, image/jpeg", multiple: true, style: { display: 'none' }, onChange: onSelectImages }),
|
|
208
|
+
imageSrcs.length > MAX_IMAGE_UPLOADS ? (React__default.createElement("div", { className: "input-notification" },
|
|
209
|
+
React__default.createElement("img", { src: IconAlertCircleWarning, loading: "lazy" }),
|
|
210
|
+
React__default.createElement(Text, { size: "p4", color: theme.colors.alertWarning }, t(`createPost.popup.warningImage`)))) : null,
|
|
211
|
+
imageSrcs.length > 0 && (React__default.createElement("div", { className: "image-gallery" }, imageSrcs.map((src, i) => (React__default.createElement("div", { key: i, className: "image-item" },
|
|
212
|
+
React__default.createElement("img", { src: src, loading: "lazy" }),
|
|
213
|
+
React__default.createElement("img", { className: "close-btn", src: IconCloseCircle, onClick: () => onRemoveImage(i), loading: "lazy" }))))))));
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
const StyledCreatePostTitle = styled.div `
|
|
217
|
+
input:focus,
|
|
218
|
+
textarea:focus,
|
|
219
|
+
[contenteditable='true'] {
|
|
220
|
+
outline: none;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.title-input {
|
|
224
|
+
overflow: hidden;
|
|
225
|
+
width: 100%;
|
|
226
|
+
padding: 12px 16px;
|
|
227
|
+
border: solid 1px #d9d9d9;
|
|
228
|
+
border-radius: ${theme.borderRadius};
|
|
229
|
+
font-size: 16px;
|
|
230
|
+
line-height: 1.2;
|
|
231
|
+
white-space: nowrap;
|
|
232
|
+
:focus {
|
|
233
|
+
border-color: ${theme.colors.primaryBase};
|
|
234
|
+
box-shadow: 0px 0px 2px 2px ${theme.colors.primary200};
|
|
235
|
+
}
|
|
236
|
+
br {
|
|
237
|
+
display: none;
|
|
238
|
+
}
|
|
239
|
+
* {
|
|
240
|
+
display: inline;
|
|
241
|
+
white-space: nowrap;
|
|
242
|
+
}
|
|
243
|
+
mocka {
|
|
244
|
+
padding: 2px 6px;
|
|
245
|
+
border-radius: 1rem;
|
|
246
|
+
&[data-error='true'] {
|
|
247
|
+
background-color: #ffeeee;
|
|
248
|
+
color: red;
|
|
249
|
+
text-decoration: underline;
|
|
250
|
+
font-style: bold;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
ol,
|
|
254
|
+
ul {
|
|
255
|
+
padding-left: 1rem;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
label {
|
|
260
|
+
display: block;
|
|
261
|
+
margin-bottom: 5px;
|
|
262
|
+
color: ${theme.colors.gray600};
|
|
263
|
+
font-size: 13px;
|
|
264
|
+
font-weight: bold;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.count-string {
|
|
268
|
+
margin-top: 5px;
|
|
269
|
+
color: ${theme.colors.gray500};
|
|
270
|
+
font-size: 11px;
|
|
271
|
+
text-align: right;
|
|
272
|
+
}
|
|
273
|
+
`;
|
|
274
|
+
|
|
275
|
+
const TITLE_LIMIT = 120;
|
|
276
|
+
const inputModify = (value, opts) => {
|
|
277
|
+
if (!opts)
|
|
278
|
+
return value;
|
|
279
|
+
const { limit, bannedWords = [] } = opts;
|
|
280
|
+
const shorten = typeof limit === 'number' && limit >= 0 ? value.substring(0, limit) : value;
|
|
281
|
+
const processedValue = highlightBadWords(shorten, bannedWords);
|
|
282
|
+
return processedValue;
|
|
283
|
+
};
|
|
284
|
+
const CreatePostTitle = ({ className, style, bannedWords = [], value, onChange, }) => {
|
|
285
|
+
var _a;
|
|
286
|
+
const { t } = useTranslations();
|
|
287
|
+
const [titleValue, setTitleValue] = useState('');
|
|
288
|
+
const titleRef = useRef(null);
|
|
289
|
+
useEffect(() => {
|
|
290
|
+
if (titleRef.current) {
|
|
291
|
+
const pasteHandler = (e) => {
|
|
292
|
+
var _a;
|
|
293
|
+
e.preventDefault();
|
|
294
|
+
const text = (_a = e.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text/plain');
|
|
295
|
+
document.execCommand('insertHTML', false, text);
|
|
296
|
+
};
|
|
297
|
+
const contentDiv = titleRef.current;
|
|
298
|
+
contentDiv.addEventListener('paste', pasteHandler, {
|
|
299
|
+
passive: true,
|
|
300
|
+
});
|
|
301
|
+
return () => contentDiv.removeEventListener('paste', pasteHandler);
|
|
302
|
+
}
|
|
303
|
+
}, [titleRef]);
|
|
304
|
+
const bannedString = (bannedWords === null || bannedWords === void 0 ? void 0 : bannedWords.join(',')) || '';
|
|
305
|
+
useEffect(() => {
|
|
306
|
+
var _a;
|
|
307
|
+
if (bannedString) {
|
|
308
|
+
const titleText = (_a = titleRef.current) === null || _a === void 0 ? void 0 : _a.innerText;
|
|
309
|
+
if (titleText) {
|
|
310
|
+
const titleValueWithBanned = highlightBadWords(titleText, bannedWords);
|
|
311
|
+
if (titleValueWithBanned !== titleText) {
|
|
312
|
+
onChange && onChange(titleValueWithBanned);
|
|
313
|
+
setTitleValue(titleValueWithBanned);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}, [bannedString]);
|
|
318
|
+
const debounceInputModify = useCallback(debounce(() => {
|
|
319
|
+
if (titleRef.current) {
|
|
320
|
+
const shortenString = inputModify(titleRef.current.innerText, {
|
|
321
|
+
limit: TITLE_LIMIT,
|
|
322
|
+
bannedWords,
|
|
323
|
+
});
|
|
324
|
+
onChange && onChange(shortenString);
|
|
325
|
+
setTitleValue(shortenString);
|
|
326
|
+
}
|
|
327
|
+
}, 300), []);
|
|
328
|
+
useEffect(() => {
|
|
329
|
+
setTimeout(() => {
|
|
330
|
+
var _a;
|
|
331
|
+
(_a = titleRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
332
|
+
}, 500);
|
|
333
|
+
}, []);
|
|
334
|
+
return (React__default.createElement(StyledCreatePostTitle, { className: className, style: style },
|
|
335
|
+
React__default.createElement(Input, { name: "title", value: value || titleValue, size: "md", label: t('createPost.title'), CustomInput: React__default.createElement(ContentEditable, { innerRef: titleRef, html: value || titleValue, onChange: () => {
|
|
336
|
+
if (titleRef.current &&
|
|
337
|
+
titleRef.current.innerText !== (value || titleValue)) {
|
|
338
|
+
const initialValue = inputModify(titleRef.current.innerText, {
|
|
339
|
+
bannedWords,
|
|
340
|
+
});
|
|
341
|
+
onChange && onChange(initialValue);
|
|
342
|
+
setTitleValue(initialValue);
|
|
343
|
+
debounceInputModify();
|
|
344
|
+
}
|
|
345
|
+
}, className: "title-input" }) }),
|
|
346
|
+
React__default.createElement(Text, { size: "p4", className: "count-string" }, t('createPost.popup.wordCount', {
|
|
347
|
+
count: ((_a = titleRef.current) === null || _a === void 0 ? void 0 : _a.innerText.length) || 0,
|
|
348
|
+
max: TITLE_LIMIT,
|
|
349
|
+
}))));
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
const StyledTopicSelectList = styled.div `
|
|
353
|
+
display: flex;
|
|
354
|
+
width: 100%;
|
|
355
|
+
flex-wrap: wrap;
|
|
356
|
+
margin-top: 1rem;
|
|
357
|
+
|
|
358
|
+
.tag-item {
|
|
359
|
+
min-height: 32px;
|
|
360
|
+
padding: 5px 12px;
|
|
361
|
+
border: 1px solid ${theme.colors.neutral100};
|
|
362
|
+
margin-right: 1rem;
|
|
363
|
+
margin-bottom: 8px;
|
|
364
|
+
border-radius: 1rem;
|
|
365
|
+
color: ${theme.colors.gray800};
|
|
366
|
+
cursor: pointer;
|
|
367
|
+
font-size: 13px;
|
|
368
|
+
line-height: 22px;
|
|
369
|
+
transition: all 0.2s;
|
|
370
|
+
|
|
371
|
+
&.--active {
|
|
372
|
+
border-color: ${theme.colors.primary50};
|
|
373
|
+
background: ${theme.colors.primary50};
|
|
374
|
+
color: ${theme.colors.primaryBase};
|
|
375
|
+
}
|
|
376
|
+
&[data-disabled='true'] {
|
|
377
|
+
background: ${theme.colors.gray100};
|
|
378
|
+
color: ${theme.colors.gray800};
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
.topic-spinner {
|
|
382
|
+
margin-right: auto;
|
|
383
|
+
margin-left: auto;
|
|
384
|
+
& > button {
|
|
385
|
+
width: 24px;
|
|
386
|
+
height: 24px;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
&[data-is-marrybaby='true'] {
|
|
390
|
+
.tag-item {
|
|
391
|
+
border-color: transparent;
|
|
392
|
+
background: #f3f3f3;
|
|
393
|
+
color: #3e3f58;
|
|
394
|
+
&.--active {
|
|
395
|
+
border-color: #b6cdff;
|
|
396
|
+
background: #e0e9fb;
|
|
397
|
+
color: #3e3f58;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
`;
|
|
402
|
+
|
|
403
|
+
const TopicSelectList = ({ className, style, topics: topicsProp, communityId, onChange, isLoading, disabled, forceTopics, selectedTopics: selectedTopicsProp, noFetch, dataEventCategory, dataEventAction, dataEventLabel, }) => {
|
|
404
|
+
const { data: { locale, env: { isMarryBaby }, }, } = useContext(TogetherComponentGlobalContext);
|
|
405
|
+
const [topics, setTopics] = useState(topicsProp ? [...topicsProp] : []);
|
|
406
|
+
const [selectedTopics, setSelectedTopics] = useState(selectedTopicsProp ? [...selectedTopicsProp] : []);
|
|
407
|
+
const [isLoadingTopics, setIsLoadingTopics] = useState(false);
|
|
408
|
+
const topicsPropRef = useRef(topicsProp);
|
|
409
|
+
topicsPropRef.current = topicsProp;
|
|
410
|
+
useEffect(() => {
|
|
411
|
+
var _a;
|
|
412
|
+
if (communityId && !noFetch && !((_a = topicsPropRef.current) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
413
|
+
setTopics([]);
|
|
414
|
+
setIsLoadingTopics(true);
|
|
415
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
416
|
+
var _b;
|
|
417
|
+
try {
|
|
418
|
+
const res = yield callApi(getApiPath(PATHS.TOPIC.LIST, {
|
|
419
|
+
communityId: communityId,
|
|
420
|
+
_locale: locale,
|
|
421
|
+
}), 'GET');
|
|
422
|
+
const topicRes = (_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.topics;
|
|
423
|
+
if (Array.isArray(topicRes)) {
|
|
424
|
+
setTopics(() => (topicRes === null || topicRes === void 0 ? void 0 : topicRes.map(formatTopic).sort((t1, t2) => (t1.order || 0) - (t2.order || 0))) || []);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
catch (e) {
|
|
428
|
+
console.log(e);
|
|
429
|
+
setIsLoadingTopics(false);
|
|
430
|
+
}
|
|
431
|
+
setIsLoadingTopics(false);
|
|
432
|
+
}))();
|
|
433
|
+
}
|
|
434
|
+
}, [communityId, noFetch]);
|
|
435
|
+
const topicsPropString = topicsProp === null || topicsProp === void 0 ? void 0 : topicsProp.map((t) => t.id).join('-');
|
|
436
|
+
const topicsStateString = topics === null || topics === void 0 ? void 0 : topics.map((t) => t.id).join('-');
|
|
437
|
+
const forceTopicsPropString = forceTopics === null || forceTopics === void 0 ? void 0 : forceTopics.map((t) => t.id).join('-');
|
|
438
|
+
useEffect(() => {
|
|
439
|
+
if (topicsProp &&
|
|
440
|
+
typeof topicsPropString !== 'undefined' &&
|
|
441
|
+
topicsPropString !== topicsStateString) {
|
|
442
|
+
setTopics(topicsProp);
|
|
443
|
+
}
|
|
444
|
+
}, [topicsProp, topicsPropString, topicsStateString]);
|
|
445
|
+
const topicsWithoutForced = useMemo(() => topics.filter((t) => !(forceTopics === null || forceTopics === void 0 ? void 0 : forceTopics.some((ft) => (ft.id && ft.id === t.id) ||
|
|
446
|
+
(ft.mappedCategoryId &&
|
|
447
|
+
ft.mappedCategoryId === t.mappedCategoryId)))), [topicsStateString, forceTopicsPropString]);
|
|
448
|
+
return (React__default.createElement(StyledTopicSelectList, { "data-is-marrybaby": isMarryBaby, className: className, style: style },
|
|
449
|
+
forceTopics.map((topic) => (React__default.createElement(TopicItem, { key: `${topic.id}-${topic.mappedCategoryId}`, topic: topic, disabled: true, selected: true, dataEventAction: dataEventAction, dataEventCategory: dataEventCategory, dataEventLabel: dataEventLabel }))),
|
|
450
|
+
topicsWithoutForced.map((topic) => (React__default.createElement(TopicItem, { key: `${topic.id}-${topic.mappedCategoryId}`, topic: topic, disabled: disabled, selected: (selectedTopicsProp || selectedTopics).some((t) => (t.id && t.id === topic.id) ||
|
|
451
|
+
(t.mappedCategoryId &&
|
|
452
|
+
t.mappedCategoryId === topic.mappedCategoryId)), onClick: () => {
|
|
453
|
+
const _selected = selectedTopicsProp || selectedTopics;
|
|
454
|
+
const foundIndex = _selected.findIndex((_selected) => (_selected.id && _selected.id === topic.id) ||
|
|
455
|
+
(_selected.mappedCategoryId &&
|
|
456
|
+
_selected.mappedCategoryId === topic.mappedCategoryId));
|
|
457
|
+
if (foundIndex !== -1) {
|
|
458
|
+
_selected.splice(foundIndex, 1);
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
_selected.push(topic);
|
|
462
|
+
}
|
|
463
|
+
if (onChange && selectedTopicsProp) {
|
|
464
|
+
onChange(_selected.slice());
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
onChange && onChange(_selected.slice());
|
|
468
|
+
setSelectedTopics(_selected.slice());
|
|
469
|
+
}
|
|
470
|
+
}, dataEventAction: dataEventAction, dataEventCategory: dataEventCategory, dataEventLabel: dataEventLabel }))),
|
|
471
|
+
(isLoading || isLoadingTopics) && React__default.createElement(Loading, { className: "topic-spinner" })));
|
|
472
|
+
};
|
|
473
|
+
const TopicItem = (_a) => {
|
|
474
|
+
var { topic, disabled, selected, onClick } = _a, rest = __rest(_a, ["topic", "disabled", "selected", "onClick"]);
|
|
475
|
+
return (React__default.createElement("div", Object.assign({ className: 'tag-item' + (selected ? ' --active' : ''), "data-disabled": disabled, onClick: !disabled ? onClick : undefined }, rest), topic.name));
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
const CreateNewPostContent = ({ className, style, onPostCreatedEdited, onClose, communities = [], forceSelectCommunity, forceSelectTopics, articleId, optionalTopic, editPostData, defaultCommunity, defaultTopics, noFetchTopic, hideTopicList, selectAskDoctor, showAskDoctorOptions, currentPageUrl, }) => {
|
|
479
|
+
const isInEditMode = !!(editPostData === null || editPostData === void 0 ? void 0 : editPostData.id);
|
|
480
|
+
const { data: { locale, env: { isMarryBaby }, }, action: { pushNotifications, sanitizeFunction }, } = useContext(TogetherComponentGlobalContext);
|
|
481
|
+
const { t } = useTranslations();
|
|
482
|
+
const [isAnonymous, setIsAnonymous] = useState(false);
|
|
483
|
+
const [isAskDoctor, setIsAskDoctor] = useState(selectAskDoctor);
|
|
484
|
+
const [showAskDoctorRequired, setShowAskDoctorRequired] = useState(false);
|
|
485
|
+
const [specialCharErr, setspecialCharErr] = useState(false);
|
|
486
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
487
|
+
const [titleValue, setTitleValue] = useState('');
|
|
488
|
+
const [descriptionValue, setDescriptionValue] = useState('');
|
|
489
|
+
const [communityValue, setCommunityValue] = useState(forceSelectCommunity
|
|
490
|
+
? {
|
|
491
|
+
label: forceSelectCommunity.name,
|
|
492
|
+
value: `${forceSelectCommunity.id || ''}-${forceSelectCommunity.mappedCategoryId || ''}`,
|
|
493
|
+
}
|
|
494
|
+
: {
|
|
495
|
+
label: t('community.choose'),
|
|
496
|
+
value: '',
|
|
497
|
+
});
|
|
498
|
+
const [selectedTopics, setSelectedTopics] = useState([...forceSelectTopics] || []);
|
|
499
|
+
const [imageFiles, setImageFiles] = useState([]);
|
|
500
|
+
const [bannedWords, setBannedWords] = useState([]);
|
|
501
|
+
const currentCommunity = forceSelectCommunity ||
|
|
502
|
+
communities.find((c) => `${c.id || ''}-${c.mappedCategoryId || ''}` === communityValue.value);
|
|
503
|
+
const communitiesList = forceSelectCommunity
|
|
504
|
+
? [forceSelectCommunity]
|
|
505
|
+
: communities
|
|
506
|
+
.filter((c) => c.isActive)
|
|
507
|
+
.sort((a, b) => {
|
|
508
|
+
if (a.name > b.name)
|
|
509
|
+
return 1;
|
|
510
|
+
if (a.name < b.name)
|
|
511
|
+
return -1;
|
|
512
|
+
return 0;
|
|
513
|
+
});
|
|
514
|
+
const [previewUrl, setPreviewUrl] = useState(null);
|
|
515
|
+
const [invalidUrls, setInvalidUrls] = useState([]);
|
|
516
|
+
const isReadyToSubmit = titleValue &&
|
|
517
|
+
!specialCharErr &&
|
|
518
|
+
innertext(descriptionValue) &&
|
|
519
|
+
(optionalTopic || (!optionalTopic && selectedTopics.length > 0)) &&
|
|
520
|
+
currentCommunity &&
|
|
521
|
+
(!imageFiles || imageFiles.length <= MAX_IMAGE_UPLOADS) &&
|
|
522
|
+
!(invalidUrls === null || invalidUrls === void 0 ? void 0 : invalidUrls.length) &&
|
|
523
|
+
!isSubmitting;
|
|
524
|
+
// HANDLE etra action when OPEN AND CLOSE
|
|
525
|
+
useEffect(() => {
|
|
526
|
+
if (editPostData) {
|
|
527
|
+
const post = editPostData;
|
|
528
|
+
setTitleValue(post.title || '');
|
|
529
|
+
setDescriptionValue(decodeMention(decodePostUrl(post.description || '', 'edit'), post.mentions));
|
|
530
|
+
setCommunityValue({
|
|
531
|
+
label: post.community.name,
|
|
532
|
+
value: `${post.community.id || ''}-${post.community.mappedCategoryId || ''}`,
|
|
533
|
+
});
|
|
534
|
+
setSelectedTopics(post.topics || []);
|
|
535
|
+
setImageFiles(post.photos || []);
|
|
536
|
+
setIsAnonymous(!!post.isAnonymous || false);
|
|
537
|
+
setIsAskDoctor(!!post.isAskDoctor || false);
|
|
538
|
+
}
|
|
539
|
+
else {
|
|
540
|
+
if (defaultCommunity) {
|
|
541
|
+
setCommunityValue({
|
|
542
|
+
label: defaultCommunity.name,
|
|
543
|
+
value: `${defaultCommunity.id || ''}-${defaultCommunity.mappedCategoryId || ''}`,
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
if (defaultTopics) {
|
|
547
|
+
setSelectedTopics(defaultTopics);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}, []);
|
|
551
|
+
useEffect(() => {
|
|
552
|
+
setspecialCharErr(titleValue !== '' && !/[a-zA-Z]/.test(titleValue));
|
|
553
|
+
}, [titleValue]);
|
|
554
|
+
const onCreateEditSuccess = (res) => {
|
|
555
|
+
if (onPostCreatedEdited) {
|
|
556
|
+
onPostCreatedEdited(formatPost(res), isInEditMode);
|
|
557
|
+
}
|
|
558
|
+
onClose && onClose();
|
|
559
|
+
};
|
|
560
|
+
const submitPost = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
561
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
562
|
+
if (showAskDoctorOptions && typeof isAskDoctor === 'undefined') {
|
|
563
|
+
setShowAskDoctorRequired(true);
|
|
564
|
+
return false;
|
|
565
|
+
}
|
|
566
|
+
const bodyFormData = yield getPostFormData({
|
|
567
|
+
title: titleValue,
|
|
568
|
+
description: descriptionValue,
|
|
569
|
+
communityId: String((currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.id) || ''),
|
|
570
|
+
imageFiles,
|
|
571
|
+
previewUrl,
|
|
572
|
+
topicIds: selectedTopics === null || selectedTopics === void 0 ? void 0 : selectedTopics.map((topic) => String(topic.id || '')).filter(Boolean),
|
|
573
|
+
locale,
|
|
574
|
+
sanitizeFunction,
|
|
575
|
+
categoryCommunityId: String((currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.mappedCategoryId) || ''),
|
|
576
|
+
categoryTopicIds: selectedTopics === null || selectedTopics === void 0 ? void 0 : selectedTopics.map((topic) => String(topic.mappedCategoryId || '')).filter(Boolean),
|
|
577
|
+
isAnonymous: isAnonymous ? 1 : 0,
|
|
578
|
+
isAskDoctor: isAskDoctor ? 1 : 0,
|
|
579
|
+
});
|
|
580
|
+
if (articleId) {
|
|
581
|
+
bodyFormData.append('article_id', articleId);
|
|
582
|
+
}
|
|
583
|
+
let res;
|
|
584
|
+
if (isInEditMode) {
|
|
585
|
+
if (editPostData === null || editPostData === void 0 ? void 0 : editPostData.id) {
|
|
586
|
+
res = yield editPost({
|
|
587
|
+
id: editPostData.id,
|
|
588
|
+
formData: bodyFormData,
|
|
589
|
+
locale,
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
else {
|
|
594
|
+
res = yield createPost({
|
|
595
|
+
formData: bodyFormData,
|
|
596
|
+
locale,
|
|
597
|
+
isArticleComment: !(currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.id) && !!(currentCommunity === null || currentCommunity === void 0 ? void 0 : currentCommunity.mappedCategoryId),
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
const resData = res === null || res === void 0 ? void 0 : res.data;
|
|
601
|
+
if ((resData === null || resData === void 0 ? void 0 : resData.id) && !((_b = (_a = res === null || res === void 0 ? void 0 : res.messages) === null || _a === void 0 ? void 0 : _a.moderation) === null || _b === void 0 ? void 0 : _b.type)) {
|
|
602
|
+
pushNotifications({
|
|
603
|
+
message: t('createPost.popup.success'),
|
|
604
|
+
type: 'success',
|
|
605
|
+
});
|
|
606
|
+
onCreateEditSuccess(resData);
|
|
607
|
+
}
|
|
608
|
+
else {
|
|
609
|
+
if (((_d = (_c = res === null || res === void 0 ? void 0 : res.messages) === null || _c === void 0 ? void 0 : _c.moderation) === null || _d === void 0 ? void 0 : _d.type) === 'banned') {
|
|
610
|
+
pushNotifications({
|
|
611
|
+
title: t('notification.post.blocked.title'),
|
|
612
|
+
message: t('notification.post.blocked.message'),
|
|
613
|
+
type: 'danger',
|
|
614
|
+
});
|
|
615
|
+
if (res.messages.moderation.words) {
|
|
616
|
+
setBannedWords(res.messages.moderation.words);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
else if (((_f = (_e = res === null || res === void 0 ? void 0 : res.messages) === null || _e === void 0 ? void 0 : _e.moderation) === null || _f === void 0 ? void 0 : _f.type) === 'suspect') {
|
|
620
|
+
pushNotifications({
|
|
621
|
+
title: t('notification.post.suspect.title'),
|
|
622
|
+
message: t('notification.post.suspect.message'),
|
|
623
|
+
type: 'warning',
|
|
624
|
+
});
|
|
625
|
+
onClose && onClose();
|
|
626
|
+
}
|
|
627
|
+
else if ((_h = (_g = res === null || res === void 0 ? void 0 : res.messages) === null || _g === void 0 ? void 0 : _g.find) === null || _h === void 0 ? void 0 : _h.call(_g, (m) => { var _a; return !!((_a = m === null || m === void 0 ? void 0 : m.includes) === null || _a === void 0 ? void 0 : _a.call(m, 'suspend')); })) {
|
|
628
|
+
pushNotifications({
|
|
629
|
+
message: t('notification.suspend.message'),
|
|
630
|
+
type: 'danger',
|
|
631
|
+
});
|
|
632
|
+
onClose && onClose();
|
|
633
|
+
}
|
|
634
|
+
else {
|
|
635
|
+
pushNotifications({
|
|
636
|
+
message: ((_j = res === null || res === void 0 ? void 0 : res.messages) === null || _j === void 0 ? void 0 : _j[0]) || t('notification.failure'),
|
|
637
|
+
type: 'danger',
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
});
|
|
642
|
+
return (React__default.createElement(StyledCreateNewPost, { className: className, style: style },
|
|
643
|
+
React__default.createElement("div", { className: "input-group-container" },
|
|
644
|
+
React__default.createElement(CreatePostTitle, { className: "input-group", bannedWords: bannedWords, value: titleValue, onChange: setTitleValue }),
|
|
645
|
+
specialCharErr && (React__default.createElement(StyledError, null,
|
|
646
|
+
React__default.createElement(Info, { isSolid: true, color: theme.colors.red700, size: 14 }),
|
|
647
|
+
React__default.createElement(Text, { size: "p3", as: "span", color: theme.colors.red700 }, t('createPost.popup.specialCharErr')))),
|
|
648
|
+
React__default.createElement(CreatePostDescription, { className: "input-group", bannedWords: bannedWords, value: descriptionValue, onChange: setDescriptionValue, onPreviewUrlChange: setPreviewUrl, onInvalidUrlsChange: setInvalidUrls, onImageFilesChange: setImageFiles, imageFiles: imageFiles }),
|
|
649
|
+
showAskDoctorOptions && (React__default.createElement(StyledIsQuestion, { "data-is-marry-baby": isMarryBaby },
|
|
650
|
+
React__default.createElement("div", { className: "switch-label" },
|
|
651
|
+
React__default.createElement(Ask, { isMarryBaby: isMarryBaby, size: isMarryBaby ? 32 : 24, color: theme.colors.primaryBase, className: "label-icon" }),
|
|
652
|
+
React__default.createElement("span", { className: "label-txt" }, t('createPost.askDoctor'))),
|
|
653
|
+
React__default.createElement(BtnChoice, { value: isAskDoctor, choices: [
|
|
654
|
+
{
|
|
655
|
+
label: t('createPost.askDoctorChoice.yes'),
|
|
656
|
+
value: true,
|
|
657
|
+
dataEventCategory: 'Together',
|
|
658
|
+
dataEventAction: 'Write Post Click - Ask Doctor',
|
|
659
|
+
dataEventLabel: currentPageUrl,
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
label: t('createPost.askDoctorChoice.no'),
|
|
663
|
+
value: false,
|
|
664
|
+
},
|
|
665
|
+
], onChange: (v) => {
|
|
666
|
+
if (typeof v === 'boolean') {
|
|
667
|
+
setShowAskDoctorRequired(false);
|
|
668
|
+
setIsAskDoctor(v);
|
|
669
|
+
}
|
|
670
|
+
} }))),
|
|
671
|
+
showAskDoctorRequired && (React__default.createElement(StyledError, null,
|
|
672
|
+
React__default.createElement(Info, { isSolid: true, color: theme.colors.red700, size: 14 }),
|
|
673
|
+
React__default.createElement(Text, { size: "p3", as: "span", color: theme.colors.red700 }, t('createPost.message.askDoctorRequire')))),
|
|
674
|
+
React__default.createElement("div", { className: "input-group" },
|
|
675
|
+
React__default.createElement(Text, { size: "p4", className: "input-group-label" }, t('admin.community')),
|
|
676
|
+
React__default.createElement(Dropdown, { options: (communitiesList === null || communitiesList === void 0 ? void 0 : communitiesList.map((c) => ({
|
|
677
|
+
label: c.name,
|
|
678
|
+
value: `${c.id || ''}-${c.mappedCategoryId || ''}`,
|
|
679
|
+
}))) || [], id: "community-picker", placeholder: t('community.choose'), value: communityValue, dropdownLabelTrackingAttributes: {
|
|
680
|
+
'data-event-category': 'Together',
|
|
681
|
+
'data-event-action': 'Write Post Click - Choose Community/Topic',
|
|
682
|
+
'data-event-label': currentPageUrl,
|
|
683
|
+
}, onChange: (option) => {
|
|
684
|
+
setCommunityValue({
|
|
685
|
+
label: option.label,
|
|
686
|
+
value: String(option.value),
|
|
687
|
+
});
|
|
688
|
+
setSelectedTopics([]);
|
|
689
|
+
}, disabled: !!forceSelectCommunity }),
|
|
690
|
+
React__default.createElement(Text, { size: "sm", className: "warning", color: theme.colors.gray400 },
|
|
691
|
+
"* ",
|
|
692
|
+
t('commentPopup.warning.newPost'))),
|
|
693
|
+
!hideTopicList && (React__default.createElement("div", { className: "input-group" },
|
|
694
|
+
React__default.createElement(Text, { size: "p4", className: "input-group-label" }, t('tab.topic')),
|
|
695
|
+
React__default.createElement("div", { className: "input-notification" },
|
|
696
|
+
React__default.createElement("img", { src: currentCommunity
|
|
697
|
+
? IconAlertCirclePrimary
|
|
698
|
+
: IconAlertCircleWarning, loading: "lazy" }),
|
|
699
|
+
React__default.createElement(Text, { size: "base", color: theme.colors.gray500 }, t(currentCommunity
|
|
700
|
+
? 'createPost.popup.primary'
|
|
701
|
+
: 'createPost.popup.warning'))),
|
|
702
|
+
currentCommunity && (React__default.createElement(TopicSelectList, { className: "tag-list", communityId: currentCommunity.id, forceTopics: forceSelectTopics, onChange: setSelectedTopics, selectedTopics: selectedTopics, noFetch: noFetchTopic, dataEventCategory: "Together", dataEventAction: "Write Post Click - Choose Community/Topic", dataEventLabel: currentPageUrl }))))),
|
|
703
|
+
React__default.createElement("div", { className: "form-action" },
|
|
704
|
+
React__default.createElement("div", { className: "input-group" },
|
|
705
|
+
React__default.createElement(Checkbox, { className: "swich-input-group", labelPosition: "left", name: "PostAnonymous", checked: isAnonymous, color: isMarryBaby ? 'pink' : undefined, "data-event-category": "Together", "data-event-action": "Write Post Click - Incognito", "data-event-label": currentPageUrl, label: React__default.createElement("div", { className: "switch-label" },
|
|
706
|
+
React__default.createElement("img", { className: "label-icon", src: CommonGAssets.getAssetPath('anomyous-avatar.svg'), alt: "anomyous avatar", style: { marginRight: '10px', width: '24px' }, loading: "lazy" }),
|
|
707
|
+
React__default.createElement("span", { className: "label-txt" }, t('createPost.postAnonymous'))), value: "Post Anonymous", onChange: (event) => setIsAnonymous(event.currentTarget.checked), styles: {
|
|
708
|
+
body: {
|
|
709
|
+
display: 'flex',
|
|
710
|
+
width: '100%',
|
|
711
|
+
justifyContent: 'space-between',
|
|
712
|
+
alignItems: 'center',
|
|
713
|
+
},
|
|
714
|
+
label: {
|
|
715
|
+
display: 'flex',
|
|
716
|
+
alignItems: 'center',
|
|
717
|
+
},
|
|
718
|
+
} })),
|
|
719
|
+
React__default.createElement("div", { className: "input-group" },
|
|
720
|
+
React__default.createElement(Button, { className: "submit-btn pointer-event-child-none", size: "lg", "data-event-category": "Ask Doctor", "data-event-action": "Submit Question", "data-event-label": window.location.href, onClick: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
721
|
+
if (isReadyToSubmit && !isSubmitting) {
|
|
722
|
+
setIsSubmitting(true);
|
|
723
|
+
try {
|
|
724
|
+
yield submitPost();
|
|
725
|
+
}
|
|
726
|
+
catch (e) {
|
|
727
|
+
console.error(e);
|
|
728
|
+
pushNotifications(getDefaultFailNoti(t));
|
|
729
|
+
}
|
|
730
|
+
setIsSubmitting(false);
|
|
731
|
+
}
|
|
732
|
+
}), disabled: !isReadyToSubmit, loading: isSubmitting }, t('createPost.popup.submit'))))));
|
|
733
|
+
};
|
|
734
|
+
|
|
735
|
+
var styles = {"skipBtn":"KsWg8i6","alertHeading":"_9tS0EUN","alertDesc":"kyyRKlb","alertAction":"-Uqqka-"};
|
|
736
|
+
|
|
737
|
+
const SkipQuestionOfExpertBtn = (_a) => {
|
|
738
|
+
var { post, onSkip, btnText, currentPageUrl } = _a, rest = __rest(_a, ["post", "onSkip", "btnText", "currentPageUrl"]);
|
|
739
|
+
const { t } = useTranslations();
|
|
740
|
+
const { data: { locale }, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
|
|
741
|
+
const [showAlert, setShowAlert] = useState(false);
|
|
742
|
+
const [loading, setLoading] = useState(false);
|
|
743
|
+
const _theme = useMantineTheme();
|
|
744
|
+
const handleSkip = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
745
|
+
var _b;
|
|
746
|
+
setLoading(true);
|
|
747
|
+
const res = yield callApiWithAuth(getApiPath(PATHS.USER.SKIP_QUESTION, {
|
|
748
|
+
_locale: locale,
|
|
749
|
+
id: post === null || post === void 0 ? void 0 : post.id,
|
|
750
|
+
}), 'PUT');
|
|
751
|
+
if ((res === null || res === void 0 ? void 0 : res.status) === 1) {
|
|
752
|
+
onSkip === null || onSkip === void 0 ? void 0 : onSkip({ id: (post === null || post === void 0 ? void 0 : post.id) || '', communityId: ((_b = post === null || post === void 0 ? void 0 : post.community) === null || _b === void 0 ? void 0 : _b.id) || '' });
|
|
753
|
+
setShowAlert(false);
|
|
754
|
+
pushNotifications({
|
|
755
|
+
title: '',
|
|
756
|
+
message: 'Skip success',
|
|
757
|
+
type: 'success',
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
else {
|
|
761
|
+
pushNotifications({
|
|
762
|
+
title: '',
|
|
763
|
+
message: res === null || res === void 0 ? void 0 : res.messages,
|
|
764
|
+
type: 'danger',
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
setLoading(false);
|
|
768
|
+
}), []);
|
|
769
|
+
return (React__default.createElement(Popover, { width: 327, withArrow: true, shadow: "md", opened: showAlert },
|
|
770
|
+
React__default.createElement(Popover.Target, null,
|
|
771
|
+
React__default.createElement("div", Object.assign({ className: `${styles.skipBtn} ${(rest === null || rest === void 0 ? void 0 : rest.className) || ''}`, onClick: () => setShowAlert(true) }, rest), btnText || t('profilePanel.questionNotClear'))),
|
|
772
|
+
React__default.createElement(Popover.Dropdown, null,
|
|
773
|
+
React__default.createElement("div", null,
|
|
774
|
+
React__default.createElement("div", { className: styles.alertHeading }, t('profilePanel.skipQuestion.heading')),
|
|
775
|
+
React__default.createElement("div", { className: styles.alertDesc }, t('profilePanel.skipQuestion.content')),
|
|
776
|
+
React__default.createElement("div", { className: styles.alertAction },
|
|
777
|
+
React__default.createElement(Button, { size: "md", variant: "secondary", leftIcon: React__default.createElement(Close, { color: _theme.fn.primaryColor(), size: 24 }), onClick: () => setShowAlert(false), styles: () => ({
|
|
778
|
+
leftIcon: {
|
|
779
|
+
marginRight: 0,
|
|
780
|
+
},
|
|
781
|
+
}) }),
|
|
782
|
+
React__default.createElement(Button, { variant: "primary", size: "md", leftIcon: React__default.createElement(Check, { color: 'white', size: 24 }), onClick: handleSkip, loading: loading, "data-event-category": "Together", "data-event-action": "Unclear Question Click", "data-event-label": currentPageUrl, styles: () => ({
|
|
783
|
+
leftIcon: {
|
|
784
|
+
marginRight: 0,
|
|
785
|
+
},
|
|
786
|
+
}) }))))));
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
export { CreateNewPostContent as C, SkipQuestionOfExpertBtn as S, TopicSelectList as T, CreatePostDescription as a, CreatePostTitle as b };
|