@quintype/native-components 2.20.24 → 2.20.26
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 +7 -0
- package/bin-dev-scripts/standard-version-release.sh +1 -1
- package/package.json +4 -4
- package/src/components/Story/index.js +11 -4
- package/src/components/Story/styles.js +9 -0
- package/src/constants/renderHTML.js +7 -6
- package/src/utils/colorUtils.js +0 -1
- package/src/utils/story.js +24 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [2.20.25](https://github.com/quintype/native-components/compare/v2.20.24...v2.20.25) (2024-03-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **text-clip:** Bump lineheight for HTML story-content ([91f6279](https://github.com/quintype/native-components/commit/91f6279ca2815bf48bddcf0eb03020351bde8666))
|
|
11
|
+
|
|
5
12
|
### [2.20.24](https://github.com/quintype/native-components/compare/v2.20.23...v2.20.24) (2024-03-13)
|
|
6
13
|
|
|
7
14
|
### [2.20.23](https://github.com/quintype/native-components/compare/v2.20.22...v2.20.23) (2024-03-11)
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quintype/native-components",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.26",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "jest --detectOpenHandles",
|
|
8
8
|
"lint": "npx eslint './src/**/*.{js,jsx}'",
|
|
9
|
-
"lint:ci": "npx eslint $(git diff --pretty='' --diff-filter=d --name-only origin/master..HEAD -- '*.js' '*.jsx') ./start.js"
|
|
10
|
-
"prepublishOnly": "./bin-dev-scripts/standard-version-release.sh"
|
|
9
|
+
"lint:ci": "npx eslint $(git diff --pretty='' --diff-filter=d --name-only origin/master..HEAD -- '*.js' '*.jsx') ./start.js"
|
|
11
10
|
},
|
|
12
11
|
"dependencies": {
|
|
13
12
|
"atob": "^2.1.2",
|
|
@@ -34,7 +33,8 @@
|
|
|
34
33
|
"react-native-pdf": ">=6.2.0",
|
|
35
34
|
"react-native-webview": ">=11.0.0",
|
|
36
35
|
"rn-fetch-blob": ">=0.12.0",
|
|
37
|
-
"react-native-vector-icons": "^10.0.0"
|
|
36
|
+
"react-native-vector-icons": "^10.0.0",
|
|
37
|
+
"react-native-linear-gradient": "^2.8.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@babel/core": "^7.11.1",
|
|
@@ -15,6 +15,8 @@ import { storyStyles } from './styles';
|
|
|
15
15
|
import { isStoryFree, mutateDataBeforeAccess, getFirstVideoElement } from '../../utils/story';
|
|
16
16
|
import { isMiddleIndexOfArray } from '../../utils/arrayUtils';
|
|
17
17
|
|
|
18
|
+
|
|
19
|
+
|
|
18
20
|
const getLiveBlogTimeStamp = (card, DATE_FORMAT, share, styles, locale) => {
|
|
19
21
|
const slug = `?cardId=${card.id}`;
|
|
20
22
|
return (
|
|
@@ -76,8 +78,9 @@ const getStoryCards = (
|
|
|
76
78
|
currentLayout,
|
|
77
79
|
getAd,
|
|
78
80
|
locale,
|
|
79
|
-
) => cards.map((card, index, source) =>
|
|
80
|
-
|
|
81
|
+
) => cards.map((card, index, source) => {
|
|
82
|
+
console.log('risi - vstf', card, source)
|
|
83
|
+
return <View key={card?.id}>
|
|
81
84
|
{isLiveBlog
|
|
82
85
|
&& getLiveBlogTimeStamp(card, DATE_FORMAT, share, styles, locale)}
|
|
83
86
|
|
|
@@ -107,7 +110,6 @@ const getStoryCards = (
|
|
|
107
110
|
{/* ^ In the case of a story having just 1 card,
|
|
108
111
|
requesting mid-content-Ad if there are > 1 story-elements in that card
|
|
109
112
|
(> 2 story-elements in case of video story since the 1st story-element gets rendered in header). */}
|
|
110
|
-
|
|
111
113
|
<StoryContent
|
|
112
114
|
testID={contentTestID}
|
|
113
115
|
key={storyElement?.id}
|
|
@@ -124,7 +126,7 @@ const getStoryCards = (
|
|
|
124
126
|
);
|
|
125
127
|
})}
|
|
126
128
|
</View>
|
|
127
|
-
)
|
|
129
|
+
});
|
|
128
130
|
|
|
129
131
|
export const Story = ({
|
|
130
132
|
cdn,
|
|
@@ -187,6 +189,7 @@ export const Story = ({
|
|
|
187
189
|
|
|
188
190
|
return (
|
|
189
191
|
<>
|
|
192
|
+
<View>
|
|
190
193
|
<StoryHeader
|
|
191
194
|
firstVideoElement={firstVideoElement}
|
|
192
195
|
testID={headerTestID}
|
|
@@ -218,6 +221,10 @@ export const Story = ({
|
|
|
218
221
|
getAd,
|
|
219
222
|
locale,
|
|
220
223
|
)}
|
|
224
|
+
<View style={styles.overlay} />
|
|
225
|
+
</View>
|
|
226
|
+
|
|
227
|
+
|
|
221
228
|
|
|
222
229
|
{accessComponent(story, storyHasAccess)}
|
|
223
230
|
|
|
@@ -37,4 +37,13 @@ export const storyStyles = (COLORS, FONT_SIZE) => StyleSheet.create({
|
|
|
37
37
|
color: COLORS.BRAND_1,
|
|
38
38
|
fontSize: FONT_SIZE.title,
|
|
39
39
|
},
|
|
40
|
+
overlay: {
|
|
41
|
+
position: 'absolute',
|
|
42
|
+
bottom: -10,
|
|
43
|
+
left: 0,
|
|
44
|
+
right: 0,
|
|
45
|
+
height: 180, // Adjust the height as needed
|
|
46
|
+
backgroundColor: 'rgba(150, 0, 0, 0.2)',
|
|
47
|
+
marginHorizontal:10
|
|
48
|
+
},
|
|
40
49
|
});
|
|
@@ -21,13 +21,13 @@ export const customHTMLStyles = () => {
|
|
|
21
21
|
marginTop: 7,
|
|
22
22
|
marginBottom: 7,
|
|
23
23
|
fontSize: FONT_SIZE.p1,
|
|
24
|
-
lineHeight: FONT_SIZE.p1 * 1.
|
|
24
|
+
lineHeight: FONT_SIZE.p1 * 1.7,
|
|
25
25
|
color: COLORS.BRAND_BLACK,
|
|
26
26
|
opacity: 0.85,
|
|
27
27
|
},
|
|
28
28
|
li: {
|
|
29
29
|
fontSize: FONT_SIZE.h3,
|
|
30
|
-
lineHeight: FONT_SIZE.h3 * 1.
|
|
30
|
+
lineHeight: FONT_SIZE.h3 * 1.5,
|
|
31
31
|
marginTop: 8,
|
|
32
32
|
color: COLORS.BRAND_BLACK,
|
|
33
33
|
opacity: 0.85,
|
|
@@ -50,25 +50,26 @@ export const customHTMLStyles = () => {
|
|
|
50
50
|
marginTop: 7,
|
|
51
51
|
marginBottom: 7,
|
|
52
52
|
fontSize: FONT_SIZE.p1,
|
|
53
|
-
lineHeight: FONT_SIZE.p1 * 1.
|
|
53
|
+
lineHeight: FONT_SIZE.p1 * 1.7,
|
|
54
54
|
color: COLORS.HYPERLINK_COLOR || COLORS.BRAND_BLACK,
|
|
55
55
|
},
|
|
56
56
|
h: {
|
|
57
57
|
fontFamily: FONT_FAMILY.secondaryBold,
|
|
58
58
|
fontWeight: 'normal',
|
|
59
|
-
marginTop:
|
|
59
|
+
marginTop: 12,
|
|
60
60
|
marginRight: 4,
|
|
61
|
+
lineHeight: FONT_SIZE.h1 * 2,
|
|
61
62
|
color: COLORS.BRAND_BLACK,
|
|
62
63
|
opacity: 0.85,
|
|
63
64
|
},
|
|
64
65
|
sup: {
|
|
65
66
|
marginBottom: 16,
|
|
66
|
-
lineHeight: FONT_SIZE.p1 * 0.
|
|
67
|
+
lineHeight: FONT_SIZE.p1 * 0.5,
|
|
67
68
|
fontSize: FONT_SIZE.p1 * 0.5,
|
|
68
69
|
},
|
|
69
70
|
sub: {
|
|
70
71
|
marginBottom: 16,
|
|
71
|
-
lineHeight: FONT_SIZE.p1 * 0.
|
|
72
|
+
lineHeight: FONT_SIZE.p1 * 0.5,
|
|
72
73
|
fontSize: FONT_SIZE.p1 * 0.5,
|
|
73
74
|
},
|
|
74
75
|
};
|
package/src/utils/colorUtils.js
CHANGED
|
@@ -2,7 +2,6 @@ export const hexToRgb = (hex, alpha=1) => {
|
|
|
2
2
|
let rgbCode = hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(m, r, g, b) => '#' + r + r + g + g + b + b)
|
|
3
3
|
.substring(1).match(/.{2}/g)
|
|
4
4
|
.map(x => parseInt(x, 16));
|
|
5
|
-
console.log('risi - color', `rgb(${rgbCode[0]}, ${rgbCode[1]}, ${rgbCode[2]}, ${alpha})`)
|
|
6
5
|
return `rgba(${rgbCode[0]}, ${rgbCode[1]}, ${rgbCode[2]}, ${alpha})`;
|
|
7
6
|
}
|
|
8
7
|
|
package/src/utils/story.js
CHANGED
|
@@ -50,13 +50,35 @@ export const mutateDataBeforeAccess = (item, storyHasAccess) => {
|
|
|
50
50
|
return item;
|
|
51
51
|
}
|
|
52
52
|
/* The following steps are necessary to keep argument mutation at bay */
|
|
53
|
-
|
|
53
|
+
// console.log('riteshh - ittem', item.cards)
|
|
54
|
+
const firstCardObject = get(item, ['cards', 2], {});
|
|
54
55
|
const firstCardElement = get(firstCardObject, !STORY_TYPES.VIDEO_STORY && ['story-elements', 0], {});
|
|
56
|
+
let visibleContentsForBlockedStory = [];
|
|
57
|
+
let textStoryFound = false;
|
|
58
|
+
if(item.cards && item.cards.length > 0){
|
|
59
|
+
for(let i = 0; i < Math.min(item.cards.length, 2); i++){
|
|
60
|
+
let storyElement = [];
|
|
61
|
+
for(let j=0; j<item.cards[i]['story-elements'].length; j++){
|
|
62
|
+
let tempStoryElement = item.cards[i]['story-elements'][j];
|
|
63
|
+
if(tempStoryElement?.type !== 'text'){
|
|
64
|
+
storyElement.push(tempStoryElement);
|
|
65
|
+
} else {
|
|
66
|
+
textStoryFound = true;
|
|
67
|
+
storyElement.push(tempStoryElement);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// console.log('risi - temp - item', item.cards[i])
|
|
72
|
+
visibleContentsForBlockedStory.push({...item.cards[i],'story-elements' : storyElement});
|
|
73
|
+
if(textStoryFound) break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
55
77
|
|
|
56
78
|
return {
|
|
57
79
|
...item,
|
|
58
80
|
...{
|
|
59
|
-
cards:
|
|
81
|
+
cards: visibleContentsForBlockedStory,
|
|
60
82
|
},
|
|
61
83
|
};
|
|
62
84
|
};
|