@davi-ai/retorik-framework 3.2.0 → 3.2.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/dist/AttachmentDetail.1e06c2a5.js +1757 -0
- package/dist/AttachmentDetail.1e06c2a5.js.map +1 -0
- package/dist/AttachmentDetail.c6c297df.js +1732 -0
- package/dist/AttachmentDetail.c6c297df.js.map +1 -0
- package/dist/CustomView.080c8028.js +143 -0
- package/dist/CustomView.080c8028.js.map +1 -0
- package/dist/CustomView.90d2a13d.js +134 -0
- package/dist/CustomView.90d2a13d.js.map +1 -0
- package/dist/Emergency.423214ad.js +301 -0
- package/dist/Emergency.423214ad.js.map +1 -0
- package/dist/Emergency.a21f837c.js +292 -0
- package/dist/Emergency.a21f837c.js.map +1 -0
- package/dist/FullScreenImage.1fe27198.js +70 -0
- package/dist/FullScreenImage.1fe27198.js.map +1 -0
- package/dist/FullScreenImage.9a9b978e.js +83 -0
- package/dist/FullScreenImage.9a9b978e.js.map +1 -0
- package/dist/HistoryList.50ff0fd9.js +242 -0
- package/dist/HistoryList.50ff0fd9.js.map +1 -0
- package/dist/HistoryList.5fd6aa12.js +228 -0
- package/dist/HistoryList.5fd6aa12.js.map +1 -0
- package/dist/LanguageChoice.1579b654.js +125 -0
- package/dist/LanguageChoice.1579b654.js.map +1 -0
- package/dist/LanguageChoice.61e36c1d.js +116 -0
- package/dist/LanguageChoice.61e36c1d.js.map +1 -0
- package/dist/LittleWeatherContainer.07937cf3.js +57 -0
- package/dist/LittleWeatherContainer.07937cf3.js.map +1 -0
- package/dist/LittleWeatherContainer.d27a6b8a.js +44 -0
- package/dist/LittleWeatherContainer.d27a6b8a.js.map +1 -0
- package/dist/NewsContainer.67f04b19.js +730 -0
- package/dist/NewsContainer.67f04b19.js.map +1 -0
- package/dist/NewsContainer.932174e9.js +755 -0
- package/dist/NewsContainer.932174e9.js.map +1 -0
- package/dist/SpiritEngineWrapper.1d8db53d.js +82 -0
- package/dist/SpiritEngineWrapper.1d8db53d.js.map +1 -0
- package/dist/SpiritEngineWrapper.27e9c120.js +96 -0
- package/dist/SpiritEngineWrapper.27e9c120.js.map +1 -0
- package/dist/ThreeJsWrapper.09c689b8.js +141 -0
- package/dist/ThreeJsWrapper.09c689b8.js.map +1 -0
- package/dist/ThreeJsWrapper.7918143f.js +128 -0
- package/dist/ThreeJsWrapper.7918143f.js.map +1 -0
- package/dist/Weather.661c2cac.js +282 -0
- package/dist/Weather.661c2cac.js.map +1 -0
- package/dist/Weather.fb22fba3.js +268 -0
- package/dist/Weather.fb22fba3.js.map +1 -0
- package/dist/index.d.ts +69 -50
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23055 -23224
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +22278 -22376
- package/dist/index.modern.js.map +1 -1
- package/package.json +4 -36
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
var $avS3e$reactjsxruntime = require("react/jsx-runtime");
|
|
2
|
+
var $avS3e$react = require("react");
|
|
3
|
+
var $avS3e$daviairetorikweather = require("@davi-ai/retorik-weather");
|
|
4
|
+
var $avS3e$qrcode = require("qrcode");
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function $parcel$interopDefault(a) {
|
|
8
|
+
return a && a.__esModule ? a.default : a;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function $parcel$defineInteropFlag(a) {
|
|
12
|
+
Object.defineProperty(a, '__esModule', {value: true, configurable: true});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function $parcel$export(e, n, v, s) {
|
|
16
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
var $parcel$global =
|
|
20
|
+
typeof globalThis !== 'undefined'
|
|
21
|
+
? globalThis
|
|
22
|
+
: typeof self !== 'undefined'
|
|
23
|
+
? self
|
|
24
|
+
: typeof window !== 'undefined'
|
|
25
|
+
? window
|
|
26
|
+
: typeof global !== 'undefined'
|
|
27
|
+
? global
|
|
28
|
+
: {};
|
|
29
|
+
var parcelRequire = $parcel$global["parcelRequirea39d"];
|
|
30
|
+
var parcelRegister = parcelRequire.register;
|
|
31
|
+
parcelRegister("j5z2A", function(module, exports) {
|
|
32
|
+
|
|
33
|
+
$parcel$defineInteropFlag(module.exports);
|
|
34
|
+
|
|
35
|
+
$parcel$export(module.exports, "default", () => $becba6a72493aae8$export$2e2bcd8739ae039);
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
var $6Q0mk = parcelRequire("6Q0mk");
|
|
41
|
+
|
|
42
|
+
var $7eio0 = parcelRequire("7eio0");
|
|
43
|
+
|
|
44
|
+
var $6EkQS = parcelRequire("6EkQS");
|
|
45
|
+
|
|
46
|
+
var $kUiCn = parcelRequire("kUiCn");
|
|
47
|
+
|
|
48
|
+
var $6QoTL = parcelRequire("6QoTL");
|
|
49
|
+
|
|
50
|
+
var $7WHA7 = parcelRequire("7WHA7");
|
|
51
|
+
|
|
52
|
+
var $a3uH3 = parcelRequire("a3uH3");
|
|
53
|
+
|
|
54
|
+
var $8ywPo = parcelRequire("8ywPo");
|
|
55
|
+
|
|
56
|
+
var $aA7FU = parcelRequire("aA7FU");
|
|
57
|
+
|
|
58
|
+
var $lONbp = parcelRequire("lONbp");
|
|
59
|
+
|
|
60
|
+
var $6tFNo = parcelRequire("6tFNo");
|
|
61
|
+
const $becba6a72493aae8$var$Weather = ({ handleClose: handleClose })=>{
|
|
62
|
+
var _configuration_position, _configuration_position1, _configuration_position2, _configuration_position3;
|
|
63
|
+
const locale = (0, $6Q0mk.useLocaleStore)((state)=>state.locale);
|
|
64
|
+
const configuration = (0, $6EkQS.useRetorikStore)((state)=>state.configuration);
|
|
65
|
+
const currentDeviceType = (0, $kUiCn.useViewStore)((state)=>state.currentDeviceType);
|
|
66
|
+
const isMobile = (0, $kUiCn.useViewStore)((state)=>state.isMobile);
|
|
67
|
+
const setCurrentSubView = (0, $7eio0.useUtilsStore)((state)=>state.actions.setCurrentSubView);
|
|
68
|
+
const sendEvent = (0, $6QoTL.useDirectlineStore)((state)=>state.actions.sendEvent);
|
|
69
|
+
/**
|
|
70
|
+
* On call :
|
|
71
|
+
* - set RetorikContext's displayWeather state to false
|
|
72
|
+
*/ const handleBack = ()=>{
|
|
73
|
+
sendEvent('Davi.CloseWindow', null);
|
|
74
|
+
sendEvent('Davi.CloseWindowWeather', null);
|
|
75
|
+
handleClose ? handleClose() : setCurrentSubView((0, $7WHA7.CurrentSubView).none);
|
|
76
|
+
};
|
|
77
|
+
return isMobile ? /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsxs)((0, $a3uH3.FullScreenMobile), {
|
|
78
|
+
depth: (0, $7WHA7.Depth).dropdown,
|
|
79
|
+
background: "#FFFFFF",
|
|
80
|
+
children: [
|
|
81
|
+
/*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)((0, $8ywPo.default), {
|
|
82
|
+
subView: (0, $7WHA7.AvailableViews).weather,
|
|
83
|
+
className: "rf-border-b rf-border-b-menuBorder",
|
|
84
|
+
handleBack: handleBack
|
|
85
|
+
}),
|
|
86
|
+
/*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)((0, ($parcel$interopDefault($avS3e$daviairetorikweather))), {
|
|
87
|
+
locale: locale,
|
|
88
|
+
deviceType: currentDeviceType,
|
|
89
|
+
position: {
|
|
90
|
+
latitude: ((_configuration_position = configuration.position) === null || _configuration_position === void 0 ? void 0 : _configuration_position.latitude) || 0,
|
|
91
|
+
longitude: ((_configuration_position1 = configuration.position) === null || _configuration_position1 === void 0 ? void 0 : _configuration_position1.longitude) || 0
|
|
92
|
+
}
|
|
93
|
+
}),
|
|
94
|
+
/*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)((0, $6tFNo.default), {})
|
|
95
|
+
]
|
|
96
|
+
}) : /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsxs)((0, $a3uH3.FullScreen), {
|
|
97
|
+
depth: (0, $7WHA7.Depth).dropdown,
|
|
98
|
+
background: "linear-gradient(to right bottom, #F2F8F8FC , #F2E1E2E8)",
|
|
99
|
+
onClick: handleBack,
|
|
100
|
+
children: [
|
|
101
|
+
/*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsxs)("div", {
|
|
102
|
+
className: "rf-h-full rf-w-full rf-flex rf-flex-col rf-items-center",
|
|
103
|
+
children: [
|
|
104
|
+
/*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)((0, $aA7FU.default), {
|
|
105
|
+
subView: (0, $7WHA7.AvailableViews).weather
|
|
106
|
+
}),
|
|
107
|
+
/*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)((0, ($parcel$interopDefault($avS3e$daviairetorikweather))), {
|
|
108
|
+
locale: locale,
|
|
109
|
+
deviceType: currentDeviceType,
|
|
110
|
+
position: {
|
|
111
|
+
latitude: ((_configuration_position2 = configuration.position) === null || _configuration_position2 === void 0 ? void 0 : _configuration_position2.latitude) || 0,
|
|
112
|
+
longitude: ((_configuration_position3 = configuration.position) === null || _configuration_position3 === void 0 ? void 0 : _configuration_position3.longitude) || 0
|
|
113
|
+
}
|
|
114
|
+
}),
|
|
115
|
+
/*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)((0, $6tFNo.default), {})
|
|
116
|
+
]
|
|
117
|
+
}),
|
|
118
|
+
/*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)((0, $lONbp.default), {
|
|
119
|
+
dashboardVisible: true,
|
|
120
|
+
onClick: handleBack
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
var $becba6a72493aae8$export$2e2bcd8739ae039 = $becba6a72493aae8$var$Weather;
|
|
126
|
+
|
|
127
|
+
});
|
|
128
|
+
parcelRegister("8ywPo", function(module, exports) {
|
|
129
|
+
|
|
130
|
+
$parcel$export(module.exports, "default", () => $0a80198eb48dcfb9$export$2e2bcd8739ae039);
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
var $6Q0mk = parcelRequire("6Q0mk");
|
|
135
|
+
|
|
136
|
+
var $7v7LH = parcelRequire("7v7LH");
|
|
137
|
+
|
|
138
|
+
var $bUTyR = parcelRequire("bUTyR");
|
|
139
|
+
const $0a80198eb48dcfb9$var$MobileTopContainer = ({ subView: subView, className: className, handleBack: handleBack })=>{
|
|
140
|
+
const translation = (0, $6Q0mk.useLocaleStore)((state)=>state.currentTranslations);
|
|
141
|
+
return /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsxs)((0, ($parcel$interopDefault($avS3e$react))).Fragment, {
|
|
142
|
+
children: [
|
|
143
|
+
/*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)((0, $7v7LH.BackButton), {
|
|
144
|
+
title: translation.common.back,
|
|
145
|
+
className: "rf-text-sm",
|
|
146
|
+
handleBack: handleBack
|
|
147
|
+
}),
|
|
148
|
+
subView && /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)((0, $bUTyR.default), {
|
|
149
|
+
subView: subView,
|
|
150
|
+
className: className
|
|
151
|
+
})
|
|
152
|
+
]
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
var $0a80198eb48dcfb9$export$2e2bcd8739ae039 = $0a80198eb48dcfb9$var$MobileTopContainer;
|
|
156
|
+
|
|
157
|
+
});
|
|
158
|
+
parcelRegister("bUTyR", function(module, exports) {
|
|
159
|
+
|
|
160
|
+
$parcel$export(module.exports, "default", () => $5ec58a98f8a43d3b$export$2e2bcd8739ae039);
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
var $7WHA7 = parcelRequire("7WHA7");
|
|
165
|
+
|
|
166
|
+
var $6Q0mk = parcelRequire("6Q0mk");
|
|
167
|
+
|
|
168
|
+
var $6GlMG = parcelRequire("6GlMG");
|
|
169
|
+
const $5ec58a98f8a43d3b$var$iconClassname = 'rf-h-8 rf-w-8';
|
|
170
|
+
const $5ec58a98f8a43d3b$var$MobileIconAndTitle = ({ subView: subView, className: className })=>{
|
|
171
|
+
const translation = (0, $6Q0mk.useLocaleStore)((state)=>state.currentTranslations);
|
|
172
|
+
return /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsxs)("div", {
|
|
173
|
+
className: `large:rf-hidden rf-py-2 rf-flex rf-flex-row rf-items-end ${className}`,
|
|
174
|
+
children: [
|
|
175
|
+
subView === (0, $7WHA7.AvailableViews).weather ? /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)($6GlMG.WeatherIcon, {
|
|
176
|
+
className: $5ec58a98f8a43d3b$var$iconClassname
|
|
177
|
+
}) : subView === (0, $7WHA7.AvailableViews).emergency ? /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)($6GlMG.EmergencyIcon, {
|
|
178
|
+
className: $5ec58a98f8a43d3b$var$iconClassname
|
|
179
|
+
}) : /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)((0, ($parcel$interopDefault($avS3e$react))).Fragment, {}),
|
|
180
|
+
/*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)("div", {
|
|
181
|
+
className: "rf-ml-2 rf-capitalize rf-subtitle-size-auto",
|
|
182
|
+
children: translation[subView]
|
|
183
|
+
})
|
|
184
|
+
]
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
var $5ec58a98f8a43d3b$export$2e2bcd8739ae039 = $5ec58a98f8a43d3b$var$MobileIconAndTitle;
|
|
188
|
+
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
parcelRegister("aA7FU", function(module, exports) {
|
|
193
|
+
|
|
194
|
+
$parcel$export(module.exports, "default", () => $5aac785fee9416e3$export$2e2bcd8739ae039);
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
var $7WHA7 = parcelRequire("7WHA7");
|
|
199
|
+
|
|
200
|
+
var $6Q0mk = parcelRequire("6Q0mk");
|
|
201
|
+
|
|
202
|
+
var $6GlMG = parcelRequire("6GlMG");
|
|
203
|
+
const $5aac785fee9416e3$var$iconClassname = 'rf-h-16 rf-w-16 large-vertical:rf-h-24 large-vertical:rf-w-24';
|
|
204
|
+
const $5aac785fee9416e3$var$LargeIconAndTitle = ({ subView: subView, className: className })=>{
|
|
205
|
+
const translation = (0, $6Q0mk.useLocaleStore)((state)=>state.currentTranslations);
|
|
206
|
+
return /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsxs)("div", {
|
|
207
|
+
className: `rf-hidden large:rf-flex rf-w-full rf-pt-4 large-vertical:rf-pt-8 rf-pl-4 large-vertical:rf-pl-0 rf-flex-row rf-justify-start large-vertical:rf-justify-center rf-items-center ${className}`,
|
|
208
|
+
children: [
|
|
209
|
+
subView === (0, $7WHA7.AvailableViews).weather ? /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)($6GlMG.WeatherIcon, {
|
|
210
|
+
className: $5aac785fee9416e3$var$iconClassname
|
|
211
|
+
}) : subView === (0, $7WHA7.AvailableViews).emergency ? /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)($6GlMG.EmergencyIcon, {
|
|
212
|
+
className: $5aac785fee9416e3$var$iconClassname
|
|
213
|
+
}) : /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)((0, ($parcel$interopDefault($avS3e$react))).Fragment, {}),
|
|
214
|
+
/*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)("div", {
|
|
215
|
+
className: "rf-ml-2 rf-uppercase rf-text-[#575F6B] rf-subtitle-size-auto",
|
|
216
|
+
children: translation[subView]
|
|
217
|
+
})
|
|
218
|
+
]
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
var $5aac785fee9416e3$export$2e2bcd8739ae039 = $5aac785fee9416e3$var$LargeIconAndTitle;
|
|
222
|
+
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
parcelRegister("6tFNo", function(module, exports) {
|
|
226
|
+
|
|
227
|
+
$parcel$export(module.exports, "default", () => $ca477ffba32efc70$export$2e2bcd8739ae039);
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
var $6EkQS = parcelRequire("6EkQS");
|
|
233
|
+
|
|
234
|
+
var $hQSgy = parcelRequire("hQSgy");
|
|
235
|
+
const $ca477ffba32efc70$var$OpenMeteoAttribution = ()=>{
|
|
236
|
+
const isUsedOnBorne = (0, $6EkQS.useRetorikStore)((state)=>state.configuration.isUsedOnBorne);
|
|
237
|
+
const [qrCodeData, setQrCodeData] = (0, $avS3e$react.useState)();
|
|
238
|
+
const [showQrCode, setShowQrCode] = (0, $avS3e$react.useState)(false);
|
|
239
|
+
const setQrCodeDataAsync = async ()=>{
|
|
240
|
+
const qrCodeString = await (0, ($parcel$interopDefault($avS3e$qrcode))).toDataURL('https://open-meteo.com/');
|
|
241
|
+
setQrCodeData(qrCodeString);
|
|
242
|
+
};
|
|
243
|
+
(0, $avS3e$react.useEffect)(()=>{
|
|
244
|
+
isUsedOnBorne && setQrCodeDataAsync();
|
|
245
|
+
}, [
|
|
246
|
+
isUsedOnBorne
|
|
247
|
+
]);
|
|
248
|
+
const handleClick = ()=>{
|
|
249
|
+
setShowQrCode((current)=>!current);
|
|
250
|
+
};
|
|
251
|
+
return /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)("div", {
|
|
252
|
+
className: "rf-w-full rf-py-2 rf-flex rf-justify-center",
|
|
253
|
+
children: isUsedOnBorne ? /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)((0, ($parcel$interopDefault($avS3e$react))).Fragment, {
|
|
254
|
+
children: /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsxs)("div", {
|
|
255
|
+
className: "rf-relative rf-text-sm hover:rf-cursor-pointer",
|
|
256
|
+
onClick: handleClick,
|
|
257
|
+
children: [
|
|
258
|
+
"Weather data by Open-Meteo.com",
|
|
259
|
+
showQrCode && qrCodeData ? /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)("div", {
|
|
260
|
+
className: "rf-absolute rf-left-1/2 rf-top-0 -rf-translate-x-1/2 -rf-translate-y-full",
|
|
261
|
+
children: /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)((0, $hQSgy.default), {
|
|
262
|
+
src: qrCodeData
|
|
263
|
+
})
|
|
264
|
+
}) : /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)((0, ($parcel$interopDefault($avS3e$react))).Fragment, {})
|
|
265
|
+
]
|
|
266
|
+
})
|
|
267
|
+
}) : /*#__PURE__*/ (0, $avS3e$reactjsxruntime.jsx)("a", {
|
|
268
|
+
href: "https://open-meteo.com/",
|
|
269
|
+
target: "_blank",
|
|
270
|
+
rel: "noreferrer noopener",
|
|
271
|
+
className: "rf-text-sm",
|
|
272
|
+
children: "Weather data by open-meteo.com"
|
|
273
|
+
})
|
|
274
|
+
});
|
|
275
|
+
};
|
|
276
|
+
var $ca477ffba32efc70$export$2e2bcd8739ae039 = $ca477ffba32efc70$var$OpenMeteoAttribution;
|
|
277
|
+
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
//# sourceMappingURL=Weather.661c2cac.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,gCAAU,CAAC,eAAE,WAAW,EAAgB;QA4B1B,yBACC,0BAiBC,0BACC;IA9CrB,MAAM,SAAS,CAAA,GAAA,qBAAa,EAAE,CAAC,QAAU,MAAM,MAAM;IACrD,MAAM,gBAAgB,CAAA,GAAA,sBAAc,EAAE,CAAC,QAAU,MAAM,aAAa;IACpE,MAAM,oBAAoB,CAAA,GAAA,mBAAW,EAAE,CAAC,QAAU,MAAM,iBAAiB;IACzE,MAAM,WAAW,CAAA,GAAA,mBAAW,EAAE,CAAC,QAAU,MAAM,QAAQ;IACvD,MAAM,oBAAoB,CAAA,GAAA,oB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AAE,OAAO,iBACjC,gCAAC;gBAAkB,WAAW;iBAC5B,YAAY,CAAA,GAAA,qBAAa,EAAE,SAAS,iBACtC,gCAAC;gBAAoB,WAAW;+BAEhC,gCAAC,CAAA,GAAA,sCAAI,EAAE,QAAQ;0BAGjB,gCAAC;gBAAI,WAAU;0BACZ,WAAW,CAAC,QAAQ;;;;AAI7B;IAEA,2CAAe;;;;;;;;;;;;;;AClCf,MAAM,6CAAuB;IAC3B,MAAM,gBAAgB,CAAA,GAAA,sBAAc,EAClC,CAAC,QAAU,MAAM,aAAa,CAAC,aAAa;IAE9C,MAAM,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,qBAAO;IAC3C,MAAM,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,qBAAO,EAAW;IAEtD,MAAM,qBAAqB;QACzB,MAAM,eAAe,MAAM,CAAA,GAAA,uCAAK,EAAE,SAAS,CAAC;QAC5C,cAAc;IAChB;IAEA,CAAA,GAAA,sBAAQ,EAAE;QACR,iBAAiB;IACnB,GAAG;QAAC;KAAc;IAElB,MAAM,cAAc;QAClB,cAAc,CAAC,UAAY,CAAC;IAC9B;IAEA,qBACE,gCAAC;QAAI,WAAU;kBACZ,8BACC,gCAAC,CAAA,GAAA,sCAAI,EAAE,QAAQ;sBACb,cAAA,iCAAC;gBACC,WAAU;gBACV,SAAS;;oBACV;oBAEE,cAAc,2BACb,gCAAC;wBAAI,WAAU;kCACb,cAAA,gCAAC,CAAA,GAAA,cAAc;4BAAE,KAAK;;uCAGxB,gCAAC,CAAA,GAAA,sCAAI,EAAE,QAAQ;;;2BAKrB,gCAAC;YACC,MAAK;YACL,QAAO;YACP,KAAI;YACJ,WAAU;sBACX;;;AAMT;IAEA,2CAAe","sources":["src/components/Weather/Weather.tsx","src/components/Utils/SubView/MobileTopContainer.tsx","src/components/Utils/SubView/MobileIconAndTitle.tsx","src/components/Utils/SubView/LargeIconAndTitle.tsx","src/components/Weather/OpenMeteoAttribution.tsx"],"sourcesContent":["import React from 'react'\r\nimport WeatherContent from '@davi-ai/retorik-weather'\r\n\r\nimport { useLocaleStore } from '../Contexts/LocaleContext'\r\nimport { useUtilsStore } from '../Contexts/UtilsContext'\r\nimport { useRetorikStore } from '../Contexts/RetorikContext'\r\nimport { useViewStore } from '../Contexts/ViewContext'\r\nimport { useDirectlineStore } from '../Contexts/DirectlineContext'\r\n\r\nimport { AvailableViews, CurrentSubView, Depth } from '../../models/enums'\r\n\r\nimport { FullScreen, FullScreenMobile } from '../Templates'\r\nimport MobileTopContainer from '../Utils/SubView/MobileTopContainer'\r\nimport LargeIconAndTitle from '../Utils/SubView/LargeIconAndTitle'\r\nimport AbsoluteLargeClosingButton from '../Utils/SubView/AbsoluteLargeClosingButton'\r\nimport OpenMeteoAttribution from './OpenMeteoAttribution'\r\n\r\ninterface WeatherProps {\r\n handleClose?: () => void\r\n}\r\n\r\nconst Weather = ({ handleClose }: WeatherProps): JSX.Element => {\r\n const locale = useLocaleStore((state) => state.locale)\r\n const configuration = useRetorikStore((state) => state.configuration)\r\n const currentDeviceType = useViewStore((state) => state.currentDeviceType)\r\n const isMobile = useViewStore((state) => state.isMobile)\r\n const setCurrentSubView = useUtilsStore((state) => state.actions.setCurrentSubView)\r\n const sendEvent = useDirectlineStore((state) => state.actions.sendEvent)\r\n\r\n /**\r\n * On call :\r\n * - set RetorikContext's displayWeather state to false\r\n */\r\n const handleBack = (): void => {\r\n sendEvent('Davi.CloseWindow', null)\r\n sendEvent('Davi.CloseWindowWeather', null)\r\n handleClose ? handleClose() : setCurrentSubView(CurrentSubView.none)\r\n }\r\n\r\n return isMobile ? (\r\n <FullScreenMobile depth={Depth.dropdown} background='#FFFFFF'>\r\n {/* Top container : back button + weather icon + title */}\r\n <MobileTopContainer subView={AvailableViews.weather} className='rf-border-b rf-border-b-menuBorder' handleBack={handleBack} />\r\n\r\n {/* Weather data */}\r\n <WeatherContent\r\n locale={locale}\r\n deviceType={currentDeviceType}\r\n position={{\r\n latitude: configuration.position?.latitude || 0,\r\n longitude: configuration.position?.longitude || 0\r\n }}\r\n />\r\n\r\n <OpenMeteoAttribution />\r\n </FullScreenMobile>\r\n ) : (\r\n <FullScreen depth={Depth.dropdown} background='linear-gradient(to right bottom, #F2F8F8FC , #F2E1E2E8)' onClick={handleBack}>\r\n <div className='rf-h-full rf-w-full rf-flex rf-flex-col rf-items-center'>\r\n {/* Weather icon + text */}\r\n <LargeIconAndTitle subView={AvailableViews.weather} />\r\n\r\n {/* Weather data */}\r\n <WeatherContent\r\n locale={locale}\r\n deviceType={currentDeviceType}\r\n position={{\r\n latitude: configuration.position?.latitude || 0,\r\n longitude: configuration.position?.longitude || 0\r\n }}\r\n />\r\n\r\n <OpenMeteoAttribution />\r\n </div>\r\n\r\n {/* Closing button */}\r\n <AbsoluteLargeClosingButton dashboardVisible={true} onClick={handleBack} />\r\n </FullScreen>\r\n )\r\n}\r\n\r\nexport default Weather\r\n","import React from 'react'\r\nimport { useLocaleStore } from '../../Contexts/LocaleContext'\r\nimport { BackButton } from '../../Menu/Common'\r\nimport MobileIconAndTitle from './MobileIconAndTitle'\r\n\r\ninterface MobileTopContainerProps {\r\n subView?: number\r\n className?: string\r\n handleBack: () => void\r\n}\r\n\r\nconst MobileTopContainer = ({\r\n subView,\r\n className,\r\n handleBack\r\n}: MobileTopContainerProps): JSX.Element => {\r\n const translation = useLocaleStore((state) => state.currentTranslations)\r\n\r\n return (\r\n <React.Fragment>\r\n <BackButton\r\n title={translation.common.back}\r\n className='rf-text-sm'\r\n handleBack={handleBack}\r\n />\r\n {subView && (\r\n <MobileIconAndTitle subView={subView} className={className} />\r\n )}\r\n </React.Fragment>\r\n )\r\n}\r\n\r\nexport default MobileTopContainer\r\n","import React from 'react'\r\nimport { AvailableViews } from '../../../models/enums'\r\nimport { useLocaleStore } from '../../Contexts/LocaleContext'\r\nimport * as Icons from '../../Icons/ViewIcons'\r\n\r\ninterface MobileIconAndTitleProps {\r\n subView: number\r\n className?: string\r\n}\r\n\r\nconst iconClassname = 'rf-h-8 rf-w-8'\r\n\r\nconst MobileIconAndTitle = ({\r\n subView,\r\n className\r\n}: MobileIconAndTitleProps): JSX.Element => {\r\n const translation = useLocaleStore((state) => state.currentTranslations)\r\n\r\n return (\r\n <div\r\n className={`large:rf-hidden rf-py-2 rf-flex rf-flex-row rf-items-end ${className}`}\r\n >\r\n {/* Icon */}\r\n {subView === AvailableViews.weather ? (\r\n <Icons.WeatherIcon className={iconClassname} />\r\n ) : subView === AvailableViews.emergency ? (\r\n <Icons.EmergencyIcon className={iconClassname} />\r\n ) : (\r\n <React.Fragment />\r\n )}\r\n {/* Title */}\r\n <div className='rf-ml-2 rf-capitalize rf-subtitle-size-auto'>\r\n {translation[subView]}\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default MobileIconAndTitle\r\n","import React from 'react'\r\nimport { AvailableViews } from '../../../models/enums'\r\nimport { useLocaleStore } from '../../Contexts/LocaleContext'\r\nimport * as Icons from '../../Icons/ViewIcons'\r\n\r\ninterface LargeIconAndTitleProps {\r\n subView: number\r\n className?: string\r\n}\r\n\r\nconst iconClassname =\r\n 'rf-h-16 rf-w-16 large-vertical:rf-h-24 large-vertical:rf-w-24'\r\n\r\nconst LargeIconAndTitle = ({\r\n subView,\r\n className\r\n}: LargeIconAndTitleProps): JSX.Element => {\r\n const translation = useLocaleStore((state) => state.currentTranslations)\r\n\r\n return (\r\n <div\r\n className={`rf-hidden large:rf-flex rf-w-full rf-pt-4 large-vertical:rf-pt-8 rf-pl-4 large-vertical:rf-pl-0 rf-flex-row rf-justify-start large-vertical:rf-justify-center rf-items-center ${className}`}\r\n >\r\n {/* Icon */}\r\n {subView === AvailableViews.weather ? (\r\n <Icons.WeatherIcon className={iconClassname} />\r\n ) : subView === AvailableViews.emergency ? (\r\n <Icons.EmergencyIcon className={iconClassname} />\r\n ) : (\r\n <React.Fragment />\r\n )}\r\n {/* Title */}\r\n <div className='rf-ml-2 rf-uppercase rf-text-[#575F6B] rf-subtitle-size-auto'>\r\n {translation[subView]}\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default LargeIconAndTitle\r\n","import React, { useEffect, useState } from 'react'\r\nimport QRCode from 'qrcode'\r\nimport { useRetorikStore } from '../Contexts/RetorikContext'\r\nimport QRCodeComponent from '../Utils/QRCodeComponent'\r\n\r\nconst OpenMeteoAttribution = (): JSX.Element => {\r\n const isUsedOnBorne = useRetorikStore(\r\n (state) => state.configuration.isUsedOnBorne\r\n )\r\n const [qrCodeData, setQrCodeData] = useState<string>()\r\n const [showQrCode, setShowQrCode] = useState<boolean>(false)\r\n\r\n const setQrCodeDataAsync = async (): Promise<void> => {\r\n const qrCodeString = await QRCode.toDataURL('https://open-meteo.com/')\r\n setQrCodeData(qrCodeString)\r\n }\r\n\r\n useEffect(() => {\r\n isUsedOnBorne && setQrCodeDataAsync()\r\n }, [isUsedOnBorne])\r\n\r\n const handleClick = (): void => {\r\n setShowQrCode((current) => !current)\r\n }\r\n\r\n return (\r\n <div className='rf-w-full rf-py-2 rf-flex rf-justify-center'>\r\n {isUsedOnBorne ? (\r\n <React.Fragment>\r\n <div\r\n className='rf-relative rf-text-sm hover:rf-cursor-pointer'\r\n onClick={handleClick}\r\n >\r\n Weather data by Open-Meteo.com\r\n {showQrCode && qrCodeData ? (\r\n <div className='rf-absolute rf-left-1/2 rf-top-0 -rf-translate-x-1/2 -rf-translate-y-full'>\r\n <QRCodeComponent src={qrCodeData} />\r\n </div>\r\n ) : (\r\n <React.Fragment />\r\n )}\r\n </div>\r\n </React.Fragment>\r\n ) : (\r\n <a\r\n href='https://open-meteo.com/'\r\n target='_blank'\r\n rel='noreferrer noopener'\r\n className='rf-text-sm'\r\n >\r\n Weather data by open-meteo.com\r\n </a>\r\n )}\r\n </div>\r\n )\r\n}\r\n\r\nexport default OpenMeteoAttribution\r\n"],"names":[],"version":3,"file":"Weather.661c2cac.js.map","sourceRoot":"../"}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import {jsxs as $cCOLM$jsxs, jsx as $cCOLM$jsx} from "react/jsx-runtime";
|
|
2
|
+
import $cCOLM$react, {useState as $cCOLM$useState, useEffect as $cCOLM$useEffect} from "react";
|
|
3
|
+
import $cCOLM$daviairetorikweather from "@davi-ai/retorik-weather";
|
|
4
|
+
import $cCOLM$qrcode from "qrcode";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function $parcel$defineInteropFlag(a) {
|
|
8
|
+
Object.defineProperty(a, '__esModule', {value: true, configurable: true});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function $parcel$export(e, n, v, s) {
|
|
12
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
var $parcel$global = globalThis;
|
|
16
|
+
var parcelRequire = $parcel$global["parcelRequirea39d"];
|
|
17
|
+
var parcelRegister = parcelRequire.register;
|
|
18
|
+
parcelRegister("2pbjN", function(module, exports) {
|
|
19
|
+
|
|
20
|
+
$parcel$defineInteropFlag(module.exports);
|
|
21
|
+
|
|
22
|
+
$parcel$export(module.exports, "default", () => $c2365f1c5aa7ab18$export$2e2bcd8739ae039);
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var $2fuDN = parcelRequire("2fuDN");
|
|
28
|
+
|
|
29
|
+
var $j67YK = parcelRequire("j67YK");
|
|
30
|
+
|
|
31
|
+
var $1x02c = parcelRequire("1x02c");
|
|
32
|
+
|
|
33
|
+
var $1Qww3 = parcelRequire("1Qww3");
|
|
34
|
+
|
|
35
|
+
var $aNpqK = parcelRequire("aNpqK");
|
|
36
|
+
|
|
37
|
+
var $4ucVo = parcelRequire("4ucVo");
|
|
38
|
+
|
|
39
|
+
var $gQ55S = parcelRequire("gQ55S");
|
|
40
|
+
|
|
41
|
+
var $e2B0Y = parcelRequire("e2B0Y");
|
|
42
|
+
|
|
43
|
+
var $fshO3 = parcelRequire("fshO3");
|
|
44
|
+
|
|
45
|
+
var $9uOFS = parcelRequire("9uOFS");
|
|
46
|
+
|
|
47
|
+
var $7suBk = parcelRequire("7suBk");
|
|
48
|
+
const $c2365f1c5aa7ab18$var$Weather = ({ handleClose: handleClose })=>{
|
|
49
|
+
const locale = (0, $2fuDN.useLocaleStore)((state)=>state.locale);
|
|
50
|
+
const configuration = (0, $1x02c.useRetorikStore)((state)=>state.configuration);
|
|
51
|
+
const currentDeviceType = (0, $1Qww3.useViewStore)((state)=>state.currentDeviceType);
|
|
52
|
+
const isMobile = (0, $1Qww3.useViewStore)((state)=>state.isMobile);
|
|
53
|
+
const setCurrentSubView = (0, $j67YK.useUtilsStore)((state)=>state.actions.setCurrentSubView);
|
|
54
|
+
const sendEvent = (0, $aNpqK.useDirectlineStore)((state)=>state.actions.sendEvent);
|
|
55
|
+
/**
|
|
56
|
+
* On call :
|
|
57
|
+
* - set RetorikContext's displayWeather state to false
|
|
58
|
+
*/ const handleBack = ()=>{
|
|
59
|
+
sendEvent('Davi.CloseWindow', null);
|
|
60
|
+
sendEvent('Davi.CloseWindowWeather', null);
|
|
61
|
+
handleClose ? handleClose() : setCurrentSubView((0, $4ucVo.CurrentSubView).none);
|
|
62
|
+
};
|
|
63
|
+
return isMobile ? /*#__PURE__*/ (0, $cCOLM$jsxs)((0, $gQ55S.FullScreenMobile), {
|
|
64
|
+
depth: (0, $4ucVo.Depth).dropdown,
|
|
65
|
+
background: "#FFFFFF",
|
|
66
|
+
children: [
|
|
67
|
+
/*#__PURE__*/ (0, $cCOLM$jsx)((0, $e2B0Y.default), {
|
|
68
|
+
subView: (0, $4ucVo.AvailableViews).weather,
|
|
69
|
+
className: "rf-border-b rf-border-b-menuBorder",
|
|
70
|
+
handleBack: handleBack
|
|
71
|
+
}),
|
|
72
|
+
/*#__PURE__*/ (0, $cCOLM$jsx)((0, $cCOLM$daviairetorikweather), {
|
|
73
|
+
locale: locale,
|
|
74
|
+
deviceType: currentDeviceType,
|
|
75
|
+
position: {
|
|
76
|
+
latitude: configuration.position?.latitude || 0,
|
|
77
|
+
longitude: configuration.position?.longitude || 0
|
|
78
|
+
}
|
|
79
|
+
}),
|
|
80
|
+
/*#__PURE__*/ (0, $cCOLM$jsx)((0, $7suBk.default), {})
|
|
81
|
+
]
|
|
82
|
+
}) : /*#__PURE__*/ (0, $cCOLM$jsxs)((0, $gQ55S.FullScreen), {
|
|
83
|
+
depth: (0, $4ucVo.Depth).dropdown,
|
|
84
|
+
background: "linear-gradient(to right bottom, #F2F8F8FC , #F2E1E2E8)",
|
|
85
|
+
onClick: handleBack,
|
|
86
|
+
children: [
|
|
87
|
+
/*#__PURE__*/ (0, $cCOLM$jsxs)("div", {
|
|
88
|
+
className: "rf-h-full rf-w-full rf-flex rf-flex-col rf-items-center",
|
|
89
|
+
children: [
|
|
90
|
+
/*#__PURE__*/ (0, $cCOLM$jsx)((0, $fshO3.default), {
|
|
91
|
+
subView: (0, $4ucVo.AvailableViews).weather
|
|
92
|
+
}),
|
|
93
|
+
/*#__PURE__*/ (0, $cCOLM$jsx)((0, $cCOLM$daviairetorikweather), {
|
|
94
|
+
locale: locale,
|
|
95
|
+
deviceType: currentDeviceType,
|
|
96
|
+
position: {
|
|
97
|
+
latitude: configuration.position?.latitude || 0,
|
|
98
|
+
longitude: configuration.position?.longitude || 0
|
|
99
|
+
}
|
|
100
|
+
}),
|
|
101
|
+
/*#__PURE__*/ (0, $cCOLM$jsx)((0, $7suBk.default), {})
|
|
102
|
+
]
|
|
103
|
+
}),
|
|
104
|
+
/*#__PURE__*/ (0, $cCOLM$jsx)((0, $9uOFS.default), {
|
|
105
|
+
dashboardVisible: true,
|
|
106
|
+
onClick: handleBack
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
var $c2365f1c5aa7ab18$export$2e2bcd8739ae039 = $c2365f1c5aa7ab18$var$Weather;
|
|
112
|
+
|
|
113
|
+
});
|
|
114
|
+
parcelRegister("e2B0Y", function(module, exports) {
|
|
115
|
+
|
|
116
|
+
$parcel$export(module.exports, "default", () => $24f0b093ea089a6f$export$2e2bcd8739ae039);
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
var $2fuDN = parcelRequire("2fuDN");
|
|
121
|
+
|
|
122
|
+
var $28ved = parcelRequire("28ved");
|
|
123
|
+
|
|
124
|
+
var $iaKFs = parcelRequire("iaKFs");
|
|
125
|
+
const $24f0b093ea089a6f$var$MobileTopContainer = ({ subView: subView, className: className, handleBack: handleBack })=>{
|
|
126
|
+
const translation = (0, $2fuDN.useLocaleStore)((state)=>state.currentTranslations);
|
|
127
|
+
return /*#__PURE__*/ (0, $cCOLM$jsxs)((0, $cCOLM$react).Fragment, {
|
|
128
|
+
children: [
|
|
129
|
+
/*#__PURE__*/ (0, $cCOLM$jsx)((0, $28ved.BackButton), {
|
|
130
|
+
title: translation.common.back,
|
|
131
|
+
className: "rf-text-sm",
|
|
132
|
+
handleBack: handleBack
|
|
133
|
+
}),
|
|
134
|
+
subView && /*#__PURE__*/ (0, $cCOLM$jsx)((0, $iaKFs.default), {
|
|
135
|
+
subView: subView,
|
|
136
|
+
className: className
|
|
137
|
+
})
|
|
138
|
+
]
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
var $24f0b093ea089a6f$export$2e2bcd8739ae039 = $24f0b093ea089a6f$var$MobileTopContainer;
|
|
142
|
+
|
|
143
|
+
});
|
|
144
|
+
parcelRegister("iaKFs", function(module, exports) {
|
|
145
|
+
|
|
146
|
+
$parcel$export(module.exports, "default", () => $c34cf20fdff0eb66$export$2e2bcd8739ae039);
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
var $4ucVo = parcelRequire("4ucVo");
|
|
151
|
+
|
|
152
|
+
var $2fuDN = parcelRequire("2fuDN");
|
|
153
|
+
|
|
154
|
+
var $41ZLl = parcelRequire("41ZLl");
|
|
155
|
+
const $c34cf20fdff0eb66$var$iconClassname = 'rf-h-8 rf-w-8';
|
|
156
|
+
const $c34cf20fdff0eb66$var$MobileIconAndTitle = ({ subView: subView, className: className })=>{
|
|
157
|
+
const translation = (0, $2fuDN.useLocaleStore)((state)=>state.currentTranslations);
|
|
158
|
+
return /*#__PURE__*/ (0, $cCOLM$jsxs)("div", {
|
|
159
|
+
className: `large:rf-hidden rf-py-2 rf-flex rf-flex-row rf-items-end ${className}`,
|
|
160
|
+
children: [
|
|
161
|
+
subView === (0, $4ucVo.AvailableViews).weather ? /*#__PURE__*/ (0, $cCOLM$jsx)($41ZLl.WeatherIcon, {
|
|
162
|
+
className: $c34cf20fdff0eb66$var$iconClassname
|
|
163
|
+
}) : subView === (0, $4ucVo.AvailableViews).emergency ? /*#__PURE__*/ (0, $cCOLM$jsx)($41ZLl.EmergencyIcon, {
|
|
164
|
+
className: $c34cf20fdff0eb66$var$iconClassname
|
|
165
|
+
}) : /*#__PURE__*/ (0, $cCOLM$jsx)((0, $cCOLM$react).Fragment, {}),
|
|
166
|
+
/*#__PURE__*/ (0, $cCOLM$jsx)("div", {
|
|
167
|
+
className: "rf-ml-2 rf-capitalize rf-subtitle-size-auto",
|
|
168
|
+
children: translation[subView]
|
|
169
|
+
})
|
|
170
|
+
]
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
var $c34cf20fdff0eb66$export$2e2bcd8739ae039 = $c34cf20fdff0eb66$var$MobileIconAndTitle;
|
|
174
|
+
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
parcelRegister("fshO3", function(module, exports) {
|
|
179
|
+
|
|
180
|
+
$parcel$export(module.exports, "default", () => $c0be9b86124f1061$export$2e2bcd8739ae039);
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
var $4ucVo = parcelRequire("4ucVo");
|
|
185
|
+
|
|
186
|
+
var $2fuDN = parcelRequire("2fuDN");
|
|
187
|
+
|
|
188
|
+
var $41ZLl = parcelRequire("41ZLl");
|
|
189
|
+
const $c0be9b86124f1061$var$iconClassname = 'rf-h-16 rf-w-16 large-vertical:rf-h-24 large-vertical:rf-w-24';
|
|
190
|
+
const $c0be9b86124f1061$var$LargeIconAndTitle = ({ subView: subView, className: className })=>{
|
|
191
|
+
const translation = (0, $2fuDN.useLocaleStore)((state)=>state.currentTranslations);
|
|
192
|
+
return /*#__PURE__*/ (0, $cCOLM$jsxs)("div", {
|
|
193
|
+
className: `rf-hidden large:rf-flex rf-w-full rf-pt-4 large-vertical:rf-pt-8 rf-pl-4 large-vertical:rf-pl-0 rf-flex-row rf-justify-start large-vertical:rf-justify-center rf-items-center ${className}`,
|
|
194
|
+
children: [
|
|
195
|
+
subView === (0, $4ucVo.AvailableViews).weather ? /*#__PURE__*/ (0, $cCOLM$jsx)($41ZLl.WeatherIcon, {
|
|
196
|
+
className: $c0be9b86124f1061$var$iconClassname
|
|
197
|
+
}) : subView === (0, $4ucVo.AvailableViews).emergency ? /*#__PURE__*/ (0, $cCOLM$jsx)($41ZLl.EmergencyIcon, {
|
|
198
|
+
className: $c0be9b86124f1061$var$iconClassname
|
|
199
|
+
}) : /*#__PURE__*/ (0, $cCOLM$jsx)((0, $cCOLM$react).Fragment, {}),
|
|
200
|
+
/*#__PURE__*/ (0, $cCOLM$jsx)("div", {
|
|
201
|
+
className: "rf-ml-2 rf-uppercase rf-text-[#575F6B] rf-subtitle-size-auto",
|
|
202
|
+
children: translation[subView]
|
|
203
|
+
})
|
|
204
|
+
]
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
var $c0be9b86124f1061$export$2e2bcd8739ae039 = $c0be9b86124f1061$var$LargeIconAndTitle;
|
|
208
|
+
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
parcelRegister("7suBk", function(module, exports) {
|
|
212
|
+
|
|
213
|
+
$parcel$export(module.exports, "default", () => $954e5588fc9f219b$export$2e2bcd8739ae039);
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
var $1x02c = parcelRequire("1x02c");
|
|
219
|
+
|
|
220
|
+
var $3mANd = parcelRequire("3mANd");
|
|
221
|
+
const $954e5588fc9f219b$var$OpenMeteoAttribution = ()=>{
|
|
222
|
+
const isUsedOnBorne = (0, $1x02c.useRetorikStore)((state)=>state.configuration.isUsedOnBorne);
|
|
223
|
+
const [qrCodeData, setQrCodeData] = (0, $cCOLM$useState)();
|
|
224
|
+
const [showQrCode, setShowQrCode] = (0, $cCOLM$useState)(false);
|
|
225
|
+
const setQrCodeDataAsync = async ()=>{
|
|
226
|
+
const qrCodeString = await (0, $cCOLM$qrcode).toDataURL('https://open-meteo.com/');
|
|
227
|
+
setQrCodeData(qrCodeString);
|
|
228
|
+
};
|
|
229
|
+
(0, $cCOLM$useEffect)(()=>{
|
|
230
|
+
isUsedOnBorne && setQrCodeDataAsync();
|
|
231
|
+
}, [
|
|
232
|
+
isUsedOnBorne
|
|
233
|
+
]);
|
|
234
|
+
const handleClick = ()=>{
|
|
235
|
+
setShowQrCode((current)=>!current);
|
|
236
|
+
};
|
|
237
|
+
return /*#__PURE__*/ (0, $cCOLM$jsx)("div", {
|
|
238
|
+
className: "rf-w-full rf-py-2 rf-flex rf-justify-center",
|
|
239
|
+
children: isUsedOnBorne ? /*#__PURE__*/ (0, $cCOLM$jsx)((0, $cCOLM$react).Fragment, {
|
|
240
|
+
children: /*#__PURE__*/ (0, $cCOLM$jsxs)("div", {
|
|
241
|
+
className: "rf-relative rf-text-sm hover:rf-cursor-pointer",
|
|
242
|
+
onClick: handleClick,
|
|
243
|
+
children: [
|
|
244
|
+
"Weather data by Open-Meteo.com",
|
|
245
|
+
showQrCode && qrCodeData ? /*#__PURE__*/ (0, $cCOLM$jsx)("div", {
|
|
246
|
+
className: "rf-absolute rf-left-1/2 rf-top-0 -rf-translate-x-1/2 -rf-translate-y-full",
|
|
247
|
+
children: /*#__PURE__*/ (0, $cCOLM$jsx)((0, $3mANd.default), {
|
|
248
|
+
src: qrCodeData
|
|
249
|
+
})
|
|
250
|
+
}) : /*#__PURE__*/ (0, $cCOLM$jsx)((0, $cCOLM$react).Fragment, {})
|
|
251
|
+
]
|
|
252
|
+
})
|
|
253
|
+
}) : /*#__PURE__*/ (0, $cCOLM$jsx)("a", {
|
|
254
|
+
href: "https://open-meteo.com/",
|
|
255
|
+
target: "_blank",
|
|
256
|
+
rel: "noreferrer noopener",
|
|
257
|
+
className: "rf-text-sm",
|
|
258
|
+
children: "Weather data by open-meteo.com"
|
|
259
|
+
})
|
|
260
|
+
});
|
|
261
|
+
};
|
|
262
|
+
var $954e5588fc9f219b$export$2e2bcd8739ae039 = $954e5588fc9f219b$var$OpenMeteoAttribution;
|
|
263
|
+
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
//# sourceMappingURL=Weather.fb22fba3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,gCAAU,CAAC,eAAE,WAAW,EAAgB;IAC5C,MAAM,SAAS,CAAA,GAAA,qBAAa,EAAE,CAAC,QAAU,MAAM,MAAM;IACrD,MAAM,gBAAgB,CAAA,GAAA,sBAAc,EAAE,CAAC,QAAU,MAAM,aAAa;IACpE,MAAM,oBAAoB,CAAA,GAAA,mBAAW,EAAE,CAAC,QAAU,MAAM,iBAAiB;IACzE,MAAM,WAAW,CAAA,GAAA,mBAAW,EAAE,CAAC,QAAU,MAAM,QAAQ;IACvD,MAAM,oBAAoB,CAAA,GAAA,oBAAY,EAAE,CAAC,QAAU,MAAM,OAAO,CAAC,iBAAiB;IAClF,MAAM,YAAY,CAAA,GAAA,yBAAiB,EAAE,CAAC,QAAU,MAAM,OAAO,CAAC,SAAS;IAEvE;;;GAGC,GACD,MAAM,aAAa;QACjB,UAAU,oBAAoB;QAC9B,UAAU,2BAA2B;QACrC,cAAc,gBAAgB,kBAAkB,CAAA,GAAA,qBAAa,EAAE,IAAI;IACrE;IAEA,OAAO,yBACL,iBAAC,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,GAAG,CAAA,GAAA,eAAO,EAAW;IAEtD,MAAM,qBAAqB;QACzB,MAAM,eAAe,MAAM,CAAA,GAAA,aAAK,EAAE,SAAS,CAAC;QAC5C,cAAc;IAChB;IAEA,CAAA,GAAA,gBAAQ,EAAE;QACR,iBAAiB;IACnB,GAAG;QAAC;KAAc;IAElB,MAAM,cAAc;QAClB,cAAc,CAAC,UAAY,CAAC;IAC9B;IAEA,qBACE,gBAAC;QAAI,WAAU;kBACZ,8BACC,gBAAC,CAAA,GAAA,YAAI,EAAE,QAAQ;sBACb,cAAA,iBAAC;gBACC,WAAU;gBACV,SAAS;;oBACV;oBAEE,cAAc,2BACb,gBAAC;wBAAI,WAAU;kCACb,cAAA,gBAAC,CAAA,GAAA,cAAc;4BAAE,KAAK;;uCAGxB,gBAAC,CAAA,GAAA,YAAI,EAAE,QAAQ;;;2BAKrB,gBAAC;YACC,MAAK;YACL,QAAO;YACP,KAAI;YACJ,WAAU;sBACX;;;AAMT;IAEA,2CAAe","sources":["src/components/Weather/Weather.tsx","src/components/Utils/SubView/MobileTopContainer.tsx","src/components/Utils/SubView/MobileIconAndTitle.tsx","src/components/Utils/SubView/LargeIconAndTitle.tsx","src/components/Weather/OpenMeteoAttribution.tsx"],"sourcesContent":["import React from 'react'\r\nimport WeatherContent from '@davi-ai/retorik-weather'\r\n\r\nimport { useLocaleStore } from '../Contexts/LocaleContext'\r\nimport { useUtilsStore } from '../Contexts/UtilsContext'\r\nimport { useRetorikStore } from '../Contexts/RetorikContext'\r\nimport { useViewStore } from '../Contexts/ViewContext'\r\nimport { useDirectlineStore } from '../Contexts/DirectlineContext'\r\n\r\nimport { AvailableViews, CurrentSubView, Depth } from '../../models/enums'\r\n\r\nimport { FullScreen, FullScreenMobile } from '../Templates'\r\nimport MobileTopContainer from '../Utils/SubView/MobileTopContainer'\r\nimport LargeIconAndTitle from '../Utils/SubView/LargeIconAndTitle'\r\nimport AbsoluteLargeClosingButton from '../Utils/SubView/AbsoluteLargeClosingButton'\r\nimport OpenMeteoAttribution from './OpenMeteoAttribution'\r\n\r\ninterface WeatherProps {\r\n handleClose?: () => void\r\n}\r\n\r\nconst Weather = ({ handleClose }: WeatherProps): JSX.Element => {\r\n const locale = useLocaleStore((state) => state.locale)\r\n const configuration = useRetorikStore((state) => state.configuration)\r\n const currentDeviceType = useViewStore((state) => state.currentDeviceType)\r\n const isMobile = useViewStore((state) => state.isMobile)\r\n const setCurrentSubView = useUtilsStore((state) => state.actions.setCurrentSubView)\r\n const sendEvent = useDirectlineStore((state) => state.actions.sendEvent)\r\n\r\n /**\r\n * On call :\r\n * - set RetorikContext's displayWeather state to false\r\n */\r\n const handleBack = (): void => {\r\n sendEvent('Davi.CloseWindow', null)\r\n sendEvent('Davi.CloseWindowWeather', null)\r\n handleClose ? handleClose() : setCurrentSubView(CurrentSubView.none)\r\n }\r\n\r\n return isMobile ? (\r\n <FullScreenMobile depth={Depth.dropdown} background='#FFFFFF'>\r\n {/* Top container : back button + weather icon + title */}\r\n <MobileTopContainer subView={AvailableViews.weather} className='rf-border-b rf-border-b-menuBorder' handleBack={handleBack} />\r\n\r\n {/* Weather data */}\r\n <WeatherContent\r\n locale={locale}\r\n deviceType={currentDeviceType}\r\n position={{\r\n latitude: configuration.position?.latitude || 0,\r\n longitude: configuration.position?.longitude || 0\r\n }}\r\n />\r\n\r\n <OpenMeteoAttribution />\r\n </FullScreenMobile>\r\n ) : (\r\n <FullScreen depth={Depth.dropdown} background='linear-gradient(to right bottom, #F2F8F8FC , #F2E1E2E8)' onClick={handleBack}>\r\n <div className='rf-h-full rf-w-full rf-flex rf-flex-col rf-items-center'>\r\n {/* Weather icon + text */}\r\n <LargeIconAndTitle subView={AvailableViews.weather} />\r\n\r\n {/* Weather data */}\r\n <WeatherContent\r\n locale={locale}\r\n deviceType={currentDeviceType}\r\n position={{\r\n latitude: configuration.position?.latitude || 0,\r\n longitude: configuration.position?.longitude || 0\r\n }}\r\n />\r\n\r\n <OpenMeteoAttribution />\r\n </div>\r\n\r\n {/* Closing button */}\r\n <AbsoluteLargeClosingButton dashboardVisible={true} onClick={handleBack} />\r\n </FullScreen>\r\n )\r\n}\r\n\r\nexport default Weather\r\n","import React from 'react'\r\nimport { useLocaleStore } from '../../Contexts/LocaleContext'\r\nimport { BackButton } from '../../Menu/Common'\r\nimport MobileIconAndTitle from './MobileIconAndTitle'\r\n\r\ninterface MobileTopContainerProps {\r\n subView?: number\r\n className?: string\r\n handleBack: () => void\r\n}\r\n\r\nconst MobileTopContainer = ({\r\n subView,\r\n className,\r\n handleBack\r\n}: MobileTopContainerProps): JSX.Element => {\r\n const translation = useLocaleStore((state) => state.currentTranslations)\r\n\r\n return (\r\n <React.Fragment>\r\n <BackButton\r\n title={translation.common.back}\r\n className='rf-text-sm'\r\n handleBack={handleBack}\r\n />\r\n {subView && (\r\n <MobileIconAndTitle subView={subView} className={className} />\r\n )}\r\n </React.Fragment>\r\n )\r\n}\r\n\r\nexport default MobileTopContainer\r\n","import React from 'react'\r\nimport { AvailableViews } from '../../../models/enums'\r\nimport { useLocaleStore } from '../../Contexts/LocaleContext'\r\nimport * as Icons from '../../Icons/ViewIcons'\r\n\r\ninterface MobileIconAndTitleProps {\r\n subView: number\r\n className?: string\r\n}\r\n\r\nconst iconClassname = 'rf-h-8 rf-w-8'\r\n\r\nconst MobileIconAndTitle = ({\r\n subView,\r\n className\r\n}: MobileIconAndTitleProps): JSX.Element => {\r\n const translation = useLocaleStore((state) => state.currentTranslations)\r\n\r\n return (\r\n <div\r\n className={`large:rf-hidden rf-py-2 rf-flex rf-flex-row rf-items-end ${className}`}\r\n >\r\n {/* Icon */}\r\n {subView === AvailableViews.weather ? (\r\n <Icons.WeatherIcon className={iconClassname} />\r\n ) : subView === AvailableViews.emergency ? (\r\n <Icons.EmergencyIcon className={iconClassname} />\r\n ) : (\r\n <React.Fragment />\r\n )}\r\n {/* Title */}\r\n <div className='rf-ml-2 rf-capitalize rf-subtitle-size-auto'>\r\n {translation[subView]}\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default MobileIconAndTitle\r\n","import React from 'react'\r\nimport { AvailableViews } from '../../../models/enums'\r\nimport { useLocaleStore } from '../../Contexts/LocaleContext'\r\nimport * as Icons from '../../Icons/ViewIcons'\r\n\r\ninterface LargeIconAndTitleProps {\r\n subView: number\r\n className?: string\r\n}\r\n\r\nconst iconClassname =\r\n 'rf-h-16 rf-w-16 large-vertical:rf-h-24 large-vertical:rf-w-24'\r\n\r\nconst LargeIconAndTitle = ({\r\n subView,\r\n className\r\n}: LargeIconAndTitleProps): JSX.Element => {\r\n const translation = useLocaleStore((state) => state.currentTranslations)\r\n\r\n return (\r\n <div\r\n className={`rf-hidden large:rf-flex rf-w-full rf-pt-4 large-vertical:rf-pt-8 rf-pl-4 large-vertical:rf-pl-0 rf-flex-row rf-justify-start large-vertical:rf-justify-center rf-items-center ${className}`}\r\n >\r\n {/* Icon */}\r\n {subView === AvailableViews.weather ? (\r\n <Icons.WeatherIcon className={iconClassname} />\r\n ) : subView === AvailableViews.emergency ? (\r\n <Icons.EmergencyIcon className={iconClassname} />\r\n ) : (\r\n <React.Fragment />\r\n )}\r\n {/* Title */}\r\n <div className='rf-ml-2 rf-uppercase rf-text-[#575F6B] rf-subtitle-size-auto'>\r\n {translation[subView]}\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default LargeIconAndTitle\r\n","import React, { useEffect, useState } from 'react'\r\nimport QRCode from 'qrcode'\r\nimport { useRetorikStore } from '../Contexts/RetorikContext'\r\nimport QRCodeComponent from '../Utils/QRCodeComponent'\r\n\r\nconst OpenMeteoAttribution = (): JSX.Element => {\r\n const isUsedOnBorne = useRetorikStore(\r\n (state) => state.configuration.isUsedOnBorne\r\n )\r\n const [qrCodeData, setQrCodeData] = useState<string>()\r\n const [showQrCode, setShowQrCode] = useState<boolean>(false)\r\n\r\n const setQrCodeDataAsync = async (): Promise<void> => {\r\n const qrCodeString = await QRCode.toDataURL('https://open-meteo.com/')\r\n setQrCodeData(qrCodeString)\r\n }\r\n\r\n useEffect(() => {\r\n isUsedOnBorne && setQrCodeDataAsync()\r\n }, [isUsedOnBorne])\r\n\r\n const handleClick = (): void => {\r\n setShowQrCode((current) => !current)\r\n }\r\n\r\n return (\r\n <div className='rf-w-full rf-py-2 rf-flex rf-justify-center'>\r\n {isUsedOnBorne ? (\r\n <React.Fragment>\r\n <div\r\n className='rf-relative rf-text-sm hover:rf-cursor-pointer'\r\n onClick={handleClick}\r\n >\r\n Weather data by Open-Meteo.com\r\n {showQrCode && qrCodeData ? (\r\n <div className='rf-absolute rf-left-1/2 rf-top-0 -rf-translate-x-1/2 -rf-translate-y-full'>\r\n <QRCodeComponent src={qrCodeData} />\r\n </div>\r\n ) : (\r\n <React.Fragment />\r\n )}\r\n </div>\r\n </React.Fragment>\r\n ) : (\r\n <a\r\n href='https://open-meteo.com/'\r\n target='_blank'\r\n rel='noreferrer noopener'\r\n className='rf-text-sm'\r\n >\r\n Weather data by open-meteo.com\r\n </a>\r\n )}\r\n </div>\r\n )\r\n}\r\n\r\nexport default OpenMeteoAttribution\r\n"],"names":[],"version":3,"file":"Weather.fb22fba3.js.map"}
|