stream-chat-react-native-core 9.4.0-beta.1 → 9.4.0-beta.3
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/lib/commonjs/components/Attachment/Attachment.js +8 -4
- package/lib/commonjs/components/Attachment/Attachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/Audio/AudioAttachment.js +2 -4
- package/lib/commonjs/components/Attachment/Audio/AudioAttachment.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +53 -16
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageItemView.js +6 -84
- package/lib/commonjs/components/Message/MessageItemView/MessageItemView.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageComposer.js +8 -29
- package/lib/commonjs/components/MessageInput/MessageComposer.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageActionList.js +1 -1
- package/lib/commonjs/components/Poll/components/CreatePollHeader.js +5 -5
- package/lib/commonjs/components/Poll/components/CreatePollHeader.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollButtons.js +25 -56
- package/lib/commonjs/components/Poll/components/PollButtons.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollInputDialog.js +9 -11
- package/lib/commonjs/components/Poll/components/PollInputDialog.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollModal.js +50 -0
- package/lib/commonjs/components/Poll/components/PollModal.js.map +1 -0
- package/lib/commonjs/components/Poll/components/PollModalHeader.js +3 -3
- package/lib/commonjs/components/Poll/components/PollModalHeader.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollResults/PollResultItem.js +10 -24
- package/lib/commonjs/components/Poll/components/PollResults/PollResultItem.js.map +1 -1
- package/lib/commonjs/components/Poll/components/index.js +11 -0
- package/lib/commonjs/components/Poll/components/index.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Attachment.js +8 -4
- package/lib/module/components/Attachment/Attachment.js.map +1 -1
- package/lib/module/components/Attachment/Audio/AudioAttachment.js +2 -4
- package/lib/module/components/Attachment/Audio/AudioAttachment.js.map +1 -1
- package/lib/module/components/Message/Message.js +53 -16
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageItemView.js +6 -84
- package/lib/module/components/Message/MessageItemView/MessageItemView.js.map +1 -1
- package/lib/module/components/MessageInput/MessageComposer.js +8 -29
- package/lib/module/components/MessageInput/MessageComposer.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageActionList.js +1 -1
- package/lib/module/components/Poll/components/CreatePollHeader.js +5 -5
- package/lib/module/components/Poll/components/CreatePollHeader.js.map +1 -1
- package/lib/module/components/Poll/components/PollButtons.js +25 -56
- package/lib/module/components/Poll/components/PollButtons.js.map +1 -1
- package/lib/module/components/Poll/components/PollInputDialog.js +9 -11
- package/lib/module/components/Poll/components/PollInputDialog.js.map +1 -1
- package/lib/module/components/Poll/components/PollModal.js +50 -0
- package/lib/module/components/Poll/components/PollModal.js.map +1 -0
- package/lib/module/components/Poll/components/PollModalHeader.js +3 -3
- package/lib/module/components/Poll/components/PollModalHeader.js.map +1 -1
- package/lib/module/components/Poll/components/PollResults/PollResultItem.js +10 -24
- package/lib/module/components/Poll/components/PollResults/PollResultItem.js.map +1 -1
- package/lib/module/components/Poll/components/index.js +11 -0
- package/lib/module/components/Poll/components/index.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/Audio/AudioAttachment.d.ts +1 -0
- package/lib/typescript/components/Attachment/Audio/AudioAttachment.d.ts.map +1 -1
- package/lib/typescript/components/Message/Message.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageItemView.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/MessageComposer.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/CreatePollHeader.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollButtons.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollModal.d.ts +9 -0
- package/lib/typescript/components/Poll/components/PollModal.d.ts.map +1 -0
- package/lib/typescript/components/Poll/components/PollResults/PollResultItem.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/index.d.ts +1 -0
- package/lib/typescript/components/Poll/components/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Attachment/Attachment.tsx +9 -5
- package/src/components/Attachment/Audio/AudioAttachment.tsx +3 -4
- package/src/components/Message/Message.tsx +68 -22
- package/src/components/Message/MessageItemView/MessageItemView.tsx +5 -116
- package/src/components/Message/MessageItemView/__tests__/MessageItemView.test.tsx +22 -13
- package/src/components/MessageInput/MessageComposer.tsx +9 -30
- package/src/components/MessageMenu/MessageActionList.tsx +1 -1
- package/src/components/Poll/components/CreatePollHeader.tsx +12 -5
- package/src/components/Poll/components/PollButtons.tsx +14 -38
- package/src/components/Poll/components/PollInputDialog.tsx +12 -12
- package/src/components/Poll/components/PollModal.tsx +55 -0
- package/src/components/Poll/components/PollModalHeader.tsx +3 -3
- package/src/components/Poll/components/PollResults/PollResultItem.tsx +6 -18
- package/src/components/Poll/components/__tests__/CreatePollHeader.test.tsx +4 -36
- package/src/components/Poll/components/__tests__/PollModalHeader.test.tsx +8 -45
- package/src/components/Poll/components/index.ts +1 -0
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.tsx.snap +5 -5
- package/src/version.json +1 -1
|
@@ -43,39 +43,8 @@ const collectPathData = (node: unknown): string[] => {
|
|
|
43
43
|
return [...(typeof props?.d === 'string' ? [props.d] : []), ...collectPathData(children)];
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
const collectTransforms = (node: unknown): string[] => {
|
|
47
|
-
if (!node || typeof node !== 'object') {
|
|
48
|
-
return [];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (Array.isArray(node)) {
|
|
52
|
-
return node.reduce<string[]>((acc, child) => [...acc, ...collectTransforms(child)], []);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const { children, props } = node as {
|
|
56
|
-
children?: unknown;
|
|
57
|
-
props?: { style?: StyleProp<ViewStyle> };
|
|
58
|
-
};
|
|
59
|
-
const style = StyleSheet.flatten(props?.style);
|
|
60
|
-
const styleTransforms = Array.isArray(style?.transform)
|
|
61
|
-
? style.transform.flatMap((transform) => {
|
|
62
|
-
if (
|
|
63
|
-
transform &&
|
|
64
|
-
typeof transform === 'object' &&
|
|
65
|
-
'rotate' in transform &&
|
|
66
|
-
typeof transform.rotate === 'string'
|
|
67
|
-
) {
|
|
68
|
-
return [transform.rotate];
|
|
69
|
-
}
|
|
70
|
-
return [];
|
|
71
|
-
})
|
|
72
|
-
: [];
|
|
73
|
-
|
|
74
|
-
return [...styleTransforms, ...collectTransforms(children)];
|
|
75
|
-
};
|
|
76
|
-
|
|
77
46
|
describe('CreatePollHeader', () => {
|
|
78
|
-
it('renders a secondary
|
|
47
|
+
it('renders a secondary outline cross close button', () => {
|
|
79
48
|
render(
|
|
80
49
|
<ThemeProvider>
|
|
81
50
|
<CreatePollHeader onBackPressHandler={jest.fn()} onCreatePollPressHandler={jest.fn()} />
|
|
@@ -84,11 +53,10 @@ describe('CreatePollHeader', () => {
|
|
|
84
53
|
|
|
85
54
|
const style = getCloseButtonWrapperStyle();
|
|
86
55
|
expect(style.backgroundColor).toBeUndefined();
|
|
87
|
-
expect(style.borderWidth).
|
|
88
|
-
expect(style.borderColor).
|
|
56
|
+
expect(style.borderWidth).toBe(1);
|
|
57
|
+
expect(style.borderColor).toBeDefined();
|
|
89
58
|
expect(collectPathData(screen.toJSON())).toContain(
|
|
90
|
-
'
|
|
59
|
+
'M15.625 4.375L4.375 15.625M15.625 15.625L4.375 4.375',
|
|
91
60
|
);
|
|
92
|
-
expect(collectTransforms(screen.toJSON())).toContain('-90deg');
|
|
93
61
|
});
|
|
94
62
|
});
|
|
@@ -47,41 +47,6 @@ const collectPathData = (node: unknown): string[] => {
|
|
|
47
47
|
return [...(typeof props?.d === 'string' ? [props.d] : []), ...collectPathData(children)];
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
const collectTransforms = (node: unknown): string[] => {
|
|
51
|
-
if (!node || typeof node !== 'object') {
|
|
52
|
-
return [];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (Array.isArray(node)) {
|
|
56
|
-
return node.reduce<string[]>((acc, child) => [...acc, ...collectTransforms(child)], []);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const { children, props } = node as {
|
|
60
|
-
children?: unknown;
|
|
61
|
-
props?: { style?: StyleProp<ViewStyle>; transform?: unknown };
|
|
62
|
-
};
|
|
63
|
-
const style = StyleSheet.flatten(props?.style);
|
|
64
|
-
const styleTransforms = Array.isArray(style?.transform)
|
|
65
|
-
? style.transform.flatMap((transform) => {
|
|
66
|
-
if (
|
|
67
|
-
transform &&
|
|
68
|
-
typeof transform === 'object' &&
|
|
69
|
-
'rotate' in transform &&
|
|
70
|
-
typeof transform.rotate === 'string'
|
|
71
|
-
) {
|
|
72
|
-
return [transform.rotate];
|
|
73
|
-
}
|
|
74
|
-
return [];
|
|
75
|
-
})
|
|
76
|
-
: [];
|
|
77
|
-
|
|
78
|
-
return [
|
|
79
|
-
...(typeof props?.transform === 'string' ? [props.transform] : []),
|
|
80
|
-
...styleTransforms,
|
|
81
|
-
...collectTransforms(children),
|
|
82
|
-
];
|
|
83
|
-
};
|
|
84
|
-
|
|
85
50
|
const renderPollModalHeader = () =>
|
|
86
51
|
render(
|
|
87
52
|
<ThemeProvider>
|
|
@@ -94,33 +59,31 @@ describe('PollModalHeader', () => {
|
|
|
94
59
|
setPlatform(originalPlatform);
|
|
95
60
|
});
|
|
96
61
|
|
|
97
|
-
it('renders a secondary
|
|
62
|
+
it('renders a secondary outline cross button outside Android', () => {
|
|
98
63
|
setPlatform('ios');
|
|
99
64
|
|
|
100
65
|
renderPollModalHeader();
|
|
101
66
|
|
|
102
67
|
const style = getCloseButtonWrapperStyle();
|
|
103
68
|
expect(style.backgroundColor).toBeUndefined();
|
|
104
|
-
expect(style.borderWidth).
|
|
105
|
-
expect(style.borderColor).
|
|
69
|
+
expect(style.borderWidth).toBe(1);
|
|
70
|
+
expect(style.borderColor).toBeDefined();
|
|
106
71
|
expect(collectPathData(screen.toJSON())).toContain(
|
|
107
|
-
'
|
|
72
|
+
'M15.625 4.375L4.375 15.625M15.625 15.625L4.375 4.375',
|
|
108
73
|
);
|
|
109
|
-
expect(collectTransforms(screen.toJSON())).toContain('-90deg');
|
|
110
74
|
});
|
|
111
75
|
|
|
112
|
-
it('renders a secondary
|
|
76
|
+
it('renders a secondary outline cross button on Android', () => {
|
|
113
77
|
setPlatform('android');
|
|
114
78
|
|
|
115
79
|
renderPollModalHeader();
|
|
116
80
|
|
|
117
81
|
const style = getCloseButtonWrapperStyle();
|
|
118
82
|
expect(style.backgroundColor).toBeUndefined();
|
|
119
|
-
expect(style.borderWidth).
|
|
120
|
-
expect(style.borderColor).
|
|
83
|
+
expect(style.borderWidth).toBe(1);
|
|
84
|
+
expect(style.borderColor).toBeDefined();
|
|
121
85
|
expect(collectPathData(screen.toJSON())).toContain(
|
|
122
|
-
'
|
|
86
|
+
'M15.625 4.375L4.375 15.625M15.625 15.625L4.375 4.375',
|
|
123
87
|
);
|
|
124
|
-
expect(collectTransforms(screen.toJSON())).toContain('-90deg');
|
|
125
88
|
});
|
|
126
89
|
});
|
|
@@ -337,6 +337,7 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
337
337
|
],
|
|
338
338
|
{
|
|
339
339
|
"paddingHorizontal": 16,
|
|
340
|
+
"paddingVertical": 8,
|
|
340
341
|
},
|
|
341
342
|
]
|
|
342
343
|
}
|
|
@@ -370,7 +371,6 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
370
371
|
"alignItems": "flex-end",
|
|
371
372
|
"flexDirection": "row",
|
|
372
373
|
"gap": 8,
|
|
373
|
-
"paddingVertical": 8,
|
|
374
374
|
"width": "100%",
|
|
375
375
|
}
|
|
376
376
|
}
|
|
@@ -671,6 +671,7 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
671
671
|
],
|
|
672
672
|
{
|
|
673
673
|
"paddingHorizontal": 16,
|
|
674
|
+
"paddingVertical": 8,
|
|
674
675
|
},
|
|
675
676
|
]
|
|
676
677
|
}
|
|
@@ -704,7 +705,6 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
704
705
|
"alignItems": "flex-end",
|
|
705
706
|
"flexDirection": "row",
|
|
706
707
|
"gap": 8,
|
|
707
|
-
"paddingVertical": 8,
|
|
708
708
|
"width": "100%",
|
|
709
709
|
}
|
|
710
710
|
}
|
|
@@ -1039,6 +1039,7 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
1039
1039
|
],
|
|
1040
1040
|
{
|
|
1041
1041
|
"paddingHorizontal": 16,
|
|
1042
|
+
"paddingVertical": 8,
|
|
1042
1043
|
},
|
|
1043
1044
|
]
|
|
1044
1045
|
}
|
|
@@ -1072,7 +1073,6 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
1072
1073
|
"alignItems": "flex-end",
|
|
1073
1074
|
"flexDirection": "row",
|
|
1074
1075
|
"gap": 8,
|
|
1075
|
-
"paddingVertical": 8,
|
|
1076
1076
|
"width": "100%",
|
|
1077
1077
|
}
|
|
1078
1078
|
}
|
|
@@ -1365,7 +1365,9 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
1365
1365
|
[
|
|
1366
1366
|
undefined,
|
|
1367
1367
|
{
|
|
1368
|
+
"marginBottom": 12,
|
|
1368
1369
|
"paddingHorizontal": 16,
|
|
1370
|
+
"paddingVertical": 8,
|
|
1369
1371
|
},
|
|
1370
1372
|
]
|
|
1371
1373
|
}
|
|
@@ -1399,8 +1401,6 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
1399
1401
|
"alignItems": "flex-end",
|
|
1400
1402
|
"flexDirection": "row",
|
|
1401
1403
|
"gap": 8,
|
|
1402
|
-
"marginBottom": 12,
|
|
1403
|
-
"paddingVertical": 8,
|
|
1404
1404
|
"width": "100%",
|
|
1405
1405
|
}
|
|
1406
1406
|
}
|
package/src/version.json
CHANGED