@mjhls/mjh-framework 1.0.850-beta.3 → 1.0.850
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 +31 -30
- package/dist/cjs/AD300x250x600.js +31 -30
- package/dist/cjs/AD728x90.js +34 -33
- package/dist/cjs/ADFloatingFooter.js +33 -32
- package/dist/cjs/ADFooter.js +15 -14
- package/dist/cjs/ADGutter.js +33 -32
- package/dist/cjs/{ADInfeed-98c71bcd.js → ADInfeed-fb136f1d.js} +15 -13
- package/dist/cjs/ADSkyscraper.js +33 -32
- package/dist/cjs/ADSponsoredResources.js +33 -32
- package/dist/cjs/ADWebcast.js +33 -32
- package/dist/cjs/ADWelcome.js +34 -33
- package/dist/cjs/{ADlgInfeed-9de32585.js → ADlgInfeed-d303d27e.js} +11 -10
- package/dist/cjs/AccordionPanel.js +31 -29
- package/dist/cjs/AdSlot.js +36 -35
- package/dist/cjs/AdSlotsProvider.js +21 -19
- package/dist/cjs/AlgoliaSearch.js +1087 -1068
- package/dist/cjs/AlphabeticList.js +26 -25
- package/dist/cjs/ArticleCarousel.js +24 -23
- package/dist/cjs/ArticleProgramLandingPage.js +60 -58
- package/dist/cjs/ArticleSeriesLandingPage.js +41 -40
- package/dist/cjs/ArticleSeriesListing.js +62 -61
- package/dist/cjs/Auth.js +3652 -0
- package/dist/cjs/AuthWrapper.js +311 -269
- package/dist/cjs/{AuthorComponent-bb831b74.js → AuthorComponent-c21aac7f.js} +14 -13
- package/dist/cjs/Beam.js +8 -8
- package/dist/cjs/{BlockContent-091a991f.js → BlockContent-36e54d77.js} +56 -55
- package/dist/cjs/Breadcrumbs.js +29 -27
- package/dist/cjs/CMEDeck.js +83 -83
- package/dist/cjs/Column1.js +14 -11
- package/dist/cjs/Column2.js +36 -33
- package/dist/cjs/Column3.js +62 -59
- package/dist/cjs/ConferenceArticleCard.js +38 -37
- package/dist/cjs/ConferenceBanner-6c9e718a.js +24 -0
- package/dist/cjs/DeckContent.js +107 -103
- package/dist/cjs/DeckQueue.js +92 -88
- package/dist/cjs/{Dfp-26baccf1.js → Dfp-93399f8c.js} +35 -34
- package/dist/cjs/EventsDeck.js +159 -152
- package/dist/cjs/ExternalResources.js +81 -79
- package/dist/cjs/Feature.js +26 -24
- package/dist/cjs/ForbesHero.js +43 -42
- package/dist/cjs/GridContent.js +238 -233
- package/dist/cjs/GridHero.js +45 -44
- package/dist/cjs/GroupDeck.js +60 -59
- package/dist/cjs/HamMagazine.js +145 -140
- package/dist/cjs/Header.js +14 -12
- package/dist/cjs/Hero.js +13 -12
- package/dist/cjs/HighlightenVideo.js +18 -17
- package/dist/cjs/HorizontalArticleListing.js +73 -71
- package/dist/cjs/HorizontalHero.js +25 -24
- package/dist/cjs/IssueContentDeck.js +78 -73
- package/dist/cjs/IssueDeck.js +77 -72
- package/dist/cjs/IssueLanding.js +96 -92
- package/dist/cjs/KMTracker.js +15 -15
- package/dist/cjs/LeftNav.js +41 -39
- package/dist/cjs/MasterDeck.js +81 -80
- package/dist/cjs/MediaSeriesLanding.js +1118 -1126
- package/dist/cjs/NavDvm.js +79 -74
- package/dist/cjs/{NavFooter-76c913e3.js → NavFooter-3dcd99a8.js} +15 -14
- package/dist/cjs/NavMagazine.js +152 -147
- package/dist/cjs/NavNative.js +147 -139
- package/dist/cjs/OncliveHero.js +19 -19
- package/dist/cjs/OncliveLargeHero.js +73 -72
- package/dist/cjs/PageFilter.js +15 -14
- package/dist/cjs/PartnerDetailListing.js +109 -105
- package/dist/cjs/PdfDownload.js +9 -8
- package/dist/cjs/PopUpModal.js +21 -19
- package/dist/cjs/PubSection.js +43 -40
- package/dist/cjs/PubToc.js +16 -15
- package/dist/cjs/PublicationDeck.js +67 -62
- package/dist/cjs/PublicationLanding.js +139 -135
- package/dist/cjs/QueueDeckExpanded.js +1174 -2074
- package/dist/cjs/RecentNews.js +22 -21
- package/dist/cjs/RelatedContent.js +55 -54
- package/dist/cjs/RelatedTopicsDropdown.js +32 -29
- package/dist/cjs/RolesDeck.js +32 -27
- package/dist/cjs/Search.js +22 -18
- package/dist/cjs/Segment.js +6 -6
- package/dist/cjs/SeriesListingDeck.js +38 -38
- package/dist/cjs/{SeriesSlider-8bbc989f.js → SeriesSlider-cbab9f0f.js} +40 -39
- package/dist/cjs/SetCookie.js +1 -1
- package/dist/cjs/SideFooter.js +39 -38
- package/dist/cjs/SocialIcons.js +10 -9
- package/dist/cjs/{SocialSearchComponent-cea213aa.js → SocialSearchComponent-ecb4f972.js} +40 -36
- package/dist/cjs/SocialShare.js +31 -29
- package/dist/cjs/TaxonomyCard.js +64 -59
- package/dist/cjs/TaxonomyDescription.js +56 -54
- package/dist/cjs/TemplateNormal.js +75 -74
- package/dist/cjs/ThumbnailCard.js +23 -21
- package/dist/cjs/Ustream.js +30 -29
- package/dist/cjs/VerticalHero.js +17 -16
- package/dist/cjs/VideoProgramLandingPage.js +78 -73
- package/dist/cjs/VideoSeriesCard.js +34 -33
- package/dist/cjs/VideoSeriesFilter.js +18 -18
- package/dist/cjs/VideoSeriesLandingPage.js +51 -50
- package/dist/cjs/VideoSeriesListing.js +79 -78
- package/dist/cjs/View.js +268 -263
- package/dist/cjs/YahooHero.js +42 -41
- package/dist/cjs/YoutubeGroup.js +67 -66
- package/dist/cjs/{_is-array-754e012d.js → _is-array-6128bd56.js} +6 -6
- package/dist/cjs/{_iter-detect-60b2f026.js → _iter-detect-55a5657a.js} +8 -8
- package/dist/cjs/{_object-pie-68c5bcbc.js → _object-pie-083f2dd6.js} +4 -4
- package/dist/cjs/{_object-sap-5e74ba08.js → _object-sap-a175b4a9.js} +1 -1
- package/dist/cjs/{_object-to-array-5762f850.js → _object-to-array-8fe5a54f.js} +2 -2
- package/dist/cjs/{_to-object-329a650b.js → _to-object-6de10e57.js} +8 -8
- package/dist/cjs/{asyncToGenerator-140e5f89.js → asyncToGenerator-58c289d9.js} +32 -32
- package/dist/cjs/{brightcove-react-player-loader.es-156bd4d6.js → brightcove-react-player-loader.es-a195642e.js} +11 -9
- package/dist/cjs/{core.get-iterator-method-f62321d4.js → core.get-iterator-method-f474eacc.js} +2 -2
- package/dist/cjs/{debounce-529c8d06.js → debounce-d4a2369b.js} +2 -2
- package/dist/cjs/{define-property-f4d12f4e.js → define-property-c88be878.js} +6 -6
- package/dist/cjs/{defineProperty-55548b25.js → defineProperty-0cb76d99.js} +1 -1
- package/dist/cjs/{entities-310b46ee.js → entities-3f9d0f2f.js} +1 -1
- package/dist/cjs/{eq-bb2843ed.js → eq-5fc26c07.js} +1 -1
- package/dist/cjs/{es6.string.iterator-cc0bbaa4.js → es6.string.iterator-c2573ffd.js} +6 -6
- package/dist/cjs/{extends-0a918631.js → extends-29bdbc6d.js} +7 -7
- package/dist/cjs/faundadb.js +10 -327
- package/dist/cjs/{get-adbb11e3.js → get-5839e5b5.js} +21 -21
- package/dist/cjs/getRelatedArticle.js +445 -28
- package/dist/cjs/getRootDocGroup.js +6 -6
- package/dist/cjs/getSerializers.js +45 -44
- package/dist/cjs/{getTargeting-f1821260.js → getTargeting-faf37284.js} +12 -12
- package/dist/cjs/getTargeting.js +8 -8
- package/dist/cjs/iconBase-68959171.js +0 -3
- package/dist/cjs/{index-e2e62963.js → index-8041a4eb.js} +11 -1
- package/dist/cjs/{index-4151deb3.js → index-a67ab93e.js} +1009 -1558
- package/dist/cjs/index-bd6c9f56.js +211 -0
- package/dist/cjs/{index-96b3db50.js → index-eadd5035.js} +17 -15
- package/dist/cjs/{index-be0c82be.js → index-efca863c.js} +36 -30
- package/dist/cjs/{index-3294d3bc.js → index-f86bb269.js} +44 -45
- package/dist/cjs/{index-98e01cb9.js → index-fc2f1ca2.js} +13 -12
- package/dist/cjs/{index.es-9110add6.js → index.es-f3e47207.js} +31 -12
- package/dist/cjs/{index.esm-ff47db6f.js → index.esm-05850a2f.js} +5 -12
- package/dist/cjs/{index.esm-e32d3e8e.js → index.esm-44f3e2d0.js} +3 -6
- package/dist/cjs/{index.esm-4d410430.js → index.esm-8123cf40.js} +20 -20
- package/dist/cjs/{index.esm-90433435.js → index.esm-974f47d9.js} +6 -15
- package/dist/cjs/index.js +169 -158
- package/dist/cjs/{inherits-9953db94.js → inherits-c2065b95.js} +22 -22
- package/dist/cjs/{isSymbol-04666465.js → isSymbol-03abbdf0.js} +15 -15
- package/dist/cjs/keys-7f2c2108.js +25 -0
- package/dist/cjs/{lodash-fc2922d0.js → lodash-f0783643.js} +128 -31
- package/dist/cjs/main-025fdc78.js +973 -0
- package/dist/cjs/md5-e1ca5797.js +323 -0
- package/dist/cjs/{moment-575fe24c.js → moment-aca40de1.js} +11 -9
- package/dist/cjs/{react-social-icons-f7f48f71.js → react-social-icons-af932527.js} +28 -27
- package/dist/cjs/{slicedToArray-8f385299.js → slicedToArray-5d1bc3b3.js} +14 -14
- package/dist/cjs/{smoothscroll-5054361f.js → smoothscroll-99df7f93.js} +1 -1
- package/dist/cjs/stringify-c9ac1214.js +17 -0
- package/dist/cjs/timeDifferenceCalc.js +1 -1
- package/dist/cjs/{toConsumableArray-9a3476fe.js → toConsumableArray-ddb70795.js} +9 -9
- package/dist/cjs/{toNumber-36d1e7e5.js → toNumber-5e1fac58.js} +40 -5
- package/dist/cjs/{typeof-725500bc.js → typeof-88a668c5.js} +36 -36
- package/dist/cjs/urlFor.js +3 -3
- package/dist/cjs/{ustream-api-d092dc31.js → ustream-api-b2b9092f.js} +4 -4
- package/dist/cjs/util-6f784d85.js +576 -0
- package/dist/cjs/{visibility-sensor-ad5e3116.js → visibility-sensor-eb2c5b69.js} +7 -5
- package/dist/cjs/{web.dom.iterable-a0e279c1.js → web.dom.iterable-46657b5c.js} +3 -3
- package/dist/esm/AD.js +7 -7
- package/dist/esm/AD300x250.js +27 -27
- package/dist/esm/AD300x250x600.js +27 -27
- package/dist/esm/AD728x90.js +30 -30
- package/dist/esm/ADFloatingFooter.js +29 -29
- package/dist/esm/ADFooter.js +11 -11
- package/dist/esm/ADGutter.js +29 -29
- package/dist/esm/{ADInfeed-bbdd5398.js → ADInfeed-df562a07.js} +11 -11
- package/dist/esm/ADSkyscraper.js +29 -29
- package/dist/esm/ADSponsoredResources.js +29 -29
- package/dist/esm/ADWebcast.js +29 -29
- package/dist/esm/ADWelcome.js +30 -30
- package/dist/esm/{ADlgInfeed-4473ee3b.js → ADlgInfeed-53992119.js} +8 -8
- package/dist/esm/AccordionPanel.js +24 -24
- package/dist/esm/AdSlot.js +27 -27
- package/dist/esm/AdSlotsProvider.js +14 -14
- package/dist/esm/AlgoliaSearch.js +736 -718
- package/dist/esm/AlphabeticList.js +22 -22
- package/dist/esm/ArticleCarousel.js +20 -20
- package/dist/esm/ArticleProgramLandingPage.js +56 -55
- package/dist/esm/ArticleSeriesLandingPage.js +37 -37
- package/dist/esm/ArticleSeriesListing.js +57 -57
- package/dist/esm/Auth.js +3632 -0
- package/dist/esm/AuthWrapper.js +308 -267
- package/dist/esm/{AuthorComponent-34b16174.js → AuthorComponent-5ae7409f.js} +11 -11
- package/dist/esm/Beam.js +8 -8
- package/dist/esm/{BlockContent-e9b4ddcf.js → BlockContent-52cf21c5.js} +35 -35
- package/dist/esm/Breadcrumbs.js +17 -17
- package/dist/esm/CMEDeck.js +79 -79
- package/dist/esm/Column1.js +9 -9
- package/dist/esm/Column2.js +30 -30
- package/dist/esm/Column3.js +56 -56
- package/dist/esm/ConferenceArticleCard.js +35 -35
- package/dist/esm/{ConferenceBanner-8792ebd2.js → ConferenceBanner-9162d0ca.js} +4 -4
- package/dist/esm/DeckContent.js +98 -98
- package/dist/esm/DeckQueue.js +83 -83
- package/dist/esm/{Dfp-b7236041.js → Dfp-43f121ff.js} +22 -22
- package/dist/esm/EventsDeck.js +129 -129
- package/dist/esm/ExternalResources.js +74 -73
- package/dist/esm/Feature.js +18 -18
- package/dist/esm/ForbesHero.js +35 -35
- package/dist/esm/GridContent.js +201 -201
- package/dist/esm/GridHero.js +37 -37
- package/dist/esm/GroupDeck.js +47 -47
- package/dist/esm/HamMagazine.js +116 -116
- package/dist/esm/Header.js +8 -8
- package/dist/esm/Hero.js +10 -10
- package/dist/esm/HighlightenVideo.js +14 -14
- package/dist/esm/HorizontalArticleListing.js +69 -68
- package/dist/esm/HorizontalHero.js +22 -22
- package/dist/esm/IssueContentDeck.js +61 -61
- package/dist/esm/IssueDeck.js +65 -65
- package/dist/esm/IssueLanding.js +92 -89
- package/dist/esm/KMTracker.js +15 -15
- package/dist/esm/LeftNav.js +35 -35
- package/dist/esm/MasterDeck.js +77 -77
- package/dist/esm/MediaSeriesLanding.js +841 -852
- package/dist/esm/NavDvm.js +59 -59
- package/dist/esm/{NavFooter-e27bd93b.js → NavFooter-c29526b7.js} +12 -12
- package/dist/esm/NavMagazine.js +126 -126
- package/dist/esm/NavNative.js +116 -116
- package/dist/esm/OncliveHero.js +16 -17
- package/dist/esm/OncliveLargeHero.js +60 -60
- package/dist/esm/PageFilter.js +12 -12
- package/dist/esm/PartnerDetailListing.js +105 -102
- package/dist/esm/PdfDownload.js +6 -6
- package/dist/esm/PopUpModal.js +14 -14
- package/dist/esm/PubSection.js +39 -37
- package/dist/esm/PubToc.js +12 -12
- package/dist/esm/PublicationDeck.js +53 -53
- package/dist/esm/PublicationLanding.js +122 -122
- package/dist/esm/QueueDeckExpanded.js +1152 -2052
- package/dist/esm/RecentNews.js +19 -19
- package/dist/esm/RelatedContent.js +48 -48
- package/dist/esm/RelatedTopicsDropdown.js +21 -21
- package/dist/esm/RolesDeck.js +25 -25
- package/dist/esm/Search.js +13 -13
- package/dist/esm/Segment.js +6 -6
- package/dist/esm/SeriesListingDeck.js +32 -32
- package/dist/esm/{SeriesSlider-a866bb21.js → SeriesSlider-5c62a578.js} +31 -31
- package/dist/esm/SetCookie.js +1 -1
- package/dist/esm/SideFooter.js +34 -34
- package/dist/esm/SocialIcons.js +7 -7
- package/dist/esm/{SocialSearchComponent-03c3e869.js → SocialSearchComponent-cd38ae60.js} +30 -30
- package/dist/esm/SocialShare.js +25 -25
- package/dist/esm/TaxonomyCard.js +54 -54
- package/dist/esm/TaxonomyDescription.js +50 -49
- package/dist/esm/TemplateNormal.js +70 -70
- package/dist/esm/ThumbnailCard.js +14 -14
- package/dist/esm/Ustream.js +26 -26
- package/dist/esm/VerticalHero.js +14 -14
- package/dist/esm/VideoProgramLandingPage.js +67 -66
- package/dist/esm/VideoSeriesCard.js +26 -26
- package/dist/esm/VideoSeriesFilter.js +15 -15
- package/dist/esm/VideoSeriesLandingPage.js +42 -42
- package/dist/esm/VideoSeriesListing.js +74 -74
- package/dist/esm/View.js +248 -247
- package/dist/esm/YahooHero.js +35 -35
- package/dist/esm/YoutubeGroup.js +51 -51
- package/dist/esm/{_is-array-58e95429.js → _is-array-3e99e06e.js} +6 -6
- package/dist/esm/{_iter-detect-5d49a330.js → _iter-detect-7e5e5ce2.js} +8 -8
- package/dist/esm/{_object-pie-33c40e79.js → _object-pie-133f504a.js} +4 -4
- package/dist/esm/{_object-sap-964b6feb.js → _object-sap-f353c2a9.js} +1 -1
- package/dist/esm/{_object-to-array-7e804fce.js → _object-to-array-0f197f89.js} +2 -2
- package/dist/esm/{_to-object-a4107da3.js → _to-object-b50e61c3.js} +9 -9
- package/dist/esm/{asyncToGenerator-4877b617.js → asyncToGenerator-7f8f9219.js} +33 -33
- package/dist/esm/{brightcove-react-player-loader.es-83f53e4e.js → brightcove-react-player-loader.es-b43c695a.js} +7 -6
- package/dist/esm/{core.get-iterator-method-e1de7503.js → core.get-iterator-method-133dfacd.js} +2 -2
- package/dist/esm/{debounce-9207d8ee.js → debounce-533d9748.js} +2 -2
- package/dist/esm/{define-property-8af5f002.js → define-property-fe54dc9f.js} +6 -6
- package/dist/esm/{defineProperty-94fd8bfc.js → defineProperty-f5ff6f5a.js} +1 -1
- package/dist/esm/{entities-7cc3bf45.js → entities-932b50cf.js} +1 -1
- package/dist/esm/{eq-b470f743.js → eq-bdcbf886.js} +1 -1
- package/dist/esm/{es6.string.iterator-c990c18c.js → es6.string.iterator-bc33758b.js} +7 -7
- package/dist/esm/{extends-6f2fcc99.js → extends-60e0e1c6.js} +7 -7
- package/dist/esm/faundadb.js +8 -325
- package/dist/esm/{get-1e515072.js → get-3c308da4.js} +21 -21
- package/dist/esm/getRelatedArticle.js +445 -28
- package/dist/esm/getRootDocGroup.js +6 -6
- package/dist/esm/getSerializers.js +45 -44
- package/dist/esm/{getTargeting-bd800589.js → getTargeting-c3401fa7.js} +11 -11
- package/dist/esm/getTargeting.js +8 -8
- package/dist/esm/{index-73819142.js → index-0dbff1d1.js} +36 -30
- package/dist/esm/{index-41a678ea.js → index-2446af28.js} +6 -6
- package/dist/esm/{index-d6dc592a.js → index-27e2c06e.js} +963 -1519
- package/dist/esm/{index-5f7e79e7.js → index-35bdcc81.js} +10 -10
- package/dist/esm/{index-aaa2dae0.js → index-67e1773f.js} +11 -2
- package/dist/esm/{index-ef6d5dcf.js → index-79cfd25c.js} +44 -45
- package/dist/esm/index-db3bb315.js +207 -0
- package/dist/esm/{index.es-29c1cef5.js → index.es-c6222053.js} +28 -10
- package/dist/esm/{index.esm-29e48d38.js → index.esm-3fdda599.js} +6 -15
- package/dist/esm/{index.esm-fd746768.js → index.esm-8016b507.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 +139 -132
- package/dist/esm/{inherits-cf8dde54.js → inherits-a41fe93f.js} +19 -19
- package/dist/esm/{isSymbol-1981418f.js → isSymbol-a7e9aafe.js} +15 -15
- package/dist/esm/{keys-8eda7a5c.js → keys-7a3adabf.js} +6 -6
- package/dist/esm/{lodash-17fdfebb.js → lodash-f97fd99a.js} +128 -31
- package/dist/esm/main-b5c5aac1.js +961 -0
- package/dist/esm/md5-4e42248e.js +321 -0
- package/dist/esm/{moment-e2f9b20c.js → moment-bc12cb97.js} +11 -9
- package/dist/esm/{react-social-icons-a7d5c5c7.js → react-social-icons-91f9716f.js} +20 -20
- package/dist/esm/{slicedToArray-641f241f.js → slicedToArray-be2f7a22.js} +14 -14
- package/dist/esm/{smoothscroll-0cd4c7a6.js → smoothscroll-fa4e3f8c.js} +1 -1
- package/dist/esm/stringify-59c8f690.js +15 -0
- package/dist/esm/timeDifferenceCalc.js +1 -1
- package/dist/esm/{toConsumableArray-43aa614d.js → toConsumableArray-6d9a4616.js} +9 -9
- package/dist/esm/{toNumber-2f7a84cd.js → toNumber-5aeba6e7.js} +40 -5
- package/dist/esm/{typeof-6435ba1c.js → typeof-a286cf0c.js} +36 -36
- package/dist/esm/urlFor.js +1 -1
- package/dist/esm/{ustream-api-9a50644d.js → ustream-api-33a866b6.js} +4 -4
- package/dist/esm/util-3ab476bf.js +574 -0
- package/dist/esm/{visibility-sensor-72fd8f8b.js → visibility-sensor-f40c2564.js} +2 -2
- package/dist/esm/{web.dom.iterable-4439f05a.js → web.dom.iterable-4109ff68.js} +3 -3
- package/package.json +110 -116
- package/dist/cjs/ConferenceBanner-4a16fddc.js +0 -23
- package/dist/cjs/keys-a586b7a0.js +0 -25
- package/dist/cjs/main-02daeefe.js +0 -862
- package/dist/cjs/stringify-7c5aff47.js +0 -17
- package/dist/esm/main-e4a934b2.js +0 -851
- package/dist/esm/stringify-4330ccdc.js +0 -15
|
@@ -1,1144 +1,165 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
require('./_to-object-329a650b.js');
|
|
7
|
-
require('./es6.string.iterator-cc0bbaa4.js');
|
|
8
|
-
require('./_library-dd23b178.js');
|
|
9
|
-
require('./_iter-detect-60b2f026.js');
|
|
10
|
-
var toConsumableArray = require('./toConsumableArray-9a3476fe.js');
|
|
11
|
-
require('./core.get-iterator-method-f62321d4.js');
|
|
12
|
-
require('./_object-pie-68c5bcbc.js');
|
|
13
|
-
var _extends = require('./extends-0a918631.js');
|
|
14
|
-
require('./web.dom.iterable-a0e279c1.js');
|
|
3
|
+
var slicedToArray = require('./slicedToArray-5d1bc3b3.js');
|
|
4
|
+
var toConsumableArray = require('./toConsumableArray-ddb70795.js');
|
|
5
|
+
var _extends = require('./extends-29bdbc6d.js');
|
|
15
6
|
var React = require('react');
|
|
16
|
-
var
|
|
7
|
+
var reactBootstrap = require('react-bootstrap');
|
|
8
|
+
var urlFor = require('./urlFor.js');
|
|
9
|
+
var index_es = require('./index.es-f3e47207.js');
|
|
10
|
+
var moment = require('./moment-aca40de1.js');
|
|
11
|
+
var visibilitySensor = require('./visibility-sensor-eb2c5b69.js');
|
|
12
|
+
var index$1 = require('./index-fc2f1ca2.js');
|
|
13
|
+
var Router = require('next/router');
|
|
14
|
+
var index = require('./index-eadd5035.js');
|
|
15
|
+
var main = require('./main-025fdc78.js');
|
|
16
|
+
var entities = require('./entities-3f9d0f2f.js');
|
|
17
|
+
var ADInfeed = require('./ADInfeed-fb136f1d.js');
|
|
18
|
+
var AuthorComponent = require('./AuthorComponent-c21aac7f.js');
|
|
19
|
+
var lodash = require('./lodash-f0783643.js');
|
|
20
|
+
var ADlgInfeed = require('./ADlgInfeed-d303d27e.js');
|
|
21
|
+
var getContentCategory = require('./getContentCategory-f38a4c00.js');
|
|
22
|
+
var timeDifferenceCalc = require('./timeDifferenceCalc.js');
|
|
23
|
+
require('./_commonjsHelpers-06173234.js');
|
|
24
|
+
require('./web.dom.iterable-46657b5c.js');
|
|
25
|
+
require('./es6.string.iterator-c2573ffd.js');
|
|
26
|
+
require('./_to-object-6de10e57.js');
|
|
27
|
+
require('./core.get-iterator-method-f474eacc.js');
|
|
28
|
+
require('./_iter-detect-55a5657a.js');
|
|
29
|
+
require('./_object-pie-083f2dd6.js');
|
|
30
|
+
require('./index-efca863c.js');
|
|
31
|
+
require('react-dom');
|
|
17
32
|
require('./events-1b438fe7.js');
|
|
18
|
-
var index = require('./index-98e01cb9.js');
|
|
19
33
|
require('prop-types');
|
|
20
34
|
require('react-bootstrap/Card');
|
|
21
|
-
var moment = require('./moment-575fe24c.js');
|
|
22
|
-
var Router = require('next/router');
|
|
23
|
-
var Router__default = _interopDefault(Router);
|
|
24
|
-
require('./isSymbol-04666465.js');
|
|
25
|
-
require('./debounce-529c8d06.js');
|
|
26
|
-
require('./toNumber-36d1e7e5.js');
|
|
27
|
-
require('react-dom');
|
|
28
|
-
require('./index-be0c82be.js');
|
|
29
|
-
var urlFor = require('./urlFor.js');
|
|
30
|
-
var index$2 = require('./index-96b3db50.js');
|
|
31
|
-
var main = require('./main-02daeefe.js');
|
|
32
|
-
var entities = require('./entities-310b46ee.js');
|
|
33
|
-
var slicedToArray = require('./slicedToArray-8f385299.js');
|
|
34
|
-
require('./stringify-7c5aff47.js');
|
|
35
|
-
var asyncToGenerator = require('./asyncToGenerator-140e5f89.js');
|
|
36
|
-
require('./Segment.js');
|
|
37
|
-
require('./Beam.js');
|
|
38
35
|
require('./AdSlot.js');
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var reactPaginate = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
48
|
-
!function(e,a){module.exports=a(React__default);}(_commonjsHelpers.commonjsGlobal,(function(e){return function(e){var a={};function t(r){if(a[r])return a[r].exports;var n=a[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}return t.m=e,t.c=a,t.d=function(e,a,r){t.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:r});},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},t.t=function(e,a){if(1&a&&(e=t(e)),8&a)return e;if(4&a&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&a&&"string"!=typeof e)for(var n in e)t.d(r,n,function(a){return e[a]}.bind(null,n));return r},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},t.p="",t(t.s=4)}([function(e,a,t){e.exports=t(2)();},function(a,t){a.exports=e;},function(e,a,t){var r=t(3);function n(){}function i(){}i.resetWarningCache=n,e.exports=function(){function e(e,a,t,n,i,s){if(s!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function a(){return e}e.isRequired=e;var t={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:a,element:e,elementType:e,instanceOf:a,node:e,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:i,resetWarningCache:n};return t.PropTypes=t,t};},function(e,a,t){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";},function(e,a,t){t.r(a);var r=t(1),n=t.n(r),i=t(0),s=t.n(i);function l(){return (l=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);}return e}).apply(this,arguments)}var o=function(e){var a=e.pageClassName,t=e.pageLinkClassName,r=e.page,i=e.selected,s=e.activeClassName,o=e.activeLinkClassName,u=e.getEventListener,c=e.pageSelectedHandler,p=e.href,f=e.extraAriaContext,g=e.pageLabelBuilder,d=e.ariaLabel||"Page "+r+(f?" "+f:""),b=null;return i&&(b="page",d=e.ariaLabel||"Page "+r+" is your current page",a=void 0!==a?a+" "+s:s,void 0!==t?void 0!==o&&(t=t+" "+o):t=o),n.a.createElement("li",{className:a},n.a.createElement("a",l({role:"button",className:t,href:p,tabIndex:"0","aria-label":d,"aria-current":b,onKeyPress:c},u(c)),g(r)))};o.propTypes={pageSelectedHandler:s.a.func.isRequired,selected:s.a.bool.isRequired,pageClassName:s.a.string,pageLinkClassName:s.a.string,activeClassName:s.a.string,activeLinkClassName:s.a.string,extraAriaContext:s.a.string,href:s.a.string,ariaLabel:s.a.string,page:s.a.number.isRequired,getEventListener:s.a.func.isRequired,pageLabelBuilder:s.a.func.isRequired};var u=o;function c(){return (c=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);}return e}).apply(this,arguments)}var p=function(e){var a=e.breakLabel,t=e.breakClassName,r=e.breakLinkClassName,i=e.breakHandler,s=e.getEventListener,l=t||"break";return n.a.createElement("li",{className:l},n.a.createElement("a",c({className:r,role:"button",tabIndex:"0",onKeyPress:i},s(i)),a))};p.propTypes={breakLabel:s.a.oneOfType([s.a.string,s.a.node]),breakClassName:s.a.string,breakLinkClassName:s.a.string,breakHandler:s.a.func.isRequired,getEventListener:s.a.func.isRequired};var f=p;function g(e){return (g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(){return (d=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);}return e}).apply(this,arguments)}function b(e,a){for(var t=0;t<a.length;t++){var r=a[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r);}}function v(e,a){return (v=Object.setPrototypeOf||function(e,a){return e.__proto__=a,e})(e,a)}function m(e){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return !1}}();return function(){var t,r=C(e);if(a){var n=C(this).constructor;t=Reflect.construct(r,arguments,n);}else t=r.apply(this,arguments);return h(this,t)}}function h(e,a){return !a||"object"!==g(a)&&"function"!=typeof a?y(e):a}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e){return (C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}var k=function(e){!function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),a&&v(e,a);}(s,e);var a,t,i=m(s);function s(e){var a,t;return function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,s),P(y(a=i.call(this,e)),"handlePreviousPage",(function(e){var t=a.state.selected;e.preventDefault?e.preventDefault():e.returnValue=!1,t>0&&a.handlePageSelected(t-1,e);})),P(y(a),"handleNextPage",(function(e){var t=a.state.selected,r=a.props.pageCount;e.preventDefault?e.preventDefault():e.returnValue=!1,t<r-1&&a.handlePageSelected(t+1,e);})),P(y(a),"handlePageSelected",(function(e,t){t.preventDefault?t.preventDefault():t.returnValue=!1,a.state.selected!==e?(a.setState({selected:e}),a.callCallback(e)):a.callActiveCallback(e);})),P(y(a),"getEventListener",(function(e){return P({},a.props.eventListener,e)})),P(y(a),"handleBreakClick",(function(e,t){t.preventDefault?t.preventDefault():t.returnValue=!1;var r=a.state.selected;a.handlePageSelected(r<e?a.getForwardJump():a.getBackwardJump(),t);})),P(y(a),"callCallback",(function(e){void 0!==a.props.onPageChange&&"function"==typeof a.props.onPageChange&&a.props.onPageChange({selected:e});})),P(y(a),"callActiveCallback",(function(e){void 0!==a.props.onPageActive&&"function"==typeof a.props.onPageActive&&a.props.onPageActive({selected:e});})),P(y(a),"pagination",(function(){var e=[],t=a.props,r=t.pageRangeDisplayed,i=t.pageCount,s=t.marginPagesDisplayed,l=t.breakLabel,o=t.breakClassName,u=t.breakLinkClassName,c=a.state.selected;if(i<=r)for(var p=0;p<i;p++)e.push(a.getPageElement(p));else {var g,d,b,v=r/2,m=r-v;c>i-r/2?v=r-(m=i-c):c<r/2&&(m=r-(v=c));var h=function(e){return a.getPageElement(e)};for(g=0;g<i;g++)(d=g+1)<=s||d>i-s||g>=c-v&&g<=c+m?e.push(h(g)):l&&e[e.length-1]!==b&&(b=n.a.createElement(f,{key:g,breakLabel:l,breakClassName:o,breakLinkClassName:u,breakHandler:a.handleBreakClick.bind(null,g),getEventListener:a.getEventListener}),e.push(b));}return e})),t=e.initialPage?e.initialPage:e.forcePage?e.forcePage:0,a.state={selected:t},a}return a=s,(t=[{key:"componentDidMount",value:function(){var e=this.props,a=e.initialPage,t=e.disableInitialCallback,r=e.extraAriaContext;void 0===a||t||this.callCallback(a),r&&console.warn("DEPRECATED (react-paginate): The extraAriaContext prop is deprecated. You should now use the ariaLabelBuilder instead.");}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.forcePage&&this.props.forcePage!==e.forcePage&&this.setState({selected:this.props.forcePage});}},{key:"getForwardJump",value:function(){var e=this.state.selected,a=this.props,t=a.pageCount,r=e+a.pageRangeDisplayed;return r>=t?t-1:r}},{key:"getBackwardJump",value:function(){var e=this.state.selected-this.props.pageRangeDisplayed;return e<0?0:e}},{key:"hrefBuilder",value:function(e){var a=this.props,t=a.hrefBuilder,r=a.pageCount;if(t&&e!==this.state.selected&&e>=0&&e<r)return t(e+1)}},{key:"ariaLabelBuilder",value:function(e){var a=e===this.state.selected;if(this.props.ariaLabelBuilder&&e>=0&&e<this.props.pageCount){var t=this.props.ariaLabelBuilder(e+1,a);return this.props.extraAriaContext&&!a&&(t=t+" "+this.props.extraAriaContext),t}}},{key:"getPageElement",value:function(e){var a=this.state.selected,t=this.props,r=t.pageClassName,i=t.pageLinkClassName,s=t.activeClassName,l=t.activeLinkClassName,o=t.extraAriaContext,c=t.pageLabelBuilder;return n.a.createElement(u,{key:e,pageSelectedHandler:this.handlePageSelected.bind(null,e),selected:a===e,pageClassName:r,pageLinkClassName:i,activeClassName:s,activeLinkClassName:l,extraAriaContext:o,href:this.hrefBuilder(e),ariaLabel:this.ariaLabelBuilder(e),page:e+1,pageLabelBuilder:c,getEventListener:this.getEventListener})}},{key:"render",value:function(){var e=this.props,a=e.disabledClassName,t=e.pageCount,r=e.containerClassName,i=e.previousLabel,s=e.previousClassName,l=e.previousLinkClassName,o=e.previousAriaLabel,u=e.prevRel,c=e.nextLabel,p=e.nextClassName,f=e.nextLinkClassName,g=e.nextAriaLabel,b=e.nextRel,v=this.state.selected,m=s+(0===v?" ".concat(a):""),h=p+(v===t-1?" ".concat(a):""),y=0===v?"true":"false",C=v===t-1?"true":"false";return n.a.createElement("ul",{className:r},n.a.createElement("li",{className:m},n.a.createElement("a",d({className:l,href:this.hrefBuilder(v-1),tabIndex:"0",role:"button",onKeyPress:this.handlePreviousPage,"aria-disabled":y,"aria-label":o,rel:u},this.getEventListener(this.handlePreviousPage)),i)),this.pagination(),n.a.createElement("li",{className:h},n.a.createElement("a",d({className:f,href:this.hrefBuilder(v+1),tabIndex:"0",role:"button",onKeyPress:this.handleNextPage,"aria-disabled":C,"aria-label":g,rel:b},this.getEventListener(this.handleNextPage)),c)))}}])&&b(a.prototype,t),s}(r.Component);P(k,"propTypes",{pageCount:s.a.number.isRequired,pageRangeDisplayed:s.a.number.isRequired,marginPagesDisplayed:s.a.number.isRequired,previousLabel:s.a.node,previousAriaLabel:s.a.string,prevRel:s.a.string,nextLabel:s.a.node,nextAriaLabel:s.a.string,nextRel:s.a.string,breakLabel:s.a.oneOfType([s.a.string,s.a.node]),hrefBuilder:s.a.func,onPageChange:s.a.func,onPageActive:s.a.func,initialPage:s.a.number,forcePage:s.a.number,disableInitialCallback:s.a.bool,containerClassName:s.a.string,pageClassName:s.a.string,pageLinkClassName:s.a.string,pageLabelBuilder:s.a.func,activeClassName:s.a.string,activeLinkClassName:s.a.string,previousClassName:s.a.string,nextClassName:s.a.string,previousLinkClassName:s.a.string,nextLinkClassName:s.a.string,disabledClassName:s.a.string,breakClassName:s.a.string,breakLinkClassName:s.a.string,extraAriaContext:s.a.string,ariaLabelBuilder:s.a.func,eventListener:s.a.string}),P(k,"defaultProps",{pageCount:10,pageRangeDisplayed:2,marginPagesDisplayed:3,activeClassName:"selected",previousLabel:"Previous",previousClassName:"previous",previousAriaLabel:"Previous page",prevRel:"prev",nextLabel:"Next",nextClassName:"next",nextAriaLabel:"Next page",nextRel:"next",breakLabel:"...",disabledClassName:"disabled",disableInitialCallback:!1,pageLabelBuilder:function(e){return e},eventListener:"onClick"});a.default=k;}])}));
|
|
49
|
-
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
var ReactPaginate = _commonjsHelpers.unwrapExports(reactPaginate);
|
|
53
|
-
var reactPaginate_1 = reactPaginate.ReactPaginate;
|
|
36
|
+
require('./debounce-d4a2369b.js');
|
|
37
|
+
require('./isSymbol-03abbdf0.js');
|
|
38
|
+
require('./toNumber-5e1fac58.js');
|
|
39
|
+
require('./Beam.js');
|
|
40
|
+
require('./stringify-c9ac1214.js');
|
|
41
|
+
require('./asyncToGenerator-58c289d9.js');
|
|
42
|
+
require('./_library-dd23b178.js');
|
|
43
|
+
require('./Segment.js');
|
|
54
44
|
|
|
55
|
-
|
|
45
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
56
46
|
|
|
57
|
-
|
|
58
|
-
var ctor, len;
|
|
59
|
-
if (foo === bar) return true;
|
|
47
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
60
48
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
49
|
+
var renderCardImage = function renderCardImage(row, client) {
|
|
50
|
+
var imageHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
51
|
+
var imageWidth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
52
|
+
var imageMaxHeight = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
53
|
+
var imageFit = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
|
|
64
54
|
|
|
65
|
-
|
|
66
|
-
if ((len=foo.length) === bar.length) {
|
|
67
|
-
while (len-- && dequal(foo[len], bar[len]));
|
|
68
|
-
}
|
|
69
|
-
return len === -1;
|
|
70
|
-
}
|
|
55
|
+
var url = urlFor({ client: client, source: row.thumbnail, imageHeight: imageHeight, imageWidth: imageWidth, imageMaxHeight: imageMaxHeight, imageFit: imageFit });
|
|
71
56
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
for (ctor in foo) {
|
|
75
|
-
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
|
|
76
|
-
if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
|
|
77
|
-
}
|
|
78
|
-
return Object.keys(bar).length === len;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
57
|
+
return url;
|
|
58
|
+
};
|
|
81
59
|
|
|
82
|
-
|
|
83
|
-
|
|
60
|
+
var loadMore = function loadMore(values, setValues, itemsPerPage) {
|
|
61
|
+
console.log('Values:::', values);
|
|
62
|
+
setValues({
|
|
63
|
+
page: values.page + 1,
|
|
64
|
+
from: values.from + itemsPerPage,
|
|
65
|
+
to: values.to + itemsPerPage
|
|
66
|
+
});
|
|
67
|
+
};
|
|
84
68
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
function hash(args) {
|
|
94
|
-
if (!args.length)
|
|
95
|
-
return '';
|
|
96
|
-
var key = 'arg';
|
|
97
|
-
for (var i = 0; i < args.length; ++i) {
|
|
98
|
-
if (args[i] === null) {
|
|
99
|
-
key += '@null';
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
var _hash = void 0;
|
|
103
|
-
if (typeof args[i] !== 'object' && typeof args[i] !== 'function') {
|
|
104
|
-
// need to consider the case that args[i] is a string:
|
|
105
|
-
// args[i] _hash
|
|
106
|
-
// "undefined" -> '"undefined"'
|
|
107
|
-
// undefined -> 'undefined'
|
|
108
|
-
// 123 -> '123'
|
|
109
|
-
// "null" -> '"null"'
|
|
110
|
-
if (typeof args[i] === 'string') {
|
|
111
|
-
_hash = '"' + args[i] + '"';
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
_hash = String(args[i]);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
if (!table.has(args[i])) {
|
|
119
|
-
_hash = counter;
|
|
120
|
-
table.set(args[i], counter++);
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
_hash = table.get(args[i]);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
key += '@' + _hash;
|
|
69
|
+
var loadData = function loadData(values, query, client, params, setData, setScrolling, setLastDataSize, pointer, pointerArray) {
|
|
70
|
+
params = _extends._extends({}, params, {
|
|
71
|
+
from: values.from,
|
|
72
|
+
to: values.to
|
|
73
|
+
});
|
|
74
|
+
client.fetch(query, params).then(function (dataArr) {
|
|
75
|
+
if (pointer && pointerArray) {
|
|
76
|
+
dataArr = dataArr[pointerArray][pointer];
|
|
127
77
|
}
|
|
128
|
-
return key;
|
|
129
|
-
}
|
|
130
78
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if (initialData === void 0) { initialData = {}; }
|
|
134
|
-
this.cache = new Map(Object.entries(initialData));
|
|
135
|
-
this.subs = [];
|
|
79
|
+
if (!dataArr) {
|
|
80
|
+
dataArr = [];
|
|
136
81
|
}
|
|
137
|
-
Cache.prototype.get = function (key) {
|
|
138
|
-
var _key = this.serializeKey(key)[0];
|
|
139
|
-
return this.cache.get(_key);
|
|
140
|
-
};
|
|
141
|
-
Cache.prototype.set = function (key, value) {
|
|
142
|
-
var _key = this.serializeKey(key)[0];
|
|
143
|
-
this.cache.set(_key, value);
|
|
144
|
-
this.notify();
|
|
145
|
-
};
|
|
146
|
-
Cache.prototype.keys = function () {
|
|
147
|
-
return Array.from(this.cache.keys());
|
|
148
|
-
};
|
|
149
|
-
Cache.prototype.has = function (key) {
|
|
150
|
-
var _key = this.serializeKey(key)[0];
|
|
151
|
-
return this.cache.has(_key);
|
|
152
|
-
};
|
|
153
|
-
Cache.prototype.clear = function () {
|
|
154
|
-
this.cache.clear();
|
|
155
|
-
this.notify();
|
|
156
|
-
};
|
|
157
|
-
Cache.prototype.delete = function (key) {
|
|
158
|
-
var _key = this.serializeKey(key)[0];
|
|
159
|
-
this.cache.delete(_key);
|
|
160
|
-
this.notify();
|
|
161
|
-
};
|
|
162
|
-
// TODO: introduce namespace for the cache
|
|
163
|
-
Cache.prototype.serializeKey = function (key) {
|
|
164
|
-
var args = null;
|
|
165
|
-
if (typeof key === 'function') {
|
|
166
|
-
try {
|
|
167
|
-
key = key();
|
|
168
|
-
}
|
|
169
|
-
catch (err) {
|
|
170
|
-
// dependencies not ready
|
|
171
|
-
key = '';
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
if (Array.isArray(key)) {
|
|
175
|
-
// args array
|
|
176
|
-
args = key;
|
|
177
|
-
key = hash(key);
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
// convert null to ''
|
|
181
|
-
key = String(key || '');
|
|
182
|
-
}
|
|
183
|
-
var errorKey = key ? 'err@' + key : '';
|
|
184
|
-
var isValidatingKey = key ? 'validating@' + key : '';
|
|
185
|
-
return [key, args, errorKey, isValidatingKey];
|
|
186
|
-
};
|
|
187
|
-
Cache.prototype.subscribe = function (listener) {
|
|
188
|
-
var _this = this;
|
|
189
|
-
if (typeof listener !== 'function') {
|
|
190
|
-
throw new Error('Expected the listener to be a function.');
|
|
191
|
-
}
|
|
192
|
-
var isSubscribed = true;
|
|
193
|
-
this.subs.push(listener);
|
|
194
|
-
return function () {
|
|
195
|
-
if (!isSubscribed)
|
|
196
|
-
return;
|
|
197
|
-
isSubscribed = false;
|
|
198
|
-
var index = _this.subs.indexOf(listener);
|
|
199
|
-
if (index > -1) {
|
|
200
|
-
_this.subs[index] = _this.subs[_this.subs.length - 1];
|
|
201
|
-
_this.subs.length--;
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
};
|
|
205
|
-
// Notify Cache subscribers about a change in the cache
|
|
206
|
-
Cache.prototype.notify = function () {
|
|
207
|
-
for (var _i = 0, _a = this.subs; _i < _a.length; _i++) {
|
|
208
|
-
var listener = _a[_i];
|
|
209
|
-
listener();
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
return Cache;
|
|
213
|
-
}());
|
|
214
82
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
return true;
|
|
231
|
-
};
|
|
232
|
-
var fetcher = function (url) { return fetch(url).then(function (res) { return res.json(); }); };
|
|
233
|
-
var registerOnFocus = function (cb) {
|
|
234
|
-
if (typeof window !== 'undefined' &&
|
|
235
|
-
window.addEventListener !== undefined &&
|
|
236
|
-
typeof document !== 'undefined' &&
|
|
237
|
-
document.addEventListener !== undefined) {
|
|
238
|
-
// focus revalidate
|
|
239
|
-
document.addEventListener('visibilitychange', function () { return cb(); }, false);
|
|
240
|
-
window.addEventListener('focus', function () { return cb(); }, false);
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
var registerOnReconnect = function (cb) {
|
|
244
|
-
if (typeof window !== 'undefined' && window.addEventListener !== undefined) {
|
|
245
|
-
// reconnect revalidate
|
|
246
|
-
window.addEventListener('online', function () {
|
|
247
|
-
online = true;
|
|
248
|
-
cb();
|
|
249
|
-
}, false);
|
|
250
|
-
// nothing to revalidate, just update the status
|
|
251
|
-
window.addEventListener('offline', function () { return (online = false); }, false);
|
|
83
|
+
dataArr = dataArr.map(function (item) {
|
|
84
|
+
return _extends._extends({}, item, {
|
|
85
|
+
pageNumber: values.page
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
if (dataArr.length > 0) {
|
|
90
|
+
setData(function (prevData) {
|
|
91
|
+
return [].concat(toConsumableArray._toConsumableArray(prevData), toConsumableArray._toConsumableArray(dataArr));
|
|
92
|
+
});
|
|
93
|
+
setLastDataSize(dataArr.length);
|
|
94
|
+
setScrolling(true);
|
|
95
|
+
} else {
|
|
96
|
+
setLastDataSize(0);
|
|
97
|
+
setScrolling(false);
|
|
252
98
|
}
|
|
253
|
-
};
|
|
254
|
-
var webPreset = {
|
|
255
|
-
isOnline: isOnline,
|
|
256
|
-
isDocumentVisible: isDocumentVisible,
|
|
257
|
-
fetcher: fetcher,
|
|
258
|
-
registerOnFocus: registerOnFocus,
|
|
259
|
-
registerOnReconnect: registerOnReconnect
|
|
99
|
+
});
|
|
260
100
|
};
|
|
261
101
|
|
|
262
|
-
var
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}
|
|
269
|
-
return t;
|
|
270
|
-
};
|
|
271
|
-
return __assign.apply(this, arguments);
|
|
272
|
-
};
|
|
273
|
-
// cache
|
|
274
|
-
var cache = new Cache();
|
|
275
|
-
// error retry
|
|
276
|
-
function onErrorRetry(_, __, config, revalidate, opts) {
|
|
277
|
-
if (!config.isDocumentVisible()) {
|
|
278
|
-
// if it's hidden, stop
|
|
279
|
-
// it will auto revalidate when focus
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
if (typeof config.errorRetryCount === 'number' &&
|
|
283
|
-
opts.retryCount > config.errorRetryCount) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
// exponential backoff
|
|
287
|
-
var count = Math.min(opts.retryCount, 8);
|
|
288
|
-
var timeout = ~~((Math.random() + 0.5) * (1 << count)) * config.errorRetryInterval;
|
|
289
|
-
setTimeout(revalidate, timeout, opts);
|
|
290
|
-
}
|
|
291
|
-
// client side: need to adjust the config
|
|
292
|
-
// based on the browser status
|
|
293
|
-
// slow connection (<= 70Kbps)
|
|
294
|
-
var slowConnection = typeof window !== 'undefined' &&
|
|
295
|
-
// @ts-ignore
|
|
296
|
-
navigator['connection'] &&
|
|
297
|
-
// @ts-ignore
|
|
298
|
-
['slow-2g', '2g'].indexOf(navigator['connection'].effectiveType) !== -1;
|
|
299
|
-
// config
|
|
300
|
-
var defaultConfig = __assign({
|
|
301
|
-
// events
|
|
302
|
-
onLoadingSlow: function () { }, onSuccess: function () { }, onError: function () { }, onErrorRetry: onErrorRetry, errorRetryInterval: (slowConnection ? 10 : 5) * 1000, focusThrottleInterval: 5 * 1000, dedupingInterval: 2 * 1000, loadingTimeout: (slowConnection ? 5 : 3) * 1000, refreshInterval: 0, revalidateOnFocus: true, revalidateOnReconnect: true, refreshWhenHidden: false, refreshWhenOffline: false, shouldRetryOnError: true, suspense: false, compare: dequal, isPaused: function () { return false; } }, webPreset);
|
|
102
|
+
var changePageNumber = function changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, itemIndex) {
|
|
103
|
+
if (seoPaginate) {
|
|
104
|
+
var path = router.asPath;
|
|
105
|
+
var qrIndex = path.indexOf('?');
|
|
106
|
+
var pathname = router.pathname;
|
|
107
|
+
var queryString = '';
|
|
303
108
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
!!(typeof Deno !== 'undefined' && Deno && Deno.version && Deno.version.deno);
|
|
307
|
-
// polyfill for requestAnimationFrame
|
|
308
|
-
var rAF = IS_SERVER
|
|
309
|
-
? null
|
|
310
|
-
: window['requestAnimationFrame']
|
|
311
|
-
? function (f) { return window['requestAnimationFrame'](f); }
|
|
312
|
-
: function (f) { return setTimeout(f, 1); };
|
|
313
|
-
// React currently throws a warning when using useLayoutEffect on the server.
|
|
314
|
-
// To get around it, we can conditionally useEffect on the server (no-op) and
|
|
315
|
-
// useLayoutEffect in the browser.
|
|
316
|
-
var useIsomorphicLayoutEffect = IS_SERVER ? React.useEffect : React.useLayoutEffect;
|
|
109
|
+
if (qrIndex > 0) {
|
|
110
|
+
path = path.substring(1, qrIndex);
|
|
317
111
|
|
|
318
|
-
var
|
|
319
|
-
|
|
112
|
+
var partialQS = router.asPath.substring(qrIndex + 1);
|
|
113
|
+
var partialQSArr = partialQS.split('&');
|
|
320
114
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
};
|
|
330
|
-
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
331
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
332
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
333
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
334
|
-
function step(op) {
|
|
335
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
336
|
-
while (_) try {
|
|
337
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
338
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
339
|
-
switch (op[0]) {
|
|
340
|
-
case 0: case 1: t = op; break;
|
|
341
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
342
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
343
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
344
|
-
default:
|
|
345
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
346
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
347
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
348
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
349
|
-
if (t[2]) _.ops.pop();
|
|
350
|
-
_.trys.pop(); continue;
|
|
351
|
-
}
|
|
352
|
-
op = body.call(thisArg, _);
|
|
353
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
354
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
355
|
-
}
|
|
356
|
-
};
|
|
357
|
-
// global state managers
|
|
358
|
-
var CONCURRENT_PROMISES = {};
|
|
359
|
-
var CONCURRENT_PROMISES_TS = {};
|
|
360
|
-
var FOCUS_REVALIDATORS = {};
|
|
361
|
-
var RECONNECT_REVALIDATORS = {};
|
|
362
|
-
var CACHE_REVALIDATORS = {};
|
|
363
|
-
var MUTATION_TS = {};
|
|
364
|
-
var MUTATION_END_TS = {};
|
|
365
|
-
// generate strictly increasing timestamps
|
|
366
|
-
var now = (function () {
|
|
367
|
-
var ts = 0;
|
|
368
|
-
return function () { return ++ts; };
|
|
369
|
-
})();
|
|
370
|
-
// setup DOM events listeners for `focus` and `reconnect` actions
|
|
371
|
-
if (!IS_SERVER) {
|
|
372
|
-
var revalidate_1 = function (revalidators) {
|
|
373
|
-
if (!defaultConfig.isDocumentVisible() || !defaultConfig.isOnline())
|
|
374
|
-
return;
|
|
375
|
-
for (var key in revalidators) {
|
|
376
|
-
if (revalidators[key][0])
|
|
377
|
-
revalidators[key][0]();
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
|
-
if (typeof defaultConfig.registerOnFocus === 'function') {
|
|
381
|
-
defaultConfig.registerOnFocus(function () { return revalidate_1(FOCUS_REVALIDATORS); });
|
|
382
|
-
}
|
|
383
|
-
if (typeof defaultConfig.registerOnReconnect === 'function') {
|
|
384
|
-
defaultConfig.registerOnReconnect(function () { return revalidate_1(RECONNECT_REVALIDATORS); });
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
var trigger = function (_key, shouldRevalidate) {
|
|
388
|
-
if (shouldRevalidate === void 0) { shouldRevalidate = true; }
|
|
389
|
-
// we are ignoring the second argument which correspond to the arguments
|
|
390
|
-
// the fetcher will receive when key is an array
|
|
391
|
-
var _a = cache.serializeKey(_key), key = _a[0], keyErr = _a[2], keyValidating = _a[3];
|
|
392
|
-
if (!key)
|
|
393
|
-
return Promise.resolve();
|
|
394
|
-
var updaters = CACHE_REVALIDATORS[key];
|
|
395
|
-
if (key && updaters) {
|
|
396
|
-
var currentData = cache.get(key);
|
|
397
|
-
var currentError = cache.get(keyErr);
|
|
398
|
-
var currentIsValidating = cache.get(keyValidating);
|
|
399
|
-
var promises = [];
|
|
400
|
-
for (var i = 0; i < updaters.length; ++i) {
|
|
401
|
-
promises.push(updaters[i](shouldRevalidate, currentData, currentError, currentIsValidating, i > 0));
|
|
402
|
-
}
|
|
403
|
-
// return new updated value
|
|
404
|
-
return Promise.all(promises).then(function () { return cache.get(key); });
|
|
405
|
-
}
|
|
406
|
-
return Promise.resolve(cache.get(key));
|
|
407
|
-
};
|
|
408
|
-
var broadcastState = function (key, data, error, isValidating) {
|
|
409
|
-
var updaters = CACHE_REVALIDATORS[key];
|
|
410
|
-
if (key && updaters) {
|
|
411
|
-
for (var i = 0; i < updaters.length; ++i) {
|
|
412
|
-
updaters[i](false, data, error, isValidating);
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
var mutate = function (_key, _data, shouldRevalidate) {
|
|
417
|
-
if (shouldRevalidate === void 0) { shouldRevalidate = true; }
|
|
418
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
419
|
-
var _a, key, keyErr, beforeMutationTs, beforeConcurrentPromisesTs, data, error, isAsyncMutation, err_1, shouldAbort, updaters, promises, i;
|
|
420
|
-
return __generator(this, function (_b) {
|
|
421
|
-
switch (_b.label) {
|
|
422
|
-
case 0:
|
|
423
|
-
_a = cache.serializeKey(_key), key = _a[0], keyErr = _a[2];
|
|
424
|
-
if (!key)
|
|
425
|
-
return [2 /*return*/];
|
|
426
|
-
// if there is no new data to update, let's just revalidate the key
|
|
427
|
-
if (typeof _data === 'undefined')
|
|
428
|
-
return [2 /*return*/, trigger(_key, shouldRevalidate)
|
|
429
|
-
// update global timestamps
|
|
430
|
-
];
|
|
431
|
-
// update global timestamps
|
|
432
|
-
MUTATION_TS[key] = now() - 1;
|
|
433
|
-
MUTATION_END_TS[key] = 0;
|
|
434
|
-
beforeMutationTs = MUTATION_TS[key];
|
|
435
|
-
beforeConcurrentPromisesTs = CONCURRENT_PROMISES_TS[key];
|
|
436
|
-
isAsyncMutation = false;
|
|
437
|
-
if (_data && typeof _data === 'function') {
|
|
438
|
-
// `_data` is a function, call it passing current cache value
|
|
439
|
-
try {
|
|
440
|
-
_data = _data(cache.get(key));
|
|
441
|
-
}
|
|
442
|
-
catch (err) {
|
|
443
|
-
// if `_data` function throws an error synchronously, it shouldn't be cached
|
|
444
|
-
_data = undefined;
|
|
445
|
-
error = err;
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
if (!(_data && typeof _data.then === 'function')) return [3 /*break*/, 5];
|
|
449
|
-
// `_data` is a promise
|
|
450
|
-
isAsyncMutation = true;
|
|
451
|
-
_b.label = 1;
|
|
452
|
-
case 1:
|
|
453
|
-
_b.trys.push([1, 3, , 4]);
|
|
454
|
-
return [4 /*yield*/, _data];
|
|
455
|
-
case 2:
|
|
456
|
-
data = _b.sent();
|
|
457
|
-
return [3 /*break*/, 4];
|
|
458
|
-
case 3:
|
|
459
|
-
err_1 = _b.sent();
|
|
460
|
-
error = err_1;
|
|
461
|
-
return [3 /*break*/, 4];
|
|
462
|
-
case 4: return [3 /*break*/, 6];
|
|
463
|
-
case 5:
|
|
464
|
-
data = _data;
|
|
465
|
-
_b.label = 6;
|
|
466
|
-
case 6:
|
|
467
|
-
shouldAbort = function () {
|
|
468
|
-
// check if other mutations have occurred since we've started this mutation
|
|
469
|
-
if (beforeMutationTs !== MUTATION_TS[key] ||
|
|
470
|
-
beforeConcurrentPromisesTs !== CONCURRENT_PROMISES_TS[key]) {
|
|
471
|
-
if (error)
|
|
472
|
-
throw error;
|
|
473
|
-
return true;
|
|
474
|
-
}
|
|
475
|
-
};
|
|
476
|
-
// if there's a race we don't update cache or broadcast change, just return the data
|
|
477
|
-
if (shouldAbort())
|
|
478
|
-
return [2 /*return*/, data];
|
|
479
|
-
if (typeof data !== 'undefined') {
|
|
480
|
-
// update cached data
|
|
481
|
-
cache.set(key, data);
|
|
482
|
-
}
|
|
483
|
-
// always update or reset the error
|
|
484
|
-
cache.set(keyErr, error);
|
|
485
|
-
// reset the timestamp to mark the mutation has ended
|
|
486
|
-
MUTATION_END_TS[key] = now() - 1;
|
|
487
|
-
if (!isAsyncMutation) {
|
|
488
|
-
// we skip broadcasting if there's another mutation happened synchronously
|
|
489
|
-
if (shouldAbort())
|
|
490
|
-
return [2 /*return*/, data];
|
|
491
|
-
}
|
|
492
|
-
updaters = CACHE_REVALIDATORS[key];
|
|
493
|
-
if (updaters) {
|
|
494
|
-
promises = [];
|
|
495
|
-
for (i = 0; i < updaters.length; ++i) {
|
|
496
|
-
promises.push(updaters[i](!!shouldRevalidate, data, error, undefined, i > 0));
|
|
497
|
-
}
|
|
498
|
-
// return new updated value
|
|
499
|
-
return [2 /*return*/, Promise.all(promises).then(function () {
|
|
500
|
-
if (error)
|
|
501
|
-
throw error;
|
|
502
|
-
return cache.get(key);
|
|
503
|
-
})];
|
|
504
|
-
}
|
|
505
|
-
// throw error or return data to be used by caller of mutate
|
|
506
|
-
if (error)
|
|
507
|
-
throw error;
|
|
508
|
-
return [2 /*return*/, data];
|
|
509
|
-
}
|
|
510
|
-
});
|
|
511
|
-
});
|
|
512
|
-
};
|
|
513
|
-
function useSWR() {
|
|
514
|
-
var _this = this;
|
|
515
|
-
var args = [];
|
|
516
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
517
|
-
args[_i] = arguments[_i];
|
|
518
|
-
}
|
|
519
|
-
var _key = args[0];
|
|
520
|
-
var config = Object.assign({}, defaultConfig, React.useContext(SWRConfigContext), args.length > 2
|
|
521
|
-
? args[2]
|
|
522
|
-
: args.length === 2 && typeof args[1] === 'object'
|
|
523
|
-
? args[1]
|
|
524
|
-
: {});
|
|
525
|
-
// in typescript args.length > 2 is not same as args.lenth === 3
|
|
526
|
-
// we do a safe type assertion here
|
|
527
|
-
// args.length === 3
|
|
528
|
-
var fn = (args.length > 2
|
|
529
|
-
? args[1]
|
|
530
|
-
: args.length === 2 && typeof args[1] === 'function'
|
|
531
|
-
? args[1]
|
|
532
|
-
: /**
|
|
533
|
-
pass fn as null will disable revalidate
|
|
534
|
-
https://paco.sh/blog/shared-hook-state-with-swr
|
|
535
|
-
*/
|
|
536
|
-
args[1] === null
|
|
537
|
-
? args[1]
|
|
538
|
-
: config.fetcher);
|
|
539
|
-
// we assume `key` as the identifier of the request
|
|
540
|
-
// `key` can change but `fn` shouldn't
|
|
541
|
-
// (because `revalidate` only depends on `key`)
|
|
542
|
-
// `keyErr` is the cache key for error objects
|
|
543
|
-
var _a = cache.serializeKey(_key), key = _a[0], fnArgs = _a[1], keyErr = _a[2], keyValidating = _a[3];
|
|
544
|
-
var configRef = React.useRef(config);
|
|
545
|
-
useIsomorphicLayoutEffect(function () {
|
|
546
|
-
configRef.current = config;
|
|
547
|
-
});
|
|
548
|
-
var willRevalidateOnMount = function () {
|
|
549
|
-
return (config.revalidateOnMount ||
|
|
550
|
-
(!config.initialData && config.revalidateOnMount === undefined));
|
|
551
|
-
};
|
|
552
|
-
var resolveData = function () {
|
|
553
|
-
var cachedData = cache.get(key);
|
|
554
|
-
return typeof cachedData === 'undefined' ? config.initialData : cachedData;
|
|
555
|
-
};
|
|
556
|
-
var resolveIsValidating = function () {
|
|
557
|
-
return !!cache.get(keyValidating) || (key && willRevalidateOnMount());
|
|
558
|
-
};
|
|
559
|
-
var initialData = resolveData();
|
|
560
|
-
var initialError = cache.get(keyErr);
|
|
561
|
-
var initialIsValidating = resolveIsValidating();
|
|
562
|
-
// if a state is accessed (data, error or isValidating),
|
|
563
|
-
// we add the state to dependencies so if the state is
|
|
564
|
-
// updated in the future, we can trigger a rerender
|
|
565
|
-
var stateDependencies = React.useRef({
|
|
566
|
-
data: false,
|
|
567
|
-
error: false,
|
|
568
|
-
isValidating: false
|
|
569
|
-
});
|
|
570
|
-
var stateRef = React.useRef({
|
|
571
|
-
data: initialData,
|
|
572
|
-
error: initialError,
|
|
573
|
-
isValidating: initialIsValidating
|
|
574
|
-
});
|
|
575
|
-
// display the data label in the React DevTools next to SWR hooks
|
|
576
|
-
React.useDebugValue(stateRef.current.data);
|
|
577
|
-
var rerender = React.useState({})[1];
|
|
578
|
-
var dispatch = React.useCallback(function (payload) {
|
|
579
|
-
var shouldUpdateState = false;
|
|
580
|
-
for (var k in payload) {
|
|
581
|
-
// @ts-ignore
|
|
582
|
-
if (stateRef.current[k] === payload[k]) {
|
|
583
|
-
continue;
|
|
584
|
-
}
|
|
585
|
-
// @ts-ignore
|
|
586
|
-
stateRef.current[k] = payload[k];
|
|
587
|
-
// @ts-ignore
|
|
588
|
-
if (stateDependencies.current[k]) {
|
|
589
|
-
shouldUpdateState = true;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
if (shouldUpdateState) {
|
|
593
|
-
// if component is unmounted, should skip rerender
|
|
594
|
-
// if component is not mounted, should skip rerender
|
|
595
|
-
if (unmountedRef.current || !initialMountedRef.current)
|
|
596
|
-
return;
|
|
597
|
-
rerender({});
|
|
598
|
-
}
|
|
599
|
-
},
|
|
600
|
-
// config.suspense isn't allowed to change during the lifecycle
|
|
601
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
602
|
-
[]);
|
|
603
|
-
// error ref inside revalidate (is last request errored?)
|
|
604
|
-
var unmountedRef = React.useRef(false);
|
|
605
|
-
var keyRef = React.useRef(key);
|
|
606
|
-
// check if component is mounted in suspense mode
|
|
607
|
-
var initialMountedRef = React.useRef(false);
|
|
608
|
-
// do unmount check for callbacks
|
|
609
|
-
var eventsCallback = React.useCallback(function (event) {
|
|
610
|
-
var _a;
|
|
611
|
-
var params = [];
|
|
612
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
613
|
-
params[_i - 1] = arguments[_i];
|
|
614
|
-
}
|
|
615
|
-
if (unmountedRef.current)
|
|
616
|
-
return;
|
|
617
|
-
if (!initialMountedRef.current)
|
|
618
|
-
return;
|
|
619
|
-
if (key !== keyRef.current)
|
|
620
|
-
return;
|
|
621
|
-
// @ts-ignore
|
|
622
|
-
(_a = configRef.current)[event].apply(_a, params);
|
|
623
|
-
}, [key]);
|
|
624
|
-
var boundMutate = React.useCallback(function (data, shouldRevalidate) {
|
|
625
|
-
return mutate(keyRef.current, data, shouldRevalidate);
|
|
626
|
-
}, []);
|
|
627
|
-
var addRevalidator = function (revalidators, callback) {
|
|
628
|
-
if (!revalidators[key]) {
|
|
629
|
-
revalidators[key] = [callback];
|
|
630
|
-
}
|
|
631
|
-
else {
|
|
632
|
-
revalidators[key].push(callback);
|
|
633
|
-
}
|
|
634
|
-
return function () {
|
|
635
|
-
var keyedRevalidators = revalidators[key];
|
|
636
|
-
var index = keyedRevalidators.indexOf(callback);
|
|
637
|
-
if (index >= 0) {
|
|
638
|
-
// O(1): faster than splice
|
|
639
|
-
keyedRevalidators[index] =
|
|
640
|
-
keyedRevalidators[keyedRevalidators.length - 1];
|
|
641
|
-
keyedRevalidators.pop();
|
|
642
|
-
}
|
|
643
|
-
};
|
|
644
|
-
};
|
|
645
|
-
// start a revalidation
|
|
646
|
-
var revalidate = React.useCallback(function (revalidateOpts) {
|
|
647
|
-
if (revalidateOpts === void 0) { revalidateOpts = {}; }
|
|
648
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
649
|
-
var _a, retryCount, _b, dedupe, loading, shouldDeduping, newData, startAt, newState, err_2;
|
|
650
|
-
return __generator(this, function (_c) {
|
|
651
|
-
switch (_c.label) {
|
|
652
|
-
case 0:
|
|
653
|
-
if (!key || !fn)
|
|
654
|
-
return [2 /*return*/, false];
|
|
655
|
-
if (unmountedRef.current)
|
|
656
|
-
return [2 /*return*/, false];
|
|
657
|
-
if (configRef.current.isPaused())
|
|
658
|
-
return [2 /*return*/, false];
|
|
659
|
-
_a = revalidateOpts.retryCount, retryCount = _a === void 0 ? 0 : _a, _b = revalidateOpts.dedupe, dedupe = _b === void 0 ? false : _b;
|
|
660
|
-
loading = true;
|
|
661
|
-
shouldDeduping = typeof CONCURRENT_PROMISES[key] !== 'undefined' && dedupe;
|
|
662
|
-
_c.label = 1;
|
|
663
|
-
case 1:
|
|
664
|
-
_c.trys.push([1, 6, , 7]);
|
|
665
|
-
dispatch({
|
|
666
|
-
isValidating: true
|
|
667
|
-
});
|
|
668
|
-
cache.set(keyValidating, true);
|
|
669
|
-
if (!shouldDeduping) {
|
|
670
|
-
// also update other hooks
|
|
671
|
-
broadcastState(key, stateRef.current.data, stateRef.current.error, true);
|
|
672
|
-
}
|
|
673
|
-
newData = void 0;
|
|
674
|
-
startAt = void 0;
|
|
675
|
-
if (!shouldDeduping) return [3 /*break*/, 3];
|
|
676
|
-
// there's already an ongoing request,
|
|
677
|
-
// this one needs to be deduplicated.
|
|
678
|
-
startAt = CONCURRENT_PROMISES_TS[key];
|
|
679
|
-
return [4 /*yield*/, CONCURRENT_PROMISES[key]];
|
|
680
|
-
case 2:
|
|
681
|
-
newData = _c.sent();
|
|
682
|
-
return [3 /*break*/, 5];
|
|
683
|
-
case 3:
|
|
684
|
-
// if no cache being rendered currently (it shows a blank page),
|
|
685
|
-
// we trigger the loading slow event.
|
|
686
|
-
if (config.loadingTimeout && !cache.get(key)) {
|
|
687
|
-
setTimeout(function () {
|
|
688
|
-
if (loading)
|
|
689
|
-
eventsCallback('onLoadingSlow', key, config);
|
|
690
|
-
}, config.loadingTimeout);
|
|
691
|
-
}
|
|
692
|
-
if (fnArgs !== null) {
|
|
693
|
-
CONCURRENT_PROMISES[key] = fn.apply(void 0, fnArgs);
|
|
694
|
-
}
|
|
695
|
-
else {
|
|
696
|
-
CONCURRENT_PROMISES[key] = fn(key);
|
|
697
|
-
}
|
|
698
|
-
CONCURRENT_PROMISES_TS[key] = startAt = now();
|
|
699
|
-
return [4 /*yield*/, CONCURRENT_PROMISES[key]];
|
|
700
|
-
case 4:
|
|
701
|
-
newData = _c.sent();
|
|
702
|
-
setTimeout(function () {
|
|
703
|
-
delete CONCURRENT_PROMISES[key];
|
|
704
|
-
delete CONCURRENT_PROMISES_TS[key];
|
|
705
|
-
}, config.dedupingInterval);
|
|
706
|
-
// trigger the success event,
|
|
707
|
-
// only do this for the original request.
|
|
708
|
-
eventsCallback('onSuccess', newData, key, config);
|
|
709
|
-
_c.label = 5;
|
|
710
|
-
case 5:
|
|
711
|
-
// if there're other ongoing request(s), started after the current one,
|
|
712
|
-
// we need to ignore the current one to avoid possible race conditions:
|
|
713
|
-
// req1------------------>res1 (current one)
|
|
714
|
-
// req2---------------->res2
|
|
715
|
-
// the request that fired later will always be kept.
|
|
716
|
-
if (CONCURRENT_PROMISES_TS[key] > startAt) {
|
|
717
|
-
return [2 /*return*/, false];
|
|
718
|
-
}
|
|
719
|
-
// if there're other mutations(s), overlapped with the current revalidation:
|
|
720
|
-
// case 1:
|
|
721
|
-
// req------------------>res
|
|
722
|
-
// mutate------>end
|
|
723
|
-
// case 2:
|
|
724
|
-
// req------------>res
|
|
725
|
-
// mutate------>end
|
|
726
|
-
// case 3:
|
|
727
|
-
// req------------------>res
|
|
728
|
-
// mutate-------...---------->
|
|
729
|
-
// we have to ignore the revalidation result (res) because it's no longer fresh.
|
|
730
|
-
// meanwhile, a new revalidation should be triggered when the mutation ends.
|
|
731
|
-
if (MUTATION_TS[key] &&
|
|
732
|
-
// case 1
|
|
733
|
-
(startAt <= MUTATION_TS[key] ||
|
|
734
|
-
// case 2
|
|
735
|
-
startAt <= MUTATION_END_TS[key] ||
|
|
736
|
-
// case 3
|
|
737
|
-
MUTATION_END_TS[key] === 0)) {
|
|
738
|
-
dispatch({ isValidating: false });
|
|
739
|
-
return [2 /*return*/, false];
|
|
740
|
-
}
|
|
741
|
-
cache.set(keyErr, undefined);
|
|
742
|
-
cache.set(keyValidating, false);
|
|
743
|
-
newState = {
|
|
744
|
-
isValidating: false
|
|
745
|
-
};
|
|
746
|
-
if (typeof stateRef.current.error !== 'undefined') {
|
|
747
|
-
// we don't have an error
|
|
748
|
-
newState.error = undefined;
|
|
749
|
-
}
|
|
750
|
-
if (!config.compare(stateRef.current.data, newData)) {
|
|
751
|
-
// deep compare to avoid extra re-render
|
|
752
|
-
// data changed
|
|
753
|
-
newState.data = newData;
|
|
754
|
-
}
|
|
755
|
-
if (!config.compare(cache.get(key), newData)) {
|
|
756
|
-
cache.set(key, newData);
|
|
757
|
-
}
|
|
758
|
-
// merge the new state
|
|
759
|
-
dispatch(newState);
|
|
760
|
-
if (!shouldDeduping) {
|
|
761
|
-
// also update other hooks
|
|
762
|
-
broadcastState(key, newData, newState.error, false);
|
|
763
|
-
}
|
|
764
|
-
return [3 /*break*/, 7];
|
|
765
|
-
case 6:
|
|
766
|
-
err_2 = _c.sent();
|
|
767
|
-
delete CONCURRENT_PROMISES[key];
|
|
768
|
-
delete CONCURRENT_PROMISES_TS[key];
|
|
769
|
-
if (configRef.current.isPaused()) {
|
|
770
|
-
dispatch({
|
|
771
|
-
isValidating: false
|
|
772
|
-
});
|
|
773
|
-
return [2 /*return*/, false];
|
|
774
|
-
}
|
|
775
|
-
cache.set(keyErr, err_2);
|
|
776
|
-
// get a new error
|
|
777
|
-
// don't use deep equal for errors
|
|
778
|
-
if (stateRef.current.error !== err_2) {
|
|
779
|
-
// we keep the stale data
|
|
780
|
-
dispatch({
|
|
781
|
-
isValidating: false,
|
|
782
|
-
error: err_2
|
|
783
|
-
});
|
|
784
|
-
if (!shouldDeduping) {
|
|
785
|
-
// also broadcast to update other hooks
|
|
786
|
-
broadcastState(key, undefined, err_2, false);
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
// events and retry
|
|
790
|
-
eventsCallback('onError', err_2, key, config);
|
|
791
|
-
if (config.shouldRetryOnError) {
|
|
792
|
-
// when retrying, we always enable deduping
|
|
793
|
-
eventsCallback('onErrorRetry', err_2, key, config, revalidate, {
|
|
794
|
-
retryCount: retryCount + 1,
|
|
795
|
-
dedupe: true
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
return [3 /*break*/, 7];
|
|
799
|
-
case 7:
|
|
800
|
-
loading = false;
|
|
801
|
-
return [2 /*return*/, true];
|
|
802
|
-
}
|
|
803
|
-
});
|
|
804
|
-
});
|
|
805
|
-
},
|
|
806
|
-
// dispatch is immutable, and `eventsCallback`, `fnArgs`, `keyErr`, and `keyValidating` are based on `key`,
|
|
807
|
-
// so we can them from the deps array.
|
|
808
|
-
//
|
|
809
|
-
// FIXME:
|
|
810
|
-
// `fn` and `config` might be changed during the lifecycle,
|
|
811
|
-
// but they might be changed every render like this.
|
|
812
|
-
// useSWR('key', () => fetch('/api/'), { suspense: true })
|
|
813
|
-
// So we omit the values from the deps array
|
|
814
|
-
// even though it might cause unexpected behaviors.
|
|
815
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
816
|
-
[key]);
|
|
817
|
-
// mounted (client side rendering)
|
|
818
|
-
useIsomorphicLayoutEffect(function () {
|
|
819
|
-
if (!key)
|
|
820
|
-
return undefined;
|
|
821
|
-
// after `key` updates, we need to mark it as mounted
|
|
822
|
-
unmountedRef.current = false;
|
|
823
|
-
var isUpdating = initialMountedRef.current;
|
|
824
|
-
initialMountedRef.current = true;
|
|
825
|
-
// after the component is mounted (hydrated),
|
|
826
|
-
// we need to update the data from the cache
|
|
827
|
-
// and trigger a revalidation
|
|
828
|
-
var currentHookData = stateRef.current.data;
|
|
829
|
-
var latestKeyedData = resolveData();
|
|
830
|
-
// update the state if the key changed (not the inital render) or cache updated
|
|
831
|
-
keyRef.current = key;
|
|
832
|
-
if (!config.compare(currentHookData, latestKeyedData)) {
|
|
833
|
-
dispatch({ data: latestKeyedData });
|
|
834
|
-
}
|
|
835
|
-
// revalidate with deduping
|
|
836
|
-
var softRevalidate = function () { return revalidate({ dedupe: true }); };
|
|
837
|
-
// trigger a revalidation
|
|
838
|
-
if (isUpdating || willRevalidateOnMount()) {
|
|
839
|
-
if (typeof latestKeyedData !== 'undefined' && !IS_SERVER) {
|
|
840
|
-
// delay revalidate if there's cache
|
|
841
|
-
// to not block the rendering
|
|
842
|
-
// @ts-ignore it's safe to use requestAnimationFrame in browser
|
|
843
|
-
rAF(softRevalidate);
|
|
844
|
-
}
|
|
845
|
-
else {
|
|
846
|
-
softRevalidate();
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
var pending = false;
|
|
850
|
-
var onFocus = function () {
|
|
851
|
-
if (pending || !configRef.current.revalidateOnFocus)
|
|
852
|
-
return;
|
|
853
|
-
pending = true;
|
|
854
|
-
softRevalidate();
|
|
855
|
-
setTimeout(function () { return (pending = false); }, configRef.current.focusThrottleInterval);
|
|
856
|
-
};
|
|
857
|
-
var onReconnect = function () {
|
|
858
|
-
if (configRef.current.revalidateOnReconnect) {
|
|
859
|
-
softRevalidate();
|
|
860
|
-
}
|
|
861
|
-
};
|
|
862
|
-
// register global cache update listener
|
|
863
|
-
var onUpdate = function (shouldRevalidate, updatedData, updatedError, updatedIsValidating, dedupe) {
|
|
864
|
-
if (shouldRevalidate === void 0) { shouldRevalidate = true; }
|
|
865
|
-
if (dedupe === void 0) { dedupe = true; }
|
|
866
|
-
// update hook state
|
|
867
|
-
var newState = {};
|
|
868
|
-
var needUpdate = false;
|
|
869
|
-
if (typeof updatedData !== 'undefined' &&
|
|
870
|
-
!config.compare(stateRef.current.data, updatedData)) {
|
|
871
|
-
newState.data = updatedData;
|
|
872
|
-
needUpdate = true;
|
|
873
|
-
}
|
|
874
|
-
// always update error
|
|
875
|
-
// because it can be `undefined`
|
|
876
|
-
if (stateRef.current.error !== updatedError) {
|
|
877
|
-
newState.error = updatedError;
|
|
878
|
-
needUpdate = true;
|
|
879
|
-
}
|
|
880
|
-
if (typeof updatedIsValidating !== 'undefined' &&
|
|
881
|
-
stateRef.current.isValidating !== updatedIsValidating) {
|
|
882
|
-
newState.isValidating = updatedIsValidating;
|
|
883
|
-
needUpdate = true;
|
|
884
|
-
}
|
|
885
|
-
if (needUpdate) {
|
|
886
|
-
dispatch(newState);
|
|
887
|
-
}
|
|
888
|
-
if (shouldRevalidate) {
|
|
889
|
-
if (dedupe) {
|
|
890
|
-
return softRevalidate();
|
|
891
|
-
}
|
|
892
|
-
else {
|
|
893
|
-
return revalidate();
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
return false;
|
|
897
|
-
};
|
|
898
|
-
var unsubFocus = addRevalidator(FOCUS_REVALIDATORS, onFocus);
|
|
899
|
-
var unsubReconnect = addRevalidator(RECONNECT_REVALIDATORS, onReconnect);
|
|
900
|
-
var unsubUpdate = addRevalidator(CACHE_REVALIDATORS, onUpdate);
|
|
901
|
-
return function () {
|
|
902
|
-
// cleanup
|
|
903
|
-
dispatch = function () { return null; };
|
|
904
|
-
// mark it as unmounted
|
|
905
|
-
unmountedRef.current = true;
|
|
906
|
-
unsubFocus();
|
|
907
|
-
unsubReconnect();
|
|
908
|
-
unsubUpdate();
|
|
909
|
-
};
|
|
910
|
-
}, [key, revalidate]);
|
|
911
|
-
useIsomorphicLayoutEffect(function () {
|
|
912
|
-
var timer = null;
|
|
913
|
-
var tick = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
914
|
-
return __generator(this, function (_a) {
|
|
915
|
-
switch (_a.label) {
|
|
916
|
-
case 0:
|
|
917
|
-
if (!(!stateRef.current.error &&
|
|
918
|
-
(configRef.current.refreshWhenHidden ||
|
|
919
|
-
configRef.current.isDocumentVisible()) &&
|
|
920
|
-
(configRef.current.refreshWhenOffline || configRef.current.isOnline()))) return [3 /*break*/, 2];
|
|
921
|
-
// only revalidate when the page is visible
|
|
922
|
-
// if API request errored, we stop polling in this round
|
|
923
|
-
// and let the error retry function handle it
|
|
924
|
-
return [4 /*yield*/, revalidate({ dedupe: true })];
|
|
925
|
-
case 1:
|
|
926
|
-
// only revalidate when the page is visible
|
|
927
|
-
// if API request errored, we stop polling in this round
|
|
928
|
-
// and let the error retry function handle it
|
|
929
|
-
_a.sent();
|
|
930
|
-
_a.label = 2;
|
|
931
|
-
case 2:
|
|
932
|
-
// Read the latest refreshInterval
|
|
933
|
-
if (configRef.current.refreshInterval && timer) {
|
|
934
|
-
timer = setTimeout(tick, configRef.current.refreshInterval);
|
|
935
|
-
}
|
|
936
|
-
return [2 /*return*/];
|
|
937
|
-
}
|
|
938
|
-
});
|
|
939
|
-
}); };
|
|
940
|
-
if (configRef.current.refreshInterval) {
|
|
941
|
-
timer = setTimeout(tick, configRef.current.refreshInterval);
|
|
942
|
-
}
|
|
943
|
-
return function () {
|
|
944
|
-
if (timer) {
|
|
945
|
-
clearTimeout(timer);
|
|
946
|
-
timer = null;
|
|
947
|
-
}
|
|
948
|
-
};
|
|
949
|
-
}, [
|
|
950
|
-
config.refreshInterval,
|
|
951
|
-
config.refreshWhenHidden,
|
|
952
|
-
config.refreshWhenOffline,
|
|
953
|
-
revalidate
|
|
954
|
-
]);
|
|
955
|
-
// suspense
|
|
956
|
-
var latestData;
|
|
957
|
-
var latestError;
|
|
958
|
-
if (config.suspense) {
|
|
959
|
-
// in suspense mode, we can't return empty state
|
|
960
|
-
// (it should be suspended)
|
|
961
|
-
// try to get data and error from cache
|
|
962
|
-
latestData = cache.get(key);
|
|
963
|
-
latestError = cache.get(keyErr);
|
|
964
|
-
if (typeof latestData === 'undefined') {
|
|
965
|
-
latestData = initialData;
|
|
966
|
-
}
|
|
967
|
-
if (typeof latestError === 'undefined') {
|
|
968
|
-
latestError = initialError;
|
|
969
|
-
}
|
|
970
|
-
if (typeof latestData === 'undefined' &&
|
|
971
|
-
typeof latestError === 'undefined') {
|
|
972
|
-
// need to start the request if it hasn't
|
|
973
|
-
if (!CONCURRENT_PROMISES[key]) {
|
|
974
|
-
// trigger revalidate immediately
|
|
975
|
-
// to get the promise
|
|
976
|
-
// in this revalidate, should not rerender
|
|
977
|
-
revalidate();
|
|
978
|
-
}
|
|
979
|
-
if (CONCURRENT_PROMISES[key] &&
|
|
980
|
-
typeof CONCURRENT_PROMISES[key].then === 'function') {
|
|
981
|
-
// if it is a promise
|
|
982
|
-
throw CONCURRENT_PROMISES[key];
|
|
983
|
-
}
|
|
984
|
-
// it's a value, return it directly (override)
|
|
985
|
-
latestData = CONCURRENT_PROMISES[key];
|
|
986
|
-
}
|
|
987
|
-
if (typeof latestData === 'undefined' && latestError) {
|
|
988
|
-
// in suspense mode, throw error if there's no content
|
|
989
|
-
throw latestError;
|
|
115
|
+
// exclude page=xxx from query string
|
|
116
|
+
partialQSArr.map(function (item) {
|
|
117
|
+
var itemArr = item.split('=');
|
|
118
|
+
var key = itemArr[0];
|
|
119
|
+
var val = itemArr[1];
|
|
120
|
+
|
|
121
|
+
if (key !== 'page') {
|
|
122
|
+
queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
|
|
990
123
|
}
|
|
124
|
+
});
|
|
991
125
|
}
|
|
992
|
-
// define returned state
|
|
993
|
-
// can be memorized since the state is a ref
|
|
994
|
-
var memoizedState = React.useMemo(function () {
|
|
995
|
-
// revalidate will be deprecated in the 1.x release
|
|
996
|
-
// because mutate() covers the same use case of revalidate().
|
|
997
|
-
// This remains only for backward compatibility
|
|
998
|
-
var state = { revalidate: revalidate, mutate: boundMutate };
|
|
999
|
-
Object.defineProperties(state, {
|
|
1000
|
-
error: {
|
|
1001
|
-
// `key` might be changed in the upcoming hook re-render,
|
|
1002
|
-
// but the previous state will stay
|
|
1003
|
-
// so we need to match the latest key and data (fallback to `initialData`)
|
|
1004
|
-
get: function () {
|
|
1005
|
-
stateDependencies.current.error = true;
|
|
1006
|
-
if (config.suspense) {
|
|
1007
|
-
return latestError;
|
|
1008
|
-
}
|
|
1009
|
-
return keyRef.current === key ? stateRef.current.error : initialError;
|
|
1010
|
-
},
|
|
1011
|
-
enumerable: true
|
|
1012
|
-
},
|
|
1013
|
-
data: {
|
|
1014
|
-
get: function () {
|
|
1015
|
-
stateDependencies.current.data = true;
|
|
1016
|
-
if (config.suspense) {
|
|
1017
|
-
return latestData;
|
|
1018
|
-
}
|
|
1019
|
-
return keyRef.current === key ? stateRef.current.data : initialData;
|
|
1020
|
-
},
|
|
1021
|
-
enumerable: true
|
|
1022
|
-
},
|
|
1023
|
-
isValidating: {
|
|
1024
|
-
get: function () {
|
|
1025
|
-
stateDependencies.current.isValidating = true;
|
|
1026
|
-
return key ? stateRef.current.isValidating : false;
|
|
1027
|
-
},
|
|
1028
|
-
enumerable: true
|
|
1029
|
-
}
|
|
1030
|
-
});
|
|
1031
|
-
return state;
|
|
1032
|
-
// `config.suspense` isn't allowed to change during the lifecycle.
|
|
1033
|
-
// `boundMutate` is immutable, and the immutability of `revalidate` depends on `key`
|
|
1034
|
-
// so we can omit them from the deps array,
|
|
1035
|
-
// but we put it to enable react-hooks/exhaustive-deps rule.
|
|
1036
|
-
// `initialData` and `initialError` are not initial values
|
|
1037
|
-
// because they are changed during the lifecycle
|
|
1038
|
-
// so we should add them in the deps array.
|
|
1039
|
-
}, [
|
|
1040
|
-
revalidate,
|
|
1041
|
-
initialData,
|
|
1042
|
-
initialError,
|
|
1043
|
-
boundMutate,
|
|
1044
|
-
key,
|
|
1045
|
-
config.suspense,
|
|
1046
|
-
latestError,
|
|
1047
|
-
latestData
|
|
1048
|
-
]);
|
|
1049
|
-
return memoizedState;
|
|
1050
|
-
}
|
|
1051
|
-
Object.defineProperty(SWRConfigContext.Provider, 'default', {
|
|
1052
|
-
value: defaultConfig
|
|
1053
|
-
});
|
|
1054
|
-
var SWRConfig = SWRConfigContext.Provider;
|
|
1055
126
|
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
1059
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
1060
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
1061
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
1062
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1063
|
-
});
|
|
1064
|
-
};
|
|
1065
|
-
var __generator$1 = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
1066
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
1067
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
1068
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
1069
|
-
function step(op) {
|
|
1070
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
1071
|
-
while (_) try {
|
|
1072
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1073
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
1074
|
-
switch (op[0]) {
|
|
1075
|
-
case 0: case 1: t = op; break;
|
|
1076
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
1077
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
1078
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
1079
|
-
default:
|
|
1080
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
1081
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
1082
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
1083
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
1084
|
-
if (t[2]) _.ops.pop();
|
|
1085
|
-
_.trys.pop(); continue;
|
|
1086
|
-
}
|
|
1087
|
-
op = body.call(thisArg, _);
|
|
1088
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
1089
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
127
|
+
if (queryString.length > 0) {
|
|
128
|
+
path += '?' + queryString;
|
|
1090
129
|
}
|
|
1091
|
-
};
|
|
1092
|
-
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
1093
|
-
var t = {};
|
|
1094
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1095
|
-
t[p] = s[p];
|
|
1096
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1097
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1098
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1099
|
-
t[p[i]] = s[p[i]];
|
|
1100
|
-
}
|
|
1101
|
-
return t;
|
|
1102
|
-
};
|
|
1103
130
|
|
|
1104
|
-
|
|
131
|
+
pageNumber = parseInt(pageNumber);
|
|
132
|
+
// const index = Number(itemIndex)
|
|
133
|
+
// const perPage = Number(itemsPerPage)
|
|
1105
134
|
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
135
|
+
// pageNumber = Math.ceil((index + 1) / perPage)
|
|
136
|
+
|
|
137
|
+
if (currentPage !== pageNumber) {
|
|
138
|
+
index$1.lib_3.refresh();
|
|
139
|
+
|
|
140
|
+
setCurrentPage(pageNumber);
|
|
141
|
+
if (path[0] !== '/') {
|
|
142
|
+
path = '/' + path;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
var newPath = pageNumber === 1 ? '' + path : '' + path + (queryString.length > 0 ? '&' : '?') + 'page=' + pageNumber;
|
|
1111
146
|
|
|
1112
|
-
|
|
147
|
+
// if (pageview) {
|
|
148
|
+
// pageview(newPath)
|
|
149
|
+
// }
|
|
150
|
+
|
|
151
|
+
router.push(pathname, newPath, {
|
|
152
|
+
shallow: true
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
1113
156
|
};
|
|
1114
157
|
|
|
1115
158
|
var checkExternalUrl = function checkExternalUrl(url) {
|
|
1116
159
|
return new RegExp(['http', 'https'].join('|')).test(url);
|
|
1117
160
|
};
|
|
1118
161
|
|
|
1119
|
-
var
|
|
1120
|
-
var data = _ref.data,
|
|
1121
|
-
client = _ref.client,
|
|
1122
|
-
mapping = _ref.mapping,
|
|
1123
|
-
showPublished = _ref.showPublished,
|
|
1124
|
-
defaultImage = _ref.defaultImage,
|
|
1125
|
-
showAuthor = _ref.showAuthor,
|
|
1126
|
-
showCategory = _ref.showCategory,
|
|
1127
|
-
imageHeight = _ref.imageHeight,
|
|
1128
|
-
imageWidth = _ref.imageWidth,
|
|
1129
|
-
imageMaxHeight = _ref.imageMaxHeight,
|
|
1130
|
-
imageFit = _ref.imageFit,
|
|
1131
|
-
rightItems = _ref.rightItems,
|
|
1132
|
-
brandInsightAd = _ref.brandInsightAd,
|
|
1133
|
-
showBI = _ref.showBI,
|
|
1134
|
-
heroContent = _ref.heroContent,
|
|
1135
|
-
lgInfeedAd = _ref.lgInfeedAd,
|
|
1136
|
-
showPubInfo = _ref.showPubInfo,
|
|
1137
|
-
contentCategoryMapping = _ref.contentCategoryMapping,
|
|
1138
|
-
showTimeDiff = _ref.showTimeDiff,
|
|
1139
|
-
showTaxonomies = _ref.showTaxonomies,
|
|
1140
|
-
showIntro = _ref.showIntro;
|
|
1141
|
-
|
|
162
|
+
var cardLoader = function cardLoader(data, client, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, imageMaxHeight, imageFit, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent, lgInfeedAd, showPubInfo, contentCategoryMapping, showTimeDiff, showTaxonomies, showIntro) {
|
|
1142
163
|
var numberOfItemsBeforeAd = 6;
|
|
1143
164
|
var insertBrandInsightAd = function insertBrandInsightAd(arr, index, newElement) {
|
|
1144
165
|
return [].concat(toConsumableArray._toConsumableArray(arr.slice(0, index)), [newElement], toConsumableArray._toConsumableArray(arr.slice(index)));
|
|
@@ -1220,842 +241,425 @@ var CardLoader = function CardLoader(_ref) {
|
|
|
1220
241
|
}
|
|
1221
242
|
}
|
|
1222
243
|
|
|
244
|
+
// 'articleCount' is New parameter to use instead of 'index' while passing to 'changePageNumber()'
|
|
245
|
+
// 'index' was including the indexes for infeed ads along with article count making the page number change before it reaches last article.
|
|
246
|
+
// 'articleCount' will be the indexes of only the articles in the deck.
|
|
247
|
+
var articleCount = -1;
|
|
248
|
+
data = data.map(function (ele, i) {
|
|
249
|
+
if (ele._type === 'lg-infeed') {
|
|
250
|
+
// Setting pos as top2 for the first occurence of large infeed ad
|
|
251
|
+
// const pos = data.indexOf(data.find((d) => d._type === 'lg-infeed')) === i ? 'top2' : `lg-infeed_${i}`
|
|
252
|
+
return _extends._extends({}, ele, { slotId: 'lg-infeed_' + i, targeting: _extends._extends({}, ele.targeting, { pos: 'lg-infeed' }) });
|
|
253
|
+
} else if (ele._type === 'article') {
|
|
254
|
+
// incrementing 'articleCount' for each article.
|
|
255
|
+
++articleCount;
|
|
256
|
+
return _extends._extends({}, ele, { articleCount: articleCount });
|
|
257
|
+
} else {
|
|
258
|
+
return ele;
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
|
|
1223
262
|
var featureCount = 0;
|
|
1224
|
-
return React__default.createElement(
|
|
263
|
+
return React__default['default'].createElement(
|
|
1225
264
|
'div',
|
|
1226
265
|
null,
|
|
1227
266
|
data && data.length > 0 ? dataRemapped ? // For Javascript Enabled Cases
|
|
1228
|
-
data.map(function (article, index) {
|
|
267
|
+
data.map(function (article, index$1) {
|
|
268
|
+
var pageNumber = article.pageNumber || values.page;
|
|
1229
269
|
var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
|
|
1230
|
-
|
|
1231
|
-
if (article._type === 'feature') {
|
|
1232
|
-
featureCount++;
|
|
1233
|
-
if (article.blank || checkExternalUrl(article.url.current)) {
|
|
1234
|
-
return React__default.createElement(
|
|
1235
|
-
|
|
1236
|
-
{
|
|
1237
|
-
key: article._id ? article._id : index,
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
React__default.
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
React__default.createElement(
|
|
1252
|
-
'
|
|
1253
|
-
{
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
null,
|
|
1261
|
-
React__default.createElement(
|
|
1262
|
-
'a',
|
|
1263
|
-
{ rel: 'noopener', href: article.url.current, target: '_blank' },
|
|
1264
|
-
article.title && React__default.createElement(
|
|
1265
|
-
'h4',
|
|
1266
|
-
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
1267
|
-
article.title
|
|
1268
|
-
)
|
|
1269
|
-
),
|
|
1270
|
-
showPublished && !showTimeDiff && article.published && React__default.createElement(
|
|
1271
|
-
'p',
|
|
1272
|
-
{ className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
|
|
1273
|
-
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
1274
|
-
),
|
|
1275
|
-
showTimeDiff && article.published && React__default.createElement(
|
|
1276
|
-
'p',
|
|
1277
|
-
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
1278
|
-
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
1279
|
-
if (index > 3) {
|
|
1280
|
-
return null;
|
|
1281
|
-
}
|
|
1282
|
-
if (index === 3) {
|
|
1283
|
-
return React__default.createElement(
|
|
1284
|
-
React__default.Fragment,
|
|
1285
|
-
null,
|
|
1286
|
-
React__default.createElement(
|
|
1287
|
-
'em',
|
|
1288
|
-
{ style: { marginRight: '.5rem' } },
|
|
1289
|
-
'...'
|
|
1290
|
-
)
|
|
1291
|
-
);
|
|
1292
|
-
}
|
|
1293
|
-
return React__default.createElement(
|
|
1294
|
-
React__default.Fragment,
|
|
1295
|
-
null,
|
|
1296
|
-
React__default.createElement(
|
|
1297
|
-
'em',
|
|
1298
|
-
null,
|
|
1299
|
-
taxonomy.name
|
|
1300
|
-
),
|
|
1301
|
-
' |',
|
|
1302
|
-
' '
|
|
1303
|
-
);
|
|
1304
|
-
}),
|
|
1305
|
-
' ',
|
|
1306
|
-
React__default.createElement(
|
|
1307
|
-
'span',
|
|
1308
|
-
{ style: { display: 'inline-block' } },
|
|
1309
|
-
timeDifferenceCalc(article.published)
|
|
1310
|
-
)
|
|
1311
|
-
),
|
|
1312
|
-
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
|
|
1313
|
-
index$2.LazyLoad,
|
|
1314
|
-
{ height: 50 },
|
|
1315
|
-
React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
|
|
1316
|
-
),
|
|
1317
|
-
!article.thumbnail && !defaultImage && article.source && React__default.createElement(
|
|
1318
|
-
'div',
|
|
1319
|
-
{ className: 'content-category-label' },
|
|
1320
|
-
React__default.createElement(
|
|
1321
|
-
'div',
|
|
1322
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1323
|
-
article.source
|
|
1324
|
-
)
|
|
1325
|
-
),
|
|
1326
|
-
React__default.createElement(
|
|
1327
|
-
'div',
|
|
1328
|
-
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
1329
|
-
showCategory && article.contentCategory && React__default.createElement(
|
|
1330
|
-
'p',
|
|
1331
|
-
{
|
|
1332
|
-
className: 'article-category',
|
|
1333
|
-
style: {
|
|
1334
|
-
background: '#3FB618',
|
|
1335
|
-
color: '#ffffff',
|
|
1336
|
-
marginBottom: '.25rem',
|
|
1337
|
-
display: 'inline-block',
|
|
1338
|
-
padding: '0 .25rem',
|
|
1339
|
-
fontSize: '.8rem'
|
|
1340
|
-
} },
|
|
1341
|
-
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
1342
|
-
),
|
|
1343
|
-
article.issueSection && article.issueSection.name && React__default.createElement(
|
|
1344
|
-
'p',
|
|
1345
|
-
{
|
|
1346
|
-
className: 'issueSection',
|
|
1347
|
-
style: {
|
|
1348
|
-
background: '#000000',
|
|
1349
|
-
color: '#ffffff',
|
|
1350
|
-
marginBottom: '.25rem',
|
|
1351
|
-
marginLeft: '.25rem',
|
|
1352
|
-
display: 'inline-block',
|
|
1353
|
-
padding: '0 .25rem',
|
|
1354
|
-
fontSize: '.8rem'
|
|
1355
|
-
} },
|
|
1356
|
-
article.issueSection.name
|
|
1357
|
-
)
|
|
1358
|
-
),
|
|
1359
|
-
showPubInfo && (article.issue || article.volume) && React__default.createElement(
|
|
1360
|
-
'div',
|
|
1361
|
-
{ className: 'pubInfo' },
|
|
1362
|
-
article.volume && React__default.createElement(
|
|
1363
|
-
'p',
|
|
1364
|
-
{ className: 'qdeVolume' },
|
|
1365
|
-
article.volume
|
|
1366
|
-
),
|
|
1367
|
-
article.issue && React__default.createElement(
|
|
1368
|
-
'p',
|
|
1369
|
-
{ className: 'qdeIssue' },
|
|
1370
|
-
article.issue
|
|
1371
|
-
)
|
|
1372
|
-
),
|
|
1373
|
-
showIntro && article.summary && React__default.createElement(
|
|
1374
|
-
'p',
|
|
1375
|
-
{ className: 'pt-2 card-text' },
|
|
1376
|
-
entities.clean_html_1(article.summary)
|
|
1377
|
-
)
|
|
1378
|
-
)
|
|
1379
|
-
);
|
|
1380
|
-
} else {
|
|
1381
|
-
return React__default.createElement(
|
|
1382
|
-
reactBootstrap.Media,
|
|
1383
|
-
{
|
|
1384
|
-
key: article._id ? article._id : index,
|
|
1385
|
-
className: 'feature-media',
|
|
1386
|
-
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
1387
|
-
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
1388
|
-
'a',
|
|
1389
|
-
{ href: article.url.current, className: 'feature-wrapper' },
|
|
1390
|
-
React__default.createElement(
|
|
1391
|
-
index$2.LazyLoad,
|
|
1392
|
-
{ height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
|
|
1393
|
-
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
1394
|
-
),
|
|
1395
|
-
article.source && React__default.createElement(
|
|
1396
|
-
'div',
|
|
1397
|
-
{ className: 'content-category-label' },
|
|
1398
|
-
React__default.createElement(
|
|
1399
|
-
'div',
|
|
1400
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1401
|
-
article.source
|
|
1402
|
-
)
|
|
1403
|
-
)
|
|
1404
|
-
),
|
|
1405
|
-
React__default.createElement(
|
|
1406
|
-
reactBootstrap.Media.Body,
|
|
1407
|
-
null,
|
|
1408
|
-
React__default.createElement(
|
|
1409
|
-
'a',
|
|
1410
|
-
{ href: article.url.current },
|
|
1411
|
-
article.title && React__default.createElement(
|
|
1412
|
-
'h4',
|
|
1413
|
-
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
1414
|
-
article.title
|
|
1415
|
-
)
|
|
1416
|
-
),
|
|
1417
|
-
showPublished && !showTimeDiff && article.published && React__default.createElement(
|
|
1418
|
-
'p',
|
|
1419
|
-
{ className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
|
|
1420
|
-
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
1421
|
-
),
|
|
1422
|
-
showTimeDiff && article.published && React__default.createElement(
|
|
1423
|
-
'p',
|
|
1424
|
-
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
1425
|
-
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
1426
|
-
if (index > 3) {
|
|
1427
|
-
return null;
|
|
1428
|
-
}
|
|
1429
|
-
if (index === 3) {
|
|
1430
|
-
return React__default.createElement(
|
|
1431
|
-
React__default.Fragment,
|
|
1432
|
-
null,
|
|
1433
|
-
React__default.createElement(
|
|
1434
|
-
'em',
|
|
1435
|
-
{ style: { marginRight: '.5rem' } },
|
|
1436
|
-
'...'
|
|
1437
|
-
)
|
|
1438
|
-
);
|
|
1439
|
-
}
|
|
1440
|
-
if (index === 3) {
|
|
1441
|
-
return React__default.createElement(
|
|
1442
|
-
React__default.Fragment,
|
|
1443
|
-
null,
|
|
1444
|
-
React__default.createElement(
|
|
1445
|
-
'em',
|
|
1446
|
-
{ style: { marginRight: '.5rem' } },
|
|
1447
|
-
'...'
|
|
1448
|
-
)
|
|
1449
|
-
);
|
|
1450
|
-
}
|
|
1451
|
-
return React__default.createElement(
|
|
1452
|
-
React__default.Fragment,
|
|
1453
|
-
null,
|
|
1454
|
-
React__default.createElement(
|
|
1455
|
-
'em',
|
|
1456
|
-
null,
|
|
1457
|
-
taxonomy.name
|
|
1458
|
-
),
|
|
1459
|
-
' |',
|
|
1460
|
-
' '
|
|
1461
|
-
);
|
|
1462
|
-
}),
|
|
1463
|
-
' ',
|
|
1464
|
-
React__default.createElement(
|
|
1465
|
-
'span',
|
|
1466
|
-
{ style: { display: 'inline-block' } },
|
|
1467
|
-
timeDifferenceCalc(article.published)
|
|
1468
|
-
)
|
|
1469
|
-
),
|
|
1470
|
-
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
|
|
1471
|
-
index$2.LazyLoad,
|
|
1472
|
-
{ height: 50 },
|
|
1473
|
-
React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
|
|
1474
|
-
),
|
|
1475
|
-
!article.thumbnail && !defaultImage && article.source && React__default.createElement(
|
|
1476
|
-
'div',
|
|
1477
|
-
{ className: 'content-category-label' },
|
|
1478
|
-
React__default.createElement(
|
|
1479
|
-
'div',
|
|
1480
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1481
|
-
article.source
|
|
1482
|
-
)
|
|
1483
|
-
),
|
|
1484
|
-
React__default.createElement(
|
|
1485
|
-
'div',
|
|
1486
|
-
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
1487
|
-
showCategory && article.contentCategory && React__default.createElement(
|
|
1488
|
-
'p',
|
|
1489
|
-
{
|
|
1490
|
-
className: 'article-category',
|
|
1491
|
-
style: {
|
|
1492
|
-
background: '#3FB618',
|
|
1493
|
-
color: '#ffffff',
|
|
1494
|
-
marginBottom: '.25rem',
|
|
1495
|
-
display: 'inline-block',
|
|
1496
|
-
padding: '0 .25rem',
|
|
1497
|
-
fontSize: '.8rem'
|
|
1498
|
-
} },
|
|
1499
|
-
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
1500
|
-
),
|
|
1501
|
-
article.issueSection && article.issueSection.name && React__default.createElement(
|
|
1502
|
-
'p',
|
|
1503
|
-
{
|
|
1504
|
-
className: 'issueSection',
|
|
1505
|
-
style: {
|
|
1506
|
-
background: '#000000',
|
|
1507
|
-
color: '#ffffff',
|
|
1508
|
-
marginBottom: '.25rem',
|
|
1509
|
-
marginLeft: '.25rem',
|
|
1510
|
-
display: 'inline-block',
|
|
1511
|
-
padding: '0 .25rem',
|
|
1512
|
-
fontSize: '.8rem'
|
|
1513
|
-
} },
|
|
1514
|
-
article.issueSection.name
|
|
1515
|
-
)
|
|
1516
|
-
),
|
|
1517
|
-
showPubInfo && (article.issue || article.volume) && React__default.createElement(
|
|
1518
|
-
'div',
|
|
1519
|
-
{ className: 'pubInfo' },
|
|
1520
|
-
article.volume && React__default.createElement(
|
|
1521
|
-
'p',
|
|
1522
|
-
{ className: 'qdeVolume' },
|
|
1523
|
-
article.volume
|
|
1524
|
-
),
|
|
1525
|
-
article.issue && React__default.createElement(
|
|
1526
|
-
'p',
|
|
1527
|
-
{ className: 'qdeIssue' },
|
|
1528
|
-
article.issue
|
|
1529
|
-
)
|
|
1530
|
-
),
|
|
1531
|
-
showIntro && article.summary && React__default.createElement(
|
|
1532
|
-
'p',
|
|
1533
|
-
{ className: 'pt-2 card-text' },
|
|
1534
|
-
entities.clean_html_1(article.summary)
|
|
1535
|
-
)
|
|
1536
|
-
)
|
|
1537
|
-
);
|
|
1538
|
-
}
|
|
1539
|
-
} else if (article._type === 'lg-infeed' && article.adUnit) {
|
|
1540
|
-
return React__default.createElement(ADlgInfeed.ADlgInfeed, _extends._extends({ index: index }, article));
|
|
1541
|
-
} else if (article._type === 'brandInsightAd' && article.adUnit) {
|
|
1542
|
-
return React__default.createElement(ADInfeed.ADInfeed, { index: index, infeedAd: article });
|
|
1543
|
-
}
|
|
1544
|
-
if ((brandInsightAd ? index > heroContent + featureCount : index + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
|
|
1545
|
-
return React__default.createElement(
|
|
1546
|
-
React__default.Fragment,
|
|
1547
|
-
{ key: article._id ? article._id : index },
|
|
1548
|
-
React__default.createElement(
|
|
1549
|
-
reactBootstrap.Media,
|
|
1550
|
-
{
|
|
1551
|
-
key: article._id ? article._id : index,
|
|
1552
|
-
style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
1553
|
-
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
1554
|
-
'a',
|
|
1555
|
-
{ href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
|
|
1556
|
-
React__default.createElement(
|
|
1557
|
-
index$2.LazyLoad,
|
|
1558
|
-
{ height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
|
|
1559
|
-
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
1560
|
-
),
|
|
1561
|
-
article.source && React__default.createElement(
|
|
1562
|
-
'div',
|
|
1563
|
-
{ className: 'content-category-label' },
|
|
1564
|
-
React__default.createElement(
|
|
1565
|
-
'div',
|
|
1566
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1567
|
-
article.source
|
|
1568
|
-
)
|
|
1569
|
-
)
|
|
1570
|
-
),
|
|
1571
|
-
React__default.createElement(
|
|
1572
|
-
reactBootstrap.Media.Body,
|
|
1573
|
-
null,
|
|
1574
|
-
React__default.createElement(
|
|
1575
|
-
'a',
|
|
1576
|
-
{ href: mapping[contentCategoryName] + '/' + article.url.current },
|
|
1577
|
-
article.title && React__default.createElement(
|
|
1578
|
-
'h4',
|
|
1579
|
-
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
1580
|
-
article.title
|
|
1581
|
-
)
|
|
1582
|
-
),
|
|
1583
|
-
showPublished && !showTimeDiff && article.published && React__default.createElement(
|
|
1584
|
-
'p',
|
|
1585
|
-
{ className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
|
|
1586
|
-
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
1587
|
-
),
|
|
1588
|
-
showTimeDiff && article.published && React__default.createElement(
|
|
1589
|
-
'p',
|
|
1590
|
-
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
1591
|
-
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
1592
|
-
if (index > 3) {
|
|
1593
|
-
return null;
|
|
1594
|
-
}
|
|
1595
|
-
if (index === 3) {
|
|
1596
|
-
return React__default.createElement(
|
|
1597
|
-
React__default.Fragment,
|
|
1598
|
-
null,
|
|
1599
|
-
React__default.createElement(
|
|
1600
|
-
'em',
|
|
1601
|
-
{ style: { marginRight: '.5rem' } },
|
|
1602
|
-
'...'
|
|
1603
|
-
)
|
|
1604
|
-
);
|
|
1605
|
-
}
|
|
1606
|
-
return React__default.createElement(
|
|
1607
|
-
React__default.Fragment,
|
|
1608
|
-
null,
|
|
1609
|
-
React__default.createElement(
|
|
1610
|
-
'em',
|
|
1611
|
-
null,
|
|
1612
|
-
taxonomy.name
|
|
1613
|
-
),
|
|
1614
|
-
' |',
|
|
1615
|
-
' '
|
|
1616
|
-
);
|
|
1617
|
-
}),
|
|
1618
|
-
' ',
|
|
1619
|
-
React__default.createElement(
|
|
1620
|
-
'span',
|
|
1621
|
-
{ style: { display: 'inline-block' } },
|
|
1622
|
-
timeDifferenceCalc(article.published)
|
|
1623
|
-
)
|
|
1624
|
-
),
|
|
1625
|
-
React__default.createElement(
|
|
1626
|
-
'div',
|
|
1627
|
-
{ className: 'author-sec', style: { lineHeight: 1.5 } },
|
|
1628
|
-
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
|
|
1629
|
-
index$2.LazyLoad,
|
|
1630
|
-
{ height: 50 },
|
|
1631
|
-
React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
|
|
1632
|
-
)
|
|
1633
|
-
),
|
|
1634
|
-
!article.thumbnail && !defaultImage && article.source && React__default.createElement(
|
|
1635
|
-
'div',
|
|
1636
|
-
{ className: 'content-category-label' },
|
|
1637
|
-
React__default.createElement(
|
|
1638
|
-
'div',
|
|
1639
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1640
|
-
article.source
|
|
1641
|
-
)
|
|
1642
|
-
),
|
|
1643
|
-
React__default.createElement(
|
|
1644
|
-
'div',
|
|
1645
|
-
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
1646
|
-
showCategory && article.contentCategory && React__default.createElement(
|
|
1647
|
-
'p',
|
|
1648
|
-
{
|
|
1649
|
-
className: 'article-category',
|
|
1650
|
-
style: {
|
|
1651
|
-
background: '#3FB618',
|
|
1652
|
-
color: '#ffffff',
|
|
1653
|
-
marginBottom: '.25rem',
|
|
1654
|
-
display: 'inline-block',
|
|
1655
|
-
padding: '0 .25rem',
|
|
1656
|
-
fontSize: '.8rem'
|
|
1657
|
-
} },
|
|
1658
|
-
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
1659
|
-
),
|
|
1660
|
-
article.issueSection && article.issueSection.name && React__default.createElement(
|
|
1661
|
-
'p',
|
|
1662
|
-
{
|
|
1663
|
-
className: 'issueSection',
|
|
1664
|
-
style: {
|
|
1665
|
-
background: '#000000',
|
|
1666
|
-
color: '#ffffff',
|
|
1667
|
-
marginBottom: '.25rem',
|
|
1668
|
-
marginLeft: '.25rem',
|
|
1669
|
-
display: 'inline-block',
|
|
1670
|
-
padding: '0 .25rem',
|
|
1671
|
-
fontSize: '.8rem'
|
|
1672
|
-
} },
|
|
1673
|
-
article.issueSection.name
|
|
1674
|
-
)
|
|
1675
|
-
),
|
|
1676
|
-
showPubInfo && (article.issue || article.volume) && React__default.createElement(
|
|
1677
|
-
'div',
|
|
1678
|
-
{ className: 'pubInfo' },
|
|
1679
|
-
article.volume && React__default.createElement(
|
|
1680
|
-
'p',
|
|
1681
|
-
{ className: 'qdeVolume' },
|
|
1682
|
-
article.volume
|
|
1683
|
-
),
|
|
1684
|
-
article.issue && React__default.createElement(
|
|
1685
|
-
'p',
|
|
1686
|
-
{ className: 'qdeIssue' },
|
|
1687
|
-
article.issue
|
|
1688
|
-
)
|
|
1689
|
-
),
|
|
1690
|
-
showIntro && article.summary && React__default.createElement(
|
|
1691
|
-
'p',
|
|
1692
|
-
{ className: 'pt-2 card-text' },
|
|
1693
|
-
entities.clean_html_1(article.summary)
|
|
1694
|
-
)
|
|
1695
|
-
)
|
|
1696
|
-
),
|
|
1697
|
-
React__default.createElement(
|
|
1698
|
-
'div',
|
|
1699
|
-
null,
|
|
1700
|
-
main.main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
|
|
1701
|
-
)
|
|
1702
|
-
);
|
|
1703
|
-
} else return null;
|
|
1704
|
-
}) :
|
|
1705
|
-
// For Javascript Disabled Cases
|
|
1706
|
-
React__default.createElement(
|
|
1707
|
-
'noscript',
|
|
1708
|
-
null,
|
|
1709
|
-
data.map(function (article, index) {
|
|
1710
|
-
var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
|
|
1711
|
-
|
|
1712
|
-
if (article._type === 'feature') {
|
|
1713
|
-
featureCount++;
|
|
1714
|
-
if (article.blank || checkExternalUrl(article.url.current)) {
|
|
1715
|
-
return React__default.createElement(
|
|
1716
|
-
reactBootstrap.Media,
|
|
1717
|
-
{
|
|
1718
|
-
key: article._id ? article._id : index,
|
|
1719
|
-
className: 'feature-media',
|
|
1720
|
-
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
1721
|
-
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
1722
|
-
'a',
|
|
1723
|
-
{ rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
|
|
1724
|
-
React__default.createElement(
|
|
1725
|
-
index$2.LazyLoad,
|
|
1726
|
-
{ height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
|
|
1727
|
-
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
1728
|
-
),
|
|
1729
|
-
article.source && React__default.createElement(
|
|
1730
|
-
'div',
|
|
1731
|
-
{ className: 'content-category-label' },
|
|
1732
|
-
React__default.createElement(
|
|
1733
|
-
'div',
|
|
1734
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1735
|
-
article.source
|
|
1736
|
-
)
|
|
1737
|
-
)
|
|
1738
|
-
),
|
|
1739
|
-
React__default.createElement(
|
|
1740
|
-
reactBootstrap.Media.Body,
|
|
1741
|
-
null,
|
|
1742
|
-
React__default.createElement(
|
|
1743
|
-
'a',
|
|
1744
|
-
{ rel: 'noopener', href: article.url.current, target: '_blank' },
|
|
1745
|
-
article.title && React__default.createElement(
|
|
1746
|
-
'h4',
|
|
1747
|
-
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
1748
|
-
article.title
|
|
1749
|
-
)
|
|
1750
|
-
),
|
|
1751
|
-
showPublished && article.published && React__default.createElement(
|
|
1752
|
-
'p',
|
|
1753
|
-
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
1754
|
-
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
1755
|
-
),
|
|
1756
|
-
showTimeDiff && article.published && React__default.createElement(
|
|
1757
|
-
'p',
|
|
1758
|
-
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
1759
|
-
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
1760
|
-
if (index > 3) {
|
|
1761
|
-
return null;
|
|
1762
|
-
}
|
|
1763
|
-
if (index === 3) {
|
|
1764
|
-
return React__default.createElement(
|
|
1765
|
-
React__default.Fragment,
|
|
1766
|
-
null,
|
|
1767
|
-
React__default.createElement(
|
|
1768
|
-
'em',
|
|
1769
|
-
{ style: { marginRight: '.5rem' } },
|
|
1770
|
-
'...'
|
|
1771
|
-
)
|
|
1772
|
-
);
|
|
1773
|
-
}
|
|
1774
|
-
return React__default.createElement(
|
|
1775
|
-
React__default.Fragment,
|
|
1776
|
-
null,
|
|
1777
|
-
React__default.createElement(
|
|
1778
|
-
'em',
|
|
1779
|
-
null,
|
|
1780
|
-
taxonomy.name
|
|
1781
|
-
),
|
|
1782
|
-
' |',
|
|
1783
|
-
' '
|
|
1784
|
-
);
|
|
1785
|
-
}),
|
|
1786
|
-
' ',
|
|
1787
|
-
React__default.createElement(
|
|
1788
|
-
'span',
|
|
1789
|
-
{ style: { display: 'inline-block' } },
|
|
1790
|
-
timeDifferenceCalc(article.published)
|
|
1791
|
-
)
|
|
1792
|
-
),
|
|
1793
|
-
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
|
|
1794
|
-
index$2.LazyLoad,
|
|
1795
|
-
{ height: 50 },
|
|
1796
|
-
React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
|
|
1797
|
-
),
|
|
1798
|
-
!article.thumbnail && !defaultImage && article.source && React__default.createElement(
|
|
1799
|
-
'div',
|
|
1800
|
-
{ className: 'content-category-label' },
|
|
1801
|
-
React__default.createElement(
|
|
1802
|
-
'div',
|
|
1803
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1804
|
-
article.source
|
|
1805
|
-
)
|
|
1806
|
-
),
|
|
1807
|
-
React__default.createElement(
|
|
1808
|
-
'div',
|
|
1809
|
-
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
1810
|
-
showCategory && article.contentCategory && React__default.createElement(
|
|
1811
|
-
'p',
|
|
1812
|
-
{
|
|
1813
|
-
className: 'article-category',
|
|
1814
|
-
style: {
|
|
1815
|
-
background: '#3FB618',
|
|
1816
|
-
color: '#ffffff',
|
|
1817
|
-
marginBottom: '.25rem',
|
|
1818
|
-
display: 'inline-block',
|
|
1819
|
-
padding: '0 .25rem',
|
|
1820
|
-
fontSize: '.8rem'
|
|
1821
|
-
} },
|
|
1822
|
-
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
1823
|
-
),
|
|
1824
|
-
article.issueSection && article.issueSection.name && React__default.createElement(
|
|
1825
|
-
'p',
|
|
1826
|
-
{
|
|
1827
|
-
className: 'issueSection',
|
|
1828
|
-
style: {
|
|
1829
|
-
background: '#000000',
|
|
1830
|
-
color: '#ffffff',
|
|
1831
|
-
marginBottom: '.25rem',
|
|
1832
|
-
marginLeft: '.25rem',
|
|
1833
|
-
display: 'inline-block',
|
|
1834
|
-
padding: '0 .25rem',
|
|
1835
|
-
fontSize: '.8rem'
|
|
1836
|
-
} },
|
|
1837
|
-
article.issueSection.name
|
|
1838
|
-
)
|
|
1839
|
-
),
|
|
1840
|
-
showPubInfo && (article.issue || article.volume) && React__default.createElement(
|
|
1841
|
-
'div',
|
|
1842
|
-
{ className: 'pubInfo' },
|
|
1843
|
-
article.volume && React__default.createElement(
|
|
1844
|
-
'p',
|
|
1845
|
-
{ className: 'qdeVolume' },
|
|
1846
|
-
article.volume
|
|
1847
|
-
),
|
|
1848
|
-
article.issue && React__default.createElement(
|
|
1849
|
-
'p',
|
|
1850
|
-
{ className: 'qdeIssue' },
|
|
1851
|
-
article.issue
|
|
1852
|
-
)
|
|
1853
|
-
),
|
|
1854
|
-
showIntro && article.summary && React__default.createElement(
|
|
1855
|
-
'p',
|
|
1856
|
-
{ className: 'pt-2 card-text' },
|
|
1857
|
-
entities.clean_html_1(article.summary)
|
|
1858
|
-
)
|
|
1859
|
-
)
|
|
1860
|
-
);
|
|
1861
|
-
} else {
|
|
1862
|
-
return React__default.createElement(
|
|
1863
|
-
reactBootstrap.Media,
|
|
1864
|
-
{
|
|
1865
|
-
key: article._id ? article._id : index,
|
|
1866
|
-
className: 'feature-media',
|
|
1867
|
-
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
1868
|
-
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
1869
|
-
'a',
|
|
1870
|
-
{ href: article.url.current, className: 'feature-wrapper' },
|
|
1871
|
-
React__default.createElement(
|
|
1872
|
-
index$2.LazyLoad,
|
|
1873
|
-
{ height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
|
|
1874
|
-
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
1875
|
-
),
|
|
1876
|
-
article.source && React__default.createElement(
|
|
1877
|
-
'div',
|
|
1878
|
-
{ className: 'content-category-label' },
|
|
1879
|
-
React__default.createElement(
|
|
1880
|
-
'div',
|
|
1881
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1882
|
-
article.source
|
|
1883
|
-
)
|
|
1884
|
-
)
|
|
1885
|
-
),
|
|
1886
|
-
React__default.createElement(
|
|
1887
|
-
reactBootstrap.Media.Body,
|
|
1888
|
-
null,
|
|
1889
|
-
React__default.createElement(
|
|
1890
|
-
'a',
|
|
1891
|
-
{ href: article.url.current },
|
|
1892
|
-
article.title && React__default.createElement(
|
|
1893
|
-
'h4',
|
|
1894
|
-
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
1895
|
-
article.title
|
|
1896
|
-
)
|
|
1897
|
-
),
|
|
1898
|
-
showPublished && article.published && React__default.createElement(
|
|
1899
|
-
'p',
|
|
1900
|
-
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
1901
|
-
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
1902
|
-
),
|
|
1903
|
-
showTimeDiff && article.published && React__default.createElement(
|
|
1904
|
-
'p',
|
|
1905
|
-
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
1906
|
-
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
1907
|
-
if (index > 3) {
|
|
1908
|
-
return null;
|
|
1909
|
-
}
|
|
1910
|
-
if (index === 3) {
|
|
1911
|
-
return React__default.createElement(
|
|
1912
|
-
React__default.Fragment,
|
|
1913
|
-
null,
|
|
1914
|
-
React__default.createElement(
|
|
1915
|
-
'em',
|
|
1916
|
-
{ style: { marginRight: '.5rem' } },
|
|
1917
|
-
'...'
|
|
1918
|
-
)
|
|
1919
|
-
);
|
|
1920
|
-
}
|
|
1921
|
-
return React__default.createElement(
|
|
1922
|
-
React__default.Fragment,
|
|
1923
|
-
null,
|
|
1924
|
-
React__default.createElement(
|
|
1925
|
-
'em',
|
|
1926
|
-
null,
|
|
1927
|
-
taxonomy.name
|
|
1928
|
-
),
|
|
1929
|
-
' |',
|
|
1930
|
-
' '
|
|
1931
|
-
);
|
|
1932
|
-
}),
|
|
1933
|
-
' ',
|
|
1934
|
-
React__default.createElement(
|
|
1935
|
-
'span',
|
|
1936
|
-
{ style: { display: 'inline-block' } },
|
|
1937
|
-
timeDifferenceCalc(article.published)
|
|
1938
|
-
)
|
|
1939
|
-
),
|
|
1940
|
-
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
|
|
1941
|
-
index$2.LazyLoad,
|
|
1942
|
-
{ height: 50 },
|
|
1943
|
-
React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
|
|
1944
|
-
),
|
|
1945
|
-
!article.thumbnail && !defaultImage && article.source && React__default.createElement(
|
|
1946
|
-
'div',
|
|
1947
|
-
{ className: 'content-category-label' },
|
|
1948
|
-
React__default.createElement(
|
|
270
|
+
|
|
271
|
+
if (article._type === 'feature') {
|
|
272
|
+
featureCount++;
|
|
273
|
+
if (article.blank || checkExternalUrl(article.url.current)) {
|
|
274
|
+
return React__default['default'].createElement(
|
|
275
|
+
visibilitySensor.VisibilitySensor,
|
|
276
|
+
{
|
|
277
|
+
key: article._id ? article._id : index$1,
|
|
278
|
+
partialVisibility: true,
|
|
279
|
+
onChange: function onChange(isVisible) {
|
|
280
|
+
isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
|
|
281
|
+
} },
|
|
282
|
+
React__default['default'].createElement(
|
|
283
|
+
React__default['default'].Fragment,
|
|
284
|
+
null,
|
|
285
|
+
React__default['default'].createElement(
|
|
286
|
+
reactBootstrap.Media,
|
|
287
|
+
{
|
|
288
|
+
key: article._id ? article._id : index$1,
|
|
289
|
+
className: 'feature-media',
|
|
290
|
+
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
291
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default['default'].createElement(
|
|
292
|
+
'a',
|
|
293
|
+
{ rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
|
|
294
|
+
React__default['default'].createElement(
|
|
295
|
+
index.LazyLoad,
|
|
296
|
+
{ height: imageHeight, placeholder: React__default['default'].createElement(ImagePlaceholder, null) },
|
|
297
|
+
article.thumbnail && article.thumbnail.asset ? React__default['default'].createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default['default'].createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default['default'].createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
298
|
+
),
|
|
299
|
+
article.source && React__default['default'].createElement(
|
|
1949
300
|
'div',
|
|
1950
|
-
{ className: '
|
|
1951
|
-
|
|
301
|
+
{ className: 'content-category-label' },
|
|
302
|
+
React__default['default'].createElement(
|
|
303
|
+
'div',
|
|
304
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
305
|
+
article.source
|
|
306
|
+
)
|
|
1952
307
|
)
|
|
1953
308
|
),
|
|
1954
|
-
React__default.createElement(
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
309
|
+
React__default['default'].createElement(
|
|
310
|
+
reactBootstrap.Media.Body,
|
|
311
|
+
null,
|
|
312
|
+
React__default['default'].createElement(
|
|
313
|
+
'a',
|
|
314
|
+
{ rel: 'noopener', href: article.url.current, target: '_blank' },
|
|
315
|
+
article.title && React__default['default'].createElement(
|
|
316
|
+
'h4',
|
|
317
|
+
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
318
|
+
article.title
|
|
319
|
+
)
|
|
320
|
+
),
|
|
321
|
+
showPublished && !showTimeDiff && article.published && React__default['default'].createElement(
|
|
1958
322
|
'p',
|
|
1959
|
-
{
|
|
1960
|
-
|
|
1961
|
-
style: {
|
|
1962
|
-
background: '#3FB618',
|
|
1963
|
-
color: '#ffffff',
|
|
1964
|
-
marginBottom: '.25rem',
|
|
1965
|
-
display: 'inline-block',
|
|
1966
|
-
padding: '0 .25rem',
|
|
1967
|
-
fontSize: '.8rem'
|
|
1968
|
-
} },
|
|
1969
|
-
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
323
|
+
{ className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
|
|
324
|
+
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
1970
325
|
),
|
|
1971
|
-
|
|
326
|
+
showTimeDiff && article.published && React__default['default'].createElement(
|
|
1972
327
|
'p',
|
|
1973
|
-
{
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
328
|
+
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
329
|
+
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
330
|
+
if (index > 3) {
|
|
331
|
+
return null;
|
|
332
|
+
}
|
|
333
|
+
if (index === 3) {
|
|
334
|
+
return React__default['default'].createElement(
|
|
335
|
+
React__default['default'].Fragment,
|
|
336
|
+
null,
|
|
337
|
+
React__default['default'].createElement(
|
|
338
|
+
'em',
|
|
339
|
+
{ style: { marginRight: '.5rem' } },
|
|
340
|
+
'...'
|
|
341
|
+
)
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
return React__default['default'].createElement(
|
|
345
|
+
React__default['default'].Fragment,
|
|
346
|
+
null,
|
|
347
|
+
React__default['default'].createElement(
|
|
348
|
+
'em',
|
|
349
|
+
null,
|
|
350
|
+
taxonomy.name
|
|
351
|
+
),
|
|
352
|
+
' |',
|
|
353
|
+
' '
|
|
354
|
+
);
|
|
355
|
+
}),
|
|
356
|
+
' ',
|
|
357
|
+
React__default['default'].createElement(
|
|
358
|
+
'span',
|
|
359
|
+
{ style: { display: 'inline-block' } },
|
|
360
|
+
timeDifferenceCalc(article.published)
|
|
361
|
+
)
|
|
362
|
+
),
|
|
363
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default['default'].createElement(
|
|
364
|
+
index.LazyLoad,
|
|
365
|
+
{ height: 50 },
|
|
366
|
+
React__default['default'].createElement(AuthorComponent.AuthorComponent, { key: index$1.toString(), index: index$1, authors: article.authorMapping })
|
|
367
|
+
),
|
|
368
|
+
!article.thumbnail && !defaultImage && article.source && React__default['default'].createElement(
|
|
369
|
+
'div',
|
|
370
|
+
{ className: 'content-category-label' },
|
|
371
|
+
React__default['default'].createElement(
|
|
372
|
+
'div',
|
|
373
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
374
|
+
article.source
|
|
375
|
+
)
|
|
376
|
+
),
|
|
377
|
+
React__default['default'].createElement(
|
|
378
|
+
'div',
|
|
379
|
+
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
380
|
+
showCategory && article.contentCategory && React__default['default'].createElement(
|
|
381
|
+
'p',
|
|
382
|
+
{
|
|
383
|
+
className: 'article-category',
|
|
384
|
+
style: {
|
|
385
|
+
background: '#3FB618',
|
|
386
|
+
color: '#ffffff',
|
|
387
|
+
marginBottom: '.25rem',
|
|
388
|
+
display: 'inline-block',
|
|
389
|
+
padding: '0 .25rem',
|
|
390
|
+
fontSize: '.8rem'
|
|
391
|
+
} },
|
|
392
|
+
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
393
|
+
),
|
|
394
|
+
article.issueSection && article.issueSection.name && React__default['default'].createElement(
|
|
395
|
+
'p',
|
|
396
|
+
{
|
|
397
|
+
className: 'issueSection',
|
|
398
|
+
style: {
|
|
399
|
+
background: '#000000',
|
|
400
|
+
color: '#ffffff',
|
|
401
|
+
marginBottom: '.25rem',
|
|
402
|
+
marginLeft: '.25rem',
|
|
403
|
+
display: 'inline-block',
|
|
404
|
+
padding: '0 .25rem',
|
|
405
|
+
fontSize: '.8rem'
|
|
406
|
+
} },
|
|
407
|
+
article.issueSection.name
|
|
408
|
+
)
|
|
409
|
+
),
|
|
410
|
+
showPubInfo && (article.issue || article.volume) && React__default['default'].createElement(
|
|
411
|
+
'div',
|
|
412
|
+
{ className: 'pubInfo' },
|
|
413
|
+
article.volume && React__default['default'].createElement(
|
|
414
|
+
'p',
|
|
415
|
+
{ className: 'qdeVolume' },
|
|
416
|
+
article.volume
|
|
417
|
+
),
|
|
418
|
+
article.issue && React__default['default'].createElement(
|
|
419
|
+
'p',
|
|
420
|
+
{ className: 'qdeIssue' },
|
|
421
|
+
article.issue
|
|
422
|
+
)
|
|
423
|
+
),
|
|
424
|
+
showIntro && article.summary && React__default['default'].createElement(
|
|
425
|
+
'p',
|
|
426
|
+
{ className: 'pt-2 card-text' },
|
|
427
|
+
entities.clean_html_1(article.summary)
|
|
428
|
+
)
|
|
429
|
+
)
|
|
430
|
+
)
|
|
431
|
+
)
|
|
432
|
+
);
|
|
433
|
+
} else {
|
|
434
|
+
return React__default['default'].createElement(
|
|
435
|
+
visibilitySensor.VisibilitySensor,
|
|
436
|
+
{
|
|
437
|
+
key: article._id ? article._id : index$1,
|
|
438
|
+
partialVisibility: true,
|
|
439
|
+
onChange: function onChange(isVisible) {
|
|
440
|
+
isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
|
|
441
|
+
} },
|
|
442
|
+
React__default['default'].createElement(
|
|
443
|
+
React__default['default'].Fragment,
|
|
444
|
+
null,
|
|
445
|
+
React__default['default'].createElement(
|
|
446
|
+
reactBootstrap.Media,
|
|
447
|
+
{
|
|
448
|
+
key: article._id ? article._id : index$1,
|
|
449
|
+
className: 'feature-media',
|
|
450
|
+
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
451
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default['default'].createElement(
|
|
452
|
+
'a',
|
|
453
|
+
{ href: article.url.current, className: 'feature-wrapper' },
|
|
454
|
+
React__default['default'].createElement(
|
|
455
|
+
index.LazyLoad,
|
|
456
|
+
{ height: imageHeight, placeholder: React__default['default'].createElement(ImagePlaceholder, null) },
|
|
457
|
+
article.thumbnail && article.thumbnail.asset ? React__default['default'].createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default['default'].createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default['default'].createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
458
|
+
),
|
|
459
|
+
article.source && React__default['default'].createElement(
|
|
460
|
+
'div',
|
|
461
|
+
{ className: 'content-category-label' },
|
|
462
|
+
React__default['default'].createElement(
|
|
463
|
+
'div',
|
|
464
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
465
|
+
article.source
|
|
466
|
+
)
|
|
1985
467
|
)
|
|
1986
468
|
),
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
469
|
+
React__default['default'].createElement(
|
|
470
|
+
reactBootstrap.Media.Body,
|
|
471
|
+
null,
|
|
472
|
+
React__default['default'].createElement(
|
|
473
|
+
'a',
|
|
474
|
+
{ href: article.url.current },
|
|
475
|
+
article.title && React__default['default'].createElement(
|
|
476
|
+
'h4',
|
|
477
|
+
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
478
|
+
article.title
|
|
479
|
+
)
|
|
480
|
+
),
|
|
481
|
+
showPublished && !showTimeDiff && article.published && React__default['default'].createElement(
|
|
1991
482
|
'p',
|
|
1992
|
-
{ className: '
|
|
1993
|
-
article.
|
|
483
|
+
{ className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
|
|
484
|
+
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
1994
485
|
),
|
|
1995
|
-
article.
|
|
486
|
+
showTimeDiff && article.published && React__default['default'].createElement(
|
|
1996
487
|
'p',
|
|
1997
|
-
{ className: '
|
|
1998
|
-
article.
|
|
488
|
+
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
489
|
+
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
490
|
+
if (index > 3) {
|
|
491
|
+
return null;
|
|
492
|
+
}
|
|
493
|
+
if (index === 3) {
|
|
494
|
+
return React__default['default'].createElement(
|
|
495
|
+
React__default['default'].Fragment,
|
|
496
|
+
null,
|
|
497
|
+
React__default['default'].createElement(
|
|
498
|
+
'em',
|
|
499
|
+
{ style: { marginRight: '.5rem' } },
|
|
500
|
+
'...'
|
|
501
|
+
)
|
|
502
|
+
);
|
|
503
|
+
}
|
|
504
|
+
if (index === 3) {
|
|
505
|
+
return React__default['default'].createElement(
|
|
506
|
+
React__default['default'].Fragment,
|
|
507
|
+
null,
|
|
508
|
+
React__default['default'].createElement(
|
|
509
|
+
'em',
|
|
510
|
+
{ style: { marginRight: '.5rem' } },
|
|
511
|
+
'...'
|
|
512
|
+
)
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
return React__default['default'].createElement(
|
|
516
|
+
React__default['default'].Fragment,
|
|
517
|
+
null,
|
|
518
|
+
React__default['default'].createElement(
|
|
519
|
+
'em',
|
|
520
|
+
null,
|
|
521
|
+
taxonomy.name
|
|
522
|
+
),
|
|
523
|
+
' |',
|
|
524
|
+
' '
|
|
525
|
+
);
|
|
526
|
+
}),
|
|
527
|
+
' ',
|
|
528
|
+
React__default['default'].createElement(
|
|
529
|
+
'span',
|
|
530
|
+
{ style: { display: 'inline-block' } },
|
|
531
|
+
timeDifferenceCalc(article.published)
|
|
532
|
+
)
|
|
533
|
+
),
|
|
534
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default['default'].createElement(
|
|
535
|
+
index.LazyLoad,
|
|
536
|
+
{ height: 50 },
|
|
537
|
+
React__default['default'].createElement(AuthorComponent.AuthorComponent, { key: index$1.toString(), index: index$1, authors: article.authorMapping })
|
|
538
|
+
),
|
|
539
|
+
!article.thumbnail && !defaultImage && article.source && React__default['default'].createElement(
|
|
540
|
+
'div',
|
|
541
|
+
{ className: 'content-category-label' },
|
|
542
|
+
React__default['default'].createElement(
|
|
543
|
+
'div',
|
|
544
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
545
|
+
article.source
|
|
546
|
+
)
|
|
547
|
+
),
|
|
548
|
+
React__default['default'].createElement(
|
|
549
|
+
'div',
|
|
550
|
+
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
551
|
+
showCategory && article.contentCategory && React__default['default'].createElement(
|
|
552
|
+
'p',
|
|
553
|
+
{
|
|
554
|
+
className: 'article-category',
|
|
555
|
+
style: {
|
|
556
|
+
background: '#3FB618',
|
|
557
|
+
color: '#ffffff',
|
|
558
|
+
marginBottom: '.25rem',
|
|
559
|
+
display: 'inline-block',
|
|
560
|
+
padding: '0 .25rem',
|
|
561
|
+
fontSize: '.8rem'
|
|
562
|
+
} },
|
|
563
|
+
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
564
|
+
),
|
|
565
|
+
article.issueSection && article.issueSection.name && React__default['default'].createElement(
|
|
566
|
+
'p',
|
|
567
|
+
{
|
|
568
|
+
className: 'issueSection',
|
|
569
|
+
style: {
|
|
570
|
+
background: '#000000',
|
|
571
|
+
color: '#ffffff',
|
|
572
|
+
marginBottom: '.25rem',
|
|
573
|
+
marginLeft: '.25rem',
|
|
574
|
+
display: 'inline-block',
|
|
575
|
+
padding: '0 .25rem',
|
|
576
|
+
fontSize: '.8rem'
|
|
577
|
+
} },
|
|
578
|
+
article.issueSection.name
|
|
579
|
+
)
|
|
580
|
+
),
|
|
581
|
+
showPubInfo && (article.issue || article.volume) && React__default['default'].createElement(
|
|
582
|
+
'div',
|
|
583
|
+
{ className: 'pubInfo' },
|
|
584
|
+
article.volume && React__default['default'].createElement(
|
|
585
|
+
'p',
|
|
586
|
+
{ className: 'qdeVolume' },
|
|
587
|
+
article.volume
|
|
588
|
+
),
|
|
589
|
+
article.issue && React__default['default'].createElement(
|
|
590
|
+
'p',
|
|
591
|
+
{ className: 'qdeIssue' },
|
|
592
|
+
article.issue
|
|
593
|
+
)
|
|
594
|
+
),
|
|
595
|
+
showIntro && article.summary && React__default['default'].createElement(
|
|
596
|
+
'p',
|
|
597
|
+
{ className: 'pt-2 card-text' },
|
|
598
|
+
entities.clean_html_1(article.summary)
|
|
1999
599
|
)
|
|
2000
|
-
),
|
|
2001
|
-
showIntro && article.summary && React__default.createElement(
|
|
2002
|
-
'p',
|
|
2003
|
-
{ className: 'pt-2 card-text' },
|
|
2004
|
-
entities.clean_html_1(article.summary)
|
|
2005
600
|
)
|
|
2006
601
|
)
|
|
2007
|
-
)
|
|
2008
|
-
|
|
2009
|
-
} else if (article._type === 'lg-infeed' && article.adUnit) {
|
|
2010
|
-
return React__default.createElement(ADlgInfeed.ADlgInfeed, _extends._extends({ index: index }, article));
|
|
2011
|
-
} else if (article._type === 'brandInsightAd' && article.adUnit) {
|
|
2012
|
-
return React__default.createElement(ADInfeed.ADInfeed, { index: index, infeedAd: article });
|
|
602
|
+
)
|
|
603
|
+
);
|
|
2013
604
|
}
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
605
|
+
} else if (article._type === 'lg-infeed' && article.adUnit) {
|
|
606
|
+
return React__default['default'].createElement(ADlgInfeed.ADlgInfeed, _extends._extends({ index: index$1 }, article));
|
|
607
|
+
} else if (article._type === 'brandInsightAd' && article.adUnit) {
|
|
608
|
+
return React__default['default'].createElement(ADInfeed.ADInfeed, { index: index$1, infeedAd: article });
|
|
609
|
+
}
|
|
610
|
+
if ((brandInsightAd ? index$1 > heroContent + featureCount : index$1 + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
|
|
611
|
+
return React__default['default'].createElement(
|
|
612
|
+
visibilitySensor.VisibilitySensor,
|
|
613
|
+
{
|
|
614
|
+
key: article._id ? article._id : index$1,
|
|
615
|
+
onChange: function onChange(isVisible) {
|
|
616
|
+
// Passing 'articleCount' instead of index because index will be including the indexes of ads whereas articleCount will be having index of artilce only.
|
|
617
|
+
isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, article.articleCount ? article.articleCount : index$1);
|
|
618
|
+
} },
|
|
619
|
+
React__default['default'].createElement(
|
|
620
|
+
React__default['default'].Fragment,
|
|
621
|
+
null,
|
|
622
|
+
React__default['default'].createElement(
|
|
2019
623
|
reactBootstrap.Media,
|
|
2020
624
|
{
|
|
2021
|
-
key: article._id ? article._id : index,
|
|
625
|
+
key: article._id ? article._id : index$1,
|
|
2022
626
|
style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
2023
|
-
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
627
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default['default'].createElement(
|
|
2024
628
|
'a',
|
|
2025
629
|
{ href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
|
|
2026
|
-
React__default.createElement(
|
|
2027
|
-
index
|
|
2028
|
-
{ height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
|
|
2029
|
-
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
630
|
+
React__default['default'].createElement(
|
|
631
|
+
index.LazyLoad,
|
|
632
|
+
{ height: imageHeight, placeholder: React__default['default'].createElement(ImagePlaceholder, null) },
|
|
633
|
+
article.thumbnail && article.thumbnail.asset ? React__default['default'].createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default['default'].createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default['default'].createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
2030
634
|
),
|
|
2031
|
-
article.source && React__default.createElement(
|
|
635
|
+
article.source && React__default['default'].createElement(
|
|
2032
636
|
'div',
|
|
2033
637
|
{ className: 'content-category-label' },
|
|
2034
|
-
React__default.createElement(
|
|
638
|
+
React__default['default'].createElement(
|
|
2035
639
|
'div',
|
|
2036
640
|
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
2037
641
|
article.source
|
|
2038
642
|
)
|
|
2039
643
|
)
|
|
2040
644
|
),
|
|
2041
|
-
React__default.createElement(
|
|
645
|
+
React__default['default'].createElement(
|
|
2042
646
|
reactBootstrap.Media.Body,
|
|
2043
647
|
null,
|
|
2044
|
-
React__default.createElement(
|
|
648
|
+
React__default['default'].createElement(
|
|
2045
649
|
'a',
|
|
2046
650
|
{ href: mapping[contentCategoryName] + '/' + article.url.current },
|
|
2047
|
-
article.title && React__default.createElement(
|
|
651
|
+
article.title && React__default['default'].createElement(
|
|
2048
652
|
'h4',
|
|
2049
653
|
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
2050
654
|
article.title
|
|
2051
655
|
)
|
|
2052
656
|
),
|
|
2053
|
-
showPublished && article.published && React__default.createElement(
|
|
657
|
+
showPublished && !showTimeDiff && article.published && React__default['default'].createElement(
|
|
2054
658
|
'p',
|
|
2055
|
-
{ className: 'card-text', style: { color: 'var(--dark)',
|
|
659
|
+
{ className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
|
|
2056
660
|
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
2057
661
|
),
|
|
2058
|
-
showTimeDiff && article.published && React__default.createElement(
|
|
662
|
+
showTimeDiff && article.published && React__default['default'].createElement(
|
|
2059
663
|
'p',
|
|
2060
664
|
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
2061
665
|
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
@@ -2063,20 +667,20 @@ var CardLoader = function CardLoader(_ref) {
|
|
|
2063
667
|
return null;
|
|
2064
668
|
}
|
|
2065
669
|
if (index === 3) {
|
|
2066
|
-
return React__default.createElement(
|
|
2067
|
-
React__default.Fragment,
|
|
670
|
+
return React__default['default'].createElement(
|
|
671
|
+
React__default['default'].Fragment,
|
|
2068
672
|
null,
|
|
2069
|
-
React__default.createElement(
|
|
673
|
+
React__default['default'].createElement(
|
|
2070
674
|
'em',
|
|
2071
675
|
{ style: { marginRight: '.5rem' } },
|
|
2072
676
|
'...'
|
|
2073
677
|
)
|
|
2074
678
|
);
|
|
2075
679
|
}
|
|
2076
|
-
return React__default.createElement(
|
|
2077
|
-
React__default.Fragment,
|
|
680
|
+
return React__default['default'].createElement(
|
|
681
|
+
React__default['default'].Fragment,
|
|
2078
682
|
null,
|
|
2079
|
-
React__default.createElement(
|
|
683
|
+
React__default['default'].createElement(
|
|
2080
684
|
'em',
|
|
2081
685
|
null,
|
|
2082
686
|
taxonomy.name
|
|
@@ -2086,34 +690,34 @@ var CardLoader = function CardLoader(_ref) {
|
|
|
2086
690
|
);
|
|
2087
691
|
}),
|
|
2088
692
|
' ',
|
|
2089
|
-
React__default.createElement(
|
|
693
|
+
React__default['default'].createElement(
|
|
2090
694
|
'span',
|
|
2091
695
|
{ style: { display: 'inline-block' } },
|
|
2092
696
|
timeDifferenceCalc(article.published)
|
|
2093
697
|
)
|
|
2094
698
|
),
|
|
2095
|
-
React__default.createElement(
|
|
699
|
+
React__default['default'].createElement(
|
|
2096
700
|
'div',
|
|
2097
701
|
{ className: 'author-sec', style: { lineHeight: 1.5 } },
|
|
2098
|
-
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
|
|
2099
|
-
index
|
|
702
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default['default'].createElement(
|
|
703
|
+
index.LazyLoad,
|
|
2100
704
|
{ height: 50 },
|
|
2101
|
-
React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
|
|
705
|
+
React__default['default'].createElement(AuthorComponent.AuthorComponent, { key: index$1.toString(), index: index$1, authors: article.authorMapping })
|
|
2102
706
|
)
|
|
2103
707
|
),
|
|
2104
|
-
!article.thumbnail && !defaultImage && article.source && React__default.createElement(
|
|
708
|
+
!article.thumbnail && !defaultImage && article.source && React__default['default'].createElement(
|
|
2105
709
|
'div',
|
|
2106
710
|
{ className: 'content-category-label' },
|
|
2107
|
-
React__default.createElement(
|
|
711
|
+
React__default['default'].createElement(
|
|
2108
712
|
'div',
|
|
2109
713
|
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
2110
714
|
article.source
|
|
2111
715
|
)
|
|
2112
716
|
),
|
|
2113
|
-
React__default.createElement(
|
|
717
|
+
React__default['default'].createElement(
|
|
2114
718
|
'div',
|
|
2115
719
|
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
2116
|
-
showCategory && article.contentCategory && React__default.createElement(
|
|
720
|
+
showCategory && article.contentCategory && React__default['default'].createElement(
|
|
2117
721
|
'p',
|
|
2118
722
|
{
|
|
2119
723
|
className: 'article-category',
|
|
@@ -2127,7 +731,7 @@ var CardLoader = function CardLoader(_ref) {
|
|
|
2127
731
|
} },
|
|
2128
732
|
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
2129
733
|
),
|
|
2130
|
-
article.issueSection && article.issueSection.name && React__default.createElement(
|
|
734
|
+
article.issueSection && article.issueSection.name && React__default['default'].createElement(
|
|
2131
735
|
'p',
|
|
2132
736
|
{
|
|
2133
737
|
className: 'issueSection',
|
|
@@ -2143,49 +747,556 @@ var CardLoader = function CardLoader(_ref) {
|
|
|
2143
747
|
article.issueSection.name
|
|
2144
748
|
)
|
|
2145
749
|
),
|
|
2146
|
-
showPubInfo && (article.issue || article.volume) && React__default.createElement(
|
|
750
|
+
showPubInfo && (article.issue || article.volume) && React__default['default'].createElement(
|
|
2147
751
|
'div',
|
|
2148
752
|
{ className: 'pubInfo' },
|
|
2149
|
-
article.volume && React__default.createElement(
|
|
753
|
+
article.volume && React__default['default'].createElement(
|
|
2150
754
|
'p',
|
|
2151
755
|
{ className: 'qdeVolume' },
|
|
2152
756
|
article.volume
|
|
2153
757
|
),
|
|
2154
|
-
article.issue && React__default.createElement(
|
|
758
|
+
article.issue && React__default['default'].createElement(
|
|
2155
759
|
'p',
|
|
2156
760
|
{ className: 'qdeIssue' },
|
|
2157
761
|
article.issue
|
|
2158
762
|
)
|
|
2159
763
|
),
|
|
2160
|
-
showIntro && article.summary && React__default.createElement(
|
|
764
|
+
showIntro && article.summary && React__default['default'].createElement(
|
|
2161
765
|
'p',
|
|
2162
766
|
{ className: 'pt-2 card-text' },
|
|
2163
767
|
entities.clean_html_1(article.summary)
|
|
2164
768
|
)
|
|
2165
769
|
)
|
|
2166
770
|
),
|
|
2167
|
-
React__default.createElement(
|
|
771
|
+
React__default['default'].createElement(
|
|
2168
772
|
'div',
|
|
2169
773
|
null,
|
|
2170
|
-
main.
|
|
774
|
+
main.main_43 && rightItems && (index$1 + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index$1, numberOfItemsBeforeAd, rightItems)
|
|
775
|
+
)
|
|
776
|
+
)
|
|
777
|
+
);
|
|
778
|
+
} else return null;
|
|
779
|
+
}) :
|
|
780
|
+
// For Javascript Disabled Cases
|
|
781
|
+
React__default['default'].createElement(
|
|
782
|
+
'noscript',
|
|
783
|
+
null,
|
|
784
|
+
data.map(function (article, index$1) {
|
|
785
|
+
var pageNumber = article.pageNumber || values.page;
|
|
786
|
+
var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
|
|
787
|
+
|
|
788
|
+
if (article._type === 'feature') {
|
|
789
|
+
featureCount++;
|
|
790
|
+
if (article.blank || checkExternalUrl(article.url.current)) {
|
|
791
|
+
return React__default['default'].createElement(
|
|
792
|
+
visibilitySensor.VisibilitySensor,
|
|
793
|
+
{
|
|
794
|
+
key: article._id ? article._id : index$1,
|
|
795
|
+
partialVisibility: true,
|
|
796
|
+
onChange: function onChange(isVisible) {
|
|
797
|
+
isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
|
|
798
|
+
} },
|
|
799
|
+
React__default['default'].createElement(
|
|
800
|
+
React__default['default'].Fragment,
|
|
801
|
+
null,
|
|
802
|
+
React__default['default'].createElement(
|
|
803
|
+
reactBootstrap.Media,
|
|
804
|
+
{
|
|
805
|
+
key: article._id ? article._id : index$1,
|
|
806
|
+
className: 'feature-media',
|
|
807
|
+
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
808
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default['default'].createElement(
|
|
809
|
+
'a',
|
|
810
|
+
{ rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
|
|
811
|
+
React__default['default'].createElement(
|
|
812
|
+
index.LazyLoad,
|
|
813
|
+
{ height: imageHeight, placeholder: React__default['default'].createElement(ImagePlaceholder, null) },
|
|
814
|
+
article.thumbnail && article.thumbnail.asset ? React__default['default'].createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default['default'].createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default['default'].createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
815
|
+
),
|
|
816
|
+
article.source && React__default['default'].createElement(
|
|
817
|
+
'div',
|
|
818
|
+
{ className: 'content-category-label' },
|
|
819
|
+
React__default['default'].createElement(
|
|
820
|
+
'div',
|
|
821
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
822
|
+
article.source
|
|
823
|
+
)
|
|
824
|
+
)
|
|
825
|
+
),
|
|
826
|
+
React__default['default'].createElement(
|
|
827
|
+
reactBootstrap.Media.Body,
|
|
828
|
+
null,
|
|
829
|
+
React__default['default'].createElement(
|
|
830
|
+
'a',
|
|
831
|
+
{ rel: 'noopener', href: article.url.current, target: '_blank' },
|
|
832
|
+
article.title && React__default['default'].createElement(
|
|
833
|
+
'h4',
|
|
834
|
+
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
835
|
+
article.title
|
|
836
|
+
)
|
|
837
|
+
),
|
|
838
|
+
showPublished && article.published && React__default['default'].createElement(
|
|
839
|
+
'p',
|
|
840
|
+
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
841
|
+
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
842
|
+
),
|
|
843
|
+
showTimeDiff && article.published && React__default['default'].createElement(
|
|
844
|
+
'p',
|
|
845
|
+
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
846
|
+
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
847
|
+
if (index > 3) {
|
|
848
|
+
return null;
|
|
849
|
+
}
|
|
850
|
+
if (index === 3) {
|
|
851
|
+
return React__default['default'].createElement(
|
|
852
|
+
React__default['default'].Fragment,
|
|
853
|
+
null,
|
|
854
|
+
React__default['default'].createElement(
|
|
855
|
+
'em',
|
|
856
|
+
{ style: { marginRight: '.5rem' } },
|
|
857
|
+
'...'
|
|
858
|
+
)
|
|
859
|
+
);
|
|
860
|
+
}
|
|
861
|
+
return React__default['default'].createElement(
|
|
862
|
+
React__default['default'].Fragment,
|
|
863
|
+
null,
|
|
864
|
+
React__default['default'].createElement(
|
|
865
|
+
'em',
|
|
866
|
+
null,
|
|
867
|
+
taxonomy.name
|
|
868
|
+
),
|
|
869
|
+
' |',
|
|
870
|
+
' '
|
|
871
|
+
);
|
|
872
|
+
}),
|
|
873
|
+
' ',
|
|
874
|
+
React__default['default'].createElement(
|
|
875
|
+
'span',
|
|
876
|
+
{ style: { display: 'inline-block' } },
|
|
877
|
+
timeDifferenceCalc(article.published)
|
|
878
|
+
)
|
|
879
|
+
),
|
|
880
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default['default'].createElement(
|
|
881
|
+
index.LazyLoad,
|
|
882
|
+
{ height: 50 },
|
|
883
|
+
React__default['default'].createElement(AuthorComponent.AuthorComponent, { key: index$1.toString(), index: index$1, authors: article.authorMapping })
|
|
884
|
+
),
|
|
885
|
+
!article.thumbnail && !defaultImage && article.source && React__default['default'].createElement(
|
|
886
|
+
'div',
|
|
887
|
+
{ className: 'content-category-label' },
|
|
888
|
+
React__default['default'].createElement(
|
|
889
|
+
'div',
|
|
890
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
891
|
+
article.source
|
|
892
|
+
)
|
|
893
|
+
),
|
|
894
|
+
React__default['default'].createElement(
|
|
895
|
+
'div',
|
|
896
|
+
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
897
|
+
showCategory && article.contentCategory && React__default['default'].createElement(
|
|
898
|
+
'p',
|
|
899
|
+
{
|
|
900
|
+
className: 'article-category',
|
|
901
|
+
style: {
|
|
902
|
+
background: '#3FB618',
|
|
903
|
+
color: '#ffffff',
|
|
904
|
+
marginBottom: '.25rem',
|
|
905
|
+
display: 'inline-block',
|
|
906
|
+
padding: '0 .25rem',
|
|
907
|
+
fontSize: '.8rem'
|
|
908
|
+
} },
|
|
909
|
+
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
910
|
+
),
|
|
911
|
+
article.issueSection && article.issueSection.name && React__default['default'].createElement(
|
|
912
|
+
'p',
|
|
913
|
+
{
|
|
914
|
+
className: 'issueSection',
|
|
915
|
+
style: {
|
|
916
|
+
background: '#000000',
|
|
917
|
+
color: '#ffffff',
|
|
918
|
+
marginBottom: '.25rem',
|
|
919
|
+
marginLeft: '.25rem',
|
|
920
|
+
display: 'inline-block',
|
|
921
|
+
padding: '0 .25rem',
|
|
922
|
+
fontSize: '.8rem'
|
|
923
|
+
} },
|
|
924
|
+
article.issueSection.name
|
|
925
|
+
)
|
|
926
|
+
),
|
|
927
|
+
showPubInfo && (article.issue || article.volume) && React__default['default'].createElement(
|
|
928
|
+
'div',
|
|
929
|
+
{ className: 'pubInfo' },
|
|
930
|
+
article.volume && React__default['default'].createElement(
|
|
931
|
+
'p',
|
|
932
|
+
{ className: 'qdeVolume' },
|
|
933
|
+
article.volume
|
|
934
|
+
),
|
|
935
|
+
article.issue && React__default['default'].createElement(
|
|
936
|
+
'p',
|
|
937
|
+
{ className: 'qdeIssue' },
|
|
938
|
+
article.issue
|
|
939
|
+
)
|
|
940
|
+
),
|
|
941
|
+
showIntro && article.summary && React__default['default'].createElement(
|
|
942
|
+
'p',
|
|
943
|
+
{ className: 'pt-2 card-text' },
|
|
944
|
+
entities.clean_html_1(article.summary)
|
|
945
|
+
)
|
|
946
|
+
)
|
|
947
|
+
)
|
|
948
|
+
)
|
|
949
|
+
);
|
|
950
|
+
} else {
|
|
951
|
+
return React__default['default'].createElement(
|
|
952
|
+
visibilitySensor.VisibilitySensor,
|
|
953
|
+
{
|
|
954
|
+
key: article._id ? article._id : index$1,
|
|
955
|
+
partialVisibility: true,
|
|
956
|
+
onChange: function onChange(isVisible) {
|
|
957
|
+
isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
|
|
958
|
+
} },
|
|
959
|
+
React__default['default'].createElement(
|
|
960
|
+
React__default['default'].Fragment,
|
|
961
|
+
null,
|
|
962
|
+
React__default['default'].createElement(
|
|
963
|
+
reactBootstrap.Media,
|
|
964
|
+
{
|
|
965
|
+
key: article._id ? article._id : index$1,
|
|
966
|
+
className: 'feature-media',
|
|
967
|
+
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
968
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default['default'].createElement(
|
|
969
|
+
'a',
|
|
970
|
+
{ href: article.url.current, className: 'feature-wrapper' },
|
|
971
|
+
React__default['default'].createElement(
|
|
972
|
+
index.LazyLoad,
|
|
973
|
+
{ height: imageHeight, placeholder: React__default['default'].createElement(ImagePlaceholder, null) },
|
|
974
|
+
article.thumbnail && article.thumbnail.asset ? React__default['default'].createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default['default'].createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default['default'].createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
975
|
+
),
|
|
976
|
+
article.source && React__default['default'].createElement(
|
|
977
|
+
'div',
|
|
978
|
+
{ className: 'content-category-label' },
|
|
979
|
+
React__default['default'].createElement(
|
|
980
|
+
'div',
|
|
981
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
982
|
+
article.source
|
|
983
|
+
)
|
|
984
|
+
)
|
|
985
|
+
),
|
|
986
|
+
React__default['default'].createElement(
|
|
987
|
+
reactBootstrap.Media.Body,
|
|
988
|
+
null,
|
|
989
|
+
React__default['default'].createElement(
|
|
990
|
+
'a',
|
|
991
|
+
{ href: article.url.current },
|
|
992
|
+
article.title && React__default['default'].createElement(
|
|
993
|
+
'h4',
|
|
994
|
+
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
995
|
+
article.title
|
|
996
|
+
)
|
|
997
|
+
),
|
|
998
|
+
showPublished && article.published && React__default['default'].createElement(
|
|
999
|
+
'p',
|
|
1000
|
+
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
1001
|
+
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
1002
|
+
),
|
|
1003
|
+
showTimeDiff && article.published && React__default['default'].createElement(
|
|
1004
|
+
'p',
|
|
1005
|
+
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
1006
|
+
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
1007
|
+
if (index > 3) {
|
|
1008
|
+
return null;
|
|
1009
|
+
}
|
|
1010
|
+
if (index === 3) {
|
|
1011
|
+
return React__default['default'].createElement(
|
|
1012
|
+
React__default['default'].Fragment,
|
|
1013
|
+
null,
|
|
1014
|
+
React__default['default'].createElement(
|
|
1015
|
+
'em',
|
|
1016
|
+
{ style: { marginRight: '.5rem' } },
|
|
1017
|
+
'...'
|
|
1018
|
+
)
|
|
1019
|
+
);
|
|
1020
|
+
}
|
|
1021
|
+
return React__default['default'].createElement(
|
|
1022
|
+
React__default['default'].Fragment,
|
|
1023
|
+
null,
|
|
1024
|
+
React__default['default'].createElement(
|
|
1025
|
+
'em',
|
|
1026
|
+
null,
|
|
1027
|
+
taxonomy.name
|
|
1028
|
+
),
|
|
1029
|
+
' |',
|
|
1030
|
+
' '
|
|
1031
|
+
);
|
|
1032
|
+
}),
|
|
1033
|
+
' ',
|
|
1034
|
+
React__default['default'].createElement(
|
|
1035
|
+
'span',
|
|
1036
|
+
{ style: { display: 'inline-block' } },
|
|
1037
|
+
timeDifferenceCalc(article.published)
|
|
1038
|
+
)
|
|
1039
|
+
),
|
|
1040
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default['default'].createElement(
|
|
1041
|
+
index.LazyLoad,
|
|
1042
|
+
{ height: 50 },
|
|
1043
|
+
React__default['default'].createElement(AuthorComponent.AuthorComponent, { key: index$1.toString(), index: index$1, authors: article.authorMapping })
|
|
1044
|
+
),
|
|
1045
|
+
!article.thumbnail && !defaultImage && article.source && React__default['default'].createElement(
|
|
1046
|
+
'div',
|
|
1047
|
+
{ className: 'content-category-label' },
|
|
1048
|
+
React__default['default'].createElement(
|
|
1049
|
+
'div',
|
|
1050
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1051
|
+
article.source
|
|
1052
|
+
)
|
|
1053
|
+
),
|
|
1054
|
+
React__default['default'].createElement(
|
|
1055
|
+
'div',
|
|
1056
|
+
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
1057
|
+
showCategory && article.contentCategory && React__default['default'].createElement(
|
|
1058
|
+
'p',
|
|
1059
|
+
{
|
|
1060
|
+
className: 'article-category',
|
|
1061
|
+
style: {
|
|
1062
|
+
background: '#3FB618',
|
|
1063
|
+
color: '#ffffff',
|
|
1064
|
+
marginBottom: '.25rem',
|
|
1065
|
+
display: 'inline-block',
|
|
1066
|
+
padding: '0 .25rem',
|
|
1067
|
+
fontSize: '.8rem'
|
|
1068
|
+
} },
|
|
1069
|
+
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
1070
|
+
),
|
|
1071
|
+
article.issueSection && article.issueSection.name && React__default['default'].createElement(
|
|
1072
|
+
'p',
|
|
1073
|
+
{
|
|
1074
|
+
className: 'issueSection',
|
|
1075
|
+
style: {
|
|
1076
|
+
background: '#000000',
|
|
1077
|
+
color: '#ffffff',
|
|
1078
|
+
marginBottom: '.25rem',
|
|
1079
|
+
marginLeft: '.25rem',
|
|
1080
|
+
display: 'inline-block',
|
|
1081
|
+
padding: '0 .25rem',
|
|
1082
|
+
fontSize: '.8rem'
|
|
1083
|
+
} },
|
|
1084
|
+
article.issueSection.name
|
|
1085
|
+
)
|
|
1086
|
+
),
|
|
1087
|
+
showPubInfo && (article.issue || article.volume) && React__default['default'].createElement(
|
|
1088
|
+
'div',
|
|
1089
|
+
{ className: 'pubInfo' },
|
|
1090
|
+
article.volume && React__default['default'].createElement(
|
|
1091
|
+
'p',
|
|
1092
|
+
{ className: 'qdeVolume' },
|
|
1093
|
+
article.volume
|
|
1094
|
+
),
|
|
1095
|
+
article.issue && React__default['default'].createElement(
|
|
1096
|
+
'p',
|
|
1097
|
+
{ className: 'qdeIssue' },
|
|
1098
|
+
article.issue
|
|
1099
|
+
)
|
|
1100
|
+
),
|
|
1101
|
+
showIntro && article.summary && React__default['default'].createElement(
|
|
1102
|
+
'p',
|
|
1103
|
+
{ className: 'pt-2 card-text' },
|
|
1104
|
+
entities.clean_html_1(article.summary)
|
|
1105
|
+
)
|
|
1106
|
+
)
|
|
1107
|
+
)
|
|
1108
|
+
)
|
|
1109
|
+
);
|
|
1110
|
+
}
|
|
1111
|
+
} else if (article._type === 'lg-infeed' && article.adUnit) {
|
|
1112
|
+
return React__default['default'].createElement(ADlgInfeed.ADlgInfeed, _extends._extends({ index: index$1 }, article));
|
|
1113
|
+
} else if (article._type === 'brandInsightAd' && article.adUnit) {
|
|
1114
|
+
return React__default['default'].createElement(ADInfeed.ADInfeed, { index: index$1, infeedAd: article });
|
|
1115
|
+
}
|
|
1116
|
+
if ((brandInsightAd ? index$1 > heroContent + featureCount : index$1 + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
|
|
1117
|
+
return React__default['default'].createElement(
|
|
1118
|
+
visibilitySensor.VisibilitySensor,
|
|
1119
|
+
{
|
|
1120
|
+
key: article._id ? article._id : index$1,
|
|
1121
|
+
onChange: function onChange(isVisible) {
|
|
1122
|
+
// Passing 'articleCount' instead of index because index will be including the indexes of ads whereas articleCount will be having index of artilce only.
|
|
1123
|
+
isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, article.articleCount ? article.articleCount : index$1);
|
|
1124
|
+
} },
|
|
1125
|
+
React__default['default'].createElement(
|
|
1126
|
+
React__default['default'].Fragment,
|
|
1127
|
+
null,
|
|
1128
|
+
React__default['default'].createElement(
|
|
1129
|
+
reactBootstrap.Media,
|
|
1130
|
+
{
|
|
1131
|
+
key: article._id ? article._id : index$1,
|
|
1132
|
+
style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
1133
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default['default'].createElement(
|
|
1134
|
+
'a',
|
|
1135
|
+
{ href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
|
|
1136
|
+
React__default['default'].createElement(
|
|
1137
|
+
index.LazyLoad,
|
|
1138
|
+
{ height: imageHeight, placeholder: React__default['default'].createElement(ImagePlaceholder, null) },
|
|
1139
|
+
article.thumbnail && article.thumbnail.asset ? React__default['default'].createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default['default'].createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default['default'].createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
1140
|
+
),
|
|
1141
|
+
article.source && React__default['default'].createElement(
|
|
1142
|
+
'div',
|
|
1143
|
+
{ className: 'content-category-label' },
|
|
1144
|
+
React__default['default'].createElement(
|
|
1145
|
+
'div',
|
|
1146
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1147
|
+
article.source
|
|
1148
|
+
)
|
|
1149
|
+
)
|
|
1150
|
+
),
|
|
1151
|
+
React__default['default'].createElement(
|
|
1152
|
+
reactBootstrap.Media.Body,
|
|
1153
|
+
null,
|
|
1154
|
+
React__default['default'].createElement(
|
|
1155
|
+
'a',
|
|
1156
|
+
{ href: mapping[contentCategoryName] + '/' + article.url.current },
|
|
1157
|
+
article.title && React__default['default'].createElement(
|
|
1158
|
+
'h4',
|
|
1159
|
+
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
1160
|
+
article.title
|
|
1161
|
+
)
|
|
1162
|
+
),
|
|
1163
|
+
showPublished && article.published && React__default['default'].createElement(
|
|
1164
|
+
'p',
|
|
1165
|
+
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
1166
|
+
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
1167
|
+
),
|
|
1168
|
+
showTimeDiff && article.published && React__default['default'].createElement(
|
|
1169
|
+
'p',
|
|
1170
|
+
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
1171
|
+
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
1172
|
+
if (index > 3) {
|
|
1173
|
+
return null;
|
|
1174
|
+
}
|
|
1175
|
+
if (index === 3) {
|
|
1176
|
+
return React__default['default'].createElement(
|
|
1177
|
+
React__default['default'].Fragment,
|
|
1178
|
+
null,
|
|
1179
|
+
React__default['default'].createElement(
|
|
1180
|
+
'em',
|
|
1181
|
+
{ style: { marginRight: '.5rem' } },
|
|
1182
|
+
'...'
|
|
1183
|
+
)
|
|
1184
|
+
);
|
|
1185
|
+
}
|
|
1186
|
+
return React__default['default'].createElement(
|
|
1187
|
+
React__default['default'].Fragment,
|
|
1188
|
+
null,
|
|
1189
|
+
React__default['default'].createElement(
|
|
1190
|
+
'em',
|
|
1191
|
+
null,
|
|
1192
|
+
taxonomy.name
|
|
1193
|
+
),
|
|
1194
|
+
' |',
|
|
1195
|
+
' '
|
|
1196
|
+
);
|
|
1197
|
+
}),
|
|
1198
|
+
' ',
|
|
1199
|
+
React__default['default'].createElement(
|
|
1200
|
+
'span',
|
|
1201
|
+
{ style: { display: 'inline-block' } },
|
|
1202
|
+
timeDifferenceCalc(article.published)
|
|
1203
|
+
)
|
|
1204
|
+
),
|
|
1205
|
+
React__default['default'].createElement(
|
|
1206
|
+
'div',
|
|
1207
|
+
{ className: 'author-sec', style: { lineHeight: 1.5 } },
|
|
1208
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default['default'].createElement(
|
|
1209
|
+
index.LazyLoad,
|
|
1210
|
+
{ height: 50 },
|
|
1211
|
+
React__default['default'].createElement(AuthorComponent.AuthorComponent, { key: index$1.toString(), index: index$1, authors: article.authorMapping })
|
|
1212
|
+
)
|
|
1213
|
+
),
|
|
1214
|
+
!article.thumbnail && !defaultImage && article.source && React__default['default'].createElement(
|
|
1215
|
+
'div',
|
|
1216
|
+
{ className: 'content-category-label' },
|
|
1217
|
+
React__default['default'].createElement(
|
|
1218
|
+
'div',
|
|
1219
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1220
|
+
article.source
|
|
1221
|
+
)
|
|
1222
|
+
),
|
|
1223
|
+
React__default['default'].createElement(
|
|
1224
|
+
'div',
|
|
1225
|
+
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
1226
|
+
showCategory && article.contentCategory && React__default['default'].createElement(
|
|
1227
|
+
'p',
|
|
1228
|
+
{
|
|
1229
|
+
className: 'article-category',
|
|
1230
|
+
style: {
|
|
1231
|
+
background: '#3FB618',
|
|
1232
|
+
color: '#ffffff',
|
|
1233
|
+
marginBottom: '.25rem',
|
|
1234
|
+
display: 'inline-block',
|
|
1235
|
+
padding: '0 .25rem',
|
|
1236
|
+
fontSize: '.8rem'
|
|
1237
|
+
} },
|
|
1238
|
+
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
1239
|
+
),
|
|
1240
|
+
article.issueSection && article.issueSection.name && React__default['default'].createElement(
|
|
1241
|
+
'p',
|
|
1242
|
+
{
|
|
1243
|
+
className: 'issueSection',
|
|
1244
|
+
style: {
|
|
1245
|
+
background: '#000000',
|
|
1246
|
+
color: '#ffffff',
|
|
1247
|
+
marginBottom: '.25rem',
|
|
1248
|
+
marginLeft: '.25rem',
|
|
1249
|
+
display: 'inline-block',
|
|
1250
|
+
padding: '0 .25rem',
|
|
1251
|
+
fontSize: '.8rem'
|
|
1252
|
+
} },
|
|
1253
|
+
article.issueSection.name
|
|
1254
|
+
)
|
|
1255
|
+
),
|
|
1256
|
+
showPubInfo && (article.issue || article.volume) && React__default['default'].createElement(
|
|
1257
|
+
'div',
|
|
1258
|
+
{ className: 'pubInfo' },
|
|
1259
|
+
article.volume && React__default['default'].createElement(
|
|
1260
|
+
'p',
|
|
1261
|
+
{ className: 'qdeVolume' },
|
|
1262
|
+
article.volume
|
|
1263
|
+
),
|
|
1264
|
+
article.issue && React__default['default'].createElement(
|
|
1265
|
+
'p',
|
|
1266
|
+
{ className: 'qdeIssue' },
|
|
1267
|
+
article.issue
|
|
1268
|
+
)
|
|
1269
|
+
),
|
|
1270
|
+
showIntro && article.summary && React__default['default'].createElement(
|
|
1271
|
+
'p',
|
|
1272
|
+
{ className: 'pt-2 card-text' },
|
|
1273
|
+
entities.clean_html_1(article.summary)
|
|
1274
|
+
)
|
|
1275
|
+
)
|
|
1276
|
+
),
|
|
1277
|
+
React__default['default'].createElement(
|
|
1278
|
+
'div',
|
|
1279
|
+
null,
|
|
1280
|
+
main.main_43 && rightItems && (index$1 + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index$1, numberOfItemsBeforeAd, rightItems)
|
|
1281
|
+
)
|
|
2171
1282
|
)
|
|
2172
1283
|
);
|
|
2173
1284
|
} else return null;
|
|
2174
1285
|
})
|
|
2175
|
-
) : React__default.createElement(
|
|
1286
|
+
) : React__default['default'].createElement(
|
|
2176
1287
|
'div',
|
|
2177
1288
|
null,
|
|
2178
|
-
React__default.createElement(
|
|
1289
|
+
React__default['default'].createElement(
|
|
2179
1290
|
'h5',
|
|
2180
1291
|
null,
|
|
2181
|
-
React__default.createElement(
|
|
1292
|
+
React__default['default'].createElement(
|
|
2182
1293
|
'em',
|
|
2183
1294
|
null,
|
|
2184
1295
|
'New content coming soon, please check back later.'
|
|
2185
1296
|
)
|
|
2186
1297
|
)
|
|
2187
1298
|
),
|
|
2188
|
-
React__default.createElement(
|
|
1299
|
+
React__default['default'].createElement(
|
|
2189
1300
|
'style',
|
|
2190
1301
|
{ jsx: 'true' },
|
|
2191
1302
|
'\n .displayLabelThumb {\n margin: 0 auto;\n margin-top: -1.25rem;\n background-color: white;\n position: relative;\n }\n .content-category-label {\n margin: 0.5rem 0;\n display: block;\n }\n .sanityDisplayLabel {\n margin: 0.5rem 0;\n border: 1px solid black;\n width: fit-content;\n width: -moz-fit-content;\n padding: 5px;\n color: #484848;\n border-radius: 2px;\n }\n .feature-media > .media-body {\n -webkit-box-flex: none;\n -ms-flex: none;\n flex: none;\n }\n .img-wrapper img {\n max-height: 240px;\n height: auto;\n width: 100%;\n object-fit: contain;\n }\n .feature-wrapper {\n height: 100%;\n width: 100%;\n }\n .feature-wrapper img {\n width: 100%;\n margin-bottom: 1em;\n }\n @media only screen and (min-width: 768px) {\n .img-wrapper > img {\n padding-right: 1em;\n }\n }\n @media only screen and (max-width: 767px) {\n .sanityDisplayLabel {\n max-width: 100%;\n }\n .img-wrapper {\n width: 100%;\n }\n .img-wrapper img {\n padding-bottom: 1em;\n }\n .media {\n flex-direction: column !important;\n }\n }\n '
|
|
@@ -2194,11 +1305,11 @@ var CardLoader = function CardLoader(_ref) {
|
|
|
2194
1305
|
};
|
|
2195
1306
|
|
|
2196
1307
|
var ImagePlaceholder = function ImagePlaceholder() {
|
|
2197
|
-
return React__default.createElement(
|
|
2198
|
-
React__default.Fragment,
|
|
1308
|
+
return React__default['default'].createElement(
|
|
1309
|
+
React__default['default'].Fragment,
|
|
2199
1310
|
null,
|
|
2200
|
-
React__default.createElement('div', { className: 'queuedeck-exp-image-placeholder' }),
|
|
2201
|
-
React__default.createElement(
|
|
1311
|
+
React__default['default'].createElement('div', { className: 'queuedeck-exp-image-placeholder' }),
|
|
1312
|
+
React__default['default'].createElement(
|
|
2202
1313
|
'style',
|
|
2203
1314
|
{ jsx: 'true' },
|
|
2204
1315
|
'\n .queuedeck-exp-image-placeholder {\n width: 240px;\n height: 0;\n padding-top: calc(240px * 9 / 16);\n margin: 0 1rem 0 0;\n }\n @media only screen and (max-width: 767px) {\n .queuedeck-exp-image-placeholder {\n width: 100%;\n height: 0;\n padding-top: calc(100% * 9 / 16);\n margin: 0 0 1rem 0;\n }\n }\n '
|
|
@@ -2208,7 +1319,7 @@ var ImagePlaceholder = function ImagePlaceholder() {
|
|
|
2208
1319
|
|
|
2209
1320
|
var renderMobileAd = function renderMobileAd(index, numberOfItemsBeforeAd, rightItems) {
|
|
2210
1321
|
var i = ((index + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
|
|
2211
|
-
return React__default.createElement(
|
|
1322
|
+
return React__default['default'].createElement(
|
|
2212
1323
|
'div',
|
|
2213
1324
|
{ style: { display: 'flex', flex: '1 0 auto' } },
|
|
2214
1325
|
rightItems[i].component
|
|
@@ -2223,46 +1334,6 @@ var usePrevious = function usePrevious(value) {
|
|
|
2223
1334
|
return ref.current;
|
|
2224
1335
|
};
|
|
2225
1336
|
|
|
2226
|
-
var Pagination = function Pagination(_ref2) {
|
|
2227
|
-
var totalPostsCount = _ref2.totalPostsCount,
|
|
2228
|
-
itemsPerPage = _ref2.itemsPerPage,
|
|
2229
|
-
currentPage = _ref2.currentPage,
|
|
2230
|
-
handlePageChange = _ref2.handlePageChange,
|
|
2231
|
-
data = _ref2.data;
|
|
2232
|
-
|
|
2233
|
-
var pageCount = Math.ceil(totalPostsCount / itemsPerPage);
|
|
2234
|
-
return React__default.createElement(
|
|
2235
|
-
'div',
|
|
2236
|
-
{ className: '' + (!data ? 'd-none' : 'd-block') },
|
|
2237
|
-
React__default.createElement(ReactPaginate, {
|
|
2238
|
-
pageCount: pageCount,
|
|
2239
|
-
marginPagesDisplayed: 1,
|
|
2240
|
-
pageRangeDisplayed: main.main_36 ? 3 : 9,
|
|
2241
|
-
initialPage: currentPage - 1,
|
|
2242
|
-
disableInitialCallback: true,
|
|
2243
|
-
onPageChange: function onPageChange(_ref3) {
|
|
2244
|
-
var selected = _ref3.selected;
|
|
2245
|
-
return handlePageChange(selected + 1);
|
|
2246
|
-
},
|
|
2247
|
-
hrefBuilder: function hrefBuilder(page) {
|
|
2248
|
-
return page === 1 ? '/' : '?page=' + page;
|
|
2249
|
-
},
|
|
2250
|
-
previousLabel: '<',
|
|
2251
|
-
nextLabel: '>',
|
|
2252
|
-
containerClassName: 'pagination-container',
|
|
2253
|
-
previousLinkClassName: 'previous',
|
|
2254
|
-
nextLinkClassName: 'next',
|
|
2255
|
-
disabledClassName: 'disbaled',
|
|
2256
|
-
activeClassName: 'active'
|
|
2257
|
-
}),
|
|
2258
|
-
React__default.createElement(
|
|
2259
|
-
'style',
|
|
2260
|
-
{ jsx: 'true' },
|
|
2261
|
-
'\n .pagination-container {\n list-style: none;\n display: flex;\n justify-content: center;\n margin: 3rem 0 3rem 0;\n padding-left: 0;\n }\n .pagination-container a {\n padding: 10px;\n border: 1px solid #dee2e6;\n }\n .pagination-container a:hover {\n text-decoration: none;\n background-color: #e9ecef;\n border-color: #dee2e6;\n }\n .pagination-container .active a {\n color: #fff;\n background-color: var(--primary);\n border-color: #007bff;\n }\n .pagination-container .previous a {\n border-radius: 5px 0 0 5px;\n }\n .pagination-container .next a {\n border-radius: 0 5px 5px 0;\n }\n @media only screen and (max-width: 768px) {\n .pagination-container {\n margin-bottom: 6rem;\n }\n }\n '
|
|
2262
|
-
)
|
|
2263
|
-
);
|
|
2264
|
-
};
|
|
2265
|
-
|
|
2266
1337
|
var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
2267
1338
|
var router = Router.useRouter();
|
|
2268
1339
|
|
|
@@ -2278,12 +1349,15 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
|
2278
1349
|
}, [router]);
|
|
2279
1350
|
|
|
2280
1351
|
var initialData = props.dataRecord,
|
|
2281
|
-
initialCurrentPage = props.currentPage,
|
|
2282
1352
|
client = props.client,
|
|
2283
1353
|
params = props.params,
|
|
2284
1354
|
query = props.query,
|
|
1355
|
+
autoScroll = props.autoScroll,
|
|
1356
|
+
pointer = props.pointer,
|
|
1357
|
+
pointerArray = props.pointerArray,
|
|
2285
1358
|
mapping = props.mapping,
|
|
2286
1359
|
seoPaginate = props.seoPaginate,
|
|
1360
|
+
pageview = props.pageview,
|
|
2287
1361
|
defaultImage = props.defaultImage,
|
|
2288
1362
|
showAuthor = props.showAuthor,
|
|
2289
1363
|
showCategory = props.showCategory,
|
|
@@ -2308,135 +1382,161 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
|
2308
1382
|
_props$showIntro = props.showIntro,
|
|
2309
1383
|
showIntro = _props$showIntro === undefined ? true : _props$showIntro,
|
|
2310
1384
|
_props$contentCategor = props.contentCategoryMapping,
|
|
2311
|
-
contentCategoryMapping = _props$contentCategor === undefined ? [] : _props$contentCategor
|
|
1385
|
+
contentCategoryMapping = _props$contentCategor === undefined ? [] : _props$contentCategor;
|
|
1386
|
+
var initialCurrentPage = props.currentPage,
|
|
2312
1387
|
showPublished = props.showPublished;
|
|
2313
1388
|
|
|
2314
|
-
var _useState3 = React.useState(
|
|
1389
|
+
var _useState3 = React.useState(initialData),
|
|
2315
1390
|
_useState4 = slicedToArray._slicedToArray(_useState3, 2),
|
|
2316
|
-
|
|
2317
|
-
|
|
1391
|
+
data = _useState4[0],
|
|
1392
|
+
setData = _useState4[1];
|
|
2318
1393
|
|
|
2319
|
-
var
|
|
1394
|
+
var _useState5 = React.useState(true),
|
|
1395
|
+
_useState6 = slicedToArray._slicedToArray(_useState5, 2),
|
|
1396
|
+
scrolling = _useState6[0],
|
|
1397
|
+
setScrolling = _useState6[1];
|
|
2320
1398
|
|
|
2321
|
-
var
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
while (1) {
|
|
2326
|
-
switch (_context.prev = _context.next) {
|
|
2327
|
-
case 0:
|
|
2328
|
-
start = (currentPage - 1) * itemsPerPage;
|
|
2329
|
-
_context.next = 3;
|
|
2330
|
-
return client.fetch(query, _extends._extends({}, params, {
|
|
2331
|
-
from: start,
|
|
2332
|
-
to: start + itemsPerPage
|
|
2333
|
-
}));
|
|
1399
|
+
var _useState7 = React.useState(initialCurrentPage || 1),
|
|
1400
|
+
_useState8 = slicedToArray._slicedToArray(_useState7, 2),
|
|
1401
|
+
currentPage = _useState8[0],
|
|
1402
|
+
setCurrentPage = _useState8[1];
|
|
2334
1403
|
|
|
2335
|
-
|
|
2336
|
-
|
|
1404
|
+
var _useState9 = React.useState(initialData ? initialData.length : 0),
|
|
1405
|
+
_useState10 = slicedToArray._slicedToArray(_useState9, 2),
|
|
1406
|
+
lastDataSize = _useState10[0],
|
|
1407
|
+
setLastDataSize = _useState10[1];
|
|
2337
1408
|
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
1409
|
+
var _useState11 = React.useState({
|
|
1410
|
+
from: params ? params.from : 0,
|
|
1411
|
+
to: params ? params.to : 0,
|
|
1412
|
+
page: initialCurrentPage ? initialCurrentPage : 1
|
|
1413
|
+
}),
|
|
1414
|
+
_useState12 = slicedToArray._slicedToArray(_useState11, 2),
|
|
1415
|
+
values = _useState12[0],
|
|
1416
|
+
setValues = _useState12[1];
|
|
2345
1417
|
|
|
2346
|
-
|
|
2347
|
-
return _ref4.apply(this, arguments);
|
|
2348
|
-
};
|
|
2349
|
-
}();
|
|
1418
|
+
var itemsPerPage = params && params.itemsPerPage ? params.itemsPerPage : 10;
|
|
2350
1419
|
|
|
2351
|
-
var
|
|
2352
|
-
seoPaginate && seoPagination(currentPage);
|
|
2353
|
-
index.lib_3.refresh();
|
|
2354
|
-
};
|
|
1420
|
+
var prevValues = usePrevious(values);
|
|
2355
1421
|
|
|
2356
|
-
var
|
|
2357
|
-
|
|
1422
|
+
var renderManualPagination = function renderManualPagination(currentPage) {
|
|
1423
|
+
if (lastDataSize < itemsPerPage) {
|
|
1424
|
+
return null;
|
|
1425
|
+
}
|
|
2358
1426
|
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
1427
|
+
return React__default['default'].createElement(
|
|
1428
|
+
'div',
|
|
1429
|
+
{ className: 'd-flex justify-content-between' },
|
|
1430
|
+
currentPage && currentPage > 1 && React__default['default'].createElement(
|
|
1431
|
+
'a',
|
|
1432
|
+
{ href: '?page=' + (currentPage - 1) },
|
|
1433
|
+
'<< Previous'
|
|
1434
|
+
),
|
|
1435
|
+
React__default['default'].createElement(
|
|
1436
|
+
'a',
|
|
1437
|
+
{ href: '?page=' + (currentPage + 1) },
|
|
1438
|
+
'Next >>'
|
|
1439
|
+
)
|
|
1440
|
+
);
|
|
2363
1441
|
};
|
|
2364
1442
|
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
// exclude page=xxx from query string
|
|
2375
|
-
partialQSArr.map(function (item) {
|
|
2376
|
-
var itemArr = item.split('=');
|
|
2377
|
-
var key = itemArr[0];
|
|
2378
|
-
var val = itemArr[1];
|
|
2379
|
-
if (key !== 'page') queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
|
|
1443
|
+
// check for change in filter parameters from client side and refresh the page
|
|
1444
|
+
React.useEffect(function () {
|
|
1445
|
+
if (initialData && data !== initialData && initialData.length >= 0) {
|
|
1446
|
+
setData(initialData);
|
|
1447
|
+
setCurrentPage(initialCurrentPage ? initialCurrentPage : 1);
|
|
1448
|
+
setValues({
|
|
1449
|
+
from: params ? params.from : 0,
|
|
1450
|
+
to: params ? params.to : 0,
|
|
1451
|
+
page: initialCurrentPage ? initialCurrentPage : 1
|
|
2380
1452
|
});
|
|
1453
|
+
if (initialData.length > 0) {
|
|
1454
|
+
setScrolling(true);
|
|
1455
|
+
}
|
|
2381
1456
|
}
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
1457
|
+
}, [initialData]);
|
|
1458
|
+
|
|
1459
|
+
React.useEffect(function () {
|
|
1460
|
+
if (prevValues) {
|
|
1461
|
+
if (values.page !== prevValues.page && values.from !== prevValues.from && values.to !== prevValues.to) {
|
|
1462
|
+
loadData(values, query, client, params, setData, setScrolling, setLastDataSize, pointer, pointerArray);
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
}, [values, prevValues, query, client, params, setData, setScrolling, setLastDataSize, pointer, pointerArray]);
|
|
1466
|
+
|
|
1467
|
+
// useEffect(() => {
|
|
1468
|
+
// document.addEventListener('scroll', trackScrolling)
|
|
1469
|
+
// return () => {
|
|
1470
|
+
// document.removeEventListener('scroll', trackScrolling)
|
|
1471
|
+
// }
|
|
1472
|
+
// }, [currentPage])
|
|
2390
1473
|
|
|
2391
|
-
|
|
1474
|
+
// const trackScrolling = (current) => {
|
|
1475
|
+
// if (window.pageYOffset === 0) {
|
|
1476
|
+
// if (currentPage > 1) {
|
|
1477
|
+
// changePageNumber(1, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, 1)
|
|
1478
|
+
// }
|
|
1479
|
+
// }
|
|
1480
|
+
// }
|
|
1481
|
+
|
|
1482
|
+
return React__default['default'].createElement(
|
|
2392
1483
|
'div',
|
|
2393
1484
|
null,
|
|
2394
|
-
|
|
2395
|
-
'
|
|
2396
|
-
|
|
2397
|
-
React__default.createElement(
|
|
2398
|
-
|
|
2399
|
-
{
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
1485
|
+
autoScroll ? React__default['default'].createElement(
|
|
1486
|
+
React__default['default'].Fragment,
|
|
1487
|
+
null,
|
|
1488
|
+
React__default['default'].createElement(
|
|
1489
|
+
index_es.InfiniteScroll,
|
|
1490
|
+
{ dataLength: data && data.length, next: function next() {
|
|
1491
|
+
return loadMore(values, setValues, itemsPerPage);
|
|
1492
|
+
}, hasMore: scrolling, scrollThreshold: 0.9 },
|
|
1493
|
+
React__default['default'].createElement(
|
|
1494
|
+
reactBootstrap.Container,
|
|
1495
|
+
null,
|
|
1496
|
+
cardLoader(data, client, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, imageMaxHeight, imageFit, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent, lgInfeedAd, showPubInfo, contentCategoryMapping, showTimeDiff, showTaxonomies, showIntro)
|
|
2404
1497
|
)
|
|
1498
|
+
),
|
|
1499
|
+
React__default['default'].createElement(
|
|
1500
|
+
'noscript',
|
|
1501
|
+
null,
|
|
1502
|
+
renderManualPagination(currentPage)
|
|
2405
1503
|
)
|
|
2406
|
-
) : React__default.createElement(
|
|
2407
|
-
|
|
1504
|
+
) : React__default['default'].createElement(
|
|
1505
|
+
React__default['default'].Fragment,
|
|
2408
1506
|
null,
|
|
2409
|
-
React__default.createElement(
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
1507
|
+
React__default['default'].createElement(
|
|
1508
|
+
reactBootstrap.Container,
|
|
1509
|
+
null,
|
|
1510
|
+
cardLoader(data, client, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, imageMaxHeight, imageFit, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent, lgInfeedAd, showPubInfo, contentCategoryMapping, showTimeDiff, showTaxonomies, showIntro)
|
|
1511
|
+
),
|
|
1512
|
+
React__default['default'].createElement(
|
|
1513
|
+
'div',
|
|
1514
|
+
{ style: { padding: '0px 10px' } },
|
|
1515
|
+
scrolling ? React__default['default'].createElement(
|
|
1516
|
+
'button',
|
|
1517
|
+
{
|
|
1518
|
+
className: 'load-more-btn',
|
|
1519
|
+
style: { margin: 'auto', width: '100%' },
|
|
1520
|
+
onClick: function onClick(e) {
|
|
1521
|
+
loadMore(values, setValues, itemsPerPage);
|
|
1522
|
+
} },
|
|
1523
|
+
'Load More'
|
|
1524
|
+
) : React__default['default'].createElement(
|
|
1525
|
+
'p',
|
|
1526
|
+
{ style: { textAlign: 'center' } },
|
|
1527
|
+
React__default['default'].createElement(
|
|
1528
|
+
'b',
|
|
1529
|
+
null,
|
|
1530
|
+
'End of data'
|
|
1531
|
+
)
|
|
1532
|
+
)
|
|
1533
|
+
),
|
|
1534
|
+
React__default['default'].createElement(
|
|
1535
|
+
'noscript',
|
|
1536
|
+
null,
|
|
1537
|
+
renderManualPagination(currentPage)
|
|
1538
|
+
)
|
|
1539
|
+
)
|
|
2440
1540
|
);
|
|
2441
1541
|
};
|
|
2442
1542
|
|