@quintype/arrow 3.20.0-perf-v2.0 → 3.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AlsoRead/styles.arrow.css +1 -0
- package/AlternateCollectionFilter/styles.arrow.css +1 -0
- package/AsideCollection/styles.arrow.css +1 -0
- package/AstrologyCollection/styles.arrow.css +1 -0
- package/Attachment/styles.arrow.css +1 -0
- package/Author/styles.arrow.css +1 -0
- package/AuthorIntroductionCard/styles.arrow.css +1 -0
- package/AuthorWithTime/styles.arrow.css +1 -0
- package/AuthorsList/styles.arrow.css +1 -0
- package/BigFact/styles.arrow.css +1 -0
- package/BlockQuote/styles.arrow.css +1 -0
- package/Blurb/styles.arrow.css +1 -0
- package/CollectionFilter/styles.arrow.css +1 -0
- package/CollectionName/styles.arrow.css +1 -0
- package/ElevenStories/styles.arrow.css +1 -0
- package/FourColFiveStories/styles.arrow.css +1 -0
- package/FourColGrid/styles.arrow.css +1 -0
- package/FourColPortraitStories/styles.arrow.css +1 -0
- package/FourColSixteenStories/styles.arrow.css +1 -0
- package/FourColTwelveStories/styles.arrow.css +1 -0
- package/FourStorySlider/styles.arrow.css +1 -0
- package/FourStorySliderPortrait/styles.arrow.css +1 -0
- package/FourTabbedBigStorySlider/styles.arrow.css +1 -0
- package/FullScreenSlider/styles.arrow.css +1 -0
- package/HalfScreenSlider/styles.arrow.css +1 -0
- package/Headline/styles.arrow.css +1 -0
- package/HeroImage/styles.arrow.css +1 -0
- package/Image/styles.arrow.css +1 -0
- package/ImageGallery/styles.arrow.css +1 -0
- package/ImageSlideshow/styles.arrow.css +1 -0
- package/KeyEvents/styles.arrow.css +1 -0
- package/ListComponent/styles.arrow.css +1 -0
- package/ListicleStoryTemplate/styles.arrow.css +1 -0
- package/Listicles/styles.arrow.css +1 -0
- package/LiveBlogStoryTemplate/styles.arrow.css +1 -0
- package/LoadmoreButton/styles.arrow.css +1 -0
- package/MagazineEditions/styles.arrow.css +1 -0
- package/MagazineHeaderCard/styles.arrow.css +1 -0
- package/MagazineWidget/styles.arrow.css +1 -0
- package/OneColStoryList/styles.arrow.css +1 -0
- package/OpinionCollection/styles.arrow.css +1 -0
- package/PageIntroductionCard/styles.arrow.css +1 -0
- package/PhotoStoryTemplate/styles.arrow.css +1 -0
- package/QuestionAnswer/styles.arrow.css +1 -0
- package/Quote/styles.arrow.css +1 -0
- package/README.md +8 -0
- package/Reference/styles.arrow.css +1 -0
- package/ScrollSnap/styles.arrow.css +1 -0
- package/SectionTag/styles.arrow.css +1 -0
- package/SixColSixStories/styles.arrow.css +1 -0
- package/SocialShareTemplate/styles.arrow.css +1 -0
- package/StoryCard/styles.arrow.css +1 -0
- package/StoryCollection/styles.arrow.css +1 -0
- package/StoryElementCard/styles.arrow.css +1 -0
- package/StorycardContent/styles.arrow.css +1 -0
- package/Subheadline/styles.arrow.css +1 -0
- package/Summary/styles.arrow.css +1 -0
- package/TagIntroductionCard/styles.arrow.css +1 -0
- package/Text/styles.arrow.css +1 -0
- package/TextStoryTemplate/styles.arrow.css +1 -0
- package/ThreeColFlexStories/styles.arrow.css +1 -0
- package/ThreeColFourteenStories/styles.arrow.css +1 -0
- package/ThreeColGrid/styles.arrow.css +1 -0
- package/ThreeColSevenStory/styles.arrow.css +1 -0
- package/ThreeColSixStories/styles.arrow.css +1 -0
- package/ThreeColTwelveStories/styles.arrow.css +1 -0
- package/TimeStamp/styles.arrow.css +1 -0
- package/TwoColFourStories/styles.arrow.css +1 -0
- package/TwoColFourStoryHighlight/styles.arrow.css +1 -0
- package/TwoColSevenStories/styles.arrow.css +1 -0
- package/TwoColSixStories/styles.arrow.css +1 -0
- package/TwoColTenStoriesSidebar/styles.arrow.css +1 -0
- package/TwoColThreeStories/styles.arrow.css +1 -0
- package/Video/styles.arrow.css +1 -0
- package/VideoStoryTemplate/styles.arrow.css +1 -0
- package/{assets/stylesheets/app.scss → app.scss} +0 -2
- package/cjs/index.js +1 -0
- package/esm/index.js +1 -0
- package/package.json +1 -131
- package/.babelrc +0 -12
- package/.circleci/config.yml +0 -43
- package/.eslintrc.json +0 -35
- package/.prettierrc +0 -6
- package/.storybook/addons.js +0 -4
- package/.storybook/main.js +0 -7
- package/.storybook/preview.js +0 -3
- package/.storybook/webpack.config.js +0 -8
- package/.stylelintrc +0 -10
- package/.vscode/extensions.json +0 -16
- package/.vscode/settings.json +0 -12
- package/CHANGELOG.md +0 -1641
- package/__mocks__/fileMock.js +0 -1
- package/__mocks__/styleMock.js +0 -1
- package/assets/stylesheets/mixins.scss +0 -27
- package/assets/stylesheets/reset.scss +0 -148
- package/assets/stylesheets/viewports.m.css +0 -3
- package/bin-dev-scripts/prepublish.sh +0 -11
- package/bin-dev-scripts/sync-to.sh +0 -13
- package/jest.config.json +0 -14
- package/publish +0 -22
- package/rollup.js +0 -202
- package/setupTests.js +0 -3
- package/src/components/Atoms/AdPlaceholder/ads.m.css +0 -13
- package/src/components/Atoms/AdPlaceholder/index.js +0 -25
- package/src/components/Atoms/Author/README.md +0 -19
- package/src/components/Atoms/Author/author.m.css +0 -65
- package/src/components/Atoms/Author/index.js +0 -98
- package/src/components/Atoms/Author/stories.js +0 -23
- package/src/components/Atoms/AuthorCard/README.md +0 -47
- package/src/components/Atoms/AuthorCard/author-card.m.css +0 -174
- package/src/components/Atoms/AuthorCard/author-card.test.js +0 -72
- package/src/components/Atoms/AuthorCard/index.js +0 -115
- package/src/components/Atoms/AuthorCard/stories.js +0 -69
- package/src/components/Atoms/AuthorImage/README.md +0 -31
- package/src/components/Atoms/AuthorImage/author-image.m.css +0 -53
- package/src/components/Atoms/AuthorImage/index.js +0 -55
- package/src/components/Atoms/AuthorImage/stories.js +0 -20
- package/src/components/Atoms/AuthorWithTimestamp/README.md +0 -12
- package/src/components/Atoms/AuthorWithTimestamp/author-with-timestamp.m.css +0 -42
- package/src/components/Atoms/AuthorWithTimestamp/index.js +0 -79
- package/src/components/Atoms/AuthorWithTimestamp/stories.js +0 -27
- package/src/components/Atoms/BulletPoint/README.md +0 -9
- package/src/components/Atoms/BulletPoint/bullet-point.m.css +0 -14
- package/src/components/Atoms/BulletPoint/index.js +0 -19
- package/src/components/Atoms/BulletPoint/stories.js +0 -6
- package/src/components/Atoms/CaptionAttribution/README.md +0 -15
- package/src/components/Atoms/CaptionAttribution/caption-attribution.m.css +0 -40
- package/src/components/Atoms/CaptionAttribution/caption-attribution.test.js +0 -29
- package/src/components/Atoms/CaptionAttribution/index.js +0 -40
- package/src/components/Atoms/CaptionAttribution/stories.js +0 -40
- package/src/components/Atoms/CollectionName/README.md +0 -11
- package/src/components/Atoms/CollectionName/collection-name.m.css +0 -94
- package/src/components/Atoms/CollectionName/index.js +0 -143
- package/src/components/Atoms/CollectionName/stories.js +0 -52
- package/src/components/Atoms/Divider/__snapshots__/divider.test.js.snap +0 -18
- package/src/components/Atoms/Divider/divider.m.css +0 -6
- package/src/components/Atoms/Divider/divider.test.js +0 -10
- package/src/components/Atoms/Divider/index.js +0 -20
- package/src/components/Atoms/Dot/dot.js +0 -20
- package/src/components/Atoms/Dot/dot.m.css +0 -6
- package/src/components/Atoms/ExtendedLoadMore/README.md +0 -9
- package/src/components/Atoms/ExtendedLoadMore/__snapshots__/extended-load-more.test.js.snap +0 -11
- package/src/components/Atoms/ExtendedLoadMore/extended-load-more.test.js +0 -19
- package/src/components/Atoms/ExtendedLoadMore/index.js +0 -114
- package/src/components/Atoms/FallbackImage/fallback.m.css +0 -33
- package/src/components/Atoms/FallbackImage/index.js +0 -30
- package/src/components/Atoms/Headline/README.md +0 -7
- package/src/components/Atoms/Headline/headline.m.css +0 -26
- package/src/components/Atoms/Headline/index.js +0 -91
- package/src/components/Atoms/Headline/stories.js +0 -52
- package/src/components/Atoms/HeroImage/README.md +0 -13
- package/src/components/Atoms/HeroImage/hero-image.m.css +0 -72
- package/src/components/Atoms/HeroImage/index.js +0 -168
- package/src/components/Atoms/HeroImage/stories.js +0 -22
- package/src/components/Atoms/Hyperlink/hyperlink.m.css +0 -10
- package/src/components/Atoms/Hyperlink/index.js +0 -24
- package/src/components/Atoms/LoadMoreTarget/index.js +0 -24
- package/src/components/Atoms/Loadmore/README.md +0 -0
- package/src/components/Atoms/Loadmore/__snapshots__/load-more.test.js.snap +0 -25
- package/src/components/Atoms/Loadmore/index.js +0 -41
- package/src/components/Atoms/Loadmore/load-more.m.css +0 -23
- package/src/components/Atoms/Loadmore/load-more.test.js +0 -30
- package/src/components/Atoms/Loadmore/stories.js +0 -17
- package/src/components/Atoms/MagazineCoverImage/README.md +0 -21
- package/src/components/Atoms/MagazineCoverImage/index.js +0 -61
- package/src/components/Atoms/MagazineCoverImage/magazine-cover-image.m.css +0 -24
- package/src/components/Atoms/MagazineCoverImage/stories.js +0 -21
- package/src/components/Atoms/PremiumStoryIcon/index.js +0 -27
- package/src/components/Atoms/PublishDetail/README.md +0 -15
- package/src/components/Atoms/PublishDetail/index.js +0 -66
- package/src/components/Atoms/PublishDetail/publish-details.m.css +0 -47
- package/src/components/Atoms/PublishDetail/publish-details.test.js +0 -22
- package/src/components/Atoms/PublishDetail/stories.js +0 -22
- package/src/components/Atoms/ReadTime/README.md +0 -13
- package/src/components/Atoms/ReadTime/index.js +0 -52
- package/src/components/Atoms/ReadTime/read-time.m.css +0 -25
- package/src/components/Atoms/ReadTime/read-time.test.js +0 -27
- package/src/components/Atoms/ReadTime/stories.js +0 -19
- package/src/components/Atoms/ScrollSnap/SliderArrow/index.js +0 -57
- package/src/components/Atoms/ScrollSnap/SliderArrow/slider-arrow.m.css +0 -45
- package/src/components/Atoms/ScrollSnap/SliderIndicator/index.js +0 -41
- package/src/components/Atoms/ScrollSnap/SliderIndicator/slider-indicator.m.css +0 -71
- package/src/components/Atoms/ScrollSnap/index.js +0 -169
- package/src/components/Atoms/ScrollSnap/scroll-snap.m.css +0 -26
- package/src/components/Atoms/SectionTag/README.md +0 -11
- package/src/components/Atoms/SectionTag/index.js +0 -61
- package/src/components/Atoms/SectionTag/section.m.css +0 -53
- package/src/components/Atoms/SectionTag/stories.js +0 -26
- package/src/components/Atoms/SocialSharePopup/README.md +0 -25
- package/src/components/Atoms/SocialSharePopup/__snapshots__/social-share-popup.test.js.snap +0 -653
- package/src/components/Atoms/SocialSharePopup/index.js +0 -61
- package/src/components/Atoms/SocialSharePopup/social-share-popup.m.css +0 -109
- package/src/components/Atoms/SocialSharePopup/social-share-popup.test.js +0 -93
- package/src/components/Atoms/SocialSharePopup/stories.js +0 -19
- package/src/components/Atoms/StoryElements/AlsoRead/README.md +0 -49
- package/src/components/Atoms/StoryElements/AlsoRead/also-read.m.css +0 -135
- package/src/components/Atoms/StoryElements/AlsoRead/also-read.test.js +0 -83
- package/src/components/Atoms/StoryElements/AlsoRead/index.js +0 -117
- package/src/components/Atoms/StoryElements/AlsoRead/stories.js +0 -40
- package/src/components/Atoms/StoryElements/Attachment/README.md +0 -21
- package/src/components/Atoms/StoryElements/Attachment/__snapshots__/attachment.test.js.snap +0 -47
- package/src/components/Atoms/StoryElements/Attachment/attachment.m.css +0 -125
- package/src/components/Atoms/StoryElements/Attachment/attachment.test.js +0 -39
- package/src/components/Atoms/StoryElements/Attachment/index.js +0 -62
- package/src/components/Atoms/StoryElements/Attachment/stories.js +0 -48
- package/src/components/Atoms/StoryElements/BigFact/README.md +0 -9
- package/src/components/Atoms/StoryElements/BigFact/big-fact.m.css +0 -41
- package/src/components/Atoms/StoryElements/BigFact/big-fact.test.js +0 -21
- package/src/components/Atoms/StoryElements/BigFact/index.js +0 -33
- package/src/components/Atoms/StoryElements/BigFact/stories.js +0 -9
- package/src/components/Atoms/StoryElements/BlockQuote/README.md +0 -49
- package/src/components/Atoms/StoryElements/BlockQuote/Svg/curve.js +0 -26
- package/src/components/Atoms/StoryElements/BlockQuote/Svg/edge.js +0 -26
- package/src/components/Atoms/StoryElements/BlockQuote/Svg/icon.m.css +0 -4
- package/src/components/Atoms/StoryElements/BlockQuote/block-quote.m.css +0 -161
- package/src/components/Atoms/StoryElements/BlockQuote/block-quote.test.js +0 -48
- package/src/components/Atoms/StoryElements/BlockQuote/index.js +0 -82
- package/src/components/Atoms/StoryElements/BlockQuote/stories.js +0 -35
- package/src/components/Atoms/StoryElements/Blurb/README.md +0 -43
- package/src/components/Atoms/StoryElements/Blurb/blurb.m.css +0 -55
- package/src/components/Atoms/StoryElements/Blurb/blurb.test.js +0 -46
- package/src/components/Atoms/StoryElements/Blurb/index.js +0 -53
- package/src/components/Atoms/StoryElements/Blurb/stories.js +0 -28
- package/src/components/Atoms/StoryElements/Image/README.md +0 -13
- package/src/components/Atoms/StoryElements/Image/image.m.css +0 -21
- package/src/components/Atoms/StoryElements/Image/image.test.js +0 -20
- package/src/components/Atoms/StoryElements/Image/index.js +0 -60
- package/src/components/Atoms/StoryElements/Image/stories.js +0 -25
- package/src/components/Atoms/StoryElements/ImageSlideshow/README.md +0 -13
- package/src/components/Atoms/StoryElements/ImageSlideshow/image-slideshow.m.css +0 -49
- package/src/components/Atoms/StoryElements/ImageSlideshow/index.js +0 -65
- package/src/components/Atoms/StoryElements/ImageSlideshow/stories.js +0 -34
- package/src/components/Atoms/StoryElements/QuestionAnswer/README.md +0 -56
- package/src/components/Atoms/StoryElements/QuestionAnswer/index.js +0 -134
- package/src/components/Atoms/StoryElements/QuestionAnswer/question-answer.m.css +0 -106
- package/src/components/Atoms/StoryElements/QuestionAnswer/question-answer.test.js +0 -74
- package/src/components/Atoms/StoryElements/QuestionAnswer/stories.js +0 -79
- package/src/components/Atoms/StoryElements/Quote/README.md +0 -41
- package/src/components/Atoms/StoryElements/Quote/index.js +0 -44
- package/src/components/Atoms/StoryElements/Quote/quote.m.css +0 -111
- package/src/components/Atoms/StoryElements/Quote/quote.test.js +0 -39
- package/src/components/Atoms/StoryElements/Quote/stories.js +0 -28
- package/src/components/Atoms/StoryElements/Reference/README.md +0 -9
- package/src/components/Atoms/StoryElements/Reference/index.js +0 -52
- package/src/components/Atoms/StoryElements/Reference/reference.m.css +0 -42
- package/src/components/Atoms/StoryElements/Reference/reference.test.js +0 -28
- package/src/components/Atoms/StoryElements/Reference/stories.js +0 -18
- package/src/components/Atoms/StoryElements/StoryElement/README.md +0 -10
- package/src/components/Atoms/StoryElements/StoryElement/index.js +0 -21
- package/src/components/Atoms/StoryElements/StoryElement/stories.js +0 -20
- package/src/components/Atoms/StoryElements/StoryElement/storyelement.test.js +0 -13
- package/src/components/Atoms/StoryElements/Summary/README.md +0 -56
- package/src/components/Atoms/StoryElements/Summary/index.js +0 -68
- package/src/components/Atoms/StoryElements/Summary/stories.js +0 -33
- package/src/components/Atoms/StoryElements/Summary/summary.m.css +0 -121
- package/src/components/Atoms/StoryElements/Summary/summary.test.js +0 -50
- package/src/components/Atoms/StoryElements/Text/README.md +0 -32
- package/src/components/Atoms/StoryElements/Text/index.js +0 -41
- package/src/components/Atoms/StoryElements/Text/stories.js +0 -32
- package/src/components/Atoms/StoryElements/Text/text.m.css +0 -78
- package/src/components/Atoms/StoryElements/Text/text.test.js +0 -42
- package/src/components/Atoms/StoryElements/Video/README.md +0 -9
- package/src/components/Atoms/StoryElements/Video/index.js +0 -23
- package/src/components/Atoms/StoryElements/Video/stories.js +0 -24
- package/src/components/Atoms/StoryElements/Video/video.m.css +0 -89
- package/src/components/Atoms/StoryElements/Video/video.test.js +0 -13
- package/src/components/Atoms/StoryElements/imageGallery/README.md +0 -18
- package/src/components/Atoms/StoryElements/imageGallery/image-gallery.m.css +0 -52
- package/src/components/Atoms/StoryElements/imageGallery/image-gallery.test.js +0 -19
- package/src/components/Atoms/StoryElements/imageGallery/index.js +0 -79
- package/src/components/Atoms/StoryElements/imageGallery/stories.js +0 -23
- package/src/components/Atoms/StoryElements/withElementWrapper.js +0 -13
- package/src/components/Atoms/StoryElements/withElementWrapper.test.js +0 -31
- package/src/components/Atoms/StoryHeadline/index.js +0 -36
- package/src/components/Atoms/StoryHeadline/story-headline.m.css +0 -36
- package/src/components/Atoms/StoryTags/README.md +0 -9
- package/src/components/Atoms/StoryTags/index.js +0 -33
- package/src/components/Atoms/StoryTags/stories.js +0 -25
- package/src/components/Atoms/StoryTags/story-tags.test.js +0 -18
- package/src/components/Atoms/StoryTags/tags.m.css +0 -34
- package/src/components/Atoms/Subheadline/README.md +0 -17
- package/src/components/Atoms/Subheadline/index.js +0 -54
- package/src/components/Atoms/Subheadline/stories.js +0 -12
- package/src/components/Atoms/Subheadline/subheadline.m.css +0 -17
- package/src/components/Atoms/TimeStamp/README.md +0 -9
- package/src/components/Atoms/TimeStamp/index.js +0 -40
- package/src/components/Atoms/TimeStamp/stories.js +0 -9
- package/src/components/Atoms/TimeStamp/timestamp.m.css +0 -22
- package/src/components/Fixture/config.json +0 -2703
- package/src/components/Fixture/dummy-collection.js +0 -2790
- package/src/components/Fixture/dummyStory.js +0 -2200
- package/src/components/Fixture/index.js +0 -424
- package/src/components/Fixture/slot-config.js +0 -29
- package/src/components/Molecules/FullScreenImages/fullscreenimages.scss +0 -56
- package/src/components/Molecules/FullScreenImages/index.js +0 -98
- package/src/components/Molecules/KeyEvents/README.md +0 -21
- package/src/components/Molecules/KeyEvents/index.js +0 -109
- package/src/components/Molecules/KeyEvents/key-events.m.css +0 -89
- package/src/components/Molecules/KeyEvents/stories.js +0 -28
- package/src/components/Molecules/PageIntroductionCard/README.md +0 -25
- package/src/components/Molecules/PageIntroductionCard/index.js +0 -50
- package/src/components/Molecules/PageIntroductionCard/page-intro-card.m.css +0 -61
- package/src/components/Molecules/PageIntroductionCard/stories.js +0 -16
- package/src/components/Molecules/PortraitStoryCard/README.md +0 -10
- package/src/components/Molecules/PortraitStoryCard/index.js +0 -49
- package/src/components/Molecules/PortraitStoryCard/portrait-story-card.m.css +0 -38
- package/src/components/Molecules/PortraitStoryCard/stories.js +0 -24
- package/src/components/Molecules/SliderHorizontalCard/README.md +0 -14
- package/src/components/Molecules/SliderHorizontalCard/index.js +0 -45
- package/src/components/Molecules/SliderHorizontalCard/slider-horizontal-card.m.css +0 -42
- package/src/components/Molecules/SliderHorizontalCard/stories.js +0 -30
- package/src/components/Molecules/SocialShareTemplate/README.md +0 -118
- package/src/components/Molecules/SocialShareTemplate/__snapshots__/social-share-template.test.js.snap +0 -738
- package/src/components/Molecules/SocialShareTemplate/index.js +0 -119
- package/src/components/Molecules/SocialShareTemplate/social-share-data.js +0 -66
- package/src/components/Molecules/SocialShareTemplate/social-share-template.m.css +0 -174
- package/src/components/Molecules/SocialShareTemplate/social-share-template.test.js +0 -116
- package/src/components/Molecules/SocialShareTemplate/stories.js +0 -40
- package/src/components/Molecules/StoryCard/README.md +0 -75
- package/src/components/Molecules/StoryCard/READMEBGIMAGE.md +0 -25
- package/src/components/Molecules/StoryCard/READMEBORDER.md +0 -61
- package/src/components/Molecules/StoryCard/index.js +0 -184
- package/src/components/Molecules/StoryCard/stories.js +0 -223
- package/src/components/Molecules/StoryCard/storycard.m.css +0 -158
- package/src/components/Molecules/StoryCardWithBulletPoint/README.md +0 -9
- package/src/components/Molecules/StoryCardWithBulletPoint/index.js +0 -32
- package/src/components/Molecules/StoryCardWithBulletPoint/stories.js +0 -31
- package/src/components/Molecules/StoryCardWithBulletPoint/story-card-with-bullet-point.m.css +0 -7
- package/src/components/Molecules/StoryElementCard/README.md +0 -9
- package/src/components/Molecules/StoryElementCard/index.js +0 -359
- package/src/components/Molecules/StoryElementCard/stories.js +0 -27
- package/src/components/Molecules/StoryElementCard/story-element-card.m.css +0 -78
- package/src/components/Molecules/StorycardContent/README.md +0 -34
- package/src/components/Molecules/StorycardContent/index.js +0 -76
- package/src/components/Molecules/StorycardContent/stories.js +0 -39
- package/src/components/Molecules/StorycardContent/storycardContent.m.css +0 -21
- package/src/components/Rows/AlternateCollectionFilter/README.md +0 -38
- package/src/components/Rows/AlternateCollectionFilter/alternate-collection-filter.m.css +0 -254
- package/src/components/Rows/AlternateCollectionFilter/index.js +0 -179
- package/src/components/Rows/AlternateCollectionFilter/stories.js +0 -74
- package/src/components/Rows/AsideCollection/README.md +0 -27
- package/src/components/Rows/AsideCollection/aside-collection.m.css +0 -103
- package/src/components/Rows/AsideCollection/aside-collection.test.js +0 -34
- package/src/components/Rows/AsideCollection/index.js +0 -175
- package/src/components/Rows/AsideCollection/stories.js +0 -52
- package/src/components/Rows/AstrologyCollection/README.md +0 -40
- package/src/components/Rows/AstrologyCollection/astrology-collection.m.css +0 -165
- package/src/components/Rows/AstrologyCollection/index.js +0 -172
- package/src/components/Rows/AstrologyCollection/stories.js +0 -60
- package/src/components/Rows/AuthorIntroductionCard/README.md +0 -43
- package/src/components/Rows/AuthorIntroductionCard/author-intro.m.css +0 -278
- package/src/components/Rows/AuthorIntroductionCard/author-intro.test.js +0 -106
- package/src/components/Rows/AuthorIntroductionCard/index.js +0 -120
- package/src/components/Rows/AuthorIntroductionCard/stories.js +0 -43
- package/src/components/Rows/AuthorsList/README.md +0 -24
- package/src/components/Rows/AuthorsList/author-list.test.js +0 -50
- package/src/components/Rows/AuthorsList/authors-list.m.css +0 -22
- package/src/components/Rows/AuthorsList/index.js +0 -50
- package/src/components/Rows/AuthorsList/stories.js +0 -61
- package/src/components/Rows/CollectionFilter/README.md +0 -39
- package/src/components/Rows/CollectionFilter/collection-filter.m.css +0 -213
- package/src/components/Rows/CollectionFilter/index.js +0 -232
- package/src/components/Rows/CollectionFilter/stories.js +0 -77
- package/src/components/Rows/ElevenStories/11-stories.m.css +0 -85
- package/src/components/Rows/ElevenStories/README.md +0 -39
- package/src/components/Rows/ElevenStories/index.js +0 -332
- package/src/components/Rows/ElevenStories/stories.js +0 -70
- package/src/components/Rows/FourColFiveStories/README.md +0 -37
- package/src/components/Rows/FourColFiveStories/four-col-five-stories.m.css +0 -112
- package/src/components/Rows/FourColFiveStories/index.js +0 -161
- package/src/components/Rows/FourColFiveStories/stories.js +0 -67
- package/src/components/Rows/FourColGrid/README.md +0 -39
- package/src/components/Rows/FourColGrid/four-col.m.css +0 -50
- package/src/components/Rows/FourColGrid/index.js +0 -144
- package/src/components/Rows/FourColGrid/stories.js +0 -66
- package/src/components/Rows/FourColPortraitStories/README.md +0 -38
- package/src/components/Rows/FourColPortraitStories/four-col-portrait-stories.m.css +0 -45
- package/src/components/Rows/FourColPortraitStories/index.js +0 -145
- package/src/components/Rows/FourColPortraitStories/stories.js +0 -66
- package/src/components/Rows/FourColSixteenStories/README.md +0 -35
- package/src/components/Rows/FourColSixteenStories/four-col-sixteen-stories.m.css +0 -141
- package/src/components/Rows/FourColSixteenStories/index.js +0 -115
- package/src/components/Rows/FourColSixteenStories/stories.js +0 -47
- package/src/components/Rows/FourColTwelveStory/README.md +0 -39
- package/src/components/Rows/FourColTwelveStory/four-col-twelve-story.m.css +0 -71
- package/src/components/Rows/FourColTwelveStory/index.js +0 -176
- package/src/components/Rows/FourColTwelveStory/stories.js +0 -117
- package/src/components/Rows/FourStorySlider/README.md +0 -45
- package/src/components/Rows/FourStorySlider/four-story-slider.m.css +0 -78
- package/src/components/Rows/FourStorySlider/index.js +0 -127
- package/src/components/Rows/FourStorySlider/stories.js +0 -117
- package/src/components/Rows/FourStorySliderPortrait/README.md +0 -45
- package/src/components/Rows/FourStorySliderPortrait/four-story-slider-portrait.m.css +0 -272
- package/src/components/Rows/FourStorySliderPortrait/index.js +0 -129
- package/src/components/Rows/FourStorySliderPortrait/stories.js +0 -117
- package/src/components/Rows/FourTabbedBigStorySlider/README.md +0 -39
- package/src/components/Rows/FourTabbedBigStorySlider/four-tabbed-big-story-slider.m.css +0 -265
- package/src/components/Rows/FourTabbedBigStorySlider/index.js +0 -158
- package/src/components/Rows/FourTabbedBigStorySlider/stories.js +0 -63
- package/src/components/Rows/FullScreenSlider/README.md +0 -46
- package/src/components/Rows/FullScreenSlider/full-screen-slider.m.css +0 -155
- package/src/components/Rows/FullScreenSlider/index.js +0 -118
- package/src/components/Rows/FullScreenSlider/stories.js +0 -115
- package/src/components/Rows/HalfScreenSlider/README.md +0 -43
- package/src/components/Rows/HalfScreenSlider/half-screen-slider.m.css +0 -80
- package/src/components/Rows/HalfScreenSlider/index.js +0 -104
- package/src/components/Rows/HalfScreenSlider/stories.js +0 -115
- package/src/components/Rows/ListComponent/README.md +0 -48
- package/src/components/Rows/ListComponent/index.js +0 -151
- package/src/components/Rows/ListComponent/list-component.m.css +0 -65
- package/src/components/Rows/ListComponent/stories.js +0 -63
- package/src/components/Rows/Listicles/README.md +0 -32
- package/src/components/Rows/Listicles/index.js +0 -162
- package/src/components/Rows/Listicles/listicles.m.css +0 -149
- package/src/components/Rows/Listicles/stories.js +0 -66
- package/src/components/Rows/MagazineEditions/README.md +0 -21
- package/src/components/Rows/MagazineEditions/index.js +0 -91
- package/src/components/Rows/MagazineEditions/magazine-editions.m.css +0 -50
- package/src/components/Rows/MagazineEditions/magazine-editions.test.js +0 -33
- package/src/components/Rows/MagazineEditions/stories.js +0 -45
- package/src/components/Rows/MagazineHeaderCard/README.md +0 -21
- package/src/components/Rows/MagazineHeaderCard/index.js +0 -72
- package/src/components/Rows/MagazineHeaderCard/magazine-cards.m.css +0 -106
- package/src/components/Rows/MagazineHeaderCard/stories.js +0 -36
- package/src/components/Rows/MagazineWidget/README.md +0 -21
- package/src/components/Rows/MagazineWidget/index.js +0 -127
- package/src/components/Rows/MagazineWidget/stories.js +0 -43
- package/src/components/Rows/OneColStoryList/README.md +0 -48
- package/src/components/Rows/OneColStoryList/index.js +0 -198
- package/src/components/Rows/OneColStoryList/one-col-story-list.m.css +0 -81
- package/src/components/Rows/OneColStoryList/stories.js +0 -61
- package/src/components/Rows/OpinionCollection/README.md +0 -36
- package/src/components/Rows/OpinionCollection/index.js +0 -155
- package/src/components/Rows/OpinionCollection/opinion-collection.m.css +0 -226
- package/src/components/Rows/OpinionCollection/stories.js +0 -82
- package/src/components/Rows/SixColSixStories/README.md +0 -37
- package/src/components/Rows/SixColSixStories/index.js +0 -141
- package/src/components/Rows/SixColSixStories/six-col-six-stories.m.css +0 -75
- package/src/components/Rows/SixColSixStories/stories.js +0 -73
- package/src/components/Rows/StoryTemplates/ListicleStoryTemplates/README.md +0 -19
- package/src/components/Rows/StoryTemplates/ListicleStoryTemplates/__snapshots__/listicle-story.test.js.snap +0 -841
- package/src/components/Rows/StoryTemplates/ListicleStoryTemplates/index.js +0 -291
- package/src/components/Rows/StoryTemplates/ListicleStoryTemplates/listicle-story.m.css +0 -249
- package/src/components/Rows/StoryTemplates/ListicleStoryTemplates/listicle-story.test.js +0 -47
- package/src/components/Rows/StoryTemplates/ListicleStoryTemplates/stories.js +0 -116
- package/src/components/Rows/StoryTemplates/LiveBlogStoryTemplates/README.md +0 -25
- package/src/components/Rows/StoryTemplates/LiveBlogStoryTemplates/index.js +0 -55
- package/src/components/Rows/StoryTemplates/LiveBlogStoryTemplates/live-blog.m.css +0 -326
- package/src/components/Rows/StoryTemplates/LiveBlogStoryTemplates/stories.js +0 -120
- package/src/components/Rows/StoryTemplates/LiveBlogStoryTemplates/templates.js +0 -378
- package/src/components/Rows/StoryTemplates/PhotoStoryTemplates/index.js +0 -249
- package/src/components/Rows/StoryTemplates/PhotoStoryTemplates/photo-story.test.js +0 -144
- package/src/components/Rows/StoryTemplates/PhotoStoryTemplates/photo.m.css +0 -175
- package/src/components/Rows/StoryTemplates/PhotoStoryTemplates/stories.js +0 -123
- package/src/components/Rows/StoryTemplates/TextStoryTemplates/README.md +0 -49
- package/src/components/Rows/StoryTemplates/TextStoryTemplates/index.js +0 -74
- package/src/components/Rows/StoryTemplates/TextStoryTemplates/stories.js +0 -125
- package/src/components/Rows/StoryTemplates/TextStoryTemplates/templates.js +0 -274
- package/src/components/Rows/StoryTemplates/TextStoryTemplates/text-story.m.css +0 -449
- package/src/components/Rows/StoryTemplates/TextStoryTemplates/text-story.test.js +0 -222
- package/src/components/Rows/StoryTemplates/VideoStoryTemplates/README.md +0 -31
- package/src/components/Rows/StoryTemplates/VideoStoryTemplates/index.js +0 -237
- package/src/components/Rows/StoryTemplates/VideoStoryTemplates/stories.js +0 -204
- package/src/components/Rows/StoryTemplates/VideoStoryTemplates/video-story.m.css +0 -195
- package/src/components/Rows/TagIntroductionCard/README.md +0 -11
- package/src/components/Rows/TagIntroductionCard/index.js +0 -26
- package/src/components/Rows/TagIntroductionCard/stories.js +0 -21
- package/src/components/Rows/TagIntroductionCard/tag-intro-card.module.css +0 -25
- package/src/components/Rows/ThreeColFlexStories/README.md +0 -38
- package/src/components/Rows/ThreeColFlexStories/index.js +0 -182
- package/src/components/Rows/ThreeColFlexStories/stories.js +0 -73
- package/src/components/Rows/ThreeColFlexStories/three-col-flex-stories.m.css +0 -60
- package/src/components/Rows/ThreeColFourteenStory/README.md +0 -28
- package/src/components/Rows/ThreeColFourteenStory/index.js +0 -135
- package/src/components/Rows/ThreeColFourteenStory/stories.js +0 -60
- package/src/components/Rows/ThreeColFourteenStory/three-col-fourteen-story.m.css +0 -51
- package/src/components/Rows/ThreeColGrid/README.md +0 -36
- package/src/components/Rows/ThreeColGrid/index.js +0 -148
- package/src/components/Rows/ThreeColGrid/stories.js +0 -70
- package/src/components/Rows/ThreeColGrid/three-col.m.css +0 -43
- package/src/components/Rows/ThreeColSevenStory/README.md +0 -36
- package/src/components/Rows/ThreeColSevenStory/index.js +0 -172
- package/src/components/Rows/ThreeColSevenStory/stories.js +0 -71
- package/src/components/Rows/ThreeColSevenStory/three-col-seven-story.m.css +0 -44
- package/src/components/Rows/ThreeColSixStories/README.md +0 -40
- package/src/components/Rows/ThreeColSixStories/index.js +0 -161
- package/src/components/Rows/ThreeColSixStories/stories.js +0 -73
- package/src/components/Rows/ThreeColSixStories/three-col-six-stories.m.css +0 -32
- package/src/components/Rows/ThreeColTwelveStories/README.md +0 -41
- package/src/components/Rows/ThreeColTwelveStories/index.js +0 -123
- package/src/components/Rows/ThreeColTwelveStories/stories.js +0 -51
- package/src/components/Rows/ThreeColTwelveStories/three-col-twelve-stories.m.css +0 -83
- package/src/components/Rows/TwoColFourStory/README.md +0 -33
- package/src/components/Rows/TwoColFourStory/index.js +0 -151
- package/src/components/Rows/TwoColFourStory/stories.js +0 -68
- package/src/components/Rows/TwoColFourStory/two-col-four-story.m.css +0 -64
- package/src/components/Rows/TwoColFourStoryHighlight/README.md +0 -35
- package/src/components/Rows/TwoColFourStoryHighlight/index.js +0 -122
- package/src/components/Rows/TwoColFourStoryHighlight/stories.js +0 -48
- package/src/components/Rows/TwoColFourStoryHighlight/two-col-four-story-highlight.m.css +0 -116
- package/src/components/Rows/TwoColSevenStories/README.md +0 -37
- package/src/components/Rows/TwoColSevenStories/index.js +0 -152
- package/src/components/Rows/TwoColSevenStories/stories.js +0 -100
- package/src/components/Rows/TwoColSevenStories/two-col-seven-stories.m.css +0 -175
- package/src/components/Rows/TwoColSixStories/README.md +0 -36
- package/src/components/Rows/TwoColSixStories/index.js +0 -117
- package/src/components/Rows/TwoColSixStories/stories.js +0 -67
- package/src/components/Rows/TwoColSixStories/two-col-six-stories.m.css +0 -135
- package/src/components/Rows/TwoColTenStoriesSidebar/README.md +0 -34
- package/src/components/Rows/TwoColTenStoriesSidebar/index.js +0 -168
- package/src/components/Rows/TwoColTenStoriesSidebar/stories.js +0 -45
- package/src/components/Rows/TwoColTenStoriesSidebar/two-col-ten-stories-sidebar.m.css +0 -52
- package/src/components/Rows/TwoColThreeStory/README.md +0 -40
- package/src/components/Rows/TwoColThreeStory/index.js +0 -137
- package/src/components/Rows/TwoColThreeStory/stories.js +0 -68
- package/src/components/Rows/TwoColThreeStory/two-col-three-story.m.css +0 -36
- package/src/components/SharedContext.js +0 -13
- package/src/components/Svgs/Loading/loading.js +0 -133
- package/src/components/Svgs/Loading/loading.m.css +0 -5
- package/src/components/Svgs/SocialIcons/facebook.js +0 -15
- package/src/components/Svgs/SocialIcons/instagram.js +0 -24
- package/src/components/Svgs/SocialIcons/linkedin.js +0 -15
- package/src/components/Svgs/SocialIcons/pinterest.js +0 -12
- package/src/components/Svgs/SocialIcons/twitter.js +0 -15
- package/src/components/Svgs/SocialIcons/whatsapp.js +0 -17
- package/src/components/Svgs/SocialIcons/youtube.js +0 -17
- package/src/components/Svgs/caret-right.svg +0 -3
- package/src/components/Svgs/clock-icon.js +0 -17
- package/src/components/Svgs/close-icon.js +0 -15
- package/src/components/Svgs/crown.js +0 -31
- package/src/components/Svgs/fallbackImage.js +0 -42
- package/src/components/Svgs/hyperlink.js +0 -17
- package/src/components/Svgs/key.js +0 -33
- package/src/components/Svgs/left-arrow.js +0 -17
- package/src/components/Svgs/liveicon.js +0 -13
- package/src/components/Svgs/lock.js +0 -31
- package/src/components/Svgs/right-arrow.js +0 -17
- package/src/components/Svgs/share-icon.js +0 -17
- package/src/components/Svgs/star.js +0 -28
- package/src/components/Svgs/user-fallback-icon.js +0 -19
- package/src/components/Typography/README.md +0 -7
- package/src/components/Typography/index.js +0 -47
- package/src/components/Typography/stories.js +0 -10
- package/src/components/Typography/style.m.css +0 -11
- package/src/entry-points.js +0 -357
- package/src/guide/stories.js +0 -18
- package/src/hydration-component/index.js +0 -37
- package/src/hydration-component/useNearScreen.js +0 -56
- package/src/index.js +0 -91
- package/src/utils/testing-utils.js +0 -8
- package/src/utils/utils.js +0 -305
- package/src/utils/utils.test.js +0 -55
- package/storybook/index.js +0 -83
package/src/utils/utils.js
DELETED
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
import get from "lodash/get";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import upperCase from "lodash/upperCase";
|
|
4
|
-
import Timeago from "react-timeago";
|
|
5
|
-
import React from "react";
|
|
6
|
-
import lowerCase from "lodash/lowerCase";
|
|
7
|
-
import { format, utcToZonedTime } from "date-fns-tz";
|
|
8
|
-
|
|
9
|
-
const canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
10
|
-
|
|
11
|
-
export const sharePageUrl = canUseDOM && window.location.href;
|
|
12
|
-
|
|
13
|
-
export function truncate(string = "", limit = 60, ellipsis = true) {
|
|
14
|
-
const putEllipsis = ellipsis ? " ..." : "";
|
|
15
|
-
return typeof string === "string" && string.length > limit ? string.substring(0, limit) + putEllipsis : string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const timestampToFormat = (value, unit, suffix, timestamp, config = {}, languageCode = "en") => {
|
|
19
|
-
const {
|
|
20
|
-
showTime = false,
|
|
21
|
-
isTimeFirst = false,
|
|
22
|
-
isUpperCase = false,
|
|
23
|
-
disableMeridiem = false,
|
|
24
|
-
timeFormat = "12hours",
|
|
25
|
-
localizedZeroToPad
|
|
26
|
-
} = config;
|
|
27
|
-
const monthList = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
28
|
-
const dateTime = new Date(timestamp);
|
|
29
|
-
const date = dateTime
|
|
30
|
-
.getDate()
|
|
31
|
-
.toString()
|
|
32
|
-
.padStart(2, 0);
|
|
33
|
-
|
|
34
|
-
const month = monthList[dateTime.getMonth()];
|
|
35
|
-
let localizedMonth = month;
|
|
36
|
-
if (isUpperCase) {
|
|
37
|
-
localizedMonth = upperCase(month);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const year = dateTime.getFullYear();
|
|
41
|
-
const { localizedMeridiem, localizedMonths, direction = "ltr" } = config;
|
|
42
|
-
const time = formatAMPM(timestamp, timeFormat, localizedZeroToPad, languageCode);
|
|
43
|
-
let timeWithLocalizedMeridiem = time;
|
|
44
|
-
let timetoShow;
|
|
45
|
-
|
|
46
|
-
if (localizedMonths) {
|
|
47
|
-
localizedMonth = get(localizedMonths, [lowerCase(month)]) || month;
|
|
48
|
-
}
|
|
49
|
-
const localizedDate = Number(date).toLocaleString(languageCode);
|
|
50
|
-
const localizedYear = year.toLocaleString(languageCode).replace(/,/g, "");
|
|
51
|
-
|
|
52
|
-
if (localizedMeridiem) {
|
|
53
|
-
const isAm = time.includes("am");
|
|
54
|
-
const { am = "am", pm = "pm" } = localizedMeridiem;
|
|
55
|
-
timeWithLocalizedMeridiem = (isAm ? time.replace("am", am) : time.replace("pm", pm)) || time;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (direction === "rtl") {
|
|
59
|
-
timetoShow = showTime ? `${timeWithLocalizedMeridiem}` : "";
|
|
60
|
-
return `${localizedDate} ${localizedMonth}, ${localizedYear} ${timetoShow} `;
|
|
61
|
-
} else {
|
|
62
|
-
if (disableMeridiem) {
|
|
63
|
-
return `${localizedMonth} ${localizedDate}, ${localizedYear}`;
|
|
64
|
-
} else if (isTimeFirst) {
|
|
65
|
-
return `${timeWithLocalizedMeridiem}, ${localizedDate} ${localizedMonth} ${localizedYear}`;
|
|
66
|
-
} else {
|
|
67
|
-
timetoShow = showTime ? `, ${timeWithLocalizedMeridiem}` : "";
|
|
68
|
-
return `${localizedDate} ${localizedMonth}, ${localizedYear}${timetoShow}`;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export function formatter(value, unit, suffix, date, config, languageCode) {
|
|
74
|
-
const showDateForUnits = ["day", "week", "month", "year"];
|
|
75
|
-
// suffix here refers to ago
|
|
76
|
-
// unit here refers to seconds, minute, minutes,...
|
|
77
|
-
const localizedSuffix = get(config, ["localizedPublishTime", suffix]) || suffix;
|
|
78
|
-
let localizedUnitOfTime;
|
|
79
|
-
|
|
80
|
-
if ((unit === "hour" && value > 23) || showDateForUnits.indexOf(unit) !== -1) {
|
|
81
|
-
return timestampToFormat(value, unit, suffix, date, config, languageCode);
|
|
82
|
-
} else if (value > 1) {
|
|
83
|
-
localizedUnitOfTime = get(config, ["localizedPublishTime", `${unit}s`]) || `${unit}s`;
|
|
84
|
-
return `${value.toLocaleString(languageCode)} ${localizedUnitOfTime} ${localizedSuffix}`;
|
|
85
|
-
}
|
|
86
|
-
localizedUnitOfTime = get(config, ["localizedPublishTime", unit]) || unit;
|
|
87
|
-
return `${value.toLocaleString(languageCode)} ${localizedUnitOfTime} ${localizedSuffix} `;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function formatAMPM(timestamp, timeFormat = "12hours", localizedZeroToPad, languageCode) {
|
|
91
|
-
const dateTime = new Date(timestamp);
|
|
92
|
-
let hours = dateTime.getHours();
|
|
93
|
-
let minutes = dateTime.getMinutes();
|
|
94
|
-
const ampm = hours >= 12 ? "pm" : "am";
|
|
95
|
-
hours = hours % 12;
|
|
96
|
-
hours = hours || 12;
|
|
97
|
-
const padZero = languageCode === "en" ? "0" : localizedZeroToPad;
|
|
98
|
-
minutes = minutes < 10 ? padZero + minutes.toLocaleString(languageCode) : minutes.toLocaleString(languageCode);
|
|
99
|
-
const strTime = hours.toLocaleString(languageCode) + ":" + minutes + " " + ampm.toLocaleString(languageCode);
|
|
100
|
-
if (timeFormat === "24hours") {
|
|
101
|
-
return dateTime.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
102
|
-
}
|
|
103
|
-
return strTime;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export const hexToRGB = (hex) => {
|
|
107
|
-
const r = parseInt(hex.slice(1, 3), 16);
|
|
108
|
-
const g = parseInt(hex.slice(3, 5), 16);
|
|
109
|
-
const b = parseInt(hex.slice(5, 7), 16);
|
|
110
|
-
return { r, g, b };
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export const getLuminanceOfColor = (hex) => {
|
|
114
|
-
const { r, g, b } = hexToRGB(hex);
|
|
115
|
-
return r * 0.299 + g * 0.587 + b * 0.114;
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export const rgbToHex = (color = "rgba(255, 255, 255, 0)") => {
|
|
119
|
-
let rgba = color.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
|
120
|
-
return rgba && rgba.length === 4
|
|
121
|
-
? "#" +
|
|
122
|
-
("0" + parseInt(rgba[1], 10).toString(16)).slice(-2) +
|
|
123
|
-
("0" + parseInt(rgba[2], 10).toString(16)).slice(-2) +
|
|
124
|
-
("0" + parseInt(rgba[3], 10).toString(16)).slice(-2)
|
|
125
|
-
: color;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const clientWidths = {
|
|
129
|
-
mobile: 767,
|
|
130
|
-
tablet: 1024
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export const clientWidth = (device) => {
|
|
134
|
-
const foundDeviceWidth = get(clientWidths, device);
|
|
135
|
-
if (foundDeviceWidth) {
|
|
136
|
-
return get(global, "document.documentElement.clientWidth") <= foundDeviceWidth;
|
|
137
|
-
}
|
|
138
|
-
return false;
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
export const getTextColor = (theme = "rgb(255,255,255)") => {
|
|
142
|
-
const isRegexCheck = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(theme);
|
|
143
|
-
const getHexValue = !isRegexCheck ? rgbToHex(theme) : theme;
|
|
144
|
-
const textColor = getLuminanceOfColor(getHexValue) < 155 ? "light" : "dark";
|
|
145
|
-
return textColor;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
export function getNumberOfStoriesToShow(numberOfStoriesToShow) {
|
|
149
|
-
return numberOfStoriesToShow ? parseInt(numberOfStoriesToShow) : 1;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export const getSlot = (type, component, storyCallback, collectionCallback) => {
|
|
153
|
-
switch (type) {
|
|
154
|
-
case "story":
|
|
155
|
-
return storyCallback();
|
|
156
|
-
case "collection":
|
|
157
|
-
return collectionCallback();
|
|
158
|
-
default:
|
|
159
|
-
return component ? component() : null;
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
export const getSlug = (collection, config = {}) => {
|
|
164
|
-
const { magazineSlug = "", isArchivePage = false } = config;
|
|
165
|
-
if (isArchivePage) {
|
|
166
|
-
return `/magazine/archive/${magazineSlug}`;
|
|
167
|
-
}
|
|
168
|
-
if (magazineSlug) {
|
|
169
|
-
return `/magazine/${magazineSlug}/${collection.slug}`;
|
|
170
|
-
}
|
|
171
|
-
const isSection = collection.template === "section";
|
|
172
|
-
if (isSection) {
|
|
173
|
-
const sectionId = get(collection, ["metadata", "section", "0", "id"], "");
|
|
174
|
-
const { sections } = config;
|
|
175
|
-
const section = sections && sections.find((section) => section.id === sectionId);
|
|
176
|
-
return section ? section["section-url"] : "/";
|
|
177
|
-
}
|
|
178
|
-
return `/collection/${collection.slug}`;
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
export function isExternalStory(story = {}) {
|
|
182
|
-
const { "story-template": storyTemplate = "", metadata = {} } = story;
|
|
183
|
-
return storyTemplate === "news-elsewhere" ? get(metadata, ["reference-url"], "") : "";
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// Adds target='_blank' attribute to anchor tags if not present
|
|
187
|
-
export const updateContentLinks = (content) => {
|
|
188
|
-
let updatedContent = content;
|
|
189
|
-
const anchorTagsList = content.match(/(<a).*?(>)/g);
|
|
190
|
-
anchorTagsList &&
|
|
191
|
-
anchorTagsList.forEach((anchorTag) => {
|
|
192
|
-
const isTargetPresent = /target=/g.test(anchorTag);
|
|
193
|
-
if (!isTargetPresent) {
|
|
194
|
-
updatedContent = updatedContent.replace(
|
|
195
|
-
anchorTag,
|
|
196
|
-
`<a aria-label='content' target='_blank'${anchorTag.substring(2)}`
|
|
197
|
-
);
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
return updatedContent;
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
export const isEmpty = (value) => {
|
|
204
|
-
return (
|
|
205
|
-
value == null || // From standard.js: Always use === - but value == null is allowed to check null || undefined
|
|
206
|
-
(typeof value === "object" && Object.entries(value).length === 0 && value.constructor === Object) ||
|
|
207
|
-
(typeof value === "string" && value.trim().length === 0)
|
|
208
|
-
);
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
export const shapeConfig = PropTypes.shape({
|
|
212
|
-
"sketches-host": PropTypes.string,
|
|
213
|
-
"cdn-name": PropTypes.string,
|
|
214
|
-
"cdn-image": PropTypes.string
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
export const shapeStory = PropTypes.shape({
|
|
218
|
-
headline: PropTypes.string,
|
|
219
|
-
"last-published-at": PropTypes.number,
|
|
220
|
-
subheadline: PropTypes.string
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
export const getStoryUrl = (story, defaultValue = "") => {
|
|
224
|
-
return get(story, ["story-template"]) === "news-elsewhere"
|
|
225
|
-
? get(story, ["metadata", "reference-url"], "")
|
|
226
|
-
: story.url || defaultValue;
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
export const detectComponent = (component, adComponent, widgetComp) => {
|
|
230
|
-
const { type } = component;
|
|
231
|
-
switch (type) {
|
|
232
|
-
case "ad":
|
|
233
|
-
return adComponent(component);
|
|
234
|
-
case "widget":
|
|
235
|
-
return widgetComp(component);
|
|
236
|
-
default:
|
|
237
|
-
return null;
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
export const facebookMobileVideoResizeFix = () => {
|
|
242
|
-
if (typeof window !== "undefined" && window.matchMedia && window.matchMedia("(max-width: 767px)").matches) {
|
|
243
|
-
const applyFixAfterTime = 3000;
|
|
244
|
-
const aspectRatioAdjustmentFactor = 0.7;
|
|
245
|
-
setTimeout(() => {
|
|
246
|
-
document
|
|
247
|
-
.querySelectorAll(".story-element-jsembed.story-element-jsembed-facebook-post span")
|
|
248
|
-
.forEach((element) => {
|
|
249
|
-
if (!element.classList.contains("fixed-mobile-fb-video")) {
|
|
250
|
-
element.style.height = `${Math.ceil(element.offsetHeight * aspectRatioAdjustmentFactor)}px`;
|
|
251
|
-
element.classList.add("fixed-mobile-fb-video");
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
}, applyFixAfterTime);
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
export const navigateTo = (dispatch, url = "") => {
|
|
259
|
-
global.app.navigateToPage(dispatch, url);
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
export const generateNavigateSlug = (collection = {}, config = {}, customUrlPath) => {
|
|
263
|
-
if (customUrlPath) {
|
|
264
|
-
return customUrlPath;
|
|
265
|
-
}
|
|
266
|
-
const { magazineSlug = "", isArchivePage = false } = config;
|
|
267
|
-
if (isArchivePage) {
|
|
268
|
-
return `/magazine/archive/${magazineSlug}`;
|
|
269
|
-
}
|
|
270
|
-
if (magazineSlug) {
|
|
271
|
-
return `/magazine/${magazineSlug}/${collection.slug}`;
|
|
272
|
-
}
|
|
273
|
-
if (collection) {
|
|
274
|
-
return getSlug(collection, config);
|
|
275
|
-
}
|
|
276
|
-
return "/";
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
export const getCollectionData = async (collectionSlug, mountAtPrefix = "") => {
|
|
280
|
-
try {
|
|
281
|
-
const result = await (await fetch(
|
|
282
|
-
`${mountAtPrefix}/api/v1/collections/${collectionSlug}?item-type=story&limit=6`
|
|
283
|
-
)).json();
|
|
284
|
-
return result;
|
|
285
|
-
} catch (err) {
|
|
286
|
-
// eslint-disable-next-line no-console
|
|
287
|
-
console.error(err);
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
export const getTimeStamp = (date, formatter, config = {}, languageCode, template, timezone = null) => {
|
|
292
|
-
if (timezone && template === "story") {
|
|
293
|
-
const zonedTime = timezone && utcToZonedTime(date, timezone);
|
|
294
|
-
const formatZonedTime = zonedTime && format(zonedTime, "yyyy-MM-dd'T'HH:mm:ssXXX", { timeZone: timezone });
|
|
295
|
-
const timeStamp = timestampToFormat("", "", "", date, config);
|
|
296
|
-
return <time dateTime={formatZonedTime}>{timeStamp}</time>;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
return (
|
|
300
|
-
<Timeago
|
|
301
|
-
date={date}
|
|
302
|
-
formatter={(value, unit, suffix, date) => formatter(value, unit, suffix, date, config, languageCode)}
|
|
303
|
-
/>
|
|
304
|
-
);
|
|
305
|
-
};
|
package/src/utils/utils.test.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { updateContentLinks, isEmpty, sharePageUrl } from "./utils";
|
|
2
|
-
|
|
3
|
-
describe("updateContentLinks", () => {
|
|
4
|
-
it("should add target='_blank' to anchor tags if target attribute not present", () => {
|
|
5
|
-
const content =
|
|
6
|
-
"<p>Coronavirus in India News Live Updates: <a target='_parent'>India</a> has recorded the <a href='#'>highest</a> single-day spike in fresh cases of novel <a>coronavirus</a> with the number crossing 1,300.";
|
|
7
|
-
const updatedContent = updateContentLinks(content);
|
|
8
|
-
expect(updatedContent).toBe(
|
|
9
|
-
"<p>Coronavirus in India News Live Updates: <a target='_parent'>India</a> has recorded the <a aria-label='content' target='_blank' href='#'>highest</a> single-day spike in fresh cases of novel <a aria-label='content' target='_blank'>coronavirus</a> with the number crossing 1,300."
|
|
10
|
-
);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
describe("isEmpty", () => {
|
|
15
|
-
it("should return true if the value is null/ undefined", () => {
|
|
16
|
-
const value = null;
|
|
17
|
-
const result = isEmpty(value);
|
|
18
|
-
expect(result).toBe(true);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it("should return true if the value is an empty string", () => {
|
|
22
|
-
const value = "";
|
|
23
|
-
const result = isEmpty(value);
|
|
24
|
-
expect(result).toBe(true);
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it("should return true if the value is an empty object", () => {
|
|
28
|
-
const value = {};
|
|
29
|
-
const result = isEmpty(value);
|
|
30
|
-
expect(result).toBe(true);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it("should return false if the value is not null/ undefined", () => {
|
|
34
|
-
const value = 6;
|
|
35
|
-
const result = isEmpty(value);
|
|
36
|
-
expect(result).toBe(false);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it("should return false if the value is not an empty string", () => {
|
|
40
|
-
const value = "value";
|
|
41
|
-
const result = isEmpty(value);
|
|
42
|
-
expect(result).toBe(false);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it("should return false if the value is not an empty object", () => {
|
|
46
|
-
const value = { data: "read" };
|
|
47
|
-
const result = isEmpty(value);
|
|
48
|
-
expect(result).toBe(false);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it("should return window if the page url is defined", () => {
|
|
52
|
-
const result = sharePageUrl;
|
|
53
|
-
expect(result).toBe(window.location["href"]);
|
|
54
|
-
});
|
|
55
|
-
});
|
package/storybook/index.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Provider } from "react-redux";
|
|
3
|
-
import * as storybook from "@storybook/react";
|
|
4
|
-
import { withKnobs, select } from "@storybook/addon-knobs";
|
|
5
|
-
import { action } from "@storybook/addon-actions";
|
|
6
|
-
import { addReadme } from "storybook-readme";
|
|
7
|
-
|
|
8
|
-
import "../assets/stylesheets/reset.scss";
|
|
9
|
-
import "../assets/stylesheets/app.scss";
|
|
10
|
-
|
|
11
|
-
export function optionalSelect() {
|
|
12
|
-
return select.apply(null, arguments) || undefined;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const storiesOf = (componentName) => {
|
|
16
|
-
return storybook
|
|
17
|
-
.storiesOf(componentName, module)
|
|
18
|
-
.addParameters({
|
|
19
|
-
options: {
|
|
20
|
-
theme: {
|
|
21
|
-
base: "light",
|
|
22
|
-
brandTitle: "Quintype",
|
|
23
|
-
brandUrl: "https://quintype.com",
|
|
24
|
-
brandImage:
|
|
25
|
-
// eslint-disable-next-line max-len
|
|
26
|
-
"https://images.assettype.com/quintype-website/2018-10/013e8cbe-92b4-435f-bbbb-3e101efbc99a/quintype_logo.png"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
})
|
|
30
|
-
.addDecorator(addReadme)
|
|
31
|
-
.addDecorator(withKnobs)
|
|
32
|
-
.addDecorator((story) => (
|
|
33
|
-
<React.Fragment>
|
|
34
|
-
<style>
|
|
35
|
-
{
|
|
36
|
-
// eslint-disable-next-line max-len
|
|
37
|
-
"@font-face{font-family:'PT Serif';font-style:normal;font-weight:400;font-display:swap;src:local('PT Serif'),local('PTSerif-Regular'),url(https://fonts.gstatic.com/s/ptserif/v10/EJRVQgYoZZY2vCFuvAFWzrk.woff) format('woff')}@font-face{font-family:'PT Serif';font-style:normal;font-weight:700;font-display:swap;src:local('PT Serif Bold'),local('PTSerif-Bold'),url(https://fonts.gstatic.com/s/ptserif/v10/EJRSQgYoZZY2vCFuvAnt66qSVy0.woff) format('woff')}@font-face{font-family:Roboto;font-style:normal;font-weight:400;font-display:swap;src:local('Roboto'),local('Roboto-Regular'),url(https://fonts.gstatic.com/s/roboto/v19/KFOmCnqEu92Fr1Mu4mxM.woff) format('woff')}@font-face{font-family:Roboto;font-style:normal;font-weight:700;font-display:swap;src:local('Roboto Bold'),local('Roboto-Bold'),url(https://fonts.gstatic.com/s/roboto/v19/KFOlCnqEu92Fr1MmWUlfBBc-.woff) format('woff')}"
|
|
38
|
-
}
|
|
39
|
-
{`:root {--sansTypeface: 'Roboto', sans-serif;--serifTypeface: PT Serif, sans-serif;}`}
|
|
40
|
-
</style>
|
|
41
|
-
{story()}
|
|
42
|
-
</React.Fragment>
|
|
43
|
-
));
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export function withStore(componentName, state, readme) {
|
|
47
|
-
const store = {
|
|
48
|
-
getState: () => state || { qt: { config: { iconSpritePath: "/sprite.svg" } } },
|
|
49
|
-
subscribe: () => 0,
|
|
50
|
-
dispatch: action("some action")
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
return storiesOf(componentName)
|
|
54
|
-
.addDecorator((story) => <Provider store={store}>{story()}</Provider>)
|
|
55
|
-
.addParameters({
|
|
56
|
-
options: {
|
|
57
|
-
showPanel: true,
|
|
58
|
-
panelPosition: "right"
|
|
59
|
-
},
|
|
60
|
-
readme: {
|
|
61
|
-
sidebar: readme,
|
|
62
|
-
codeTheme: "a11y-dark"
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export const sectionTagTemplates = {
|
|
68
|
-
default: "",
|
|
69
|
-
solid: "solid",
|
|
70
|
-
borderBottomSml: "borderBottomSml",
|
|
71
|
-
borderLeft: "borderLeft"
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export const collectionNameTemplates = {
|
|
75
|
-
default: "",
|
|
76
|
-
borderLeft: "borderLeft",
|
|
77
|
-
borderBottom: "borderBottom",
|
|
78
|
-
crossLine: "crossLine",
|
|
79
|
-
borderBottomFull: "borderBottomFull"
|
|
80
|
-
};
|
|
81
|
-
export const footerButton = {
|
|
82
|
-
NavigateToPage: "NavigateToPage"
|
|
83
|
-
};
|