@financial-times/cp-content-pipeline-ui 7.0.2 → 7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/lib/client.d.ts +1 -0
- package/lib/client.js +3 -1
- package/lib/client.js.map +1 -1
- package/lib/components/Body/index.test.js +12 -11
- package/lib/components/Body/index.test.js.map +1 -1
- package/lib/components/CustomCodeComponent/client/index.d.ts +15 -0
- package/lib/components/CustomCodeComponent/client/index.js +95 -0
- package/lib/components/CustomCodeComponent/client/index.js.map +1 -0
- package/lib/components/CustomCodeComponent/index.d.ts +19 -0
- package/lib/components/CustomCodeComponent/index.js +17 -0
- package/lib/components/CustomCodeComponent/index.js.map +1 -0
- package/lib/components/Flourish/index.js +2 -5
- package/lib/components/Flourish/index.js.map +1 -1
- package/lib/components/Layout/index.d.ts +1 -1
- package/lib/components/LiveBlogBody/index.js +2 -2
- package/lib/components/LiveBlogBody/index.js.map +1 -1
- package/lib/components/Message/index.d.ts +9 -0
- package/lib/components/Message/index.js +18 -0
- package/lib/components/Message/index.js.map +1 -0
- package/lib/components/Message/test/snapshot.spec.d.ts +1 -0
- package/lib/components/Message/test/snapshot.spec.js +23 -0
- package/lib/components/Message/test/snapshot.spec.js.map +1 -0
- package/lib/components/PartnerContentHeader/index.js +2 -3
- package/lib/components/PartnerContentHeader/index.js.map +1 -1
- package/lib/components/RichText/BasicComponents.d.ts +1 -0
- package/lib/components/RichText/BasicComponents.js +3 -1
- package/lib/components/RichText/BasicComponents.js.map +1 -1
- package/lib/components/RichText/index.js +3 -0
- package/lib/components/RichText/index.js.map +1 -1
- package/lib/components/Workarounds.d.ts +5 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +4 -1
- package/lib/index.js.map +1 -1
- package/lib/stories/Message.stories.d.ts +11 -0
- package/lib/stories/Message.stories.js +30 -0
- package/lib/stories/Message.stories.js.map +1 -0
- package/package.json +3 -2
- package/src/client.ts +1 -0
- package/src/components/Body/index.test.tsx +23 -24
- package/src/components/CustomCodeComponent/client/index.ts +121 -0
- package/src/components/CustomCodeComponent/index.tsx +54 -0
- package/src/components/Flourish/index.tsx +5 -26
- package/src/components/Flourish/test/__snapshots__/snapshot.spec.tsx.snap +12 -12
- package/src/components/Layout/index.tsx +1 -1
- package/src/components/LiveBlogBody/index.tsx +2 -0
- package/src/components/Message/index.tsx +35 -0
- package/src/components/Message/test/__snapshots__/snapshot.spec.tsx.snap +45 -0
- package/src/components/Message/test/snapshot.spec.tsx +31 -0
- package/src/components/PartnerContentHeader/index.tsx +6 -8
- package/src/components/RichText/BasicComponents.tsx +4 -0
- package/src/components/RichText/index.tsx +4 -0
- package/src/components/Workarounds.ts +12 -0
- package/src/index.ts +2 -0
- package/src/stories/Message.stories.scss +5 -0
- package/src/stories/Message.stories.tsx +29 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -50,6 +50,10 @@ export const Strikethrough: React.FC<
|
|
|
50
50
|
React.PropsWithChildren<ContentProps<ContentTree.Strikethrough>>
|
|
51
51
|
> = (props) => <s>{props.children}</s>
|
|
52
52
|
|
|
53
|
+
export const CccFallbackText: React.FC<
|
|
54
|
+
React.PropsWithChildren<ContentProps<ContentTreeWorkarounds.CccFallbackText>>
|
|
55
|
+
> = (props) => <div>{props.children}</div>
|
|
56
|
+
|
|
53
57
|
export const TableRow: React.FC<
|
|
54
58
|
React.PropsWithChildren<ContentProps<ContentTreeWorkarounds.TableRow>>
|
|
55
59
|
> = (props) => <tr>{props.children}</tr>
|
|
@@ -17,6 +17,7 @@ import Video from '../Video'
|
|
|
17
17
|
import Table from '../Table'
|
|
18
18
|
import Clip from '../Clip'
|
|
19
19
|
import Paragraph from '../Paragraph'
|
|
20
|
+
import CustomCodeComponent from '../CustomCodeComponent'
|
|
20
21
|
|
|
21
22
|
import {
|
|
22
23
|
List,
|
|
@@ -32,6 +33,7 @@ import {
|
|
|
32
33
|
TableCaption,
|
|
33
34
|
TableFooter,
|
|
34
35
|
TableRow,
|
|
36
|
+
CccFallbackText,
|
|
35
37
|
} from './BasicComponents'
|
|
36
38
|
|
|
37
39
|
import type {
|
|
@@ -104,8 +106,10 @@ const componentMap: RichTextComponentMapRecord = {
|
|
|
104
106
|
cite: Cite,
|
|
105
107
|
blockquote: Blockquote,
|
|
106
108
|
break: LineBreak,
|
|
109
|
+
'ccc-fallback-text': CccFallbackText,
|
|
107
110
|
'clip-set': Clip,
|
|
108
111
|
clip: Clip,
|
|
112
|
+
'custom-code-component': CustomCodeComponent,
|
|
109
113
|
emphasis: Emphasis,
|
|
110
114
|
flourish: Flourish,
|
|
111
115
|
heading: Heading,
|
|
@@ -2,6 +2,7 @@ import type { ContentTree } from '@financial-times/content-tree'
|
|
|
2
2
|
import {
|
|
3
3
|
ConceptFragment,
|
|
4
4
|
TranscriptFragment,
|
|
5
|
+
CustomCodeComponentRichTextFragment,
|
|
5
6
|
} from '@financial-times/cp-content-pipeline-client'
|
|
6
7
|
import type { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema'
|
|
7
8
|
import type {
|
|
@@ -188,3 +189,14 @@ export type Author = PartialToMaybe<
|
|
|
188
189
|
concept?: ConceptFragment
|
|
189
190
|
}
|
|
190
191
|
>
|
|
192
|
+
|
|
193
|
+
type CustomCodeComponentUI = Pick<
|
|
194
|
+
ContentTree.CustomCodeComponent,
|
|
195
|
+
'path' | 'versionRange' | 'id' | 'layoutWidth' | 'attributes' | 'type'
|
|
196
|
+
>
|
|
197
|
+
|
|
198
|
+
export type CustomCodeComponent = PartialToMaybeDeep<
|
|
199
|
+
CustomCodeComponentUI & {
|
|
200
|
+
body?: CustomCodeComponentRichTextFragment
|
|
201
|
+
}
|
|
202
|
+
>
|
package/src/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { default as Byline } from './components/Byline'
|
|
|
6
6
|
export { default as Flourish } from './components/Flourish'
|
|
7
7
|
export { default as Heading } from './components/Heading'
|
|
8
8
|
export { default as ImageSet } from './components/ImageSet'
|
|
9
|
+
export { default as CustomCodeComponent } from './components/CustomCodeComponent'
|
|
9
10
|
export { default as Clip } from './components/Clip/template/component'
|
|
10
11
|
export { Layout, LayoutContainer, LayoutSlot } from './components/Layout'
|
|
11
12
|
export { default as LiveBlogBody } from './components/LiveBlogBody'
|
|
@@ -33,6 +34,7 @@ export {
|
|
|
33
34
|
Strong,
|
|
34
35
|
Strikethrough,
|
|
35
36
|
Cite,
|
|
37
|
+
CccFallbackText,
|
|
36
38
|
} from './components/RichText/BasicComponents'
|
|
37
39
|
export {
|
|
38
40
|
PresentationFlagsContext,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Message from '../components/Message'
|
|
2
|
+
import type { MessageProps } from '../components/Message'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import './Message.stories.scss'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Message',
|
|
8
|
+
component: Message,
|
|
9
|
+
content: {},
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const noticeInformArgs: MessageProps = {
|
|
13
|
+
id: '',
|
|
14
|
+
type: 'notice',
|
|
15
|
+
state: 'inform',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const noticeInformDefault = () => <Message {...noticeInformArgs} />
|
|
19
|
+
|
|
20
|
+
const noticeInformCustomTextArgs: MessageProps = {
|
|
21
|
+
id: '',
|
|
22
|
+
type: 'notice',
|
|
23
|
+
state: 'inform',
|
|
24
|
+
text: 'This is a custom message',
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const noticeInformCustomText = () => (
|
|
28
|
+
<Message {...noticeInformCustomTextArgs} />
|
|
29
|
+
)
|