diff --git a/dotcom-rendering/.storybook/decorators/splitThemeDecorator.tsx b/dotcom-rendering/.storybook/decorators/splitThemeDecorator.tsx index 47388bd7976..8c0faa5b21b 100644 --- a/dotcom-rendering/.storybook/decorators/splitThemeDecorator.tsx +++ b/dotcom-rendering/.storybook/decorators/splitThemeDecorator.tsx @@ -6,7 +6,7 @@ import { ArticleFormat, ArticleSpecial, Pillar, -} from '@guardian/libs'; +} from '../../src/lib/format'; import { palette as sourcePalette, space, diff --git a/dotcom-rendering/.storybook/decorators/themeDecorator.tsx b/dotcom-rendering/.storybook/decorators/themeDecorator.tsx index ad8f27fedc2..988a714a5a7 100644 --- a/dotcom-rendering/.storybook/decorators/themeDecorator.tsx +++ b/dotcom-rendering/.storybook/decorators/themeDecorator.tsx @@ -12,7 +12,7 @@ import { type StoryContext, type StrictArgs, } from '@storybook/react'; -import { ArticleFormat } from '@guardian/libs'; +import { ArticleFormat } from '../../src/lib/format'; import type { CSSProperties } from 'react'; const darkStoryCss = css` diff --git a/dotcom-rendering/.storybook/mocks/paletteDeclarations.ts b/dotcom-rendering/.storybook/mocks/paletteDeclarations.ts index 60595d547bb..0e3165b9e63 100644 --- a/dotcom-rendering/.storybook/mocks/paletteDeclarations.ts +++ b/dotcom-rendering/.storybook/mocks/paletteDeclarations.ts @@ -1,4 +1,4 @@ -import { ArticleFormat } from '@guardian/libs'; +import { ArticleFormat } from '../../src/lib/format'; import { paletteDeclarations } from '../../src/palette'; /** diff --git a/dotcom-rendering/.storybook/toolbar/globalColourScheme.ts b/dotcom-rendering/.storybook/toolbar/globalColourScheme.ts index e2aa8b0078a..b8698fea4db 100644 --- a/dotcom-rendering/.storybook/toolbar/globalColourScheme.ts +++ b/dotcom-rendering/.storybook/toolbar/globalColourScheme.ts @@ -6,7 +6,7 @@ import { ArticleDesign, Pillar, type ArticleFormat, -} from '@guardian/libs'; +} from '../../src/lib/format'; const defaultFormat: ArticleFormat = { display: ArticleDisplay.Standard, diff --git a/dotcom-rendering/fixtures/manual/guideAtom.ts b/dotcom-rendering/fixtures/manual/guideAtom.ts index fca708e3799..2ce275d2c31 100644 --- a/dotcom-rendering/fixtures/manual/guideAtom.ts +++ b/dotcom-rendering/fixtures/manual/guideAtom.ts @@ -1,4 +1,4 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../src/lib/format'; export const defaultStoryExpanded = { id: 'a76d998e-d4b0-4d00-8afb-773eddb4064c', diff --git a/dotcom-rendering/fixtures/manual/key-events.ts b/dotcom-rendering/fixtures/manual/key-events.ts index a17381be102..8992ce8cf08 100644 --- a/dotcom-rendering/fixtures/manual/key-events.ts +++ b/dotcom-rendering/fixtures/manual/key-events.ts @@ -3,7 +3,7 @@ import { ArticleDisplay, type ArticleFormat, Pillar, -} from '@guardian/libs'; +} from '../../src/lib/format'; export interface KeyEventCard { id: string; diff --git a/dotcom-rendering/fixtures/manual/trails-nav.ts b/dotcom-rendering/fixtures/manual/trails-nav.ts index 63487f2a753..b11efa3b7e3 100644 --- a/dotcom-rendering/fixtures/manual/trails-nav.ts +++ b/dotcom-rendering/fixtures/manual/trails-nav.ts @@ -1,4 +1,4 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../src/lib/format'; import type { TrailType } from '../../src/types/trails'; export const trails: [ diff --git a/dotcom-rendering/fixtures/manual/trails.ts b/dotcom-rendering/fixtures/manual/trails.ts index 69becbea2e2..8fc816d4d1c 100644 --- a/dotcom-rendering/fixtures/manual/trails.ts +++ b/dotcom-rendering/fixtures/manual/trails.ts @@ -3,7 +3,7 @@ import { ArticleDisplay, type ArticleFormat, Pillar, -} from '@guardian/libs'; +} from '../../src/lib/format'; import type { DCRFrontCard } from '../../src/types/front'; import { discussionApiUrl } from './discussionApiUrl'; diff --git a/dotcom-rendering/scripts/gen-stories/get-stories.mjs b/dotcom-rendering/scripts/gen-stories/get-stories.mjs index 5ed0c04646e..8c0e2f03eda 100644 --- a/dotcom-rendering/scripts/gen-stories/get-stories.mjs +++ b/dotcom-rendering/scripts/gen-stories/get-stories.mjs @@ -34,9 +34,9 @@ const CARD_TEMPLATE_HEADER = ` * These stories were auto-generated by \`dotcom-rendering/scripts/gen-stories/gen-stories.js\` */ -import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar } from '@guardian/libs'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { CardsWithDifferentThemes } from '../../src/components/Card/Card.stories'; +import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar } from '../../src/lib/format'; // eslint-disable-next-line import/no-default-export -- we need a default here export default { diff --git a/dotcom-rendering/src/components/AdSlot.web.tsx b/dotcom-rendering/src/components/AdSlot.web.tsx index 279ab0cde64..4d4e2994d32 100644 --- a/dotcom-rendering/src/components/AdSlot.web.tsx +++ b/dotcom-rendering/src/components/AdSlot.web.tsx @@ -1,7 +1,6 @@ import { css } from '@emotion/react'; import type { SlotName } from '@guardian/commercial'; import { adSizes, constants } from '@guardian/commercial'; -import { ArticleDisplay } from '@guardian/libs'; import { between, breakpoints, @@ -12,6 +11,7 @@ import { until, } from '@guardian/source/foundations'; import { Hide } from '@guardian/source/react-components'; +import { ArticleDisplay } from '../lib/format'; import { getZIndex } from '../lib/getZIndex'; import { LABS_HEADER_HEIGHT } from '../lib/labs-constants'; import { palette as schemedPalette } from '../palette'; diff --git a/dotcom-rendering/src/components/AllEditorialNewslettersPage.tsx b/dotcom-rendering/src/components/AllEditorialNewslettersPage.tsx index afbe742187f..725646ca42f 100644 --- a/dotcom-rendering/src/components/AllEditorialNewslettersPage.tsx +++ b/dotcom-rendering/src/components/AllEditorialNewslettersPage.tsx @@ -1,7 +1,7 @@ import { Global } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { StrictMode } from 'react'; import { AllEditorialNewslettersPageLayout } from '../layouts/AllEditorialNewslettersPageLayout'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { rootStyles } from '../lib/rootStyles'; import type { NavType } from '../model/extract-nav'; import type { DCRNewslettersPageType } from '../types/newslettersPage'; diff --git a/dotcom-rendering/src/components/Answers.stories.tsx b/dotcom-rendering/src/components/Answers.stories.tsx index f48b107edec..c902259691e 100644 --- a/dotcom-rendering/src/components/Answers.stories.tsx +++ b/dotcom-rendering/src/components/Answers.stories.tsx @@ -1,8 +1,8 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { Radio, RadioGroup } from '@guardian/source/react-components'; import type { Meta, StoryObj } from '@storybook/react'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { CorrectSelectedAnswer, IncorrectAnswer, diff --git a/dotcom-rendering/src/components/Answers.tsx b/dotcom-rendering/src/components/Answers.tsx index 09f1aefa490..1bd22c212aa 100644 --- a/dotcom-rendering/src/components/Answers.tsx +++ b/dotcom-rendering/src/components/Answers.tsx @@ -1,6 +1,4 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; -import { ArticleSpecial } from '@guardian/libs'; import { article17, palette, @@ -9,6 +7,7 @@ import { textSans17, } from '@guardian/source/foundations'; import { SvgCheckmark, SvgCross } from '@guardian/source/react-components'; +import { ArticleSpecial, type ArticleTheme } from '../lib/format'; import { palette as schemedPalette } from '../palette'; // We export Radio wrapper styles to override Source Radio buttons to align diff --git a/dotcom-rendering/src/components/AppsEpic.importable.stories.tsx b/dotcom-rendering/src/components/AppsEpic.importable.stories.tsx index 80f75c4f4b9..964a77c1476 100644 --- a/dotcom-rendering/src/components/AppsEpic.importable.stories.tsx +++ b/dotcom-rendering/src/components/AppsEpic.importable.stories.tsx @@ -1,6 +1,6 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { Meta, StoryObj } from '@storybook/react'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { AppsEpic as AppsEpicComponent } from './AppsEpic.importable'; const meta = { diff --git a/dotcom-rendering/src/components/AppsFooter.importable.stories.tsx b/dotcom-rendering/src/components/AppsFooter.importable.stories.tsx index 0982cb57b7c..8a48d625799 100644 --- a/dotcom-rendering/src/components/AppsFooter.importable.stories.tsx +++ b/dotcom-rendering/src/components/AppsFooter.importable.stories.tsx @@ -1,6 +1,6 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { Meta, StoryObj } from '@storybook/react'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { AppsFooter as AppsFooterComponent } from './AppsFooter.importable'; const meta = { diff --git a/dotcom-rendering/src/components/AppsLightboxImage.importable.tsx b/dotcom-rendering/src/components/AppsLightboxImage.importable.tsx index 30ca898b235..7bf4e394d56 100644 --- a/dotcom-rendering/src/components/AppsLightboxImage.importable.tsx +++ b/dotcom-rendering/src/components/AppsLightboxImage.importable.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; +import type { ArticleFormat } from '../lib/format'; import { type RoleType } from '../types/content'; import { openLightboxForImageId } from './AppsLightboxImageStore.importable'; import type { Loading } from './CardPicture'; diff --git a/dotcom-rendering/src/components/ArticleBody.tsx b/dotcom-rendering/src/components/ArticleBody.tsx index 18dae822cae..f0d61020b98 100644 --- a/dotcom-rendering/src/components/ArticleBody.tsx +++ b/dotcom-rendering/src/components/ArticleBody.tsx @@ -1,6 +1,4 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay } from '@guardian/libs'; -import type { ArticleFormat } from '@guardian/libs'; import { between, headlineBold24, @@ -9,6 +7,11 @@ import { } from '@guardian/source/foundations'; import { ArticleRenderer } from '../lib/ArticleRenderer'; import type { EditionId } from '../lib/edition'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, +} from '../lib/format'; import { decideLanguage, decideLanguageDirection } from '../lib/lang'; import { revealStyles } from '../lib/revealStyles'; import { palette as themePalette } from '../palette'; diff --git a/dotcom-rendering/src/components/ArticleContainer.tsx b/dotcom-rendering/src/components/ArticleContainer.tsx index 0043fbc63fb..6d9f1a00f13 100644 --- a/dotcom-rendering/src/components/ArticleContainer.tsx +++ b/dotcom-rendering/src/components/ArticleContainer.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; import { adSizes, constants } from '@guardian/commercial'; -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; import { from, space, until } from '@guardian/source/foundations'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { palette } from '../palette'; import { carrotAdStyles, labelStyles } from './AdSlot.web'; diff --git a/dotcom-rendering/src/components/ArticleHeadline.stories.tsx b/dotcom-rendering/src/components/ArticleHeadline.stories.tsx index 260410c107e..2a58947616b 100644 --- a/dotcom-rendering/src/components/ArticleHeadline.stories.tsx +++ b/dotcom-rendering/src/components/ArticleHeadline.stories.tsx @@ -1,13 +1,13 @@ import { css } from '@emotion/react'; +import type { Meta, StoryObj } from '@storybook/react'; +import { centreColumnDecorator } from '../../.storybook/decorators/gridDecorators'; +import { allModes } from '../../.storybook/modes'; import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import type { Meta, StoryObj } from '@storybook/react'; -import { centreColumnDecorator } from '../../.storybook/decorators/gridDecorators'; -import { allModes } from '../../.storybook/modes'; +} from '../lib/format'; import { formatToString, getAllThemes } from '../lib/format'; import { palette } from '../palette'; import { ArticleHeadline } from './ArticleHeadline'; diff --git a/dotcom-rendering/src/components/ArticleHeadline.tsx b/dotcom-rendering/src/components/ArticleHeadline.tsx index 097328a2126..4a01ed847ac 100644 --- a/dotcom-rendering/src/components/ArticleHeadline.tsx +++ b/dotcom-rendering/src/components/ArticleHeadline.tsx @@ -1,11 +1,4 @@ import { css } from '@emotion/react'; -import { - ArticleDesign, - ArticleDisplay, - ArticleSpecial, - Pillar, -} from '@guardian/libs'; -import type { ArticleFormat } from '@guardian/libs'; import { from, headlineBold28, @@ -24,6 +17,13 @@ import { } from '@guardian/source/foundations'; import { interactiveLegacyClasses } from '../layouts/lib/interactiveLegacyStyling'; import { getAgeWarning } from '../lib/age-warning'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, + ArticleSpecial, + Pillar, +} from '../lib/format'; import { getZIndex } from '../lib/getZIndex'; import { palette as themePalette } from '../palette'; import type { TagType } from '../types/tag'; diff --git a/dotcom-rendering/src/components/ArticleLastUpdated.stories.tsx b/dotcom-rendering/src/components/ArticleLastUpdated.stories.tsx index 031e625decb..538e9371486 100644 --- a/dotcom-rendering/src/components/ArticleLastUpdated.stories.tsx +++ b/dotcom-rendering/src/components/ArticleLastUpdated.stories.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { Meta, StoryObj } from '@storybook/react'; import { allModes } from '../../.storybook/modes'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { palette } from '../palette'; import { ArticleLastUpdated } from './ArticleLastUpdated'; diff --git a/dotcom-rendering/src/components/ArticleLastUpdated.tsx b/dotcom-rendering/src/components/ArticleLastUpdated.tsx index 38b1d9374ec..faa2c175b9d 100644 --- a/dotcom-rendering/src/components/ArticleLastUpdated.tsx +++ b/dotcom-rendering/src/components/ArticleLastUpdated.tsx @@ -1,6 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleDesign, type ArticleFormat, timeAgo } from '@guardian/libs'; +import { timeAgo } from '@guardian/libs'; import { textSans15, textSansBold15 } from '@guardian/source/foundations'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { palette } from '../palette'; import { Island } from './Island'; import { PulsingDot } from './PulsingDot.importable'; diff --git a/dotcom-rendering/src/components/ArticleMeta.apps.stories.tsx b/dotcom-rendering/src/components/ArticleMeta.apps.stories.tsx index ba859a5e32a..de5d8aa9c07 100644 --- a/dotcom-rendering/src/components/ArticleMeta.apps.stories.tsx +++ b/dotcom-rendering/src/components/ArticleMeta.apps.stories.tsx @@ -1,8 +1,8 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { Meta, StoryObj } from '@storybook/react'; import { leftColumnDecorator } from '../../.storybook/decorators/gridDecorators'; import { defaultFormats } from '../../.storybook/decorators/splitThemeDecorator'; import { allModes } from '../../.storybook/modes'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { getAllThemes } from '../lib/format'; import { ArticleMetaApps } from './ArticleMeta.apps'; diff --git a/dotcom-rendering/src/components/ArticleMeta.apps.tsx b/dotcom-rendering/src/components/ArticleMeta.apps.tsx index 25a8494e411..5d2eae6fc51 100644 --- a/dotcom-rendering/src/components/ArticleMeta.apps.tsx +++ b/dotcom-rendering/src/components/ArticleMeta.apps.tsx @@ -1,11 +1,12 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, ArticleDisplay, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { from, space, until } from '@guardian/source/foundations'; import { StraightLines } from '@guardian/source-development-kitchen/react-components'; import type { ReactNode } from 'react'; import { interactiveLegacyClasses } from '../layouts/lib/interactiveLegacyStyling'; import { getSoleContributor } from '../lib/byline'; +import { ArticleDesign, ArticleDisplay } from '../lib/format'; +import type { ArticleFormat } from '../lib/format'; import { palette as themePalette } from '../palette'; import type { Branding as BrandingType } from '../types/branding'; import type { TagType } from '../types/tag'; diff --git a/dotcom-rendering/src/components/ArticleMeta.web.stories.tsx b/dotcom-rendering/src/components/ArticleMeta.web.stories.tsx index dae5ba592a8..66609fed69b 100644 --- a/dotcom-rendering/src/components/ArticleMeta.web.stories.tsx +++ b/dotcom-rendering/src/components/ArticleMeta.web.stories.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { from, palette as sourcePalette, @@ -10,6 +9,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { leftColumnDecorator } from '../../.storybook/decorators/gridDecorators'; import { defaultFormats } from '../../.storybook/decorators/splitThemeDecorator'; import { allModes } from '../../.storybook/modes'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { getAllThemes } from '../lib/format'; import { palette } from '../palette'; import { ArticleMeta } from './ArticleMeta.web'; diff --git a/dotcom-rendering/src/components/ArticleMeta.web.test.tsx b/dotcom-rendering/src/components/ArticleMeta.web.test.tsx index 9a0432c866a..362a4f928d0 100644 --- a/dotcom-rendering/src/components/ArticleMeta.web.test.tsx +++ b/dotcom-rendering/src/components/ArticleMeta.web.test.tsx @@ -1,6 +1,6 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { render } from '@testing-library/react'; import { interactiveLegacyClasses } from '../layouts/lib/interactiveLegacyStyling'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { ArticleMeta, shouldShowContributor } from './ArticleMeta.web'; import { ConfigProvider } from './ConfigContext'; diff --git a/dotcom-rendering/src/components/ArticleMeta.web.tsx b/dotcom-rendering/src/components/ArticleMeta.web.tsx index fd34ee571d7..3e537332bc9 100644 --- a/dotcom-rendering/src/components/ArticleMeta.web.tsx +++ b/dotcom-rendering/src/components/ArticleMeta.web.tsx @@ -1,10 +1,14 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, ArticleDisplay, ArticleSpecial } from '@guardian/libs'; import { between, from, space, until } from '@guardian/source/foundations'; import { StraightLines } from '@guardian/source-development-kitchen/react-components'; import { interactiveLegacyClasses } from '../layouts/lib/interactiveLegacyStyling'; import { getSoleContributor } from '../lib/byline'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, + ArticleSpecial, +} from '../lib/format'; import { palette as themePalette } from '../palette'; import type { Branding as BrandingType } from '../types/branding'; import type { TagType } from '../types/tag'; diff --git a/dotcom-rendering/src/components/ArticlePage.tsx b/dotcom-rendering/src/components/ArticlePage.tsx index c66200e62ab..ee93f33a6b6 100644 --- a/dotcom-rendering/src/components/ArticlePage.tsx +++ b/dotcom-rendering/src/components/ArticlePage.tsx @@ -1,8 +1,8 @@ import { Global } from '@emotion/react'; -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; import { StrictMode } from 'react'; import { DecideLayout } from '../layouts/DecideLayout'; import { buildAdTargeting } from '../lib/ad-targeting'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { rootStyles } from '../lib/rootStyles'; import { filterABTestSwitches } from '../model/enhance-switches'; import type { NavType } from '../model/extract-nav'; diff --git a/dotcom-rendering/src/components/ArticleTitle.stories.tsx b/dotcom-rendering/src/components/ArticleTitle.stories.tsx index d9747bf3185..f2d1c307353 100644 --- a/dotcom-rendering/src/components/ArticleTitle.stories.tsx +++ b/dotcom-rendering/src/components/ArticleTitle.stories.tsx @@ -1,13 +1,13 @@ +import type { Meta, StoryObj } from '@storybook/react/*'; +import { leftColumnDecorator } from '../../.storybook/decorators/gridDecorators'; +import { defaultFormats } from '../../.storybook/decorators/splitThemeDecorator'; +import { allModes } from '../../.storybook/modes'; import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import type { Meta, StoryObj } from '@storybook/react/*'; -import { leftColumnDecorator } from '../../.storybook/decorators/gridDecorators'; -import { defaultFormats } from '../../.storybook/decorators/splitThemeDecorator'; -import { allModes } from '../../.storybook/modes'; +} from '../lib/format'; import { getAllThemes } from '../lib/format'; import { ArticleTitle } from './ArticleTitle'; diff --git a/dotcom-rendering/src/components/ArticleTitle.tsx b/dotcom-rendering/src/components/ArticleTitle.tsx index 2515b7c999f..df824759fed 100644 --- a/dotcom-rendering/src/components/ArticleTitle.tsx +++ b/dotcom-rendering/src/components/ArticleTitle.tsx @@ -1,10 +1,10 @@ import { css } from '@emotion/react'; +import { from } from '@guardian/source/foundations'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, -} from '@guardian/libs'; -import { from } from '@guardian/source/foundations'; +} from '../lib/format'; import type { TagType } from '../types/tag'; import { SeriesSectionLink } from './SeriesSectionLink'; diff --git a/dotcom-rendering/src/components/Avatar.stories.tsx b/dotcom-rendering/src/components/Avatar.stories.tsx index b369a5d740b..d7306b73d41 100644 --- a/dotcom-rendering/src/components/Avatar.stories.tsx +++ b/dotcom-rendering/src/components/Avatar.stories.tsx @@ -1,11 +1,11 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import type { Meta, StoryObj } from '@storybook/react'; -import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +} from '../lib/format'; import { Avatar } from './Avatar'; const meta: Meta = { diff --git a/dotcom-rendering/src/components/BigNumber.stories.tsx b/dotcom-rendering/src/components/BigNumber.stories.tsx index 8b67b258efb..75b06968884 100755 --- a/dotcom-rendering/src/components/BigNumber.stories.tsx +++ b/dotcom-rendering/src/components/BigNumber.stories.tsx @@ -1,8 +1,8 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { space } from '@guardian/source/foundations'; import type { Meta } from '@storybook/react'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { palette } from '../palette'; import { BigNumber } from './BigNumber'; diff --git a/dotcom-rendering/src/components/BlockquoteBlockComponent.stories.tsx b/dotcom-rendering/src/components/BlockquoteBlockComponent.stories.tsx index a6684c944c5..2d922a9a442 100644 --- a/dotcom-rendering/src/components/BlockquoteBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/BlockquoteBlockComponent.stories.tsx @@ -1,11 +1,11 @@ import { css } from '@emotion/react'; +import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +} from '../lib/format'; import { BlockquoteBlockComponent } from './BlockquoteBlockComponent'; const shortQuoteHtml = diff --git a/dotcom-rendering/src/components/Blocks.amp.tsx b/dotcom-rendering/src/components/Blocks.amp.tsx index 92ec6804ae1..059326c943f 100644 --- a/dotcom-rendering/src/components/Blocks.amp.tsx +++ b/dotcom-rendering/src/components/Blocks.amp.tsx @@ -1,9 +1,9 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { palette, text, textSans12 } from '@guardian/source/foundations'; import { blockLink } from '../lib/block-link.amp'; import type { EditionId } from '../lib/edition'; import { findBlockAdSlots } from '../lib/find-adslots.amp'; +import type { ArticleTheme } from '../lib/format'; import { pillarPalette_DO_NOT_USE } from '../lib/pillars'; import type { CommercialProperties } from '../types/commercial'; import type { Switches } from '../types/config'; diff --git a/dotcom-rendering/src/components/BodyArticle.amp.tsx b/dotcom-rendering/src/components/BodyArticle.amp.tsx index 64edef16744..7e02a3a5948 100644 --- a/dotcom-rendering/src/components/BodyArticle.amp.tsx +++ b/dotcom-rendering/src/components/BodyArticle.amp.tsx @@ -1,16 +1,16 @@ import { css } from '@emotion/react'; -import { - ArticleDesign, - type ArticleTheme, - ArticleDesign as Design, - ArticleSpecial as Special, -} from '@guardian/libs'; import { palette, text, textSans12, until } from '@guardian/source/foundations'; import React from 'react'; import { buildAdTargeting } from '../lib/ad-targeting'; import { decideDesign } from '../lib/decideDesign'; import { decideTheme } from '../lib/decideTheme'; import { findAdSlots } from '../lib/find-adslots.amp'; +import { + ArticleDesign, + type ArticleTheme, + ArticleDesign as Design, + ArticleSpecial as Special, +} from '../lib/format'; import { pillarPalette_DO_NOT_USE } from '../lib/pillars'; import { getSharingUrls } from '../lib/sharing-urls'; import { insertDisclaimerElement } from '../model/enhance-disclaimer'; diff --git a/dotcom-rendering/src/components/Branding.amp.tsx b/dotcom-rendering/src/components/Branding.amp.tsx index 9587ef437a7..bc236513f09 100644 --- a/dotcom-rendering/src/components/Branding.amp.tsx +++ b/dotcom-rendering/src/components/Branding.amp.tsx @@ -1,8 +1,9 @@ import { css } from '@emotion/react'; -import { type ArticleTheme, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { textSans12 } from '@guardian/source/foundations'; import React from 'react'; import { isEditionId } from '../lib/edition'; +import type { ArticleTheme } from '../lib/format'; import { neutralBorder, pillarPalette_DO_NOT_USE } from '../lib/pillars'; import { editionRegionClasses } from '../lib/region-classes.amp'; import type { Branding as BrandingType } from '../types/branding'; diff --git a/dotcom-rendering/src/components/Branding.importable.tsx b/dotcom-rendering/src/components/Branding.importable.tsx index 76daa6ca278..2a4550d9bd9 100644 --- a/dotcom-rendering/src/components/Branding.importable.tsx +++ b/dotcom-rendering/src/components/Branding.importable.tsx @@ -1,15 +1,15 @@ import { css } from '@emotion/react'; -import { - ArticleDesign, - type ArticleFormat, - ArticleSpecial, -} from '@guardian/libs'; import { between, breakpoints, from, textSans12, } from '@guardian/source/foundations'; +import { + ArticleDesign, + type ArticleFormat, + ArticleSpecial, +} from '../lib/format'; import { getOphanComponents } from '../lib/labs'; import { palette } from '../palette'; import type { Branding as BrandingType } from '../types/branding'; diff --git a/dotcom-rendering/src/components/BylineLink.test.tsx b/dotcom-rendering/src/components/BylineLink.test.tsx index 9481e965eef..0113ac8f277 100644 --- a/dotcom-rendering/src/components/BylineLink.test.tsx +++ b/dotcom-rendering/src/components/BylineLink.test.tsx @@ -1,6 +1,6 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { render } from '@testing-library/react'; import { getContributorTagsForToken } from '../lib/byline'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import type { TagType } from '../types/tag'; import { bylineAsTokens, diff --git a/dotcom-rendering/src/components/BylineLink.tsx b/dotcom-rendering/src/components/BylineLink.tsx index 1e2da0638bf..93f4ca12bf0 100644 --- a/dotcom-rendering/src/components/BylineLink.tsx +++ b/dotcom-rendering/src/components/BylineLink.tsx @@ -1,4 +1,4 @@ -import { ArticleDesign, type ArticleFormat, isString } from '@guardian/libs'; +import { isString } from '@guardian/libs'; import { Hide } from '@guardian/source/react-components'; import { DottedLines } from '@guardian/source-development-kitchen/react-components'; import { @@ -6,6 +6,7 @@ import { getSoleContributor, isContributor, } from '../lib/byline'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { palette as themePalette } from '../palette'; import type { TagType } from '../types/tag'; import { useConfig } from './ConfigContext'; diff --git a/dotcom-rendering/src/components/CalloutBlockComponent.stories.tsx b/dotcom-rendering/src/components/CalloutBlockComponent.stories.tsx index 776d268d505..abd1fdd355a 100644 --- a/dotcom-rendering/src/components/CalloutBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/CalloutBlockComponent.stories.tsx @@ -1,9 +1,13 @@ -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { StoryObj } from '@storybook/react'; import fetchMock from 'fetch-mock'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { calloutCampaign as calloutCampaignV2 } from '../../fixtures/manual/calloutCampaignV2'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, + Pillar, +} from '../lib/format'; import { CalloutBlockComponent } from './CalloutBlockComponent.importable'; const tomorrow = new Date().setDate(new Date().getDate() + 1) / 1000; diff --git a/dotcom-rendering/src/components/CalloutEmbedBlockComponent.importable.tsx b/dotcom-rendering/src/components/CalloutEmbedBlockComponent.importable.tsx index 8d6217bbd04..38cb02fd698 100644 --- a/dotcom-rendering/src/components/CalloutEmbedBlockComponent.importable.tsx +++ b/dotcom-rendering/src/components/CalloutEmbedBlockComponent.importable.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; import { palette as srcPalette, textSansBold12, @@ -8,6 +7,7 @@ import { import { Button } from '@guardian/source/react-components'; import { useEffect, useState } from 'react'; import { decidePalette } from '../lib/decidePalette'; +import type { ArticleFormat } from '../lib/format'; import MinusIcon from '../static/icons/minus.svg'; import PlusIcon from '../static/icons/plus.svg'; import type { diff --git a/dotcom-rendering/src/components/CalloutEmbedBlockComponent.stories.tsx b/dotcom-rendering/src/components/CalloutEmbedBlockComponent.stories.tsx index 11f0bcbd200..0553366fdc3 100644 --- a/dotcom-rendering/src/components/CalloutEmbedBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/CalloutEmbedBlockComponent.stories.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import fetchMock from 'fetch-mock'; import { calloutCampaign } from '../../fixtures/manual/calloutCampaign'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { CalloutEmbedBlockComponent } from './CalloutEmbedBlockComponent.importable'; export default { diff --git a/dotcom-rendering/src/components/Caption.amp.tsx b/dotcom-rendering/src/components/Caption.amp.tsx index 94fda900dc7..c51d64f5528 100644 --- a/dotcom-rendering/src/components/Caption.amp.tsx +++ b/dotcom-rendering/src/components/Caption.amp.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { palette, textSans12 } from '@guardian/source/foundations'; import React from 'react'; +import type { ArticleTheme } from '../lib/format'; import { pillarPalette_DO_NOT_USE } from '../lib/pillars'; import TriangleIcon from '../static/icons/triangle.svg'; diff --git a/dotcom-rendering/src/components/Caption.stories.tsx b/dotcom-rendering/src/components/Caption.stories.tsx index f124b00b300..6dfdf9dd9cb 100644 --- a/dotcom-rendering/src/components/Caption.stories.tsx +++ b/dotcom-rendering/src/components/Caption.stories.tsx @@ -1,14 +1,14 @@ import { css } from '@emotion/react'; +import { breakpoints, palette } from '@guardian/source/foundations'; +import type { StoryObj } from '@storybook/react'; +import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import { breakpoints, palette } from '@guardian/source/foundations'; -import type { StoryObj } from '@storybook/react'; -import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +} from '../lib/format'; import { Caption } from './Caption'; import { Section } from './Section'; import { StarRating } from './StarRating/StarRating'; diff --git a/dotcom-rendering/src/components/Caption.tsx b/dotcom-rendering/src/components/Caption.tsx index 67d05bb2e06..2ce8f162329 100644 --- a/dotcom-rendering/src/components/Caption.tsx +++ b/dotcom-rendering/src/components/Caption.tsx @@ -1,6 +1,4 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, ArticleDisplay, ArticleSpecial } from '@guardian/libs'; import { from, space, @@ -8,6 +6,12 @@ import { textSans14, until, } from '@guardian/source/foundations'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, + ArticleSpecial, +} from '../lib/format'; import { palette } from '../palette'; import CameraSvg from '../static/icons/camera.svg'; import VideoSvg from '../static/icons/video-icon.svg'; diff --git a/dotcom-rendering/src/components/CaptionBlockComponent.stories.tsx b/dotcom-rendering/src/components/CaptionBlockComponent.stories.tsx index addc0c3882d..3d3b3d2841c 100644 --- a/dotcom-rendering/src/components/CaptionBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/CaptionBlockComponent.stories.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { CaptionBlockComponent } from './CaptionBlockComponent'; import { Flex } from './Flex'; import { LeftColumn } from './LeftColumn'; diff --git a/dotcom-rendering/src/components/CaptionBlockComponent.tsx b/dotcom-rendering/src/components/CaptionBlockComponent.tsx index 11415b36b9e..99d6c1c8e82 100644 --- a/dotcom-rendering/src/components/CaptionBlockComponent.tsx +++ b/dotcom-rendering/src/components/CaptionBlockComponent.tsx @@ -1,4 +1,4 @@ -import type { ArticleFormat } from '@guardian/libs'; +import type { ArticleFormat } from '../lib/format'; import { Caption } from './Caption'; type Props = { diff --git a/dotcom-rendering/src/components/Card/Card.stories.tsx b/dotcom-rendering/src/components/Card/Card.stories.tsx index 95479e56bde..7f957a64c54 100644 --- a/dotcom-rendering/src/components/Card/Card.stories.tsx +++ b/dotcom-rendering/src/components/Card/Card.stories.tsx @@ -1,13 +1,13 @@ import { css } from '@emotion/react'; +import { from } from '@guardian/source/foundations'; +import React from 'react'; +import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import { from } from '@guardian/source/foundations'; -import React from 'react'; -import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; +} from '../../lib/format'; import type { Branding } from '../../types/branding'; import type { DCRContainerPalette } from '../../types/front'; import type { MainMedia } from '../../types/mainMedia'; diff --git a/dotcom-rendering/src/components/Card/Card.tsx b/dotcom-rendering/src/components/Card/Card.tsx index 2c1b6392905..d57225e8c84 100644 --- a/dotcom-rendering/src/components/Card/Card.tsx +++ b/dotcom-rendering/src/components/Card/Card.tsx @@ -1,6 +1,5 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { from, palette as sourcePalette, @@ -8,6 +7,7 @@ import { } from '@guardian/source/foundations'; import { Hide, Link } from '@guardian/source/react-components'; import { isMediaCard } from '../../lib/cardHelpers'; +import { ArticleDesign, type ArticleFormat } from '../../lib/format'; import { getZIndex } from '../../lib/getZIndex'; import { DISCUSSION_ID_DATA_ATTRIBUTE } from '../../lib/useCommentCount'; import { palette as themePalette } from '../../palette'; diff --git a/dotcom-rendering/src/components/Card/components/CardBranding.tsx b/dotcom-rendering/src/components/Card/components/CardBranding.tsx index 2b54ada6de0..f022fb4b210 100644 --- a/dotcom-rendering/src/components/Card/components/CardBranding.tsx +++ b/dotcom-rendering/src/components/Card/components/CardBranding.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; import { space, textSans12, @@ -7,6 +6,7 @@ import { } from '@guardian/source/foundations'; import { useConfig } from '../../../components/ConfigContext'; import { decideCardLogo } from '../../../lib/decideLogo'; +import type { ArticleFormat } from '../../../lib/format'; import { getZIndex } from '../../../lib/getZIndex'; import { getOphanComponents } from '../../../lib/labs'; import { palette as themePalette } from '../../../palette'; diff --git a/dotcom-rendering/src/components/Card/components/CardFooter.tsx b/dotcom-rendering/src/components/Card/components/CardFooter.tsx index 2b68d0229b2..0898dc39c1e 100644 --- a/dotcom-rendering/src/components/Card/components/CardFooter.tsx +++ b/dotcom-rendering/src/components/Card/components/CardFooter.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { type ArticleFormat, ArticleSpecial } from '@guardian/libs'; import { palette, space, textSansBold12 } from '@guardian/source/foundations'; +import { type ArticleFormat, ArticleSpecial } from '../../../lib/format'; type Props = { format: ArticleFormat; diff --git a/dotcom-rendering/src/components/Card/components/CardWrapper.tsx b/dotcom-rendering/src/components/Card/components/CardWrapper.tsx index 5a5653df200..28fdca574b8 100644 --- a/dotcom-rendering/src/components/Card/components/CardWrapper.tsx +++ b/dotcom-rendering/src/components/Card/components/CardWrapper.tsx @@ -1,10 +1,10 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; import { palette as sourcePalette, space, until, } from '@guardian/source/foundations'; +import type { ArticleFormat } from '../../../lib/format'; import { palette } from '../../../palette'; import type { DCRContainerPalette } from '../../../types/front'; import { ContainerOverrides } from '../../ContainerOverrides'; diff --git a/dotcom-rendering/src/components/CardHeadline.stories.tsx b/dotcom-rendering/src/components/CardHeadline.stories.tsx index 38f38f208be..ba20558e8eb 100644 --- a/dotcom-rendering/src/components/CardHeadline.stories.tsx +++ b/dotcom-rendering/src/components/CardHeadline.stories.tsx @@ -1,13 +1,13 @@ +import { breakpoints } from '@guardian/source/foundations'; +import type { StoryObj } from '@storybook/react'; +import type { StoryProps } from '../../.storybook/decorators/splitThemeDecorator'; +import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import { breakpoints } from '@guardian/source/foundations'; -import type { StoryObj } from '@storybook/react'; -import type { StoryProps } from '../../.storybook/decorators/splitThemeDecorator'; -import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +} from '../lib/format'; import type { DCRContainerPalette } from '../types/front'; import { CardHeadline } from './CardHeadline'; import { ContainerOverrides } from './ContainerOverrides'; diff --git a/dotcom-rendering/src/components/CardHeadline.tsx b/dotcom-rendering/src/components/CardHeadline.tsx index 7fb8d487807..2429944d6ba 100644 --- a/dotcom-rendering/src/components/CardHeadline.tsx +++ b/dotcom-rendering/src/components/CardHeadline.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import { type ArticleFormat, ArticleSpecial } from '@guardian/libs'; import { between, from, @@ -22,6 +21,7 @@ import { } from '@guardian/source/foundations'; import { Link, SvgExternal } from '@guardian/source/react-components'; import React from 'react'; +import { type ArticleFormat, ArticleSpecial } from '../lib/format'; import { getZIndex } from '../lib/getZIndex'; import { palette } from '../palette'; import { Byline } from './Byline'; diff --git a/dotcom-rendering/src/components/Carousel.importable.tsx b/dotcom-rendering/src/components/Carousel.importable.tsx index 39a09094393..37dcae69b0e 100644 --- a/dotcom-rendering/src/components/Carousel.importable.tsx +++ b/dotcom-rendering/src/components/Carousel.importable.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import { ArticleDesign, type ArticleFormat, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { from, headlineBold24, @@ -8,6 +8,7 @@ import { } from '@guardian/source/foundations'; import libDebounce from 'lodash.debounce'; import { useEffect, useRef, useState } from 'react'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { formatAttrString } from '../lib/formatAttrString'; import { getSourceImageUrl } from '../lib/getSourceImageUrl_temp_fix'; import { getZIndex } from '../lib/getZIndex'; diff --git a/dotcom-rendering/src/components/Carousel.stories.tsx b/dotcom-rendering/src/components/Carousel.stories.tsx index 28206410d57..13db96df0e3 100644 --- a/dotcom-rendering/src/components/Carousel.stories.tsx +++ b/dotcom-rendering/src/components/Carousel.stories.tsx @@ -1,15 +1,15 @@ -import { - ArticleDesign, - ArticleDisplay, - ArticleSpecial, - Pillar, -} from '@guardian/libs'; import { breakpoints } from '@guardian/source/foundations'; import type { StoryObj } from '@storybook/react'; import fetchMock from 'fetch-mock'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import type { StoryProps } from '../../.storybook/decorators/splitThemeDecorator'; import { discussionApiUrl } from '../../fixtures/manual/discussionApiUrl'; +import { + ArticleDesign, + ArticleDisplay, + ArticleSpecial, + Pillar, +} from '../lib/format'; import { palette } from '../palette'; import type { TrailType } from '../types/trails'; import { Carousel } from './Carousel.importable'; diff --git a/dotcom-rendering/src/components/CartoonComponent.stories.tsx b/dotcom-rendering/src/components/CartoonComponent.stories.tsx index c714bf26f68..fb116335ba5 100644 --- a/dotcom-rendering/src/components/CartoonComponent.stories.tsx +++ b/dotcom-rendering/src/components/CartoonComponent.stories.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { CartoonComponent } from './CartoonComponent'; import { cartoon, diff --git a/dotcom-rendering/src/components/CartoonComponent.tsx b/dotcom-rendering/src/components/CartoonComponent.tsx index 874107158fc..b5fb664e8a1 100644 --- a/dotcom-rendering/src/components/CartoonComponent.tsx +++ b/dotcom-rendering/src/components/CartoonComponent.tsx @@ -1,12 +1,12 @@ import { css } from '@emotion/react'; +import { isUndefined } from '@guardian/libs'; +import { Hide } from '@guardian/source/react-components'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, - isUndefined, Pillar, -} from '@guardian/libs'; -import { Hide } from '@guardian/source/react-components'; +} from '../lib/format'; import type { CartoonBlockElement, Image } from '../types/content'; import { AppsLightboxImage } from './AppsLightboxImage.importable'; import { Caption } from './Caption'; diff --git a/dotcom-rendering/src/components/ChartAtom.stories.tsx b/dotcom-rendering/src/components/ChartAtom.stories.tsx index d38cd35bd0c..cdfb7467cfc 100644 --- a/dotcom-rendering/src/components/ChartAtom.stories.tsx +++ b/dotcom-rendering/src/components/ChartAtom.stories.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { barChartHtml, lineChartHtml } from '../../fixtures/manual/chartAtoms'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { ChartAtom } from './ChartAtom.importable'; export default { diff --git a/dotcom-rendering/src/components/ClickToView.stories.tsx b/dotcom-rendering/src/components/ClickToView.stories.tsx index e2040c4f982..d77eec01aef 100644 --- a/dotcom-rendering/src/components/ClickToView.stories.tsx +++ b/dotcom-rendering/src/components/ClickToView.stories.tsx @@ -1,13 +1,13 @@ import { css } from '@emotion/react'; +import { textSans17 } from '@guardian/source/foundations'; +import type { StoryObj } from '@storybook/react'; +import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, Pillar, -} from '@guardian/libs'; -import { textSans17 } from '@guardian/source/foundations'; -import type { StoryObj } from '@storybook/react'; -import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +} from '../lib/format'; import type { DocumentBlockElement, EmbedBlockElement, diff --git a/dotcom-rendering/src/components/CodeBlockComponent.stories.tsx b/dotcom-rendering/src/components/CodeBlockComponent.stories.tsx index 01362162c39..91b486fc748 100644 --- a/dotcom-rendering/src/components/CodeBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/CodeBlockComponent.stories.tsx @@ -1,5 +1,5 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { CodeBlockComponent } from './CodeBlockComponent'; import { Section } from './Section'; diff --git a/dotcom-rendering/src/components/Contributor.test.tsx b/dotcom-rendering/src/components/Contributor.test.tsx index de2b1fa0cd3..08ee4bd09db 100644 --- a/dotcom-rendering/src/components/Contributor.test.tsx +++ b/dotcom-rendering/src/components/Contributor.test.tsx @@ -1,6 +1,6 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { render } from '@testing-library/react'; import { interactiveLegacyClasses } from '../layouts/lib/interactiveLegacyStyling'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { ConfigProvider } from './ConfigContext'; import { Contributor } from './Contributor'; diff --git a/dotcom-rendering/src/components/Contributor.tsx b/dotcom-rendering/src/components/Contributor.tsx index 84fd885597c..778bb604a0e 100644 --- a/dotcom-rendering/src/components/Contributor.tsx +++ b/dotcom-rendering/src/components/Contributor.tsx @@ -1,15 +1,15 @@ import { css } from '@emotion/react'; -import { - ArticleDesign, - type ArticleFormat, - ArticleSpecial, -} from '@guardian/libs'; import { headlineMedium17, textSansItalic17, until, } from '@guardian/source/foundations'; import { interactiveLegacyClasses } from '../layouts/lib/interactiveLegacyStyling'; +import { + ArticleDesign, + type ArticleFormat, + ArticleSpecial, +} from '../lib/format'; import { palette as schemedPalette } from '../palette'; import type { TagType } from '../types/tag'; import { BylineLink } from './BylineLink'; diff --git a/dotcom-rendering/src/components/Dateline.tsx b/dotcom-rendering/src/components/Dateline.tsx index 36385afdf9c..3ad323641da 100644 --- a/dotcom-rendering/src/components/Dateline.tsx +++ b/dotcom-rendering/src/components/Dateline.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; import { textSans12, until } from '@guardian/source/foundations'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { palette } from '../palette'; import { useConfig } from './ConfigContext'; diff --git a/dotcom-rendering/src/components/DecideLines.tsx b/dotcom-rendering/src/components/DecideLines.tsx index bc11c07185d..7f95658af95 100644 --- a/dotcom-rendering/src/components/DecideLines.tsx +++ b/dotcom-rendering/src/components/DecideLines.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleDesign, type ArticleFormat, Pillar } from '@guardian/libs'; import { palette } from '@guardian/source/foundations'; import { StraightLines } from '@guardian/source-development-kitchen/react-components'; +import { ArticleDesign, type ArticleFormat, Pillar } from '../lib/format'; type Props = { format: ArticleFormat; diff --git a/dotcom-rendering/src/components/DesignTag.stories.tsx b/dotcom-rendering/src/components/DesignTag.stories.tsx index b95b61da051..60fee8519ed 100644 --- a/dotcom-rendering/src/components/DesignTag.stories.tsx +++ b/dotcom-rendering/src/components/DesignTag.stories.tsx @@ -1,10 +1,10 @@ +import type { Meta, StoryObj } from '@storybook/react'; import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import type { Meta, StoryObj } from '@storybook/react'; +} from '../lib/format'; import { DesignTag } from './DesignTag'; const meta = { diff --git a/dotcom-rendering/src/components/DesignTag.tsx b/dotcom-rendering/src/components/DesignTag.tsx index d79879c51ae..1028c7b7f65 100644 --- a/dotcom-rendering/src/components/DesignTag.tsx +++ b/dotcom-rendering/src/components/DesignTag.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; import { headlineBold17, headlineBold20, @@ -7,6 +6,7 @@ import { until, } from '@guardian/source/foundations'; import { LinkButton } from '@guardian/source/react-components'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { palette } from '../palette'; const tagStyles = css` diff --git a/dotcom-rendering/src/components/Discussion.stories.tsx b/dotcom-rendering/src/components/Discussion.stories.tsx index caa363a5350..026c69526a0 100644 --- a/dotcom-rendering/src/components/Discussion.stories.tsx +++ b/dotcom-rendering/src/components/Discussion.stories.tsx @@ -1,8 +1,9 @@ -import { ArticleDesign, ArticleDisplay, Pillar, storage } from '@guardian/libs'; +import { storage } from '@guardian/libs'; import type { StoryObj } from '@storybook/react'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import type { StoryProps } from '../../.storybook/decorators/splitThemeDecorator'; import { Section } from '../components/Section'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { palette as themePalette } from '../palette'; import { DiscussionLayout } from './DiscussionLayout'; diff --git a/dotcom-rendering/src/components/Discussion/AbuseReportForm.stories.tsx b/dotcom-rendering/src/components/Discussion/AbuseReportForm.stories.tsx index e1ed5c744e1..cc2fa7e680d 100644 --- a/dotcom-rendering/src/components/Discussion/AbuseReportForm.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/AbuseReportForm.stories.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { ok } from '../../lib/result'; import { AbuseReportForm } from './AbuseReportForm'; diff --git a/dotcom-rendering/src/components/Discussion/Avatar.stories.tsx b/dotcom-rendering/src/components/Discussion/Avatar.stories.tsx index 02e450596d7..89dfc8cdfe1 100644 --- a/dotcom-rendering/src/components/Discussion/Avatar.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/Avatar.stories.tsx @@ -1,5 +1,5 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { Avatar } from './Avatar'; export default { diff --git a/dotcom-rendering/src/components/Discussion/Badges.stories.tsx b/dotcom-rendering/src/components/Discussion/Badges.stories.tsx index 58899f8e910..38f61602692 100644 --- a/dotcom-rendering/src/components/Discussion/Badges.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/Badges.stories.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { GuardianContributor, GuardianPick, GuardianStaff } from './Badges'; export default { diff --git a/dotcom-rendering/src/components/Discussion/Comment.stories.tsx b/dotcom-rendering/src/components/Discussion/Comment.stories.tsx index 3116311b1f9..d43c7598a9a 100644 --- a/dotcom-rendering/src/components/Discussion/Comment.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/Comment.stories.tsx @@ -1,4 +1,3 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; import type { CommentType, @@ -6,6 +5,7 @@ import type { ReplyType, Staff, } from '../../lib/discussion'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { ok } from '../../lib/result'; import { Comment } from './Comment'; diff --git a/dotcom-rendering/src/components/Discussion/CommentContainer.stories.tsx b/dotcom-rendering/src/components/Discussion/CommentContainer.stories.tsx index cb9a066a4e0..0bbadf475dc 100644 --- a/dotcom-rendering/src/components/Discussion/CommentContainer.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/CommentContainer.stories.tsx @@ -1,6 +1,6 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; import type { CommentType, Reader, ReplyType } from '../../lib/discussion'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { ok } from '../../lib/result'; import { CommentContainer } from './CommentContainer'; diff --git a/dotcom-rendering/src/components/Discussion/CommentForm.stories.tsx b/dotcom-rendering/src/components/Discussion/CommentForm.stories.tsx index ccc4375acd2..47b88a921ee 100644 --- a/dotcom-rendering/src/components/Discussion/CommentForm.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/CommentForm.stories.tsx @@ -1,7 +1,7 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { useState } from 'react'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; import type { CommentType, Reader } from '../../lib/discussion'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { ok } from '../../lib/result'; import { CommentForm } from './CommentForm'; diff --git a/dotcom-rendering/src/components/Discussion/CommentReplyPreview.stories.tsx b/dotcom-rendering/src/components/Discussion/CommentReplyPreview.stories.tsx index dd8c77f58f7..47372284170 100644 --- a/dotcom-rendering/src/components/Discussion/CommentReplyPreview.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/CommentReplyPreview.stories.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; import type { CommentType } from '../../lib/discussion'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { CommentReplyPreview, Preview } from './CommentReplyPreview'; const defaultFormat = { diff --git a/dotcom-rendering/src/components/Discussion/Comments.stories.tsx b/dotcom-rendering/src/components/Discussion/Comments.stories.tsx index a40307a2fec..b629ef02eed 100644 --- a/dotcom-rendering/src/components/Discussion/Comments.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/Comments.stories.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { parse } from 'valibot'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; import { lightDecorator } from '../../../.storybook/decorators/themeDecorator'; @@ -12,6 +11,7 @@ import type { Reader, } from '../../lib/discussion'; import { discussionApiResponseSchema } from '../../lib/discussion'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { ok } from '../../lib/result'; import { Comments } from './Comments'; diff --git a/dotcom-rendering/src/components/Discussion/Dropdown.stories.tsx b/dotcom-rendering/src/components/Discussion/Dropdown.stories.tsx index 2b919a77c00..dfcd14d7249 100644 --- a/dotcom-rendering/src/components/Discussion/Dropdown.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/Dropdown.stories.tsx @@ -1,8 +1,8 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { useState } from 'react'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; import type { DropdownOptionType } from '../../lib/discussion'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { Dropdown } from './Dropdown'; const Container = ({ children }: { children: React.ReactNode }) => ( diff --git a/dotcom-rendering/src/components/Discussion/Filters.stories.tsx b/dotcom-rendering/src/components/Discussion/Filters.stories.tsx index 9b5276d8582..33758f0699e 100644 --- a/dotcom-rendering/src/components/Discussion/Filters.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/Filters.stories.tsx @@ -1,7 +1,7 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { useState } from 'react'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; import type { FilterOptions } from '../../lib/discussion'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { Filters } from './Filters'; export default { title: 'Discussion/Filters' }; diff --git a/dotcom-rendering/src/components/Discussion/FirstCommentWelcome.stories.tsx b/dotcom-rendering/src/components/Discussion/FirstCommentWelcome.stories.tsx index d32f3578395..138a49fa300 100644 --- a/dotcom-rendering/src/components/Discussion/FirstCommentWelcome.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/FirstCommentWelcome.stories.tsx @@ -1,5 +1,5 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { FirstCommentWelcome } from './FirstCommentWelcome'; export default { title: 'Discussion/FirstCommentWelcome' }; diff --git a/dotcom-rendering/src/components/Discussion/LoadingComments.stories.tsx b/dotcom-rendering/src/components/Discussion/LoadingComments.stories.tsx index da117f08808..3035a2f1282 100644 --- a/dotcom-rendering/src/components/Discussion/LoadingComments.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/LoadingComments.stories.tsx @@ -1,5 +1,5 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { LoadingComments } from './LoadingComments'; export default { diff --git a/dotcom-rendering/src/components/Discussion/LoadingPicks.stories.tsx b/dotcom-rendering/src/components/Discussion/LoadingPicks.stories.tsx index f8ae5cc2071..22f55dab6ce 100644 --- a/dotcom-rendering/src/components/Discussion/LoadingPicks.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/LoadingPicks.stories.tsx @@ -1,5 +1,5 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { LoadingPicks } from './LoadingPicks'; export default { diff --git a/dotcom-rendering/src/components/Discussion/Pagination.stories.tsx b/dotcom-rendering/src/components/Discussion/Pagination.stories.tsx index 11d7683499f..cb6d06bcb90 100644 --- a/dotcom-rendering/src/components/Discussion/Pagination.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/Pagination.stories.tsx @@ -1,12 +1,12 @@ +import { useState } from 'react'; +import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; +import type { FilterOptions } from '../../lib/discussion'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, Pillar, -} from '@guardian/libs'; -import { useState } from 'react'; -import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; -import type { FilterOptions } from '../../lib/discussion'; +} from '../../lib/format'; import { Pagination } from './Pagination'; const articleFormat: ArticleFormat = { diff --git a/dotcom-rendering/src/components/Discussion/PillarButton.stories.tsx b/dotcom-rendering/src/components/Discussion/PillarButton.stories.tsx index 20261859f90..fa65a9c81ea 100644 --- a/dotcom-rendering/src/components/Discussion/PillarButton.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/PillarButton.stories.tsx @@ -1,13 +1,13 @@ import { css } from '@emotion/react'; +import { space } from '@guardian/source/foundations'; +import { SvgCheckmark } from '@guardian/source/react-components'; +import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, Pillar, -} from '@guardian/libs'; -import { space } from '@guardian/source/foundations'; -import { SvgCheckmark } from '@guardian/source/react-components'; -import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; +} from '../../lib/format'; import { PillarButton } from './PillarButton'; import { Row } from './Row'; diff --git a/dotcom-rendering/src/components/Discussion/Preview.stories.tsx b/dotcom-rendering/src/components/Discussion/Preview.stories.tsx index 37be5211d49..af027a3fb16 100644 --- a/dotcom-rendering/src/components/Discussion/Preview.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/Preview.stories.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { Preview } from './Preview'; export default { diff --git a/dotcom-rendering/src/components/Discussion/RecommendationCount.stories.tsx b/dotcom-rendering/src/components/Discussion/RecommendationCount.stories.tsx index 46b9603f08a..c11f8077d74 100644 --- a/dotcom-rendering/src/components/Discussion/RecommendationCount.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/RecommendationCount.stories.tsx @@ -1,6 +1,6 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; import type { SignedInUser } from '../../lib/discussion'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { ok } from '../../lib/result'; import { palette as themePalette } from '../../palette'; import { RecommendationCount } from './RecommendationCount'; diff --git a/dotcom-rendering/src/components/Discussion/Timestamp.stories.tsx b/dotcom-rendering/src/components/Discussion/Timestamp.stories.tsx index 5b951e51a26..12ec0480220 100644 --- a/dotcom-rendering/src/components/Discussion/Timestamp.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/Timestamp.stories.tsx @@ -1,5 +1,5 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { Timestamp } from './Timestamp'; type Props = Parameters[0]; diff --git a/dotcom-rendering/src/components/Discussion/TopPick.stories.tsx b/dotcom-rendering/src/components/Discussion/TopPick.stories.tsx index 342f4fc67c9..460c8bfc3c7 100644 --- a/dotcom-rendering/src/components/Discussion/TopPick.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/TopPick.stories.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; import type { ReplyType, SignedInUser } from '../../lib/discussion'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { ok } from '../../lib/result'; import { TopPick } from './TopPick'; diff --git a/dotcom-rendering/src/components/Discussion/TopPicks.stories.tsx b/dotcom-rendering/src/components/Discussion/TopPicks.stories.tsx index bc5d5613486..fe7c6a05de9 100644 --- a/dotcom-rendering/src/components/Discussion/TopPicks.stories.tsx +++ b/dotcom-rendering/src/components/Discussion/TopPicks.stories.tsx @@ -1,6 +1,6 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; import type { ReplyType, SignedInUser } from '../../lib/discussion'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { ok } from '../../lib/result'; import { TopPicks } from './TopPicks'; diff --git a/dotcom-rendering/src/components/DiscussionLayout.tsx b/dotcom-rendering/src/components/DiscussionLayout.tsx index 6edd05e6d54..4c706d9c2f3 100644 --- a/dotcom-rendering/src/components/DiscussionLayout.tsx +++ b/dotcom-rendering/src/components/DiscussionLayout.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { ArticleDisplay, type ArticleFormat } from '@guardian/libs'; import { from } from '@guardian/source/foundations'; +import { ArticleDisplay, type ArticleFormat } from '../lib/format'; import type { RenderingTarget } from '../types/renderingTarget'; import { AdSlot, labelStyles } from './AdSlot.web'; import { useConfig } from './ConfigContext'; diff --git a/dotcom-rendering/src/components/DividerBlockComponent.stories.tsx b/dotcom-rendering/src/components/DividerBlockComponent.stories.tsx index f074facd993..05a9eae4fff 100644 --- a/dotcom-rendering/src/components/DividerBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/DividerBlockComponent.stories.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { DividerBlockComponent } from './DividerBlockComponent'; import { TextBlockComponent } from './TextBlockComponent'; diff --git a/dotcom-rendering/src/components/DropCap.tsx b/dotcom-rendering/src/components/DropCap.tsx index 6ed7b839507..11c3c57b9db 100644 --- a/dotcom-rendering/src/components/DropCap.tsx +++ b/dotcom-rendering/src/components/DropCap.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { ArticleDesign, type ArticleFormat, Pillar } from '@guardian/libs'; import { headlineMedium14Object, space } from '@guardian/source/foundations'; +import { ArticleDesign, type ArticleFormat, Pillar } from '../lib/format'; import { palette } from '../palette'; type Props = { diff --git a/dotcom-rendering/src/components/Dropcap.stories.tsx b/dotcom-rendering/src/components/Dropcap.stories.tsx index f25865f5c5d..490ce79c7d6 100644 --- a/dotcom-rendering/src/components/Dropcap.stories.tsx +++ b/dotcom-rendering/src/components/Dropcap.stories.tsx @@ -1,12 +1,12 @@ import { css } from '@emotion/react'; +import { article17 } from '@guardian/source/foundations'; +import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, Pillar, -} from '@guardian/libs'; -import { article17 } from '@guardian/source/foundations'; -import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +} from '../lib/format'; import { DropCap } from './DropCap'; const Wrapper = ({ children }: { children: React.ReactNode }) => ( diff --git a/dotcom-rendering/src/components/DynamicPackage.stories.tsx b/dotcom-rendering/src/components/DynamicPackage.stories.tsx index da0f493e0b6..222c98f7548 100644 --- a/dotcom-rendering/src/components/DynamicPackage.stories.tsx +++ b/dotcom-rendering/src/components/DynamicPackage.stories.tsx @@ -1,8 +1,8 @@ -import { ArticleDesign, ArticleDisplay, ArticleSpecial } from '@guardian/libs'; import { breakpoints } from '@guardian/source/foundations'; import type { Meta, StoryObj } from '@storybook/react'; import { discussionApiUrl } from '../../fixtures/manual/discussionApiUrl'; import { getSublinks, trails } from '../../fixtures/manual/trails'; +import { ArticleDesign, ArticleDisplay, ArticleSpecial } from '../lib/format'; import type { DCRGroupedTrails } from '../types/front'; import { DynamicPackage } from './DynamicPackage'; import { FrontSection } from './FrontSection'; diff --git a/dotcom-rendering/src/components/DynamicSlow.stories.tsx b/dotcom-rendering/src/components/DynamicSlow.stories.tsx index 4eed0bdf7ce..d612140e6fa 100644 --- a/dotcom-rendering/src/components/DynamicSlow.stories.tsx +++ b/dotcom-rendering/src/components/DynamicSlow.stories.tsx @@ -1,7 +1,7 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { breakpoints } from '@guardian/source/foundations'; import { discussionApiUrl } from '../../fixtures/manual/discussionApiUrl'; import { trails } from '../../fixtures/manual/trails'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import type { DCRGroupedTrails } from '../types/front'; import { DynamicSlow } from './DynamicSlow'; import { FrontSection } from './FrontSection'; diff --git a/dotcom-rendering/src/components/Elements.amp.tsx b/dotcom-rendering/src/components/Elements.amp.tsx index 7987509fdb2..5cbef567070 100644 --- a/dotcom-rendering/src/components/Elements.amp.tsx +++ b/dotcom-rendering/src/components/Elements.amp.tsx @@ -1,10 +1,10 @@ +import { isNonNullable } from '@guardian/libs'; +import { NotRenderableInDCR } from '../lib/errors/not-renderable-in-dcr'; import { ArticleDesign, type ArticleFormat, type ArticleTheme, - isNonNullable, -} from '@guardian/libs'; -import { NotRenderableInDCR } from '../lib/errors/not-renderable-in-dcr'; +} from '../lib/format'; import type { Switches } from '../types/config'; import type { FEElement } from '../types/content'; import type { TagType } from '../types/tag'; diff --git a/dotcom-rendering/src/components/EmailSignup.stories.tsx b/dotcom-rendering/src/components/EmailSignup.stories.tsx index fc95ddb1f97..32a767116b2 100644 --- a/dotcom-rendering/src/components/EmailSignup.stories.tsx +++ b/dotcom-rendering/src/components/EmailSignup.stories.tsx @@ -1,11 +1,11 @@ +import { breakpoints } from '@guardian/source/foundations'; +import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, Pillar, -} from '@guardian/libs'; -import { breakpoints } from '@guardian/source/foundations'; -import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +} from '../lib/format'; import { EmailSignup } from './EmailSignup'; import { NewsletterPrivacyMessage } from './NewsletterPrivacyMessage'; import { Section } from './Section'; diff --git a/dotcom-rendering/src/components/Expandable.amp.tsx b/dotcom-rendering/src/components/Expandable.amp.tsx index 83030958d80..9007732bb93 100644 --- a/dotcom-rendering/src/components/Expandable.amp.tsx +++ b/dotcom-rendering/src/components/Expandable.amp.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { article17, headlineMedium20, @@ -7,6 +6,7 @@ import { textSans15, } from '@guardian/source/foundations'; import React from 'react'; +import type { ArticleTheme } from '../lib/format'; import { neutralBorder, pillarPalette_DO_NOT_USE } from '../lib/pillars'; import InfoIcon from '../static/icons/info.svg'; import PlusIcon from '../static/icons/plus.svg'; diff --git a/dotcom-rendering/src/components/ExplainerAtom.stories.tsx b/dotcom-rendering/src/components/ExplainerAtom.stories.tsx index 4f2071ca425..ccefe7866d2 100644 --- a/dotcom-rendering/src/components/ExplainerAtom.stories.tsx +++ b/dotcom-rendering/src/components/ExplainerAtom.stories.tsx @@ -1,6 +1,6 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { Meta, StoryObj } from '@storybook/react'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { ExplainerAtom as ExplainerAtomComponent } from './ExplainerAtom'; const html = diff --git a/dotcom-rendering/src/components/FetchOnwardsData.importable.tsx b/dotcom-rendering/src/components/FetchOnwardsData.importable.tsx index b0c33fc1646..837b6293126 100644 --- a/dotcom-rendering/src/components/FetchOnwardsData.importable.tsx +++ b/dotcom-rendering/src/components/FetchOnwardsData.importable.tsx @@ -1,10 +1,7 @@ import { css } from '@emotion/react'; -import { - ArticleDesign, - type ArticleFormat, - isNonNullable, -} from '@guardian/libs'; +import { isNonNullable } from '@guardian/libs'; import { decideTrail } from '../lib/decideTrail'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { useApi } from '../lib/useApi'; import { addDiscussionIds } from '../lib/useCommentCount'; import { palette } from '../palette'; diff --git a/dotcom-rendering/src/components/Figure.stories.tsx b/dotcom-rendering/src/components/Figure.stories.tsx index bb0be274f9a..e7f077f2a1a 100644 --- a/dotcom-rendering/src/components/Figure.stories.tsx +++ b/dotcom-rendering/src/components/Figure.stories.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { breakpoints } from '@guardian/source/foundations'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { ArticleContainer } from './ArticleContainer'; import { Figure } from './Figure'; import { Flex } from './Flex'; diff --git a/dotcom-rendering/src/components/Figure.tsx b/dotcom-rendering/src/components/Figure.tsx index 4f99a51b7de..16493d934e3 100644 --- a/dotcom-rendering/src/components/Figure.tsx +++ b/dotcom-rendering/src/components/Figure.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; import { from, space, until } from '@guardian/source/foundations'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import type { FEElement, RoleType } from '../types/content'; type Props = { diff --git a/dotcom-rendering/src/components/FlexibleGeneral.stories.tsx b/dotcom-rendering/src/components/FlexibleGeneral.stories.tsx index 19b818c9a48..4a944f7df26 100644 --- a/dotcom-rendering/src/components/FlexibleGeneral.stories.tsx +++ b/dotcom-rendering/src/components/FlexibleGeneral.stories.tsx @@ -1,9 +1,9 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { breakpoints } from '@guardian/source/foundations'; import type { Meta, StoryObj } from '@storybook/react'; import fetchMock from 'fetch-mock'; import { discussionApiUrl } from '../../fixtures/manual/discussionApiUrl'; import { getSublinks, trails } from '../../fixtures/manual/trails'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import type { DCRFrontCard, DCRGroupedTrails } from '../types/front'; import { FlexibleGeneral } from './FlexibleGeneral'; import { FrontSection } from './FrontSection'; diff --git a/dotcom-rendering/src/components/FollowButtons.stories.tsx b/dotcom-rendering/src/components/FollowButtons.stories.tsx index 70f9aef0e56..b14c4bf0f31 100644 --- a/dotcom-rendering/src/components/FollowButtons.stories.tsx +++ b/dotcom-rendering/src/components/FollowButtons.stories.tsx @@ -1,5 +1,5 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { FollowNotificationsButton, FollowTagButton } from './FollowButtons'; export default { diff --git a/dotcom-rendering/src/components/Footer.stories.tsx b/dotcom-rendering/src/components/Footer.stories.tsx index 2854a2f2e47..18e9a9a122d 100644 --- a/dotcom-rendering/src/components/Footer.stories.tsx +++ b/dotcom-rendering/src/components/Footer.stories.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import { Pillar } from '@guardian/libs'; import { breakpoints, palette, @@ -8,6 +7,7 @@ import { } from '@guardian/source/foundations'; import { Standard } from '../../fixtures/generated/dcr-articles/Standard'; import { editionList } from '../lib/edition'; +import { Pillar } from '../lib/format'; import { extractNAV } from '../model/extract-nav'; import { Footer } from './Footer'; import { Section } from './Section'; diff --git a/dotcom-rendering/src/components/Footer.tsx b/dotcom-rendering/src/components/Footer.tsx index 43e8fdeaddf..37dd23038c2 100644 --- a/dotcom-rendering/src/components/Footer.tsx +++ b/dotcom-rendering/src/components/Footer.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import type { Pillar } from '@guardian/libs'; import { isNonNullable } from '@guardian/libs'; import { between, @@ -17,6 +16,7 @@ import { SvgArrowRightStraight, } from '@guardian/source/react-components'; import type { EditionId } from '../lib/edition'; +import type { Pillar } from '../lib/format'; import { clearFix } from '../lib/mixins'; import { nestedOphanComponents } from '../lib/ophan-helpers'; import type { PillarLinkType } from '../model/extract-nav'; diff --git a/dotcom-rendering/src/components/FormatBoundary.tsx b/dotcom-rendering/src/components/FormatBoundary.tsx index 307f98e0f12..bc95491bd95 100644 --- a/dotcom-rendering/src/components/FormatBoundary.tsx +++ b/dotcom-rendering/src/components/FormatBoundary.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; import { useEffect, useState } from 'react'; +import type { ArticleFormat } from '../lib/format'; import { paletteDeclarations } from '../palette'; import { useConfig } from './ConfigContext'; diff --git a/dotcom-rendering/src/components/FrontCard.tsx b/dotcom-rendering/src/components/FrontCard.tsx index ab6babf4615..86ad1c2164c 100644 --- a/dotcom-rendering/src/components/FrontCard.tsx +++ b/dotcom-rendering/src/components/FrontCard.tsx @@ -1,4 +1,4 @@ -import { ArticleDesign } from '@guardian/libs'; +import { ArticleDesign } from '../lib/format'; import type { DCRFrontCard } from '../types/front'; import type { Props as CardProps } from './Card/Card'; import { Card } from './Card/Card'; diff --git a/dotcom-rendering/src/components/FrontPage.tsx b/dotcom-rendering/src/components/FrontPage.tsx index 788a6e3c28b..45adb782014 100644 --- a/dotcom-rendering/src/components/FrontPage.tsx +++ b/dotcom-rendering/src/components/FrontPage.tsx @@ -1,8 +1,8 @@ import { Global } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { StrictMode } from 'react'; import { FrontLayout } from '../layouts/FrontLayout'; import { buildAdTargeting } from '../lib/ad-targeting'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { rootStyles } from '../lib/rootStyles'; import { filterABTestSwitches } from '../model/enhance-switches'; import type { NavType } from '../model/extract-nav'; diff --git a/dotcom-rendering/src/components/GetCricketScoreboard.importable.tsx b/dotcom-rendering/src/components/GetCricketScoreboard.importable.tsx index 899710d5d89..2adef368087 100644 --- a/dotcom-rendering/src/components/GetCricketScoreboard.importable.tsx +++ b/dotcom-rendering/src/components/GetCricketScoreboard.importable.tsx @@ -1,5 +1,5 @@ -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; import type { SWRConfiguration } from 'swr'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { useApi } from '../lib/useApi'; import type { CricketMatch } from '../types/sport'; import { CricketScoreboard } from './CricketScoreboard'; diff --git a/dotcom-rendering/src/components/GetMatchNav.importable.tsx b/dotcom-rendering/src/components/GetMatchNav.importable.tsx index b366443e4ef..a9da495f949 100644 --- a/dotcom-rendering/src/components/GetMatchNav.importable.tsx +++ b/dotcom-rendering/src/components/GetMatchNav.importable.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; import { from } from '@guardian/source/foundations'; import type { SWRConfiguration } from 'swr'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { useApi } from '../lib/useApi'; import type { TeamType } from '../types/sport'; import type { TagType } from '../types/tag'; diff --git a/dotcom-rendering/src/components/GetMatchStats.importable.tsx b/dotcom-rendering/src/components/GetMatchStats.importable.tsx index 33812c14ab1..84e55dfcd22 100644 --- a/dotcom-rendering/src/components/GetMatchStats.importable.tsx +++ b/dotcom-rendering/src/components/GetMatchStats.importable.tsx @@ -1,5 +1,5 @@ -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; import type { SWRConfiguration } from 'swr'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { useApi } from '../lib/useApi'; import { useHydrated } from '../lib/useHydrated'; import type { TeamType } from '../types/sport'; diff --git a/dotcom-rendering/src/components/GetMatchTabs.importable.tsx b/dotcom-rendering/src/components/GetMatchTabs.importable.tsx index 35b309f9c9b..d6225635663 100644 --- a/dotcom-rendering/src/components/GetMatchTabs.importable.tsx +++ b/dotcom-rendering/src/components/GetMatchTabs.importable.tsx @@ -1,4 +1,4 @@ -import type { ArticleFormat } from '@guardian/libs'; +import type { ArticleFormat } from '../lib/format'; import { useApi } from '../lib/useApi'; import { MatchTabs } from './MatchTabs'; import { Placeholder } from './Placeholder'; diff --git a/dotcom-rendering/src/components/GoalAttempts.stories.tsx b/dotcom-rendering/src/components/GoalAttempts.stories.tsx index a777489858c..aa646e8645f 100644 --- a/dotcom-rendering/src/components/GoalAttempts.stories.tsx +++ b/dotcom-rendering/src/components/GoalAttempts.stories.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { lightDecorator } from '../../.storybook/decorators/themeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { GoalAttempts } from './GoalAttempts'; export default { diff --git a/dotcom-rendering/src/components/GuVideoBlockComponent.amp.tsx b/dotcom-rendering/src/components/GuVideoBlockComponent.amp.tsx index 823476a2bb2..344b4b4f6ae 100644 --- a/dotcom-rendering/src/components/GuVideoBlockComponent.amp.tsx +++ b/dotcom-rendering/src/components/GuVideoBlockComponent.amp.tsx @@ -1,4 +1,4 @@ -import type { ArticleTheme } from '@guardian/libs'; +import type { ArticleTheme } from '../lib/format'; import type { GuVideoBlockElement } from '../types/content'; import { Caption } from './Caption.amp'; diff --git a/dotcom-rendering/src/components/GuVideoBlockComponent.tsx b/dotcom-rendering/src/components/GuVideoBlockComponent.tsx index 2901f55b964..b75956fa933 100644 --- a/dotcom-rendering/src/components/GuVideoBlockComponent.tsx +++ b/dotcom-rendering/src/components/GuVideoBlockComponent.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; import { unescapeData } from '../lib/escapeData'; +import type { ArticleFormat } from '../lib/format'; import { Caption } from './Caption'; type Props = { diff --git a/dotcom-rendering/src/components/GuideAtom/GuideAtom.stories.tsx b/dotcom-rendering/src/components/GuideAtom/GuideAtom.stories.tsx index 6cd6938807b..aa723e94bb8 100644 --- a/dotcom-rendering/src/components/GuideAtom/GuideAtom.stories.tsx +++ b/dotcom-rendering/src/components/GuideAtom/GuideAtom.stories.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator'; import { analysisStoryExpanded, @@ -10,6 +9,7 @@ import { listStoryExpanded, orderedListStoryExpanded, } from '../../../fixtures/manual/guideAtom'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { palette } from '../../palette'; import { GuideAtom } from './GuideAtom'; diff --git a/dotcom-rendering/src/components/Header.amp.tsx b/dotcom-rendering/src/components/Header.amp.tsx index dd6359c2d76..aa6eaca3209 100644 --- a/dotcom-rendering/src/components/Header.amp.tsx +++ b/dotcom-rendering/src/components/Header.amp.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { brandText, from, @@ -9,6 +8,7 @@ import { visuallyHidden, } from '@guardian/source/foundations'; import { SvgGuardianBestWebsiteLogo } from '@guardian/source/react-components'; +import type { ArticleTheme } from '../lib/format'; import { pillarPalette_DO_NOT_USE } from '../lib/pillars'; import type { NavType, PillarLinkType } from '../model/extract-nav'; import { ReaderRevenueButton } from './ReaderRevenueButton.amp'; diff --git a/dotcom-rendering/src/components/HeadlineByline.stories.tsx b/dotcom-rendering/src/components/HeadlineByline.stories.tsx index 27fdf394220..41be4381da2 100644 --- a/dotcom-rendering/src/components/HeadlineByline.stories.tsx +++ b/dotcom-rendering/src/components/HeadlineByline.stories.tsx @@ -1,15 +1,15 @@ import { css } from '@emotion/react'; -import { - ArticleDesign, - ArticleDisplay, - ArticleSpecial, - Pillar, -} from '@guardian/libs'; import type { StoryObj } from '@storybook/react'; import { splitTheme, type StoryProps, } from '../../.storybook/decorators/splitThemeDecorator'; +import { + ArticleDesign, + ArticleDisplay, + ArticleSpecial, + Pillar, +} from '../lib/format'; import { HeadlineByline } from './HeadlineByline'; export default { diff --git a/dotcom-rendering/src/components/HeadlineByline.tsx b/dotcom-rendering/src/components/HeadlineByline.tsx index 247040f810e..413518bc53e 100644 --- a/dotcom-rendering/src/components/HeadlineByline.tsx +++ b/dotcom-rendering/src/components/HeadlineByline.tsx @@ -1,6 +1,4 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, ArticleDisplay, ArticleSpecial } from '@guardian/libs'; import { from, headlineLightItalic28, @@ -17,6 +15,12 @@ import { until, } from '@guardian/source/foundations'; import { getSoleContributor } from '../lib/byline'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, + ArticleSpecial, +} from '../lib/format'; import { palette as schemedPalette } from '../palette'; import type { TagType } from '../types/tag'; import { BylineLink } from './BylineLink'; diff --git a/dotcom-rendering/src/components/ImageBlockComponent.amp.tsx b/dotcom-rendering/src/components/ImageBlockComponent.amp.tsx index 8cf333f63c0..051a2230fb5 100644 --- a/dotcom-rendering/src/components/ImageBlockComponent.amp.tsx +++ b/dotcom-rendering/src/components/ImageBlockComponent.amp.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { text, textSans12 } from '@guardian/source/foundations'; +import type { ArticleTheme } from '../lib/format'; import { bestFitImage, heightEstimate } from '../lib/image-fit.amp'; import { pillarPalette_DO_NOT_USE } from '../lib/pillars'; import TriangleIcon from '../static/icons/triangle.svg'; diff --git a/dotcom-rendering/src/components/ImageBlockComponent.stories.tsx b/dotcom-rendering/src/components/ImageBlockComponent.stories.tsx index f4990f9b1e3..b6ea127d3c3 100644 --- a/dotcom-rendering/src/components/ImageBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/ImageBlockComponent.stories.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { Figure } from './Figure'; import { Flex } from './Flex'; import { ImageBlockComponent } from './ImageBlockComponent'; diff --git a/dotcom-rendering/src/components/ImageBlockComponent.tsx b/dotcom-rendering/src/components/ImageBlockComponent.tsx index d38e88ebe09..5ed41641b7a 100644 --- a/dotcom-rendering/src/components/ImageBlockComponent.tsx +++ b/dotcom-rendering/src/components/ImageBlockComponent.tsx @@ -1,4 +1,4 @@ -import type { ArticleFormat } from '@guardian/libs'; +import type { ArticleFormat } from '../lib/format'; import type { ImageBlockElement, StarRating } from '../types/content'; import { ImageComponent } from './ImageComponent'; diff --git a/dotcom-rendering/src/components/ImageComponent.tsx b/dotcom-rendering/src/components/ImageComponent.tsx index 0fa4b363de5..0264838616c 100644 --- a/dotcom-rendering/src/components/ImageComponent.tsx +++ b/dotcom-rendering/src/components/ImageComponent.tsx @@ -1,10 +1,5 @@ import { css } from '@emotion/react'; -import { - ArticleDesign, - ArticleDisplay, - type ArticleFormat, - isUndefined, -} from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { from, headlineLight17, @@ -14,6 +9,11 @@ import { palette as srcPalette, until, } from '@guardian/source/foundations'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, +} from '../lib/format'; import { getLargest, getMaster } from '../lib/image'; import { palette as themePalette } from '../palette'; import type { diff --git a/dotcom-rendering/src/components/InteractiveBlockComponent.importable.tsx b/dotcom-rendering/src/components/InteractiveBlockComponent.importable.tsx index a9366bfe968..c297219980e 100644 --- a/dotcom-rendering/src/components/InteractiveBlockComponent.importable.tsx +++ b/dotcom-rendering/src/components/InteractiveBlockComponent.importable.tsx @@ -1,13 +1,10 @@ import { css } from '@emotion/react'; -import { - type ArticleFormat, - ArticleSpecial, - isUndefined, -} from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { article17, space, textSans17 } from '@guardian/source/foundations'; import libDebounce from 'lodash.debounce'; import { useRef, useState } from 'react'; import { interactiveLegacyFigureClasses } from '../layouts/lib/interactiveLegacyStyling'; +import { type ArticleFormat, ArticleSpecial } from '../lib/format'; import { useOnce } from '../lib/useOnce'; import { palette as themePalette } from '../palette'; import type { RoleType } from '../types/content'; diff --git a/dotcom-rendering/src/components/InteractiveBlockComponent.stories.tsx b/dotcom-rendering/src/components/InteractiveBlockComponent.stories.tsx index 2d7e95d8e22..d7ff9cdcb33 100644 --- a/dotcom-rendering/src/components/InteractiveBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/InteractiveBlockComponent.stories.tsx @@ -1,8 +1,8 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { StoryObj } from '@storybook/react'; import type { StoryProps } from '../../.storybook/decorators/splitThemeDecorator'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { InteractiveBlockComponent } from './InteractiveBlockComponent.importable'; import { TextBlockComponent } from './TextBlockComponent'; diff --git a/dotcom-rendering/src/components/InteractiveContentsBlockComponent.stories.tsx b/dotcom-rendering/src/components/InteractiveContentsBlockComponent.stories.tsx index 1b1e1abaeb0..550b09650a0 100644 --- a/dotcom-rendering/src/components/InteractiveContentsBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/InteractiveContentsBlockComponent.stories.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { NumberedList } from '../../fixtures/generated/dcr-articles/NumberedList'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { enhanceInteractiveContentsElements } from '../model/enhance-interactive-contents-elements'; import type { InteractiveContentsBlockElement } from '../types/content'; import { InteractiveContentsBlockComponent } from './InteractiveContentsBlockComponent.importable'; diff --git a/dotcom-rendering/src/components/Island.test.tsx b/dotcom-rendering/src/components/Island.test.tsx index 57ace5c0463..c8b40556ae0 100644 --- a/dotcom-rendering/src/components/Island.test.tsx +++ b/dotcom-rendering/src/components/Island.test.tsx @@ -2,9 +2,9 @@ * @jest-environment node */ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { PropsWithChildren } from 'react'; import { renderToString } from 'react-dom/server'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { AdPortals } from './AdPortals.importable'; import { AlreadyVisited } from './AlreadyVisited.importable'; import { AppsEpic } from './AppsEpic.importable'; diff --git a/dotcom-rendering/src/components/KeyEventCard.stories.tsx b/dotcom-rendering/src/components/KeyEventCard.stories.tsx index 74618241873..9c1432ea696 100644 --- a/dotcom-rendering/src/components/KeyEventCard.stories.tsx +++ b/dotcom-rendering/src/components/KeyEventCard.stories.tsx @@ -1,15 +1,15 @@ import { css } from '@emotion/react'; +import { from } from '@guardian/source/foundations'; +import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import type { KeyEventCard as KeyEventCardType } from '../../fixtures/manual/key-events'; +import { events } from '../../fixtures/manual/key-events'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import { from } from '@guardian/source/foundations'; -import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; -import type { KeyEventCard as KeyEventCardType } from '../../fixtures/manual/key-events'; -import { events } from '../../fixtures/manual/key-events'; +} from '../lib/format'; import { palette } from '../palette'; import { KeyEventCard } from './KeyEventCard'; diff --git a/dotcom-rendering/src/components/KeyEventsCarousel.stories.tsx b/dotcom-rendering/src/components/KeyEventsCarousel.stories.tsx index 5939db0757c..5996a7ac120 100644 --- a/dotcom-rendering/src/components/KeyEventsCarousel.stories.tsx +++ b/dotcom-rendering/src/components/KeyEventsCarousel.stories.tsx @@ -1,11 +1,4 @@ import { css } from '@emotion/react'; -import { - ArticleDesign, - ArticleDisplay, - type ArticleFormat, - ArticleSpecial, - Pillar, -} from '@guardian/libs'; import { from } from '@guardian/source/foundations'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { @@ -13,6 +6,13 @@ import { ShortKeyEvents, SingleKeyEvent, } from '../../fixtures/manual/live-blog-key-events'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, + ArticleSpecial, + Pillar, +} from '../lib/format'; import { palette } from '../palette'; import { KeyEventsCarousel } from './KeyEventsCarousel.importable'; diff --git a/dotcom-rendering/src/components/KeyTakeaway.tsx b/dotcom-rendering/src/components/KeyTakeaway.tsx index 04191598367..1ad40235fd0 100644 --- a/dotcom-rendering/src/components/KeyTakeaway.tsx +++ b/dotcom-rendering/src/components/KeyTakeaway.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { type ArticleFormat } from '@guardian/libs'; import type { EditionId } from '../lib/edition'; +import { type ArticleFormat } from '../lib/format'; import type { ArticleElementRenderer } from '../lib/renderElement'; import { slugify } from '../model/enhance-H2s'; import { palette } from '../palette'; diff --git a/dotcom-rendering/src/components/KeyTakeaways.stories.tsx b/dotcom-rendering/src/components/KeyTakeaways.stories.tsx index 32654e081c6..3b3034cfae2 100644 --- a/dotcom-rendering/src/components/KeyTakeaways.stories.tsx +++ b/dotcom-rendering/src/components/KeyTakeaways.stories.tsx @@ -1,14 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { centreColumnDecorator } from '../../.storybook/decorators/gridDecorators'; +import { allModes } from '../../.storybook/modes'; +import { images } from '../../fixtures/generated/images'; import { ArticleDesign, ArticleDisplay, + type ArticleFormat, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import type { ArticleFormat } from '@guardian/libs'; -import type { Meta, StoryObj } from '@storybook/react'; -import { centreColumnDecorator } from '../../.storybook/decorators/gridDecorators'; -import { allModes } from '../../.storybook/modes'; -import { images } from '../../fixtures/generated/images'; +} from '../lib/format'; import { getAllDesigns, getAllThemes } from '../lib/format'; import { RenderArticleElement } from '../lib/renderElement'; import type { TextBlockElement } from '../types/content'; diff --git a/dotcom-rendering/src/components/KeyTakeaways.tsx b/dotcom-rendering/src/components/KeyTakeaways.tsx index c63f5f74824..2aad07ae82b 100644 --- a/dotcom-rendering/src/components/KeyTakeaways.tsx +++ b/dotcom-rendering/src/components/KeyTakeaways.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; import { palette } from '@guardian/source/foundations'; import type { EditionId } from '../lib/edition'; +import type { ArticleFormat } from '../lib/format'; import type { ArticleElementRenderer } from '../lib/renderElement'; import type { ServerSideTests, Switches } from '../types/config'; import type { KeyTakeaway, StarRating } from '../types/content'; diff --git a/dotcom-rendering/src/components/Kicker.stories.tsx b/dotcom-rendering/src/components/Kicker.stories.tsx index f8d3c7c2b59..a696a32423f 100644 --- a/dotcom-rendering/src/components/Kicker.stories.tsx +++ b/dotcom-rendering/src/components/Kicker.stories.tsx @@ -1,7 +1,7 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { Meta } from '@storybook/react'; import type { CSSProperties } from 'react'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { palette } from '../palette'; import type { DCRContainerPalette } from '../types/front'; import { ContainerOverrides } from './ContainerOverrides'; diff --git a/dotcom-rendering/src/components/KnowledgeQuizAtom.importable.tsx b/dotcom-rendering/src/components/KnowledgeQuizAtom.importable.tsx index 3efebac46c1..e7aeb18766b 100644 --- a/dotcom-rendering/src/components/KnowledgeQuizAtom.importable.tsx +++ b/dotcom-rendering/src/components/KnowledgeQuizAtom.importable.tsx @@ -1,6 +1,5 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; -import { ArticleSpecial, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { article17, palette, @@ -11,6 +10,7 @@ import { } from '@guardian/source/foundations'; import { Button, Radio, RadioGroup } from '@guardian/source/react-components'; import { Fragment, useEffect, useState } from 'react'; +import { ArticleSpecial, type ArticleTheme } from '../lib/format'; import type { AnswerType, KnowledgeQuizAtomType, diff --git a/dotcom-rendering/src/components/KnowledgeQuizAtom.stories.tsx b/dotcom-rendering/src/components/KnowledgeQuizAtom.stories.tsx index 75a231b7a7c..3190dc6f1c6 100644 --- a/dotcom-rendering/src/components/KnowledgeQuizAtom.stories.tsx +++ b/dotcom-rendering/src/components/KnowledgeQuizAtom.stories.tsx @@ -1,9 +1,3 @@ -import { - ArticleDesign, - ArticleDisplay, - ArticleSpecial, - Pillar, -} from '@guardian/libs'; import type { Meta, StoryObj } from '@storybook/react'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { @@ -13,6 +7,12 @@ import { resultGroups, } from '../../fixtures/manual/knowledgeQuizAtom'; import { sharingUrls } from '../../fixtures/manual/sharingUrls'; +import { + ArticleDesign, + ArticleDisplay, + ArticleSpecial, + Pillar, +} from '../lib/format'; import { KnowledgeQuizAtom } from './KnowledgeQuizAtom.importable'; const meta = { diff --git a/dotcom-rendering/src/components/KnowledgeQuizAtom.test.tsx b/dotcom-rendering/src/components/KnowledgeQuizAtom.test.tsx index 72ee2c55f8e..88184fba6b2 100644 --- a/dotcom-rendering/src/components/KnowledgeQuizAtom.test.tsx +++ b/dotcom-rendering/src/components/KnowledgeQuizAtom.test.tsx @@ -1,4 +1,3 @@ -import { Pillar } from '@guardian/libs'; import { fireEvent, render } from '@testing-library/react'; import { ensure } from '../../fixtures/manual/ensure'; import { @@ -6,6 +5,7 @@ import { resultGroups, } from '../../fixtures/manual/knowledgeQuizAtom'; import { sharingUrls } from '../../fixtures/manual/sharingUrls'; +import { Pillar } from '../lib/format'; import { KnowledgeQuizAtom } from './KnowledgeQuizAtom.importable'; const questionOne = ensure(exampleKnowledgeQuestions.find((x) => x)); diff --git a/dotcom-rendering/src/components/LatestLinks.importable.stories.tsx b/dotcom-rendering/src/components/LatestLinks.importable.stories.tsx index 7f48f4d5d9e..2ebf21a9328 100644 --- a/dotcom-rendering/src/components/LatestLinks.importable.stories.tsx +++ b/dotcom-rendering/src/components/LatestLinks.importable.stories.tsx @@ -1,10 +1,10 @@ import type { SerializedStyles } from '@emotion/react'; import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { breakpoints } from '@guardian/source/foundations'; import fetchMock from 'fetch-mock'; import type { PropsWithChildren } from 'react'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { palette } from '../palette'; import type { DCRContainerPalette } from '../types/front'; import { ContainerOverrides } from './ContainerOverrides'; diff --git a/dotcom-rendering/src/components/LeftColumn.stories.tsx b/dotcom-rendering/src/components/LeftColumn.stories.tsx index 0f0b3f14a0e..03306ed582b 100644 --- a/dotcom-rendering/src/components/LeftColumn.stories.tsx +++ b/dotcom-rendering/src/components/LeftColumn.stories.tsx @@ -1,4 +1,4 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { ArticleContainer } from './ArticleContainer'; import { Flex } from './Flex'; import { LeftColumn } from './LeftColumn'; diff --git a/dotcom-rendering/src/components/Lightbox.stories.tsx b/dotcom-rendering/src/components/Lightbox.stories.tsx index b8d3efbde12..4a8f4dbf76d 100644 --- a/dotcom-rendering/src/components/Lightbox.stories.tsx +++ b/dotcom-rendering/src/components/Lightbox.stories.tsx @@ -1,13 +1,13 @@ +import { storage } from '@guardian/libs'; +import { breakpoints } from '@guardian/source/foundations'; +import type { Meta, StoryObj } from '@storybook/react'; +import { useEffect } from 'react'; import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar, - storage, -} from '@guardian/libs'; -import { breakpoints } from '@guardian/source/foundations'; -import type { Meta, StoryObj } from '@storybook/react'; -import { useEffect } from 'react'; +} from '../lib/format'; import type { ImageForLightbox } from '../types/content'; import { LightboxLayout } from './LightboxLayout.importable'; diff --git a/dotcom-rendering/src/components/LightboxImages.tsx b/dotcom-rendering/src/components/LightboxImages.tsx index 086525c0512..bae005f5784 100644 --- a/dotcom-rendering/src/components/LightboxImages.tsx +++ b/dotcom-rendering/src/components/LightboxImages.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import { type ArticleFormat, isUndefined, log, timeAgo } from '@guardian/libs'; +import { isUndefined, log, timeAgo } from '@guardian/libs'; import { from, headlineLight24, @@ -12,6 +12,7 @@ import { import { Hide, Link } from '@guardian/source/react-components'; import { StarRating } from '@guardian/source-development-kitchen/react-components'; import { useEffect, useState } from 'react'; +import type { ArticleFormat } from '../lib/format'; import type { ImageForLightbox } from '../types/content'; import { LightboxCaption } from './LightboxCaption'; import { LightboxLoader } from './LightboxLoader'; diff --git a/dotcom-rendering/src/components/LightboxJavascript.tsx b/dotcom-rendering/src/components/LightboxJavascript.tsx index 0a73612b385..3d915359092 100644 --- a/dotcom-rendering/src/components/LightboxJavascript.tsx +++ b/dotcom-rendering/src/components/LightboxJavascript.tsx @@ -1,9 +1,10 @@ import { css } from '@emotion/react'; -import { type ArticleFormat, isUndefined, log, storage } from '@guardian/libs'; +import { isUndefined, log, storage } from '@guardian/libs'; import { from, space } from '@guardian/source/foundations'; import libDebounce from 'lodash.debounce'; import { useEffect, useState } from 'react'; import screenfull from 'screenfull'; +import type { ArticleFormat } from '../lib/format'; import type { ImageForLightbox } from '../types/content'; import { LightboxImages } from './LightboxImages'; diff --git a/dotcom-rendering/src/components/LightboxLayout.importable.tsx b/dotcom-rendering/src/components/LightboxLayout.importable.tsx index b278dd46126..2c52d9dd8bc 100644 --- a/dotcom-rendering/src/components/LightboxLayout.importable.tsx +++ b/dotcom-rendering/src/components/LightboxLayout.importable.tsx @@ -1,5 +1,4 @@ import { css, Global } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; import { from, palette, @@ -14,6 +13,7 @@ import { SvgArrowRightStraight, SvgCross, } from '@guardian/source/react-components'; +import type { ArticleFormat } from '../lib/format'; import { getZIndex } from '../lib/getZIndex'; import type { ImageForLightbox } from '../types/content'; import { LightboxJavascript } from './LightboxJavascript'; diff --git a/dotcom-rendering/src/components/LightboxLink.tsx b/dotcom-rendering/src/components/LightboxLink.tsx index d5dad06e135..94531f4d430 100644 --- a/dotcom-rendering/src/components/LightboxLink.tsx +++ b/dotcom-rendering/src/components/LightboxLink.tsx @@ -1,9 +1,4 @@ import { css } from '@emotion/react'; -import { - ArticleDesign, - ArticleDisplay, - type ArticleFormat, -} from '@guardian/libs'; import { from, palette, @@ -11,6 +6,11 @@ import { visuallyHidden, } from '@guardian/source/foundations'; import { SvgArrowExpand } from '@guardian/source/react-components'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, +} from '../lib/format'; import type { RoleType } from '../types/content'; type Props = { diff --git a/dotcom-rendering/src/components/LinkHeadline.stories.tsx b/dotcom-rendering/src/components/LinkHeadline.stories.tsx index 25506ecb659..4a4bba592a2 100644 --- a/dotcom-rendering/src/components/LinkHeadline.stories.tsx +++ b/dotcom-rendering/src/components/LinkHeadline.stories.tsx @@ -1,13 +1,13 @@ +import type { StoryObj } from '@storybook/react'; +import type { StoryProps } from '../../.storybook/decorators/splitThemeDecorator'; +import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import type { StoryObj } from '@storybook/react'; -import type { StoryProps } from '../../.storybook/decorators/splitThemeDecorator'; -import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +} from '../lib/format'; import { LinkHeadline } from './LinkHeadline'; import { Section } from './Section'; diff --git a/dotcom-rendering/src/components/LiveBlock.stories.tsx b/dotcom-rendering/src/components/LiveBlock.stories.tsx index 668ca1f0adc..1f2b1db54d5 100644 --- a/dotcom-rendering/src/components/LiveBlock.stories.tsx +++ b/dotcom-rendering/src/components/LiveBlock.stories.tsx @@ -1,9 +1,9 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { breakpoints, from } from '@guardian/source/foundations'; import { lightDecorator } from '../../.storybook/decorators/themeDecorator'; import { images } from '../../fixtures/generated/images'; import { liveBlock } from '../../fixtures/manual/liveBlock'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { LiveBlock } from './LiveBlock'; const Wrapper = ({ children }: { children: React.ReactNode }) => { diff --git a/dotcom-rendering/src/components/LiveBlock.tsx b/dotcom-rendering/src/components/LiveBlock.tsx index b860dc9e4f2..3dfc26871b0 100644 --- a/dotcom-rendering/src/components/LiveBlock.tsx +++ b/dotcom-rendering/src/components/LiveBlock.tsx @@ -1,6 +1,7 @@ import { css } from '@emotion/react'; -import { type ArticleFormat, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import type { EditionId } from '../lib/edition'; +import type { ArticleFormat } from '../lib/format'; import { RenderArticleElement } from '../lib/renderElement'; import type { ServerSideTests, Switches } from '../types/config'; import { Island } from './Island'; diff --git a/dotcom-rendering/src/components/LiveBlogBlocksAndAdverts.tsx b/dotcom-rendering/src/components/LiveBlogBlocksAndAdverts.tsx index de83a4565bc..df2f4ce03f3 100644 --- a/dotcom-rendering/src/components/LiveBlogBlocksAndAdverts.tsx +++ b/dotcom-rendering/src/components/LiveBlogBlocksAndAdverts.tsx @@ -1,6 +1,6 @@ -import type { ArticleFormat } from '@guardian/libs'; import { Fragment } from 'react'; import type { EditionId } from '../lib/edition'; +import type { ArticleFormat } from '../lib/format'; import { getLiveblogAdPositions } from '../lib/getLiveblogAdPositions'; import type { ServerSideTests, Switches } from '../types/config'; import { AdPlaceholder } from './AdPlaceholder.apps'; diff --git a/dotcom-rendering/src/components/LiveBlogRenderer.tsx b/dotcom-rendering/src/components/LiveBlogRenderer.tsx index b5c08c260d6..6ec3b4b93a5 100644 --- a/dotcom-rendering/src/components/LiveBlogRenderer.tsx +++ b/dotcom-rendering/src/components/LiveBlogRenderer.tsx @@ -1,6 +1,6 @@ -import type { ArticleFormat } from '@guardian/libs'; import { Hide } from '@guardian/source/react-components'; import type { EditionId } from '../lib/edition'; +import type { ArticleFormat } from '../lib/format'; import type { ServerSideTests, Switches } from '../types/config'; import type { TagType } from '../types/tag'; import { useConfig } from './ConfigContext'; diff --git a/dotcom-rendering/src/components/Liveness.importable.tsx b/dotcom-rendering/src/components/Liveness.importable.tsx index a5b48ec4b3a..7137980cf8c 100644 --- a/dotcom-rendering/src/components/Liveness.importable.tsx +++ b/dotcom-rendering/src/components/Liveness.importable.tsx @@ -1,8 +1,9 @@ -import { type ArticleFormat, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { useCallback, useEffect, useState } from 'react'; import { createPortal } from 'react-dom'; import { getEmotionCache } from '../client/islands/emotion'; import { initHydration } from '../client/islands/initHydration'; +import type { ArticleFormat } from '../lib/format'; import { useApi } from '../lib/useApi'; import { Toast } from './Toast'; diff --git a/dotcom-rendering/src/components/MainMedia.amp.tsx b/dotcom-rendering/src/components/MainMedia.amp.tsx index 3352ac66469..f3f0b25c6d3 100644 --- a/dotcom-rendering/src/components/MainMedia.amp.tsx +++ b/dotcom-rendering/src/components/MainMedia.amp.tsx @@ -1,10 +1,10 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { palette, textSans15, visuallyHidden, } from '@guardian/source/foundations'; +import type { ArticleTheme } from '../lib/format'; import { bestFitImage, heightEstimate } from '../lib/image-fit.amp'; import { scrsetStringFromImagesSources } from '../lib/srcset-utils.amp'; import InfoIcon from '../static/icons/info.svg'; diff --git a/dotcom-rendering/src/components/MainMedia.tsx b/dotcom-rendering/src/components/MainMedia.tsx index 559c6466936..6cdae88b5a0 100644 --- a/dotcom-rendering/src/components/MainMedia.tsx +++ b/dotcom-rendering/src/components/MainMedia.tsx @@ -1,11 +1,11 @@ import { css } from '@emotion/react'; +import { space, until } from '@guardian/source/foundations'; +import type { EditionId } from '../lib/edition'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, -} from '@guardian/libs'; -import { space, until } from '@guardian/source/foundations'; -import type { EditionId } from '../lib/edition'; +} from '../lib/format'; import { getZIndex } from '../lib/getZIndex'; import { RenderArticleElement } from '../lib/renderElement'; import type { ServerSideTests, Switches } from '../types/config'; diff --git a/dotcom-rendering/src/components/MapEmbedBlockComponent.importable.tsx b/dotcom-rendering/src/components/MapEmbedBlockComponent.importable.tsx index d62bf7f3b4f..22fcb767999 100644 --- a/dotcom-rendering/src/components/MapEmbedBlockComponent.importable.tsx +++ b/dotcom-rendering/src/components/MapEmbedBlockComponent.importable.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; +import type { ArticleFormat } from '../lib/format'; import type { RoleType } from '../types/content'; import { Caption } from './Caption'; import { ClickToView } from './ClickToView'; diff --git a/dotcom-rendering/src/components/Masthead/HighlightsCard.stories.tsx b/dotcom-rendering/src/components/Masthead/HighlightsCard.stories.tsx index e527d12f004..4ef7447f312 100644 --- a/dotcom-rendering/src/components/Masthead/HighlightsCard.stories.tsx +++ b/dotcom-rendering/src/components/Masthead/HighlightsCard.stories.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { from } from '@guardian/source/foundations'; import type { Meta, StoryObj } from '@storybook/react'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import type { MainMedia } from '../../types/mainMedia'; import { HighlightsCard } from './HighlightsCard'; diff --git a/dotcom-rendering/src/components/Masthead/HighlightsCard.tsx b/dotcom-rendering/src/components/Masthead/HighlightsCard.tsx index 3ca5845d427..8007f139431 100644 --- a/dotcom-rendering/src/components/Masthead/HighlightsCard.tsx +++ b/dotcom-rendering/src/components/Masthead/HighlightsCard.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; import { between, from, until } from '@guardian/source/foundations'; import { isMediaCard } from '../../lib/cardHelpers'; +import { ArticleDesign, type ArticleFormat } from '../../lib/format'; import { palette } from '../../palette'; import type { DCRFrontImage } from '../../types/front'; import type { MainMedia } from '../../types/mainMedia'; diff --git a/dotcom-rendering/src/components/Masthead/Titlepiece/Nav.mock.tsx b/dotcom-rendering/src/components/Masthead/Titlepiece/Nav.mock.tsx index 3eb120b7bc7..197ee18a8af 100644 --- a/dotcom-rendering/src/components/Masthead/Titlepiece/Nav.mock.tsx +++ b/dotcom-rendering/src/components/Masthead/Titlepiece/Nav.mock.tsx @@ -1,4 +1,4 @@ -import { Pillar } from '@guardian/libs'; +import { Pillar } from '../../../lib/format'; import type { NavType } from '../../../model/extract-nav'; export const nav: NavType = { diff --git a/dotcom-rendering/src/components/Masthead/Titlepiece/Pillars.stories.tsx b/dotcom-rendering/src/components/Masthead/Titlepiece/Pillars.stories.tsx index b5463004c2e..46e85afd94a 100644 --- a/dotcom-rendering/src/components/Masthead/Titlepiece/Pillars.stories.tsx +++ b/dotcom-rendering/src/components/Masthead/Titlepiece/Pillars.stories.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import type { Pillar } from '@guardian/libs'; import { palette as sourcePalette } from '@guardian/source/foundations'; import type { Meta } from '@storybook/react'; +import type { Pillar } from '../../../lib/format'; import { nestedOphanComponents } from '../../../lib/ophan-helpers'; import { nav } from './Nav.mock'; import { Pillars } from './Pillars'; diff --git a/dotcom-rendering/src/components/Masthead/Titlepiece/Pillars.tsx b/dotcom-rendering/src/components/Masthead/Titlepiece/Pillars.tsx index b438016765e..42e63e3e450 100644 --- a/dotcom-rendering/src/components/Masthead/Titlepiece/Pillars.tsx +++ b/dotcom-rendering/src/components/Masthead/Titlepiece/Pillars.tsx @@ -3,7 +3,6 @@ * This file was largely inspired by src/components/Pillars.tsx */ import { css } from '@emotion/react'; -import { type ArticleTheme, Pillar } from '@guardian/libs'; import { from, headlineBold14, @@ -13,6 +12,7 @@ import { palette as sourcePalette, space, } from '@guardian/source/foundations'; +import { type ArticleTheme, Pillar } from '../../../lib/format'; import { nestedOphanComponents } from '../../../lib/ophan-helpers'; import type { NavType } from '../../../model/extract-nav'; import { palette as themePalette } from '../../../palette'; diff --git a/dotcom-rendering/src/components/MatchNav.stories.tsx b/dotcom-rendering/src/components/MatchNav.stories.tsx index fc2a6d17c64..7331dabccf9 100644 --- a/dotcom-rendering/src/components/MatchNav.stories.tsx +++ b/dotcom-rendering/src/components/MatchNav.stories.tsx @@ -1,4 +1,4 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import type { TeamType } from '../types/sport'; import { ArticleContainer } from './ArticleContainer'; import { Flex } from './Flex'; diff --git a/dotcom-rendering/src/components/MatchStats.stories.tsx b/dotcom-rendering/src/components/MatchStats.stories.tsx index 8248b579638..9b9226b5d85 100644 --- a/dotcom-rendering/src/components/MatchStats.stories.tsx +++ b/dotcom-rendering/src/components/MatchStats.stories.tsx @@ -1,5 +1,5 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { matchReport } from '../../fixtures/generated/match-report'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { ArticleContainer } from './ArticleContainer'; import { Flex } from './Flex'; import { LeftColumn } from './LeftColumn'; diff --git a/dotcom-rendering/src/components/MatchStats.tsx b/dotcom-rendering/src/components/MatchStats.tsx index d5c2b9d2f28..6c27b1d97ee 100644 --- a/dotcom-rendering/src/components/MatchStats.tsx +++ b/dotcom-rendering/src/components/MatchStats.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; import { between, from, @@ -9,6 +8,7 @@ import { textSans15, until, } from '@guardian/source/foundations'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { palette as themePalette } from '../palette'; import type { TeamType } from '../types/sport'; import { Distribution } from './Distribution'; diff --git a/dotcom-rendering/src/components/MatchTabs.stories.tsx b/dotcom-rendering/src/components/MatchTabs.stories.tsx index f43542fd388..ce9c08e4b19 100644 --- a/dotcom-rendering/src/components/MatchTabs.stories.tsx +++ b/dotcom-rendering/src/components/MatchTabs.stories.tsx @@ -1,4 +1,4 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { MatchTabs } from './MatchTabs'; export default { diff --git a/dotcom-rendering/src/components/MatchTabs.tsx b/dotcom-rendering/src/components/MatchTabs.tsx index 4b424d7c808..c5e2deff888 100644 --- a/dotcom-rendering/src/components/MatchTabs.tsx +++ b/dotcom-rendering/src/components/MatchTabs.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; import { headlineMedium17, space } from '@guardian/source/foundations'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { palette as themePalette } from '../palette'; type Props = { diff --git a/dotcom-rendering/src/components/MiniProfile.tsx b/dotcom-rendering/src/components/MiniProfile.tsx index b8ed535b064..30edf8b27fc 100644 --- a/dotcom-rendering/src/components/MiniProfile.tsx +++ b/dotcom-rendering/src/components/MiniProfile.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { type ArticleFormat } from '@guardian/libs'; import { neutral, space, textSans14 } from '@guardian/source/foundations'; import sanitise from 'sanitize-html'; +import type { ArticleFormat } from '../lib/format'; import { slugify } from '../model/enhance-H2s'; import { palette } from '../palette'; import type { MiniProfile as MiniProfileModel } from '../types/content'; diff --git a/dotcom-rendering/src/components/MiniProfiles.stories.tsx b/dotcom-rendering/src/components/MiniProfiles.stories.tsx index 8010cd35755..c124c1838e0 100644 --- a/dotcom-rendering/src/components/MiniProfiles.stories.tsx +++ b/dotcom-rendering/src/components/MiniProfiles.stories.tsx @@ -1,14 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { centreColumnDecorator } from '../../.storybook/decorators/gridDecorators'; +import { allModes } from '../../.storybook/modes'; +import { images } from '../../fixtures/generated/images'; import { ArticleDesign, ArticleDisplay, + type ArticleFormat, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import type { ArticleFormat } from '@guardian/libs'; -import type { Meta, StoryObj } from '@storybook/react'; -import { centreColumnDecorator } from '../../.storybook/decorators/gridDecorators'; -import { allModes } from '../../.storybook/modes'; -import { images } from '../../fixtures/generated/images'; +} from '../lib/format'; import { getAllDesigns, getAllThemes } from '../lib/format'; import { RenderArticleElement } from '../lib/renderElement'; import type { TextBlockElement } from '../types/content'; diff --git a/dotcom-rendering/src/components/MiniProfiles.tsx b/dotcom-rendering/src/components/MiniProfiles.tsx index cde531e69e8..2ed3985aabd 100644 --- a/dotcom-rendering/src/components/MiniProfiles.tsx +++ b/dotcom-rendering/src/components/MiniProfiles.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; import { palette } from '@guardian/source/foundations'; import type { EditionId } from '../lib/edition'; +import type { ArticleFormat } from '../lib/format'; import type { ArticleElementRenderer } from '../lib/renderElement'; import type { ServerSideTests, Switches } from '../types/config'; import type { MiniProfile, StarRating } from '../types/content'; diff --git a/dotcom-rendering/src/components/MostViewedFooterItem.tsx b/dotcom-rendering/src/components/MostViewedFooterItem.tsx index 2e3911582e8..5cd11fde18d 100644 --- a/dotcom-rendering/src/components/MostViewedFooterItem.tsx +++ b/dotcom-rendering/src/components/MostViewedFooterItem.tsx @@ -1,8 +1,11 @@ import type { SerializedStyles } from '@emotion/react'; import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, ArticleSpecial } from '@guardian/libs'; import { headlineMedium17 } from '@guardian/source/foundations'; +import { + ArticleDesign, + type ArticleFormat, + ArticleSpecial, +} from '../lib/format'; import { palette } from '../palette'; import { AgeWarning } from './AgeWarning'; import { BigNumber } from './BigNumber'; diff --git a/dotcom-rendering/src/components/MostViewedFooterLayout.stories.tsx b/dotcom-rendering/src/components/MostViewedFooterLayout.stories.tsx index eb56ad7e968..67e278d4243 100644 --- a/dotcom-rendering/src/components/MostViewedFooterLayout.stories.tsx +++ b/dotcom-rendering/src/components/MostViewedFooterLayout.stories.tsx @@ -1,7 +1,7 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { StoryObj } from '@storybook/react'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { trails } from '../../fixtures/manual/trails'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { palette } from '../palette'; import { MostViewedFooter } from './MostViewedFooter.importable'; import { MostViewedFooterLayout } from './MostViewedFooterLayout'; diff --git a/dotcom-rendering/src/components/MostViewedRight.stories.tsx b/dotcom-rendering/src/components/MostViewedRight.stories.tsx index c0cf0893c0e..3d74b8af18c 100644 --- a/dotcom-rendering/src/components/MostViewedRight.stories.tsx +++ b/dotcom-rendering/src/components/MostViewedRight.stories.tsx @@ -1,10 +1,10 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { StoryObj } from '@storybook/react'; import fetchMock from 'fetch-mock'; import { splitTheme, type StoryProps, } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { ArticleContainer } from './ArticleContainer'; import { Flex } from './Flex'; import { LeftColumn } from './LeftColumn'; diff --git a/dotcom-rendering/src/components/MostViewedRightItem.tsx b/dotcom-rendering/src/components/MostViewedRightItem.tsx index 183fa3643f5..c74571f2a72 100644 --- a/dotcom-rendering/src/components/MostViewedRightItem.tsx +++ b/dotcom-rendering/src/components/MostViewedRightItem.tsx @@ -1,9 +1,9 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleSpecial } from '@guardian/libs'; import { headlineMedium17, palette as sourcePalette, } from '@guardian/source/foundations'; +import { ArticleDesign, ArticleSpecial } from '../lib/format'; import { useHover } from '../lib/useHover'; import { palette as themePalette } from '../palette'; import type { TrailType } from '../types/trails'; diff --git a/dotcom-rendering/src/components/MostViewedRightWithAd.importable.tsx b/dotcom-rendering/src/components/MostViewedRightWithAd.importable.tsx index 09c57875c05..f07c32f7d8e 100644 --- a/dotcom-rendering/src/components/MostViewedRightWithAd.importable.tsx +++ b/dotcom-rendering/src/components/MostViewedRightWithAd.importable.tsx @@ -3,7 +3,7 @@ import { ArticleDesign, type ArticleFormat, ArticleSpecial, -} from '@guardian/libs'; +} from '../lib/format'; import { RightAdsPlaceholder } from './AdPlaceholder.apps'; import { AdSlot } from './AdSlot.web'; import { useConfig } from './ConfigContext'; diff --git a/dotcom-rendering/src/components/MultiImageBlockComponent.stories.tsx b/dotcom-rendering/src/components/MultiImageBlockComponent.stories.tsx index d4cbcf0ca27..092500deb39 100644 --- a/dotcom-rendering/src/components/MultiImageBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/MultiImageBlockComponent.stories.tsx @@ -1,4 +1,4 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { MultiImageBlockComponent } from './MultiImageBlockComponent'; import { fourImages } from './MultiImageBlockComponent.mocks'; import { Section } from './Section'; diff --git a/dotcom-rendering/src/components/MultiImageBlockComponent.tsx b/dotcom-rendering/src/components/MultiImageBlockComponent.tsx index 0a62b893470..15b159cb403 100644 --- a/dotcom-rendering/src/components/MultiImageBlockComponent.tsx +++ b/dotcom-rendering/src/components/MultiImageBlockComponent.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; import { from, space, until } from '@guardian/source/foundations'; +import type { ArticleFormat } from '../lib/format'; import type { ImageBlockElement } from '../types/content'; import { Caption } from './Caption'; import { GridItem } from './GridItem'; diff --git a/dotcom-rendering/src/components/NumberedTitleBlockComponent.stories.tsx b/dotcom-rendering/src/components/NumberedTitleBlockComponent.stories.tsx index 3c3fa5ce390..3d5fa86b672 100644 --- a/dotcom-rendering/src/components/NumberedTitleBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/NumberedTitleBlockComponent.stories.tsx @@ -1,11 +1,11 @@ +import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, ArticleSpecial, type ArticleTheme, Pillar, -} from '@guardian/libs'; -import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +} from '../lib/format'; import { NumberedTitleBlockComponent } from './NumberedTitleBlockComponent'; export default { diff --git a/dotcom-rendering/src/components/OnwardsUpper.importable.tsx b/dotcom-rendering/src/components/OnwardsUpper.importable.tsx index a46ce12c793..7b621399381 100644 --- a/dotcom-rendering/src/components/OnwardsUpper.importable.tsx +++ b/dotcom-rendering/src/components/OnwardsUpper.importable.tsx @@ -1,11 +1,7 @@ import { css } from '@emotion/react'; -import { - type ArticleFormat, - type ArticleTheme, - joinUrl, - Pillar, -} from '@guardian/libs'; +import { joinUrl } from '@guardian/libs'; import type { EditionId } from '../lib/edition'; +import { type ArticleFormat, type ArticleTheme, Pillar } from '../lib/format'; import { useIsAndroid } from '../lib/useIsAndroid'; import { palette } from '../palette'; import type { OnwardsSource } from '../types/onwards'; diff --git a/dotcom-rendering/src/components/Pagination.stories.tsx b/dotcom-rendering/src/components/Pagination.stories.tsx index 56012986378..ec6757b5529 100644 --- a/dotcom-rendering/src/components/Pagination.stories.tsx +++ b/dotcom-rendering/src/components/Pagination.stories.tsx @@ -1,7 +1,7 @@ -import { ArticleDesign, ArticleDisplay } from '@guardian/libs'; import { breakpoints } from '@guardian/source/foundations'; import type { StoryProps } from '../../.storybook/decorators/splitThemeDecorator'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay } from '../lib/format'; import { getAllThemes } from '../lib/format'; import { Pagination } from './Pagination'; diff --git a/dotcom-rendering/src/components/PaidForBand.amp.tsx b/dotcom-rendering/src/components/PaidForBand.amp.tsx index b988d76e9e3..e236bd0a544 100644 --- a/dotcom-rendering/src/components/PaidForBand.amp.tsx +++ b/dotcom-rendering/src/components/PaidForBand.amp.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { ArticleSpecial } from '@guardian/libs'; import { from, palette, textSans15 } from '@guardian/source/foundations'; +import { ArticleSpecial } from '../lib/format'; import { pillarPalette_DO_NOT_USE } from '../lib/pillars'; import ArrowRightIcon from '../static/icons/arrow-right.svg'; import LabsLogo from '../static/logos/the-guardian-labs.svg'; diff --git a/dotcom-rendering/src/components/PersonalityQuizAtom.importable.tsx b/dotcom-rendering/src/components/PersonalityQuizAtom.importable.tsx index 6f62e84f1ff..0be0ae21444 100644 --- a/dotcom-rendering/src/components/PersonalityQuizAtom.importable.tsx +++ b/dotcom-rendering/src/components/PersonalityQuizAtom.importable.tsx @@ -1,6 +1,5 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; -import { ArticleSpecial, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { article17, palette, @@ -11,6 +10,7 @@ import { import { Button, Radio, RadioGroup } from '@guardian/source/react-components'; import type { KeyboardEvent, MouseEvent } from 'react'; import { memo, useEffect, useState } from 'react'; +import { ArticleSpecial, type ArticleTheme } from '../lib/format'; import type { AnswerType, PersonalityQuizAtomType, diff --git a/dotcom-rendering/src/components/PersonalityQuizAtom.stories.tsx b/dotcom-rendering/src/components/PersonalityQuizAtom.stories.tsx index 53fec672bab..38e01bb6fac 100644 --- a/dotcom-rendering/src/components/PersonalityQuizAtom.stories.tsx +++ b/dotcom-rendering/src/components/PersonalityQuizAtom.stories.tsx @@ -1,9 +1,3 @@ -import { - ArticleDesign, - ArticleDisplay, - ArticleSpecial, - Pillar, -} from '@guardian/libs'; import type { Meta, StoryObj } from '@storybook/react'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { @@ -11,6 +5,12 @@ import { exampleResultBuckets, } from '../../fixtures/manual/personalityQuizAtom'; import { sharingUrls } from '../../fixtures/manual/sharingUrls'; +import { + ArticleDesign, + ArticleDisplay, + ArticleSpecial, + Pillar, +} from '../lib/format'; import { PersonalityQuizAtom } from './PersonalityQuizAtom.importable'; const meta = { diff --git a/dotcom-rendering/src/components/PersonalityQuizAtom.test.tsx b/dotcom-rendering/src/components/PersonalityQuizAtom.test.tsx index b43a8c20c1e..f21ce75efc3 100644 --- a/dotcom-rendering/src/components/PersonalityQuizAtom.test.tsx +++ b/dotcom-rendering/src/components/PersonalityQuizAtom.test.tsx @@ -1,4 +1,3 @@ -import { Pillar } from '@guardian/libs'; import { fireEvent, render } from '@testing-library/react'; import '@testing-library/jest-dom'; import { ensure } from '../../fixtures/manual/ensure'; @@ -7,6 +6,7 @@ import { exampleResultBuckets, } from '../../fixtures/manual/personalityQuizAtom'; import { sharingUrls } from '../../fixtures/manual/sharingUrls'; +import { Pillar } from '../lib/format'; import { findMostReferredToBucketId, PersonalityQuizAtom, diff --git a/dotcom-rendering/src/components/Picture.tsx b/dotcom-rendering/src/components/Picture.tsx index 4a7595a9bb2..9fea0316921 100644 --- a/dotcom-rendering/src/components/Picture.tsx +++ b/dotcom-rendering/src/components/Picture.tsx @@ -1,11 +1,11 @@ import { css } from '@emotion/react'; +import { breakpoints } from '@guardian/source/foundations'; +import { Fragment, useCallback, useEffect, useState } from 'react'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, -} from '@guardian/libs'; -import { breakpoints } from '@guardian/source/foundations'; -import { Fragment, useCallback, useEffect, useState } from 'react'; +} from '../lib/format'; import { generateImageURL } from '../lib/image'; import type { RoleType } from '../types/content'; import type { Loading } from './CardPicture'; diff --git a/dotcom-rendering/src/components/PinnedPost.stories.tsx b/dotcom-rendering/src/components/PinnedPost.stories.tsx index c96a3f76377..1465021cdac 100644 --- a/dotcom-rendering/src/components/PinnedPost.stories.tsx +++ b/dotcom-rendering/src/components/PinnedPost.stories.tsx @@ -1,14 +1,14 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; +import { breakpoints, from } from '@guardian/source/foundations'; +import type { Meta, StoryObj } from '@storybook/react'; +import { liveBlock } from '../../fixtures/manual/liveBlock'; import { ArticleDesign, ArticleDisplay, + type ArticleFormat, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import { breakpoints, from } from '@guardian/source/foundations'; -import type { Meta, StoryObj } from '@storybook/react'; -import { liveBlock } from '../../fixtures/manual/liveBlock'; +} from '../lib/format'; import { FormatBoundary } from './FormatBoundary'; import { LiveBlock } from './LiveBlock'; import { PinnedPost } from './PinnedPost'; diff --git a/dotcom-rendering/src/components/ProfileAtom.stories.tsx b/dotcom-rendering/src/components/ProfileAtom.stories.tsx index ec95a2a430a..da0eac6bfbe 100644 --- a/dotcom-rendering/src/components/ProfileAtom.stories.tsx +++ b/dotcom-rendering/src/components/ProfileAtom.stories.tsx @@ -1,11 +1,11 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, Pillar, -} from '@guardian/libs'; -import type { Meta, StoryObj } from '@storybook/react'; -import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +} from '../lib/format'; import { ProfileAtom } from './ProfileAtom.importable'; const meta = { diff --git a/dotcom-rendering/src/components/PullQuoteBlockComponent.stories.tsx b/dotcom-rendering/src/components/PullQuoteBlockComponent.stories.tsx index e18199f0fbe..2f0c6dbf509 100644 --- a/dotcom-rendering/src/components/PullQuoteBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/PullQuoteBlockComponent.stories.tsx @@ -1,11 +1,11 @@ +import { breakpoints } from '@guardian/source/foundations'; +import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, Pillar, -} from '@guardian/libs'; -import { breakpoints } from '@guardian/source/foundations'; -import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +} from '../lib/format'; import { palette as themePalette } from '../palette'; import { PullQuoteBlockComponent } from './PullQuoteBlockComponent'; import { Section } from './Section'; diff --git a/dotcom-rendering/src/components/PullQuoteBlockComponent.tsx b/dotcom-rendering/src/components/PullQuoteBlockComponent.tsx index 195e0108302..744d532f1e5 100644 --- a/dotcom-rendering/src/components/PullQuoteBlockComponent.tsx +++ b/dotcom-rendering/src/components/PullQuoteBlockComponent.tsx @@ -1,9 +1,4 @@ import { css } from '@emotion/react'; -import { - ArticleDesign, - type ArticleFormat, - ArticleSpecial, -} from '@guardian/libs'; import { from, headlineMedium20, @@ -13,6 +8,11 @@ import { until, } from '@guardian/source/foundations'; import { unescapeData } from '../lib/escapeData'; +import { + ArticleDesign, + type ArticleFormat, + ArticleSpecial, +} from '../lib/format'; import { palette } from '../palette'; import { QuoteIcon } from './QuoteIcon'; diff --git a/dotcom-rendering/src/components/PullquoteBlockComponent.amp.tsx b/dotcom-rendering/src/components/PullquoteBlockComponent.amp.tsx index 6ca03ec148b..f6c83a65df1 100644 --- a/dotcom-rendering/src/components/PullquoteBlockComponent.amp.tsx +++ b/dotcom-rendering/src/components/PullquoteBlockComponent.amp.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { article17, palette } from '@guardian/source/foundations'; +import type { ArticleTheme } from '../lib/format'; import { pillarPalette_DO_NOT_USE } from '../lib/pillars'; import Quote from '../static/icons/quote.svg'; diff --git a/dotcom-rendering/src/components/QAndAExplainer.tsx b/dotcom-rendering/src/components/QAndAExplainer.tsx index 45cbaff65ca..8465450dc9f 100644 --- a/dotcom-rendering/src/components/QAndAExplainer.tsx +++ b/dotcom-rendering/src/components/QAndAExplainer.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; import type { EditionId } from '../lib/edition'; +import type { ArticleFormat } from '../lib/format'; import type { ArticleElementRenderer } from '../lib/renderElement'; import { slugify } from '../model/enhance-H2s'; import { palette } from '../palette'; diff --git a/dotcom-rendering/src/components/QAndAExplainers.stories.tsx b/dotcom-rendering/src/components/QAndAExplainers.stories.tsx index 38055ca9fac..0d1621f3e53 100644 --- a/dotcom-rendering/src/components/QAndAExplainers.stories.tsx +++ b/dotcom-rendering/src/components/QAndAExplainers.stories.tsx @@ -1,13 +1,13 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { centreColumnDecorator } from '../../.storybook/decorators/gridDecorators'; +import { allModes } from '../../.storybook/modes'; +import { images } from '../../fixtures/generated/images'; import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import type { Meta, StoryObj } from '@storybook/react'; -import { centreColumnDecorator } from '../../.storybook/decorators/gridDecorators'; -import { allModes } from '../../.storybook/modes'; -import { images } from '../../fixtures/generated/images'; +} from '../lib/format'; import { getAllThemes } from '../lib/format'; import { RenderArticleElement } from '../lib/renderElement'; import type { TextBlockElement } from '../types/content'; diff --git a/dotcom-rendering/src/components/QAndAExplainers.tsx b/dotcom-rendering/src/components/QAndAExplainers.tsx index d02c875f615..3d724b02a4f 100644 --- a/dotcom-rendering/src/components/QAndAExplainers.tsx +++ b/dotcom-rendering/src/components/QAndAExplainers.tsx @@ -1,5 +1,5 @@ -import type { ArticleFormat } from '@guardian/libs'; import type { EditionId } from '../lib/edition'; +import type { ArticleFormat } from '../lib/format'; import type { ArticleElementRenderer } from '../lib/renderElement'; import type { ServerSideTests, Switches } from '../types/config'; import type { QAndAExplainer, StarRating } from '../types/content'; diff --git a/dotcom-rendering/src/components/QandaAtom.stories.tsx b/dotcom-rendering/src/components/QandaAtom.stories.tsx index 6f60952e8d4..1f3bfb1b5bb 100644 --- a/dotcom-rendering/src/components/QandaAtom.stories.tsx +++ b/dotcom-rendering/src/components/QandaAtom.stories.tsx @@ -1,4 +1,3 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { Meta, StoryObj } from '@storybook/react'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { @@ -6,6 +5,7 @@ import { imageStoryWithCreditExpanded, listStoryExpanded, } from '../../fixtures/manual/qandaAtom'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { getAllThemes } from '../lib/format'; import { QandaAtom as QandaAtomComponent } from './QandaAtom.importable'; diff --git a/dotcom-rendering/src/components/RichLink.stories.tsx b/dotcom-rendering/src/components/RichLink.stories.tsx index ee23e287606..24c6cb3ff2e 100644 --- a/dotcom-rendering/src/components/RichLink.stories.tsx +++ b/dotcom-rendering/src/components/RichLink.stories.tsx @@ -1,11 +1,11 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { allModes } from '../../.storybook/modes'; import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import type { Meta, StoryObj } from '@storybook/react'; -import { allModes } from '../../.storybook/modes'; +} from '../lib/format'; import { palette } from '../palette'; import { Figure } from './Figure'; import { RichLink } from './RichLink'; diff --git a/dotcom-rendering/src/components/RichLink.tsx b/dotcom-rendering/src/components/RichLink.tsx index 053906a1ce0..369063b88ec 100644 --- a/dotcom-rendering/src/components/RichLink.tsx +++ b/dotcom-rendering/src/components/RichLink.tsx @@ -1,6 +1,5 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, ArticleSpecial, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { from, headlineMedium14, @@ -14,6 +13,11 @@ import { textSansBold17, } from '@guardian/source/foundations'; import { getSoleContributor, isContributor } from '../lib/byline'; +import { + ArticleDesign, + type ArticleFormat, + ArticleSpecial, +} from '../lib/format'; import { palette as themePalette } from '../palette'; import ArrowInCircle from '../static/icons/arrow-in-circle.svg'; import type { StarRating as Rating } from '../types/content'; diff --git a/dotcom-rendering/src/components/RichLinkBlockComponent.amp.tsx b/dotcom-rendering/src/components/RichLinkBlockComponent.amp.tsx index a56d3ed9ca7..8714ed6ab09 100644 --- a/dotcom-rendering/src/components/RichLinkBlockComponent.amp.tsx +++ b/dotcom-rendering/src/components/RichLinkBlockComponent.amp.tsx @@ -1,11 +1,11 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { headlineMedium17, palette, text, textSans12, } from '@guardian/source/foundations'; +import type { ArticleTheme } from '../lib/format'; import { pillarPalette_DO_NOT_USE } from '../lib/pillars'; import type { RichLinkBlockElement } from '../types/content'; diff --git a/dotcom-rendering/src/components/RichLinkComponent.importable.test.tsx b/dotcom-rendering/src/components/RichLinkComponent.importable.test.tsx index ff3c274c92c..e18e800a046 100644 --- a/dotcom-rendering/src/components/RichLinkComponent.importable.test.tsx +++ b/dotcom-rendering/src/components/RichLinkComponent.importable.test.tsx @@ -1,5 +1,5 @@ -import { ArticleDesign, ArticleDisplay, ArticleSpecial } from '@guardian/libs'; import { renderToString } from 'react-dom/server'; +import { ArticleDesign, ArticleDisplay, ArticleSpecial } from '../lib/format'; import { ConfigProvider } from './ConfigContext'; import { RichLinkComponent } from './RichLinkComponent.importable'; diff --git a/dotcom-rendering/src/components/RichLinkComponent.importable.tsx b/dotcom-rendering/src/components/RichLinkComponent.importable.tsx index d3d60fe2973..dbea062cda5 100644 --- a/dotcom-rendering/src/components/RichLinkComponent.importable.tsx +++ b/dotcom-rendering/src/components/RichLinkComponent.importable.tsx @@ -1,5 +1,5 @@ -import { type ArticleFormat } from '@guardian/libs'; import { decideFormat } from '../lib/decideFormat'; +import { type ArticleFormat } from '../lib/format'; import { useApi } from '../lib/useApi'; import type { RichLinkBlockElement, StarRating } from '../types/content'; import type { FEFormat } from '../types/frontend'; diff --git a/dotcom-rendering/src/components/Section.tsx b/dotcom-rendering/src/components/Section.tsx index 0277d3e4ef0..97e86d50c75 100644 --- a/dotcom-rendering/src/components/Section.tsx +++ b/dotcom-rendering/src/components/Section.tsx @@ -1,8 +1,7 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign } from '@guardian/libs'; import { from, space, until } from '@guardian/source/foundations'; import type { EditionId } from '../lib/edition'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { hiddenStyles } from '../lib/hiddenStyles'; import { palette } from '../palette'; import type { TreatType } from '../types/front'; diff --git a/dotcom-rendering/src/components/SeriesLink.amp.tsx b/dotcom-rendering/src/components/SeriesLink.amp.tsx index 4053d08fa4f..d893c739162 100644 --- a/dotcom-rendering/src/components/SeriesLink.amp.tsx +++ b/dotcom-rendering/src/components/SeriesLink.amp.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { headlineMedium17 } from '@guardian/source/foundations'; +import type { ArticleTheme } from '../lib/format'; import { pillarPalette_DO_NOT_USE } from '../lib/pillars'; import type { TagType } from '../types/tag'; diff --git a/dotcom-rendering/src/components/SeriesSectionLink.tsx b/dotcom-rendering/src/components/SeriesSectionLink.tsx index 5b33937a47d..f67670896ab 100644 --- a/dotcom-rendering/src/components/SeriesSectionLink.tsx +++ b/dotcom-rendering/src/components/SeriesSectionLink.tsx @@ -1,10 +1,4 @@ import { css } from '@emotion/react'; -import { - ArticleDesign, - ArticleDisplay, - type ArticleFormat, - ArticleSpecial, -} from '@guardian/libs'; import { from, headlineBold17, @@ -17,6 +11,12 @@ import { until, } from '@guardian/source/foundations'; import { interactiveLegacyClasses } from '../layouts/lib/interactiveLegacyStyling'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, + ArticleSpecial, +} from '../lib/format'; import { palette as themePalette } from '../palette'; import type { TagType } from '../types/tag'; import { Hide } from './Hide'; diff --git a/dotcom-rendering/src/components/ShareButton.importable.tsx b/dotcom-rendering/src/components/ShareButton.importable.tsx index 0b3acae46ba..d76656227ec 100644 --- a/dotcom-rendering/src/components/ShareButton.importable.tsx +++ b/dotcom-rendering/src/components/ShareButton.importable.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; import { palette, until } from '@guardian/source/foundations'; import type { Size } from '@guardian/source/react-components'; import { @@ -9,6 +8,7 @@ import { SvgShareWeb, } from '@guardian/source/react-components'; import { useEffect, useMemo, useState } from 'react'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { transparentColour } from '../lib/transparentColour'; import { palette as themePalette } from '../palette'; diff --git a/dotcom-rendering/src/components/ShareButton.stories.tsx b/dotcom-rendering/src/components/ShareButton.stories.tsx index 2815f078bfe..0ace8bdabc7 100644 --- a/dotcom-rendering/src/components/ShareButton.stories.tsx +++ b/dotcom-rendering/src/components/ShareButton.stories.tsx @@ -1,10 +1,10 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { StoryProps } from '../../.storybook/decorators/splitThemeDecorator'; import { defaultFormats, splitTheme, } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { palette as themePalette } from '../palette'; import { CopyNativeShareButton, diff --git a/dotcom-rendering/src/components/ShareIcons.amp.tsx b/dotcom-rendering/src/components/ShareIcons.amp.tsx index 47125c7e0db..71fcb1963d4 100644 --- a/dotcom-rendering/src/components/ShareIcons.amp.tsx +++ b/dotcom-rendering/src/components/ShareIcons.amp.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { visuallyHidden } from '@guardian/source/foundations'; import React from 'react'; +import type { ArticleTheme } from '../lib/format'; import { neutralBorder, pillarMap, diff --git a/dotcom-rendering/src/components/SignedInAs.stories.tsx b/dotcom-rendering/src/components/SignedInAs.stories.tsx index fb82f775f12..47ce4a964ad 100644 --- a/dotcom-rendering/src/components/SignedInAs.stories.tsx +++ b/dotcom-rendering/src/components/SignedInAs.stories.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { SignedInAs } from './SignedInAs'; const aUser = { diff --git a/dotcom-rendering/src/components/SpotifyBlockComponent.importable.tsx b/dotcom-rendering/src/components/SpotifyBlockComponent.importable.tsx index 85f7d6f4a0a..b68c1f104ec 100644 --- a/dotcom-rendering/src/components/SpotifyBlockComponent.importable.tsx +++ b/dotcom-rendering/src/components/SpotifyBlockComponent.importable.tsx @@ -1,5 +1,6 @@ import { css } from '@emotion/react'; -import { type ArticleFormat, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; +import type { ArticleFormat } from '../lib/format'; import type { RoleType } from '../types/content'; import { Caption } from './Caption'; import { ClickToView } from './ClickToView'; diff --git a/dotcom-rendering/src/components/Standfirst.amp.tsx b/dotcom-rendering/src/components/Standfirst.amp.tsx index 94c37fc966d..ec96925dd72 100644 --- a/dotcom-rendering/src/components/Standfirst.amp.tsx +++ b/dotcom-rendering/src/components/Standfirst.amp.tsx @@ -1,11 +1,10 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; -import { ArticleSpecial } from '@guardian/libs'; import { headlineMedium17, palette, textSans20, } from '@guardian/source/foundations'; +import { ArticleSpecial, type ArticleTheme } from '../lib/format'; import { neutralBorder, pillarPalette_DO_NOT_USE } from '../lib/pillars'; const ListStyle = (iconColour: string) => css` diff --git a/dotcom-rendering/src/components/Standfirst.stories.tsx b/dotcom-rendering/src/components/Standfirst.stories.tsx index 782a453c8db..beb1e656e78 100644 --- a/dotcom-rendering/src/components/Standfirst.stories.tsx +++ b/dotcom-rendering/src/components/Standfirst.stories.tsx @@ -1,13 +1,13 @@ +import { palette as sourcePalette } from '@guardian/source/foundations'; +import type { StoryObj } from '@storybook/react'; +import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import { palette as sourcePalette } from '@guardian/source/foundations'; -import type { StoryObj } from '@storybook/react'; -import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +} from '../lib/format'; import { Section } from './Section'; import { Standfirst } from './Standfirst'; diff --git a/dotcom-rendering/src/components/Standfirst.test.tsx b/dotcom-rendering/src/components/Standfirst.test.tsx index 39c06254a44..e0b14d542d4 100644 --- a/dotcom-rendering/src/components/Standfirst.test.tsx +++ b/dotcom-rendering/src/components/Standfirst.test.tsx @@ -1,6 +1,6 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { render } from '@testing-library/react'; import { interactiveLegacyClasses } from '../layouts/lib/interactiveLegacyStyling'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { Standfirst } from './Standfirst'; describe('Standfirst', () => { diff --git a/dotcom-rendering/src/components/Standfirst.tsx b/dotcom-rendering/src/components/Standfirst.tsx index 1707fdd6bbb..a7dc40caf5c 100644 --- a/dotcom-rendering/src/components/Standfirst.tsx +++ b/dotcom-rendering/src/components/Standfirst.tsx @@ -1,10 +1,4 @@ import { css } from '@emotion/react'; -import { - ArticleDesign, - ArticleDisplay, - type ArticleFormat, - ArticleSpecial, -} from '@guardian/libs'; import { from, headlineLight17, @@ -20,6 +14,12 @@ import { } from '@guardian/source/foundations'; import sanitise from 'sanitize-html'; import { interactiveLegacyClasses } from '../layouts/lib/interactiveLegacyStyling'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, + ArticleSpecial, +} from '../lib/format'; import { palette } from '../palette'; type Props = { diff --git a/dotcom-rendering/src/components/StarRatingBlockComponent.stories.tsx b/dotcom-rendering/src/components/StarRatingBlockComponent.stories.tsx index 63d62222f90..f0f0003da9c 100644 --- a/dotcom-rendering/src/components/StarRatingBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/StarRatingBlockComponent.stories.tsx @@ -1,10 +1,10 @@ +import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, Pillar, -} from '@guardian/libs'; -import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +} from '../lib/format'; import { StarRatingBlockComponent } from './StarRatingBlockComponent'; const articleFormat: ArticleFormat = { diff --git a/dotcom-rendering/src/components/SubMeta.amp.tsx b/dotcom-rendering/src/components/SubMeta.amp.tsx index f8707d26f73..f9349573f33 100644 --- a/dotcom-rendering/src/components/SubMeta.amp.tsx +++ b/dotcom-rendering/src/components/SubMeta.amp.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { article17, palette, @@ -7,6 +6,7 @@ import { textSans12, textSans15, } from '@guardian/source/foundations'; +import type { ArticleTheme } from '../lib/format'; import { neutralBorder, pillarPalette_DO_NOT_USE } from '../lib/pillars'; import type { BaseLinkType } from '../model/extract-nav'; import CommentIcon from '../static/icons/comment.svg'; diff --git a/dotcom-rendering/src/components/SubMeta.stories.tsx b/dotcom-rendering/src/components/SubMeta.stories.tsx index 2aefcb6b92d..f3745ece3c0 100644 --- a/dotcom-rendering/src/components/SubMeta.stories.tsx +++ b/dotcom-rendering/src/components/SubMeta.stories.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay } from '@guardian/libs'; import type { StoryProps } from '../../.storybook/decorators/splitThemeDecorator'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay } from '../lib/format'; import { getAllThemes } from '../lib/format'; import { SubMeta } from './SubMeta'; diff --git a/dotcom-rendering/src/components/SubMeta.tsx b/dotcom-rendering/src/components/SubMeta.tsx index d82c316eed6..dc583b8c6fa 100644 --- a/dotcom-rendering/src/components/SubMeta.tsx +++ b/dotcom-rendering/src/components/SubMeta.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; import { from, space, @@ -8,6 +7,7 @@ import { until, } from '@guardian/source/foundations'; import { LinkButton } from '@guardian/source/react-components'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import type { BaseLinkType } from '../model/extract-nav'; import { palette } from '../palette'; import { Island } from './Island'; diff --git a/dotcom-rendering/src/components/Subheading.tsx b/dotcom-rendering/src/components/Subheading.tsx index 28f9120651f..185838a918e 100644 --- a/dotcom-rendering/src/components/Subheading.tsx +++ b/dotcom-rendering/src/components/Subheading.tsx @@ -1,11 +1,4 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { - ArticleDesign, - ArticleDisplay, - ArticleSpecial, - Pillar, -} from '@guardian/libs'; import { from, headlineBold24, @@ -21,6 +14,13 @@ import { textSans34, } from '@guardian/source/foundations'; import type { ReactNode } from 'react'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, + ArticleSpecial, + Pillar, +} from '../lib/format'; import { palette } from '../palette'; const fontStyles = ({ diff --git a/dotcom-rendering/src/components/SubheadingBlockComponent.amp.tsx b/dotcom-rendering/src/components/SubheadingBlockComponent.amp.tsx index 1094a127000..d2438a7f666 100644 --- a/dotcom-rendering/src/components/SubheadingBlockComponent.amp.tsx +++ b/dotcom-rendering/src/components/SubheadingBlockComponent.amp.tsx @@ -1,11 +1,11 @@ import { css } from '@emotion/react'; -import { type ArticleTheme, ArticleSpecial as Special } from '@guardian/libs'; import { headlineMedium20, headlineMedium34, palette, textSans20, } from '@guardian/source/foundations'; +import { type ArticleTheme, ArticleSpecial as Special } from '../lib/format'; import { pillarPalette_DO_NOT_USE } from '../lib/pillars'; const style = (pillar: ArticleTheme) => css` diff --git a/dotcom-rendering/src/components/SubheadingBlockComponent.stories.tsx b/dotcom-rendering/src/components/SubheadingBlockComponent.stories.tsx index e1b94d34997..ec84a429fd4 100644 --- a/dotcom-rendering/src/components/SubheadingBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/SubheadingBlockComponent.stories.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { Decorator, Meta, StoryObj } from '@storybook/react'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { getAllDesigns, getAllThemes } from '../lib/format'; import { SubheadingBlockComponent } from './SubheadingBlockComponent'; diff --git a/dotcom-rendering/src/components/SubheadingBlockComponent.tsx b/dotcom-rendering/src/components/SubheadingBlockComponent.tsx index a4d0bdffb71..c6ffb142429 100644 --- a/dotcom-rendering/src/components/SubheadingBlockComponent.tsx +++ b/dotcom-rendering/src/components/SubheadingBlockComponent.tsx @@ -1,8 +1,8 @@ import { jsx } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; import type { ReactNode } from 'react'; import { Fragment } from 'react'; import { isElement, parseHtml } from '../lib/domUtils'; +import type { ArticleFormat } from '../lib/format'; import { logger } from '../server/lib/logging'; import { Subheading } from './Subheading'; diff --git a/dotcom-rendering/src/components/SupportingContent.stories.tsx b/dotcom-rendering/src/components/SupportingContent.stories.tsx index 5ac495b7fed..6418449f2bc 100644 --- a/dotcom-rendering/src/components/SupportingContent.stories.tsx +++ b/dotcom-rendering/src/components/SupportingContent.stories.tsx @@ -1,11 +1,11 @@ import { css } from '@emotion/react'; +import { breakpoints } from '@guardian/source/foundations'; import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import { breakpoints } from '@guardian/source/foundations'; +} from '../lib/format'; import type { Props as CardProps } from './Card/Card'; import { Card } from './Card/Card'; import { SupportingContent } from './SupportingContent'; diff --git a/dotcom-rendering/src/components/SupportingContent.tsx b/dotcom-rendering/src/components/SupportingContent.tsx index ec7056347dc..a9f6d512fed 100644 --- a/dotcom-rendering/src/components/SupportingContent.tsx +++ b/dotcom-rendering/src/components/SupportingContent.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleDesign } from '@guardian/libs'; import { from, space, until } from '@guardian/source/foundations'; import { isMediaCard } from '../lib/cardHelpers'; +import { ArticleDesign } from '../lib/format'; import { palette } from '../palette'; import type { DCRContainerPalette, DCRSupportingContent } from '../types/front'; import { CardHeadline } from './CardHeadline'; diff --git a/dotcom-rendering/src/components/TableOfContents.importable.tsx b/dotcom-rendering/src/components/TableOfContents.importable.tsx index 6aea45f7cb1..531e92dafcf 100644 --- a/dotcom-rendering/src/components/TableOfContents.importable.tsx +++ b/dotcom-rendering/src/components/TableOfContents.importable.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import { ArticleDisplay, type ArticleFormat } from '@guardian/libs'; import { headlineBold17, headlineLight17, @@ -11,6 +10,7 @@ import { SvgChevronUpSingle, } from '@guardian/source/react-components'; import { useState } from 'react'; +import { ArticleDisplay, type ArticleFormat } from '../lib/format'; import { palette } from '../palette'; import type { TableOfContentsItem } from '../types/article'; diff --git a/dotcom-rendering/src/components/TableOfContents.stories.tsx b/dotcom-rendering/src/components/TableOfContents.stories.tsx index 4fcefe30f0b..59443b0398d 100644 --- a/dotcom-rendering/src/components/TableOfContents.stories.tsx +++ b/dotcom-rendering/src/components/TableOfContents.stories.tsx @@ -1,12 +1,12 @@ import { css } from '@emotion/react'; +import type { StoryObj } from '@storybook/react'; +import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, type ArticleFormat, Pillar, -} from '@guardian/libs'; -import type { StoryObj } from '@storybook/react'; -import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +} from '../lib/format'; import type { TableOfContentsItem } from '../types/article'; import { TableOfContents } from './TableOfContents.importable'; diff --git a/dotcom-rendering/src/components/TagPage.tsx b/dotcom-rendering/src/components/TagPage.tsx index 383df22bb38..09cdd49c2d6 100644 --- a/dotcom-rendering/src/components/TagPage.tsx +++ b/dotcom-rendering/src/components/TagPage.tsx @@ -1,8 +1,8 @@ import { Global } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { StrictMode } from 'react'; import { TagPageLayout } from '../layouts/TagPageLayout'; import { buildAdTargeting } from '../lib/ad-targeting'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { rootStyles } from '../lib/rootStyles'; import { filterABTestSwitches } from '../model/enhance-switches'; import type { NavType } from '../model/extract-nav'; diff --git a/dotcom-rendering/src/components/TextBlockComponent.amp.tsx b/dotcom-rendering/src/components/TextBlockComponent.amp.tsx index 017985f034c..ff347e49216 100644 --- a/dotcom-rendering/src/components/TextBlockComponent.amp.tsx +++ b/dotcom-rendering/src/components/TextBlockComponent.amp.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleSpecial, type ArticleTheme } from '@guardian/libs'; import { article17, palette, textSans20 } from '@guardian/source/foundations'; import sanitise from 'sanitize-html'; +import { ArticleSpecial, type ArticleTheme } from '../lib/format'; import { neutralBorder, pillarPalette_DO_NOT_USE } from '../lib/pillars'; // Note, this should only apply basic text styling. It is a case where we want diff --git a/dotcom-rendering/src/components/TextBlockComponent.stories.tsx b/dotcom-rendering/src/components/TextBlockComponent.stories.tsx index 9adfc6b2110..e21b77f4342 100644 --- a/dotcom-rendering/src/components/TextBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/TextBlockComponent.stories.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { TextBlockComponent } from './TextBlockComponent'; const html = diff --git a/dotcom-rendering/src/components/TextBlockComponent.tsx b/dotcom-rendering/src/components/TextBlockComponent.tsx index c6c576ef825..7531501038e 100644 --- a/dotcom-rendering/src/components/TextBlockComponent.tsx +++ b/dotcom-rendering/src/components/TextBlockComponent.tsx @@ -1,6 +1,4 @@ import { css, jsx } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, ArticleDisplay, ArticleSpecial } from '@guardian/libs'; import { article17, from, @@ -15,6 +13,12 @@ import type { IOptions } from 'sanitize-html'; import sanitise from 'sanitize-html'; import { decidePalette } from '../lib/decidePalette'; import { getAttrs, isElement, parseHtml } from '../lib/domUtils'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, + ArticleSpecial, +} from '../lib/format'; import { palette as themePalette } from '../palette'; import { logger } from '../server/lib/logging'; import { DropCap } from './DropCap'; diff --git a/dotcom-rendering/src/components/Timeline.stories.tsx b/dotcom-rendering/src/components/Timeline.stories.tsx index 24d92b461cb..db38822ddbf 100644 --- a/dotcom-rendering/src/components/Timeline.stories.tsx +++ b/dotcom-rendering/src/components/Timeline.stories.tsx @@ -1,9 +1,13 @@ -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { Meta, StoryObj } from '@storybook/react'; import { centreColumnDecorator } from '../../.storybook/decorators/gridDecorators'; import { allModes } from '../../.storybook/modes'; import { images } from '../../fixtures/generated/images'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, + Pillar, +} from '../lib/format'; import { getNestedArticleElement } from '../lib/renderElement'; import type { TextBlockElement, YoutubeBlockElement } from '../types/content'; import { Timeline } from './Timeline'; diff --git a/dotcom-rendering/src/components/Timeline.tsx b/dotcom-rendering/src/components/Timeline.tsx index 2c3f9c8f506..cebe1e17605 100644 --- a/dotcom-rendering/src/components/Timeline.tsx +++ b/dotcom-rendering/src/components/Timeline.tsx @@ -1,5 +1,5 @@ import { css, type SerializedStyles } from '@emotion/react'; -import { ArticleDesign, type ArticleFormat, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { between, from, @@ -12,6 +12,7 @@ import { textSansBold15, textSansBold17, } from '@guardian/source/foundations'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import type { NestedArticleElement } from '../lib/renderElement'; import { palette } from '../palette'; import type { diff --git a/dotcom-rendering/src/components/TimelineAtom.amp.tsx b/dotcom-rendering/src/components/TimelineAtom.amp.tsx index e63a8b13d23..a01176b64ff 100644 --- a/dotcom-rendering/src/components/TimelineAtom.amp.tsx +++ b/dotcom-rendering/src/components/TimelineAtom.amp.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { palette } from '@guardian/source/foundations'; +import type { ArticleTheme } from '../lib/format'; import type { TimelineAtomEvent } from '../types/content'; import { Expandable } from './Expandable.amp'; diff --git a/dotcom-rendering/src/components/TimelineAtom.stories.tsx b/dotcom-rendering/src/components/TimelineAtom.stories.tsx index c9d474e5cae..1ab9acb4c7e 100644 --- a/dotcom-rendering/src/components/TimelineAtom.stories.tsx +++ b/dotcom-rendering/src/components/TimelineAtom.stories.tsx @@ -1,4 +1,3 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { Meta, StoryObj } from '@storybook/react'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { @@ -7,6 +6,7 @@ import { noTimelineEventsStoryExpanded, sportTimelineStoryWithDescriptionAndEventsExpanded, } from '../../fixtures/manual/timelineAtom'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { TimelineAtom as TimelineAtomComponent } from './TimelineAtom.importable'; const meta: Meta = { diff --git a/dotcom-rendering/src/components/Toast.stories.tsx b/dotcom-rendering/src/components/Toast.stories.tsx index 66c43493bc7..2a2af6a1b68 100644 --- a/dotcom-rendering/src/components/Toast.stories.tsx +++ b/dotcom-rendering/src/components/Toast.stories.tsx @@ -1,11 +1,11 @@ import { css } from '@emotion/react'; +import { breakpoints } from '@guardian/source/foundations'; import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar, -} from '@guardian/libs'; -import { breakpoints } from '@guardian/source/foundations'; +} from '../lib/format'; import { Toast } from './Toast'; const Wrapper = ({ children }: { children: React.ReactNode }) => ( diff --git a/dotcom-rendering/src/components/Toast.tsx b/dotcom-rendering/src/components/Toast.tsx index efd61f47376..748449eb121 100644 --- a/dotcom-rendering/src/components/Toast.tsx +++ b/dotcom-rendering/src/components/Toast.tsx @@ -1,8 +1,8 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; import { space } from '@guardian/source/foundations'; import { Hide } from '@guardian/source/react-components'; import { EditorialButton } from '@guardian/source-development-kitchen/react-components'; +import type { ArticleFormat } from '../lib/format'; type Props = { count: number; diff --git a/dotcom-rendering/src/components/TopMeta.amp.tsx b/dotcom-rendering/src/components/TopMeta.amp.tsx index 01214ed5b78..0c6dd2f62ac 100644 --- a/dotcom-rendering/src/components/TopMeta.amp.tsx +++ b/dotcom-rendering/src/components/TopMeta.amp.tsx @@ -2,7 +2,7 @@ import { ArticleDesign, ArticleSpecial, type ArticleTheme, -} from '@guardian/libs'; +} from '../lib/format'; import type { AMPArticleModel } from '../types/article.amp'; import { TopMetaAnalysis } from './TopMetaAnalysis.amp'; import { TopMetaNews } from './TopMetaNews.amp'; diff --git a/dotcom-rendering/src/components/TopMetaAnalysis.amp.tsx b/dotcom-rendering/src/components/TopMetaAnalysis.amp.tsx index b70482233d6..9f0791a3776 100644 --- a/dotcom-rendering/src/components/TopMetaAnalysis.amp.tsx +++ b/dotcom-rendering/src/components/TopMetaAnalysis.amp.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import { type ArticleTheme, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { headlineMedium17, headlineMedium28, @@ -8,6 +8,7 @@ import { } from '@guardian/source/foundations'; import { string as curly } from 'curlyquotes'; import { getAgeWarning } from '../lib/age-warning'; +import type { ArticleTheme } from '../lib/format'; import { pillarPalette_DO_NOT_USE } from '../lib/pillars'; import { getSharingUrls } from '../lib/sharing-urls'; import type { AMPArticleModel } from '../types/article.amp'; diff --git a/dotcom-rendering/src/components/TopMetaExtras.amp.tsx b/dotcom-rendering/src/components/TopMetaExtras.amp.tsx index 780a29acf42..668b302fc28 100644 --- a/dotcom-rendering/src/components/TopMetaExtras.amp.tsx +++ b/dotcom-rendering/src/components/TopMetaExtras.amp.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { text, textSans12 } from '@guardian/source/foundations'; +import type { ArticleTheme } from '../lib/format'; import { neutralBorder, pillarMap, diff --git a/dotcom-rendering/src/components/TopMetaLiveblog.amp.tsx b/dotcom-rendering/src/components/TopMetaLiveblog.amp.tsx index 098f240094d..68af5894efd 100644 --- a/dotcom-rendering/src/components/TopMetaLiveblog.amp.tsx +++ b/dotcom-rendering/src/components/TopMetaLiveblog.amp.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { headlineMedium17, headlineMedium28, @@ -7,6 +6,7 @@ import { } from '@guardian/source/foundations'; import { string as curly } from 'curlyquotes'; import { getAgeWarning } from '../lib/age-warning'; +import type { ArticleTheme } from '../lib/format'; import { neutralBorder, pillarPalette_DO_NOT_USE } from '../lib/pillars'; import { getSharingUrls } from '../lib/sharing-urls'; import type { AMPArticleModel } from '../types/article.amp'; diff --git a/dotcom-rendering/src/components/TopMetaNews.amp.tsx b/dotcom-rendering/src/components/TopMetaNews.amp.tsx index fc397b1e5da..4e120c50189 100644 --- a/dotcom-rendering/src/components/TopMetaNews.amp.tsx +++ b/dotcom-rendering/src/components/TopMetaNews.amp.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import { type ArticleTheme, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { headlineMedium17, headlineMedium28, @@ -7,6 +7,7 @@ import { } from '@guardian/source/foundations'; import { string as curly } from 'curlyquotes'; import { getAgeWarning } from '../lib/age-warning'; +import type { ArticleTheme } from '../lib/format'; import { pillarPalette_DO_NOT_USE } from '../lib/pillars'; import { getSharingUrls } from '../lib/sharing-urls'; import type { AMPArticleModel } from '../types/article.amp'; diff --git a/dotcom-rendering/src/components/TopMetaOpinion.amp.tsx b/dotcom-rendering/src/components/TopMetaOpinion.amp.tsx index 830151d1f8e..caff95b828e 100644 --- a/dotcom-rendering/src/components/TopMetaOpinion.amp.tsx +++ b/dotcom-rendering/src/components/TopMetaOpinion.amp.tsx @@ -1,7 +1,8 @@ import { css } from '@emotion/react'; -import { type ArticleTheme, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { headlineMedium28, palette } from '@guardian/source/foundations'; import { getAgeWarning } from '../lib/age-warning'; +import type { ArticleTheme } from '../lib/format'; import { pillarPalette_DO_NOT_USE } from '../lib/pillars'; import { getSharingUrls } from '../lib/sharing-urls'; import type { AMPArticleModel } from '../types/article.amp'; diff --git a/dotcom-rendering/src/components/TopMetaPaidContent.amp.tsx b/dotcom-rendering/src/components/TopMetaPaidContent.amp.tsx index 5f0f1f929ce..adeeec8a602 100644 --- a/dotcom-rendering/src/components/TopMetaPaidContent.amp.tsx +++ b/dotcom-rendering/src/components/TopMetaPaidContent.amp.tsx @@ -1,5 +1,4 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { article17, palette, @@ -8,6 +7,7 @@ import { textSans24, } from '@guardian/source/foundations'; import { getAgeWarning } from '../lib/age-warning'; +import type { ArticleTheme } from '../lib/format'; import { getSharingUrls } from '../lib/sharing-urls'; import type { AMPArticleModel } from '../types/article.amp'; import type { Branding } from '../types/branding'; diff --git a/dotcom-rendering/src/components/Treats.stories.tsx b/dotcom-rendering/src/components/Treats.stories.tsx index 2197122265d..fe171c2dbe5 100644 --- a/dotcom-rendering/src/components/Treats.stories.tsx +++ b/dotcom-rendering/src/components/Treats.stories.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import { Pillar } from '@guardian/libs'; +import { Pillar } from '../lib/format'; import { Treats } from './Treats'; export default { diff --git a/dotcom-rendering/src/components/Treats.tsx b/dotcom-rendering/src/components/Treats.tsx index 44feaef5acb..d8c63c8daae 100644 --- a/dotcom-rendering/src/components/Treats.tsx +++ b/dotcom-rendering/src/components/Treats.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { from, headlineMedium17, @@ -8,6 +8,7 @@ import { } from '@guardian/source/foundations'; import { Link } from '@guardian/source/react-components'; import { Fragment } from 'react'; +import { ArticleDesign, ArticleDisplay } from '../lib/format'; import { palette } from '../palette'; import type { TreatType } from '../types/front'; import { FormatBoundary } from './FormatBoundary'; diff --git a/dotcom-rendering/src/components/TwitterBlockComponent.amp.tsx b/dotcom-rendering/src/components/TwitterBlockComponent.amp.tsx index 7f9fdc00242..dc613555292 100644 --- a/dotcom-rendering/src/components/TwitterBlockComponent.amp.tsx +++ b/dotcom-rendering/src/components/TwitterBlockComponent.amp.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import type { ArticleTheme } from '@guardian/libs'; import { article17, palette } from '@guardian/source/foundations'; import { JSDOM } from 'jsdom'; +import type { ArticleTheme } from '../lib/format'; import { neutralBorder, pillarPalette_DO_NOT_USE } from '../lib/pillars'; import type { TweetBlockElement } from '../types/content'; diff --git a/dotcom-rendering/src/components/VideoFacebookBlockComponent.importable.tsx b/dotcom-rendering/src/components/VideoFacebookBlockComponent.importable.tsx index f538c1b162f..a48be11cc5f 100644 --- a/dotcom-rendering/src/components/VideoFacebookBlockComponent.importable.tsx +++ b/dotcom-rendering/src/components/VideoFacebookBlockComponent.importable.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; +import type { ArticleFormat } from '../lib/format'; import type { RoleType } from '../types/content'; import { Caption } from './Caption'; import { ClickToView } from './ClickToView'; diff --git a/dotcom-rendering/src/components/VideoFacebookBlockComponent.stories.tsx b/dotcom-rendering/src/components/VideoFacebookBlockComponent.stories.tsx index 3bfa9a73153..5564b393f19 100644 --- a/dotcom-rendering/src/components/VideoFacebookBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/VideoFacebookBlockComponent.stories.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { VideoFacebookBlockComponent } from './VideoFacebookBlockComponent.importable'; export default { diff --git a/dotcom-rendering/src/components/VideoVimeoBlockComponent.amp.tsx b/dotcom-rendering/src/components/VideoVimeoBlockComponent.amp.tsx index a1a6951f594..0a43f168133 100644 --- a/dotcom-rendering/src/components/VideoVimeoBlockComponent.amp.tsx +++ b/dotcom-rendering/src/components/VideoVimeoBlockComponent.amp.tsx @@ -1,5 +1,5 @@ -import type { ArticleTheme } from '@guardian/libs'; import { levels } from 'log4js'; +import type { ArticleTheme } from '../lib/format'; import { getIdFromUrl } from '../lib/get-video-id.amp'; import { logger } from '../server/lib/logging'; import type { VideoVimeoBlockElement } from '../types/content'; diff --git a/dotcom-rendering/src/components/VideoYoutubeBlockComponent.amp.tsx b/dotcom-rendering/src/components/VideoYoutubeBlockComponent.amp.tsx index b0e017e1fed..39a33d96ed6 100644 --- a/dotcom-rendering/src/components/VideoYoutubeBlockComponent.amp.tsx +++ b/dotcom-rendering/src/components/VideoYoutubeBlockComponent.amp.tsx @@ -1,5 +1,5 @@ -import type { ArticleTheme } from '@guardian/libs'; import { levels } from 'log4js'; +import type { ArticleTheme } from '../lib/format'; import { getIdFromUrl } from '../lib/get-video-id.amp'; import { logger } from '../server/lib/logging'; import type { VideoYoutubeBlockElement } from '../types/content'; diff --git a/dotcom-rendering/src/components/VimeoBlockComponent.stories.tsx b/dotcom-rendering/src/components/VimeoBlockComponent.stories.tsx index be03887f5d9..6411617f6df 100644 --- a/dotcom-rendering/src/components/VimeoBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/VimeoBlockComponent.stories.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { VimeoBlockComponent } from './VimeoBlockComponent'; export default { diff --git a/dotcom-rendering/src/components/VimeoBlockComponent.tsx b/dotcom-rendering/src/components/VimeoBlockComponent.tsx index 3bb882f7ded..95b85e4be63 100644 --- a/dotcom-rendering/src/components/VimeoBlockComponent.tsx +++ b/dotcom-rendering/src/components/VimeoBlockComponent.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; +import type { ArticleFormat } from '../lib/format'; import { Caption } from './Caption'; const responsiveAspectRatio = (height: number, width: number) => css` diff --git a/dotcom-rendering/src/components/WitnessBlockComponent.stories.tsx b/dotcom-rendering/src/components/WitnessBlockComponent.stories.tsx index 7437ec53622..ebd0eda80ff 100644 --- a/dotcom-rendering/src/components/WitnessBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/WitnessBlockComponent.stories.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import { lightDecorator } from '../../.storybook/decorators/themeDecorator'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import type { WitnessAssetType } from '../types/content'; import { WitnessImageBlockComponent, diff --git a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.stories.tsx b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.stories.tsx index c9d81ed3660..4c8bfd7ec84 100644 --- a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.stories.tsx +++ b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.stories.tsx @@ -1,8 +1,8 @@ import { css } from '@emotion/react'; import type { ConsentState } from '@guardian/libs'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import type { Decorator, Meta, StoryObj } from '@storybook/react'; import { useState } from 'react'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import type { ImagePositionType, ImageSizeType, diff --git a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.test.tsx b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.test.tsx index 3c94ee46fb2..6cb38b91f13 100644 --- a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.test.tsx +++ b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.test.tsx @@ -1,7 +1,7 @@ import type { ConsentState } from '@guardian/libs'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; import '@testing-library/jest-dom'; import { fireEvent, render } from '@testing-library/react'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../../lib/format'; import { ConfigProvider } from '../ConfigContext'; import { YoutubeAtom } from './YoutubeAtom'; diff --git a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.tsx b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.tsx index a50a21a6738..8559d80cb67 100644 --- a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.tsx +++ b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.tsx @@ -1,6 +1,7 @@ import type { Participations } from '@guardian/ab-core'; -import type { ArticleFormat, ConsentState } from '@guardian/libs'; +import type { ConsentState } from '@guardian/libs'; import { useCallback, useState } from 'react'; +import type { ArticleFormat } from '../../lib/format'; import type { RenderingTarget } from '../../types/renderingTarget'; import type { ImagePositionType, diff --git a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomExpiredOverlay.tsx b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomExpiredOverlay.tsx index b70fe4a3c59..94a1cc84c9f 100644 --- a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomExpiredOverlay.tsx +++ b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomExpiredOverlay.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; import { palette, space, textEgyptian17 } from '@guardian/source/foundations'; import { SvgAlertRound } from '@guardian/source/react-components'; +import type { ArticleFormat } from '../../lib/format'; import { Caption } from '../Caption'; type Props = { diff --git a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomOverlay.tsx b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomOverlay.tsx index 815f118b9a1..c61988bf074 100644 --- a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomOverlay.tsx +++ b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomOverlay.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import { type ArticleFormat, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { from, headlineMedium17, @@ -8,6 +8,7 @@ import { space, textSansBold12, } from '@guardian/source/foundations'; +import type { ArticleFormat } from '../../lib/format'; import { palette } from '../../palette'; import type { ImagePositionType, diff --git a/dotcom-rendering/src/components/YoutubeBlockComponent.amp.tsx b/dotcom-rendering/src/components/YoutubeBlockComponent.amp.tsx index aa34ed0b938..e0ac004a5db 100644 --- a/dotcom-rendering/src/components/YoutubeBlockComponent.amp.tsx +++ b/dotcom-rendering/src/components/YoutubeBlockComponent.amp.tsx @@ -1,4 +1,4 @@ -import type { ArticleTheme } from '@guardian/libs'; +import type { ArticleTheme } from '../lib/format'; import { constructQuery } from '../lib/querystring'; import type { YoutubeBlockElement } from '../types/content'; import { Caption } from './Caption.amp'; diff --git a/dotcom-rendering/src/components/YoutubeBlockComponent.importable.tsx b/dotcom-rendering/src/components/YoutubeBlockComponent.importable.tsx index 45bb3991998..24423b4676a 100644 --- a/dotcom-rendering/src/components/YoutubeBlockComponent.importable.tsx +++ b/dotcom-rendering/src/components/YoutubeBlockComponent.importable.tsx @@ -1,5 +1,6 @@ -import { type ArticleFormat, type ConsentState } from '@guardian/libs'; +import type { ConsentState } from '@guardian/libs'; import { useEffect, useState } from 'react'; +import type { ArticleFormat } from '../lib/format'; import { useAB } from '../lib/useAB'; import { useAdTargeting } from '../lib/useAdTargeting'; import { Caption } from './Caption'; diff --git a/dotcom-rendering/src/components/YoutubeBlockComponent.stories.tsx b/dotcom-rendering/src/components/YoutubeBlockComponent.stories.tsx index 1e71bda31a6..87bf90e5b1c 100644 --- a/dotcom-rendering/src/components/YoutubeBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/YoutubeBlockComponent.stories.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { Flex } from './Flex'; import { LeftColumn } from './LeftColumn'; import { RightColumn } from './RightColumn'; diff --git a/dotcom-rendering/src/components/YoutubeEmbedBlockComponent.stories.tsx b/dotcom-rendering/src/components/YoutubeEmbedBlockComponent.stories.tsx index 006965f8914..6806015b350 100644 --- a/dotcom-rendering/src/components/YoutubeEmbedBlockComponent.stories.tsx +++ b/dotcom-rendering/src/components/YoutubeEmbedBlockComponent.stories.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { YoutubeEmbedBlockComponent } from './YoutubeEmbedBlockComponent'; export default { diff --git a/dotcom-rendering/src/components/YoutubeEmbedBlockComponent.tsx b/dotcom-rendering/src/components/YoutubeEmbedBlockComponent.tsx index 77ba908479f..26a782e4356 100644 --- a/dotcom-rendering/src/components/YoutubeEmbedBlockComponent.tsx +++ b/dotcom-rendering/src/components/YoutubeEmbedBlockComponent.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; +import type { ArticleFormat } from '../lib/format'; import { Caption } from './Caption'; import { MaintainAspectRatio } from './MaintainAspectRatio'; diff --git a/dotcom-rendering/src/layouts/CommentLayout.tsx b/dotcom-rendering/src/layouts/CommentLayout.tsx index efd394466e1..11830384a8e 100644 --- a/dotcom-rendering/src/layouts/CommentLayout.tsx +++ b/dotcom-rendering/src/layouts/CommentLayout.tsx @@ -1,6 +1,5 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, ArticleDisplay, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { from, palette as sourcePalette, @@ -43,6 +42,11 @@ import { getSoleContributor } from '../lib/byline'; import { canRenderAds } from '../lib/canRenderAds'; import { getContributionsServiceUrl } from '../lib/contributions'; import { decideTrail } from '../lib/decideTrail'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, +} from '../lib/format'; import { parse } from '../lib/slot-machine-flags'; import type { NavType } from '../model/extract-nav'; import { palette as themePalette } from '../palette'; diff --git a/dotcom-rendering/src/layouts/DecideLayout.stories.tsx b/dotcom-rendering/src/layouts/DecideLayout.stories.tsx index 2bc3bc4e298..a88187657d9 100644 --- a/dotcom-rendering/src/layouts/DecideLayout.stories.tsx +++ b/dotcom-rendering/src/layouts/DecideLayout.stories.tsx @@ -1,4 +1,4 @@ -import { type ArticleFormat, isObject } from '@guardian/libs'; +import { isObject } from '@guardian/libs'; import { breakpoints } from '@guardian/source/foundations'; import type { Decorator, StoryObj } from '@storybook/react'; import { useEffect } from 'react'; @@ -16,6 +16,7 @@ import { Standard as StandardStandardNewsFixture } from '../../fixtures/generate import { Video as VideoStandardNewsFixture } from '../../fixtures/generated/dcr-articles/Video'; import { embedIframe } from '../client/embedIframe'; import { decideFormat } from '../lib/decideFormat'; +import type { ArticleFormat } from '../lib/format'; import { getCurrentPillar } from '../lib/layoutHelpers'; import { mockRESTCalls } from '../lib/mockRESTCalls'; import { extractNAV } from '../model/extract-nav'; diff --git a/dotcom-rendering/src/layouts/DecideLayout.tsx b/dotcom-rendering/src/layouts/DecideLayout.tsx index b55d84fdcc0..e4b09f751a9 100644 --- a/dotcom-rendering/src/layouts/DecideLayout.tsx +++ b/dotcom-rendering/src/layouts/DecideLayout.tsx @@ -1,5 +1,8 @@ -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, ArticleDisplay } from '@guardian/libs'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, +} from '../lib/format'; import type { NavType } from '../model/extract-nav'; import type { ArticleDeprecated } from '../types/article'; import type { RenderingTarget } from '../types/renderingTarget'; diff --git a/dotcom-rendering/src/layouts/FrontLayout.tsx b/dotcom-rendering/src/layouts/FrontLayout.tsx index 3e7b0c8599b..a3e52602721 100644 --- a/dotcom-rendering/src/layouts/FrontLayout.tsx +++ b/dotcom-rendering/src/layouts/FrontLayout.tsx @@ -1,4 +1,4 @@ -import { ArticleDisplay, isOneOf } from '@guardian/libs'; +import { isOneOf } from '@guardian/libs'; import { background, brandBackground, @@ -35,6 +35,7 @@ import { badgeFromBranding, isPaidContentSameBranding } from '../lib/branding'; import { canRenderAds } from '../lib/canRenderAds'; import { getContributionsServiceUrl } from '../lib/contributions'; import { editionList } from '../lib/edition'; +import { ArticleDisplay } from '../lib/format'; import { getFrontsBannerAdPositions, getMobileAdPositions, diff --git a/dotcom-rendering/src/layouts/FullPageInteractiveLayout.tsx b/dotcom-rendering/src/layouts/FullPageInteractiveLayout.tsx index 37036310b03..1f09c270d90 100644 --- a/dotcom-rendering/src/layouts/FullPageInteractiveLayout.tsx +++ b/dotcom-rendering/src/layouts/FullPageInteractiveLayout.tsx @@ -1,6 +1,4 @@ import { css, Global } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleSpecial } from '@guardian/libs'; import { from, palette as sourcePalette, @@ -20,6 +18,7 @@ import { StickyBottomBanner } from '../components/StickyBottomBanner.importable' import { SubNav } from '../components/SubNav.importable'; import { canRenderAds } from '../lib/canRenderAds'; import type { EditionId } from '../lib/edition'; +import { type ArticleFormat, ArticleSpecial } from '../lib/format'; import { getZIndex } from '../lib/getZIndex'; import { decideLanguage, decideLanguageDirection } from '../lib/lang'; import { renderElement } from '../lib/renderElement'; diff --git a/dotcom-rendering/src/layouts/ImmersiveLayout.tsx b/dotcom-rendering/src/layouts/ImmersiveLayout.tsx index 1432e779cb6..c86f6070132 100644 --- a/dotcom-rendering/src/layouts/ImmersiveLayout.tsx +++ b/dotcom-rendering/src/layouts/ImmersiveLayout.tsx @@ -1,6 +1,5 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, ArticleSpecial, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { from, palette as sourcePalette, @@ -48,6 +47,11 @@ import { canRenderAds } from '../lib/canRenderAds'; import { getContributionsServiceUrl } from '../lib/contributions'; import { decideMainMediaCaption } from '../lib/decide-caption'; import { decideTrail } from '../lib/decideTrail'; +import { + ArticleDesign, + type ArticleFormat, + ArticleSpecial, +} from '../lib/format'; import { getZIndex } from '../lib/getZIndex'; import { LABS_HEADER_HEIGHT } from '../lib/labs-constants'; import { parse } from '../lib/slot-machine-flags'; diff --git a/dotcom-rendering/src/layouts/InteractiveLayout.tsx b/dotcom-rendering/src/layouts/InteractiveLayout.tsx index d418ddf35c4..0247ef6dab9 100644 --- a/dotcom-rendering/src/layouts/InteractiveLayout.tsx +++ b/dotcom-rendering/src/layouts/InteractiveLayout.tsx @@ -1,6 +1,5 @@ import { css, Global } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleSpecial, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { from, palette as sourcePalette, @@ -43,6 +42,7 @@ import { SubNav } from '../components/SubNav.importable'; import { canRenderAds } from '../lib/canRenderAds'; import { getContributionsServiceUrl } from '../lib/contributions'; import { decideTrail } from '../lib/decideTrail'; +import { type ArticleFormat, ArticleSpecial } from '../lib/format'; import type { NavType } from '../model/extract-nav'; import { palette as themePalette } from '../palette'; import type { ArticleDeprecated } from '../types/article'; diff --git a/dotcom-rendering/src/layouts/LiveLayout.tsx b/dotcom-rendering/src/layouts/LiveLayout.tsx index 0be8ef6e0e3..d7252c7aada 100644 --- a/dotcom-rendering/src/layouts/LiveLayout.tsx +++ b/dotcom-rendering/src/layouts/LiveLayout.tsx @@ -1,6 +1,5 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { from, palette as sourcePalette, @@ -53,6 +52,7 @@ import { SubNav } from '../components/SubNav.importable'; import { canRenderAds } from '../lib/canRenderAds'; import { getContributionsServiceUrl } from '../lib/contributions'; import { decideTrail } from '../lib/decideTrail'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { getZIndex } from '../lib/getZIndex'; import type { NavType } from '../model/extract-nav'; import { palette as themePalette } from '../palette'; diff --git a/dotcom-rendering/src/layouts/NewsletterSignupLayout.tsx b/dotcom-rendering/src/layouts/NewsletterSignupLayout.tsx index 8d0b0a4a502..0a177dae3d7 100644 --- a/dotcom-rendering/src/layouts/NewsletterSignupLayout.tsx +++ b/dotcom-rendering/src/layouts/NewsletterSignupLayout.tsx @@ -1,7 +1,5 @@ import type { SerializedStyles } from '@emotion/react'; import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDisplay } from '@guardian/libs'; import { from, palette as sourcePalette, @@ -38,6 +36,7 @@ import { Standfirst } from '../components/Standfirst'; import { canRenderAds } from '../lib/canRenderAds'; import { getContributionsServiceUrl } from '../lib/contributions'; import { decideTrail } from '../lib/decideTrail'; +import { ArticleDisplay, type ArticleFormat } from '../lib/format'; import { isValidUrl } from '../lib/isValidUrl'; import type { NavType } from '../model/extract-nav'; import type { ArticleDeprecated } from '../types/article'; diff --git a/dotcom-rendering/src/layouts/PictureLayout.tsx b/dotcom-rendering/src/layouts/PictureLayout.tsx index 16a7d949cdf..5aa392f5dfb 100644 --- a/dotcom-rendering/src/layouts/PictureLayout.tsx +++ b/dotcom-rendering/src/layouts/PictureLayout.tsx @@ -1,6 +1,5 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { from, palette as sourcePalette, @@ -40,6 +39,7 @@ import { getSoleContributor } from '../lib/byline'; import { canRenderAds } from '../lib/canRenderAds'; import { getContributionsServiceUrl } from '../lib/contributions'; import { decideTrail } from '../lib/decideTrail'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { decideLanguage, decideLanguageDirection } from '../lib/lang'; import type { NavType } from '../model/extract-nav'; import { palette as themePalette } from '../palette'; diff --git a/dotcom-rendering/src/layouts/ShowcaseLayout.tsx b/dotcom-rendering/src/layouts/ShowcaseLayout.tsx index 23e5d6ce263..4d096827451 100644 --- a/dotcom-rendering/src/layouts/ShowcaseLayout.tsx +++ b/dotcom-rendering/src/layouts/ShowcaseLayout.tsx @@ -1,6 +1,5 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, ArticleSpecial, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { from, palette as sourcePalette, @@ -44,6 +43,11 @@ import { SubNav } from '../components/SubNav.importable'; import { canRenderAds } from '../lib/canRenderAds'; import { getContributionsServiceUrl } from '../lib/contributions'; import { decideTrail } from '../lib/decideTrail'; +import { + ArticleDesign, + type ArticleFormat, + ArticleSpecial, +} from '../lib/format'; import { decideLanguage, decideLanguageDirection } from '../lib/lang'; import { parse } from '../lib/slot-machine-flags'; import type { NavType } from '../model/extract-nav'; diff --git a/dotcom-rendering/src/layouts/StandardLayout.tsx b/dotcom-rendering/src/layouts/StandardLayout.tsx index d4b64d37eb3..eec11389b53 100644 --- a/dotcom-rendering/src/layouts/StandardLayout.tsx +++ b/dotcom-rendering/src/layouts/StandardLayout.tsx @@ -1,6 +1,5 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, ArticleSpecial, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { from, palette as sourcePalette, @@ -50,6 +49,11 @@ import { SubNav } from '../components/SubNav.importable'; import { canRenderAds } from '../lib/canRenderAds'; import { getContributionsServiceUrl } from '../lib/contributions'; import { decideTrail } from '../lib/decideTrail'; +import { + ArticleDesign, + type ArticleFormat, + ArticleSpecial, +} from '../lib/format'; import { parse } from '../lib/slot-machine-flags'; import type { NavType } from '../model/extract-nav'; import { palette as themePalette } from '../palette'; diff --git a/dotcom-rendering/src/layouts/lib/interactiveLegacyStyling.ts b/dotcom-rendering/src/layouts/lib/interactiveLegacyStyling.ts index 33dd2434d34..85e17a934d5 100644 --- a/dotcom-rendering/src/layouts/lib/interactiveLegacyStyling.ts +++ b/dotcom-rendering/src/layouts/lib/interactiveLegacyStyling.ts @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; -import { ArticleDesign } from '@guardian/libs'; import { from, until } from '@guardian/source/foundations'; import { center } from '../../lib/center'; +import { ArticleDesign } from '../../lib/format'; import type { RoleType } from '../../types/content'; export const isInteractive = (design: ArticleDesign): boolean => diff --git a/dotcom-rendering/src/lib/ArticleRenderer.tsx b/dotcom-rendering/src/lib/ArticleRenderer.tsx index 413f434d89f..c9964f8991a 100644 --- a/dotcom-rendering/src/lib/ArticleRenderer.tsx +++ b/dotcom-rendering/src/lib/ArticleRenderer.tsx @@ -1,9 +1,8 @@ import { css } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign } from '@guardian/libs'; import { adContainerStyles } from '../components/AdSlot.web'; import { useConfig } from '../components/ConfigContext'; import { interactiveLegacyClasses } from '../layouts/lib/interactiveLegacyStyling'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import type { ServerSideTests, Switches } from '../types/config'; import type { FEElement } from '../types/content'; import type { TagType } from '../types/tag'; diff --git a/dotcom-rendering/src/lib/cardHelpers.test.ts b/dotcom-rendering/src/lib/cardHelpers.test.ts index a3403c1e5cf..86f13058cfb 100644 --- a/dotcom-rendering/src/lib/cardHelpers.test.ts +++ b/dotcom-rendering/src/lib/cardHelpers.test.ts @@ -3,7 +3,7 @@ import { ArticleDisplay, type ArticleFormat, Pillar, -} from '@guardian/libs'; +} from '../lib/format'; import type { DCRContainerPalette } from '../types/front'; import { cardHasDarkBackground } from './cardHelpers'; diff --git a/dotcom-rendering/src/lib/cardHelpers.ts b/dotcom-rendering/src/lib/cardHelpers.ts index ba1248df5e5..5cd018073bb 100644 --- a/dotcom-rendering/src/lib/cardHelpers.ts +++ b/dotcom-rendering/src/lib/cardHelpers.ts @@ -1,4 +1,4 @@ -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import type { DCRContainerPalette } from '../types/front'; export const isMediaCard = (format: ArticleFormat): boolean => { diff --git a/dotcom-rendering/src/lib/decideDesign.ts b/dotcom-rendering/src/lib/decideDesign.ts index 0049410e9e7..ba3449d6759 100644 --- a/dotcom-rendering/src/lib/decideDesign.ts +++ b/dotcom-rendering/src/lib/decideDesign.ts @@ -1,4 +1,4 @@ -import { ArticleDesign } from '@guardian/libs'; +import { ArticleDesign } from '../lib/format'; import type { FEFormat } from '../types/frontend'; /** diff --git a/dotcom-rendering/src/lib/decideDisplay.ts b/dotcom-rendering/src/lib/decideDisplay.ts index 764a8c89b49..7f3b41c1ea9 100644 --- a/dotcom-rendering/src/lib/decideDisplay.ts +++ b/dotcom-rendering/src/lib/decideDisplay.ts @@ -1,4 +1,4 @@ -import { ArticleDisplay } from '@guardian/libs'; +import { ArticleDisplay } from '../lib/format'; import type { FEFormat } from '../types/frontend'; export const decideDisplay = ({ diff --git a/dotcom-rendering/src/lib/decideFormat.ts b/dotcom-rendering/src/lib/decideFormat.ts index e847cc23f80..62fbd723f72 100644 --- a/dotcom-rendering/src/lib/decideFormat.ts +++ b/dotcom-rendering/src/lib/decideFormat.ts @@ -1,4 +1,4 @@ -import type { ArticleFormat } from '@guardian/libs'; +import type { ArticleFormat } from '../lib/format'; import type { FEFormat } from '../types/frontend'; import { decideDesign } from './decideDesign'; import { decideDisplay } from './decideDisplay'; diff --git a/dotcom-rendering/src/lib/decideLogo.ts b/dotcom-rendering/src/lib/decideLogo.ts index d417eb6db69..9d65cecb428 100644 --- a/dotcom-rendering/src/lib/decideLogo.ts +++ b/dotcom-rendering/src/lib/decideLogo.ts @@ -1,4 +1,4 @@ -import type { ArticleFormat } from '@guardian/libs'; +import type { ArticleFormat } from '../lib/format'; import type { Branding } from '../types/branding'; import type { DCRContainerPalette } from '../types/front'; import { cardHasDarkBackground } from './cardHelpers'; diff --git a/dotcom-rendering/src/lib/decideNavPillar.ts b/dotcom-rendering/src/lib/decideNavPillar.ts index a0a42c0f94b..6fb20208966 100644 --- a/dotcom-rendering/src/lib/decideNavPillar.ts +++ b/dotcom-rendering/src/lib/decideNavPillar.ts @@ -1,4 +1,4 @@ -import { Pillar } from '@guardian/libs'; +import { Pillar } from '../lib/format'; import type { LegacyPillar } from '../types/frontend'; export const decideNavPillar = (pillar: LegacyPillar): Pillar | undefined => { diff --git a/dotcom-rendering/src/lib/decidePalette.ts b/dotcom-rendering/src/lib/decidePalette.ts index 7f6d48662d0..5d58c66aa8b 100644 --- a/dotcom-rendering/src/lib/decidePalette.ts +++ b/dotcom-rendering/src/lib/decidePalette.ts @@ -1,6 +1,10 @@ -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, ArticleSpecial, Pillar } from '@guardian/libs'; import { brandAltBackground, palette } from '@guardian/source/foundations'; +import { + ArticleDesign, + type ArticleFormat, + ArticleSpecial, + Pillar, +} from '../lib/format'; // Here is the one place where we use `pillarPalette` import { pillarPalette_DO_NOT_USE as pillarPalette } from '../lib/pillars'; import type { Palette } from '../types/palette'; diff --git a/dotcom-rendering/src/lib/decideTheme.ts b/dotcom-rendering/src/lib/decideTheme.ts index 2cb23fbcac9..7c99f6ee789 100644 --- a/dotcom-rendering/src/lib/decideTheme.ts +++ b/dotcom-rendering/src/lib/decideTheme.ts @@ -1,4 +1,4 @@ -import { ArticleSpecial, type ArticleTheme, Pillar } from '@guardian/libs'; +import { ArticleSpecial, type ArticleTheme, Pillar } from '../lib/format'; import type { FEFormat } from '../types/frontend'; export const decideTheme = ({ theme }: Partial): ArticleTheme => { diff --git a/dotcom-rendering/src/lib/decideTrail.ts b/dotcom-rendering/src/lib/decideTrail.ts index 1515cd3e20e..5435d1e8de6 100644 --- a/dotcom-rendering/src/lib/decideTrail.ts +++ b/dotcom-rendering/src/lib/decideTrail.ts @@ -1,4 +1,4 @@ -import type { ArticleFormat } from '@guardian/libs'; +import type { ArticleFormat } from '../lib/format'; import type { DCRFrontImage } from '../types/front'; import type { FETrailType, TrailType } from '../types/trails'; import { decideFormat } from './decideFormat'; diff --git a/dotcom-rendering/src/lib/format.test.ts b/dotcom-rendering/src/lib/format.test.ts index 4226e0c2f9c..0684cec9c65 100644 --- a/dotcom-rendering/src/lib/format.test.ts +++ b/dotcom-rendering/src/lib/format.test.ts @@ -1,4 +1,4 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import { formatToFEFormat } from './format'; describe('formatToFEFormat', () => { diff --git a/dotcom-rendering/src/lib/format.ts b/dotcom-rendering/src/lib/format.ts index f8d93ad2ab3..cab7d4d473a 100644 --- a/dotcom-rendering/src/lib/format.ts +++ b/dotcom-rendering/src/lib/format.ts @@ -1,13 +1,65 @@ -import type { ArticleFormat, ArticleTheme } from '@guardian/libs'; -import { - ArticleDesign, - ArticleDisplay, - ArticleSpecial, - isString, - Pillar, -} from '@guardian/libs'; +import { isString } from '@guardian/libs'; import type { FEDesign, FEDisplay, FEFormat, FETheme } from '../types/frontend'; +export enum ArticleDesign { + Standard, + Picture, + Gallery, + Audio, + Video, + Review, + Analysis, + Explainer, + Comment, + Letter, + Feature, + LiveBlog, + DeadBlog, + Recipe, + MatchReport, + Interview, + Editorial, + Quiz, + Interactive, + PhotoEssay, + PrintShop, + Obituary, + Correction, + FullPageInteractive, + NewsletterSignup, + Timeline, + Profile, +} + +export enum ArticleDisplay { + Standard, + Immersive, + Showcase, + NumberedList, +} + +export enum Pillar { + News = 0, + Opinion = 1, + Sport = 2, + Culture = 3, + Lifestyle = 4, +} + +export enum ArticleSpecial { + SpecialReport = 5, + Labs = 6, + SpecialReportAlt = 7, +} + +export type ArticleTheme = Pillar | ArticleSpecial; + +export interface ArticleFormat { + theme: ArticleTheme; + design: ArticleDesign; + display: ArticleDisplay; +} + export const getThemeNameAsString = (format: ArticleFormat): string => { const themeName = Pillar[format.theme] ?? ArticleSpecial[format.theme]; if (!themeName) throw new Error('Unknown theme'); diff --git a/dotcom-rendering/src/lib/getDataLinkName.ts b/dotcom-rendering/src/lib/getDataLinkName.ts index f39609cc486..1a6a68949d5 100644 --- a/dotcom-rendering/src/lib/getDataLinkName.ts +++ b/dotcom-rendering/src/lib/getDataLinkName.ts @@ -2,7 +2,7 @@ import { ArticleDesign, type ArticleFormat, ArticleSpecial, -} from '@guardian/libs'; +} from '../lib/format'; import type { FEFrontCardStyle } from '../types/front'; /** diff --git a/dotcom-rendering/src/lib/layoutHelpers.ts b/dotcom-rendering/src/lib/layoutHelpers.ts index e047c90dcd0..2f20b9d82ad 100644 --- a/dotcom-rendering/src/lib/layoutHelpers.ts +++ b/dotcom-rendering/src/lib/layoutHelpers.ts @@ -1,4 +1,4 @@ -import type { Pillar } from '@guardian/libs'; +import type { Pillar } from '../lib/format'; import type { ArticleDeprecated } from '../types/article'; import type { LegacyPillar } from '../types/frontend'; import { decideNavPillar } from './decideNavPillar'; diff --git a/dotcom-rendering/src/lib/pillars.ts b/dotcom-rendering/src/lib/pillars.ts index 234f86826ce..3230ae49d9d 100644 --- a/dotcom-rendering/src/lib/pillars.ts +++ b/dotcom-rendering/src/lib/pillars.ts @@ -1,6 +1,5 @@ -import type { ArticleTheme } from '@guardian/libs'; -import { ArticleSpecial, Pillar } from '@guardian/libs'; import { palette } from '@guardian/source/foundations'; +import { ArticleSpecial, type ArticleTheme, Pillar } from '../lib/format'; const { culture, diff --git a/dotcom-rendering/src/lib/renderElement.tsx b/dotcom-rendering/src/lib/renderElement.tsx index 174d65aec53..d4d5c099ede 100644 --- a/dotcom-rendering/src/lib/renderElement.tsx +++ b/dotcom-rendering/src/lib/renderElement.tsx @@ -1,5 +1,3 @@ -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign } from '@guardian/libs'; import { AdPlaceholder } from '../components/AdPlaceholder.apps'; import { AffiliateDisclaimerInline } from '../components/AffiliateDisclaimer'; import { AudioAtomWrapper } from '../components/AudioAtomWrapper.importable'; @@ -66,6 +64,7 @@ import { interactiveLegacyFigureClasses, isInteractive, } from '../layouts/lib/interactiveLegacyStyling'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { getSharingUrls } from '../lib/sharing-urls'; import type { ServerSideTests, Switches } from '../types/config'; import type { FEElement, RoleType, StarRating } from '../types/content'; diff --git a/dotcom-rendering/src/lib/rootStyles.ts b/dotcom-rendering/src/lib/rootStyles.ts index ef0cf468dc3..3e0bb5581b0 100644 --- a/dotcom-rendering/src/lib/rootStyles.ts +++ b/dotcom-rendering/src/lib/rootStyles.ts @@ -1,9 +1,9 @@ import { css, type SerializedStyles } from '@emotion/react'; -import type { ArticleFormat } from '@guardian/libs'; import { focusHalo, palette as sourcePalette, } from '@guardian/source/foundations'; +import type { ArticleFormat } from '../lib/format'; import { paletteDeclarations } from '../palette'; /** diff --git a/dotcom-rendering/src/lib/themeToPillar.ts b/dotcom-rendering/src/lib/themeToPillar.ts index 15b5cc608a8..1a24fa900c5 100644 --- a/dotcom-rendering/src/lib/themeToPillar.ts +++ b/dotcom-rendering/src/lib/themeToPillar.ts @@ -1,4 +1,4 @@ -import { type ArticleTheme, Pillar } from '@guardian/libs'; +import { type ArticleTheme, Pillar } from '../lib/format'; export const themeToPillar = (theme?: ArticleTheme): Pillar | undefined => { switch (theme) { diff --git a/dotcom-rendering/src/model/article-schema.json b/dotcom-rendering/src/model/article-schema.json index 0456d862156..9218fdea6bc 100644 --- a/dotcom-rendering/src/model/article-schema.json +++ b/dotcom-rendering/src/model/article-schema.json @@ -474,6 +474,9 @@ "definitions": { "FEElement": { "anyOf": [ + { + "$ref": "#/definitions/AdPlaceholderBlockElement" + }, { "$ref": "#/definitions/AudioAtomBlockElement" }, @@ -498,9 +501,6 @@ { "$ref": "#/definitions/ChartAtomBlockElement" }, - { - "$ref": "#/definitions/QuizAtomBlockElement" - }, { "$ref": "#/definitions/CodeBlockElement" }, @@ -547,16 +547,13 @@ "$ref": "#/definitions/InteractiveAtomBlockElement" }, { - "$ref": "#/definitions/InteractiveBlockElement" - }, - { - "$ref": "#/definitions/ItemLinkBlockElement" + "$ref": "#/definitions/InteractiveContentsBlockElement" }, { - "$ref": "#/definitions/AdPlaceholderBlockElement" + "$ref": "#/definitions/InteractiveBlockElement" }, { - "$ref": "#/definitions/InteractiveContentsBlockElement" + "$ref": "#/definitions/ItemLinkBlockElement" }, { "$ref": "#/definitions/KeyTakeawaysBlockElement" @@ -594,6 +591,9 @@ { "$ref": "#/definitions/QABlockElement" }, + { + "$ref": "#/definitions/QuizAtomBlockElement" + }, { "$ref": "#/definitions/RichLinkBlockElement" }, @@ -748,6 +748,18 @@ } ] }, + "AdPlaceholderBlockElement": { + "type": "object", + "properties": { + "_type": { + "type": "string", + "const": "model.dotcomrendering.pageElements.AdPlaceholderBlockElement" + } + }, + "required": [ + "_type" + ] + }, "AudioAtomBlockElement": { "type": "object", "properties": { @@ -1516,142 +1528,6 @@ "url" ] }, - "QuizAtomBlockElement": { - "type": "object", - "properties": { - "_type": { - "type": "string", - "const": "model.dotcomrendering.pageElements.QuizAtomBlockElement" - }, - "elementId": { - "type": "string" - }, - "quizType": { - "enum": [ - "knowledge", - "personality" - ], - "type": "string" - }, - "id": { - "type": "string" - }, - "questions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "text": { - "type": "string" - }, - "answers": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "text": { - "type": "string" - }, - "revealText": { - "type": "string" - }, - "isCorrect": { - "type": "boolean" - }, - "answerBuckets": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "answerBuckets", - "id", - "isCorrect", - "text" - ] - } - }, - "imageUrl": { - "type": "string" - }, - "imageAlt": { - "type": "string" - } - }, - "required": [ - "answers", - "id", - "text" - ] - } - }, - "resultBuckets": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "required": [ - "description", - "id", - "title" - ] - } - }, - "resultGroups": { - "type": "array", - "items": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "shareText": { - "type": "string" - }, - "minScore": { - "type": "number" - }, - "id": { - "type": "string" - } - }, - "required": [ - "id", - "minScore", - "shareText", - "title" - ] - } - } - }, - "required": [ - "_type", - "elementId", - "id", - "questions", - "quizType", - "resultBuckets", - "resultGroups" - ] - }, "CodeBlockElement": { "type": "object", "properties": { @@ -2320,46 +2196,38 @@ "url" ] }, - "InteractiveBlockElement": { + "InteractiveContentsBlockElement": { "type": "object", "properties": { "_type": { "type": "string", - "const": "model.dotcomrendering.pageElements.InteractiveBlockElement" + "const": "model.dotcomrendering.pageElements.InteractiveContentsBlockElement" }, "elementId": { "type": "string" }, - "url": { - "type": "string" - }, - "isMandatory": { - "type": "boolean" - }, - "scriptUrl": { - "type": "string" - }, - "alt": { - "type": "string" - }, - "role": { - "$ref": "#/definitions/RoleType" + "subheadingLinks": { + "type": "array", + "items": { + "$ref": "#/definitions/SubheadingBlockElement" + } }, - "caption": { + "endDocumentElementId": { "type": "string" } }, "required": [ "_type", - "elementId" + "elementId", + "subheadingLinks" ] }, - "ItemLinkBlockElement": { + "SubheadingBlockElement": { "type": "object", "properties": { "_type": { "type": "string", - "const": "model.dotcomrendering.pageElements.ItemLinkBlockElement" + "const": "model.dotcomrendering.pageElements.SubheadingBlockElement" }, "elementId": { "type": "string" @@ -2374,50 +2242,46 @@ "html" ] }, - "AdPlaceholderBlockElement": { - "type": "object", - "properties": { - "_type": { - "type": "string", - "const": "model.dotcomrendering.pageElements.AdPlaceholderBlockElement" - } - }, - "required": [ - "_type" - ] - }, - "InteractiveContentsBlockElement": { + "InteractiveBlockElement": { "type": "object", "properties": { "_type": { "type": "string", - "const": "model.dotcomrendering.pageElements.InteractiveContentsBlockElement" + "const": "model.dotcomrendering.pageElements.InteractiveBlockElement" }, "elementId": { "type": "string" }, - "subheadingLinks": { - "type": "array", - "items": { - "$ref": "#/definitions/SubheadingBlockElement" - } + "url": { + "type": "string" }, - "endDocumentElementId": { + "isMandatory": { + "type": "boolean" + }, + "scriptUrl": { + "type": "string" + }, + "alt": { + "type": "string" + }, + "role": { + "$ref": "#/definitions/RoleType" + }, + "caption": { "type": "string" } }, "required": [ "_type", - "elementId", - "subheadingLinks" + "elementId" ] }, - "SubheadingBlockElement": { + "ItemLinkBlockElement": { "type": "object", "properties": { "_type": { "type": "string", - "const": "model.dotcomrendering.pageElements.SubheadingBlockElement" + "const": "model.dotcomrendering.pageElements.ItemLinkBlockElement" }, "elementId": { "type": "string" @@ -2930,6 +2794,142 @@ "title" ] }, + "QuizAtomBlockElement": { + "type": "object", + "properties": { + "_type": { + "type": "string", + "const": "model.dotcomrendering.pageElements.QuizAtomBlockElement" + }, + "elementId": { + "type": "string" + }, + "quizType": { + "enum": [ + "knowledge", + "personality" + ], + "type": "string" + }, + "id": { + "type": "string" + }, + "questions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "answers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "revealText": { + "type": "string" + }, + "isCorrect": { + "type": "boolean" + }, + "answerBuckets": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "answerBuckets", + "id", + "isCorrect", + "text" + ] + } + }, + "imageUrl": { + "type": "string" + }, + "imageAlt": { + "type": "string" + } + }, + "required": [ + "answers", + "id", + "text" + ] + } + }, + "resultBuckets": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "description", + "id", + "title" + ] + } + }, + "resultGroups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "shareText": { + "type": "string" + }, + "minScore": { + "type": "number" + }, + "id": { + "type": "string" + } + }, + "required": [ + "id", + "minScore", + "shareText", + "title" + ] + } + } + }, + "required": [ + "_type", + "elementId", + "id", + "questions", + "quizType", + "resultBuckets", + "resultGroups" + ] + }, "RichLinkBlockElement": { "type": "object", "properties": { diff --git a/dotcom-rendering/src/model/block-schema.json b/dotcom-rendering/src/model/block-schema.json index 20c257943ad..d4077bdf063 100644 --- a/dotcom-rendering/src/model/block-schema.json +++ b/dotcom-rendering/src/model/block-schema.json @@ -78,6 +78,9 @@ "definitions": { "FEElement": { "anyOf": [ + { + "$ref": "#/definitions/AdPlaceholderBlockElement" + }, { "$ref": "#/definitions/AudioAtomBlockElement" }, @@ -102,9 +105,6 @@ { "$ref": "#/definitions/ChartAtomBlockElement" }, - { - "$ref": "#/definitions/QuizAtomBlockElement" - }, { "$ref": "#/definitions/CodeBlockElement" }, @@ -151,16 +151,13 @@ "$ref": "#/definitions/InteractiveAtomBlockElement" }, { - "$ref": "#/definitions/InteractiveBlockElement" - }, - { - "$ref": "#/definitions/ItemLinkBlockElement" + "$ref": "#/definitions/InteractiveContentsBlockElement" }, { - "$ref": "#/definitions/AdPlaceholderBlockElement" + "$ref": "#/definitions/InteractiveBlockElement" }, { - "$ref": "#/definitions/InteractiveContentsBlockElement" + "$ref": "#/definitions/ItemLinkBlockElement" }, { "$ref": "#/definitions/KeyTakeawaysBlockElement" @@ -198,6 +195,9 @@ { "$ref": "#/definitions/QABlockElement" }, + { + "$ref": "#/definitions/QuizAtomBlockElement" + }, { "$ref": "#/definitions/RichLinkBlockElement" }, @@ -352,6 +352,18 @@ } ] }, + "AdPlaceholderBlockElement": { + "type": "object", + "properties": { + "_type": { + "type": "string", + "const": "model.dotcomrendering.pageElements.AdPlaceholderBlockElement" + } + }, + "required": [ + "_type" + ] + }, "AudioAtomBlockElement": { "type": "object", "properties": { @@ -1120,142 +1132,6 @@ "url" ] }, - "QuizAtomBlockElement": { - "type": "object", - "properties": { - "_type": { - "type": "string", - "const": "model.dotcomrendering.pageElements.QuizAtomBlockElement" - }, - "elementId": { - "type": "string" - }, - "quizType": { - "enum": [ - "knowledge", - "personality" - ], - "type": "string" - }, - "id": { - "type": "string" - }, - "questions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "text": { - "type": "string" - }, - "answers": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "text": { - "type": "string" - }, - "revealText": { - "type": "string" - }, - "isCorrect": { - "type": "boolean" - }, - "answerBuckets": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "answerBuckets", - "id", - "isCorrect", - "text" - ] - } - }, - "imageUrl": { - "type": "string" - }, - "imageAlt": { - "type": "string" - } - }, - "required": [ - "answers", - "id", - "text" - ] - } - }, - "resultBuckets": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "required": [ - "description", - "id", - "title" - ] - } - }, - "resultGroups": { - "type": "array", - "items": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "shareText": { - "type": "string" - }, - "minScore": { - "type": "number" - }, - "id": { - "type": "string" - } - }, - "required": [ - "id", - "minScore", - "shareText", - "title" - ] - } - } - }, - "required": [ - "_type", - "elementId", - "id", - "questions", - "quizType", - "resultBuckets", - "resultGroups" - ] - }, "CodeBlockElement": { "type": "object", "properties": { @@ -1924,46 +1800,38 @@ "url" ] }, - "InteractiveBlockElement": { + "InteractiveContentsBlockElement": { "type": "object", "properties": { "_type": { "type": "string", - "const": "model.dotcomrendering.pageElements.InteractiveBlockElement" + "const": "model.dotcomrendering.pageElements.InteractiveContentsBlockElement" }, "elementId": { "type": "string" }, - "url": { - "type": "string" - }, - "isMandatory": { - "type": "boolean" - }, - "scriptUrl": { - "type": "string" - }, - "alt": { - "type": "string" - }, - "role": { - "$ref": "#/definitions/RoleType" + "subheadingLinks": { + "type": "array", + "items": { + "$ref": "#/definitions/SubheadingBlockElement" + } }, - "caption": { + "endDocumentElementId": { "type": "string" } }, "required": [ "_type", - "elementId" + "elementId", + "subheadingLinks" ] }, - "ItemLinkBlockElement": { + "SubheadingBlockElement": { "type": "object", "properties": { "_type": { "type": "string", - "const": "model.dotcomrendering.pageElements.ItemLinkBlockElement" + "const": "model.dotcomrendering.pageElements.SubheadingBlockElement" }, "elementId": { "type": "string" @@ -1978,50 +1846,46 @@ "html" ] }, - "AdPlaceholderBlockElement": { - "type": "object", - "properties": { - "_type": { - "type": "string", - "const": "model.dotcomrendering.pageElements.AdPlaceholderBlockElement" - } - }, - "required": [ - "_type" - ] - }, - "InteractiveContentsBlockElement": { + "InteractiveBlockElement": { "type": "object", "properties": { "_type": { "type": "string", - "const": "model.dotcomrendering.pageElements.InteractiveContentsBlockElement" + "const": "model.dotcomrendering.pageElements.InteractiveBlockElement" }, "elementId": { "type": "string" }, - "subheadingLinks": { - "type": "array", - "items": { - "$ref": "#/definitions/SubheadingBlockElement" - } + "url": { + "type": "string" }, - "endDocumentElementId": { + "isMandatory": { + "type": "boolean" + }, + "scriptUrl": { + "type": "string" + }, + "alt": { + "type": "string" + }, + "role": { + "$ref": "#/definitions/RoleType" + }, + "caption": { "type": "string" } }, "required": [ "_type", - "elementId", - "subheadingLinks" + "elementId" ] }, - "SubheadingBlockElement": { + "ItemLinkBlockElement": { "type": "object", "properties": { "_type": { "type": "string", - "const": "model.dotcomrendering.pageElements.SubheadingBlockElement" + "const": "model.dotcomrendering.pageElements.ItemLinkBlockElement" }, "elementId": { "type": "string" @@ -2534,6 +2398,142 @@ "title" ] }, + "QuizAtomBlockElement": { + "type": "object", + "properties": { + "_type": { + "type": "string", + "const": "model.dotcomrendering.pageElements.QuizAtomBlockElement" + }, + "elementId": { + "type": "string" + }, + "quizType": { + "enum": [ + "knowledge", + "personality" + ], + "type": "string" + }, + "id": { + "type": "string" + }, + "questions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "answers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "revealText": { + "type": "string" + }, + "isCorrect": { + "type": "boolean" + }, + "answerBuckets": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "answerBuckets", + "id", + "isCorrect", + "text" + ] + } + }, + "imageUrl": { + "type": "string" + }, + "imageAlt": { + "type": "string" + } + }, + "required": [ + "answers", + "id", + "text" + ] + } + }, + "resultBuckets": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "description", + "id", + "title" + ] + } + }, + "resultGroups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "shareText": { + "type": "string" + }, + "minScore": { + "type": "number" + }, + "id": { + "type": "string" + } + }, + "required": [ + "id", + "minScore", + "shareText", + "title" + ] + } + } + }, + "required": [ + "_type", + "elementId", + "id", + "questions", + "quizType", + "resultBuckets", + "resultGroups" + ] + }, "RichLinkBlockElement": { "type": "object", "properties": { diff --git a/dotcom-rendering/src/model/enhance-ad-placeholders.test.ts b/dotcom-rendering/src/model/enhance-ad-placeholders.test.ts index 1d182aa4df3..b12fd66f1fd 100644 --- a/dotcom-rendering/src/model/enhance-ad-placeholders.test.ts +++ b/dotcom-rendering/src/model/enhance-ad-placeholders.test.ts @@ -1,4 +1,4 @@ -import { ArticleDesign, ArticleDisplay, Pillar } from '@guardian/libs'; +import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/format'; import type { AdPlaceholderBlockElement, FEElement, diff --git a/dotcom-rendering/src/model/enhance-ad-placeholders.ts b/dotcom-rendering/src/model/enhance-ad-placeholders.ts index 37439037385..dca5188e16f 100644 --- a/dotcom-rendering/src/model/enhance-ad-placeholders.ts +++ b/dotcom-rendering/src/model/enhance-ad-placeholders.ts @@ -1,4 +1,4 @@ -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import type { AdPlaceholderBlockElement, FEElement } from '../types/content'; import type { RenderingTarget } from '../types/renderingTarget'; diff --git a/dotcom-rendering/src/model/enhance-blockquotes.test.ts b/dotcom-rendering/src/model/enhance-blockquotes.test.ts index aad2ee9a1bc..839e610a8e6 100644 --- a/dotcom-rendering/src/model/enhance-blockquotes.test.ts +++ b/dotcom-rendering/src/model/enhance-blockquotes.test.ts @@ -1,6 +1,6 @@ -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; import { Standard as ExampleArticle } from '../../fixtures/generated/fe-articles/Standard'; import { decideFormat } from '../lib/decideFormat'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import type { FEElement } from '../types/content'; import type { FEArticleType } from '../types/frontend'; import { enhanceBlockquotes } from './enhance-blockquotes'; diff --git a/dotcom-rendering/src/model/enhance-blockquotes.ts b/dotcom-rendering/src/model/enhance-blockquotes.ts index 7d84103ca23..a7e3af9f33e 100644 --- a/dotcom-rendering/src/model/enhance-blockquotes.ts +++ b/dotcom-rendering/src/model/enhance-blockquotes.ts @@ -1,5 +1,5 @@ -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; import { JSDOM } from 'jsdom'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import type { BlockquoteBlockElement, FEElement } from '../types/content'; const isQuoted = (element: BlockquoteBlockElement): boolean => { diff --git a/dotcom-rendering/src/model/enhance-images.test.ts b/dotcom-rendering/src/model/enhance-images.test.ts index 4e82deb2740..acc936dbdb8 100644 --- a/dotcom-rendering/src/model/enhance-images.test.ts +++ b/dotcom-rendering/src/model/enhance-images.test.ts @@ -1,8 +1,8 @@ -import { Pillar } from '@guardian/libs'; import { PhotoEssay } from '../../fixtures/generated/fe-articles/PhotoEssay'; import { Standard as ExampleArticle } from '../../fixtures/generated/fe-articles/Standard'; import { images } from '../../fixtures/generated/images'; import { decideFormat } from '../lib/decideFormat'; +import { Pillar } from '../lib/format'; import type { FEElement } from '../types/content'; import { enhanceElementsImages, enhanceImages } from './enhance-images'; diff --git a/dotcom-rendering/src/model/enhance-images.ts b/dotcom-rendering/src/model/enhance-images.ts index d764baacb6d..e3d9e7f74a7 100644 --- a/dotcom-rendering/src/model/enhance-images.ts +++ b/dotcom-rendering/src/model/enhance-images.ts @@ -1,10 +1,10 @@ +import { isUndefined } from '@guardian/libs'; +import { JSDOM } from 'jsdom'; import { ArticleDesign, type ArticleFormat, ArticleSpecial, - isUndefined, -} from '@guardian/libs'; -import { JSDOM } from 'jsdom'; +} from '../lib/format'; import { getLargest, getMaster } from '../lib/image'; import type { CartoonBlockElement, diff --git a/dotcom-rendering/src/model/enhance-numbered-lists.ts b/dotcom-rendering/src/model/enhance-numbered-lists.ts index a6a4c9ad468..c191fc034f5 100644 --- a/dotcom-rendering/src/model/enhance-numbered-lists.ts +++ b/dotcom-rendering/src/model/enhance-numbered-lists.ts @@ -1,9 +1,6 @@ -import { - ArticleDisplay, - type ArticleFormat, - isUndefined, -} from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { JSDOM } from 'jsdom'; +import { ArticleDisplay, type ArticleFormat } from '../lib/format'; import type { FEElement, StarRating, TextBlockElement } from '../types/content'; const isFalseH3 = (element: FEElement): boolean => { diff --git a/dotcom-rendering/src/model/enhance-videos.test.ts b/dotcom-rendering/src/model/enhance-videos.test.ts index 93b080b770a..cefe8e20b07 100644 --- a/dotcom-rendering/src/model/enhance-videos.test.ts +++ b/dotcom-rendering/src/model/enhance-videos.test.ts @@ -1,4 +1,4 @@ -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import type { FEElement } from '../types/content'; import { enhanceGuVideos } from './enhance-videos'; diff --git a/dotcom-rendering/src/model/enhance-videos.ts b/dotcom-rendering/src/model/enhance-videos.ts index be999956300..5e42c8b91fc 100644 --- a/dotcom-rendering/src/model/enhance-videos.ts +++ b/dotcom-rendering/src/model/enhance-videos.ts @@ -1,4 +1,4 @@ -import { ArticleDesign, type ArticleFormat } from '@guardian/libs'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import type { FEElement } from '../types/content'; const addHtmlToGuVideoBlocks = (elements: FEElement[], html?: string) => { diff --git a/dotcom-rendering/src/model/enhanceBlocks.ts b/dotcom-rendering/src/model/enhanceBlocks.ts index cadea87f780..bfa5011b066 100644 --- a/dotcom-rendering/src/model/enhanceBlocks.ts +++ b/dotcom-rendering/src/model/enhanceBlocks.ts @@ -1,4 +1,5 @@ -import { type ArticleFormat, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; +import { type ArticleFormat } from '../lib/format'; import type { FEElement, ImageForLightbox, Newsletter } from '../types/content'; import type { RenderingTarget } from '../types/renderingTarget'; import { enhanceAdPlaceholders } from './enhance-ad-placeholders'; diff --git a/dotcom-rendering/src/model/enhanceCards.ts b/dotcom-rendering/src/model/enhanceCards.ts index a6f1cab1dd0..59c0faa336b 100644 --- a/dotcom-rendering/src/model/enhanceCards.ts +++ b/dotcom-rendering/src/model/enhanceCards.ts @@ -1,7 +1,8 @@ -import { ArticleDesign, type ArticleFormat, isUndefined } from '@guardian/libs'; +import { isUndefined } from '@guardian/libs'; import { getSoleContributor } from '../lib/byline'; import { decideFormat } from '../lib/decideFormat'; import type { EditionId } from '../lib/edition'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import type { Group } from '../lib/getDataLinkName'; import { getDataLinkNameCard } from '../lib/getDataLinkName'; import type { diff --git a/dotcom-rendering/src/model/enhanceTreats.ts b/dotcom-rendering/src/model/enhanceTreats.ts index 05142d0fc70..e5dafc6f9cf 100644 --- a/dotcom-rendering/src/model/enhanceTreats.ts +++ b/dotcom-rendering/src/model/enhanceTreats.ts @@ -1,5 +1,5 @@ -import { Pillar } from '@guardian/libs'; import type { EditionId } from '../lib/edition'; +import { Pillar } from '../lib/format'; import type { FEFrontCard, TreatType } from '../types/front'; const SOCCER_TREAT: TreatType = { diff --git a/dotcom-rendering/src/model/extract-nav.ts b/dotcom-rendering/src/model/extract-nav.ts index ecf14548749..829775bc4d1 100644 --- a/dotcom-rendering/src/model/extract-nav.ts +++ b/dotcom-rendering/src/model/extract-nav.ts @@ -1,5 +1,5 @@ -import { type ArticleTheme, Pillar } from '@guardian/libs'; import type { EditionId } from '../lib/edition'; +import { type ArticleTheme, Pillar } from '../lib/format'; import type { FELinkType, FENavType } from '../types/frontend'; import { findPillar } from './find-pillar'; diff --git a/dotcom-rendering/src/model/find-pillar.test.ts b/dotcom-rendering/src/model/find-pillar.test.ts index b77fc835f85..98cc9e18d09 100644 --- a/dotcom-rendering/src/model/find-pillar.test.ts +++ b/dotcom-rendering/src/model/find-pillar.test.ts @@ -1,4 +1,4 @@ -import { ArticleSpecial, Pillar } from '@guardian/libs'; +import { ArticleSpecial, Pillar } from '../lib/format'; import { findPillar } from './find-pillar'; jest.mock('../lib/pillars', () => ({ diff --git a/dotcom-rendering/src/model/find-pillar.ts b/dotcom-rendering/src/model/find-pillar.ts index 37b7bc7824c..c6e2451625e 100644 --- a/dotcom-rendering/src/model/find-pillar.ts +++ b/dotcom-rendering/src/model/find-pillar.ts @@ -1,4 +1,4 @@ -import { ArticleSpecial, type ArticleTheme, Pillar } from '@guardian/libs'; +import { ArticleSpecial, type ArticleTheme, Pillar } from '../lib/format'; import type { TagType } from '../types/tag'; export const findPillar: ( diff --git a/dotcom-rendering/src/model/insertPromotedNewsletter.ts b/dotcom-rendering/src/model/insertPromotedNewsletter.ts index 2acc62d64a8..06c9d0968a8 100644 --- a/dotcom-rendering/src/model/insertPromotedNewsletter.ts +++ b/dotcom-rendering/src/model/insertPromotedNewsletter.ts @@ -1,5 +1,5 @@ -import type { ArticleFormat } from '@guardian/libs'; -import { ArticleDesign, isOneOf } from '@guardian/libs'; +import { isOneOf } from '@guardian/libs'; +import { ArticleDesign, type ArticleFormat } from '../lib/format'; import { logger } from '../server/lib/logging'; import type { FEElement, Newsletter } from '../types/content'; diff --git a/dotcom-rendering/src/palette.ts b/dotcom-rendering/src/palette.ts index 40fb359532d..05d20c0dcef 100644 --- a/dotcom-rendering/src/palette.ts +++ b/dotcom-rendering/src/palette.ts @@ -3,13 +3,6 @@ -- the palette object is large and ordering helps knowing where to insert new elements */ -import type { ArticleFormat, ArticleTheme } from '@guardian/libs'; -import { - ArticleDesign, - ArticleDisplay, - ArticleSpecial, - Pillar, -} from '@guardian/libs'; import { palette as sourcePalette } from '@guardian/source/foundations'; import { buttonThemeBrand, @@ -22,6 +15,14 @@ import { tabsThemeDefault, } from '@guardian/source-development-kitchen/react-components'; import { isMediaCard } from './lib/cardHelpers'; +import { + ArticleDesign, + ArticleDisplay, + type ArticleFormat, + ArticleSpecial, + type ArticleTheme, + Pillar, +} from './lib/format'; import { transparentColour } from './lib/transparentColour'; // ----- Palette Functions ----- // diff --git a/dotcom-rendering/src/server/handler.article.amp.tsx b/dotcom-rendering/src/server/handler.article.amp.tsx index a8f6b5c83f3..16eadc1322e 100644 --- a/dotcom-rendering/src/server/handler.article.amp.tsx +++ b/dotcom-rendering/src/server/handler.article.amp.tsx @@ -1,4 +1,3 @@ -import { ArticleDesign } from '@guardian/libs'; import type { RequestHandler } from 'express'; import { Standard as ExampleArticle } from '../../fixtures/generated/fe-articles/Standard'; import type { AnalyticsModel } from '../components/Analytics.amp'; @@ -8,6 +7,7 @@ import type { PermutiveModel } from '../components/Permutive.amp'; import { decideFormat } from '../lib/decideFormat'; import { enhance } from '../lib/enhance.amp'; import { NotRenderableInDCR } from '../lib/errors/not-renderable-in-dcr'; +import { ArticleDesign } from '../lib/format'; import { generatePermutivePayload } from '../lib/permutive.amp'; import { extractScripts } from '../lib/scripts.amp'; import { findBySubsection } from '../model/article-sections'; diff --git a/dotcom-rendering/src/server/render.article.apps.tsx b/dotcom-rendering/src/server/render.article.apps.tsx index d53064137fb..bd324936413 100644 --- a/dotcom-rendering/src/server/render.article.apps.tsx +++ b/dotcom-rendering/src/server/render.article.apps.tsx @@ -1,4 +1,4 @@ -import { ArticleDesign, isString } from '@guardian/libs'; +import { isString } from '@guardian/libs'; import { ArticlePage } from '../components/ArticlePage'; import { ConfigProvider } from '../components/ConfigContext'; import { @@ -7,6 +7,7 @@ import { getPathFromManifest, } from '../lib/assets'; import { renderToStringWithEmotion } from '../lib/emotion'; +import { ArticleDesign } from '../lib/format'; import { createGuardian } from '../model/guardian'; import type { Article } from '../types/article'; import type { Config } from '../types/configContext'; diff --git a/dotcom-rendering/src/server/render.article.web.tsx b/dotcom-rendering/src/server/render.article.web.tsx index ebce4876d52..578fec30ad2 100644 --- a/dotcom-rendering/src/server/render.article.web.tsx +++ b/dotcom-rendering/src/server/render.article.web.tsx @@ -1,9 +1,4 @@ -import { - ArticleDesign, - type ArticleFormat, - isString, - Pillar, -} from '@guardian/libs'; +import { isString } from '@guardian/libs'; import { ArticlePage } from '../components/ArticlePage'; import { ConfigProvider } from '../components/ConfigContext'; import { isAmpSupported } from '../components/Elements.amp'; @@ -17,6 +12,7 @@ import { import { decideFormat } from '../lib/decideFormat'; import { isEditionId } from '../lib/edition'; import { renderToStringWithEmotion } from '../lib/emotion'; +import { ArticleDesign, type ArticleFormat, Pillar } from '../lib/format'; import { getCurrentPillar } from '../lib/layoutHelpers'; import { polyfillIO } from '../lib/polyfill.io'; import { extractNAV } from '../model/extract-nav'; diff --git a/dotcom-rendering/src/server/render.front.web.tsx b/dotcom-rendering/src/server/render.front.web.tsx index b6159e922ec..a69816f04a8 100644 --- a/dotcom-rendering/src/server/render.front.web.tsx +++ b/dotcom-rendering/src/server/render.front.web.tsx @@ -1,4 +1,4 @@ -import { isString, Pillar } from '@guardian/libs'; +import { isString } from '@guardian/libs'; import { ConfigProvider } from '../components/ConfigContext'; import { FrontPage } from '../components/FrontPage'; import { TagPage } from '../components/TagPage'; @@ -9,6 +9,7 @@ import { getPathFromManifest, } from '../lib/assets'; import { renderToStringWithEmotion } from '../lib/emotion'; +import { Pillar } from '../lib/format'; import { polyfillIO } from '../lib/polyfill.io'; import { themeToPillar } from '../lib/themeToPillar'; import type { NavType } from '../model/extract-nav'; diff --git a/dotcom-rendering/src/types/article.ts b/dotcom-rendering/src/types/article.ts index 94e662d024a..8aa6ff4208c 100644 --- a/dotcom-rendering/src/types/article.ts +++ b/dotcom-rendering/src/types/article.ts @@ -1,5 +1,5 @@ -import type { ArticleFormat } from '@guardian/libs'; import { decideFormat } from '../lib/decideFormat'; +import type { ArticleFormat } from '../lib/format'; import type { ImageForAppsLightbox } from '../model/appsLightboxImages'; import { appsLightboxImages } from '../model/appsLightboxImages'; import { buildLightboxImages } from '../model/buildLightboxImages'; diff --git a/dotcom-rendering/src/types/content.ts b/dotcom-rendering/src/types/content.ts index 6059c622b8e..fb04fe1eeee 100644 --- a/dotcom-rendering/src/types/content.ts +++ b/dotcom-rendering/src/types/content.ts @@ -1,4 +1,4 @@ -import type { ArticleTheme } from '@guardian/libs'; +import type { ArticleTheme } from '../lib/format'; export type StarRating = 0 | 1 | 2 | 3 | 4 | 5; diff --git a/dotcom-rendering/src/types/front.ts b/dotcom-rendering/src/types/front.ts index bb90022ac9e..4aec055721a 100644 --- a/dotcom-rendering/src/types/front.ts +++ b/dotcom-rendering/src/types/front.ts @@ -1,6 +1,6 @@ -import type { ArticleFormat, ArticleSpecial, Pillar } from '@guardian/libs'; import type { SharedAdTargeting } from '../lib/ad-targeting'; import type { EditionId } from '../lib/edition'; +import type { ArticleFormat, ArticleSpecial, Pillar } from '../lib/format'; import type { Branding, CollectionBranding, EditionBranding } from './branding'; import type { ServerSideTests, Switches } from './config'; import type { BoostLevel, Image, StarRating } from './content'; diff --git a/dotcom-rendering/src/types/trails.ts b/dotcom-rendering/src/types/trails.ts index c10a2466474..5d59ff1d533 100644 --- a/dotcom-rendering/src/types/trails.ts +++ b/dotcom-rendering/src/types/trails.ts @@ -1,4 +1,4 @@ -import type { ArticleFormat } from '@guardian/libs'; +import type { ArticleFormat } from '../lib/format'; import type { Branding } from './branding'; import type { BoostLevel, StarRating } from './content'; import type { DCRFrontImage, DCRSnapType, DCRSupportingContent } from './front'; diff --git a/dotcom-rendering/stories/generated/Card.stories.tsx b/dotcom-rendering/stories/generated/Card.stories.tsx index c3217fa3a75..b767b099305 100644 --- a/dotcom-rendering/stories/generated/Card.stories.tsx +++ b/dotcom-rendering/stories/generated/Card.stories.tsx @@ -4,9 +4,9 @@ * These stories were auto-generated by `dotcom-rendering/scripts/gen-stories/gen-stories.js` */ -import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar } from '@guardian/libs'; import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { CardsWithDifferentThemes } from '../../src/components/Card/Card.stories'; +import { ArticleDesign, ArticleDisplay, ArticleSpecial, Pillar } from '../../src/lib/format'; // eslint-disable-next-line import/no-default-export -- we need a default here export default {