jornada-ui 2.0.2 → 2.0.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/notification-details-card/index.js +50 -18
- package/lib/commonjs/components/notification-details-card/index.js.map +1 -1
- package/lib/module/components/notification-details-card/index.js +50 -18
- package/lib/module/components/notification-details-card/index.js.map +1 -1
- package/lib/typescript/commonjs/src/components/notification-details-card/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/notification-details-card/interface.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/notification-details-card/interface.d.ts.map +1 -1
- package/lib/typescript/module/src/components/notification-details-card/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/notification-details-card/interface.d.ts +1 -1
- package/lib/typescript/module/src/components/notification-details-card/interface.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/components/notification-details-card/index.tsx +59 -23
- package/src/components/notification-details-card/interface.ts +1 -1
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
+
var _expoVideo = require("expo-video");
|
|
9
10
|
var _index = require("../../common/icons-svg/index.js");
|
|
10
11
|
var _index2 = _interopRequireDefault(require("../box/index.js"));
|
|
11
12
|
var _index3 = _interopRequireDefault(require("../typography/index.js"));
|
|
@@ -31,10 +32,19 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
31
32
|
testID
|
|
32
33
|
}, ref) => {
|
|
33
34
|
const [visible, setVisible] = (0, _react.useState)(false);
|
|
35
|
+
|
|
36
|
+
// player do expo-video (inline)
|
|
37
|
+
const videoPlayer = (0, _expoVideo.useVideoPlayer)(fileType === "video" && fileUrl ? fileUrl : "undefined", player => {
|
|
38
|
+
player.loop = false;
|
|
39
|
+
player.muted = false;
|
|
40
|
+
});
|
|
34
41
|
function openFile() {
|
|
35
|
-
if (
|
|
42
|
+
if (!isInternetReachable) return;
|
|
43
|
+
if (fileType === "image" || fileType === "video") {
|
|
36
44
|
setVisible(true);
|
|
37
|
-
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (fileUrl) {
|
|
38
48
|
Promise.resolve().then(() => _interopRequireWildcard(require("react-native"))).then(({
|
|
39
49
|
Linking
|
|
40
50
|
}) => {
|
|
@@ -89,8 +99,7 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
89
99
|
testID: "button",
|
|
90
100
|
onPress: openFile,
|
|
91
101
|
activeOpacity: 0.8,
|
|
92
|
-
disabled: !isInternetReachable
|
|
93
|
-
,
|
|
102
|
+
disabled: !isInternetReachable,
|
|
94
103
|
style: {
|
|
95
104
|
borderRadius: _theme.theme.borderWidths.thick_medium,
|
|
96
105
|
overflow: "hidden",
|
|
@@ -98,10 +107,6 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
98
107
|
borderColor: isInternetReachable ? _theme.theme.colors.gray[300] : _theme.theme.colors.red[900]
|
|
99
108
|
},
|
|
100
109
|
children: fileType === "image" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.default, {
|
|
101
|
-
flexStyle: {
|
|
102
|
-
alignItems: "center",
|
|
103
|
-
justifyContent: "center"
|
|
104
|
-
},
|
|
105
110
|
borderStyled: {
|
|
106
111
|
borderWidth: 2,
|
|
107
112
|
borderColor: isInternetReachable ? _theme.theme.colors.blue[525] : _theme.theme.colors.red[900],
|
|
@@ -114,27 +119,56 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
114
119
|
style: {
|
|
115
120
|
width: "100%",
|
|
116
121
|
height: 180,
|
|
117
|
-
borderRadius: _theme.theme.borderWidths.thick_medium
|
|
118
|
-
borderWidth: 2,
|
|
119
|
-
borderColor: isInternetReachable ? _theme.theme.colors.blue[525] : _theme.theme.colors.red[900]
|
|
122
|
+
borderRadius: _theme.theme.borderWidths.thick_medium
|
|
120
123
|
},
|
|
121
124
|
resizeMode: "cover"
|
|
122
125
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_index2.default, {
|
|
126
|
+
height: 180,
|
|
123
127
|
flexStyle: {
|
|
124
128
|
alignItems: "center",
|
|
125
129
|
justifyContent: "center"
|
|
126
130
|
},
|
|
127
|
-
height: 180,
|
|
128
131
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Icons, {
|
|
129
132
|
icon: "WIFI_X",
|
|
130
133
|
size: 20,
|
|
131
134
|
color: _theme.theme.colors.red[900]
|
|
132
135
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.default, {
|
|
133
|
-
text: "Imagem
|
|
136
|
+
text: "Imagem indispon\xEDvel",
|
|
137
|
+
size: _theme.theme.fontSizes.sm,
|
|
138
|
+
color: _theme.theme.colors.gray[700]
|
|
139
|
+
})]
|
|
140
|
+
})
|
|
141
|
+
}) : fileType === "video" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.default, {
|
|
142
|
+
height: 180,
|
|
143
|
+
borderStyled: {
|
|
144
|
+
borderWidth: 2,
|
|
145
|
+
borderColor: isInternetReachable ? _theme.theme.colors.blue[525] : _theme.theme.colors.red[900],
|
|
146
|
+
borderRadius: _theme.theme.borderWidths.thick_medium
|
|
147
|
+
},
|
|
148
|
+
children: isInternetReachable ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_expoVideo.VideoView, {
|
|
149
|
+
player: videoPlayer,
|
|
150
|
+
style: {
|
|
151
|
+
width: "100%",
|
|
152
|
+
height: "100%"
|
|
153
|
+
},
|
|
154
|
+
fullscreenOptions: {
|
|
155
|
+
enable: true
|
|
156
|
+
},
|
|
157
|
+
allowsPictureInPicture: true
|
|
158
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_index2.default, {
|
|
159
|
+
flexStyle: {
|
|
160
|
+
flex: 1,
|
|
161
|
+
alignItems: "center",
|
|
162
|
+
justifyContent: "center"
|
|
163
|
+
},
|
|
164
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Icons, {
|
|
165
|
+
icon: "WIFI_X",
|
|
166
|
+
size: 20,
|
|
167
|
+
color: _theme.theme.colors.red[900]
|
|
168
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.default, {
|
|
169
|
+
text: "V\xEDdeo indispon\xEDvel",
|
|
134
170
|
size: _theme.theme.fontSizes.sm,
|
|
135
|
-
|
|
136
|
-
color: _theme.theme.colors.gray[700],
|
|
137
|
-
marginBottom: fileUrl ? 12 : 0
|
|
171
|
+
color: _theme.theme.colors.gray[700]
|
|
138
172
|
})]
|
|
139
173
|
})
|
|
140
174
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_index2.default, {
|
|
@@ -176,8 +210,6 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
176
210
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
177
211
|
onPress: () => setVisible(false),
|
|
178
212
|
style: {
|
|
179
|
-
width: 40,
|
|
180
|
-
height: 40,
|
|
181
213
|
position: "absolute",
|
|
182
214
|
top: 40,
|
|
183
215
|
right: 20
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_index","_index2","_interopRequireDefault","_index3","_asBaseComponent","_theme","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","NotificationDetailCard","forwardRef","isInternetReachable","title","description","fileUrl","fileType","testID","ref","visible","setVisible","useState","openFile","Promise","resolve","then","Linking","openURL","catch","err","console","warn","borderColor","theme","colors","blue","jsxs","flexStyle","flexDirection","borderStyled","borderWidth","neutral","borderRadius","borderWidths","thick_medium","marginStyle","marginBottom","backgroundColor","children","jsx","width","borderTopLeftRadius","borderBottomLeftRadius","flex","paddingStyle","padding","paddings","md","text","fontFamily","fonts","inter_bold","fontWeight","size","fontSizes","color","black","sm","lineHeight","gray","TouchableOpacity","onPress","activeOpacity","disabled","style","overflow","red","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_expoVideo","_index","_index2","_interopRequireDefault","_index3","_asBaseComponent","_theme","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","NotificationDetailCard","forwardRef","isInternetReachable","title","description","fileUrl","fileType","testID","ref","visible","setVisible","useState","videoPlayer","useVideoPlayer","player","loop","muted","openFile","Promise","resolve","then","Linking","openURL","catch","err","console","warn","borderColor","theme","colors","blue","jsxs","flexStyle","flexDirection","borderStyled","borderWidth","neutral","borderRadius","borderWidths","thick_medium","marginStyle","marginBottom","backgroundColor","children","jsx","width","borderTopLeftRadius","borderBottomLeftRadius","flex","paddingStyle","padding","paddings","md","text","fontFamily","fonts","inter_bold","fontWeight","size","fontSizes","color","black","sm","lineHeight","gray","TouchableOpacity","onPress","activeOpacity","disabled","style","overflow","red","Image","source","uri","height","resizeMode","alignItems","justifyContent","Icons","icon","VideoView","fullscreenOptions","enable","allowsPictureInPicture","toUpperCase","inter_medium_500","Modal","transparent","animationType","View","position","top","right","displayName","_default","exports","asBaseComponent"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/notification-details-card/index.tsx"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAGA,IAAAG,MAAA,GAAAH,OAAA;AAGA,IAAAI,OAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,OAAA,GAAAD,sBAAA,CAAAL,OAAA;AAIA,IAAAO,gBAAA,GAAAP,OAAA;AAGA,IAAAQ,MAAA,G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EAACtE,MAAA,CAAAyG,KAAK;YAACC,IAAI,EAAC,QAAQ;YAACtB,IAAI,EAAE,EAAG;YAACE,KAAK,EAAEhC,YAAK,CAACC,MAAM,CAACO,OAAO,CAAC,EAAE;UAAE,CAAE;QAAC,CAClD,CAAC,eAEnB,IAAAxD,WAAA,CAAAgE,GAAA,EAACxE,YAAA,CAAAoG,KAAK;UACJC,MAAM,EAAE;YAAEC,GAAG,EAAErE;UAAQ,CAAE;UACzBgE,KAAK,EAAE;YACLxB,KAAK,EAAE,KAAK;YACZ8B,MAAM,EAAE,KAAK;YACbtC,YAAY,EAAET,YAAK,CAACU,YAAY,CAACC;UACnC,CAAE;UACFqC,UAAU,EAAC;QAAS,CACrB,CAAC;MAAA,CACE;IAAC,CACF,CACR;EAAA,CACE,CAAC;AAEV,CACF,CAAC;AAED5E,sBAAsB,CAAC8F,WAAW,GAAG,wBAAwB;;AAE7D;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAjH,OAAA,GAGe,IAAAkH,gCAAe,EAACjG,sBAAsB,CAAC","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import React, { forwardRef, useState } from "react";
|
|
7
7
|
import { Modal, TouchableOpacity, Image, View } from "react-native";
|
|
8
|
+
import { VideoView, useVideoPlayer } from "expo-video";
|
|
8
9
|
|
|
9
10
|
// commons / icons
|
|
10
11
|
import { Icons } from "../../common/icons-svg/index.js";
|
|
@@ -33,10 +34,19 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
33
34
|
testID
|
|
34
35
|
}, ref) => {
|
|
35
36
|
const [visible, setVisible] = useState(false);
|
|
37
|
+
|
|
38
|
+
// player do expo-video (inline)
|
|
39
|
+
const videoPlayer = useVideoPlayer(fileType === "video" && fileUrl ? fileUrl : "undefined", player => {
|
|
40
|
+
player.loop = false;
|
|
41
|
+
player.muted = false;
|
|
42
|
+
});
|
|
36
43
|
function openFile() {
|
|
37
|
-
if (
|
|
44
|
+
if (!isInternetReachable) return;
|
|
45
|
+
if (fileType === "image" || fileType === "video") {
|
|
38
46
|
setVisible(true);
|
|
39
|
-
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (fileUrl) {
|
|
40
50
|
import("react-native").then(({
|
|
41
51
|
Linking
|
|
42
52
|
}) => {
|
|
@@ -91,8 +101,7 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
91
101
|
testID: "button",
|
|
92
102
|
onPress: openFile,
|
|
93
103
|
activeOpacity: 0.8,
|
|
94
|
-
disabled: !isInternetReachable
|
|
95
|
-
,
|
|
104
|
+
disabled: !isInternetReachable,
|
|
96
105
|
style: {
|
|
97
106
|
borderRadius: theme.borderWidths.thick_medium,
|
|
98
107
|
overflow: "hidden",
|
|
@@ -100,10 +109,6 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
100
109
|
borderColor: isInternetReachable ? theme.colors.gray[300] : theme.colors.red[900]
|
|
101
110
|
},
|
|
102
111
|
children: fileType === "image" ? /*#__PURE__*/_jsx(Box, {
|
|
103
|
-
flexStyle: {
|
|
104
|
-
alignItems: "center",
|
|
105
|
-
justifyContent: "center"
|
|
106
|
-
},
|
|
107
112
|
borderStyled: {
|
|
108
113
|
borderWidth: 2,
|
|
109
114
|
borderColor: isInternetReachable ? theme.colors.blue[525] : theme.colors.red[900],
|
|
@@ -116,27 +121,56 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
116
121
|
style: {
|
|
117
122
|
width: "100%",
|
|
118
123
|
height: 180,
|
|
119
|
-
borderRadius: theme.borderWidths.thick_medium
|
|
120
|
-
borderWidth: 2,
|
|
121
|
-
borderColor: isInternetReachable ? theme.colors.blue[525] : theme.colors.red[900]
|
|
124
|
+
borderRadius: theme.borderWidths.thick_medium
|
|
122
125
|
},
|
|
123
126
|
resizeMode: "cover"
|
|
124
127
|
}) : /*#__PURE__*/_jsxs(Box, {
|
|
128
|
+
height: 180,
|
|
125
129
|
flexStyle: {
|
|
126
130
|
alignItems: "center",
|
|
127
131
|
justifyContent: "center"
|
|
128
132
|
},
|
|
129
|
-
height: 180,
|
|
130
133
|
children: [/*#__PURE__*/_jsx(Icons, {
|
|
131
134
|
icon: "WIFI_X",
|
|
132
135
|
size: 20,
|
|
133
136
|
color: theme.colors.red[900]
|
|
134
137
|
}), /*#__PURE__*/_jsx(Typography, {
|
|
135
|
-
text: "Imagem
|
|
138
|
+
text: "Imagem indispon\xEDvel",
|
|
139
|
+
size: theme.fontSizes.sm,
|
|
140
|
+
color: theme.colors.gray[700]
|
|
141
|
+
})]
|
|
142
|
+
})
|
|
143
|
+
}) : fileType === "video" ? /*#__PURE__*/_jsx(Box, {
|
|
144
|
+
height: 180,
|
|
145
|
+
borderStyled: {
|
|
146
|
+
borderWidth: 2,
|
|
147
|
+
borderColor: isInternetReachable ? theme.colors.blue[525] : theme.colors.red[900],
|
|
148
|
+
borderRadius: theme.borderWidths.thick_medium
|
|
149
|
+
},
|
|
150
|
+
children: isInternetReachable ? /*#__PURE__*/_jsx(VideoView, {
|
|
151
|
+
player: videoPlayer,
|
|
152
|
+
style: {
|
|
153
|
+
width: "100%",
|
|
154
|
+
height: "100%"
|
|
155
|
+
},
|
|
156
|
+
fullscreenOptions: {
|
|
157
|
+
enable: true
|
|
158
|
+
},
|
|
159
|
+
allowsPictureInPicture: true
|
|
160
|
+
}) : /*#__PURE__*/_jsxs(Box, {
|
|
161
|
+
flexStyle: {
|
|
162
|
+
flex: 1,
|
|
163
|
+
alignItems: "center",
|
|
164
|
+
justifyContent: "center"
|
|
165
|
+
},
|
|
166
|
+
children: [/*#__PURE__*/_jsx(Icons, {
|
|
167
|
+
icon: "WIFI_X",
|
|
168
|
+
size: 20,
|
|
169
|
+
color: theme.colors.red[900]
|
|
170
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
171
|
+
text: "V\xEDdeo indispon\xEDvel",
|
|
136
172
|
size: theme.fontSizes.sm,
|
|
137
|
-
|
|
138
|
-
color: theme.colors.gray[700],
|
|
139
|
-
marginBottom: fileUrl ? 12 : 0
|
|
173
|
+
color: theme.colors.gray[700]
|
|
140
174
|
})]
|
|
141
175
|
})
|
|
142
176
|
}) : /*#__PURE__*/_jsxs(Box, {
|
|
@@ -178,8 +212,6 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
178
212
|
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
179
213
|
onPress: () => setVisible(false),
|
|
180
214
|
style: {
|
|
181
|
-
width: 40,
|
|
182
|
-
height: 40,
|
|
183
215
|
position: "absolute",
|
|
184
216
|
top: 40,
|
|
185
217
|
right: 20
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useState","Modal","TouchableOpacity","Image","View","Icons","Box","Typography","asBaseComponent","theme","jsx","_jsx","jsxs","_jsxs","NotificationDetailCard","isInternetReachable","title","description","fileUrl","fileType","testID","ref","visible","setVisible","openFile","then","Linking","openURL","catch","err","console","warn","borderColor","colors","blue","flexStyle","flexDirection","borderStyled","borderWidth","neutral","borderRadius","borderWidths","thick_medium","marginStyle","marginBottom","backgroundColor","children","width","borderTopLeftRadius","borderBottomLeftRadius","flex","paddingStyle","padding","paddings","md","text","fontFamily","fonts","inter_bold","fontWeight","size","fontSizes","color","black","sm","lineHeight","gray","onPress","activeOpacity","disabled","style","overflow","red","
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useState","Modal","TouchableOpacity","Image","View","VideoView","useVideoPlayer","Icons","Box","Typography","asBaseComponent","theme","jsx","_jsx","jsxs","_jsxs","NotificationDetailCard","isInternetReachable","title","description","fileUrl","fileType","testID","ref","visible","setVisible","videoPlayer","player","loop","muted","openFile","then","Linking","openURL","catch","err","console","warn","borderColor","colors","blue","flexStyle","flexDirection","borderStyled","borderWidth","neutral","borderRadius","borderWidths","thick_medium","marginStyle","marginBottom","backgroundColor","children","width","borderTopLeftRadius","borderBottomLeftRadius","flex","paddingStyle","padding","paddings","md","text","fontFamily","fonts","inter_bold","fontWeight","size","fontSizes","color","black","sm","lineHeight","gray","onPress","activeOpacity","disabled","style","overflow","red","source","uri","height","resizeMode","alignItems","justifyContent","icon","fullscreenOptions","enable","allowsPictureInPicture","toUpperCase","inter_medium_500","transparent","animationType","position","top","right","displayName"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/notification-details-card/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AACnD,SAASC,KAAK,EAAEC,gBAAgB,EAAEC,KAAK,EAAEC,IAAI,QAAQ,cAAc;AACnE,SAASC,SAAS,EAAEC,cAAc,QAAQ,YAAY;;AAEtD;AACA,SAASC,KAAK,QAAQ,iCAAwB;;AAE9C;AACA,OAAOC,GAAG,MAAM,iBAAQ;AACxB,OAAOC,UAAU,MAAM,wBAAe;;AAEtC;;AAEA,SAASC,eAAe,QAAQ,mCAAgC;;AAEhE;AACA,SAASC,KAAK,QAAQ,6BAA0B;;AAEhD;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGA,MAAMC,sBAA8D,gBAAGjB,UAAU,CAI/E,CACE;EAAEkB,mBAAmB,GAAG,IAAI;EAAEC,KAAK;EAAEC,WAAW;EAAEC,OAAO;EAAEC,QAAQ,GAAG,OAAO;EAAEC;AAAO,CAAC,EACvFC,GAAG,KACA;EACH,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGzB,QAAQ,CAAC,KAAK,CAAC;;EAE7C;EACA,MAAM0B,WAAW,GAAGpB,cAAc,CAChCe,QAAQ,KAAK,OAAO,IAAID,OAAQ,GAAGA,OAAO,GAAI,WAAW,EACxDO,MAAM,IAAK;IACVA,MAAM,CAACC,IAAI,GAAG,KAAK;IACnBD,MAAM,CAACE,KAAK,GAAG,KAAK;EACtB,CACF,CAAC;EAED,SAASC,QAAQA,C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EAAG;YAACE,KAAK,EAAEzD,KAAK,CAAC4B,MAAM,CAACM,OAAO,CAAC,EAAE;UAAE,CAAE;QAAC,CAClD,CAAC,eAEnBhC,IAAA,CAACV,KAAK;UACJ4E,MAAM,EAAE;YAAEC,GAAG,EAAE5D;UAAQ,CAAE;UACzBwD,KAAK,EAAE;YACLvB,KAAK,EAAE,KAAK;YACZ4B,MAAM,EAAE,KAAK;YACbnC,YAAY,EAAEnC,KAAK,CAACoC,YAAY,CAACC;UACnC,CAAE;UACFkC,UAAU,EAAC;QAAS,CACrB,CAAC;MAAA,CACE;IAAC,CACF,CACR;EAAA,CACE,CAAC;AAEV,CACF,CAAC;AAEDlE,sBAAsB,CAACgF,WAAW,GAAG,wBAAwB;;AAE7D;AACA;AACA;AACA,eAAetF,eAAe,CAACM,sBAAsB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/notification-details-card/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAA+B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/notification-details-card/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAA+B,MAAM,OAAO,CAAC;AAYpD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AA+OhE;;GAEG;;AACH,wBAAuD"}
|
|
@@ -5,7 +5,7 @@ interface INotificationDetailCardProps {
|
|
|
5
5
|
title: string;
|
|
6
6
|
description: string;
|
|
7
7
|
fileUrl?: string;
|
|
8
|
-
fileType?: "image" | "pdf" | "csv" | "other";
|
|
8
|
+
fileType?: "image" | "pdf" | "csv" | "other" | "video";
|
|
9
9
|
testID?: string;
|
|
10
10
|
/**Indica se a conexão com a internet está disponível */
|
|
11
11
|
isInternetReachable?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../../../src/components/notification-details-card/interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,UAAU,4BAA4B;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../../../src/components/notification-details-card/interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,UAAU,4BAA4B;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,wDAAwD;IACxD,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,OAAO,EAAE,KAAK,4BAA4B,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/notification-details-card/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAA+B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/notification-details-card/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAA+B,MAAM,OAAO,CAAC;AAYpD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AA+OhE;;GAEG;;AACH,wBAAuD"}
|
|
@@ -5,7 +5,7 @@ interface INotificationDetailCardProps {
|
|
|
5
5
|
title: string;
|
|
6
6
|
description: string;
|
|
7
7
|
fileUrl?: string;
|
|
8
|
-
fileType?: "image" | "pdf" | "csv" | "other";
|
|
8
|
+
fileType?: "image" | "pdf" | "csv" | "other" | "video";
|
|
9
9
|
testID?: string;
|
|
10
10
|
/**Indica se a conexão com a internet está disponível */
|
|
11
11
|
isInternetReachable?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../../../src/components/notification-details-card/interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,UAAU,4BAA4B;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../../../src/components/notification-details-card/interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,UAAU,4BAA4B;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,wDAAwD;IACxD,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,OAAO,EAAE,KAAK,4BAA4B,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jornada-ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Biblioteca para desenvolvimento dos componentes para utilizar nos app",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@react-native-community/datetimepicker": "^8.4.4",
|
|
82
82
|
"@storybook/test": "^8.3.0",
|
|
83
|
+
"expo-video": "~3.0.15",
|
|
83
84
|
"react-native-svg": "^15.11.2",
|
|
84
85
|
"react-native-web": "^0.19.12"
|
|
85
86
|
},
|
|
@@ -120,6 +121,7 @@
|
|
|
120
121
|
"babel-plugin-react-docgen-typescript": "^1.5.1",
|
|
121
122
|
"babel-plugin-react-native-web": "^0.19.12",
|
|
122
123
|
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
|
|
124
|
+
"baseline-browser-mapping": "2.9.13",
|
|
123
125
|
"commitlint": "^19.6.1",
|
|
124
126
|
"del-cli": "^5.1.0",
|
|
125
127
|
"eslint": "^9.22.0",
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import React, { forwardRef, useState } from "react";
|
|
5
5
|
import { Modal, TouchableOpacity, Image, View } from "react-native";
|
|
6
|
+
import { VideoView, useVideoPlayer } from "expo-video";
|
|
6
7
|
|
|
7
8
|
// commons / icons
|
|
8
9
|
import { Icons } from "../../common/icons-svg";
|
|
@@ -31,10 +32,24 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
31
32
|
) => {
|
|
32
33
|
const [visible, setVisible] = useState(false);
|
|
33
34
|
|
|
35
|
+
// player do expo-video (inline)
|
|
36
|
+
const videoPlayer = useVideoPlayer(
|
|
37
|
+
fileType === "video" && fileUrl! ? fileUrl! : "undefined",
|
|
38
|
+
(player) => {
|
|
39
|
+
player.loop = false;
|
|
40
|
+
player.muted = false;
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
|
|
34
44
|
function openFile() {
|
|
35
|
-
if (
|
|
45
|
+
if (!isInternetReachable) return;
|
|
46
|
+
|
|
47
|
+
if (fileType === "image" || fileType === "video") {
|
|
36
48
|
setVisible(true);
|
|
37
|
-
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (fileUrl) {
|
|
38
53
|
import("react-native").then(({ Linking }) => {
|
|
39
54
|
Linking.openURL(fileUrl).catch((err) => console.warn("Erro ao abrir arquivo:", err));
|
|
40
55
|
});
|
|
@@ -56,7 +71,7 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
56
71
|
marginStyle={{ marginBottom: 16 }}
|
|
57
72
|
backgroundColor={theme.colors.neutral[25]}
|
|
58
73
|
>
|
|
59
|
-
{/* borda
|
|
74
|
+
{/* borda lateral */}
|
|
60
75
|
<Box
|
|
61
76
|
width={8}
|
|
62
77
|
backgroundColor={borderColor}
|
|
@@ -66,9 +81,9 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
66
81
|
}}
|
|
67
82
|
/>
|
|
68
83
|
|
|
69
|
-
{/* Conteúdo
|
|
84
|
+
{/* Conteúdo */}
|
|
70
85
|
<Box flexStyle={{ flex: 1 }} paddingStyle={{ padding: theme.paddings.md }}>
|
|
71
|
-
{/*
|
|
86
|
+
{/* título */}
|
|
72
87
|
<Typography
|
|
73
88
|
text={title}
|
|
74
89
|
fontFamily={theme.fonts.inter_bold}
|
|
@@ -78,7 +93,7 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
78
93
|
marginBottom={8}
|
|
79
94
|
/>
|
|
80
95
|
|
|
81
|
-
{/*
|
|
96
|
+
{/* descrição */}
|
|
82
97
|
<Typography
|
|
83
98
|
text={description}
|
|
84
99
|
size={theme.fontSizes.sm}
|
|
@@ -87,27 +102,22 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
87
102
|
marginBottom={fileUrl ? 12 : 0}
|
|
88
103
|
/>
|
|
89
104
|
|
|
90
|
-
{/* arquivo
|
|
105
|
+
{/* arquivo */}
|
|
91
106
|
{fileUrl && (
|
|
92
107
|
<TouchableOpacity
|
|
93
108
|
testID="button"
|
|
94
109
|
onPress={openFile}
|
|
95
110
|
activeOpacity={0.8}
|
|
96
|
-
disabled={!isInternetReachable}
|
|
111
|
+
disabled={!isInternetReachable}
|
|
97
112
|
style={{
|
|
98
113
|
borderRadius: theme.borderWidths.thick_medium,
|
|
99
114
|
overflow: "hidden",
|
|
100
115
|
borderWidth: 1,
|
|
101
|
-
|
|
102
116
|
borderColor: isInternetReachable ? theme.colors.gray[300] : theme.colors.red[900],
|
|
103
117
|
}}
|
|
104
118
|
>
|
|
105
119
|
{fileType === "image" ? (
|
|
106
120
|
<Box
|
|
107
|
-
flexStyle={{
|
|
108
|
-
alignItems: "center",
|
|
109
|
-
justifyContent: "center",
|
|
110
|
-
}}
|
|
111
121
|
borderStyled={{
|
|
112
122
|
borderWidth: 2,
|
|
113
123
|
borderColor: isInternetReachable
|
|
@@ -123,28 +133,54 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
123
133
|
width: "100%",
|
|
124
134
|
height: 180,
|
|
125
135
|
borderRadius: theme.borderWidths.thick_medium,
|
|
126
|
-
borderWidth: 2,
|
|
127
|
-
borderColor: isInternetReachable
|
|
128
|
-
? theme.colors.blue[525]
|
|
129
|
-
: theme.colors.red[900],
|
|
130
136
|
}}
|
|
131
137
|
resizeMode="cover"
|
|
132
138
|
/>
|
|
139
|
+
) : (
|
|
140
|
+
<Box
|
|
141
|
+
height={180}
|
|
142
|
+
flexStyle={{ alignItems: "center", justifyContent: "center" }}
|
|
143
|
+
>
|
|
144
|
+
<Icons icon="WIFI_X" size={20} color={theme.colors.red[900]} />
|
|
145
|
+
<Typography
|
|
146
|
+
text="Imagem indisponível"
|
|
147
|
+
size={theme.fontSizes.sm}
|
|
148
|
+
color={theme.colors.gray[700]}
|
|
149
|
+
/>
|
|
150
|
+
</Box>
|
|
151
|
+
)}
|
|
152
|
+
</Box>
|
|
153
|
+
) : fileType === "video" ? (
|
|
154
|
+
<Box
|
|
155
|
+
height={180}
|
|
156
|
+
borderStyled={{
|
|
157
|
+
borderWidth: 2,
|
|
158
|
+
borderColor: isInternetReachable
|
|
159
|
+
? theme.colors.blue[525]
|
|
160
|
+
: theme.colors.red[900],
|
|
161
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
162
|
+
}}
|
|
163
|
+
>
|
|
164
|
+
{isInternetReachable ? (
|
|
165
|
+
<VideoView
|
|
166
|
+
player={videoPlayer}
|
|
167
|
+
style={{ width: "100%", height: "100%" }}
|
|
168
|
+
fullscreenOptions={{ enable: true }}
|
|
169
|
+
allowsPictureInPicture
|
|
170
|
+
/>
|
|
133
171
|
) : (
|
|
134
172
|
<Box
|
|
135
173
|
flexStyle={{
|
|
174
|
+
flex: 1,
|
|
136
175
|
alignItems: "center",
|
|
137
176
|
justifyContent: "center",
|
|
138
177
|
}}
|
|
139
|
-
height={180}
|
|
140
178
|
>
|
|
141
179
|
<Icons icon="WIFI_X" size={20} color={theme.colors.red[900]} />
|
|
142
180
|
<Typography
|
|
143
|
-
text=
|
|
181
|
+
text="Vídeo indisponível"
|
|
144
182
|
size={theme.fontSizes.sm}
|
|
145
|
-
lineHeight={theme.lineHeight.md}
|
|
146
183
|
color={theme.colors.gray[700]}
|
|
147
|
-
marginBottom={fileUrl ? 12 : 0}
|
|
148
184
|
/>
|
|
149
185
|
</Box>
|
|
150
186
|
)}
|
|
@@ -179,7 +215,7 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
179
215
|
)}
|
|
180
216
|
</Box>
|
|
181
217
|
|
|
182
|
-
{/*
|
|
218
|
+
{/* MODAL IMAGEM */}
|
|
183
219
|
{fileType === "image" && (
|
|
184
220
|
<Modal visible={visible} transparent animationType="fade">
|
|
185
221
|
<View
|
|
@@ -192,7 +228,7 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
192
228
|
>
|
|
193
229
|
<TouchableOpacity
|
|
194
230
|
onPress={() => setVisible(false)}
|
|
195
|
-
style={{
|
|
231
|
+
style={{ position: "absolute", top: 40, right: 20 }}
|
|
196
232
|
>
|
|
197
233
|
<Icons icon="CLOSED" size={28} color={theme.colors.neutral[25]} />
|
|
198
234
|
</TouchableOpacity>
|
|
@@ -6,7 +6,7 @@ interface INotificationDetailCardProps {
|
|
|
6
6
|
title: string;
|
|
7
7
|
description: string;
|
|
8
8
|
fileUrl?: string; // link para arquivo (png, pdf, csv, etc.)
|
|
9
|
-
fileType?: "image" | "pdf" | "csv" | "other";
|
|
9
|
+
fileType?: "image" | "pdf" | "csv" | "other" | "video";
|
|
10
10
|
testID?: string;
|
|
11
11
|
|
|
12
12
|
/**Indica se a conexão com a internet está disponível */
|