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