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