@times-components/article-lead-asset 1.10.8 → 1.11.2
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 +27 -0
- package/README.md +4 -24
- package/babel.config.js +5 -1
- package/package.json +11 -14
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.11.2](https://github.com/newsuk/times-components/compare/@times-components/article-lead-asset@1.11.1...@times-components/article-lead-asset@1.11.2) (2022-09-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @times-components/article-lead-asset
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.11.1](https://github.com/newsuk/times-components/compare/@times-components/article-lead-asset@1.11.0...@times-components/article-lead-asset@1.11.1) (2022-09-06)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @times-components/article-lead-asset
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [1.11.0](https://github.com/newsuk/times-components/compare/@times-components/article-lead-asset@1.10.8...@times-components/article-lead-asset@1.11.0) (2022-08-18)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **TDP-1712:** remove react-native foreverrrrr ([#3064](https://github.com/newsuk/times-components/issues/3064)) ([2a20cb5](https://github.com/newsuk/times-components/commit/2a20cb5abc10a4e7ca2d62487967f8fcf4eccb62)), closes [#3037](https://github.com/newsuk/times-components/issues/3037) [#3045](https://github.com/newsuk/times-components/issues/3045) [#3050](https://github.com/newsuk/times-components/issues/3050) [#3056](https://github.com/newsuk/times-components/issues/3056) [#3057](https://github.com/newsuk/times-components/issues/3057) [#3066](https://github.com/newsuk/times-components/issues/3066) [#3065](https://github.com/newsuk/times-components/issues/3065) [#3037](https://github.com/newsuk/times-components/issues/3037) [#3045](https://github.com/newsuk/times-components/issues/3045) [#3045](https://github.com/newsuk/times-components/issues/3045) [#3056](https://github.com/newsuk/times-components/issues/3056) [#3066](https://github.com/newsuk/times-components/issues/3066) [#3069](https://github.com/newsuk/times-components/issues/3069) [#3068](https://github.com/newsuk/times-components/issues/3068) [#3070](https://github.com/newsuk/times-components/issues/3070) [#3072](https://github.com/newsuk/times-components/issues/3072) [#3073](https://github.com/newsuk/times-components/issues/3073) [#3071](https://github.com/newsuk/times-components/issues/3071) [#3074](https://github.com/newsuk/times-components/issues/3074) [#3076](https://github.com/newsuk/times-components/issues/3076) [#3079](https://github.com/newsuk/times-components/issues/3079) [#3078](https://github.com/newsuk/times-components/issues/3078) [#3083](https://github.com/newsuk/times-components/issues/3083) [#3087](https://github.com/newsuk/times-components/issues/3087) [#3091](https://github.com/newsuk/times-components/issues/3091) [#3096](https://github.com/newsuk/times-components/issues/3096) [#3102](https://github.com/newsuk/times-components/issues/3102) [#3105](https://github.com/newsuk/times-components/issues/3105) [#3108](https://github.com/newsuk/times-components/issues/3108) [#3111](https://github.com/newsuk/times-components/issues/3111) [#3112](https://github.com/newsuk/times-components/issues/3112) [#3113](https://github.com/newsuk/times-components/issues/3113) [#3114](https://github.com/newsuk/times-components/issues/3114) [#3120](https://github.com/newsuk/times-components/issues/3120) [#3119](https://github.com/newsuk/times-components/issues/3119) [#3112](https://github.com/newsuk/times-components/issues/3112) [#3126](https://github.com/newsuk/times-components/issues/3126) [#3112](https://github.com/newsuk/times-components/issues/3112) [#3126](https://github.com/newsuk/times-components/issues/3126) [#3127](https://github.com/newsuk/times-components/issues/3127) [#3116](https://github.com/newsuk/times-components/issues/3116) [#3128](https://github.com/newsuk/times-components/issues/3128) [#3132](https://github.com/newsuk/times-components/issues/3132) [#3133](https://github.com/newsuk/times-components/issues/3133)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [1.10.8](https://github.com/newsuk/times-components/compare/@times-components/article-lead-asset@1.10.7...@times-components/article-lead-asset@1.10.8) (2022-08-12)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @times-components/article-lead-asset
|
package/README.md
CHANGED
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
# Article Lead Asset
|
|
2
2
|
|
|
3
3
|
An article lead asset is an unstyled image or video (asset) with an inline
|
|
4
|
-
caption. The caption is rendered using the renderProps React convention.
|
|
5
|
-
native platforms, assets are opened in modals on tap, and a consumer can choose
|
|
6
|
-
to provide different renderProps for inline/modal captions. Consumers are
|
|
4
|
+
caption. The caption is rendered using the renderProps React convention. Consumers are
|
|
7
5
|
responsible for styling the lead asset by placing it inside of a container
|
|
8
|
-
and/or by styling the component returned by the caption renderProp.
|
|
9
|
-
platforms, consumers must also provide a `getImageCrop` prop that will determine
|
|
10
|
-
which crop to use for the lead asset based on the available crops.
|
|
6
|
+
and/or by styling the component returned by the caption renderProp.
|
|
11
7
|
|
|
12
8
|
## Usage
|
|
13
9
|
|
|
14
10
|
```js
|
|
15
11
|
// Image
|
|
16
12
|
<ArticleLeadAsset
|
|
17
|
-
// Only used on web
|
|
18
13
|
aspectRatio="16:9"
|
|
19
|
-
|
|
20
|
-
// Only used on web
|
|
21
14
|
displayImage={{
|
|
22
15
|
ratio: "16:9"
|
|
23
16
|
url: "http://crop169.io"
|
|
24
17
|
}}
|
|
25
|
-
|
|
26
18
|
leadAsset={{
|
|
27
19
|
caption: "Caption text"
|
|
28
20
|
credits: "Credits text"
|
|
@@ -31,16 +23,8 @@ which crop to use for the lead asset based on the available crops.
|
|
|
31
23
|
url: "http://crop169.io"
|
|
32
24
|
}
|
|
33
25
|
}}
|
|
34
|
-
|
|
35
|
-
// Only used on native, used to specify fallback crops
|
|
36
|
-
getImageCrop={leadAsset => leadAsset.crop169 || leadAsset.crop32}
|
|
37
|
-
|
|
38
|
-
// Used to render inline caption on both web and native
|
|
39
26
|
renderCaption={({ caption }) => <Caption {...caption } />}
|
|
40
|
-
|
|
41
|
-
// Specify the width to render the asset at.
|
|
42
|
-
// Rendered at this size on native platforms, and used for lazy loading
|
|
43
|
-
// on web
|
|
27
|
+
// Specify the width to render the asset at, this is used for lazy loading
|
|
44
28
|
width={600}
|
|
45
29
|
/>
|
|
46
30
|
```
|
|
@@ -65,15 +49,11 @@ yarn lint
|
|
|
65
49
|
|
|
66
50
|
## Testing
|
|
67
51
|
|
|
68
|
-
Testing can be done on each platform individually
|
|
69
|
-
|
|
70
52
|
```
|
|
71
53
|
yarn test:web
|
|
72
54
|
```
|
|
73
55
|
|
|
74
|
-
Visit the official
|
|
75
|
-
|
|
76
|
-
https://components.thetimes.co.uk/?knob-Size%20of%20ad%20placeholder%3A=default&selectedKind=Primitives%2FArticle%20Lead%20Asset&selectedStory=Image&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybooks%2Fstorybook-addon-knobs
|
|
56
|
+
Visit the official [storybook](https://components.thetimes.co.uk/?knob-Size%20of%20ad%20placeholder%3A=default&selectedKind=Primitives%2FArticle%20Lead%20Asset&selectedStory=Image&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybooks%2Fstorybook-addon-knobs)
|
|
77
57
|
|
|
78
58
|
<!-- Add the storybook link here. -->
|
|
79
59
|
|
package/babel.config.js
CHANGED
|
@@ -2,6 +2,10 @@ module.exports = api => {
|
|
|
2
2
|
api.cache(true);
|
|
3
3
|
return {
|
|
4
4
|
plugins: ["babel-plugin-styled-components"],
|
|
5
|
-
presets: [
|
|
5
|
+
presets: [
|
|
6
|
+
"@babel/preset-env",
|
|
7
|
+
"@babel/preset-react",
|
|
8
|
+
"@babel/preset-typescript"
|
|
9
|
+
]
|
|
6
10
|
};
|
|
7
11
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-components/article-lead-asset",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.2",
|
|
4
4
|
"description": "Generalised Lead Asset component for templates to consume & style",
|
|
5
5
|
"main": "dist/article-lead-asset",
|
|
6
6
|
"dev": "src/article-lead-asset",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"fmt": "eslint . --fix && prettier --write '**/*.*'",
|
|
10
10
|
"prettier:diff": "prettier --list-different '**/*.*'",
|
|
11
11
|
"lint": "eslint . && yarn prettier:diff && yarn depcheck",
|
|
12
|
-
"test:web": "jest --config='./__tests__/
|
|
12
|
+
"test:web": "jest --config='./__tests__/jest.config.js'",
|
|
13
13
|
"prepublishOnly": "yarn transpile && yarn bundle",
|
|
14
14
|
"watch": "watch 'yarn bundle' ./src --ignoreDotFiles --ignoreUnreadable",
|
|
15
15
|
"cleanup-dist": "rm -rf dist",
|
|
@@ -32,12 +32,10 @@
|
|
|
32
32
|
"homepage": "https://github.com/newsuk/times-components#readme",
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/core": "7.4.4",
|
|
35
|
-
"@babel/preset-env": "7.4.4",
|
|
36
|
-
"@babel/preset-react": "7.9.1",
|
|
37
35
|
"@times-components/eslint-config-thetimes": "0.8.18",
|
|
38
|
-
"@times-components/jest-configurator-web": "0.
|
|
39
|
-
"@times-components/storybook": "4.
|
|
40
|
-
"@times-components/webpack-configurator": "2.0
|
|
36
|
+
"@times-components/jest-configurator-web": "0.8.0",
|
|
37
|
+
"@times-components/storybook": "4.5.0",
|
|
38
|
+
"@times-components/webpack-configurator": "2.1.0",
|
|
41
39
|
"babel-jest": "24.8.0",
|
|
42
40
|
"eslint": "5.9.0",
|
|
43
41
|
"jest": "24.8.0",
|
|
@@ -45,14 +43,13 @@
|
|
|
45
43
|
"react": "16.9.0",
|
|
46
44
|
"react-dom": "16.9.0",
|
|
47
45
|
"react-test-renderer": "16.9.0",
|
|
48
|
-
"webpack": "4.30.0"
|
|
49
|
-
"webpack-cli": "3.3.1"
|
|
46
|
+
"webpack": "4.30.0"
|
|
50
47
|
},
|
|
51
48
|
"dependencies": {
|
|
52
|
-
"@times-components/jest-serializer": "3.
|
|
53
|
-
"@times-components/test-utils": "2.
|
|
54
|
-
"@times-components/utils": "6.
|
|
55
|
-
"@times-components/video": "4.
|
|
49
|
+
"@times-components/jest-serializer": "3.4.0",
|
|
50
|
+
"@times-components/test-utils": "2.4.0",
|
|
51
|
+
"@times-components/utils": "6.15.0",
|
|
52
|
+
"@times-components/video": "4.13.2",
|
|
56
53
|
"prop-types": "15.7.2"
|
|
57
54
|
},
|
|
58
55
|
"resolutions": {
|
|
@@ -66,5 +63,5 @@
|
|
|
66
63
|
"publishConfig": {
|
|
67
64
|
"access": "public"
|
|
68
65
|
},
|
|
69
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "a4cb8f16b75e0d54adf6ad9e23bb6cce1dda01fc"
|
|
70
67
|
}
|