@mjhls/mjh-framework 1.0.874-ad-test-v3 → 1.0.874-beta.0
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/README.md +168 -168
- package/dist/cjs/AD.js +9 -10
- package/dist/cjs/AD300x250.js +27 -62
- package/dist/cjs/AD300x250x600.js +28 -29
- package/dist/cjs/AD728x90.js +31 -32
- package/dist/cjs/ADFloatingFooter.js +30 -31
- package/dist/cjs/ADFooter.js +12 -13
- package/dist/cjs/ADGutter.js +30 -31
- package/dist/cjs/{ADInfeed-b9e5ff3f.js → ADInfeed-c628363f.js} +13 -15
- package/dist/cjs/ADSkyscraper.js +30 -31
- package/dist/cjs/ADSponsoredResources.js +30 -31
- package/dist/cjs/ADWebcast.js +30 -31
- package/dist/cjs/ADWelcome.js +31 -32
- package/dist/cjs/{ADlgInfeed-3cdefebd.js → ADlgInfeed-a827d389.js} +10 -11
- package/dist/cjs/AccordionPanel.js +27 -29
- package/dist/cjs/AdSlot.js +33 -34
- package/dist/cjs/AdSlotsProvider.js +909 -18
- package/dist/cjs/AlgoliaSearch.js +1274 -1392
- package/dist/cjs/AlphabeticList.js +23 -24
- package/dist/cjs/ArticleCarousel.js +19 -20
- package/dist/cjs/ArticleProgramLandingPage.js +60 -61
- package/dist/cjs/ArticleSeriesLandingPage.js +40 -41
- package/dist/cjs/ArticleSeriesListing.js +59 -60
- package/dist/cjs/Auth.js +1504 -680
- package/dist/cjs/AuthWrapper.js +267 -309
- package/dist/cjs/{AuthorComponent-39b37d84.js → AuthorComponent-02e827ae.js} +13 -14
- package/dist/cjs/Beam.js +6 -6
- package/dist/cjs/{BlockContent-36e54d77.js → BlockContent-091a991f.js} +55 -56
- package/dist/cjs/Breadcrumbs.js +25 -27
- package/dist/cjs/CMEDeck.js +81 -81
- package/dist/cjs/Column1.js +11 -14
- package/dist/cjs/Column2.js +31 -34
- package/dist/cjs/Column3.js +57 -60
- package/dist/cjs/ConferenceArticleCard.js +40 -41
- package/dist/cjs/ConferenceBanner-4a16fddc.js +23 -0
- package/dist/cjs/DeckContent.js +101 -105
- package/dist/cjs/DeckQueue.js +87 -91
- package/dist/cjs/{Dfp-9be904d5.js → Dfp-14d2455c.js} +32 -33
- package/dist/cjs/EventsDeck.js +150 -157
- package/dist/cjs/ExternalResources.js +78 -79
- package/dist/cjs/Feature.js +27 -29
- package/dist/cjs/ForbesHero.js +40 -41
- package/dist/cjs/GridContent.js +231 -236
- package/dist/cjs/GridHero.js +42 -43
- package/dist/cjs/GroupDeck.js +57 -58
- package/dist/cjs/HamMagazine.js +138 -143
- package/dist/cjs/Header.js +12 -14
- package/dist/cjs/Hero.js +15 -16
- package/dist/cjs/HighlightenVideo.js +17 -18
- package/dist/cjs/HorizontalArticleListing.js +71 -72
- package/dist/cjs/HorizontalHero.js +27 -28
- package/dist/cjs/IssueContentDeck.js +71 -76
- package/dist/cjs/IssueDeck.js +70 -75
- package/dist/cjs/IssueLanding.js +93 -94
- package/dist/cjs/KMTracker.js +15 -15
- package/dist/cjs/LeftNav.js +37 -39
- package/dist/cjs/MasterDeck.js +78 -79
- package/dist/cjs/MediaSeriesLanding.js +1127 -1118
- package/dist/cjs/NavDvm.js +72 -77
- package/dist/cjs/{NavFooter-3dcd99a8.js → NavFooter-76c913e3.js} +14 -15
- package/dist/cjs/NavMagazine.js +145 -150
- package/dist/cjs/NavNative.js +137 -145
- package/dist/cjs/OncliveHero.js +22 -22
- package/dist/cjs/OncliveLargeHero.js +70 -71
- package/dist/cjs/PageFilter.js +12 -13
- package/dist/cjs/PartnerDetailListing.js +3916 -116
- package/dist/cjs/PdfDownload.js +8 -9
- package/dist/cjs/PopUpModal.js +17 -19
- package/dist/cjs/PubSection.js +40 -41
- package/dist/cjs/PubToc.js +13 -14
- package/dist/cjs/PublicationDeck.js +65 -70
- package/dist/cjs/PublicationLanding.js +133 -137
- package/dist/cjs/QueueDeckExpanded.js +308 -308
- package/dist/cjs/RecentNews.js +21 -22
- package/dist/cjs/RelatedContent.js +57 -58
- package/dist/cjs/RelatedTopicsDropdown.js +29 -32
- package/dist/cjs/RolesDeck.js +27 -32
- package/dist/cjs/Search.js +16 -20
- package/dist/cjs/Segment.js +4 -4
- package/dist/cjs/SeriesListingDeck.js +36 -36
- package/dist/cjs/{SeriesSlider-ce3261cb.js → SeriesSlider-49b81b0b.js} +39 -40
- package/dist/cjs/SetCookie.js +1 -1
- package/dist/cjs/SideFooter.js +36 -37
- package/dist/cjs/SocialIcons.js +9 -10
- package/dist/cjs/{SocialSearchComponent-5ec44406.js → SocialSearchComponent-e8477ca3.js} +36 -40
- package/dist/cjs/SocialShare.js +29 -31
- package/dist/cjs/TaxonomyCard.js +61 -66
- package/dist/cjs/TaxonomyDescription.js +53 -54
- package/dist/cjs/TemplateNormal.js +72 -73
- package/dist/cjs/ThumbnailCard.js +24 -26
- package/dist/cjs/Ustream.js +27 -28
- package/dist/cjs/VerticalHero.js +19 -20
- package/dist/cjs/VideoProgramLandingPage.js +74 -78
- package/dist/cjs/VideoSeriesCard.js +32 -33
- package/dist/cjs/VideoSeriesFilter.js +16 -16
- package/dist/cjs/VideoSeriesLandingPage.js +49 -50
- package/dist/cjs/VideoSeriesListing.js +76 -77
- package/dist/cjs/View.js +268 -271
- package/dist/cjs/YahooHero.js +39 -40
- package/dist/cjs/YoutubeGroup.js +67 -68
- package/dist/cjs/{_is-array-54228b29.js → _is-array-aa52fa1e.js} +6 -6
- package/dist/cjs/{_iter-detect-b1df62f0.js → _iter-detect-05795553.js} +7 -7
- package/dist/cjs/{_object-pie-083f2dd6.js → _object-pie-68c5bcbc.js} +4 -4
- package/dist/cjs/{_object-sap-d1978572.js → _object-sap-171b9ea5.js} +1 -1
- package/dist/cjs/{_object-to-array-ce86cae7.js → _object-to-array-9bac8737.js} +2 -2
- package/dist/cjs/{asyncToGenerator-77821af0.js → asyncToGenerator-df19209d.js} +30 -30
- package/dist/cjs/{brightcove-react-player-loader.es-a195642e.js → brightcove-react-player-loader.es-156bd4d6.js} +9 -11
- package/dist/cjs/{core.get-iterator-method-5643aa10.js → core.get-iterator-method-f3c44602.js} +35 -35
- package/dist/cjs/{debounce-d4a2369b.js → debounce-529c8d06.js} +2 -2
- package/dist/cjs/{define-property-e8404b64.js → define-property-21887c62.js} +6 -6
- package/dist/cjs/{defineProperty-9673846a.js → defineProperty-77a37684.js} +1 -1
- package/dist/cjs/{entities-3f9d0f2f.js → entities-310b46ee.js} +1 -1
- package/dist/cjs/{eq-5fc26c07.js → eq-bb2843ed.js} +1 -1
- package/dist/cjs/{extends-7c86182f.js → extends-eed4f016.js} +7 -7
- package/dist/cjs/faundadb.js +19 -19
- package/dist/cjs/{get-5839e5b5.js → get-adbb11e3.js} +21 -21
- package/dist/cjs/getRelatedArticle.js +18 -18
- package/dist/cjs/getRootDocGroup.js +6 -6
- package/dist/cjs/getSerializers.js +43 -43
- package/dist/cjs/{getTargeting-9d509319.js → getTargeting-8874437b.js} +12 -12
- package/dist/cjs/getTargeting.js +6 -6
- package/dist/cjs/iconBase-68959171.js +3 -0
- package/dist/cjs/{index-f86bb269.js → index-3294d3bc.js} +45 -44
- package/dist/cjs/{index-eadd5035.js → index-96b3db50.js} +15 -17
- package/dist/cjs/{index-fc2f1ca2.js → index-98e01cb9.js} +12 -13
- package/dist/cjs/{index-efca863c.js → index-be0c82be.js} +30 -36
- package/dist/cjs/{index-6a2a3e03.js → index-cdacba23.js} +1063 -1089
- package/dist/cjs/{index-8041a4eb.js → index-e2e62963.js} +1 -11
- package/dist/cjs/{index.es-f3e47207.js → index.es-9110add6.js} +12 -31
- package/dist/cjs/{index.esm-8123cf40.js → index.esm-4d410430.js} +20 -20
- package/dist/cjs/{index.esm-974f47d9.js → index.esm-90433435.js} +15 -6
- package/dist/cjs/{index.esm-44f3e2d0.js → index.esm-e32d3e8e.js} +6 -3
- package/dist/cjs/{index.esm-05850a2f.js → index.esm-ff47db6f.js} +12 -5
- package/dist/cjs/index.js +164 -170
- package/dist/cjs/inherits-8d29278d.js +110 -0
- package/dist/cjs/{inherits-de66ea16.js → inherits-cba9c846.js} +19 -19
- package/dist/cjs/{isSymbol-03abbdf0.js → isSymbol-04666465.js} +15 -15
- package/dist/cjs/{keys-e982b3fa.js → keys-d207942e.js} +6 -6
- package/dist/cjs/{lodash-f0783643.js → lodash-fc2922d0.js} +31 -128
- package/dist/cjs/main-02daeefe.js +862 -0
- package/dist/cjs/{md5-e1ca5797.js → md5-5039b1a6.js} +1 -1
- package/dist/cjs/{moment-aca40de1.js → moment-575fe24c.js} +9 -11
- package/dist/cjs/{react-social-icons-af932527.js → react-social-icons-f7f48f71.js} +27 -28
- package/dist/cjs/{slicedToArray-067dd3bc.js → slicedToArray-f6d4eaa8.js} +12 -12
- package/dist/cjs/{smoothscroll-99df7f93.js → smoothscroll-5054361f.js} +1 -1
- package/dist/cjs/{stringify-f7a37a8d.js → stringify-bbc68047.js} +5 -5
- package/dist/cjs/timeDifferenceCalc.js +1 -1
- package/dist/cjs/{toConsumableArray-d7797c2b.js → toConsumableArray-c9b8a0d0.js} +7 -7
- package/dist/cjs/{toNumber-5e1fac58.js → toNumber-36d1e7e5.js} +5 -40
- package/dist/cjs/{typeof-567e31ff.js → typeof-5f52cf64.js} +35 -35
- package/dist/cjs/urlFor.js +6 -6
- package/dist/cjs/{ustream-api-3819e4aa.js → ustream-api-9ebe112f.js} +4 -4
- package/dist/cjs/{util-6f784d85.js → util-f2c1b65b.js} +1 -1
- package/dist/cjs/{visibility-sensor-eb2c5b69.js → visibility-sensor-ad5e3116.js} +5 -7
- package/dist/cjs/{web.dom.iterable-d98303e0.js → web.dom.iterable-e34bf324.js} +2 -2
- package/dist/esm/AD.js +7 -7
- package/dist/esm/AD300x250.js +24 -58
- package/dist/esm/AD300x250x600.js +25 -25
- package/dist/esm/AD728x90.js +28 -28
- package/dist/esm/ADFloatingFooter.js +27 -27
- package/dist/esm/ADFooter.js +9 -9
- package/dist/esm/ADGutter.js +27 -27
- package/dist/esm/{ADInfeed-6c6093ae.js → ADInfeed-8d5edcac.js} +11 -11
- package/dist/esm/ADSkyscraper.js +27 -27
- package/dist/esm/ADSponsoredResources.js +27 -27
- package/dist/esm/ADWebcast.js +27 -27
- package/dist/esm/ADWelcome.js +28 -28
- package/dist/esm/{ADlgInfeed-5d7386e8.js → ADlgInfeed-996c0199.js} +8 -8
- package/dist/esm/AccordionPanel.js +22 -22
- package/dist/esm/AdSlot.js +25 -25
- package/dist/esm/AdSlotsProvider.js +907 -15
- package/dist/esm/AlgoliaSearch.js +703 -820
- package/dist/esm/AlphabeticList.js +20 -20
- package/dist/esm/ArticleCarousel.js +16 -16
- package/dist/esm/ArticleProgramLandingPage.js +54 -54
- package/dist/esm/ArticleSeriesLandingPage.js +35 -35
- package/dist/esm/ArticleSeriesListing.js +55 -55
- package/dist/esm/Auth.js +1487 -659
- package/dist/esm/AuthWrapper.js +265 -306
- package/dist/esm/{AuthorComponent-46a745ba.js → AuthorComponent-e6f95c2f.js} +11 -11
- package/dist/esm/Beam.js +6 -6
- package/dist/esm/{BlockContent-52cf21c5.js → BlockContent-e9b4ddcf.js} +35 -35
- package/dist/esm/Breadcrumbs.js +15 -15
- package/dist/esm/CMEDeck.js +77 -77
- package/dist/esm/Column1.js +9 -9
- package/dist/esm/Column2.js +28 -28
- package/dist/esm/Column3.js +54 -54
- package/dist/esm/ConferenceArticleCard.js +38 -38
- package/dist/esm/{ConferenceBanner-9162d0ca.js → ConferenceBanner-8792ebd2.js} +4 -4
- package/dist/esm/DeckContent.js +96 -96
- package/dist/esm/DeckQueue.js +82 -82
- package/dist/esm/{Dfp-4ca12f2e.js → Dfp-f867d061.js} +20 -20
- package/dist/esm/EventsDeck.js +127 -127
- package/dist/esm/ExternalResources.js +72 -72
- package/dist/esm/Feature.js +21 -21
- package/dist/esm/ForbesHero.js +33 -33
- package/dist/esm/GridContent.js +199 -199
- package/dist/esm/GridHero.js +35 -35
- package/dist/esm/GroupDeck.js +45 -45
- package/dist/esm/HamMagazine.js +114 -114
- package/dist/esm/Header.js +8 -8
- package/dist/esm/Hero.js +13 -13
- package/dist/esm/HighlightenVideo.js +14 -14
- package/dist/esm/HorizontalArticleListing.js +68 -68
- package/dist/esm/HorizontalHero.js +25 -25
- package/dist/esm/IssueContentDeck.js +59 -59
- package/dist/esm/IssueDeck.js +63 -63
- package/dist/esm/IssueLanding.js +90 -90
- package/dist/esm/KMTracker.js +15 -15
- package/dist/esm/LeftNav.js +33 -33
- package/dist/esm/MasterDeck.js +75 -75
- package/dist/esm/MediaSeriesLanding.js +851 -839
- package/dist/esm/NavDvm.js +57 -57
- package/dist/esm/{NavFooter-c29526b7.js → NavFooter-e27bd93b.js} +12 -12
- package/dist/esm/NavMagazine.js +124 -124
- package/dist/esm/NavNative.js +114 -114
- package/dist/esm/OncliveHero.js +20 -19
- package/dist/esm/OncliveLargeHero.js +58 -58
- package/dist/esm/PageFilter.js +10 -10
- package/dist/esm/PartnerDetailListing.js +3912 -112
- package/dist/esm/PdfDownload.js +6 -6
- package/dist/esm/PopUpModal.js +12 -12
- package/dist/esm/PubSection.js +37 -37
- package/dist/esm/PubToc.js +10 -10
- package/dist/esm/PublicationDeck.js +56 -56
- package/dist/esm/PublicationLanding.js +120 -120
- package/dist/esm/QueueDeckExpanded.js +273 -273
- package/dist/esm/RecentNews.js +19 -19
- package/dist/esm/RelatedContent.js +51 -51
- package/dist/esm/RelatedTopicsDropdown.js +21 -21
- package/dist/esm/RolesDeck.js +25 -25
- package/dist/esm/Search.js +11 -11
- package/dist/esm/Segment.js +4 -4
- package/dist/esm/SeriesListingDeck.js +30 -30
- package/dist/esm/{SeriesSlider-485f514e.js → SeriesSlider-d555a1d2.js} +31 -31
- package/dist/esm/SetCookie.js +1 -1
- package/dist/esm/SideFooter.js +32 -32
- package/dist/esm/SocialIcons.js +7 -7
- package/dist/esm/{SocialSearchComponent-a5b11613.js → SocialSearchComponent-d240935c.js} +30 -30
- package/dist/esm/SocialShare.js +25 -25
- package/dist/esm/TaxonomyCard.js +56 -56
- package/dist/esm/TaxonomyDescription.js +48 -48
- package/dist/esm/TemplateNormal.js +68 -68
- package/dist/esm/ThumbnailCard.js +17 -17
- package/dist/esm/Ustream.js +24 -24
- package/dist/esm/VerticalHero.js +17 -17
- package/dist/esm/VideoProgramLandingPage.js +65 -65
- package/dist/esm/VideoSeriesCard.js +26 -26
- package/dist/esm/VideoSeriesFilter.js +13 -13
- package/dist/esm/VideoSeriesLandingPage.js +40 -40
- package/dist/esm/VideoSeriesListing.js +72 -72
- package/dist/esm/View.js +250 -249
- package/dist/esm/YahooHero.js +33 -33
- package/dist/esm/YoutubeGroup.js +52 -52
- package/dist/esm/{_is-array-893ab020.js → _is-array-4df618a6.js} +6 -6
- package/dist/esm/{_iter-detect-f089461c.js → _iter-detect-130ee549.js} +7 -7
- package/dist/esm/{_object-pie-133f504a.js → _object-pie-33c40e79.js} +4 -4
- package/dist/esm/{_object-sap-169d6272.js → _object-sap-8b8ea5a9.js} +1 -1
- package/dist/esm/{_object-to-array-50a6b9a3.js → _object-to-array-c54dd835.js} +2 -2
- package/dist/esm/{asyncToGenerator-b4dfe691.js → asyncToGenerator-7bf8bc4d.js} +30 -30
- package/dist/esm/{brightcove-react-player-loader.es-b43c695a.js → brightcove-react-player-loader.es-83f53e4e.js} +6 -7
- package/dist/esm/{core.get-iterator-method-e903ff31.js → core.get-iterator-method-86d4db69.js} +36 -36
- package/dist/esm/{debounce-533d9748.js → debounce-9207d8ee.js} +2 -2
- package/dist/esm/{define-property-99e66838.js → define-property-6d26cb48.js} +6 -6
- package/dist/esm/{defineProperty-8fa0bc8d.js → defineProperty-d7d9b577.js} +1 -1
- package/dist/esm/{entities-932b50cf.js → entities-7cc3bf45.js} +1 -1
- package/dist/esm/{eq-bdcbf886.js → eq-b470f743.js} +1 -1
- package/dist/esm/{extends-dc6a71fd.js → extends-5b1796d4.js} +7 -7
- package/dist/esm/faundadb.js +5 -5
- package/dist/esm/{get-3c308da4.js → get-1e515072.js} +21 -21
- package/dist/esm/getRelatedArticle.js +12 -12
- package/dist/esm/getRootDocGroup.js +4 -4
- package/dist/esm/getSerializers.js +43 -43
- package/dist/esm/{getTargeting-ff2c9409.js → getTargeting-277c801e.js} +11 -11
- package/dist/esm/getTargeting.js +6 -6
- package/dist/esm/{index-2446af28.js → index-41a678ea.js} +6 -6
- package/dist/esm/{index-35bdcc81.js → index-5f7e79e7.js} +10 -10
- package/dist/esm/{index-0dbff1d1.js → index-73819142.js} +30 -36
- package/dist/esm/{index-67e1773f.js → index-aaa2dae0.js} +2 -11
- package/dist/esm/{index-79cfd25c.js → index-ef6d5dcf.js} +45 -44
- package/dist/esm/{index-5bbd1562.js → index-f51152f7.js} +1021 -1037
- package/dist/esm/{index.es-c6222053.js → index.es-29c1cef5.js} +10 -28
- package/dist/esm/{index.esm-3fdda599.js → index.esm-29e48d38.js} +15 -6
- package/dist/esm/{index.esm-a8ff922c.js → index.esm-cf08bf18.js} +12 -5
- package/dist/esm/{index.esm-c6715e80.js → index.esm-f8aaeeeb.js} +6 -3
- package/dist/esm/{index.esm-8016b507.js → index.esm-fd746768.js} +18 -17
- package/dist/esm/index.js +137 -140
- package/dist/esm/{inherits-8a801a18.js → inherits-2409637d.js} +18 -18
- package/dist/esm/inherits-77d5e4fc.js +101 -0
- package/dist/esm/{isSymbol-a7e9aafe.js → isSymbol-1981418f.js} +15 -15
- package/dist/esm/{keys-425c8ab0.js → keys-69989821.js} +6 -6
- package/dist/esm/{lodash-f97fd99a.js → lodash-17fdfebb.js} +31 -128
- package/dist/esm/main-e4a934b2.js +851 -0
- package/dist/esm/{md5-4e42248e.js → md5-9be0e905.js} +1 -1
- package/dist/esm/{moment-bc12cb97.js → moment-e2f9b20c.js} +9 -11
- package/dist/esm/{react-social-icons-91f9716f.js → react-social-icons-a7d5c5c7.js} +20 -20
- package/dist/esm/{slicedToArray-ca2c8b8d.js → slicedToArray-67a08c9c.js} +12 -12
- package/dist/esm/{smoothscroll-fa4e3f8c.js → smoothscroll-0cd4c7a6.js} +1 -1
- package/dist/esm/stringify-70b72959.js +15 -0
- package/dist/esm/timeDifferenceCalc.js +1 -1
- package/dist/esm/{toConsumableArray-7b1c0e23.js → toConsumableArray-32282905.js} +7 -7
- package/dist/esm/{toNumber-5aeba6e7.js → toNumber-2f7a84cd.js} +5 -40
- package/dist/esm/{typeof-83d9eb10.js → typeof-c05a82ba.js} +35 -35
- package/dist/esm/urlFor.js +4 -4
- package/dist/esm/{ustream-api-41166338.js → ustream-api-4c4fe0ba.js} +4 -4
- package/dist/esm/{util-3ab476bf.js → util-7700fc59.js} +1 -1
- package/dist/esm/{visibility-sensor-f40c2564.js → visibility-sensor-72fd8f8b.js} +2 -2
- package/dist/esm/{web.dom.iterable-fdf034f5.js → web.dom.iterable-f8f967cd.js} +2 -2
- package/package.json +111 -111
- package/dist/cjs/ConferenceBanner-6c9e718a.js +0 -24
- package/dist/cjs/main-025fdc78.js +0 -973
- package/dist/esm/main-b5c5aac1.js +0 -961
- package/dist/esm/stringify-c21932b3.js +0 -15
|
@@ -1,76 +1,3876 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { _ as _extends } from './extends-dc6a71fd.js';
|
|
4
|
-
import React, { useRef, useState, useEffect } from 'react';
|
|
5
|
-
import { TwitterTimelineEmbed } from 'react-twitter-embed';
|
|
6
|
-
import { FacebookProvider, Page } from 'react-facebook';
|
|
7
|
-
import { r as reactSocialIcons_1 } from './react-social-icons-91f9716f.js';
|
|
8
|
-
import { s as smoothscroll } from './smoothscroll-fa4e3f8c.js';
|
|
9
|
-
import urlFor from './urlFor.js';
|
|
10
|
-
import { m as moment } from './moment-bc12cb97.js';
|
|
11
|
-
import QueueDeckExpanded from './QueueDeckExpanded.js';
|
|
12
|
-
import Breadcrumbs from './Breadcrumbs.js';
|
|
13
|
-
import Feature from './Feature.js';
|
|
14
|
-
import { g as getSerializers } from './index-5bbd1562.js';
|
|
15
|
-
import { B as BlockContent } from './BlockContent-52cf21c5.js';
|
|
16
|
-
import './_commonjsHelpers-0c4b6f40.js';
|
|
17
|
-
import './core.get-iterator-method-e903ff31.js';
|
|
18
|
-
import './web.dom.iterable-fdf034f5.js';
|
|
1
|
+
import { c as createCommonjsModule, u as unwrapExports, a as commonjsGlobal } from './_commonjsHelpers-0c4b6f40.js';
|
|
2
|
+
import './core.get-iterator-method-86d4db69.js';
|
|
19
3
|
import './_library-528f1934.js';
|
|
20
|
-
import './_iter-detect-
|
|
21
|
-
import './
|
|
22
|
-
import '
|
|
23
|
-
import './
|
|
24
|
-
import './
|
|
25
|
-
import '
|
|
26
|
-
import './
|
|
27
|
-
import './
|
|
28
|
-
import '
|
|
29
|
-
import './
|
|
4
|
+
import './_iter-detect-130ee549.js';
|
|
5
|
+
import './toConsumableArray-32282905.js';
|
|
6
|
+
import './_object-pie-33c40e79.js';
|
|
7
|
+
import { _ as _extends } from './extends-5b1796d4.js';
|
|
8
|
+
import './_object-sap-8b8ea5a9.js';
|
|
9
|
+
import './inherits-2409637d.js';
|
|
10
|
+
import './define-property-6d26cb48.js';
|
|
11
|
+
import './web.dom.iterable-f8f967cd.js';
|
|
12
|
+
import './typeof-c05a82ba.js';
|
|
13
|
+
import './_is-array-4df618a6.js';
|
|
14
|
+
import React__default, { Component, createContext, forwardRef, PureComponent, useRef, useState, useEffect } from 'react';
|
|
30
15
|
import './events-6c3a7a63.js';
|
|
31
|
-
import '
|
|
32
|
-
import '
|
|
33
|
-
import '
|
|
34
|
-
import '
|
|
35
|
-
import './ADInfeed-6c6093ae.js';
|
|
16
|
+
import './index-41a678ea.js';
|
|
17
|
+
import PropTypes from 'prop-types';
|
|
18
|
+
import 'react-bootstrap/Row';
|
|
19
|
+
import 'react-bootstrap/Col';
|
|
36
20
|
import 'react-bootstrap/Card';
|
|
37
|
-
import './
|
|
38
|
-
import '
|
|
39
|
-
import './isSymbol-
|
|
40
|
-
import './
|
|
41
|
-
import './
|
|
42
|
-
import './
|
|
21
|
+
import { m as moment } from './moment-e2f9b20c.js';
|
|
22
|
+
import 'next/router';
|
|
23
|
+
import './isSymbol-1981418f.js';
|
|
24
|
+
import './debounce-9207d8ee.js';
|
|
25
|
+
import './toNumber-2f7a84cd.js';
|
|
26
|
+
import './index.es-29c1cef5.js';
|
|
27
|
+
import 'react-dom';
|
|
28
|
+
import './visibility-sensor-72fd8f8b.js';
|
|
29
|
+
import { _ as _slicedToArray } from './slicedToArray-67a08c9c.js';
|
|
30
|
+
import './index-73819142.js';
|
|
31
|
+
import urlFor from './urlFor.js';
|
|
32
|
+
import './index-5f7e79e7.js';
|
|
33
|
+
import './main-e4a934b2.js';
|
|
34
|
+
import './entities-7cc3bf45.js';
|
|
35
|
+
import './stringify-70b72959.js';
|
|
36
|
+
import { a as _asyncToGenerator$1, r as regenerator, _ as _Promise } from './asyncToGenerator-7bf8bc4d.js';
|
|
43
37
|
import './Segment.js';
|
|
44
|
-
import './
|
|
45
|
-
import './
|
|
46
|
-
import './
|
|
38
|
+
import './Beam.js';
|
|
39
|
+
import './AdSlot.js';
|
|
40
|
+
import './ADInfeed-8d5edcac.js';
|
|
41
|
+
import './lodash-17fdfebb.js';
|
|
42
|
+
import './ADlgInfeed-996c0199.js';
|
|
47
43
|
import './getContentCategory-15dcc413.js';
|
|
48
|
-
import './
|
|
49
|
-
import 'react-bootstrap/
|
|
50
|
-
import '
|
|
44
|
+
import './AuthorComponent-e6f95c2f.js';
|
|
45
|
+
import 'react-bootstrap/Button';
|
|
46
|
+
import { B as BlockContent } from './BlockContent-e9b4ddcf.js';
|
|
47
|
+
import { r as reactSocialIcons_1 } from './react-social-icons-a7d5c5c7.js';
|
|
51
48
|
import './index-c7e2ac95.js';
|
|
52
|
-
import './
|
|
53
|
-
import './typeof-83d9eb10.js';
|
|
54
|
-
import './_is-array-893ab020.js';
|
|
55
|
-
import './brightcove-react-player-loader.es-b43c695a.js';
|
|
49
|
+
import { s as smoothscroll } from './smoothscroll-0cd4c7a6.js';
|
|
56
50
|
import './GroupDeck.js';
|
|
57
|
-
import '
|
|
51
|
+
import 'react-bootstrap';
|
|
52
|
+
import './timeDifferenceCalc.js';
|
|
53
|
+
import QueueDeckExpanded from './QueueDeckExpanded.js';
|
|
54
|
+
import './iconBase-602d52fe.js';
|
|
55
|
+
import './index.esm-29e48d38.js';
|
|
56
|
+
import { g as getSerializers } from './index-f51152f7.js';
|
|
57
|
+
import './util-7700fc59.js';
|
|
58
|
+
import './brightcove-react-player-loader.es-83f53e4e.js';
|
|
58
59
|
import 'next/head';
|
|
59
60
|
import 'react-share';
|
|
60
|
-
import './
|
|
61
|
+
import './SocialShare.js';
|
|
62
|
+
import './_object-to-array-c54dd835.js';
|
|
61
63
|
import 'react-bootstrap/Pagination';
|
|
62
|
-
import 'react-bootstrap/Button';
|
|
63
|
-
import 'react-bootstrap/Row';
|
|
64
|
-
import 'react-bootstrap/Col';
|
|
65
|
-
import './inherits-8a801a18.js';
|
|
66
|
-
import './_object-sap-169d6272.js';
|
|
67
|
-
import './define-property-99e66838.js';
|
|
68
|
-
import './index.esm-3fdda599.js';
|
|
69
|
-
import './iconBase-602d52fe.js';
|
|
70
64
|
import 'react-bootstrap/Figure';
|
|
71
65
|
import 'react-bootstrap/OverlayTrigger';
|
|
72
66
|
import 'react-bootstrap/Tooltip';
|
|
73
67
|
import 'react-bootstrap/Popover';
|
|
68
|
+
import { _ as _defineProperty$1, b as _inherits, c as _classCallCheck, d as _possibleConstructorReturn, e as _getPrototypeOf, g as _createClass } from './inherits-77d5e4fc.js';
|
|
69
|
+
import 'react-bootstrap/Carousel';
|
|
70
|
+
import Feature from './Feature.js';
|
|
71
|
+
import 'react-bootstrap/Breadcrumb';
|
|
72
|
+
import Breadcrumbs from './Breadcrumbs.js';
|
|
73
|
+
|
|
74
|
+
var isRequiredIf_1 = createCommonjsModule(function (module, exports) {
|
|
75
|
+
Object.defineProperty(exports,'__esModule',{value:!0});var VALIDATOR_ARG_ERROR_MESSAGE='The typeValidator argument must be a function with the signature function(props, propName, componentName).',MESSAGE_ARG_ERROR_MESSAGE='The error message is optional, but must be a string if provided.',propIsRequired=function propIsRequired(a,b,c,d){if('boolean'==typeof a)return a;return 'function'==typeof a?a(b,c,d):!(!0!==!!a)&&!!a},propExists=function propExists(a,b){return Object.hasOwnProperty.call(a,b)},missingPropError=function missingPropError(a,b,c,d){return d?new Error(d):new Error('Required '+a[b]+' `'+b+'`'+(' was not specified in `'+c+'`.'))},guardAgainstInvalidArgTypes=function guardAgainstInvalidArgTypes(a,b){if('function'!=typeof a)throw new TypeError(VALIDATOR_ARG_ERROR_MESSAGE);if(!!b&&'string'!=typeof b)throw new TypeError(MESSAGE_ARG_ERROR_MESSAGE)},isRequiredIf=function isRequiredIf(a,b,c){return guardAgainstInvalidArgTypes(a,c),function(d,e,f){for(var _len=arguments.length,g=Array(3<_len?_len-3:0),_key=3;_key<_len;_key++)g[_key-3]=arguments[_key];return propIsRequired(b,d,e,f)?propExists(d,e)?a.apply(void 0,[d,e,f].concat(g)):missingPropError(d,e,f,c):a.apply(void 0,[d,e,f].concat(g));// Is not required, so just run typeValidator.
|
|
76
|
+
}};exports.default=isRequiredIf;
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
var isRequiredIf = unwrapExports(isRequiredIf_1);
|
|
82
|
+
|
|
83
|
+
var exenv = createCommonjsModule(function (module) {
|
|
84
|
+
/*!
|
|
85
|
+
Copyright (c) 2015 Jed Watson.
|
|
86
|
+
Based on code that is Copyright 2013-2015, Facebook, Inc.
|
|
87
|
+
All rights reserved.
|
|
88
|
+
*/
|
|
89
|
+
/* global define */
|
|
90
|
+
|
|
91
|
+
(function () {
|
|
92
|
+
|
|
93
|
+
var canUseDOM = !!(
|
|
94
|
+
typeof window !== 'undefined' &&
|
|
95
|
+
window.document &&
|
|
96
|
+
window.document.createElement
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
var ExecutionEnvironment = {
|
|
100
|
+
|
|
101
|
+
canUseDOM: canUseDOM,
|
|
102
|
+
|
|
103
|
+
canUseWorkers: typeof Worker !== 'undefined',
|
|
104
|
+
|
|
105
|
+
canUseEventListeners:
|
|
106
|
+
canUseDOM && !!(window.addEventListener || window.attachEvent),
|
|
107
|
+
|
|
108
|
+
canUseViewport: canUseDOM && !!window.screen
|
|
109
|
+
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
if ( module.exports) {
|
|
113
|
+
module.exports = ExecutionEnvironment;
|
|
114
|
+
} else {
|
|
115
|
+
window.ExecutionEnvironment = ExecutionEnvironment;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
}());
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
var twitterWidgetJs = 'https://platform.twitter.com/widgets.js';
|
|
122
|
+
|
|
123
|
+
var TwitterTimelineEmbed =
|
|
124
|
+
/*#__PURE__*/
|
|
125
|
+
function (_Component) {
|
|
126
|
+
_inherits(TwitterTimelineEmbed, _Component);
|
|
127
|
+
|
|
128
|
+
function TwitterTimelineEmbed(props) {
|
|
129
|
+
var _this;
|
|
130
|
+
|
|
131
|
+
_classCallCheck(this, TwitterTimelineEmbed);
|
|
132
|
+
|
|
133
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterTimelineEmbed).call(this, props));
|
|
134
|
+
_this.state = {
|
|
135
|
+
isLoading: true
|
|
136
|
+
};
|
|
137
|
+
return _this;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
_createClass(TwitterTimelineEmbed, [{
|
|
141
|
+
key: "buildChromeOptions",
|
|
142
|
+
value: function buildChromeOptions(options) {
|
|
143
|
+
options.chrome = '';
|
|
144
|
+
|
|
145
|
+
if (this.props.noHeader) {
|
|
146
|
+
options.chrome = options.chrome + ' noheader';
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (this.props.noFooter) {
|
|
150
|
+
options.chrome = options.chrome + ' nofooter';
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (this.props.noBorders) {
|
|
154
|
+
options.chrome = options.chrome + ' noborders';
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (this.props.noScrollbar) {
|
|
158
|
+
options.chrome = options.chrome + ' noscrollbar';
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (this.props.transparent) {
|
|
162
|
+
options.chrome = options.chrome + ' transparent';
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return options;
|
|
166
|
+
}
|
|
167
|
+
}, {
|
|
168
|
+
key: "buildOptions",
|
|
169
|
+
value: function buildOptions() {
|
|
170
|
+
var options = Object.assign({}, this.props.options);
|
|
171
|
+
|
|
172
|
+
if (this.props.autoHeight) {
|
|
173
|
+
options.height = this.refs.embedContainer.parentNode.offsetHeight;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
options = Object.assign({}, options, {
|
|
177
|
+
theme: this.props.theme,
|
|
178
|
+
linkColor: this.props.linkColor,
|
|
179
|
+
borderColor: this.props.borderColor,
|
|
180
|
+
lang: this.props.lang
|
|
181
|
+
});
|
|
182
|
+
return options;
|
|
183
|
+
}
|
|
184
|
+
}, {
|
|
185
|
+
key: "renderWidget",
|
|
186
|
+
value: function renderWidget(options) {
|
|
187
|
+
var _this2 = this;
|
|
188
|
+
|
|
189
|
+
var onLoad = this.props.onLoad;
|
|
190
|
+
|
|
191
|
+
if (!this.isMountCanceled) {
|
|
192
|
+
window.twttr.widgets.createTimeline({
|
|
193
|
+
sourceType: this.props.sourceType,
|
|
194
|
+
screenName: this.props.screenName,
|
|
195
|
+
userId: this.props.userId,
|
|
196
|
+
ownerScreenName: this.props.ownerScreenName,
|
|
197
|
+
slug: this.props.slug,
|
|
198
|
+
id: this.props.id || this.props.widgetId,
|
|
199
|
+
url: this.props.url
|
|
200
|
+
}, this.refs.embedContainer, options).then(function (element) {
|
|
201
|
+
_this2.setState({
|
|
202
|
+
isLoading: false
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
if (onLoad) {
|
|
206
|
+
onLoad(element);
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}, {
|
|
212
|
+
key: "componentDidMount",
|
|
213
|
+
value: function componentDidMount() {
|
|
214
|
+
var _this3 = this;
|
|
215
|
+
|
|
216
|
+
if (exenv.canUseDOM) {
|
|
217
|
+
var script = require('scriptjs');
|
|
218
|
+
|
|
219
|
+
script(twitterWidgetJs, 'twitter-embed', function () {
|
|
220
|
+
if (!window.twttr) {
|
|
221
|
+
console.error('Failure to load window.twttr in TwitterTimelineEmbed, aborting load.');
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
var options = _this3.buildOptions();
|
|
226
|
+
/** Append chrome options */
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
options = _this3.buildChromeOptions(options);
|
|
230
|
+
|
|
231
|
+
_this3.renderWidget(options);
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}, {
|
|
236
|
+
key: "componentWillUnmount",
|
|
237
|
+
value: function componentWillUnmount() {
|
|
238
|
+
this.isMountCanceled = true;
|
|
239
|
+
}
|
|
240
|
+
}, {
|
|
241
|
+
key: "render",
|
|
242
|
+
value: function render() {
|
|
243
|
+
var isLoading = this.state.isLoading;
|
|
244
|
+
var placeholder = this.props.placeholder;
|
|
245
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
246
|
+
ref: "embedContainer"
|
|
247
|
+
}));
|
|
248
|
+
}
|
|
249
|
+
}]);
|
|
250
|
+
|
|
251
|
+
return TwitterTimelineEmbed;
|
|
252
|
+
}(Component);
|
|
253
|
+
|
|
254
|
+
_defineProperty$1(TwitterTimelineEmbed, "propTypes", {
|
|
255
|
+
/**
|
|
256
|
+
* This can be either of profile, likes, list, collection, URL, widget
|
|
257
|
+
*/
|
|
258
|
+
sourceType: PropTypes.oneOf(['profile', 'likes', 'list', 'collection', 'url', 'widget']).isRequired,
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* username of twitter handle as String
|
|
262
|
+
*/
|
|
263
|
+
screenName: isRequiredIf(PropTypes.string, function (props) {
|
|
264
|
+
return !props.hasOwnProperty('userId') && (props.sourceType === 'profile' || props.sourceType === 'likes');
|
|
265
|
+
}),
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* UserId of twitter handle as number
|
|
269
|
+
*/
|
|
270
|
+
userId: isRequiredIf(PropTypes.number, function (props) {
|
|
271
|
+
return !props.hasOwnProperty('screenName') && (props.sourceType === 'profile' || props.sourceType === 'likes');
|
|
272
|
+
}),
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* To show list, used along with slug
|
|
276
|
+
*/
|
|
277
|
+
ownerScreenName: isRequiredIf(PropTypes.string, function (props) {
|
|
278
|
+
return props.sourceType === 'list' && !props.hasOwnProperty('id');
|
|
279
|
+
}),
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* To show list, used along with ownerScreenName
|
|
283
|
+
*/
|
|
284
|
+
slug: isRequiredIf(PropTypes.string, function (props) {
|
|
285
|
+
return props.sourceType === 'list' && !props.hasOwnProperty('id');
|
|
286
|
+
}),
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* To show list, unique list id
|
|
290
|
+
* Also used with collections, in that case its valid collection id
|
|
291
|
+
*/
|
|
292
|
+
id: isRequiredIf(PropTypes.oneOfType([PropTypes.number, PropTypes.string]), function (props) {
|
|
293
|
+
return props.sourceType === 'list' && !props.hasOwnProperty('ownerScreenName') && !props.hasOwnProperty('slug') || props.sourceType === 'collection';
|
|
294
|
+
}),
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* To show twitter content with url.
|
|
298
|
+
* Supported content includes profiles, likes, lists, and collections.
|
|
299
|
+
*/
|
|
300
|
+
url: isRequiredIf(PropTypes.string, function (props) {
|
|
301
|
+
return props.sourceType === 'url';
|
|
302
|
+
}),
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* To show custom widget
|
|
306
|
+
*/
|
|
307
|
+
widgetId: isRequiredIf(PropTypes.string, function (props) {
|
|
308
|
+
return props.sourceType === 'widget';
|
|
309
|
+
}),
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Additional options to pass to twitter widget plugin
|
|
313
|
+
*/
|
|
314
|
+
options: PropTypes.object,
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Automatically fit into parent container height
|
|
318
|
+
*/
|
|
319
|
+
autoHeight: PropTypes.bool,
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* With dark or light theme
|
|
323
|
+
*/
|
|
324
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* With custom link colors. Note: Only Hex colors are supported.
|
|
328
|
+
*/
|
|
329
|
+
linkColor: PropTypes.string,
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* With custom border colors. Note: Only Hex colors are supported.
|
|
333
|
+
*/
|
|
334
|
+
borderColor: PropTypes.string,
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Hide the header from timeline
|
|
338
|
+
*/
|
|
339
|
+
noHeader: PropTypes.bool,
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Hide the footer from timeline
|
|
343
|
+
*/
|
|
344
|
+
noFooter: PropTypes.bool,
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Hide the border from timeline
|
|
348
|
+
*/
|
|
349
|
+
noBorders: PropTypes.bool,
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Hide the scrollbars
|
|
353
|
+
*/
|
|
354
|
+
noScrollbar: PropTypes.bool,
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Enable Transparancy
|
|
358
|
+
*/
|
|
359
|
+
transparent: PropTypes.bool,
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Custom language code. Supported codes here: https://developer.twitter.com/en/docs/twitter-for-websites/twitter-for-websites-supported-languages/overview.html
|
|
363
|
+
*/
|
|
364
|
+
lang: PropTypes.string,
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Placeholder while tweet is loading
|
|
368
|
+
*/
|
|
369
|
+
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Function to execute after load, return html element
|
|
373
|
+
*/
|
|
374
|
+
onLoad: PropTypes.func
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
var TwitterShareButton =
|
|
378
|
+
/*#__PURE__*/
|
|
379
|
+
function (_Component) {
|
|
380
|
+
_inherits(TwitterShareButton, _Component);
|
|
381
|
+
|
|
382
|
+
function TwitterShareButton(props) {
|
|
383
|
+
var _this;
|
|
384
|
+
|
|
385
|
+
_classCallCheck(this, TwitterShareButton);
|
|
386
|
+
|
|
387
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterShareButton).call(this, props));
|
|
388
|
+
_this.state = {
|
|
389
|
+
isLoading: true
|
|
390
|
+
};
|
|
391
|
+
return _this;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
_createClass(TwitterShareButton, [{
|
|
395
|
+
key: "componentDidMount",
|
|
396
|
+
value: function componentDidMount() {
|
|
397
|
+
var _this2 = this;
|
|
398
|
+
|
|
399
|
+
var onLoad = this.props.onLoad;
|
|
400
|
+
|
|
401
|
+
if (exenv.canUseDOM) {
|
|
402
|
+
var script = require('scriptjs');
|
|
403
|
+
|
|
404
|
+
script(twitterWidgetJs, 'twitter-embed', function () {
|
|
405
|
+
if (!window.twttr) {
|
|
406
|
+
console.error('Failure to load window.twttr in TwitterShareButton, aborting load.');
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
if (!_this2.isMountCanceled) {
|
|
411
|
+
window.twttr.widgets.createShareButton(_this2.props.url, _this2.refs.embedContainer, _this2.props.options).then(function (element) {
|
|
412
|
+
_this2.setState({
|
|
413
|
+
isLoading: false
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
if (onLoad) {
|
|
417
|
+
onLoad(element);
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}, {
|
|
425
|
+
key: "componentWillUnmount",
|
|
426
|
+
value: function componentWillUnmount() {
|
|
427
|
+
this.isMountCanceled = true;
|
|
428
|
+
}
|
|
429
|
+
}, {
|
|
430
|
+
key: "render",
|
|
431
|
+
value: function render() {
|
|
432
|
+
var isLoading = this.state.isLoading;
|
|
433
|
+
var placeholder = this.props.placeholder;
|
|
434
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
435
|
+
ref: "embedContainer"
|
|
436
|
+
}));
|
|
437
|
+
}
|
|
438
|
+
}]);
|
|
439
|
+
|
|
440
|
+
return TwitterShareButton;
|
|
441
|
+
}(Component);
|
|
442
|
+
|
|
443
|
+
_defineProperty$1(TwitterShareButton, "propTypes", {
|
|
444
|
+
/**
|
|
445
|
+
* Url for sharing
|
|
446
|
+
*/
|
|
447
|
+
url: PropTypes.string.isRequired,
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Additional options for overriding config. Details at : https://dev.twitter.com/web/tweet-button/parameters
|
|
451
|
+
*/
|
|
452
|
+
options: PropTypes.object,
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Placeholder while tweet is loading
|
|
456
|
+
*/
|
|
457
|
+
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Function to execute after load, return html element
|
|
461
|
+
*/
|
|
462
|
+
onLoad: PropTypes.func
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
var TwitterFollowButton =
|
|
466
|
+
/*#__PURE__*/
|
|
467
|
+
function (_Component) {
|
|
468
|
+
_inherits(TwitterFollowButton, _Component);
|
|
469
|
+
|
|
470
|
+
function TwitterFollowButton(props) {
|
|
471
|
+
var _this;
|
|
472
|
+
|
|
473
|
+
_classCallCheck(this, TwitterFollowButton);
|
|
474
|
+
|
|
475
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterFollowButton).call(this, props));
|
|
476
|
+
_this.state = {
|
|
477
|
+
isLoading: true
|
|
478
|
+
};
|
|
479
|
+
return _this;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
_createClass(TwitterFollowButton, [{
|
|
483
|
+
key: "componentDidMount",
|
|
484
|
+
value: function componentDidMount() {
|
|
485
|
+
var _this2 = this;
|
|
486
|
+
|
|
487
|
+
var onLoad = this.props.onLoad;
|
|
488
|
+
|
|
489
|
+
if (exenv.canUseDOM) {
|
|
490
|
+
var script = require('scriptjs');
|
|
491
|
+
|
|
492
|
+
script(twitterWidgetJs, 'twitter-embed', function () {
|
|
493
|
+
if (!window.twttr) {
|
|
494
|
+
console.error('Failure to load window.twttr in TwitterFollowButton, aborting load.');
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
if (!_this2.isMountCanceled) {
|
|
499
|
+
window.twttr.widgets.createFollowButton(_this2.props.screenName, _this2.refs.embedContainer, _this2.props.options).then(function (element) {
|
|
500
|
+
_this2.setState({
|
|
501
|
+
isLoading: false
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
if (onLoad) {
|
|
505
|
+
onLoad(element);
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}, {
|
|
513
|
+
key: "componentWillUnmount",
|
|
514
|
+
value: function componentWillUnmount() {
|
|
515
|
+
this.isMountCanceled = true;
|
|
516
|
+
}
|
|
517
|
+
}, {
|
|
518
|
+
key: "render",
|
|
519
|
+
value: function render() {
|
|
520
|
+
var isLoading = this.state.isLoading;
|
|
521
|
+
var placeholder = this.props.placeholder;
|
|
522
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
523
|
+
ref: "embedContainer"
|
|
524
|
+
}));
|
|
525
|
+
}
|
|
526
|
+
}]);
|
|
527
|
+
|
|
528
|
+
return TwitterFollowButton;
|
|
529
|
+
}(Component);
|
|
530
|
+
|
|
531
|
+
_defineProperty$1(TwitterFollowButton, "propTypes", {
|
|
532
|
+
/**
|
|
533
|
+
* Username of twitter user which will be followed on click
|
|
534
|
+
*/
|
|
535
|
+
screenName: PropTypes.string.isRequired,
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Additional options to be added to the button
|
|
539
|
+
*/
|
|
540
|
+
options: PropTypes.object,
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Placeholder while tweet is loading
|
|
544
|
+
*/
|
|
545
|
+
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Function to execute after load, return html element
|
|
549
|
+
*/
|
|
550
|
+
onLoad: PropTypes.func
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
var TwitterHashtagButton =
|
|
554
|
+
/*#__PURE__*/
|
|
555
|
+
function (_Component) {
|
|
556
|
+
_inherits(TwitterHashtagButton, _Component);
|
|
557
|
+
|
|
558
|
+
function TwitterHashtagButton(props) {
|
|
559
|
+
var _this;
|
|
560
|
+
|
|
561
|
+
_classCallCheck(this, TwitterHashtagButton);
|
|
562
|
+
|
|
563
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterHashtagButton).call(this, props));
|
|
564
|
+
_this.state = {
|
|
565
|
+
isLoading: true
|
|
566
|
+
};
|
|
567
|
+
return _this;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
_createClass(TwitterHashtagButton, [{
|
|
571
|
+
key: "componentDidMount",
|
|
572
|
+
value: function componentDidMount() {
|
|
573
|
+
var _this2 = this;
|
|
574
|
+
|
|
575
|
+
var onLoad = this.props.onLoad;
|
|
576
|
+
|
|
577
|
+
if (exenv.canUseDOM) {
|
|
578
|
+
var script = require('scriptjs');
|
|
579
|
+
|
|
580
|
+
script(twitterWidgetJs, 'twitter-embed', function () {
|
|
581
|
+
if (!window.twttr) {
|
|
582
|
+
console.error('Failure to load window.twttr in TwitterHashtagButton, aborting load.');
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
if (!_this2.isMountCanceled) {
|
|
587
|
+
window.twttr.widgets.createHashtagButton(_this2.props.tag, _this2.refs.embedContainer, _this2.props.options).then(function (element) {
|
|
588
|
+
_this2.setState({
|
|
589
|
+
isLoading: false
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
if (onLoad) {
|
|
593
|
+
onLoad(element);
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}, {
|
|
601
|
+
key: "componentWillUnmount",
|
|
602
|
+
value: function componentWillUnmount() {
|
|
603
|
+
this.isMountCanceled = true;
|
|
604
|
+
}
|
|
605
|
+
}, {
|
|
606
|
+
key: "render",
|
|
607
|
+
value: function render() {
|
|
608
|
+
var isLoading = this.state.isLoading;
|
|
609
|
+
var placeholder = this.props.placeholder;
|
|
610
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
611
|
+
ref: "embedContainer"
|
|
612
|
+
}));
|
|
613
|
+
}
|
|
614
|
+
}]);
|
|
615
|
+
|
|
616
|
+
return TwitterHashtagButton;
|
|
617
|
+
}(Component);
|
|
618
|
+
|
|
619
|
+
_defineProperty$1(TwitterHashtagButton, "propTypes", {
|
|
620
|
+
/**
|
|
621
|
+
* Tag name for hashtag button
|
|
622
|
+
*/
|
|
623
|
+
tag: PropTypes.string.isRequired,
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Additional options to be added to the button
|
|
627
|
+
*/
|
|
628
|
+
options: PropTypes.object,
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Placeholder while tweet is loading
|
|
632
|
+
*/
|
|
633
|
+
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* Function to execute after load, return html element
|
|
637
|
+
*/
|
|
638
|
+
onLoad: PropTypes.func
|
|
639
|
+
});
|
|
640
|
+
|
|
641
|
+
var TwitterMentionButton =
|
|
642
|
+
/*#__PURE__*/
|
|
643
|
+
function (_Component) {
|
|
644
|
+
_inherits(TwitterMentionButton, _Component);
|
|
645
|
+
|
|
646
|
+
function TwitterMentionButton(props) {
|
|
647
|
+
var _this;
|
|
648
|
+
|
|
649
|
+
_classCallCheck(this, TwitterMentionButton);
|
|
650
|
+
|
|
651
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterMentionButton).call(this, props));
|
|
652
|
+
_this.state = {
|
|
653
|
+
isLoading: true
|
|
654
|
+
};
|
|
655
|
+
return _this;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
_createClass(TwitterMentionButton, [{
|
|
659
|
+
key: "componentDidMount",
|
|
660
|
+
value: function componentDidMount() {
|
|
661
|
+
var _this2 = this;
|
|
662
|
+
|
|
663
|
+
var onLoad = this.props.onLoad;
|
|
664
|
+
|
|
665
|
+
if (exenv.canUseDOM) {
|
|
666
|
+
var script = require('scriptjs');
|
|
667
|
+
|
|
668
|
+
script(twitterWidgetJs, 'twitter-embed', function () {
|
|
669
|
+
if (!window.twttr) {
|
|
670
|
+
console.error('Failure to load window.twttr in TwitterMentionButton, aborting load.');
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
if (!_this2.isMountCanceled) {
|
|
675
|
+
window.twttr.widgets.createMentionButton(_this2.props.screenName, _this2.refs.embedContainer, _this2.props.options).then(function (element) {
|
|
676
|
+
_this2.setState({
|
|
677
|
+
isLoading: false
|
|
678
|
+
});
|
|
679
|
+
|
|
680
|
+
if (onLoad) {
|
|
681
|
+
onLoad(element);
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
}, {
|
|
689
|
+
key: "componentWillUnmount",
|
|
690
|
+
value: function componentWillUnmount() {
|
|
691
|
+
this.isMountCanceled = true;
|
|
692
|
+
}
|
|
693
|
+
}, {
|
|
694
|
+
key: "render",
|
|
695
|
+
value: function render() {
|
|
696
|
+
var isLoading = this.state.isLoading;
|
|
697
|
+
var placeholder = this.props.placeholder;
|
|
698
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
699
|
+
ref: "embedContainer"
|
|
700
|
+
}));
|
|
701
|
+
}
|
|
702
|
+
}]);
|
|
703
|
+
|
|
704
|
+
return TwitterMentionButton;
|
|
705
|
+
}(Component);
|
|
706
|
+
|
|
707
|
+
_defineProperty$1(TwitterMentionButton, "propTypes", {
|
|
708
|
+
/**
|
|
709
|
+
* Username to which you will need to tweet
|
|
710
|
+
*/
|
|
711
|
+
screenName: PropTypes.string.isRequired,
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* Additional options for overriding config.
|
|
715
|
+
*/
|
|
716
|
+
options: PropTypes.object,
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Placeholder while tweet is loading
|
|
720
|
+
*/
|
|
721
|
+
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Function to execute after load, return html element
|
|
725
|
+
*/
|
|
726
|
+
onLoad: PropTypes.func
|
|
727
|
+
});
|
|
728
|
+
|
|
729
|
+
var TwitterTweetEmbed =
|
|
730
|
+
/*#__PURE__*/
|
|
731
|
+
function (_Component) {
|
|
732
|
+
_inherits(TwitterTweetEmbed, _Component);
|
|
733
|
+
|
|
734
|
+
function TwitterTweetEmbed(props) {
|
|
735
|
+
var _this;
|
|
736
|
+
|
|
737
|
+
_classCallCheck(this, TwitterTweetEmbed);
|
|
738
|
+
|
|
739
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterTweetEmbed).call(this, props));
|
|
740
|
+
_this.state = {
|
|
741
|
+
isLoading: true
|
|
742
|
+
};
|
|
743
|
+
return _this;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
_createClass(TwitterTweetEmbed, [{
|
|
747
|
+
key: "renderWidget",
|
|
748
|
+
value: function renderWidget() {
|
|
749
|
+
var _this2 = this;
|
|
750
|
+
|
|
751
|
+
var onLoad = this.props.onLoad;
|
|
752
|
+
|
|
753
|
+
if (!window.twttr) {
|
|
754
|
+
console.error('Failure to load window.twttr in TwitterTweetEmbed, aborting load.');
|
|
755
|
+
return;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
if (!this.isMountCanceled) {
|
|
759
|
+
window.twttr.widgets.createTweet(this.props.tweetId, this.refs.embedContainer, this.props.options).then(function (element) {
|
|
760
|
+
_this2.setState({
|
|
761
|
+
isLoading: false
|
|
762
|
+
});
|
|
763
|
+
|
|
764
|
+
if (onLoad) {
|
|
765
|
+
onLoad(element);
|
|
766
|
+
}
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}, {
|
|
771
|
+
key: "componentDidMount",
|
|
772
|
+
value: function componentDidMount() {
|
|
773
|
+
var _this3 = this;
|
|
774
|
+
|
|
775
|
+
if (exenv.canUseDOM) {
|
|
776
|
+
var script = require('scriptjs');
|
|
777
|
+
|
|
778
|
+
script(twitterWidgetJs, 'twitter-embed', function () {
|
|
779
|
+
_this3.renderWidget();
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
}, {
|
|
784
|
+
key: "componentWillUnmount",
|
|
785
|
+
value: function componentWillUnmount() {
|
|
786
|
+
this.isMountCanceled = true;
|
|
787
|
+
}
|
|
788
|
+
}, {
|
|
789
|
+
key: "render",
|
|
790
|
+
value: function render() {
|
|
791
|
+
var isLoading = this.state.isLoading;
|
|
792
|
+
var placeholder = this.props.placeholder;
|
|
793
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
794
|
+
ref: "embedContainer"
|
|
795
|
+
}));
|
|
796
|
+
}
|
|
797
|
+
}]);
|
|
798
|
+
|
|
799
|
+
return TwitterTweetEmbed;
|
|
800
|
+
}(Component);
|
|
801
|
+
|
|
802
|
+
_defineProperty$1(TwitterTweetEmbed, "propTypes", {
|
|
803
|
+
/**
|
|
804
|
+
* Tweet id that needs to be shown
|
|
805
|
+
*/
|
|
806
|
+
tweetId: PropTypes.string.isRequired,
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* Additional options to pass to twitter widget plugin
|
|
810
|
+
*/
|
|
811
|
+
options: PropTypes.object,
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* Placeholder while tweet is loading
|
|
815
|
+
*/
|
|
816
|
+
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Function to execute after load, return html element
|
|
820
|
+
*/
|
|
821
|
+
onLoad: PropTypes.func
|
|
822
|
+
});
|
|
823
|
+
|
|
824
|
+
var TwitterMomentShare =
|
|
825
|
+
/*#__PURE__*/
|
|
826
|
+
function (_Component) {
|
|
827
|
+
_inherits(TwitterMomentShare, _Component);
|
|
828
|
+
|
|
829
|
+
function TwitterMomentShare(props) {
|
|
830
|
+
var _this;
|
|
831
|
+
|
|
832
|
+
_classCallCheck(this, TwitterMomentShare);
|
|
833
|
+
|
|
834
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterMomentShare).call(this, props));
|
|
835
|
+
_this.state = {
|
|
836
|
+
isLoading: true
|
|
837
|
+
};
|
|
838
|
+
return _this;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
_createClass(TwitterMomentShare, [{
|
|
842
|
+
key: "componentDidMount",
|
|
843
|
+
value: function componentDidMount() {
|
|
844
|
+
var _this2 = this;
|
|
845
|
+
|
|
846
|
+
var onLoad = this.props.onLoad;
|
|
847
|
+
|
|
848
|
+
if (exenv.canUseDOM) {
|
|
849
|
+
var script = require('scriptjs');
|
|
850
|
+
|
|
851
|
+
script(twitterWidgetJs, 'twitter-embed', function () {
|
|
852
|
+
if (!window.twttr) {
|
|
853
|
+
console.error('Failure to load window.twttr in TwitterMomentShare, aborting load.');
|
|
854
|
+
return;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
if (!_this2.isMountCanceled) {
|
|
858
|
+
window.twttr.widgets.createMoment(_this2.props.momentId, _this2.refs.shareMoment, _this2.props.options).then(function (element) {
|
|
859
|
+
_this2.setState({
|
|
860
|
+
isLoading: false
|
|
861
|
+
});
|
|
862
|
+
|
|
863
|
+
if (onLoad) {
|
|
864
|
+
onLoad(element);
|
|
865
|
+
}
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}, {
|
|
872
|
+
key: "componentWillUnmount",
|
|
873
|
+
value: function componentWillUnmount() {
|
|
874
|
+
this.isMountCanceled = true;
|
|
875
|
+
}
|
|
876
|
+
}, {
|
|
877
|
+
key: "render",
|
|
878
|
+
value: function render() {
|
|
879
|
+
var isLoading = this.state.isLoading;
|
|
880
|
+
var placeholder = this.props.placeholder;
|
|
881
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
882
|
+
ref: "shareMoment"
|
|
883
|
+
}));
|
|
884
|
+
}
|
|
885
|
+
}]);
|
|
886
|
+
|
|
887
|
+
return TwitterMomentShare;
|
|
888
|
+
}(Component);
|
|
889
|
+
|
|
890
|
+
_defineProperty$1(TwitterMomentShare, "propTypes", {
|
|
891
|
+
/**
|
|
892
|
+
* id of Twitter moment to show
|
|
893
|
+
*/
|
|
894
|
+
momentId: PropTypes.string.isRequired,
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* Additional options for overriding config.
|
|
898
|
+
*/
|
|
899
|
+
options: PropTypes.object,
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* Placeholder while tweet is loading
|
|
903
|
+
*/
|
|
904
|
+
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* Function to execute after load, return html element
|
|
908
|
+
*/
|
|
909
|
+
onLoad: PropTypes.func
|
|
910
|
+
});
|
|
911
|
+
|
|
912
|
+
var TwitterDMButton =
|
|
913
|
+
/*#__PURE__*/
|
|
914
|
+
function (_Component) {
|
|
915
|
+
_inherits(TwitterDMButton, _Component);
|
|
916
|
+
|
|
917
|
+
function TwitterDMButton(props) {
|
|
918
|
+
var _this;
|
|
919
|
+
|
|
920
|
+
_classCallCheck(this, TwitterDMButton);
|
|
921
|
+
|
|
922
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterDMButton).call(this, props));
|
|
923
|
+
_this.state = {
|
|
924
|
+
isLoading: true
|
|
925
|
+
};
|
|
926
|
+
return _this;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
_createClass(TwitterDMButton, [{
|
|
930
|
+
key: "componentDidMount",
|
|
931
|
+
value: function componentDidMount() {
|
|
932
|
+
var _this2 = this;
|
|
933
|
+
|
|
934
|
+
var onLoad = this.props.onLoad;
|
|
935
|
+
|
|
936
|
+
if (exenv.canUseDOM) {
|
|
937
|
+
var script = require('scriptjs');
|
|
938
|
+
|
|
939
|
+
script(twitterWidgetJs, 'twitter-embed', function () {
|
|
940
|
+
if (!window.twttr) {
|
|
941
|
+
console.error('Failure to load window.twttr in TwitterDMButton, aborting load.');
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
if (!_this2.isMountCanceled) {
|
|
946
|
+
window.twttr.widgets.createDMButton(_this2.props.id, _this2.refs.embedContainer, _this2.props.options).then(function (element) {
|
|
947
|
+
_this2.setState({
|
|
948
|
+
isLoading: false
|
|
949
|
+
});
|
|
950
|
+
|
|
951
|
+
if (onLoad) {
|
|
952
|
+
onLoad(element);
|
|
953
|
+
}
|
|
954
|
+
});
|
|
955
|
+
}
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
}, {
|
|
960
|
+
key: "componentWillUnmount",
|
|
961
|
+
value: function componentWillUnmount() {
|
|
962
|
+
this.isMountCanceled = true;
|
|
963
|
+
}
|
|
964
|
+
}, {
|
|
965
|
+
key: "render",
|
|
966
|
+
value: function render() {
|
|
967
|
+
var isLoading = this.state.isLoading;
|
|
968
|
+
var placeholder = this.props.placeholder;
|
|
969
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
970
|
+
ref: "embedContainer"
|
|
971
|
+
}));
|
|
972
|
+
}
|
|
973
|
+
}]);
|
|
974
|
+
|
|
975
|
+
return TwitterDMButton;
|
|
976
|
+
}(Component);
|
|
977
|
+
|
|
978
|
+
_defineProperty$1(TwitterDMButton, "propTypes", {
|
|
979
|
+
/**
|
|
980
|
+
* Twitter user id for DM button
|
|
981
|
+
*/
|
|
982
|
+
id: PropTypes.number.isRequired,
|
|
983
|
+
|
|
984
|
+
/**
|
|
985
|
+
* Additional options to be added to the button
|
|
986
|
+
*/
|
|
987
|
+
options: PropTypes.object,
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* Placeholder while tweet is loading
|
|
991
|
+
*/
|
|
992
|
+
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* Function to execute after load, return html element
|
|
996
|
+
*/
|
|
997
|
+
onLoad: PropTypes.func
|
|
998
|
+
});
|
|
999
|
+
|
|
1000
|
+
var TwitterVideoEmbed =
|
|
1001
|
+
/*#__PURE__*/
|
|
1002
|
+
function (_Component) {
|
|
1003
|
+
_inherits(TwitterVideoEmbed, _Component);
|
|
1004
|
+
|
|
1005
|
+
function TwitterVideoEmbed(props) {
|
|
1006
|
+
var _this;
|
|
1007
|
+
|
|
1008
|
+
_classCallCheck(this, TwitterVideoEmbed);
|
|
1009
|
+
|
|
1010
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterVideoEmbed).call(this, props));
|
|
1011
|
+
_this.state = {
|
|
1012
|
+
isLoading: true
|
|
1013
|
+
};
|
|
1014
|
+
return _this;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
_createClass(TwitterVideoEmbed, [{
|
|
1018
|
+
key: "componentDidMount",
|
|
1019
|
+
value: function componentDidMount() {
|
|
1020
|
+
var _this2 = this;
|
|
1021
|
+
|
|
1022
|
+
var onLoad = this.props.onLoad;
|
|
1023
|
+
|
|
1024
|
+
if (exenv.canUseDOM) {
|
|
1025
|
+
var script = require('scriptjs');
|
|
1026
|
+
|
|
1027
|
+
script(twitterWidgetJs, 'twitter-embed', function () {
|
|
1028
|
+
if (!window.twttr) {
|
|
1029
|
+
console.error('Failure to load window.twttr in TwitterVideoEmbed, aborting load.');
|
|
1030
|
+
return;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
if (!_this2.isMountCanceled) {
|
|
1034
|
+
window.twttr.widgets.createVideo(_this2.props.id, _this2.refs.embedContainer).then(function (element) {
|
|
1035
|
+
_this2.setState({
|
|
1036
|
+
isLoading: false
|
|
1037
|
+
});
|
|
1038
|
+
|
|
1039
|
+
if (onLoad) {
|
|
1040
|
+
onLoad(element);
|
|
1041
|
+
}
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
}, {
|
|
1048
|
+
key: "componentWillUnmount",
|
|
1049
|
+
value: function componentWillUnmount() {
|
|
1050
|
+
this.isMountCanceled = true;
|
|
1051
|
+
}
|
|
1052
|
+
}, {
|
|
1053
|
+
key: "render",
|
|
1054
|
+
value: function render() {
|
|
1055
|
+
var isLoading = this.state.isLoading;
|
|
1056
|
+
var placeholder = this.props.placeholder;
|
|
1057
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
1058
|
+
ref: "embedContainer"
|
|
1059
|
+
}));
|
|
1060
|
+
}
|
|
1061
|
+
}]);
|
|
1062
|
+
|
|
1063
|
+
return TwitterVideoEmbed;
|
|
1064
|
+
}(Component);
|
|
1065
|
+
|
|
1066
|
+
_defineProperty$1(TwitterVideoEmbed, "propTypes", {
|
|
1067
|
+
/**
|
|
1068
|
+
* Id of video tweet.
|
|
1069
|
+
*/
|
|
1070
|
+
id: PropTypes.string.isRequired,
|
|
1071
|
+
|
|
1072
|
+
/**
|
|
1073
|
+
* Placeholder while tweet is loading
|
|
1074
|
+
*/
|
|
1075
|
+
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
1076
|
+
|
|
1077
|
+
/**
|
|
1078
|
+
* Function to execute after load, return html element
|
|
1079
|
+
*/
|
|
1080
|
+
onLoad: PropTypes.func
|
|
1081
|
+
});
|
|
1082
|
+
|
|
1083
|
+
var TwitterOnAirButton =
|
|
1084
|
+
/*#__PURE__*/
|
|
1085
|
+
function (_Component) {
|
|
1086
|
+
_inherits(TwitterOnAirButton, _Component);
|
|
1087
|
+
|
|
1088
|
+
function TwitterOnAirButton(props) {
|
|
1089
|
+
var _this;
|
|
1090
|
+
|
|
1091
|
+
_classCallCheck(this, TwitterOnAirButton);
|
|
1092
|
+
|
|
1093
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterOnAirButton).call(this, props));
|
|
1094
|
+
_this.state = {
|
|
1095
|
+
isLoading: true
|
|
1096
|
+
};
|
|
1097
|
+
return _this;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
_createClass(TwitterOnAirButton, [{
|
|
1101
|
+
key: "componentDidMount",
|
|
1102
|
+
value: function componentDidMount() {
|
|
1103
|
+
var _this2 = this;
|
|
1104
|
+
|
|
1105
|
+
var onLoad = this.props.onLoad;
|
|
1106
|
+
|
|
1107
|
+
if (exenv.canUseDOM) {
|
|
1108
|
+
var script = require('scriptjs');
|
|
1109
|
+
|
|
1110
|
+
script(twitterWidgetJs, 'twitter-embed', function () {
|
|
1111
|
+
if (!window.twttr) {
|
|
1112
|
+
console.error('Failure to load window.twttr in TwitterOnAirButton, aborting load.');
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
if (!_this2.isMountCanceled) {
|
|
1117
|
+
window.twttr.widgets.createPeriscopeOnAirButton(_this2.props.username, _this2.refs.embedContainer, _this2.props.options).then(function (element) {
|
|
1118
|
+
_this2.setState({
|
|
1119
|
+
isLoading: false
|
|
1120
|
+
});
|
|
1121
|
+
|
|
1122
|
+
if (onLoad) {
|
|
1123
|
+
onLoad(element);
|
|
1124
|
+
}
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
}, {
|
|
1131
|
+
key: "componentWillUnmount",
|
|
1132
|
+
value: function componentWillUnmount() {
|
|
1133
|
+
this.isMountCanceled = true;
|
|
1134
|
+
}
|
|
1135
|
+
}, {
|
|
1136
|
+
key: "render",
|
|
1137
|
+
value: function render() {
|
|
1138
|
+
var isLoading = this.state.isLoading;
|
|
1139
|
+
var placeholder = this.props.placeholder;
|
|
1140
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
1141
|
+
ref: "embedContainer"
|
|
1142
|
+
}));
|
|
1143
|
+
}
|
|
1144
|
+
}]);
|
|
1145
|
+
|
|
1146
|
+
return TwitterOnAirButton;
|
|
1147
|
+
}(Component);
|
|
1148
|
+
|
|
1149
|
+
_defineProperty$1(TwitterOnAirButton, "propTypes", {
|
|
1150
|
+
/**
|
|
1151
|
+
* Username for which you require periscope on air button
|
|
1152
|
+
*/
|
|
1153
|
+
username: PropTypes.string.isRequired,
|
|
1154
|
+
|
|
1155
|
+
/**
|
|
1156
|
+
* Additional options for overriding config.
|
|
1157
|
+
*/
|
|
1158
|
+
options: PropTypes.object,
|
|
1159
|
+
|
|
1160
|
+
/**
|
|
1161
|
+
* Placeholder while tweet is loading
|
|
1162
|
+
*/
|
|
1163
|
+
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* Function to execute after load, return html element
|
|
1167
|
+
*/
|
|
1168
|
+
onLoad: PropTypes.func
|
|
1169
|
+
});
|
|
1170
|
+
|
|
1171
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
1172
|
+
try {
|
|
1173
|
+
var info = gen[key](arg);
|
|
1174
|
+
var value = info.value;
|
|
1175
|
+
} catch (error) {
|
|
1176
|
+
reject(error);
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
if (info.done) {
|
|
1181
|
+
resolve(value);
|
|
1182
|
+
} else {
|
|
1183
|
+
Promise.resolve(value).then(_next, _throw);
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
function _asyncToGenerator(fn) {
|
|
1188
|
+
return function () {
|
|
1189
|
+
var self = this,
|
|
1190
|
+
args = arguments;
|
|
1191
|
+
return new Promise(function (resolve, reject) {
|
|
1192
|
+
var gen = fn.apply(self, args);
|
|
1193
|
+
|
|
1194
|
+
function _next(value) {
|
|
1195
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
function _throw(err) {
|
|
1199
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
_next(undefined);
|
|
1203
|
+
});
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
var asyncToGenerator = _asyncToGenerator;
|
|
1208
|
+
|
|
1209
|
+
function _defineProperty(obj, key, value) {
|
|
1210
|
+
if (key in obj) {
|
|
1211
|
+
Object.defineProperty(obj, key, {
|
|
1212
|
+
value: value,
|
|
1213
|
+
enumerable: true,
|
|
1214
|
+
configurable: true,
|
|
1215
|
+
writable: true
|
|
1216
|
+
});
|
|
1217
|
+
} else {
|
|
1218
|
+
obj[key] = value;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
return obj;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
var defineProperty = _defineProperty;
|
|
1225
|
+
|
|
1226
|
+
var canUseDOM = !!(
|
|
1227
|
+
typeof window !== 'undefined' &&
|
|
1228
|
+
window.document &&
|
|
1229
|
+
window.document.createElement
|
|
1230
|
+
);
|
|
1231
|
+
|
|
1232
|
+
var canUseDom = canUseDOM;
|
|
1233
|
+
|
|
1234
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1235
|
+
if (source == null) return {};
|
|
1236
|
+
var target = {};
|
|
1237
|
+
var sourceKeys = Object.keys(source);
|
|
1238
|
+
var key, i;
|
|
1239
|
+
|
|
1240
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1241
|
+
key = sourceKeys[i];
|
|
1242
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1243
|
+
target[key] = source[key];
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
return target;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
var objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose;
|
|
1250
|
+
|
|
1251
|
+
function _objectWithoutProperties(source, excluded) {
|
|
1252
|
+
if (source == null) return {};
|
|
1253
|
+
var target = objectWithoutPropertiesLoose(source, excluded);
|
|
1254
|
+
var key, i;
|
|
1255
|
+
|
|
1256
|
+
if (Object.getOwnPropertySymbols) {
|
|
1257
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1258
|
+
|
|
1259
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1260
|
+
key = sourceSymbolKeys[i];
|
|
1261
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1262
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1263
|
+
target[key] = source[key];
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
return target;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
var objectWithoutProperties = _objectWithoutProperties;
|
|
1271
|
+
|
|
1272
|
+
var LoginStatus = {
|
|
1273
|
+
CONNECTED: 'connected',
|
|
1274
|
+
AUTHORIZATION_EXPIRED: 'authorization_expired',
|
|
1275
|
+
NOT_AUTHORIZED: 'not_authorized',
|
|
1276
|
+
UNKNOWN: 'unknown'
|
|
1277
|
+
};
|
|
1278
|
+
|
|
1279
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
1280
|
+
|
|
1281
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
1282
|
+
const Method = {
|
|
1283
|
+
GET: 'get',
|
|
1284
|
+
POST: 'post',
|
|
1285
|
+
DELETE: 'delete'
|
|
1286
|
+
};
|
|
1287
|
+
class Facebook {
|
|
1288
|
+
constructor(options = {}) {
|
|
1289
|
+
this.options = _objectSpread({
|
|
1290
|
+
domain: 'connect.facebook.net',
|
|
1291
|
+
version: 'v3.2',
|
|
1292
|
+
cookie: false,
|
|
1293
|
+
status: false,
|
|
1294
|
+
xfbml: false,
|
|
1295
|
+
language: 'en_US',
|
|
1296
|
+
frictionlessRequests: false,
|
|
1297
|
+
debug: false,
|
|
1298
|
+
chatSupport: false
|
|
1299
|
+
}, options);
|
|
1300
|
+
|
|
1301
|
+
if (!this.options.appId) {
|
|
1302
|
+
throw new Error('You need to set appId');
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
if (!this.options.wait) {
|
|
1306
|
+
this.init();
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
getAppId() {
|
|
1311
|
+
return this.options.appId;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
init() {
|
|
1315
|
+
var _this = this;
|
|
1316
|
+
|
|
1317
|
+
return asyncToGenerator(function* () {
|
|
1318
|
+
if (_this.loadingPromise) {
|
|
1319
|
+
return _this.loadingPromise;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
_this.loadingPromise = new Promise(resolve => {
|
|
1323
|
+
const _this$options = _this.options,
|
|
1324
|
+
{
|
|
1325
|
+
domain,
|
|
1326
|
+
language,
|
|
1327
|
+
debug,
|
|
1328
|
+
chatSupport
|
|
1329
|
+
} = _this$options,
|
|
1330
|
+
restOptions = objectWithoutProperties(_this$options, ["domain", "language", "debug", "chatSupport"]);
|
|
1331
|
+
|
|
1332
|
+
window.fbAsyncInit = () => {
|
|
1333
|
+
window.FB.init({
|
|
1334
|
+
appId: restOptions.appId,
|
|
1335
|
+
version: restOptions.version,
|
|
1336
|
+
cookie: restOptions.cookie,
|
|
1337
|
+
status: restOptions.status,
|
|
1338
|
+
xfbml: restOptions.xfbml,
|
|
1339
|
+
frictionlessRequests: _this.frictionlessRequests
|
|
1340
|
+
});
|
|
1341
|
+
resolve(window.FB);
|
|
1342
|
+
};
|
|
1343
|
+
|
|
1344
|
+
if (window.document.getElementById('facebook-jssdk')) {
|
|
1345
|
+
return resolve(window.FB);
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
const js = window.document.createElement('script');
|
|
1349
|
+
js.id = 'facebook-jssdk';
|
|
1350
|
+
js.async = true;
|
|
1351
|
+
js.defer = true;
|
|
1352
|
+
js.src = `https://${domain}/${language}/sdk${chatSupport ? '/xfbml.customerchat' : ''}${debug ? '/debug' : ''}.js`;
|
|
1353
|
+
window.document.body.appendChild(js);
|
|
1354
|
+
});
|
|
1355
|
+
return _this.loadingPromise;
|
|
1356
|
+
})();
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
process(method, before = [], after = []) {
|
|
1360
|
+
var _this2 = this;
|
|
1361
|
+
|
|
1362
|
+
return asyncToGenerator(function* () {
|
|
1363
|
+
const fb = yield _this2.init();
|
|
1364
|
+
return new Promise((resolve, reject) => {
|
|
1365
|
+
fb[method](...before, response => {
|
|
1366
|
+
if (!response) {
|
|
1367
|
+
if (method === 'ui') return;
|
|
1368
|
+
reject(new Error('Response is undefined'));
|
|
1369
|
+
} else if (response.error) {
|
|
1370
|
+
const {
|
|
1371
|
+
code,
|
|
1372
|
+
type,
|
|
1373
|
+
message
|
|
1374
|
+
} = response.error;
|
|
1375
|
+
const error = new Error(message);
|
|
1376
|
+
error.code = code;
|
|
1377
|
+
error.type = type;
|
|
1378
|
+
reject(error);
|
|
1379
|
+
} else {
|
|
1380
|
+
resolve(response);
|
|
1381
|
+
}
|
|
1382
|
+
}, ...after);
|
|
1383
|
+
});
|
|
1384
|
+
})();
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
ui(options) {
|
|
1388
|
+
var _this3 = this;
|
|
1389
|
+
|
|
1390
|
+
return asyncToGenerator(function* () {
|
|
1391
|
+
return _this3.process('ui', [options]);
|
|
1392
|
+
})();
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
api(path, method = Method.GET, params = {}) {
|
|
1396
|
+
var _this4 = this;
|
|
1397
|
+
|
|
1398
|
+
return asyncToGenerator(function* () {
|
|
1399
|
+
return _this4.process('api', [path, method, params]);
|
|
1400
|
+
})();
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
login(opts = null) {
|
|
1404
|
+
var _this5 = this;
|
|
1405
|
+
|
|
1406
|
+
return asyncToGenerator(function* () {
|
|
1407
|
+
return _this5.process('login', [], [opts]);
|
|
1408
|
+
})();
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
logout() {
|
|
1412
|
+
var _this6 = this;
|
|
1413
|
+
|
|
1414
|
+
return asyncToGenerator(function* () {
|
|
1415
|
+
return _this6.process('logout');
|
|
1416
|
+
})();
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
getLoginStatus() {
|
|
1420
|
+
var _this7 = this;
|
|
1421
|
+
|
|
1422
|
+
return asyncToGenerator(function* () {
|
|
1423
|
+
return _this7.process('getLoginStatus');
|
|
1424
|
+
})();
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
getAuthResponse() {
|
|
1428
|
+
var _this8 = this;
|
|
1429
|
+
|
|
1430
|
+
return asyncToGenerator(function* () {
|
|
1431
|
+
return _this8.process('getAuthResponse');
|
|
1432
|
+
})();
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
getTokenDetail(loginResponse) {
|
|
1436
|
+
var _this9 = this;
|
|
1437
|
+
|
|
1438
|
+
return asyncToGenerator(function* () {
|
|
1439
|
+
if (loginResponse.status === LoginStatus.CONNECTED && loginResponse.authResponse) {
|
|
1440
|
+
return loginResponse.authResponse;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
const response = yield _this9.getLoginStatus();
|
|
1444
|
+
|
|
1445
|
+
if (response.status === LoginStatus.CONNECTED && response.authResponse) {
|
|
1446
|
+
return response.authResponse;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
throw new Error('Token is undefined');
|
|
1450
|
+
})();
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
getProfile(params) {
|
|
1454
|
+
var _this10 = this;
|
|
1455
|
+
|
|
1456
|
+
return asyncToGenerator(function* () {
|
|
1457
|
+
return _this10.api('/me', Method.GET, params);
|
|
1458
|
+
})();
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
getTokenDetailWithProfile(params, response) {
|
|
1462
|
+
var _this11 = this;
|
|
1463
|
+
|
|
1464
|
+
return asyncToGenerator(function* () {
|
|
1465
|
+
const tokenDetail = yield _this11.getTokenDetail(response);
|
|
1466
|
+
const profile = yield _this11.getProfile(params);
|
|
1467
|
+
return {
|
|
1468
|
+
profile,
|
|
1469
|
+
tokenDetail
|
|
1470
|
+
};
|
|
1471
|
+
})();
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
getToken() {
|
|
1475
|
+
var _this12 = this;
|
|
1476
|
+
|
|
1477
|
+
return asyncToGenerator(function* () {
|
|
1478
|
+
const authResponse = yield _this12.getTokenDetail();
|
|
1479
|
+
return authResponse.accessToken;
|
|
1480
|
+
})();
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
getUserId() {
|
|
1484
|
+
var _this13 = this;
|
|
1485
|
+
|
|
1486
|
+
return asyncToGenerator(function* () {
|
|
1487
|
+
const authResponse = yield _this13.getTokenDetail();
|
|
1488
|
+
return authResponse.userID;
|
|
1489
|
+
})();
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
sendInvite(to, options) {
|
|
1493
|
+
var _this14 = this;
|
|
1494
|
+
|
|
1495
|
+
return asyncToGenerator(function* () {
|
|
1496
|
+
return _this14.ui(_objectSpread({
|
|
1497
|
+
to,
|
|
1498
|
+
method: 'apprequests'
|
|
1499
|
+
}, options));
|
|
1500
|
+
})();
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
postAction(ogNamespace, ogAction, ogObject, ogObjectUrl, noFeedStory) {
|
|
1504
|
+
var _this15 = this;
|
|
1505
|
+
|
|
1506
|
+
return asyncToGenerator(function* () {
|
|
1507
|
+
let url = `/me/${ogNamespace}:${ogAction}?${ogObject}=${encodeURIComponent(ogObjectUrl)}`;
|
|
1508
|
+
|
|
1509
|
+
if (noFeedStory === true) {
|
|
1510
|
+
url += '&no_feed_story=true';
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
return _this15.api(url, Method.POST);
|
|
1514
|
+
})();
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
getPermissions() {
|
|
1518
|
+
var _this16 = this;
|
|
1519
|
+
|
|
1520
|
+
return asyncToGenerator(function* () {
|
|
1521
|
+
const response = yield _this16.api('/me/permissions');
|
|
1522
|
+
return response.data;
|
|
1523
|
+
})();
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
hasPermissions(permissions) {
|
|
1527
|
+
var _this17 = this;
|
|
1528
|
+
|
|
1529
|
+
return asyncToGenerator(function* () {
|
|
1530
|
+
const usersPermissions = yield _this17.getPermissions();
|
|
1531
|
+
const findedPermissions = permissions.filter(p => {
|
|
1532
|
+
const currentPermission = usersPermissions.find(row => {
|
|
1533
|
+
const {
|
|
1534
|
+
permission,
|
|
1535
|
+
status
|
|
1536
|
+
} = row;
|
|
1537
|
+
return status === 'granted' && permission === p;
|
|
1538
|
+
});
|
|
1539
|
+
return !!currentPermission;
|
|
1540
|
+
});
|
|
1541
|
+
return findedPermissions.length === permissions.length;
|
|
1542
|
+
})();
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
subscribe(eventName, callback) {
|
|
1546
|
+
var _this18 = this;
|
|
1547
|
+
|
|
1548
|
+
return asyncToGenerator(function* () {
|
|
1549
|
+
const fb = yield _this18.init();
|
|
1550
|
+
fb.Event.subscribe(eventName, callback);
|
|
1551
|
+
})();
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
unsubscribe(eventName, callback) {
|
|
1555
|
+
var _this19 = this;
|
|
1556
|
+
|
|
1557
|
+
return asyncToGenerator(function* () {
|
|
1558
|
+
const fb = yield _this19.init();
|
|
1559
|
+
fb.Event.unsubscribe(eventName, callback);
|
|
1560
|
+
})();
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
parse(parentNode) {
|
|
1564
|
+
var _this20 = this;
|
|
1565
|
+
|
|
1566
|
+
return asyncToGenerator(function* () {
|
|
1567
|
+
const fb = yield _this20.init();
|
|
1568
|
+
|
|
1569
|
+
if (typeof parentNode === 'undefined') {
|
|
1570
|
+
fb.XFBML.parse();
|
|
1571
|
+
} else {
|
|
1572
|
+
fb.XFBML.parse(parentNode);
|
|
1573
|
+
}
|
|
1574
|
+
})();
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
getRequests() {
|
|
1578
|
+
var _this21 = this;
|
|
1579
|
+
|
|
1580
|
+
return asyncToGenerator(function* () {
|
|
1581
|
+
return _this21.api('/me/apprequests');
|
|
1582
|
+
})();
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
removeRequest(requestID) {
|
|
1586
|
+
var _this22 = this;
|
|
1587
|
+
|
|
1588
|
+
return asyncToGenerator(function* () {
|
|
1589
|
+
return _this22.api(requestID, Method.DELETE);
|
|
1590
|
+
})();
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
setAutoGrow() {
|
|
1594
|
+
var _this23 = this;
|
|
1595
|
+
|
|
1596
|
+
return asyncToGenerator(function* () {
|
|
1597
|
+
const fb = yield _this23.init();
|
|
1598
|
+
fb.Canvas.setAutoGrow();
|
|
1599
|
+
})();
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
paySimple(product, quantity = 1) {
|
|
1603
|
+
var _this24 = this;
|
|
1604
|
+
|
|
1605
|
+
return asyncToGenerator(function* () {
|
|
1606
|
+
return _this24.ui({
|
|
1607
|
+
method: 'pay',
|
|
1608
|
+
action: 'purchaseitem',
|
|
1609
|
+
product,
|
|
1610
|
+
quantity
|
|
1611
|
+
});
|
|
1612
|
+
})();
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
pay(product, options) {
|
|
1616
|
+
var _this25 = this;
|
|
1617
|
+
|
|
1618
|
+
return asyncToGenerator(function* () {
|
|
1619
|
+
return _this25.ui(_objectSpread({
|
|
1620
|
+
method: 'pay',
|
|
1621
|
+
action: 'purchaseitem',
|
|
1622
|
+
product
|
|
1623
|
+
}, options));
|
|
1624
|
+
})();
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
}
|
|
1628
|
+
/*
|
|
1629
|
+
sendToFriends: function(options, callback) {
|
|
1630
|
+
if(!options) {
|
|
1631
|
+
options = {};
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
options.method = 'send';
|
|
1635
|
+
|
|
1636
|
+
this.afterLoad(function(err, fbApi) {
|
|
1637
|
+
if(err) {
|
|
1638
|
+
return callback(err);
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
FB.ui(options, function(response) {
|
|
1642
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1643
|
+
});
|
|
1644
|
+
});
|
|
1645
|
+
},
|
|
1646
|
+
|
|
1647
|
+
sendMessage: function(message, name, caption, description, url, imgUrl, callback) {
|
|
1648
|
+
this.afterLoad(function(err, fbApi) {
|
|
1649
|
+
if(err) {
|
|
1650
|
+
return callback(err);
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
FB.ui({
|
|
1654
|
+
method: 'stream.publish',
|
|
1655
|
+
message: message,
|
|
1656
|
+
attachment: {
|
|
1657
|
+
name: name,
|
|
1658
|
+
caption: caption,
|
|
1659
|
+
description: description,
|
|
1660
|
+
href: url,
|
|
1661
|
+
media:[{
|
|
1662
|
+
type: 'image',
|
|
1663
|
+
src: imgUrl,
|
|
1664
|
+
href: url
|
|
1665
|
+
}]
|
|
1666
|
+
},
|
|
1667
|
+
action_links: [{
|
|
1668
|
+
text: 'Code',
|
|
1669
|
+
href: url
|
|
1670
|
+
}],
|
|
1671
|
+
user_prompt_message: message
|
|
1672
|
+
},
|
|
1673
|
+
function(response) {
|
|
1674
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1675
|
+
});
|
|
1676
|
+
});
|
|
1677
|
+
},
|
|
1678
|
+
|
|
1679
|
+
sendInviteForm: function(options, callback) {
|
|
1680
|
+
if(typeof options === 'function') {
|
|
1681
|
+
callback = options;
|
|
1682
|
+
options = {};
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
this.afterLoad(function(err, fbApi) {
|
|
1686
|
+
if(err) {
|
|
1687
|
+
return callback(err);
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
options.method = options.method || 'apprequests';
|
|
1691
|
+
|
|
1692
|
+
|
|
1693
|
+
FB.ui(options, function(response) {
|
|
1694
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1695
|
+
});
|
|
1696
|
+
});
|
|
1697
|
+
},
|
|
1698
|
+
|
|
1699
|
+
checkPageLike: function(pageID, callback) {
|
|
1700
|
+
this.afterLoad(function(err, fbApi) {
|
|
1701
|
+
if(err) {
|
|
1702
|
+
return callback(err);
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
fbApi.getUserID(function(err, userID) {
|
|
1706
|
+
if(err) {
|
|
1707
|
+
return callback(err);
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
var fqlQuery = `SELECT uid FROM page_fan WHERE page_id = ${pageID} and uid = ${userID}`;
|
|
1711
|
+
var query = FB.Data.query(fqlQuery);
|
|
1712
|
+
|
|
1713
|
+
query.wait(function(rows) {
|
|
1714
|
+
if (rows.length === 1 && rows[0].uid === userID) {
|
|
1715
|
+
callback(null, true, query);
|
|
1716
|
+
}
|
|
1717
|
+
else {
|
|
1718
|
+
callback(null, false, query);
|
|
1719
|
+
}
|
|
1720
|
+
});
|
|
1721
|
+
});
|
|
1722
|
+
});
|
|
1723
|
+
},
|
|
1724
|
+
|
|
1725
|
+
sendMessageToFriend: function (friendID, link, callback) {
|
|
1726
|
+
this.afterLoad(function(err, fbApi) {
|
|
1727
|
+
if(err) {
|
|
1728
|
+
return callback(err);
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
FB.ui({
|
|
1732
|
+
to: friendID,
|
|
1733
|
+
method: 'send',
|
|
1734
|
+
link: link
|
|
1735
|
+
}, function(response) {
|
|
1736
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1737
|
+
});
|
|
1738
|
+
});
|
|
1739
|
+
},
|
|
1740
|
+
|
|
1741
|
+
_prepareUsers: function(data) {
|
|
1742
|
+
var users=[];
|
|
1743
|
+
|
|
1744
|
+
for(var index in data) {
|
|
1745
|
+
var userData=data[index];
|
|
1746
|
+
|
|
1747
|
+
var user = {
|
|
1748
|
+
provider_uid: 'facebook'+'_'+userData.uid,
|
|
1749
|
+
provider: 'facebook',
|
|
1750
|
+
id: userData.uid,
|
|
1751
|
+
name: userData.name,
|
|
1752
|
+
first_name: userData.first_name,
|
|
1753
|
+
last_name: userData.last_name,
|
|
1754
|
+
status: (userData.status!==null) ? userData.status : null,
|
|
1755
|
+
image: '//graph.facebook.com/'+userData.uid+'/picture?'
|
|
1756
|
+
};
|
|
1757
|
+
|
|
1758
|
+
users.push(user);
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
return users;
|
|
1762
|
+
},
|
|
1763
|
+
|
|
1764
|
+
getUserList: function(callback) {
|
|
1765
|
+
this.afterLoad(function(err, fbApi) {
|
|
1766
|
+
if(err) {
|
|
1767
|
+
return callback(err);
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
FB.api('fql', {
|
|
1771
|
+
q: `
|
|
1772
|
+
SELECT uid, name, first_name, last_name, online_presence, status
|
|
1773
|
+
FROM user
|
|
1774
|
+
WHERE uid IN
|
|
1775
|
+
( SELECT uid2 FROM friend WHERE uid1 = me()) ORDER BY name
|
|
1776
|
+
`,
|
|
1777
|
+
}, function (response)
|
|
1778
|
+
{
|
|
1779
|
+
var users = fbApi._prepareUsers(response.data);
|
|
1780
|
+
callback(null, users, response);
|
|
1781
|
+
});
|
|
1782
|
+
});
|
|
1783
|
+
},
|
|
1784
|
+
|
|
1785
|
+
postFeed: function(options, callback) {
|
|
1786
|
+
this.afterLoad(function(err, fbApi) {
|
|
1787
|
+
if(err) {
|
|
1788
|
+
return callback(err);
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
options.method='feed';
|
|
1792
|
+
|
|
1793
|
+
FB.ui(options, function(response) {
|
|
1794
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1795
|
+
});
|
|
1796
|
+
});
|
|
1797
|
+
},
|
|
1798
|
+
|
|
1799
|
+
//need publish_stream
|
|
1800
|
+
createAlbum: function(name, description, callback) {
|
|
1801
|
+
this.afterLoad(function(err, fbApi) {
|
|
1802
|
+
if(err) {
|
|
1803
|
+
return callback(err);
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
FB.api('/me/albums', 'post', {
|
|
1807
|
+
name: name,
|
|
1808
|
+
description: description
|
|
1809
|
+
},function(response) {
|
|
1810
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1811
|
+
});
|
|
1812
|
+
});
|
|
1813
|
+
},
|
|
1814
|
+
|
|
1815
|
+
//need publish_stream
|
|
1816
|
+
addImageToAlbum: function(albumID, imageURL, message, callback) {
|
|
1817
|
+
this.afterLoad(function(err, fbApi) {
|
|
1818
|
+
if(err) {
|
|
1819
|
+
return callback(err);
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
FB.api('/'+albumID+'/photos', 'post', {
|
|
1823
|
+
message: message,
|
|
1824
|
+
url: imageURL
|
|
1825
|
+
}, function(response) {
|
|
1826
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1827
|
+
});
|
|
1828
|
+
});
|
|
1829
|
+
},
|
|
1830
|
+
|
|
1831
|
+
//'user_photos'
|
|
1832
|
+
getAlbums: function(callback) {
|
|
1833
|
+
this.afterLoad(function(err, fbApi) {
|
|
1834
|
+
if(err) {
|
|
1835
|
+
return callback(err);
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
FB.api('/me/albums', function(response) {
|
|
1839
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1840
|
+
});
|
|
1841
|
+
});
|
|
1842
|
+
},
|
|
1843
|
+
|
|
1844
|
+
//'user_photos'
|
|
1845
|
+
getAlbumPhotos: function(albumID, callback) {
|
|
1846
|
+
this.afterLoad(function(err, fbApi) {
|
|
1847
|
+
if(err) {
|
|
1848
|
+
return callback(err);
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
FB.api('/'+albumID+'/photos', function(response) {
|
|
1852
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1853
|
+
});
|
|
1854
|
+
});
|
|
1855
|
+
},
|
|
1856
|
+
|
|
1857
|
+
//'user_photos'
|
|
1858
|
+
getAlbumCoverPicture: function(albumID, callback) {
|
|
1859
|
+
this.afterLoad(function(err, fbApi) {
|
|
1860
|
+
if(err) {
|
|
1861
|
+
return callback(err);
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
FB.api('/'+albumID+'/picture', function(response) {
|
|
1865
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1866
|
+
});
|
|
1867
|
+
});
|
|
1868
|
+
},
|
|
1869
|
+
|
|
1870
|
+
//'publish_stream'
|
|
1871
|
+
postPhoto: function(photoUrl, message, callback) {
|
|
1872
|
+
this.afterLoad(function(err, fbApi) {
|
|
1873
|
+
if(err) {
|
|
1874
|
+
return callback(err);
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
FB.api('/me/photos', 'post', {
|
|
1878
|
+
message: message,
|
|
1879
|
+
url: photoUrl
|
|
1880
|
+
},function(response) {
|
|
1881
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1882
|
+
});
|
|
1883
|
+
});
|
|
1884
|
+
},
|
|
1885
|
+
|
|
1886
|
+
getPageInfo: function(callback) {
|
|
1887
|
+
this.afterLoad(function(err, fbApi) {
|
|
1888
|
+
if(err) {
|
|
1889
|
+
return callback(err);
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
FB.Canvas.getPageInfo(function(response) {
|
|
1893
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1894
|
+
});
|
|
1895
|
+
});
|
|
1896
|
+
}
|
|
1897
|
+
*/
|
|
1898
|
+
|
|
1899
|
+
var FacebookContext = createContext();
|
|
1900
|
+
|
|
1901
|
+
let api = null;
|
|
1902
|
+
class Facebook$1 extends Component {
|
|
1903
|
+
constructor(...args) {
|
|
1904
|
+
var _this;
|
|
1905
|
+
|
|
1906
|
+
super(...args);
|
|
1907
|
+
_this = this;
|
|
1908
|
+
|
|
1909
|
+
defineProperty(this, "state", {
|
|
1910
|
+
isReady: false
|
|
1911
|
+
});
|
|
1912
|
+
|
|
1913
|
+
defineProperty(this, "handleInit",
|
|
1914
|
+
/*#__PURE__*/
|
|
1915
|
+
asyncToGenerator(function* () {
|
|
1916
|
+
// do not run if SSR
|
|
1917
|
+
if (!canUseDom) {
|
|
1918
|
+
throw new Error('You can not use Facebook without DOM');
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
const {
|
|
1922
|
+
isReady
|
|
1923
|
+
} = _this.state;
|
|
1924
|
+
|
|
1925
|
+
if (isReady) {
|
|
1926
|
+
return api;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
if (!api) {
|
|
1930
|
+
const {
|
|
1931
|
+
domain,
|
|
1932
|
+
version,
|
|
1933
|
+
appId,
|
|
1934
|
+
cookie,
|
|
1935
|
+
status,
|
|
1936
|
+
xfbml,
|
|
1937
|
+
language,
|
|
1938
|
+
frictionlessRequests,
|
|
1939
|
+
wait,
|
|
1940
|
+
debug,
|
|
1941
|
+
chatSupport
|
|
1942
|
+
} = _this.props;
|
|
1943
|
+
api = new Facebook({
|
|
1944
|
+
domain,
|
|
1945
|
+
appId,
|
|
1946
|
+
version,
|
|
1947
|
+
cookie,
|
|
1948
|
+
status,
|
|
1949
|
+
xfbml,
|
|
1950
|
+
language,
|
|
1951
|
+
frictionlessRequests,
|
|
1952
|
+
wait,
|
|
1953
|
+
debug,
|
|
1954
|
+
chatSupport
|
|
1955
|
+
});
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
yield api.init();
|
|
1959
|
+
|
|
1960
|
+
if (!_this.state.isReady) {
|
|
1961
|
+
_this.setState({
|
|
1962
|
+
isReady: true
|
|
1963
|
+
});
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
return api;
|
|
1967
|
+
}));
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
componentDidMount() {
|
|
1971
|
+
const {
|
|
1972
|
+
wait
|
|
1973
|
+
} = this.props;
|
|
1974
|
+
|
|
1975
|
+
if (!wait) {
|
|
1976
|
+
this.handleInit();
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
render() {
|
|
1981
|
+
const {
|
|
1982
|
+
children
|
|
1983
|
+
} = this.props;
|
|
1984
|
+
const {
|
|
1985
|
+
isReady,
|
|
1986
|
+
error
|
|
1987
|
+
} = this.state;
|
|
1988
|
+
const {
|
|
1989
|
+
handleInit
|
|
1990
|
+
} = this;
|
|
1991
|
+
const value = {
|
|
1992
|
+
isReady,
|
|
1993
|
+
error,
|
|
1994
|
+
handleInit,
|
|
1995
|
+
api
|
|
1996
|
+
};
|
|
1997
|
+
return React__default.createElement(FacebookContext.Provider, {
|
|
1998
|
+
value: value
|
|
1999
|
+
}, children);
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
defineProperty(Facebook$1, "defaultProps", {
|
|
2005
|
+
version: 'v3.1',
|
|
2006
|
+
cookie: false,
|
|
2007
|
+
status: false,
|
|
2008
|
+
xfbml: false,
|
|
2009
|
+
language: 'en_US',
|
|
2010
|
+
frictionlessRequests: false,
|
|
2011
|
+
domain: 'connect.facebook.net',
|
|
2012
|
+
children: undefined,
|
|
2013
|
+
wait: false,
|
|
2014
|
+
debug: false,
|
|
2015
|
+
chatSupport: false
|
|
2016
|
+
});
|
|
2017
|
+
|
|
2018
|
+
var _extends_1 = createCommonjsModule(function (module) {
|
|
2019
|
+
function _extends() {
|
|
2020
|
+
module.exports = _extends = Object.assign || function (target) {
|
|
2021
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2022
|
+
var source = arguments[i];
|
|
2023
|
+
|
|
2024
|
+
for (var key in source) {
|
|
2025
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2026
|
+
target[key] = source[key];
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
return target;
|
|
2032
|
+
};
|
|
2033
|
+
|
|
2034
|
+
return _extends.apply(this, arguments);
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
module.exports = _extends;
|
|
2038
|
+
});
|
|
2039
|
+
|
|
2040
|
+
class Initialize extends Component {
|
|
2041
|
+
componentDidMount() {
|
|
2042
|
+
this.$isMounted = true;
|
|
2043
|
+
this.prepare();
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
componentWillUnmount() {
|
|
2047
|
+
this.$isMounted = false;
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
prepare() {
|
|
2051
|
+
var _this = this;
|
|
2052
|
+
|
|
2053
|
+
return asyncToGenerator(function* () {
|
|
2054
|
+
const {
|
|
2055
|
+
onReady,
|
|
2056
|
+
handleInit
|
|
2057
|
+
} = _this.props;
|
|
2058
|
+
const api = yield handleInit();
|
|
2059
|
+
|
|
2060
|
+
if (onReady && _this.$isMounted) {
|
|
2061
|
+
onReady(api);
|
|
2062
|
+
}
|
|
2063
|
+
})();
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
render() {
|
|
2067
|
+
const {
|
|
2068
|
+
children,
|
|
2069
|
+
isReady,
|
|
2070
|
+
api
|
|
2071
|
+
} = this.props;
|
|
2072
|
+
const childrenProps = {
|
|
2073
|
+
isReady,
|
|
2074
|
+
api
|
|
2075
|
+
};
|
|
2076
|
+
|
|
2077
|
+
if (typeof children === 'function') {
|
|
2078
|
+
return children(childrenProps);
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
return children;
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
defineProperty(Initialize, "defaultProps", {
|
|
2087
|
+
onReady: undefined,
|
|
2088
|
+
api: undefined
|
|
2089
|
+
});
|
|
2090
|
+
|
|
2091
|
+
var Initialize$1 = forwardRef((props, ref) => React__default.createElement(FacebookContext.Consumer, null, ({
|
|
2092
|
+
handleInit,
|
|
2093
|
+
isReady,
|
|
2094
|
+
api
|
|
2095
|
+
}) => React__default.createElement(Initialize, _extends_1({}, props, {
|
|
2096
|
+
handleInit: handleInit,
|
|
2097
|
+
isReady: isReady,
|
|
2098
|
+
api: api,
|
|
2099
|
+
ref: ref
|
|
2100
|
+
}))));
|
|
2101
|
+
|
|
2102
|
+
class Parser extends Component {
|
|
2103
|
+
constructor(...args) {
|
|
2104
|
+
super(...args);
|
|
2105
|
+
|
|
2106
|
+
defineProperty(this, "state", {});
|
|
2107
|
+
|
|
2108
|
+
defineProperty(this, "handleReady", api => {
|
|
2109
|
+
this.setState({
|
|
2110
|
+
api
|
|
2111
|
+
}, this.handleParse);
|
|
2112
|
+
});
|
|
2113
|
+
|
|
2114
|
+
defineProperty(this, "handleContainer", container => {
|
|
2115
|
+
this.setState({
|
|
2116
|
+
container
|
|
2117
|
+
}, this.handleParse);
|
|
2118
|
+
});
|
|
2119
|
+
|
|
2120
|
+
defineProperty(this, "handleParse", () => {
|
|
2121
|
+
const {
|
|
2122
|
+
api,
|
|
2123
|
+
container
|
|
2124
|
+
} = this.state;
|
|
2125
|
+
|
|
2126
|
+
if (!api || !container) {
|
|
2127
|
+
return;
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2130
|
+
api.parse(container);
|
|
2131
|
+
});
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
render() {
|
|
2135
|
+
const {
|
|
2136
|
+
className,
|
|
2137
|
+
children
|
|
2138
|
+
} = this.props;
|
|
2139
|
+
return React__default.createElement("div", {
|
|
2140
|
+
className: className,
|
|
2141
|
+
ref: this.handleContainer
|
|
2142
|
+
}, React__default.createElement(Initialize$1, {
|
|
2143
|
+
onReady: this.handleReady
|
|
2144
|
+
}, children({
|
|
2145
|
+
handleParse: this.handleParse
|
|
2146
|
+
})));
|
|
2147
|
+
}
|
|
2148
|
+
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
defineProperty(Parser, "defaultProps", {
|
|
2152
|
+
className: undefined
|
|
2153
|
+
});
|
|
2154
|
+
|
|
2155
|
+
function getCurrentHref() {
|
|
2156
|
+
if (!canUseDom) {
|
|
2157
|
+
return 'https://www.facebook.com';
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
return window.location.href;
|
|
2161
|
+
}
|
|
2162
|
+
|
|
2163
|
+
class Like extends PureComponent {
|
|
2164
|
+
componentDidUpdate() {
|
|
2165
|
+
const {
|
|
2166
|
+
handleParse
|
|
2167
|
+
} = this.props;
|
|
2168
|
+
handleParse();
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
render() {
|
|
2172
|
+
const {
|
|
2173
|
+
href = getCurrentHref(),
|
|
2174
|
+
layout,
|
|
2175
|
+
colorScheme,
|
|
2176
|
+
action,
|
|
2177
|
+
showFaces,
|
|
2178
|
+
share,
|
|
2179
|
+
children,
|
|
2180
|
+
width,
|
|
2181
|
+
size,
|
|
2182
|
+
kidDirectedSite,
|
|
2183
|
+
referral
|
|
2184
|
+
} = this.props;
|
|
2185
|
+
return React__default.createElement("div", {
|
|
2186
|
+
className: "fb-like",
|
|
2187
|
+
"data-ref": referral,
|
|
2188
|
+
"data-href": href,
|
|
2189
|
+
"data-layout": layout,
|
|
2190
|
+
"data-colorscheme": colorScheme,
|
|
2191
|
+
"data-action": action,
|
|
2192
|
+
"data-show-faces": showFaces,
|
|
2193
|
+
"data-share": share,
|
|
2194
|
+
"data-width": width,
|
|
2195
|
+
"data-size": size,
|
|
2196
|
+
"data-kid-directed-site": kidDirectedSite
|
|
2197
|
+
}, children);
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
defineProperty(Like, "defaultProps", {
|
|
2203
|
+
layout: undefined,
|
|
2204
|
+
showFaces: undefined,
|
|
2205
|
+
colorScheme: undefined,
|
|
2206
|
+
action: undefined,
|
|
2207
|
+
share: undefined,
|
|
2208
|
+
size: undefined,
|
|
2209
|
+
kidDirectedSite: undefined,
|
|
2210
|
+
children: undefined,
|
|
2211
|
+
href: undefined,
|
|
2212
|
+
referral: undefined,
|
|
2213
|
+
width: undefined
|
|
2214
|
+
});
|
|
2215
|
+
|
|
2216
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
2217
|
+
handleParse
|
|
2218
|
+
}) => React__default.createElement(Like, _extends_1({}, props, {
|
|
2219
|
+
handleParse: handleParse,
|
|
2220
|
+
ref: ref
|
|
2221
|
+
}))));
|
|
2222
|
+
|
|
2223
|
+
function clearUndefinedProperties(obj) {
|
|
2224
|
+
if (!obj) {
|
|
2225
|
+
return obj;
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
const newObj = {};
|
|
2229
|
+
Object.keys(obj).forEach(propertyName => {
|
|
2230
|
+
const value = obj[propertyName];
|
|
2231
|
+
|
|
2232
|
+
if (value !== undefined) {
|
|
2233
|
+
newObj[propertyName] = value;
|
|
2234
|
+
}
|
|
2235
|
+
});
|
|
2236
|
+
return newObj;
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
class Process extends Component {
|
|
2240
|
+
constructor(...args) {
|
|
2241
|
+
var _this;
|
|
2242
|
+
|
|
2243
|
+
super(...args);
|
|
2244
|
+
_this = this;
|
|
2245
|
+
|
|
2246
|
+
defineProperty(this, "state", {
|
|
2247
|
+
api: undefined
|
|
2248
|
+
});
|
|
2249
|
+
|
|
2250
|
+
defineProperty(this, "handleProcess",
|
|
2251
|
+
/*#__PURE__*/
|
|
2252
|
+
function () {
|
|
2253
|
+
var _ref = asyncToGenerator(function* (fn, handleSuccess = () => {}) {
|
|
2254
|
+
_this.setState({
|
|
2255
|
+
data: undefined,
|
|
2256
|
+
error: undefined,
|
|
2257
|
+
loading: true
|
|
2258
|
+
});
|
|
2259
|
+
|
|
2260
|
+
try {
|
|
2261
|
+
const {
|
|
2262
|
+
api
|
|
2263
|
+
} = _this.state;
|
|
2264
|
+
|
|
2265
|
+
if (!api) {
|
|
2266
|
+
throw new Error('Facebook is not initialized. Wait for isReady');
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
const data = yield fn(api);
|
|
2270
|
+
|
|
2271
|
+
_this.setState({
|
|
2272
|
+
data,
|
|
2273
|
+
loading: false
|
|
2274
|
+
}, handleSuccess);
|
|
2275
|
+
|
|
2276
|
+
return data;
|
|
2277
|
+
} catch (error) {
|
|
2278
|
+
_this.setState({
|
|
2279
|
+
error,
|
|
2280
|
+
loading: false
|
|
2281
|
+
});
|
|
2282
|
+
|
|
2283
|
+
throw error;
|
|
2284
|
+
}
|
|
2285
|
+
});
|
|
2286
|
+
|
|
2287
|
+
return function (_x) {
|
|
2288
|
+
return _ref.apply(this, arguments);
|
|
2289
|
+
};
|
|
2290
|
+
}());
|
|
2291
|
+
|
|
2292
|
+
defineProperty(this, "handleReady", api => {
|
|
2293
|
+
this.setState({
|
|
2294
|
+
api
|
|
2295
|
+
});
|
|
2296
|
+
});
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
render() {
|
|
2300
|
+
const {
|
|
2301
|
+
children
|
|
2302
|
+
} = this.props;
|
|
2303
|
+
const {
|
|
2304
|
+
api,
|
|
2305
|
+
loading,
|
|
2306
|
+
data,
|
|
2307
|
+
error
|
|
2308
|
+
} = this.state;
|
|
2309
|
+
return React__default.createElement(Initialize$1, {
|
|
2310
|
+
onReady: this.handleReady
|
|
2311
|
+
}, children({
|
|
2312
|
+
loading: !api || loading,
|
|
2313
|
+
handleProcess: this.handleProcess,
|
|
2314
|
+
data,
|
|
2315
|
+
error
|
|
2316
|
+
}));
|
|
2317
|
+
}
|
|
2318
|
+
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
class Send extends Component {
|
|
2322
|
+
constructor(...args) {
|
|
2323
|
+
var _this;
|
|
2324
|
+
|
|
2325
|
+
super(...args);
|
|
2326
|
+
_this = this;
|
|
2327
|
+
|
|
2328
|
+
defineProperty(this, "handleClick",
|
|
2329
|
+
/*#__PURE__*/
|
|
2330
|
+
function () {
|
|
2331
|
+
var _ref = asyncToGenerator(function* (evn) {
|
|
2332
|
+
evn.preventDefault();
|
|
2333
|
+
const {
|
|
2334
|
+
handleProcess
|
|
2335
|
+
} = _this.props;
|
|
2336
|
+
return handleProcess(
|
|
2337
|
+
/*#__PURE__*/
|
|
2338
|
+
function () {
|
|
2339
|
+
var _ref2 = asyncToGenerator(function* (api) {
|
|
2340
|
+
const {
|
|
2341
|
+
link = getCurrentHref(),
|
|
2342
|
+
display,
|
|
2343
|
+
appId = api.getAppId(),
|
|
2344
|
+
to,
|
|
2345
|
+
redirectURI
|
|
2346
|
+
} = _this.props;
|
|
2347
|
+
return api.ui(clearUndefinedProperties({
|
|
2348
|
+
method: 'send',
|
|
2349
|
+
link,
|
|
2350
|
+
display,
|
|
2351
|
+
app_id: appId,
|
|
2352
|
+
to,
|
|
2353
|
+
redirect_uri: redirectURI
|
|
2354
|
+
}));
|
|
2355
|
+
});
|
|
2356
|
+
|
|
2357
|
+
return function (_x2) {
|
|
2358
|
+
return _ref2.apply(this, arguments);
|
|
2359
|
+
};
|
|
2360
|
+
}());
|
|
2361
|
+
});
|
|
2362
|
+
|
|
2363
|
+
return function (_x) {
|
|
2364
|
+
return _ref.apply(this, arguments);
|
|
2365
|
+
};
|
|
2366
|
+
}());
|
|
2367
|
+
}
|
|
2368
|
+
|
|
2369
|
+
render() {
|
|
2370
|
+
const {
|
|
2371
|
+
children,
|
|
2372
|
+
loading
|
|
2373
|
+
} = this.props;
|
|
2374
|
+
return children({
|
|
2375
|
+
loading,
|
|
2376
|
+
handleClick: this.handleClick
|
|
2377
|
+
});
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2382
|
+
defineProperty(Send, "defaultProps", {
|
|
2383
|
+
to: undefined,
|
|
2384
|
+
display: undefined,
|
|
2385
|
+
appId: undefined,
|
|
2386
|
+
redirectURI: undefined
|
|
2387
|
+
});
|
|
2388
|
+
|
|
2389
|
+
forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
2390
|
+
loading,
|
|
2391
|
+
handleProcess
|
|
2392
|
+
}) => React__default.createElement(Send, _extends_1({}, props, {
|
|
2393
|
+
loading: loading,
|
|
2394
|
+
handleProcess: handleProcess,
|
|
2395
|
+
ref: ref
|
|
2396
|
+
}))));
|
|
2397
|
+
|
|
2398
|
+
class Share extends Component {
|
|
2399
|
+
constructor(...args) {
|
|
2400
|
+
var _this;
|
|
2401
|
+
|
|
2402
|
+
super(...args);
|
|
2403
|
+
_this = this;
|
|
2404
|
+
|
|
2405
|
+
defineProperty(this, "handleClick",
|
|
2406
|
+
/*#__PURE__*/
|
|
2407
|
+
function () {
|
|
2408
|
+
var _ref = asyncToGenerator(function* (evn) {
|
|
2409
|
+
evn.preventDefault();
|
|
2410
|
+
const {
|
|
2411
|
+
handleProcess
|
|
2412
|
+
} = _this.props;
|
|
2413
|
+
return handleProcess(
|
|
2414
|
+
/*#__PURE__*/
|
|
2415
|
+
function () {
|
|
2416
|
+
var _ref2 = asyncToGenerator(function* (api) {
|
|
2417
|
+
const {
|
|
2418
|
+
href = getCurrentHref(),
|
|
2419
|
+
display,
|
|
2420
|
+
appId = api.getAppId(),
|
|
2421
|
+
hashtag,
|
|
2422
|
+
redirectURI,
|
|
2423
|
+
quote,
|
|
2424
|
+
mobileIframe
|
|
2425
|
+
} = _this.props;
|
|
2426
|
+
return api.ui(clearUndefinedProperties({
|
|
2427
|
+
method: 'share',
|
|
2428
|
+
href,
|
|
2429
|
+
display,
|
|
2430
|
+
app_id: appId,
|
|
2431
|
+
hashtag,
|
|
2432
|
+
redirect_uri: redirectURI,
|
|
2433
|
+
quote,
|
|
2434
|
+
mobile_iframe: mobileIframe
|
|
2435
|
+
}));
|
|
2436
|
+
});
|
|
2437
|
+
|
|
2438
|
+
return function (_x2) {
|
|
2439
|
+
return _ref2.apply(this, arguments);
|
|
2440
|
+
};
|
|
2441
|
+
}());
|
|
2442
|
+
});
|
|
2443
|
+
|
|
2444
|
+
return function (_x) {
|
|
2445
|
+
return _ref.apply(this, arguments);
|
|
2446
|
+
};
|
|
2447
|
+
}());
|
|
2448
|
+
}
|
|
2449
|
+
|
|
2450
|
+
render() {
|
|
2451
|
+
const {
|
|
2452
|
+
children,
|
|
2453
|
+
loading,
|
|
2454
|
+
error,
|
|
2455
|
+
data
|
|
2456
|
+
} = this.props;
|
|
2457
|
+
return children({
|
|
2458
|
+
loading,
|
|
2459
|
+
handleClick: this.handleClick,
|
|
2460
|
+
error,
|
|
2461
|
+
data
|
|
2462
|
+
});
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
defineProperty(Share, "defaultProps", {
|
|
2468
|
+
href: undefined,
|
|
2469
|
+
hashtag: undefined,
|
|
2470
|
+
quote: undefined,
|
|
2471
|
+
mobileIframe: undefined,
|
|
2472
|
+
display: undefined,
|
|
2473
|
+
appId: undefined,
|
|
2474
|
+
redirectURI: undefined
|
|
2475
|
+
});
|
|
2476
|
+
|
|
2477
|
+
var Share$1 = forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
2478
|
+
loading,
|
|
2479
|
+
handleProcess,
|
|
2480
|
+
data,
|
|
2481
|
+
error
|
|
2482
|
+
}) => React__default.createElement(Share, _extends_1({}, props, {
|
|
2483
|
+
loading: loading,
|
|
2484
|
+
handleProcess: handleProcess,
|
|
2485
|
+
data: data,
|
|
2486
|
+
error: error,
|
|
2487
|
+
ref: ref
|
|
2488
|
+
}))));
|
|
2489
|
+
|
|
2490
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
2491
|
+
|
|
2492
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(source, true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
2493
|
+
function ShareButton(props) {
|
|
2494
|
+
const {
|
|
2495
|
+
className,
|
|
2496
|
+
children
|
|
2497
|
+
} = props,
|
|
2498
|
+
rest = objectWithoutProperties(props, ["className", "children"]);
|
|
2499
|
+
|
|
2500
|
+
return React__default.createElement(Share$1, rest, ({
|
|
2501
|
+
loading,
|
|
2502
|
+
handleClick
|
|
2503
|
+
}) => React__default.createElement("button", {
|
|
2504
|
+
type: "button",
|
|
2505
|
+
disabled: loading,
|
|
2506
|
+
className: className,
|
|
2507
|
+
onClick: handleClick
|
|
2508
|
+
}, children));
|
|
2509
|
+
}
|
|
2510
|
+
ShareButton.defaultProps = _objectSpread$1({}, Share$1.defaultProps, {
|
|
2511
|
+
className: undefined
|
|
2512
|
+
});
|
|
2513
|
+
|
|
2514
|
+
class Page extends PureComponent {
|
|
2515
|
+
componentDidUpdate() {
|
|
2516
|
+
const {
|
|
2517
|
+
handleParse
|
|
2518
|
+
} = this.props;
|
|
2519
|
+
handleParse();
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
render() {
|
|
2523
|
+
const {
|
|
2524
|
+
style,
|
|
2525
|
+
href = getCurrentHref(),
|
|
2526
|
+
tabs,
|
|
2527
|
+
hideCover,
|
|
2528
|
+
width,
|
|
2529
|
+
height,
|
|
2530
|
+
showFacepile,
|
|
2531
|
+
hideCTA,
|
|
2532
|
+
smallHeader,
|
|
2533
|
+
adaptContainerWidth,
|
|
2534
|
+
children
|
|
2535
|
+
} = this.props;
|
|
2536
|
+
return React__default.createElement("div", {
|
|
2537
|
+
className: "fb-page",
|
|
2538
|
+
style: style,
|
|
2539
|
+
"data-tabs": tabs,
|
|
2540
|
+
"data-hide-cover": hideCover,
|
|
2541
|
+
"data-show-facepile": showFacepile,
|
|
2542
|
+
"data-hide-cta": hideCTA,
|
|
2543
|
+
"data-href": href,
|
|
2544
|
+
"data-small-header": smallHeader,
|
|
2545
|
+
"data-adapt-container-width": adaptContainerWidth,
|
|
2546
|
+
"data-height": height,
|
|
2547
|
+
"data-width": width
|
|
2548
|
+
}, children);
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
}
|
|
2552
|
+
|
|
2553
|
+
defineProperty(Page, "defaultProps", {
|
|
2554
|
+
width: undefined,
|
|
2555
|
+
height: undefined,
|
|
2556
|
+
tabs: undefined,
|
|
2557
|
+
hideCover: undefined,
|
|
2558
|
+
showFacepile: undefined,
|
|
2559
|
+
hideCTA: undefined,
|
|
2560
|
+
smallHeader: undefined,
|
|
2561
|
+
adaptContainerWidth: undefined,
|
|
2562
|
+
children: undefined,
|
|
2563
|
+
style: undefined,
|
|
2564
|
+
href: undefined
|
|
2565
|
+
});
|
|
2566
|
+
|
|
2567
|
+
var Page$1 = forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
2568
|
+
handleParse
|
|
2569
|
+
}) => React__default.createElement(Page, _extends_1({}, props, {
|
|
2570
|
+
handleParse: handleParse,
|
|
2571
|
+
ref: ref
|
|
2572
|
+
}))));
|
|
2573
|
+
|
|
2574
|
+
// 3.0 fields without app review https://developers.facebook.com/docs/facebook-login/permissions/?locale=en_US#reference-default
|
|
2575
|
+
var Fields = ['id', 'first_name', 'last_name', 'middle_name', 'name', 'name_format', 'picture', 'short_name', 'email'];
|
|
2576
|
+
|
|
2577
|
+
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
2578
|
+
|
|
2579
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(source, true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
2580
|
+
|
|
2581
|
+
class Login extends Component {
|
|
2582
|
+
constructor(...args) {
|
|
2583
|
+
var _this;
|
|
2584
|
+
|
|
2585
|
+
super(...args);
|
|
2586
|
+
_this = this;
|
|
2587
|
+
|
|
2588
|
+
defineProperty(this, "handleClick",
|
|
2589
|
+
/*#__PURE__*/
|
|
2590
|
+
function () {
|
|
2591
|
+
var _ref = asyncToGenerator(function* (evn) {
|
|
2592
|
+
evn.preventDefault();
|
|
2593
|
+
const {
|
|
2594
|
+
handleProcess,
|
|
2595
|
+
onCompleted,
|
|
2596
|
+
onError,
|
|
2597
|
+
onSuccess
|
|
2598
|
+
} = _this.props;
|
|
2599
|
+
|
|
2600
|
+
try {
|
|
2601
|
+
yield handleProcess(
|
|
2602
|
+
/*#__PURE__*/
|
|
2603
|
+
function () {
|
|
2604
|
+
var _ref2 = asyncToGenerator(function* (api) {
|
|
2605
|
+
const {
|
|
2606
|
+
scope,
|
|
2607
|
+
fields,
|
|
2608
|
+
returnScopes,
|
|
2609
|
+
rerequest,
|
|
2610
|
+
reauthorize,
|
|
2611
|
+
eventKey
|
|
2612
|
+
} = _this.props;
|
|
2613
|
+
const loginQpts = {
|
|
2614
|
+
scope
|
|
2615
|
+
};
|
|
2616
|
+
const authType = [];
|
|
2617
|
+
|
|
2618
|
+
if (returnScopes) {
|
|
2619
|
+
loginQpts.return_scopes = true;
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
if (rerequest) {
|
|
2623
|
+
authType.push('rerequest');
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2626
|
+
if (reauthorize) {
|
|
2627
|
+
authType.push('reauthenticate');
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
if (authType.length) {
|
|
2631
|
+
loginQpts.auth_type = authType.join(',');
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
const loginResponse = yield api.login(loginQpts);
|
|
2635
|
+
|
|
2636
|
+
if (loginResponse.status !== 'connected') {
|
|
2637
|
+
throw new Error('Unauthorized user');
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
const data = yield api.getTokenDetailWithProfile({
|
|
2641
|
+
fields
|
|
2642
|
+
}, loginResponse);
|
|
2643
|
+
|
|
2644
|
+
if (onCompleted) {
|
|
2645
|
+
yield onCompleted(_objectSpread$2({}, data, {
|
|
2646
|
+
eventKey
|
|
2647
|
+
}));
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
return data;
|
|
2651
|
+
});
|
|
2652
|
+
|
|
2653
|
+
return function (_x2) {
|
|
2654
|
+
return _ref2.apply(this, arguments);
|
|
2655
|
+
};
|
|
2656
|
+
}(), onSuccess);
|
|
2657
|
+
} catch (error) {
|
|
2658
|
+
if (onError) {
|
|
2659
|
+
onError(error);
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
});
|
|
2663
|
+
|
|
2664
|
+
return function (_x) {
|
|
2665
|
+
return _ref.apply(this, arguments);
|
|
2666
|
+
};
|
|
2667
|
+
}());
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2670
|
+
render() {
|
|
2671
|
+
const {
|
|
2672
|
+
children,
|
|
2673
|
+
loading,
|
|
2674
|
+
error,
|
|
2675
|
+
data
|
|
2676
|
+
} = this.props;
|
|
2677
|
+
return children({
|
|
2678
|
+
loading,
|
|
2679
|
+
handleClick: this.handleClick,
|
|
2680
|
+
error,
|
|
2681
|
+
data
|
|
2682
|
+
});
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
defineProperty(Login, "defaultProps", {
|
|
2688
|
+
scope: '',
|
|
2689
|
+
fields: Fields,
|
|
2690
|
+
returnScopes: false,
|
|
2691
|
+
rerequest: false,
|
|
2692
|
+
reauthorize: false,
|
|
2693
|
+
onCompleted: undefined,
|
|
2694
|
+
onError: undefined,
|
|
2695
|
+
eventKey: undefined
|
|
2696
|
+
});
|
|
2697
|
+
|
|
2698
|
+
var Login$1 = forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
2699
|
+
loading,
|
|
2700
|
+
handleProcess,
|
|
2701
|
+
data,
|
|
2702
|
+
error
|
|
2703
|
+
}) => React__default.createElement(Login, _extends_1({}, props, {
|
|
2704
|
+
loading: loading,
|
|
2705
|
+
handleProcess: handleProcess,
|
|
2706
|
+
data: data,
|
|
2707
|
+
error: error,
|
|
2708
|
+
ref: ref
|
|
2709
|
+
}))));
|
|
2710
|
+
|
|
2711
|
+
var spin = createCommonjsModule(function (module) {
|
|
2712
|
+
(function (root, factory) {
|
|
2713
|
+
|
|
2714
|
+
/* CommonJS */
|
|
2715
|
+
if ( module.exports) module.exports = factory();
|
|
2716
|
+
|
|
2717
|
+
/* AMD module */
|
|
2718
|
+
else root.Spinner = factory();
|
|
2719
|
+
}(commonjsGlobal, function () {
|
|
2720
|
+
|
|
2721
|
+
var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */
|
|
2722
|
+
, animations = {} /* Animation rules keyed by their name */
|
|
2723
|
+
, useCssAnimations /* Whether to use CSS animations or setTimeout */
|
|
2724
|
+
, sheet; /* A stylesheet to hold the @keyframe or VML rules. */
|
|
2725
|
+
|
|
2726
|
+
/**
|
|
2727
|
+
* Utility function to create elements. If no tag name is given,
|
|
2728
|
+
* a DIV is created. Optionally properties can be passed.
|
|
2729
|
+
*/
|
|
2730
|
+
function createEl (tag, prop) {
|
|
2731
|
+
var el = document.createElement(tag || 'div')
|
|
2732
|
+
, n;
|
|
2733
|
+
|
|
2734
|
+
for (n in prop) el[n] = prop[n];
|
|
2735
|
+
return el
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2738
|
+
/**
|
|
2739
|
+
* Appends children and returns the parent.
|
|
2740
|
+
*/
|
|
2741
|
+
function ins (parent /* child1, child2, ...*/) {
|
|
2742
|
+
for (var i = 1, n = arguments.length; i < n; i++) {
|
|
2743
|
+
parent.appendChild(arguments[i]);
|
|
2744
|
+
}
|
|
2745
|
+
|
|
2746
|
+
return parent
|
|
2747
|
+
}
|
|
2748
|
+
|
|
2749
|
+
/**
|
|
2750
|
+
* Creates an opacity keyframe animation rule and returns its name.
|
|
2751
|
+
* Since most mobile Webkits have timing issues with animation-delay,
|
|
2752
|
+
* we create separate rules for each line/segment.
|
|
2753
|
+
*/
|
|
2754
|
+
function addAnimation (alpha, trail, i, lines) {
|
|
2755
|
+
var name = ['opacity', trail, ~~(alpha * 100), i, lines].join('-')
|
|
2756
|
+
, start = 0.01 + i/lines * 100
|
|
2757
|
+
, z = Math.max(1 - (1-alpha) / trail * (100-start), alpha)
|
|
2758
|
+
, prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase()
|
|
2759
|
+
, pre = prefix && '-' + prefix + '-' || '';
|
|
2760
|
+
|
|
2761
|
+
if (!animations[name]) {
|
|
2762
|
+
sheet.insertRule(
|
|
2763
|
+
'@' + pre + 'keyframes ' + name + '{' +
|
|
2764
|
+
'0%{opacity:' + z + '}' +
|
|
2765
|
+
start + '%{opacity:' + alpha + '}' +
|
|
2766
|
+
(start+0.01) + '%{opacity:1}' +
|
|
2767
|
+
(start+trail) % 100 + '%{opacity:' + alpha + '}' +
|
|
2768
|
+
'100%{opacity:' + z + '}' +
|
|
2769
|
+
'}', sheet.cssRules.length);
|
|
2770
|
+
|
|
2771
|
+
animations[name] = 1;
|
|
2772
|
+
}
|
|
2773
|
+
|
|
2774
|
+
return name
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
/**
|
|
2778
|
+
* Tries various vendor prefixes and returns the first supported property.
|
|
2779
|
+
*/
|
|
2780
|
+
function vendor (el, prop) {
|
|
2781
|
+
var s = el.style
|
|
2782
|
+
, pp
|
|
2783
|
+
, i;
|
|
2784
|
+
|
|
2785
|
+
prop = prop.charAt(0).toUpperCase() + prop.slice(1);
|
|
2786
|
+
if (s[prop] !== undefined) return prop
|
|
2787
|
+
for (i = 0; i < prefixes.length; i++) {
|
|
2788
|
+
pp = prefixes[i]+prop;
|
|
2789
|
+
if (s[pp] !== undefined) return pp
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
|
|
2793
|
+
/**
|
|
2794
|
+
* Sets multiple style properties at once.
|
|
2795
|
+
*/
|
|
2796
|
+
function css (el, prop) {
|
|
2797
|
+
for (var n in prop) {
|
|
2798
|
+
el.style[vendor(el, n) || n] = prop[n];
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2801
|
+
return el
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
/**
|
|
2805
|
+
* Fills in default values.
|
|
2806
|
+
*/
|
|
2807
|
+
function merge (obj) {
|
|
2808
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2809
|
+
var def = arguments[i];
|
|
2810
|
+
for (var n in def) {
|
|
2811
|
+
if (obj[n] === undefined) obj[n] = def[n];
|
|
2812
|
+
}
|
|
2813
|
+
}
|
|
2814
|
+
return obj
|
|
2815
|
+
}
|
|
2816
|
+
|
|
2817
|
+
/**
|
|
2818
|
+
* Returns the line color from the given string or array.
|
|
2819
|
+
*/
|
|
2820
|
+
function getColor (color, idx) {
|
|
2821
|
+
return typeof color == 'string' ? color : color[idx % color.length]
|
|
2822
|
+
}
|
|
2823
|
+
|
|
2824
|
+
// Built-in defaults
|
|
2825
|
+
|
|
2826
|
+
var defaults = {
|
|
2827
|
+
lines: 12 // The number of lines to draw
|
|
2828
|
+
, length: 7 // The length of each line
|
|
2829
|
+
, width: 5 // The line thickness
|
|
2830
|
+
, radius: 10 // The radius of the inner circle
|
|
2831
|
+
, scale: 1.0 // Scales overall size of the spinner
|
|
2832
|
+
, corners: 1 // Roundness (0..1)
|
|
2833
|
+
, color: '#000' // #rgb or #rrggbb
|
|
2834
|
+
, opacity: 1/4 // Opacity of the lines
|
|
2835
|
+
, rotate: 0 // Rotation offset
|
|
2836
|
+
, direction: 1 // 1: clockwise, -1: counterclockwise
|
|
2837
|
+
, speed: 1 // Rounds per second
|
|
2838
|
+
, trail: 100 // Afterglow percentage
|
|
2839
|
+
, fps: 20 // Frames per second when using setTimeout()
|
|
2840
|
+
, zIndex: 2e9 // Use a high z-index by default
|
|
2841
|
+
, className: 'spinner' // CSS class to assign to the element
|
|
2842
|
+
, top: '50%' // center vertically
|
|
2843
|
+
, left: '50%' // center horizontally
|
|
2844
|
+
, shadow: false // Whether to render a shadow
|
|
2845
|
+
, hwaccel: false // Whether to use hardware acceleration (might be buggy)
|
|
2846
|
+
, position: 'absolute' // Element positioning
|
|
2847
|
+
};
|
|
2848
|
+
|
|
2849
|
+
/** The constructor */
|
|
2850
|
+
function Spinner (o) {
|
|
2851
|
+
this.opts = merge(o || {}, Spinner.defaults, defaults);
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
// Global defaults that override the built-ins:
|
|
2855
|
+
Spinner.defaults = {};
|
|
2856
|
+
|
|
2857
|
+
merge(Spinner.prototype, {
|
|
2858
|
+
/**
|
|
2859
|
+
* Adds the spinner to the given target element. If this instance is already
|
|
2860
|
+
* spinning, it is automatically removed from its previous target b calling
|
|
2861
|
+
* stop() internally.
|
|
2862
|
+
*/
|
|
2863
|
+
spin: function (target) {
|
|
2864
|
+
this.stop();
|
|
2865
|
+
|
|
2866
|
+
var self = this
|
|
2867
|
+
, o = self.opts
|
|
2868
|
+
, el = self.el = createEl(null, {className: o.className});
|
|
2869
|
+
|
|
2870
|
+
css(el, {
|
|
2871
|
+
position: o.position
|
|
2872
|
+
, width: 0
|
|
2873
|
+
, zIndex: o.zIndex
|
|
2874
|
+
, left: o.left
|
|
2875
|
+
, top: o.top
|
|
2876
|
+
});
|
|
2877
|
+
|
|
2878
|
+
if (target) {
|
|
2879
|
+
target.insertBefore(el, target.firstChild || null);
|
|
2880
|
+
}
|
|
2881
|
+
|
|
2882
|
+
el.setAttribute('role', 'progressbar');
|
|
2883
|
+
self.lines(el, self.opts);
|
|
2884
|
+
|
|
2885
|
+
if (!useCssAnimations) {
|
|
2886
|
+
// No CSS animation support, use setTimeout() instead
|
|
2887
|
+
var i = 0
|
|
2888
|
+
, start = (o.lines - 1) * (1 - o.direction) / 2
|
|
2889
|
+
, alpha
|
|
2890
|
+
, fps = o.fps
|
|
2891
|
+
, f = fps / o.speed
|
|
2892
|
+
, ostep = (1 - o.opacity) / (f * o.trail / 100)
|
|
2893
|
+
, astep = f / o.lines
|
|
2894
|
+
|
|
2895
|
+
;(function anim () {
|
|
2896
|
+
i++;
|
|
2897
|
+
for (var j = 0; j < o.lines; j++) {
|
|
2898
|
+
alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity);
|
|
2899
|
+
|
|
2900
|
+
self.opacity(el, j * o.direction + start, alpha, o);
|
|
2901
|
+
}
|
|
2902
|
+
self.timeout = self.el && setTimeout(anim, ~~(1000 / fps));
|
|
2903
|
+
})();
|
|
2904
|
+
}
|
|
2905
|
+
return self
|
|
2906
|
+
}
|
|
2907
|
+
|
|
2908
|
+
/**
|
|
2909
|
+
* Stops and removes the Spinner.
|
|
2910
|
+
*/
|
|
2911
|
+
, stop: function () {
|
|
2912
|
+
var el = this.el;
|
|
2913
|
+
if (el) {
|
|
2914
|
+
clearTimeout(this.timeout);
|
|
2915
|
+
if (el.parentNode) el.parentNode.removeChild(el);
|
|
2916
|
+
this.el = undefined;
|
|
2917
|
+
}
|
|
2918
|
+
return this
|
|
2919
|
+
}
|
|
2920
|
+
|
|
2921
|
+
/**
|
|
2922
|
+
* Internal method that draws the individual lines. Will be overwritten
|
|
2923
|
+
* in VML fallback mode below.
|
|
2924
|
+
*/
|
|
2925
|
+
, lines: function (el, o) {
|
|
2926
|
+
var i = 0
|
|
2927
|
+
, start = (o.lines - 1) * (1 - o.direction) / 2
|
|
2928
|
+
, seg;
|
|
2929
|
+
|
|
2930
|
+
function fill (color, shadow) {
|
|
2931
|
+
return css(createEl(), {
|
|
2932
|
+
position: 'absolute'
|
|
2933
|
+
, width: o.scale * (o.length + o.width) + 'px'
|
|
2934
|
+
, height: o.scale * o.width + 'px'
|
|
2935
|
+
, background: color
|
|
2936
|
+
, boxShadow: shadow
|
|
2937
|
+
, transformOrigin: 'left'
|
|
2938
|
+
, transform: 'rotate(' + ~~(360/o.lines*i + o.rotate) + 'deg) translate(' + o.scale*o.radius + 'px' + ',0)'
|
|
2939
|
+
, borderRadius: (o.corners * o.scale * o.width >> 1) + 'px'
|
|
2940
|
+
})
|
|
2941
|
+
}
|
|
2942
|
+
|
|
2943
|
+
for (; i < o.lines; i++) {
|
|
2944
|
+
seg = css(createEl(), {
|
|
2945
|
+
position: 'absolute'
|
|
2946
|
+
, top: 1 + ~(o.scale * o.width / 2) + 'px'
|
|
2947
|
+
, transform: o.hwaccel ? 'translate3d(0,0,0)' : ''
|
|
2948
|
+
, opacity: o.opacity
|
|
2949
|
+
, animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1 / o.speed + 's linear infinite'
|
|
2950
|
+
});
|
|
2951
|
+
|
|
2952
|
+
if (o.shadow) ins(seg, css(fill('#000', '0 0 4px #000'), {top: '2px'}));
|
|
2953
|
+
ins(el, ins(seg, fill(getColor(o.color, i), '0 0 1px rgba(0,0,0,.1)')));
|
|
2954
|
+
}
|
|
2955
|
+
return el
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
/**
|
|
2959
|
+
* Internal method that adjusts the opacity of a single line.
|
|
2960
|
+
* Will be overwritten in VML fallback mode below.
|
|
2961
|
+
*/
|
|
2962
|
+
, opacity: function (el, i, val) {
|
|
2963
|
+
if (i < el.childNodes.length) el.childNodes[i].style.opacity = val;
|
|
2964
|
+
}
|
|
2965
|
+
|
|
2966
|
+
});
|
|
2967
|
+
|
|
2968
|
+
|
|
2969
|
+
function initVML () {
|
|
2970
|
+
|
|
2971
|
+
/* Utility function to create a VML tag */
|
|
2972
|
+
function vml (tag, attr) {
|
|
2973
|
+
return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
|
|
2974
|
+
}
|
|
2975
|
+
|
|
2976
|
+
// No CSS transforms but VML support, add a CSS rule for VML elements:
|
|
2977
|
+
sheet.addRule('.spin-vml', 'behavior:url(#default#VML)');
|
|
2978
|
+
|
|
2979
|
+
Spinner.prototype.lines = function (el, o) {
|
|
2980
|
+
var r = o.scale * (o.length + o.width)
|
|
2981
|
+
, s = o.scale * 2 * r;
|
|
2982
|
+
|
|
2983
|
+
function grp () {
|
|
2984
|
+
return css(
|
|
2985
|
+
vml('group', {
|
|
2986
|
+
coordsize: s + ' ' + s
|
|
2987
|
+
, coordorigin: -r + ' ' + -r
|
|
2988
|
+
})
|
|
2989
|
+
, { width: s, height: s }
|
|
2990
|
+
)
|
|
2991
|
+
}
|
|
2992
|
+
|
|
2993
|
+
var margin = -(o.width + o.length) * o.scale * 2 + 'px'
|
|
2994
|
+
, g = css(grp(), {position: 'absolute', top: margin, left: margin})
|
|
2995
|
+
, i;
|
|
2996
|
+
|
|
2997
|
+
function seg (i, dx, filter) {
|
|
2998
|
+
ins(
|
|
2999
|
+
g
|
|
3000
|
+
, ins(
|
|
3001
|
+
css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx})
|
|
3002
|
+
, ins(
|
|
3003
|
+
css(
|
|
3004
|
+
vml('roundrect', {arcsize: o.corners})
|
|
3005
|
+
, { width: r
|
|
3006
|
+
, height: o.scale * o.width
|
|
3007
|
+
, left: o.scale * o.radius
|
|
3008
|
+
, top: -o.scale * o.width >> 1
|
|
3009
|
+
, filter: filter
|
|
3010
|
+
}
|
|
3011
|
+
)
|
|
3012
|
+
, vml('fill', {color: getColor(o.color, i), opacity: o.opacity})
|
|
3013
|
+
, vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change
|
|
3014
|
+
)
|
|
3015
|
+
)
|
|
3016
|
+
);
|
|
3017
|
+
}
|
|
3018
|
+
|
|
3019
|
+
if (o.shadow)
|
|
3020
|
+
for (i = 1; i <= o.lines; i++) {
|
|
3021
|
+
seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)');
|
|
3022
|
+
}
|
|
3023
|
+
|
|
3024
|
+
for (i = 1; i <= o.lines; i++) seg(i);
|
|
3025
|
+
return ins(el, g)
|
|
3026
|
+
};
|
|
3027
|
+
|
|
3028
|
+
Spinner.prototype.opacity = function (el, i, val, o) {
|
|
3029
|
+
var c = el.firstChild;
|
|
3030
|
+
o = o.shadow && o.lines || 0;
|
|
3031
|
+
if (c && i + o < c.childNodes.length) {
|
|
3032
|
+
c = c.childNodes[i + o]; c = c && c.firstChild; c = c && c.firstChild;
|
|
3033
|
+
if (c) c.opacity = val;
|
|
3034
|
+
}
|
|
3035
|
+
};
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
if (typeof document !== 'undefined') {
|
|
3039
|
+
sheet = (function () {
|
|
3040
|
+
var el = createEl('style', {type : 'text/css'});
|
|
3041
|
+
ins(document.getElementsByTagName('head')[0], el);
|
|
3042
|
+
return el.sheet || el.styleSheet
|
|
3043
|
+
}());
|
|
3044
|
+
|
|
3045
|
+
var probe = css(createEl('group'), {behavior: 'url(#default#VML)'});
|
|
3046
|
+
|
|
3047
|
+
if (!vendor(probe, 'transform') && probe.adj) initVML();
|
|
3048
|
+
else useCssAnimations = vendor(probe, 'animation');
|
|
3049
|
+
}
|
|
3050
|
+
|
|
3051
|
+
return Spinner
|
|
3052
|
+
|
|
3053
|
+
}));
|
|
3054
|
+
});
|
|
3055
|
+
|
|
3056
|
+
var dist = createCommonjsModule(function (module, exports) {
|
|
3057
|
+
|
|
3058
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3059
|
+
value: true
|
|
3060
|
+
});
|
|
3061
|
+
|
|
3062
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
3063
|
+
|
|
3064
|
+
|
|
3065
|
+
|
|
3066
|
+
var _react2 = _interopRequireDefault(React__default);
|
|
3067
|
+
|
|
3068
|
+
|
|
3069
|
+
|
|
3070
|
+
var _propTypes2 = _interopRequireDefault(PropTypes);
|
|
3071
|
+
|
|
3072
|
+
|
|
3073
|
+
|
|
3074
|
+
var _spin2 = _interopRequireDefault(spin);
|
|
3075
|
+
|
|
3076
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3077
|
+
|
|
3078
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3079
|
+
|
|
3080
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
3081
|
+
|
|
3082
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
3083
|
+
|
|
3084
|
+
var Spinner = function (_Component) {
|
|
3085
|
+
_inherits(Spinner, _Component);
|
|
3086
|
+
|
|
3087
|
+
function Spinner() {
|
|
3088
|
+
_classCallCheck(this, Spinner);
|
|
3089
|
+
|
|
3090
|
+
return _possibleConstructorReturn(this, (Spinner.__proto__ || Object.getPrototypeOf(Spinner)).apply(this, arguments));
|
|
3091
|
+
}
|
|
3092
|
+
|
|
3093
|
+
_createClass(Spinner, [{
|
|
3094
|
+
key: 'componentDidMount',
|
|
3095
|
+
value: function componentDidMount() {
|
|
3096
|
+
this.updateSpinner();
|
|
3097
|
+
}
|
|
3098
|
+
}, {
|
|
3099
|
+
key: 'componentDidUpdate',
|
|
3100
|
+
value: function componentDidUpdate() {
|
|
3101
|
+
this.updateSpinner();
|
|
3102
|
+
}
|
|
3103
|
+
}, {
|
|
3104
|
+
key: 'componentWillUnmount',
|
|
3105
|
+
value: function componentWillUnmount() {
|
|
3106
|
+
if (this.spinner) {
|
|
3107
|
+
this.spinner.stop();
|
|
3108
|
+
this.spinner = null;
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
}, {
|
|
3112
|
+
key: 'updateSpinner',
|
|
3113
|
+
value: function updateSpinner() {
|
|
3114
|
+
var loaded = this.props.loaded;
|
|
3115
|
+
|
|
3116
|
+
if (!loaded && !this.spinner) {
|
|
3117
|
+
this.spinner = new _spin2.default(this.props.config);
|
|
3118
|
+
this.spinner.spin(this.refs.loader);
|
|
3119
|
+
} else if (loaded && this.spinner) {
|
|
3120
|
+
this.spinner.stop();
|
|
3121
|
+
this.spinner = null;
|
|
3122
|
+
}
|
|
3123
|
+
}
|
|
3124
|
+
}, {
|
|
3125
|
+
key: 'render',
|
|
3126
|
+
value: function render() {
|
|
3127
|
+
var _props = this.props,
|
|
3128
|
+
loaded = _props.loaded,
|
|
3129
|
+
className = _props.className;
|
|
3130
|
+
|
|
3131
|
+
|
|
3132
|
+
if (loaded) {
|
|
3133
|
+
return this.props.children ? React__default.Children.only(this.props.children) : null;
|
|
3134
|
+
}
|
|
3135
|
+
|
|
3136
|
+
return _react2.default.createElement('div', { className: className, ref: 'loader' });
|
|
3137
|
+
}
|
|
3138
|
+
}]);
|
|
3139
|
+
|
|
3140
|
+
return Spinner;
|
|
3141
|
+
}(React__default.Component);
|
|
3142
|
+
|
|
3143
|
+
Spinner.propTypes = {
|
|
3144
|
+
className: _propTypes2.default.string,
|
|
3145
|
+
config: _propTypes2.default.object.isRequired,
|
|
3146
|
+
loaded: _propTypes2.default.bool.isRequired,
|
|
3147
|
+
children: _propTypes2.default.node
|
|
3148
|
+
};
|
|
3149
|
+
Spinner.defaultProps = {
|
|
3150
|
+
config: {},
|
|
3151
|
+
loaded: false,
|
|
3152
|
+
className: 'loader'
|
|
3153
|
+
};
|
|
3154
|
+
exports.default = Spinner;
|
|
3155
|
+
});
|
|
3156
|
+
|
|
3157
|
+
var Spinner = unwrapExports(dist);
|
|
3158
|
+
|
|
3159
|
+
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
3160
|
+
|
|
3161
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(source, true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
3162
|
+
function LoginButton(props) {
|
|
3163
|
+
const {
|
|
3164
|
+
children,
|
|
3165
|
+
className,
|
|
3166
|
+
spinner,
|
|
3167
|
+
spinnerConfig
|
|
3168
|
+
} = props,
|
|
3169
|
+
rest = objectWithoutProperties(props, ["children", "className", "spinner", "spinnerConfig"]);
|
|
3170
|
+
|
|
3171
|
+
return React__default.createElement(Login$1, rest, ({
|
|
3172
|
+
loading,
|
|
3173
|
+
handleClick
|
|
3174
|
+
}) => React__default.createElement("button", {
|
|
3175
|
+
type: "button",
|
|
3176
|
+
className: className,
|
|
3177
|
+
onClick: handleClick,
|
|
3178
|
+
disabled: loading
|
|
3179
|
+
}, children, spinner && loading && React__default.createElement(Spinner, {
|
|
3180
|
+
config: spinnerConfig
|
|
3181
|
+
})));
|
|
3182
|
+
}
|
|
3183
|
+
LoginButton.defaultProps = _objectSpread$3({}, Login$1.defaultProps, {
|
|
3184
|
+
className: undefined,
|
|
3185
|
+
spinnerConfig: {},
|
|
3186
|
+
spinner: true
|
|
3187
|
+
});
|
|
3188
|
+
|
|
3189
|
+
class EmbeddedPost extends PureComponent {
|
|
3190
|
+
componentDidUpdate() {
|
|
3191
|
+
const {
|
|
3192
|
+
handleParse
|
|
3193
|
+
} = this.props;
|
|
3194
|
+
handleParse();
|
|
3195
|
+
}
|
|
3196
|
+
|
|
3197
|
+
render() {
|
|
3198
|
+
const {
|
|
3199
|
+
href,
|
|
3200
|
+
width,
|
|
3201
|
+
showText,
|
|
3202
|
+
children
|
|
3203
|
+
} = this.props;
|
|
3204
|
+
return React__default.createElement("div", {
|
|
3205
|
+
className: "fb-post",
|
|
3206
|
+
"data-href": href,
|
|
3207
|
+
"data-width": width,
|
|
3208
|
+
"data-show-text": showText
|
|
3209
|
+
}, children);
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3212
|
+
}
|
|
3213
|
+
|
|
3214
|
+
defineProperty(EmbeddedPost, "defaultProps", {
|
|
3215
|
+
width: undefined,
|
|
3216
|
+
showText: undefined,
|
|
3217
|
+
children: undefined
|
|
3218
|
+
});
|
|
3219
|
+
|
|
3220
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3221
|
+
handleParse
|
|
3222
|
+
}) => React__default.createElement(EmbeddedPost, _extends_1({}, props, {
|
|
3223
|
+
handleParse: handleParse,
|
|
3224
|
+
ref: ref
|
|
3225
|
+
}))));
|
|
3226
|
+
|
|
3227
|
+
class EmbeddedVideo extends PureComponent {
|
|
3228
|
+
componentDidUpdate() {
|
|
3229
|
+
const {
|
|
3230
|
+
handleParse
|
|
3231
|
+
} = this.props;
|
|
3232
|
+
handleParse();
|
|
3233
|
+
}
|
|
3234
|
+
|
|
3235
|
+
render() {
|
|
3236
|
+
const {
|
|
3237
|
+
href,
|
|
3238
|
+
width,
|
|
3239
|
+
showText,
|
|
3240
|
+
allowFullScreen,
|
|
3241
|
+
autoPlay,
|
|
3242
|
+
showCaptions,
|
|
3243
|
+
children
|
|
3244
|
+
} = this.props;
|
|
3245
|
+
return React__default.createElement("div", {
|
|
3246
|
+
className: "fb-video",
|
|
3247
|
+
"data-href": href,
|
|
3248
|
+
"data-width": width,
|
|
3249
|
+
"data-show-text": showText,
|
|
3250
|
+
"data-show-captions": showCaptions,
|
|
3251
|
+
"data-autoplay": autoPlay,
|
|
3252
|
+
"data-allowfullscreen": allowFullScreen
|
|
3253
|
+
}, children);
|
|
3254
|
+
}
|
|
3255
|
+
|
|
3256
|
+
}
|
|
3257
|
+
|
|
3258
|
+
defineProperty(EmbeddedVideo, "defaultProps", {
|
|
3259
|
+
width: undefined,
|
|
3260
|
+
showText: undefined,
|
|
3261
|
+
allowFullScreen: undefined,
|
|
3262
|
+
autoPlay: undefined,
|
|
3263
|
+
showCaptions: undefined,
|
|
3264
|
+
children: undefined
|
|
3265
|
+
});
|
|
3266
|
+
|
|
3267
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3268
|
+
handleParse
|
|
3269
|
+
}) => React__default.createElement(EmbeddedVideo, _extends_1({}, props, {
|
|
3270
|
+
handleParse: handleParse,
|
|
3271
|
+
ref: ref
|
|
3272
|
+
}))));
|
|
3273
|
+
|
|
3274
|
+
class Comments extends PureComponent {
|
|
3275
|
+
componentDidUpdate() {
|
|
3276
|
+
const {
|
|
3277
|
+
handleParse
|
|
3278
|
+
} = this.props;
|
|
3279
|
+
handleParse();
|
|
3280
|
+
}
|
|
3281
|
+
|
|
3282
|
+
render() {
|
|
3283
|
+
const {
|
|
3284
|
+
colorScheme,
|
|
3285
|
+
href = getCurrentHref(),
|
|
3286
|
+
numPosts,
|
|
3287
|
+
orderBy,
|
|
3288
|
+
width,
|
|
3289
|
+
children,
|
|
3290
|
+
mobile
|
|
3291
|
+
} = this.props;
|
|
3292
|
+
return React__default.createElement("div", {
|
|
3293
|
+
className: "fb-comments",
|
|
3294
|
+
"data-colorscheme": colorScheme,
|
|
3295
|
+
"data-numposts": numPosts,
|
|
3296
|
+
"data-href": href,
|
|
3297
|
+
"data-order-by": orderBy,
|
|
3298
|
+
"data-width": width,
|
|
3299
|
+
"data-skin": colorScheme,
|
|
3300
|
+
"data-mobile": mobile
|
|
3301
|
+
}, children);
|
|
3302
|
+
}
|
|
3303
|
+
|
|
3304
|
+
}
|
|
3305
|
+
|
|
3306
|
+
defineProperty(Comments, "defaultProps", {
|
|
3307
|
+
href: undefined,
|
|
3308
|
+
numPosts: undefined,
|
|
3309
|
+
orderBy: undefined,
|
|
3310
|
+
width: undefined,
|
|
3311
|
+
colorScheme: undefined,
|
|
3312
|
+
children: undefined,
|
|
3313
|
+
mobile: undefined
|
|
3314
|
+
});
|
|
3315
|
+
|
|
3316
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3317
|
+
handleParse
|
|
3318
|
+
}) => React__default.createElement(Comments, _extends_1({}, props, {
|
|
3319
|
+
handleParse: handleParse,
|
|
3320
|
+
ref: ref
|
|
3321
|
+
}))));
|
|
3322
|
+
|
|
3323
|
+
class CommentsCount extends PureComponent {
|
|
3324
|
+
componentDidUpdate() {
|
|
3325
|
+
const {
|
|
3326
|
+
handleParse
|
|
3327
|
+
} = this.props;
|
|
3328
|
+
handleParse();
|
|
3329
|
+
}
|
|
3330
|
+
|
|
3331
|
+
render() {
|
|
3332
|
+
const {
|
|
3333
|
+
href = getCurrentHref(),
|
|
3334
|
+
children
|
|
3335
|
+
} = this.props;
|
|
3336
|
+
return React__default.createElement("span", {
|
|
3337
|
+
className: "fb-comments-count",
|
|
3338
|
+
"data-href": href
|
|
3339
|
+
}, children);
|
|
3340
|
+
}
|
|
3341
|
+
|
|
3342
|
+
}
|
|
3343
|
+
|
|
3344
|
+
defineProperty(CommentsCount, "defaultProps", {
|
|
3345
|
+
href: undefined,
|
|
3346
|
+
children: undefined
|
|
3347
|
+
});
|
|
3348
|
+
|
|
3349
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3350
|
+
handleParse
|
|
3351
|
+
}) => React__default.createElement(CommentsCount, _extends_1({}, props, {
|
|
3352
|
+
handleParse: handleParse,
|
|
3353
|
+
ref: ref
|
|
3354
|
+
}))));
|
|
3355
|
+
|
|
3356
|
+
class Feed extends Component {
|
|
3357
|
+
constructor(...args) {
|
|
3358
|
+
var _this;
|
|
3359
|
+
|
|
3360
|
+
super(...args);
|
|
3361
|
+
_this = this;
|
|
3362
|
+
|
|
3363
|
+
defineProperty(this, "handleClick",
|
|
3364
|
+
/*#__PURE__*/
|
|
3365
|
+
function () {
|
|
3366
|
+
var _ref = asyncToGenerator(function* (evn) {
|
|
3367
|
+
evn.preventDefault();
|
|
3368
|
+
const {
|
|
3369
|
+
handleProcess
|
|
3370
|
+
} = _this.props;
|
|
3371
|
+
return handleProcess(
|
|
3372
|
+
/*#__PURE__*/
|
|
3373
|
+
function () {
|
|
3374
|
+
var _ref2 = asyncToGenerator(function* (api) {
|
|
3375
|
+
const {
|
|
3376
|
+
link = getCurrentHref(),
|
|
3377
|
+
display,
|
|
3378
|
+
appId = api.getAppId(),
|
|
3379
|
+
redirectURI,
|
|
3380
|
+
from,
|
|
3381
|
+
to,
|
|
3382
|
+
picture,
|
|
3383
|
+
source,
|
|
3384
|
+
name,
|
|
3385
|
+
caption,
|
|
3386
|
+
description,
|
|
3387
|
+
dataRef
|
|
3388
|
+
} = _this.props;
|
|
3389
|
+
return api.ui(clearUndefinedProperties({
|
|
3390
|
+
method: 'feed',
|
|
3391
|
+
link,
|
|
3392
|
+
display,
|
|
3393
|
+
app_id: appId,
|
|
3394
|
+
redirect_uri: redirectURI,
|
|
3395
|
+
from,
|
|
3396
|
+
to,
|
|
3397
|
+
picture,
|
|
3398
|
+
source,
|
|
3399
|
+
name,
|
|
3400
|
+
caption,
|
|
3401
|
+
description,
|
|
3402
|
+
ref: dataRef
|
|
3403
|
+
}));
|
|
3404
|
+
});
|
|
3405
|
+
|
|
3406
|
+
return function (_x2) {
|
|
3407
|
+
return _ref2.apply(this, arguments);
|
|
3408
|
+
};
|
|
3409
|
+
}());
|
|
3410
|
+
});
|
|
3411
|
+
|
|
3412
|
+
return function (_x) {
|
|
3413
|
+
return _ref.apply(this, arguments);
|
|
3414
|
+
};
|
|
3415
|
+
}());
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3418
|
+
render() {
|
|
3419
|
+
const {
|
|
3420
|
+
children,
|
|
3421
|
+
loading,
|
|
3422
|
+
error,
|
|
3423
|
+
data
|
|
3424
|
+
} = this.props;
|
|
3425
|
+
return children({
|
|
3426
|
+
loading,
|
|
3427
|
+
handleClick: this.handleClick,
|
|
3428
|
+
error,
|
|
3429
|
+
data
|
|
3430
|
+
});
|
|
3431
|
+
}
|
|
3432
|
+
|
|
3433
|
+
}
|
|
3434
|
+
|
|
3435
|
+
defineProperty(Feed, "defaultProps", {
|
|
3436
|
+
link: undefined,
|
|
3437
|
+
display: undefined,
|
|
3438
|
+
appId: undefined,
|
|
3439
|
+
redirectURI: undefined,
|
|
3440
|
+
from: undefined,
|
|
3441
|
+
to: undefined,
|
|
3442
|
+
source: undefined,
|
|
3443
|
+
picture: undefined,
|
|
3444
|
+
name: undefined,
|
|
3445
|
+
caption: undefined,
|
|
3446
|
+
description: undefined,
|
|
3447
|
+
dataRef: undefined
|
|
3448
|
+
});
|
|
3449
|
+
|
|
3450
|
+
forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
3451
|
+
loading,
|
|
3452
|
+
handleProcess,
|
|
3453
|
+
error,
|
|
3454
|
+
data
|
|
3455
|
+
}) => React__default.createElement(Feed, _extends_1({}, props, {
|
|
3456
|
+
loading: loading,
|
|
3457
|
+
handleProcess: handleProcess,
|
|
3458
|
+
data: data,
|
|
3459
|
+
error: error,
|
|
3460
|
+
ref: ref
|
|
3461
|
+
}))));
|
|
3462
|
+
|
|
3463
|
+
class Group extends PureComponent {
|
|
3464
|
+
componentDidUpdate() {
|
|
3465
|
+
const {
|
|
3466
|
+
handleParse
|
|
3467
|
+
} = this.props;
|
|
3468
|
+
handleParse();
|
|
3469
|
+
}
|
|
3470
|
+
|
|
3471
|
+
render() {
|
|
3472
|
+
const {
|
|
3473
|
+
style,
|
|
3474
|
+
href = getCurrentHref(),
|
|
3475
|
+
width,
|
|
3476
|
+
showSocialContext,
|
|
3477
|
+
showMetaData,
|
|
3478
|
+
children,
|
|
3479
|
+
skin
|
|
3480
|
+
} = this.props;
|
|
3481
|
+
return React__default.createElement("div", {
|
|
3482
|
+
className: "fb-group",
|
|
3483
|
+
style: style,
|
|
3484
|
+
"data-href": href,
|
|
3485
|
+
"data-width": width,
|
|
3486
|
+
"data-show-social-context": showSocialContext,
|
|
3487
|
+
"data-show-metadata": showMetaData,
|
|
3488
|
+
"data-skin": skin
|
|
3489
|
+
}, children);
|
|
3490
|
+
}
|
|
3491
|
+
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
defineProperty(Group, "defaultProps", {
|
|
3495
|
+
showSocialContext: undefined,
|
|
3496
|
+
showMetaData: undefined,
|
|
3497
|
+
width: undefined,
|
|
3498
|
+
children: undefined,
|
|
3499
|
+
style: undefined,
|
|
3500
|
+
href: undefined,
|
|
3501
|
+
skin: undefined
|
|
3502
|
+
});
|
|
3503
|
+
|
|
3504
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3505
|
+
handleParse
|
|
3506
|
+
}) => React__default.createElement(Group, _extends_1({}, props, {
|
|
3507
|
+
handleParse: handleParse,
|
|
3508
|
+
ref: ref
|
|
3509
|
+
}))));
|
|
3510
|
+
|
|
3511
|
+
class LoginStatus$1 extends Component {
|
|
3512
|
+
constructor(..._args) {
|
|
3513
|
+
var _this;
|
|
3514
|
+
|
|
3515
|
+
super(..._args);
|
|
3516
|
+
_this = this;
|
|
3517
|
+
|
|
3518
|
+
defineProperty(this, "state", {});
|
|
3519
|
+
|
|
3520
|
+
defineProperty(this, "handleReady",
|
|
3521
|
+
/*#__PURE__*/
|
|
3522
|
+
function () {
|
|
3523
|
+
var _ref = asyncToGenerator(function* (api) {
|
|
3524
|
+
const {
|
|
3525
|
+
event
|
|
3526
|
+
} = _this.props;
|
|
3527
|
+
|
|
3528
|
+
_this.setState({
|
|
3529
|
+
api
|
|
3530
|
+
});
|
|
3531
|
+
|
|
3532
|
+
yield api.subscribe(event, _this.handleChange);
|
|
3533
|
+
});
|
|
3534
|
+
|
|
3535
|
+
return function (_x) {
|
|
3536
|
+
return _ref.apply(this, arguments);
|
|
3537
|
+
};
|
|
3538
|
+
}());
|
|
3539
|
+
|
|
3540
|
+
defineProperty(this, "handleChange", (...args) => {
|
|
3541
|
+
const {
|
|
3542
|
+
onChange
|
|
3543
|
+
} = this.props;
|
|
3544
|
+
|
|
3545
|
+
if (onChange) {
|
|
3546
|
+
onChange(...args);
|
|
3547
|
+
}
|
|
3548
|
+
});
|
|
3549
|
+
}
|
|
3550
|
+
|
|
3551
|
+
componentWillUnmount() {
|
|
3552
|
+
const {
|
|
3553
|
+
state: {
|
|
3554
|
+
api
|
|
3555
|
+
},
|
|
3556
|
+
props: {
|
|
3557
|
+
event
|
|
3558
|
+
}
|
|
3559
|
+
} = this;
|
|
3560
|
+
|
|
3561
|
+
if (api) {
|
|
3562
|
+
api.unsubscribe(event, this.handleChange);
|
|
3563
|
+
}
|
|
3564
|
+
}
|
|
3565
|
+
|
|
3566
|
+
render() {
|
|
3567
|
+
const {
|
|
3568
|
+
children
|
|
3569
|
+
} = this.props;
|
|
3570
|
+
return React__default.createElement(Initialize$1, {
|
|
3571
|
+
onReady: this.handleReady
|
|
3572
|
+
}, children);
|
|
3573
|
+
}
|
|
3574
|
+
|
|
3575
|
+
}
|
|
3576
|
+
|
|
3577
|
+
defineProperty(LoginStatus$1, "defaultProps", {
|
|
3578
|
+
onChange: undefined
|
|
3579
|
+
});
|
|
3580
|
+
|
|
3581
|
+
class Profile extends Component {
|
|
3582
|
+
constructor(...args) {
|
|
3583
|
+
var _this;
|
|
3584
|
+
|
|
3585
|
+
super(...args);
|
|
3586
|
+
_this = this;
|
|
3587
|
+
|
|
3588
|
+
defineProperty(this, "state", {
|
|
3589
|
+
loading: true
|
|
3590
|
+
});
|
|
3591
|
+
|
|
3592
|
+
defineProperty(this, "handleReady",
|
|
3593
|
+
/*#__PURE__*/
|
|
3594
|
+
function () {
|
|
3595
|
+
var _ref = asyncToGenerator(function* (api) {
|
|
3596
|
+
_this.api = api;
|
|
3597
|
+
|
|
3598
|
+
_this.updateProfile();
|
|
3599
|
+
});
|
|
3600
|
+
|
|
3601
|
+
return function (_x) {
|
|
3602
|
+
return _ref.apply(this, arguments);
|
|
3603
|
+
};
|
|
3604
|
+
}());
|
|
3605
|
+
|
|
3606
|
+
defineProperty(this, "handleStatusChange", () => {
|
|
3607
|
+
this.updateProfile();
|
|
3608
|
+
});
|
|
3609
|
+
}
|
|
3610
|
+
|
|
3611
|
+
updateProfile() {
|
|
3612
|
+
var _this2 = this;
|
|
3613
|
+
|
|
3614
|
+
return asyncToGenerator(function* () {
|
|
3615
|
+
const {
|
|
3616
|
+
api,
|
|
3617
|
+
props: {
|
|
3618
|
+
fields
|
|
3619
|
+
}
|
|
3620
|
+
} = _this2;
|
|
3621
|
+
|
|
3622
|
+
if (!api) {
|
|
3623
|
+
return;
|
|
3624
|
+
}
|
|
3625
|
+
|
|
3626
|
+
try {
|
|
3627
|
+
const response = yield api.getLoginStatus();
|
|
3628
|
+
|
|
3629
|
+
if (response.status !== LoginStatus.CONNECTED) {
|
|
3630
|
+
_this2.setState({
|
|
3631
|
+
profile: undefined,
|
|
3632
|
+
loading: false,
|
|
3633
|
+
error: undefined
|
|
3634
|
+
});
|
|
3635
|
+
|
|
3636
|
+
return;
|
|
3637
|
+
}
|
|
3638
|
+
|
|
3639
|
+
const profile = yield api.getProfile({
|
|
3640
|
+
fields
|
|
3641
|
+
});
|
|
3642
|
+
|
|
3643
|
+
_this2.setState({
|
|
3644
|
+
profile,
|
|
3645
|
+
loading: false,
|
|
3646
|
+
error: undefined
|
|
3647
|
+
});
|
|
3648
|
+
} catch (error) {
|
|
3649
|
+
_this2.setState({
|
|
3650
|
+
profile: undefined,
|
|
3651
|
+
loading: false,
|
|
3652
|
+
error
|
|
3653
|
+
});
|
|
3654
|
+
}
|
|
3655
|
+
})();
|
|
3656
|
+
}
|
|
3657
|
+
|
|
3658
|
+
render() {
|
|
3659
|
+
const {
|
|
3660
|
+
children
|
|
3661
|
+
} = this.props;
|
|
3662
|
+
const {
|
|
3663
|
+
profile,
|
|
3664
|
+
loading,
|
|
3665
|
+
error
|
|
3666
|
+
} = this.state;
|
|
3667
|
+
return React__default.createElement(Initialize$1, {
|
|
3668
|
+
onReady: this.handleReady
|
|
3669
|
+
}, React__default.createElement(LoginStatus$1, {
|
|
3670
|
+
event: "auth.statusChange",
|
|
3671
|
+
onChange: this.handleStatusChange
|
|
3672
|
+
}, children({
|
|
3673
|
+
profile,
|
|
3674
|
+
loading,
|
|
3675
|
+
error
|
|
3676
|
+
})));
|
|
3677
|
+
}
|
|
3678
|
+
|
|
3679
|
+
}
|
|
3680
|
+
|
|
3681
|
+
defineProperty(Profile, "defaultProps", {
|
|
3682
|
+
fields: Fields
|
|
3683
|
+
});
|
|
3684
|
+
|
|
3685
|
+
class CustomChat extends PureComponent {
|
|
3686
|
+
componentDidUpdate() {
|
|
3687
|
+
const {
|
|
3688
|
+
handleParse
|
|
3689
|
+
} = this.props;
|
|
3690
|
+
handleParse();
|
|
3691
|
+
}
|
|
3692
|
+
|
|
3693
|
+
render() {
|
|
3694
|
+
const {
|
|
3695
|
+
children,
|
|
3696
|
+
pageId,
|
|
3697
|
+
themeColor,
|
|
3698
|
+
loggedInGreeting,
|
|
3699
|
+
loggedOutGreeting,
|
|
3700
|
+
dataRef,
|
|
3701
|
+
greetingDialogDisplay,
|
|
3702
|
+
greetingDialogDelay
|
|
3703
|
+
} = this.props;
|
|
3704
|
+
return React__default.createElement("div", {
|
|
3705
|
+
className: "fb-customerchat",
|
|
3706
|
+
page_id: pageId,
|
|
3707
|
+
theme_color: themeColor,
|
|
3708
|
+
logged_in_greeting: loggedInGreeting,
|
|
3709
|
+
logged_out_greeting: loggedOutGreeting,
|
|
3710
|
+
greeting_dialog_display: greetingDialogDisplay,
|
|
3711
|
+
greeting_dialog_delay: greetingDialogDelay,
|
|
3712
|
+
"data-ref": dataRef
|
|
3713
|
+
}, children);
|
|
3714
|
+
}
|
|
3715
|
+
|
|
3716
|
+
}
|
|
3717
|
+
|
|
3718
|
+
defineProperty(CustomChat, "defaultProps", {
|
|
3719
|
+
children: undefined,
|
|
3720
|
+
themeColor: undefined,
|
|
3721
|
+
loggedInGreeting: undefined,
|
|
3722
|
+
loggedOutGreeting: undefined,
|
|
3723
|
+
dataRef: undefined,
|
|
3724
|
+
greetingDialogDisplay: undefined,
|
|
3725
|
+
greetingDialogDelay: undefined
|
|
3726
|
+
});
|
|
3727
|
+
|
|
3728
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3729
|
+
handleParse
|
|
3730
|
+
}) => React__default.createElement(CustomChat, _extends_1({}, props, {
|
|
3731
|
+
handleParse: handleParse,
|
|
3732
|
+
ref: ref
|
|
3733
|
+
}))));
|
|
3734
|
+
|
|
3735
|
+
class MessageUs extends PureComponent {
|
|
3736
|
+
componentDidUpdate() {
|
|
3737
|
+
const {
|
|
3738
|
+
handleParse
|
|
3739
|
+
} = this.props;
|
|
3740
|
+
handleParse();
|
|
3741
|
+
}
|
|
3742
|
+
|
|
3743
|
+
render() {
|
|
3744
|
+
const {
|
|
3745
|
+
color,
|
|
3746
|
+
messengerAppId,
|
|
3747
|
+
pageId,
|
|
3748
|
+
children,
|
|
3749
|
+
size
|
|
3750
|
+
} = this.props;
|
|
3751
|
+
return React__default.createElement("div", {
|
|
3752
|
+
className: "fb-messengermessageus",
|
|
3753
|
+
messenger_app_id: messengerAppId,
|
|
3754
|
+
page_id: pageId,
|
|
3755
|
+
"data-color": color,
|
|
3756
|
+
"data-size": size
|
|
3757
|
+
}, children);
|
|
3758
|
+
}
|
|
3759
|
+
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3762
|
+
defineProperty(MessageUs, "defaultProps", {
|
|
3763
|
+
color: undefined,
|
|
3764
|
+
size: undefined,
|
|
3765
|
+
children: undefined
|
|
3766
|
+
});
|
|
3767
|
+
|
|
3768
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3769
|
+
handleParse
|
|
3770
|
+
}) => React__default.createElement(MessageUs, _extends_1({}, props, {
|
|
3771
|
+
handleParse: handleParse,
|
|
3772
|
+
ref: ref
|
|
3773
|
+
}))));
|
|
3774
|
+
|
|
3775
|
+
class MessengerCheckbox extends PureComponent {
|
|
3776
|
+
componentDidUpdate() {
|
|
3777
|
+
const {
|
|
3778
|
+
handleParse
|
|
3779
|
+
} = this.props;
|
|
3780
|
+
handleParse();
|
|
3781
|
+
}
|
|
3782
|
+
|
|
3783
|
+
render() {
|
|
3784
|
+
const {
|
|
3785
|
+
origin,
|
|
3786
|
+
prechecked,
|
|
3787
|
+
allowLogin,
|
|
3788
|
+
userRef,
|
|
3789
|
+
messengerAppId,
|
|
3790
|
+
pageId,
|
|
3791
|
+
children,
|
|
3792
|
+
size,
|
|
3793
|
+
centerAlign,
|
|
3794
|
+
skin
|
|
3795
|
+
} = this.props;
|
|
3796
|
+
return React__default.createElement("div", {
|
|
3797
|
+
className: "fb-messenger-checkbox",
|
|
3798
|
+
messenger_app_id: messengerAppId,
|
|
3799
|
+
page_id: pageId,
|
|
3800
|
+
size: size,
|
|
3801
|
+
origin: origin,
|
|
3802
|
+
user_ref: userRef,
|
|
3803
|
+
prechecked: prechecked,
|
|
3804
|
+
allow_login: allowLogin,
|
|
3805
|
+
skin: skin,
|
|
3806
|
+
center_align: centerAlign
|
|
3807
|
+
}, children);
|
|
3808
|
+
}
|
|
3809
|
+
|
|
3810
|
+
}
|
|
3811
|
+
|
|
3812
|
+
defineProperty(MessengerCheckbox, "defaultProps", {
|
|
3813
|
+
size: undefined,
|
|
3814
|
+
allowLogin: undefined,
|
|
3815
|
+
prechecked: undefined,
|
|
3816
|
+
userRef: undefined,
|
|
3817
|
+
children: undefined,
|
|
3818
|
+
origin: undefined,
|
|
3819
|
+
skin: undefined,
|
|
3820
|
+
centerAlign: undefined
|
|
3821
|
+
});
|
|
3822
|
+
|
|
3823
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3824
|
+
handleParse
|
|
3825
|
+
}) => React__default.createElement(MessengerCheckbox, _extends_1({}, props, {
|
|
3826
|
+
handleParse: handleParse,
|
|
3827
|
+
ref: ref
|
|
3828
|
+
}))));
|
|
3829
|
+
|
|
3830
|
+
// import MessengerColor from './constants/MessengerColor';
|
|
3831
|
+
|
|
3832
|
+
class SendToMessenger extends PureComponent {
|
|
3833
|
+
componentDidUpdate() {
|
|
3834
|
+
const {
|
|
3835
|
+
handleParse
|
|
3836
|
+
} = this.props;
|
|
3837
|
+
handleParse();
|
|
3838
|
+
}
|
|
3839
|
+
|
|
3840
|
+
render() {
|
|
3841
|
+
const {
|
|
3842
|
+
color,
|
|
3843
|
+
messengerAppId,
|
|
3844
|
+
pageId,
|
|
3845
|
+
children,
|
|
3846
|
+
dataRef,
|
|
3847
|
+
size
|
|
3848
|
+
} = this.props;
|
|
3849
|
+
return React__default.createElement("div", {
|
|
3850
|
+
className: "fb-send-to-messenger",
|
|
3851
|
+
messenger_app_id: messengerAppId,
|
|
3852
|
+
page_id: pageId,
|
|
3853
|
+
"data-color": color,
|
|
3854
|
+
"data-size": size,
|
|
3855
|
+
"data-ref": dataRef
|
|
3856
|
+
}, children);
|
|
3857
|
+
}
|
|
3858
|
+
|
|
3859
|
+
}
|
|
3860
|
+
|
|
3861
|
+
defineProperty(SendToMessenger, "defaultProps", {
|
|
3862
|
+
color: undefined,
|
|
3863
|
+
size: undefined,
|
|
3864
|
+
dataRef: undefined,
|
|
3865
|
+
children: undefined
|
|
3866
|
+
});
|
|
3867
|
+
|
|
3868
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3869
|
+
handleParse
|
|
3870
|
+
}) => React__default.createElement(SendToMessenger, _extends_1({}, props, {
|
|
3871
|
+
handleParse: handleParse,
|
|
3872
|
+
ref: ref
|
|
3873
|
+
}))));
|
|
74
3874
|
|
|
75
3875
|
var ImageSlider = function ImageSlider(props) {
|
|
76
3876
|
var innerSlider = useRef(null);
|
|
@@ -179,61 +3979,61 @@ var ImageSlider = function ImageSlider(props) {
|
|
|
179
3979
|
}, []);
|
|
180
3980
|
|
|
181
3981
|
var variant = 'black';
|
|
182
|
-
return
|
|
183
|
-
|
|
3982
|
+
return React__default.createElement(
|
|
3983
|
+
React__default.Fragment,
|
|
184
3984
|
null,
|
|
185
|
-
|
|
3985
|
+
React__default.createElement(
|
|
186
3986
|
'div',
|
|
187
3987
|
{ ref: viewableWindow, id: 'vid-slider', className: 'col' },
|
|
188
|
-
|
|
3988
|
+
React__default.createElement(
|
|
189
3989
|
'div',
|
|
190
3990
|
{ className: 'row' },
|
|
191
|
-
showScroller &&
|
|
3991
|
+
showScroller && React__default.createElement(
|
|
192
3992
|
'div',
|
|
193
3993
|
{ onClick: function onClick(e) {
|
|
194
3994
|
return scrollSlider(e, 'prev');
|
|
195
3995
|
}, className: 'tile__slider-prev', style: { color: variant } },
|
|
196
|
-
|
|
3996
|
+
React__default.createElement('i', { style: { border: 'solid ' + variant, borderWidth: '0 4px 4px 0' }, className: 'arrow left' })
|
|
197
3997
|
),
|
|
198
|
-
showScroller &&
|
|
3998
|
+
showScroller && React__default.createElement(
|
|
199
3999
|
'div',
|
|
200
4000
|
{ onClick: function onClick(e) {
|
|
201
4001
|
return scrollSlider(e, 'next');
|
|
202
4002
|
}, className: 'tile__slider-next', style: { color: variant } },
|
|
203
|
-
|
|
4003
|
+
React__default.createElement('i', { style: { border: 'solid ' + variant, borderWidth: '0 4px 4px 0' }, className: 'arrow right' })
|
|
204
4004
|
),
|
|
205
|
-
|
|
4005
|
+
React__default.createElement(
|
|
206
4006
|
'div',
|
|
207
4007
|
{ ref: innerSlider, className: 'row__inner' },
|
|
208
4008
|
props.data.slides.map(function (img, index) {
|
|
209
4009
|
var thumbnail = urlFor({ client: client, source: img.slideshowImage, imageWidth: 250 });
|
|
210
4010
|
if (!img.slideshowImage.link) {
|
|
211
|
-
return
|
|
4011
|
+
return React__default.createElement(
|
|
212
4012
|
'div',
|
|
213
4013
|
{ ref: tile, key: index, className: 'tile', style: { width: tileSize + 'px' } },
|
|
214
|
-
|
|
4014
|
+
React__default.createElement(
|
|
215
4015
|
'div',
|
|
216
4016
|
{ className: 'tile__media' },
|
|
217
|
-
|
|
4017
|
+
React__default.createElement('img', { className: 'tile__img', src: thumbnail, alt: img.slideshowImage.alt ? img.slideshowImage.alt : '', style: { width: tileSize + 'px' } })
|
|
218
4018
|
),
|
|
219
|
-
|
|
4019
|
+
React__default.createElement('div', { style: { color: variant }, className: 'tile__info' })
|
|
220
4020
|
);
|
|
221
4021
|
} else {
|
|
222
|
-
return
|
|
4022
|
+
return React__default.createElement(
|
|
223
4023
|
'a',
|
|
224
4024
|
{ ref: tile, key: index, href: img.slideshowImage.link, target: img.slideshowImage.blank ? '_target' : '_self', className: 'tile', style: { width: tileSize + 'px' } },
|
|
225
|
-
|
|
4025
|
+
React__default.createElement(
|
|
226
4026
|
'div',
|
|
227
4027
|
{ className: 'tile__media' },
|
|
228
|
-
|
|
4028
|
+
React__default.createElement('img', { className: 'tile__img', src: thumbnail, alt: img.slideshowImage.alt ? img.slideshowImage.alt : '', style: { width: tileSize + 'px' } })
|
|
229
4029
|
),
|
|
230
|
-
|
|
4030
|
+
React__default.createElement('div', { style: { color: variant }, className: 'tile__info' })
|
|
231
4031
|
);
|
|
232
4032
|
}
|
|
233
4033
|
})
|
|
234
4034
|
)
|
|
235
4035
|
),
|
|
236
|
-
|
|
4036
|
+
React__default.createElement(
|
|
237
4037
|
'style',
|
|
238
4038
|
{ jsx: 'true' },
|
|
239
4039
|
'\n #vid-slider * {\n box-sizing: border-box;\n -ms-overflow-style: none;\n }\n #vid-slider::-webkit-scrollbar-thumb {\n display: none;\n }\n #vid-slider::-webkit-scrollbar {\n display: none;\n }\n #vid-slider .row::-webkit-scrollbar {\n display: none;\n }\n #vid-slider .row::-webkit-scrollbar-thumb {\n display: none;\n }\n #vid-slider {\n position: relative;\n -ms-overflow-style: none;\n padding: 0 1.5rem;\n margin-bottom: 0 !important;\n }\n #vid-slider .now-playing {\n position: absolute;\n top: 0.5rem;\n left: 1rem;\n color: white;\n background: rgba(0, 0, 0, 0.75);\n }\n #vid-slider h1,\n #vid-slider p {\n text-align: center;\n width: 100%;\n max-width: 500px;\n margin: auto;\n }\n #vid-slider,\n #vidHolder {\n max-width: 805px;\n }\n #vid-slider a:link,\n #vid-slider a:hover,\n #vid-slider a:active,\n #vid-slider a:visited {\n transition: color 150ms;\n color: #95a5a6;\n text-decoration: none;\n }\n #vid-slider a:hover {\n color: #7f8c8d;\n text-decoration: underline;\n }\n #vid-slider .contain {\n width: 100%;\n }\n #vid-slider .row {\n overflow-x: scroll;\n width: 100%;\n -ms-overflow-style: none;\n overflow-y: hidden !important;\n }\n #vid-slider .tile__info {\n white-space: normal !important;\n position: absolute;\n text-align: center;\n color: ' + (props.dark ? 'white' : '#383838') + ';\n opacity: 1;\n font-size: 0.9rem;\n font-weight: bold;\n transition: opacity 0.25s;\n }\n #vid-slider .row__inner {\n transition: 450ms -webkit-transform;\n transition: 450ms transform;\n transition: 450ms transform, 450ms -webkit-transform;\n font-size: 0;\n white-space: nowrap;\n margin: 25px 0 70px !important;\n padding-bottom: 10px;\n padding-left: 0;\n }\n #vid-slider .tile {\n position: relative;\n display: inline-block;\n margin: 0 12px;\n font-size: 20px;\n transition: 450ms all;\n -webkit-transform-origin: center left;\n transform-origin: center left;\n }\n \n #vid-slider .tile:first-child {\n margin-left: 15px;\n }\n #vid-slider .tile__img {\n height: auto;\n -o-object-fit: contain;\n object-fit: contain;\n object-position: center;\n }\n #vid-slider .tile__details {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n font-size: 10px;\n opacity: 0;\n background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);\n transition: 450ms opacity;\n }\n #vid-slider .tile__details:after,\n #vid-slider .tile__details:before {\n content: \'\';\n \n position: absolute;\n top: 50%;\n left: 50%;\n display: #000;\n }\n #vid-slider .tile__details:after {\n margin-top: -25px;\n margin-left: -25px;\n width: 50px;\n height: 50px;\n border: 3px solid #ecf0f1;\n line-height: 50px;\n text-align: center;\n border-radius: 100%;\n background: rgba(0, 0, 0, 0.5);\n z-index: 1;\n }\n #vid-slider .tile__details:before {\n content: \'\';\n background: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 64 64\' width=\'64\' height=\'64\' fill=\'white\'><path d=\'M26 46 L46 32 L26 18 Z\'/></svg>")\n no-repeat center center;\n left: 0;\n width: 100%;\n height: 3rem;\n font-size: 30px;\n margin-right: 12px;\n margin-top: -24px;\n text-align: center;\n z-index: 2;\n color: white;\n }\n \n #vid-slider .tile__title {\n position: absolute;\n bottom: 0;\n padding: 10px;\n max-width: 250px;\n }\n #vid-slider .tile__title_text {\n position: relative;\n left: 0;\n white-space: normal;\n }\n \n #vid-slider .tile__slider-prev,\n #vid-slider .tile__slider-next {\n width: 30px;\n background: transparent;\n border: none;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n z-index: 99;\n cursor: pointer;\n color: ' + (props.dark ? 'white' : 'black') + ';\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 2rem;\n }\n #vid-slider .tile__slider-prev {\n left: -0.5rem;\n padding: 1rem;\n }\n #vid-slider .tile__slider-next {\n right: -0.5rem;\n padding: 1rem;\n }\n #vid-slider,\n #vid-slider .row {\n margin: 0;\n }\n \n #vid-slider .row::-webkit-scrollbar-thumb {\n background-color: transparent !important;\n }\n #vid-slider i {\n border: solid ' + (props.dark ? 'white' : 'black') + ';\n border-width: 0 4px 4px 0;\n display: inline-block;\n padding: 4px;\n pointer-events: none;\n }\n #vid-slider .right {\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n }\n #vid-slider .left {\n transform: rotate(135deg);\n -webkit-transform: rotate(135deg);\n }\n @media screen and (min-width: 1399px) {\n .block-content #vid-slider .tile__img {\n height: auto;\n }\n .block-content #vid-slider .tile {\n height: auto;\n }\n }\n \n @media screen and (max-width: 1399px) {\n #vid-slider,\n #vidHolder {\n max-width: 620px;\n }\n }\n @media screen and (max-width: 1200px) {\n #vid-slider,\n #vidHolder {\n max-width: 580px;\n }\n }\n @media screen and (max-width: 967px) {\n #vid-slider {\n max-width: 100%;\n }\n \n #vid-slider .row__inner {\n margin: 60px 0 50px !important;\n }\n }\n \n @media screen and (max-width: 768px) {\n #vidHolder {\n position: unset;\n width: 100%;\n }\n }\n @media screen and (max-width: 568px) {\n #vidHolder {\n position: unset;\n width: 100%;\n }\n \n #vid-slider .row__inner {\n margin: 30px 0 70px;\n }\n }\n '
|
|
@@ -261,114 +4061,114 @@ var PartnerDetails = function PartnerDetails(_ref) {
|
|
|
261
4061
|
pageview = _ref.pageview,
|
|
262
4062
|
page = _ref.page;
|
|
263
4063
|
|
|
264
|
-
return
|
|
265
|
-
|
|
4064
|
+
return React__default.createElement(
|
|
4065
|
+
React__default.Fragment,
|
|
266
4066
|
null,
|
|
267
|
-
|
|
268
|
-
|
|
4067
|
+
React__default.createElement(Breadcrumbs, null),
|
|
4068
|
+
React__default.createElement(
|
|
269
4069
|
'div',
|
|
270
4070
|
{ className: 'partners-page' },
|
|
271
|
-
|
|
4071
|
+
React__default.createElement(
|
|
272
4072
|
'div',
|
|
273
4073
|
{ className: 'my-5 partner-logo-wrap', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' } },
|
|
274
|
-
partnerDetails.thumbnail && partnerDetails.thumbnail.link ?
|
|
4074
|
+
partnerDetails.thumbnail && partnerDetails.thumbnail.link ? React__default.createElement(
|
|
275
4075
|
'a',
|
|
276
4076
|
{ className: 'partners-logo', style: { width: '25%', minWidth: '25%' }, href: partnerDetails.thumbnail.link, target: partnerDetails.thumbnail.blank ? '_blank' : '' },
|
|
277
|
-
|
|
4077
|
+
React__default.createElement(
|
|
278
4078
|
'figure',
|
|
279
4079
|
{ style: { width: '100%', textAlign: 'center' } },
|
|
280
|
-
|
|
4080
|
+
React__default.createElement('img', {
|
|
281
4081
|
alt: partnerDetails.thumbnail && partnerDetails.thumbnail.alt ? partnerDetails.thumbnail.alt : partnerDetails.name,
|
|
282
4082
|
style: { maxWidth: '100%' },
|
|
283
4083
|
src: partnerDetails.thumbnail ? urlFor({ client: client, source: partnerDetails.thumbnail.asset }) : ''
|
|
284
4084
|
}),
|
|
285
|
-
partnerDetails.thumbnail && partnerDetails.thumbnail.caption &&
|
|
4085
|
+
partnerDetails.thumbnail && partnerDetails.thumbnail.caption && React__default.createElement(
|
|
286
4086
|
'figcaption',
|
|
287
4087
|
null,
|
|
288
4088
|
partnerDetails.thumbnail.caption
|
|
289
4089
|
)
|
|
290
4090
|
)
|
|
291
|
-
) :
|
|
4091
|
+
) : React__default.createElement(
|
|
292
4092
|
'figure',
|
|
293
4093
|
{ className: 'partners-logo', style: { width: '25%', minWidth: '25%', textAlign: 'center' } },
|
|
294
|
-
|
|
4094
|
+
React__default.createElement('img', {
|
|
295
4095
|
alt: partnerDetails.thumbnail && partnerDetails.thumbnail.alt ? partnerDetails.thumbnail.alt : partnerDetails.name,
|
|
296
4096
|
style: { maxWidth: '100%' },
|
|
297
4097
|
src: partnerDetails.thumbnail ? urlFor({ client: client, source: partnerDetails.thumbnail.asset }) : ''
|
|
298
4098
|
}),
|
|
299
|
-
partnerDetails.thumbnail && partnerDetails.thumbnail.caption &&
|
|
4099
|
+
partnerDetails.thumbnail && partnerDetails.thumbnail.caption && React__default.createElement(
|
|
300
4100
|
'figcaption',
|
|
301
4101
|
null,
|
|
302
4102
|
partnerDetails.thumbnail.caption
|
|
303
4103
|
)
|
|
304
4104
|
),
|
|
305
|
-
|
|
4105
|
+
React__default.createElement(
|
|
306
4106
|
'style',
|
|
307
4107
|
{ jsx: 'true' },
|
|
308
4108
|
'\n @media screen and (max-width: 768px) {\n .partners-logo {\n width: 100%;\n min-width: 100%;\n }\n .partner-logo-wrap {\n flex-wrap: wrap;\n }\n .block-content-partners {\n padding-left: 0 !important;\n }\n }\n '
|
|
309
4109
|
),
|
|
310
|
-
(partnerDetails.description || partnerDetails.linkedin || partnerDetails.twitter && partnerDetails.facebook || !partnerDetails.twitter && partnerDetails.facebook && checkIsFacebookGroup(partnerDetails.facebook)) &&
|
|
4110
|
+
(partnerDetails.description || partnerDetails.linkedin || partnerDetails.twitter && partnerDetails.facebook || !partnerDetails.twitter && partnerDetails.facebook && checkIsFacebookGroup(partnerDetails.facebook)) && React__default.createElement(
|
|
311
4111
|
'div',
|
|
312
4112
|
{ className: 'block-content-partners my-4', style: { maxWidth: '100%', paddingLeft: '2rem', flex: '1 1 auto' } },
|
|
313
|
-
partnerDetails.description &&
|
|
314
|
-
(partnerDetails.linkedin || partnerDetails.twitter && partnerDetails.facebook || !partnerDetails.twitter && partnerDetails.facebook && checkIsFacebookGroup(partnerDetails.facebook)) &&
|
|
4113
|
+
partnerDetails.description && React__default.createElement(BlockContent, _extends({ serializers: getSerializers(client), blocks: partnerDetails.description, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config())),
|
|
4114
|
+
(partnerDetails.linkedin || partnerDetails.twitter && partnerDetails.facebook || !partnerDetails.twitter && partnerDetails.facebook && checkIsFacebookGroup(partnerDetails.facebook)) && React__default.createElement(
|
|
315
4115
|
'div',
|
|
316
4116
|
null,
|
|
317
|
-
|
|
4117
|
+
React__default.createElement(
|
|
318
4118
|
'p',
|
|
319
4119
|
{ className: 'd-inline-block font-weight-bold' },
|
|
320
4120
|
'Connect with us:'
|
|
321
4121
|
),
|
|
322
4122
|
' ',
|
|
323
|
-
partnerDetails.linkedin &&
|
|
4123
|
+
partnerDetails.linkedin && React__default.createElement(reactSocialIcons_1, {
|
|
324
4124
|
url: '' + partnerDetails.linkedin + (partnerDetails.linkedin.slice(-1) === '/' ? '' : '/') + 'posts/?feedView=all',
|
|
325
4125
|
target: '_blank',
|
|
326
4126
|
rel: 'noopener noreferrer',
|
|
327
4127
|
style: { height: 30, width: 30 }
|
|
328
4128
|
}),
|
|
329
|
-
(partnerDetails.twitter && partnerDetails.facebook || !partnerDetails.twitter && partnerDetails.facebook && checkIsFacebookGroup(partnerDetails.facebook)) &&
|
|
4129
|
+
(partnerDetails.twitter && partnerDetails.facebook || !partnerDetails.twitter && partnerDetails.facebook && checkIsFacebookGroup(partnerDetails.facebook)) && React__default.createElement(reactSocialIcons_1, { url: partnerDetails.facebook, target: '_blank', rel: 'noopener noreferrer', style: { height: 30, width: 30, marginLeft: '0.25rem' } })
|
|
330
4130
|
)
|
|
331
4131
|
)
|
|
332
4132
|
),
|
|
333
|
-
partnerDetails.affiliates && partnerDetails.affiliates[0] && partnerDetails.affiliates[0].slides &&
|
|
4133
|
+
partnerDetails.affiliates && partnerDetails.affiliates[0] && partnerDetails.affiliates[0].slides && React__default.createElement(
|
|
334
4134
|
'div',
|
|
335
4135
|
{ className: 'mb-4', style: { padding: '0 15px' } },
|
|
336
|
-
partnerDetails.affiliates[0].title &&
|
|
4136
|
+
partnerDetails.affiliates[0].title && React__default.createElement(
|
|
337
4137
|
'h2',
|
|
338
4138
|
{ className: 'bb-gold' },
|
|
339
4139
|
partnerDetails.affiliates[0].title
|
|
340
4140
|
),
|
|
341
|
-
|
|
4141
|
+
React__default.createElement(ImageSlider, { client: client, data: partnerDetails.affiliates[0] })
|
|
342
4142
|
),
|
|
343
|
-
features.length > 0 &&
|
|
4143
|
+
features.length > 0 && React__default.createElement(
|
|
344
4144
|
'div',
|
|
345
4145
|
{ className: ' mb-5' },
|
|
346
|
-
|
|
4146
|
+
React__default.createElement(Feature, { dataset: features, client: client })
|
|
347
4147
|
),
|
|
348
|
-
(partnerDetails.twitter || partnerDetails.facebook && !checkIsFacebookGroup(partnerDetails.facebook)) &&
|
|
4148
|
+
(partnerDetails.twitter || partnerDetails.facebook && !checkIsFacebookGroup(partnerDetails.facebook)) && React__default.createElement(
|
|
349
4149
|
'div',
|
|
350
4150
|
{ className: 'mb-5', style: { width: '100%', maxWidth: '100%', textAlign: 'center', padding: '15px', border: '2px solid #aaa', borderRadius: '15px' } },
|
|
351
|
-
partnerDetails.twitter ?
|
|
352
|
-
|
|
4151
|
+
partnerDetails.twitter ? React__default.createElement(TwitterTimelineEmbed, { sourceType: 'url', url: partnerDetails.twitter, options: { height: 400 } }) : partnerDetails.facebook && React__default.createElement(
|
|
4152
|
+
Facebook$1,
|
|
353
4153
|
{ appId: ' ' },
|
|
354
|
-
|
|
4154
|
+
React__default.createElement(Page$1, { href: partnerDetails.facebook, tabs: 'timeline', width: '500', height: '500' })
|
|
355
4155
|
)
|
|
356
4156
|
),
|
|
357
|
-
|
|
4157
|
+
React__default.createElement(
|
|
358
4158
|
'div',
|
|
359
4159
|
null,
|
|
360
|
-
posts && posts.length > 0 &&
|
|
361
|
-
|
|
4160
|
+
posts && posts.length > 0 && React__default.createElement(
|
|
4161
|
+
React__default.Fragment,
|
|
362
4162
|
null,
|
|
363
|
-
|
|
4163
|
+
React__default.createElement(
|
|
364
4164
|
'h2',
|
|
365
4165
|
{ className: 'bb-gold mb-2' },
|
|
366
4166
|
'Latest from ',
|
|
367
4167
|
partnerDetails.name
|
|
368
4168
|
),
|
|
369
|
-
|
|
4169
|
+
React__default.createElement('hr', null)
|
|
370
4170
|
),
|
|
371
|
-
|
|
4171
|
+
React__default.createElement(QueueDeckExpanded, {
|
|
372
4172
|
client: client,
|
|
373
4173
|
mapping: Settings.mapping,
|
|
374
4174
|
dataRecord: posts,
|
|
@@ -391,7 +4191,7 @@ var PartnerDetails = function PartnerDetails(_ref) {
|
|
|
391
4191
|
};
|
|
392
4192
|
|
|
393
4193
|
PartnerDetails.returnGetInitialProps = function () {
|
|
394
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(identifier, partnerPageUrl, partnerDocumentGroupID, params, currentPage, client) {
|
|
4194
|
+
var _ref2 = _asyncToGenerator$1( /*#__PURE__*/regenerator.mark(function _callee(identifier, partnerPageUrl, partnerDocumentGroupID, params, currentPage, client) {
|
|
395
4195
|
var category = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
396
4196
|
|
|
397
4197
|
var today, featureQuery, partnerQuery, taxonomyQuery, _ref3, _ref4, features, partnerDetails, taxonomyDetails, articlesQuery, articles;
|