@blipit/react-native 0.2.1 → 0.3.0
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 +4 -0
- package/README.md +18 -0
- package/dist/index.cjs +934 -9
- package/dist/index.d.cts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +947 -1
- package/package.json +12 -4
package/dist/index.cjs
CHANGED
|
@@ -30,25 +30,930 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
BlipitReporter: () => BlipitReporter,
|
|
33
34
|
DEFAULT_ENDPOINT: () => DEFAULT_ENDPOINT,
|
|
34
35
|
VERSION: () => VERSION,
|
|
35
|
-
addBreadcrumb: () =>
|
|
36
|
-
captureException: () =>
|
|
37
|
-
captureMessage: () =>
|
|
36
|
+
addBreadcrumb: () => import_react_native3.addBreadcrumb,
|
|
37
|
+
captureException: () => import_react_native3.captureException,
|
|
38
|
+
captureMessage: () => import_react_native3.captureMessage,
|
|
38
39
|
captureSecurity: () => captureSecurity,
|
|
39
40
|
dsn: () => dsn,
|
|
40
|
-
flush: () =>
|
|
41
|
+
flush: () => import_react_native3.flush,
|
|
41
42
|
init: () => init2,
|
|
42
|
-
setTag: () =>
|
|
43
|
-
setUser: () =>
|
|
43
|
+
setTag: () => import_react_native3.setTag,
|
|
44
|
+
setUser: () => import_react_native3.setUser,
|
|
45
|
+
showReport: () => showReport,
|
|
44
46
|
withIdentity: () => withIdentity,
|
|
45
|
-
wrap: () =>
|
|
47
|
+
wrap: () => import_react_native3.wrap
|
|
46
48
|
});
|
|
47
49
|
module.exports = __toCommonJS(index_exports);
|
|
48
50
|
var Sentry = __toESM(require("@sentry/react-native"), 1);
|
|
49
|
-
var
|
|
51
|
+
var import_react_native2 = require("react-native");
|
|
52
|
+
|
|
53
|
+
// src/report-strings.ts
|
|
54
|
+
var REPORT_STRINGS = {
|
|
55
|
+
"en": {
|
|
56
|
+
"title": "Report a bug",
|
|
57
|
+
"mHow": "How do you want to show the problem?",
|
|
58
|
+
"mShot": "Take a screenshot",
|
|
59
|
+
"mVideo": "Record a video",
|
|
60
|
+
"mVideoSub": "Show the problem as it happens",
|
|
61
|
+
"mSkip": "Skip, just describe it",
|
|
62
|
+
"mNext": "Next",
|
|
63
|
+
"mBack": "Back",
|
|
64
|
+
"mZoomIn": "Zoom in",
|
|
65
|
+
"mZoomOut": "Zoom out",
|
|
66
|
+
"mFit": "Fit to screen",
|
|
67
|
+
"pen": "Draw",
|
|
68
|
+
"rect": "Rectangle",
|
|
69
|
+
"arrow": "Arrow",
|
|
70
|
+
"undo": "Undo",
|
|
71
|
+
"fTitle": "Title",
|
|
72
|
+
"fDesc": "What happened?",
|
|
73
|
+
"email": "Email (optional)",
|
|
74
|
+
"send": "Send report",
|
|
75
|
+
"sending": "Sending report\u2026",
|
|
76
|
+
"error": "That did not send. Please try again.",
|
|
77
|
+
"required": "Please fill in the title and what happened.",
|
|
78
|
+
"sentTitle": "Report sent",
|
|
79
|
+
"sentRef": "Report {ref} sent",
|
|
80
|
+
"recordTitle": "Screen recording",
|
|
81
|
+
"stop": "Stop",
|
|
82
|
+
"recDenied": "Screen sharing was blocked. Allow it in your browser to record.",
|
|
83
|
+
"recError": "The recording could not be made. You can still send the report.",
|
|
84
|
+
"uploadingVideo": "Uploading recording\u2026",
|
|
85
|
+
"close": "Close",
|
|
86
|
+
"noShot": "The screenshot could not be taken. You can still send the report."
|
|
87
|
+
},
|
|
88
|
+
"ar": {
|
|
89
|
+
"title": "\u0627\u0644\u0625\u0628\u0644\u0627\u063A \u0639\u0646 \u062E\u0637\u0623",
|
|
90
|
+
"mHow": "\u0643\u064A\u0641 \u062A\u0631\u064A\u062F \u0623\u0646 \u062A\u0648\u0636\u0651\u062D \u0627\u0644\u0645\u0634\u0643\u0644\u0629\u061F",
|
|
91
|
+
"mShot": "\u0627\u0644\u062A\u0642\u0627\u0637 \u0644\u0642\u0637\u0629 \u0634\u0627\u0634\u0629",
|
|
92
|
+
"mVideo": "\u062A\u0633\u062C\u064A\u0644 \u0641\u064A\u062F\u064A\u0648",
|
|
93
|
+
"mVideoSub": "\u0627\u0639\u0631\u0636 \u0627\u0644\u0645\u0634\u0643\u0644\u0629 \u0623\u062B\u0646\u0627\u0621 \u062D\u062F\u0648\u062B\u0647\u0627",
|
|
94
|
+
"mSkip": "\u062A\u062E\u0637\u064E\u0651\u060C \u0648\u0627\u0643\u062A\u0641\u0650 \u0628\u0627\u0644\u0648\u0635\u0641",
|
|
95
|
+
"mNext": "\u0627\u0644\u062A\u0627\u0644\u064A",
|
|
96
|
+
"mBack": "\u0631\u062C\u0648\u0639",
|
|
97
|
+
"mZoomIn": "\u062A\u0643\u0628\u064A\u0631",
|
|
98
|
+
"mZoomOut": "\u062A\u0635\u063A\u064A\u0631",
|
|
99
|
+
"mFit": "\u0645\u0644\u0627\u0621\u0645\u0629 \u0627\u0644\u0634\u0627\u0634\u0629",
|
|
100
|
+
"pen": "\u0631\u0633\u0645",
|
|
101
|
+
"rect": "\u0645\u0633\u062A\u0637\u064A\u0644",
|
|
102
|
+
"arrow": "\u0633\u0647\u0645",
|
|
103
|
+
"undo": "\u062A\u0631\u0627\u062C\u0639",
|
|
104
|
+
"fTitle": "\u0627\u0644\u0639\u0646\u0648\u0627\u0646",
|
|
105
|
+
"fDesc": "\u0645\u0627\u0630\u0627 \u062D\u062F\u062B\u061F",
|
|
106
|
+
"email": "\u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A (\u0627\u062E\u062A\u064A\u0627\u0631\u064A)",
|
|
107
|
+
"send": "\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0628\u0644\u0627\u063A",
|
|
108
|
+
"sending": "\u062C\u0627\u0631\u064D \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0628\u0644\u0627\u063A\u2026",
|
|
109
|
+
"error": "\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0625\u0631\u0633\u0627\u0644. \u064A\u064F\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",
|
|
110
|
+
"required": "\u064A\u064F\u0631\u062C\u0649 \u0643\u062A\u0627\u0628\u0629 \u0627\u0644\u0639\u0646\u0648\u0627\u0646 \u0648\u0648\u0635\u0641 \u0645\u0627 \u062D\u062F\u062B.",
|
|
111
|
+
"sentTitle": "\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0628\u0644\u0627\u063A",
|
|
112
|
+
"sentRef": "\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0628\u0644\u0627\u063A {ref}",
|
|
113
|
+
"recordTitle": "\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u0634\u0627\u0634\u0629",
|
|
114
|
+
"stop": "\u0625\u064A\u0642\u0627\u0641",
|
|
115
|
+
"recDenied": "\u062A\u0645 \u062D\u0638\u0631 \u0645\u0634\u0627\u0631\u0643\u0629 \u0627\u0644\u0634\u0627\u0634\u0629. \u0627\u0633\u0645\u062D \u0628\u0647\u0627 \u0641\u064A \u0627\u0644\u0645\u062A\u0635\u0641\u062D \u0644\u0628\u062F\u0621 \u0627\u0644\u062A\u0633\u062C\u064A\u0644.",
|
|
116
|
+
"recError": "\u062A\u0639\u0630\u0651\u0631 \u0625\u0646\u0634\u0627\u0621 \u0627\u0644\u062A\u0633\u062C\u064A\u0644. \u0644\u0627 \u064A\u0632\u0627\u0644 \u0628\u0625\u0645\u0643\u0627\u0646\u0643 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0628\u0644\u0627\u063A.",
|
|
117
|
+
"uploadingVideo": "\u062C\u0627\u0631\u064D \u0631\u0641\u0639 \u0627\u0644\u062A\u0633\u062C\u064A\u0644\u2026",
|
|
118
|
+
"close": "\u0625\u063A\u0644\u0627\u0642",
|
|
119
|
+
"noShot": "\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u062A\u0642\u0627\u0637 \u0644\u0642\u0637\u0629 \u0627\u0644\u0634\u0627\u0634\u0629. \u0644\u0627 \u064A\u0632\u0627\u0644 \u0628\u0625\u0645\u0643\u0627\u0646\u0643 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0628\u0644\u0627\u063A."
|
|
120
|
+
},
|
|
121
|
+
"de": {
|
|
122
|
+
"title": "Fehler melden",
|
|
123
|
+
"mHow": "Wie m\xF6chten Sie das Problem zeigen?",
|
|
124
|
+
"mShot": "Screenshot aufnehmen",
|
|
125
|
+
"mVideo": "Video aufnehmen",
|
|
126
|
+
"mVideoSub": "Zeigen Sie das Problem, w\xE4hrend es passiert",
|
|
127
|
+
"mSkip": "\xDCberspringen, nur beschreiben",
|
|
128
|
+
"mNext": "Weiter",
|
|
129
|
+
"mBack": "Zur\xFCck",
|
|
130
|
+
"mZoomIn": "Vergr\xF6\xDFern",
|
|
131
|
+
"mZoomOut": "Verkleinern",
|
|
132
|
+
"mFit": "An Bildschirm anpassen",
|
|
133
|
+
"pen": "Zeichnen",
|
|
134
|
+
"rect": "Rechteck",
|
|
135
|
+
"arrow": "Pfeil",
|
|
136
|
+
"undo": "R\xFCckg\xE4ngig",
|
|
137
|
+
"fTitle": "Titel",
|
|
138
|
+
"fDesc": "Was ist passiert?",
|
|
139
|
+
"email": "E-Mail (optional)",
|
|
140
|
+
"send": "Meldung senden",
|
|
141
|
+
"sending": "Meldung wird gesendet\u2026",
|
|
142
|
+
"error": "Das hat nicht geklappt. Bitte versuchen Sie es erneut.",
|
|
143
|
+
"required": "Bitte geben Sie einen Titel ein und beschreiben Sie, was passiert ist.",
|
|
144
|
+
"sentTitle": "Meldung gesendet",
|
|
145
|
+
"sentRef": "Meldung {ref} gesendet",
|
|
146
|
+
"recordTitle": "Bildschirmaufnahme",
|
|
147
|
+
"stop": "Stopp",
|
|
148
|
+
"recDenied": "Die Bildschirmfreigabe wurde blockiert. Erlauben Sie sie im Browser, um aufzunehmen.",
|
|
149
|
+
"recError": "Die Aufnahme konnte nicht erstellt werden. Sie k\xF6nnen den Bericht trotzdem senden.",
|
|
150
|
+
"uploadingVideo": "Aufnahme wird hochgeladen\u2026",
|
|
151
|
+
"close": "Schlie\xDFen",
|
|
152
|
+
"noShot": "Der Screenshot konnte nicht erstellt werden. Sie k\xF6nnen die Meldung trotzdem senden."
|
|
153
|
+
},
|
|
154
|
+
"es": {
|
|
155
|
+
"title": "Reportar un error",
|
|
156
|
+
"mHow": "\xBFC\xF3mo quieres mostrar el problema?",
|
|
157
|
+
"mShot": "Hacer una captura",
|
|
158
|
+
"mVideo": "Grabar un v\xEDdeo",
|
|
159
|
+
"mVideoSub": "Muestra el problema mientras ocurre",
|
|
160
|
+
"mSkip": "Omitir, solo describirlo",
|
|
161
|
+
"mNext": "Siguiente",
|
|
162
|
+
"mBack": "Atr\xE1s",
|
|
163
|
+
"mZoomIn": "Acercar",
|
|
164
|
+
"mZoomOut": "Alejar",
|
|
165
|
+
"mFit": "Ajustar a la pantalla",
|
|
166
|
+
"pen": "Dibujar",
|
|
167
|
+
"rect": "Rect\xE1ngulo",
|
|
168
|
+
"arrow": "Flecha",
|
|
169
|
+
"undo": "Deshacer",
|
|
170
|
+
"fTitle": "T\xEDtulo",
|
|
171
|
+
"fDesc": "\xBFQu\xE9 ha pasado?",
|
|
172
|
+
"email": "Correo electr\xF3nico (opcional)",
|
|
173
|
+
"send": "Enviar reporte",
|
|
174
|
+
"sending": "Enviando reporte\u2026",
|
|
175
|
+
"error": "No se pudo enviar. Int\xE9ntalo de nuevo.",
|
|
176
|
+
"required": "Escribe un t\xEDtulo y describe lo que ha pasado.",
|
|
177
|
+
"sentTitle": "Reporte enviado",
|
|
178
|
+
"sentRef": "Reporte {ref} enviado",
|
|
179
|
+
"recordTitle": "Grabaci\xF3n de pantalla",
|
|
180
|
+
"stop": "Detener",
|
|
181
|
+
"recDenied": "Se bloque\xF3 el uso compartido de pantalla. Perm\xEDtelo en el navegador para grabar.",
|
|
182
|
+
"recError": "No se pudo hacer la grabaci\xF3n. A\xFAn puedes enviar el informe.",
|
|
183
|
+
"uploadingVideo": "Subiendo grabaci\xF3n\u2026",
|
|
184
|
+
"close": "Cerrar",
|
|
185
|
+
"noShot": "No se pudo tomar la captura. Aun as\xED puedes enviar el reporte."
|
|
186
|
+
},
|
|
187
|
+
"fr": {
|
|
188
|
+
"title": "Signaler un bug",
|
|
189
|
+
"mHow": "Comment voulez-vous montrer le probl\xE8me ?",
|
|
190
|
+
"mShot": "Faire une capture d\u2019\xE9cran",
|
|
191
|
+
"mVideo": "Enregistrer une vid\xE9o",
|
|
192
|
+
"mVideoSub": "Montrez le probl\xE8me au moment o\xF9 il se produit",
|
|
193
|
+
"mSkip": "Passer, juste le d\xE9crire",
|
|
194
|
+
"mNext": "Suivant",
|
|
195
|
+
"mBack": "Retour",
|
|
196
|
+
"mZoomIn": "Zoom avant",
|
|
197
|
+
"mZoomOut": "Zoom arri\xE8re",
|
|
198
|
+
"mFit": "Ajuster \xE0 l\u2019\xE9cran",
|
|
199
|
+
"pen": "Dessiner",
|
|
200
|
+
"rect": "Rectangle",
|
|
201
|
+
"arrow": "Fl\xE8che",
|
|
202
|
+
"undo": "Annuler l\u2019action",
|
|
203
|
+
"fTitle": "Titre",
|
|
204
|
+
"fDesc": "Que s\u2019est-il pass\xE9 ?",
|
|
205
|
+
"email": "E-mail (facultatif)",
|
|
206
|
+
"send": "Envoyer le signalement",
|
|
207
|
+
"sending": "Envoi du signalement\u2026",
|
|
208
|
+
"error": "L\u2019envoi a \xE9chou\xE9. Veuillez r\xE9essayer.",
|
|
209
|
+
"required": "Indiquez un titre et d\xE9crivez ce qui s\u2019est pass\xE9.",
|
|
210
|
+
"sentTitle": "Signalement envoy\xE9",
|
|
211
|
+
"sentRef": "Signalement {ref} envoy\xE9",
|
|
212
|
+
"recordTitle": "Enregistrement d\u2019\xE9cran",
|
|
213
|
+
"stop": "Arr\xEAter",
|
|
214
|
+
"recDenied": "Le partage d\u2019\xE9cran a \xE9t\xE9 bloqu\xE9. Autorisez-le dans le navigateur pour enregistrer.",
|
|
215
|
+
"recError": "L\u2019enregistrement n\u2019a pas pu \xEAtre effectu\xE9. Vous pouvez quand m\xEAme envoyer le rapport.",
|
|
216
|
+
"uploadingVideo": "Envoi de l\u2019enregistrement\u2026",
|
|
217
|
+
"close": "Fermer",
|
|
218
|
+
"noShot": "La capture d\u2019\xE9cran a \xE9chou\xE9. Vous pouvez quand m\xEAme envoyer le signalement."
|
|
219
|
+
},
|
|
220
|
+
"it": {
|
|
221
|
+
"title": "Segnala un bug",
|
|
222
|
+
"mHow": "Come vuoi mostrare il problema?",
|
|
223
|
+
"mShot": "Fai uno screenshot",
|
|
224
|
+
"mVideo": "Registra un video",
|
|
225
|
+
"mVideoSub": "Mostra il problema mentre succede",
|
|
226
|
+
"mSkip": "Salta, descrivilo e basta",
|
|
227
|
+
"mNext": "Avanti",
|
|
228
|
+
"mBack": "Indietro",
|
|
229
|
+
"mZoomIn": "Ingrandisci",
|
|
230
|
+
"mZoomOut": "Riduci",
|
|
231
|
+
"mFit": "Adatta allo schermo",
|
|
232
|
+
"pen": "Disegna",
|
|
233
|
+
"rect": "Rettangolo",
|
|
234
|
+
"arrow": "Freccia",
|
|
235
|
+
"undo": "Annulla azione",
|
|
236
|
+
"fTitle": "Titolo",
|
|
237
|
+
"fDesc": "Che cosa \xE8 successo?",
|
|
238
|
+
"email": "Email (facoltativa)",
|
|
239
|
+
"send": "Invia segnalazione",
|
|
240
|
+
"sending": "Invio della segnalazione\u2026",
|
|
241
|
+
"error": "Invio non riuscito. Riprova.",
|
|
242
|
+
"required": "Inserisci un titolo e descrivi che cosa \xE8 successo.",
|
|
243
|
+
"sentTitle": "Segnalazione inviata",
|
|
244
|
+
"sentRef": "Segnalazione {ref} inviata",
|
|
245
|
+
"recordTitle": "Registrazione dello schermo",
|
|
246
|
+
"stop": "Interrompi",
|
|
247
|
+
"recDenied": "La condivisione dello schermo \xE8 stata bloccata. Consentila nel browser per registrare.",
|
|
248
|
+
"recError": "Non \xE8 stato possibile registrare. Puoi comunque inviare la segnalazione.",
|
|
249
|
+
"uploadingVideo": "Caricamento della registrazione\u2026",
|
|
250
|
+
"close": "Chiudi",
|
|
251
|
+
"noShot": "Non \xE8 stato possibile acquisire lo screenshot. Puoi comunque inviare la segnalazione."
|
|
252
|
+
},
|
|
253
|
+
"ja": {
|
|
254
|
+
"title": "\u4E0D\u5177\u5408\u3092\u5831\u544A",
|
|
255
|
+
"mHow": "\u554F\u984C\u3092\u3069\u306E\u3088\u3046\u306B\u4F1D\u3048\u307E\u3059\u304B\uFF1F",
|
|
256
|
+
"mShot": "\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u3092\u64AE\u308B",
|
|
257
|
+
"mVideo": "\u52D5\u753B\u3092\u9332\u753B\u3059\u308B",
|
|
258
|
+
"mVideoSub": "\u554F\u984C\u304C\u8D77\u304D\u308B\u69D8\u5B50\u3092\u898B\u305B\u307E\u3059",
|
|
259
|
+
"mSkip": "\u30B9\u30AD\u30C3\u30D7\u3057\u3066\u8AAC\u660E\u3060\u3051\u66F8\u304F",
|
|
260
|
+
"mNext": "\u6B21\u3078",
|
|
261
|
+
"mBack": "\u623B\u308B",
|
|
262
|
+
"mZoomIn": "\u62E1\u5927",
|
|
263
|
+
"mZoomOut": "\u7E2E\u5C0F",
|
|
264
|
+
"mFit": "\u753B\u9762\u306B\u5408\u308F\u305B\u308B",
|
|
265
|
+
"pen": "\u30D5\u30EA\u30FC\u30CF\u30F3\u30C9",
|
|
266
|
+
"rect": "\u56DB\u89D2\u5F62",
|
|
267
|
+
"arrow": "\u77E2\u5370",
|
|
268
|
+
"undo": "\u5143\u306B\u623B\u3059",
|
|
269
|
+
"fTitle": "\u30BF\u30A4\u30C8\u30EB",
|
|
270
|
+
"fDesc": "\u4F55\u304C\u8D77\u304D\u307E\u3057\u305F\u304B\uFF1F",
|
|
271
|
+
"email": "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\uFF08\u4EFB\u610F\uFF09",
|
|
272
|
+
"send": "\u5831\u544A\u3092\u9001\u4FE1",
|
|
273
|
+
"sending": "\u5831\u544A\u3092\u9001\u4FE1\u3057\u3066\u3044\u307E\u3059\u2026",
|
|
274
|
+
"error": "\u9001\u4FE1\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",
|
|
275
|
+
"required": "\u30BF\u30A4\u30C8\u30EB\u3068\u4F55\u304C\u8D77\u304D\u305F\u304B\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
276
|
+
"sentTitle": "\u5831\u544A\u3092\u9001\u4FE1\u3057\u307E\u3057\u305F",
|
|
277
|
+
"sentRef": "\u5831\u544A {ref} \u3092\u9001\u4FE1\u3057\u307E\u3057\u305F",
|
|
278
|
+
"recordTitle": "\u753B\u9762\u9332\u753B",
|
|
279
|
+
"stop": "\u505C\u6B62",
|
|
280
|
+
"recDenied": "\u753B\u9762\u5171\u6709\u304C\u30D6\u30ED\u30C3\u30AF\u3055\u308C\u307E\u3057\u305F\u3002\u9332\u753B\u3059\u308B\u306B\u306F\u30D6\u30E9\u30A6\u30B6\u3067\u8A31\u53EF\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
281
|
+
"recError": "\u9332\u753B\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30EC\u30DD\u30FC\u30C8\u306F\u305D\u306E\u307E\u307E\u9001\u4FE1\u3067\u304D\u307E\u3059\u3002",
|
|
282
|
+
"uploadingVideo": "\u9332\u753B\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u4E2D\u2026",
|
|
283
|
+
"close": "\u9589\u3058\u308B",
|
|
284
|
+
"noShot": "\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u3092\u64AE\u5F71\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5831\u544A\u306F\u3053\u306E\u307E\u307E\u9001\u4FE1\u3067\u304D\u307E\u3059\u3002"
|
|
285
|
+
},
|
|
286
|
+
"nl": {
|
|
287
|
+
"title": "Bug melden",
|
|
288
|
+
"mHow": "Hoe wil je het probleem laten zien?",
|
|
289
|
+
"mShot": "Screenshot maken",
|
|
290
|
+
"mVideo": "Video opnemen",
|
|
291
|
+
"mVideoSub": "Laat het probleem zien terwijl het gebeurt",
|
|
292
|
+
"mSkip": "Overslaan, alleen beschrijven",
|
|
293
|
+
"mNext": "Volgende",
|
|
294
|
+
"mBack": "Terug",
|
|
295
|
+
"mZoomIn": "Inzoomen",
|
|
296
|
+
"mZoomOut": "Uitzoomen",
|
|
297
|
+
"mFit": "Passend maken",
|
|
298
|
+
"pen": "Tekenen",
|
|
299
|
+
"rect": "Rechthoek",
|
|
300
|
+
"arrow": "Pijl",
|
|
301
|
+
"undo": "Ongedaan maken",
|
|
302
|
+
"fTitle": "Titel",
|
|
303
|
+
"fDesc": "Wat is er gebeurd?",
|
|
304
|
+
"email": "E-mail (optioneel)",
|
|
305
|
+
"send": "Melding versturen",
|
|
306
|
+
"sending": "Melding wordt verstuurd\u2026",
|
|
307
|
+
"error": "Versturen is mislukt. Probeer het opnieuw.",
|
|
308
|
+
"required": "Vul een titel in en beschrijf wat er gebeurde.",
|
|
309
|
+
"sentTitle": "Melding verstuurd",
|
|
310
|
+
"sentRef": "Melding {ref} verstuurd",
|
|
311
|
+
"recordTitle": "Schermopname",
|
|
312
|
+
"stop": "Stoppen",
|
|
313
|
+
"recDenied": "Scherm delen is geblokkeerd. Sta het toe in je browser om op te nemen.",
|
|
314
|
+
"recError": "De opname kon niet worden gemaakt. Je kunt het rapport nog steeds versturen.",
|
|
315
|
+
"uploadingVideo": "Opname uploaden\u2026",
|
|
316
|
+
"close": "Sluiten",
|
|
317
|
+
"noShot": "De schermafbeelding kon niet worden gemaakt. Je kunt de melding toch versturen."
|
|
318
|
+
},
|
|
319
|
+
"pt": {
|
|
320
|
+
"title": "Reportar um erro",
|
|
321
|
+
"mHow": "Como voc\xEA quer mostrar o problema?",
|
|
322
|
+
"mShot": "Fazer uma captura de tela",
|
|
323
|
+
"mVideo": "Gravar um v\xEDdeo",
|
|
324
|
+
"mVideoSub": "Mostre o problema enquanto acontece",
|
|
325
|
+
"mSkip": "Pular, s\xF3 descrever",
|
|
326
|
+
"mNext": "Avan\xE7ar",
|
|
327
|
+
"mBack": "Voltar",
|
|
328
|
+
"mZoomIn": "Ampliar",
|
|
329
|
+
"mZoomOut": "Reduzir",
|
|
330
|
+
"mFit": "Ajustar \xE0 tela",
|
|
331
|
+
"pen": "Desenhar",
|
|
332
|
+
"rect": "Ret\xE2ngulo",
|
|
333
|
+
"arrow": "Seta",
|
|
334
|
+
"undo": "Desfazer",
|
|
335
|
+
"fTitle": "T\xEDtulo",
|
|
336
|
+
"fDesc": "O que aconteceu?",
|
|
337
|
+
"email": "E-mail (opcional)",
|
|
338
|
+
"send": "Enviar relat\xF3rio",
|
|
339
|
+
"sending": "Enviando relat\xF3rio\u2026",
|
|
340
|
+
"error": "N\xE3o foi poss\xEDvel enviar. Tente novamente.",
|
|
341
|
+
"required": "Preencha o t\xEDtulo e descreva o que aconteceu.",
|
|
342
|
+
"sentTitle": "Relat\xF3rio enviado",
|
|
343
|
+
"sentRef": "Relato {ref} enviado",
|
|
344
|
+
"recordTitle": "Grava\xE7\xE3o de tela",
|
|
345
|
+
"stop": "Parar",
|
|
346
|
+
"recDenied": "O compartilhamento de tela foi bloqueado. Permita no navegador para gravar.",
|
|
347
|
+
"recError": "N\xE3o foi poss\xEDvel gravar. Voc\xEA ainda pode enviar o relat\xF3rio.",
|
|
348
|
+
"uploadingVideo": "Enviando grava\xE7\xE3o\u2026",
|
|
349
|
+
"close": "Fechar",
|
|
350
|
+
"noShot": "N\xE3o foi poss\xEDvel fazer a captura. Voc\xEA ainda pode enviar o relat\xF3rio."
|
|
351
|
+
},
|
|
352
|
+
"tr": {
|
|
353
|
+
"title": "Hata bildir",
|
|
354
|
+
"mHow": "Sorunu nas\u0131l g\xF6stermek istersiniz?",
|
|
355
|
+
"mShot": "Ekran g\xF6r\xFCnt\xFCs\xFC al",
|
|
356
|
+
"mVideo": "Video kaydet",
|
|
357
|
+
"mVideoSub": "Sorunu oldu\u011Fu anda g\xF6sterin",
|
|
358
|
+
"mSkip": "Atla, sadece anlat",
|
|
359
|
+
"mNext": "\u0130leri",
|
|
360
|
+
"mBack": "Geri",
|
|
361
|
+
"mZoomIn": "Yak\u0131nla\u015Ft\u0131r",
|
|
362
|
+
"mZoomOut": "Uzakla\u015Ft\u0131r",
|
|
363
|
+
"mFit": "Ekrana s\u0131\u011Fd\u0131r",
|
|
364
|
+
"pen": "\xC7iz",
|
|
365
|
+
"rect": "Dikd\xF6rtgen",
|
|
366
|
+
"arrow": "Ok",
|
|
367
|
+
"undo": "Geri al",
|
|
368
|
+
"fTitle": "Ba\u015Fl\u0131k",
|
|
369
|
+
"fDesc": "Ne oldu?",
|
|
370
|
+
"email": "E-posta (iste\u011Fe ba\u011Fl\u0131)",
|
|
371
|
+
"send": "Bildirimi g\xF6nder",
|
|
372
|
+
"sending": "Bildirim g\xF6nderiliyor\u2026",
|
|
373
|
+
"error": "G\xF6nderilemedi. L\xFCtfen tekrar deneyin.",
|
|
374
|
+
"required": "L\xFCtfen bir ba\u015Fl\u0131k girin ve ne oldu\u011Funu anlat\u0131n.",
|
|
375
|
+
"sentTitle": "Bildirim g\xF6nderildi",
|
|
376
|
+
"sentRef": "{ref} numaral\u0131 bildirim g\xF6nderildi",
|
|
377
|
+
"recordTitle": "Ekran kayd\u0131",
|
|
378
|
+
"stop": "Durdur",
|
|
379
|
+
"recDenied": "Ekran payla\u015F\u0131m\u0131 engellendi. Kaydetmek i\xE7in taray\u0131c\u0131da izin verin.",
|
|
380
|
+
"recError": "Kay\u0131t yap\u0131lamad\u0131. Raporu yine de g\xF6nderebilirsiniz.",
|
|
381
|
+
"uploadingVideo": "Kay\u0131t y\xFCkleniyor\u2026",
|
|
382
|
+
"close": "Kapat",
|
|
383
|
+
"noShot": "Ekran g\xF6r\xFCnt\xFCs\xFC al\u0131namad\u0131. Bildirimi yine de g\xF6nderebilirsiniz."
|
|
384
|
+
},
|
|
385
|
+
"zh": {
|
|
386
|
+
"title": "\u62A5\u544A\u95EE\u9898",
|
|
387
|
+
"mHow": "\u4F60\u60F3\u5982\u4F55\u5C55\u793A\u8FD9\u4E2A\u95EE\u9898\uFF1F",
|
|
388
|
+
"mShot": "\u622A\u53D6\u5C4F\u5E55",
|
|
389
|
+
"mVideo": "\u5F55\u5236\u89C6\u9891",
|
|
390
|
+
"mVideoSub": "\u5C55\u793A\u95EE\u9898\u53D1\u751F\u7684\u8FC7\u7A0B",
|
|
391
|
+
"mSkip": "\u8DF3\u8FC7\uFF0C\u53EA\u5199\u63CF\u8FF0",
|
|
392
|
+
"mNext": "\u4E0B\u4E00\u6B65",
|
|
393
|
+
"mBack": "\u8FD4\u56DE",
|
|
394
|
+
"mZoomIn": "\u653E\u5927",
|
|
395
|
+
"mZoomOut": "\u7F29\u5C0F",
|
|
396
|
+
"mFit": "\u9002\u5E94\u5C4F\u5E55",
|
|
397
|
+
"pen": "\u753B\u7B14",
|
|
398
|
+
"rect": "\u77E9\u5F62",
|
|
399
|
+
"arrow": "\u7BAD\u5934",
|
|
400
|
+
"undo": "\u64A4\u9500",
|
|
401
|
+
"fTitle": "\u6807\u9898",
|
|
402
|
+
"fDesc": "\u53D1\u751F\u4E86\u4EC0\u4E48\uFF1F",
|
|
403
|
+
"email": "\u90AE\u7BB1\uFF08\u9009\u586B\uFF09",
|
|
404
|
+
"send": "\u53D1\u9001\u62A5\u544A",
|
|
405
|
+
"sending": "\u6B63\u5728\u53D1\u9001\u62A5\u544A\u2026",
|
|
406
|
+
"error": "\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002",
|
|
407
|
+
"required": "\u8BF7\u586B\u5199\u6807\u9898\u5E76\u63CF\u8FF0\u53D1\u751F\u4E86\u4EC0\u4E48\u3002",
|
|
408
|
+
"sentTitle": "\u62A5\u544A\u5DF2\u53D1\u9001",
|
|
409
|
+
"sentRef": "\u62A5\u544A {ref} \u5DF2\u53D1\u9001",
|
|
410
|
+
"recordTitle": "\u5C4F\u5E55\u5F55\u5236",
|
|
411
|
+
"stop": "\u505C\u6B62",
|
|
412
|
+
"recDenied": "\u5C4F\u5E55\u5171\u4EAB\u5DF2\u88AB\u963B\u6B62\u3002\u8BF7\u5728\u6D4F\u89C8\u5668\u4E2D\u5141\u8BB8\u540E\u518D\u5F55\u5236\u3002",
|
|
413
|
+
"recError": "\u65E0\u6CD5\u5B8C\u6210\u5F55\u5236\u3002\u4F60\u4ECD\u7136\u53EF\u4EE5\u53D1\u9001\u62A5\u544A\u3002",
|
|
414
|
+
"uploadingVideo": "\u6B63\u5728\u4E0A\u4F20\u5F55\u5236\u5185\u5BB9\u2026",
|
|
415
|
+
"close": "\u5173\u95ED",
|
|
416
|
+
"noShot": "\u65E0\u6CD5\u622A\u53D6\u5C4F\u5E55\u3002\u60A8\u4ECD\u7136\u53EF\u4EE5\u53D1\u9001\u62A5\u544A\u3002"
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
// src/report-core.ts
|
|
421
|
+
var round = (v) => Math.round(v * 1e4) / 1e4;
|
|
422
|
+
function annotations(shapes, width, height) {
|
|
423
|
+
if (width <= 0 || height <= 0) return [];
|
|
424
|
+
return shapes.filter((s2) => s2.points.length > 0).map((s2) => {
|
|
425
|
+
const first = s2.points[0];
|
|
426
|
+
const last = s2.points[s2.points.length - 1];
|
|
427
|
+
const out = { tool: s2.tool, color: s2.color };
|
|
428
|
+
if (s2.tool === "pen") {
|
|
429
|
+
const xs = s2.points.map((p) => p.x);
|
|
430
|
+
const ys = s2.points.map((p) => p.y);
|
|
431
|
+
const minX = Math.min(...xs);
|
|
432
|
+
const minY = Math.min(...ys);
|
|
433
|
+
Object.assign(out, {
|
|
434
|
+
x: round(minX / width),
|
|
435
|
+
y: round(minY / height),
|
|
436
|
+
w: round((Math.max(...xs) - minX) / width),
|
|
437
|
+
h: round((Math.max(...ys) - minY) / height),
|
|
438
|
+
points: s2.points.flatMap((p) => [round(p.x / width), round(p.y / height)])
|
|
439
|
+
});
|
|
440
|
+
} else {
|
|
441
|
+
Object.assign(out, { x: round(first.x / width), y: round(first.y / height), w: round((last.x - first.x) / width), h: round((last.y - first.y) / height) });
|
|
442
|
+
}
|
|
443
|
+
return out;
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
function feedbackBody(input) {
|
|
447
|
+
const body = {
|
|
448
|
+
message: input.message,
|
|
449
|
+
kind: "bug",
|
|
450
|
+
source: "widget",
|
|
451
|
+
locale: input.locale,
|
|
452
|
+
context: input.context,
|
|
453
|
+
attachments: { screenshots: input.screenshots, recordings: 0 }
|
|
454
|
+
};
|
|
455
|
+
if (input.title.trim()) body.title = input.title.trim();
|
|
456
|
+
if (input.email?.trim()) body.email = input.email.trim();
|
|
457
|
+
if (input.image) {
|
|
458
|
+
const list = annotations(input.shapes ?? [], input.image.width, input.image.height);
|
|
459
|
+
if (list.length) body.annotations = [{ position: 0, shapes: list }];
|
|
460
|
+
}
|
|
461
|
+
return body;
|
|
462
|
+
}
|
|
463
|
+
var ReportClient = class {
|
|
464
|
+
endpoint;
|
|
465
|
+
key;
|
|
466
|
+
fetcher;
|
|
467
|
+
constructor(endpoint, key, fetcher = (...a) => fetch(...a)) {
|
|
468
|
+
this.endpoint = endpoint.replace(/\/+$/, "");
|
|
469
|
+
this.key = key;
|
|
470
|
+
this.fetcher = fetcher;
|
|
471
|
+
}
|
|
472
|
+
async call(path, init3) {
|
|
473
|
+
const res = await this.fetcher(`${this.endpoint}${path}`, { ...init3, headers: { "X-Blipit-Key": this.key, ...init3.headers } });
|
|
474
|
+
const text2 = await res.text();
|
|
475
|
+
if (!res.ok) throw new Error(`Blipit returned ${res.status}`);
|
|
476
|
+
return text2;
|
|
477
|
+
}
|
|
478
|
+
async send(body) {
|
|
479
|
+
const json = JSON.parse(await this.call("/api/v1/feedback", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) }));
|
|
480
|
+
if (typeof json.upload_token !== "string") throw new Error("Blipit returned no upload token");
|
|
481
|
+
return { id: String(json.id), token: json.upload_token, ref: typeof json.ref === "string" ? json.ref : null };
|
|
482
|
+
}
|
|
483
|
+
async uploadScreenshot(receipt, data, type) {
|
|
484
|
+
await this.call(`/api/v1/feedback/${encodeURIComponent(receipt.id)}/screenshot?position=0`, { method: "POST", headers: { "Content-Type": type, "X-Blipit-Upload": receipt.token }, body: data });
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
function pickLang(tags) {
|
|
488
|
+
for (const tag of tags) {
|
|
489
|
+
const base = tag.toLowerCase().split(/[-_]/)[0];
|
|
490
|
+
if (REPORT_STRINGS[base]) return base;
|
|
491
|
+
}
|
|
492
|
+
return "en";
|
|
493
|
+
}
|
|
494
|
+
var text = (key, lang) => REPORT_STRINGS[lang]?.[key] ?? REPORT_STRINGS.en?.[key] ?? key;
|
|
495
|
+
function fitScale(view, image) {
|
|
496
|
+
if (!view.width || !view.height) return 1;
|
|
497
|
+
return Math.min(view.width / image.width, view.height / image.height);
|
|
498
|
+
}
|
|
499
|
+
function clampPan(pan, zoom, view, image) {
|
|
500
|
+
const s2 = fitScale(view, image) * zoom;
|
|
501
|
+
const w = image.width * s2;
|
|
502
|
+
const h = image.height * s2;
|
|
503
|
+
return {
|
|
504
|
+
x: w <= view.width ? 0 : Math.min(Math.max(pan.x, (view.width - w) / 2), (w - view.width) / 2),
|
|
505
|
+
y: h <= view.height ? 0 : Math.min(Math.max(pan.y, (view.height - h) / 2), (h - view.height) / 2)
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
function origin(pan, zoom, view, image) {
|
|
509
|
+
const s2 = fitScale(view, image) * zoom;
|
|
510
|
+
return { x: (view.width - image.width * s2) / 2 + pan.x, y: (view.height - image.height * s2) / 2 + pan.y };
|
|
511
|
+
}
|
|
512
|
+
function toImage(p, pan, zoom, view, image) {
|
|
513
|
+
const o = origin(pan, zoom, view, image);
|
|
514
|
+
const s2 = fitScale(view, image) * zoom;
|
|
515
|
+
return { x: Math.min(Math.max((p.x - o.x) / s2, 0), image.width), y: Math.min(Math.max((p.y - o.y) / s2, 0), image.height) };
|
|
516
|
+
}
|
|
517
|
+
function zoomAround(zoom, pan, next, focal, view, image) {
|
|
518
|
+
const target = Math.min(Math.max(next, 1), 5);
|
|
519
|
+
const applied = target / zoom;
|
|
520
|
+
const cx = view.width / 2 + pan.x;
|
|
521
|
+
const cy = view.height / 2 + pan.y;
|
|
522
|
+
const moved = { x: pan.x + (cx - focal.x) * (applied - 1), y: pan.y + (cy - focal.y) * (applied - 1) };
|
|
523
|
+
return { zoom: target, pan: clampPan(moved, target, view, image) };
|
|
524
|
+
}
|
|
525
|
+
var strokeFor = (image) => Math.max(4, image.width / 130);
|
|
526
|
+
|
|
527
|
+
// src/reporter.tsx
|
|
528
|
+
var import_react = require("react");
|
|
529
|
+
var import_react_native = require("react-native");
|
|
530
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
531
|
+
var C = { navy: "#0B1A3A", card: "#1A2135", brand: "#3882F6", muted: "#98A6BE", mark: "#FF3B30", danger: "#FF7A6E", white: "#FFFFFF" };
|
|
532
|
+
var opener = null;
|
|
533
|
+
var config = null;
|
|
534
|
+
function configureReporter(client, device) {
|
|
535
|
+
config = { client, device };
|
|
536
|
+
}
|
|
537
|
+
function showReport() {
|
|
538
|
+
if (!config) console.warn("[blipit] call Blipit.init before showReport");
|
|
539
|
+
else if (!opener) console.warn("[blipit] wrap your app in <BlipitReporter> to use showReport");
|
|
540
|
+
else opener();
|
|
541
|
+
}
|
|
542
|
+
function viewShot() {
|
|
543
|
+
try {
|
|
544
|
+
return require("react-native-view-shot");
|
|
545
|
+
} catch {
|
|
546
|
+
return null;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
var languages = () => {
|
|
550
|
+
try {
|
|
551
|
+
return [Intl.DateTimeFormat().resolvedOptions().locale];
|
|
552
|
+
} catch {
|
|
553
|
+
return ["en"];
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
function BlipitReporter({ children, showButton = false }) {
|
|
557
|
+
const lang = (0, import_react.useMemo)(() => pickLang(languages()), []);
|
|
558
|
+
const t = (key) => text(key, lang);
|
|
559
|
+
const [stage, setStage] = (0, import_react.useState)("closed");
|
|
560
|
+
const [shot, setShot] = (0, import_react.useState)(null);
|
|
561
|
+
const [flat, setFlat] = (0, import_react.useState)(null);
|
|
562
|
+
const [notice, setNotice] = (0, import_react.useState)(null);
|
|
563
|
+
const shapes = (0, import_react.useRef)([]);
|
|
564
|
+
(0, import_react.useEffect)(() => {
|
|
565
|
+
opener = () => {
|
|
566
|
+
shapes.current = [];
|
|
567
|
+
setShot(null);
|
|
568
|
+
setFlat(null);
|
|
569
|
+
setNotice(null);
|
|
570
|
+
setStage("choice");
|
|
571
|
+
};
|
|
572
|
+
return () => {
|
|
573
|
+
opener = null;
|
|
574
|
+
};
|
|
575
|
+
}, []);
|
|
576
|
+
const capture = async () => {
|
|
577
|
+
const shooter = viewShot();
|
|
578
|
+
setStage("closed");
|
|
579
|
+
await new Promise((r) => setTimeout(r, 350));
|
|
580
|
+
try {
|
|
581
|
+
if (!shooter) throw new Error("react-native-view-shot is not installed");
|
|
582
|
+
const uri = await shooter.captureScreen({ format: "jpg", quality: 0.9, result: "tmpfile" });
|
|
583
|
+
const size = await new Promise((ok, fail) => import_react_native.Image.getSize(uri, (width, height) => ok({ width, height }), fail));
|
|
584
|
+
setShot({ uri, ...size });
|
|
585
|
+
setStage("editor");
|
|
586
|
+
} catch (err) {
|
|
587
|
+
if (!shooter) console.warn("[blipit] install react-native-view-shot to attach screenshots to bug reports");
|
|
588
|
+
setNotice(t("noShot"));
|
|
589
|
+
setStage("details");
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: { flex: 1 }, children: [
|
|
593
|
+
children,
|
|
594
|
+
showButton && stage === "closed" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.Pressable, { accessibilityRole: "button", accessibilityLabel: t("title"), onPress: () => opener?.(), style: ({ pressed }) => [s.fab, pressed && { opacity: 0.85 }], children: [
|
|
595
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: s.fabIcon, children: "!" }),
|
|
596
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: s.fabText, children: t("title") })
|
|
597
|
+
] }) : null,
|
|
598
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Modal, { visible: stage !== "closed", animationType: "none", presentationStyle: "fullScreen", onRequestClose: () => setStage(stage === "details" && shot ? "editor" : stage === "choice" ? "closed" : "choice"), statusBarTranslucent: false, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.SafeAreaView, { style: [s.screen, { direction: lang === "ar" ? "rtl" : import_react_native.I18nManager.isRTL ? "rtl" : "ltr" }], children: [
|
|
599
|
+
stage === "choice" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: s.pad, children: [
|
|
600
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Bar, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BarButton, { label: t("close"), glyph: "\u2715", onPress: () => setStage("closed") }) }),
|
|
601
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: s.center, children: [
|
|
602
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: s.h1, children: t("mHow") }),
|
|
603
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Card, { title: t("mShot"), glyph: "\u25CE", onPress: capture }),
|
|
604
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
605
|
+
Card,
|
|
606
|
+
{
|
|
607
|
+
title: t("mSkip"),
|
|
608
|
+
glyph: "\u270E",
|
|
609
|
+
onPress: () => {
|
|
610
|
+
setNotice(null);
|
|
611
|
+
setStage("details");
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
)
|
|
615
|
+
] })
|
|
616
|
+
] }) : null,
|
|
617
|
+
stage === "editor" && shot ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
618
|
+
Editor,
|
|
619
|
+
{
|
|
620
|
+
shot,
|
|
621
|
+
shapes,
|
|
622
|
+
t,
|
|
623
|
+
onBack: () => setStage("choice"),
|
|
624
|
+
onNext: (out) => {
|
|
625
|
+
setFlat(out);
|
|
626
|
+
setStage("details");
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
) : null,
|
|
630
|
+
stage === "details" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
631
|
+
Details,
|
|
632
|
+
{
|
|
633
|
+
t,
|
|
634
|
+
lang,
|
|
635
|
+
shot,
|
|
636
|
+
flat,
|
|
637
|
+
shapes: shapes.current,
|
|
638
|
+
notice,
|
|
639
|
+
onBack: () => setStage(shot ? "editor" : "choice"),
|
|
640
|
+
onDone: () => setStage("closed")
|
|
641
|
+
}
|
|
642
|
+
) : null
|
|
643
|
+
] }) })
|
|
644
|
+
] });
|
|
645
|
+
}
|
|
646
|
+
function Bar({ children }) {
|
|
647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: s.bar, children });
|
|
648
|
+
}
|
|
649
|
+
function BarButton({ label, glyph, onPress }) {
|
|
650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.Pressable, { accessibilityRole: "button", accessibilityLabel: label, onPress, style: s.barButton, hitSlop: 6, children: [
|
|
651
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: s.glyph, children: glyph }),
|
|
652
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: s.barText, numberOfLines: 1, children: label })
|
|
653
|
+
] });
|
|
654
|
+
}
|
|
655
|
+
function Primary({ label, onPress, disabled }) {
|
|
656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Pressable, { accessibilityRole: "button", accessibilityLabel: label, accessibilityState: { disabled }, disabled, onPress, style: [s.primary, disabled && { opacity: 0.6 }], children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: s.primaryText, children: label }) });
|
|
657
|
+
}
|
|
658
|
+
function Card({ title, glyph, onPress }) {
|
|
659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.Pressable, { accessibilityRole: "button", accessibilityLabel: title, onPress, style: ({ pressed }) => [s.card, pressed && { opacity: 0.85 }], children: [
|
|
660
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: s.cardGlyph, children: glyph }),
|
|
661
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: s.cardText, children: title })
|
|
662
|
+
] });
|
|
663
|
+
}
|
|
664
|
+
function Editor({ shot, shapes, t, onBack, onNext }) {
|
|
665
|
+
const [view, setView] = (0, import_react.useState)({ width: 0, height: 0, x: 0, y: 0 });
|
|
666
|
+
const [zoom, setZoom] = (0, import_react.useState)(1);
|
|
667
|
+
const [pan, setPan] = (0, import_react.useState)({ x: 0, y: 0 });
|
|
668
|
+
const [tool, setTool] = (0, import_react.useState)("pen");
|
|
669
|
+
const [current, setCurrent] = (0, import_react.useState)(null);
|
|
670
|
+
const [, redraw] = (0, import_react.useState)(0);
|
|
671
|
+
const [busy, setBusy] = (0, import_react.useState)(false);
|
|
672
|
+
const box = (0, import_react.useRef)(null);
|
|
673
|
+
const content = (0, import_react.useRef)(null);
|
|
674
|
+
const live = (0, import_react.useRef)({ zoom, pan, view, tool, current, gesture: null, lastTap: 0, moved: false });
|
|
675
|
+
live.current.zoom = zoom;
|
|
676
|
+
live.current.pan = pan;
|
|
677
|
+
live.current.view = view;
|
|
678
|
+
live.current.tool = tool;
|
|
679
|
+
const image = { width: shot.width, height: shot.height };
|
|
680
|
+
const local = (e) => e.nativeEvent.touches.map((touch) => ({ x: touch.pageX - live.current.view.x, y: touch.pageY - live.current.view.y }));
|
|
681
|
+
const responder = (0, import_react.useMemo)(
|
|
682
|
+
() => import_react_native.PanResponder.create({
|
|
683
|
+
onStartShouldSetPanResponder: () => true,
|
|
684
|
+
onMoveShouldSetPanResponder: () => true,
|
|
685
|
+
onPanResponderTerminationRequest: () => false,
|
|
686
|
+
onPanResponderGrant: (e) => {
|
|
687
|
+
const pts = local(e);
|
|
688
|
+
const L = live.current;
|
|
689
|
+
L.moved = false;
|
|
690
|
+
if (pts.length >= 2) return;
|
|
691
|
+
const p = toImage(pts[0] ?? { x: e.nativeEvent.locationX, y: e.nativeEvent.locationY }, L.pan, L.zoom, L.view, image);
|
|
692
|
+
L.current = { tool: L.tool, points: [p, p], color: C.mark };
|
|
693
|
+
setCurrent(L.current);
|
|
694
|
+
},
|
|
695
|
+
onPanResponderMove: (e) => {
|
|
696
|
+
const pts = local(e);
|
|
697
|
+
const L = live.current;
|
|
698
|
+
L.moved = true;
|
|
699
|
+
if (pts.length >= 2) {
|
|
700
|
+
const a = pts[0];
|
|
701
|
+
const b = pts[1];
|
|
702
|
+
const focal = { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 };
|
|
703
|
+
const span = Math.hypot(a.x - b.x, a.y - b.y);
|
|
704
|
+
L.current = null;
|
|
705
|
+
setCurrent(null);
|
|
706
|
+
if (L.gesture?.multi) {
|
|
707
|
+
const panned = { x: L.pan.x + focal.x - L.gesture.focal.x, y: L.pan.y + focal.y - L.gesture.focal.y };
|
|
708
|
+
const next2 = zoomAround(L.zoom, panned, L.zoom * (span / Math.max(1, L.gesture.span)), focal, L.view, image);
|
|
709
|
+
L.zoom = next2.zoom;
|
|
710
|
+
L.pan = next2.pan;
|
|
711
|
+
setZoom(next2.zoom);
|
|
712
|
+
setPan(next2.pan);
|
|
713
|
+
}
|
|
714
|
+
L.gesture = { span, focal, multi: true };
|
|
715
|
+
return;
|
|
716
|
+
}
|
|
717
|
+
if (L.gesture?.multi || !L.current || !pts[0]) return;
|
|
718
|
+
const p = toImage(pts[0], L.pan, L.zoom, L.view, image);
|
|
719
|
+
const shape = L.current;
|
|
720
|
+
L.current = { ...shape, points: shape.tool === "pen" ? [...shape.points, p] : [shape.points[0], p] };
|
|
721
|
+
setCurrent(L.current);
|
|
722
|
+
},
|
|
723
|
+
onPanResponderRelease: (e) => {
|
|
724
|
+
const L = live.current;
|
|
725
|
+
const shape = L.current;
|
|
726
|
+
const limit = strokeFor(image);
|
|
727
|
+
if (shape && !L.gesture?.multi) {
|
|
728
|
+
const a = shape.points[0];
|
|
729
|
+
const moved = shape.points.some((p) => Math.hypot(p.x - a.x, p.y - a.y) > limit);
|
|
730
|
+
const last = shape.points[shape.points.length - 1];
|
|
731
|
+
if (moved && (shape.tool === "pen" || Math.hypot(last.x - a.x, last.y - a.y) > limit)) shapes.current.push(shape);
|
|
732
|
+
}
|
|
733
|
+
if (!L.moved && !L.gesture?.multi) {
|
|
734
|
+
const now = Date.now();
|
|
735
|
+
if (now - L.lastTap < 300) {
|
|
736
|
+
const tap = { x: e.nativeEvent.pageX - L.view.x, y: e.nativeEvent.pageY - L.view.y };
|
|
737
|
+
const next2 = L.zoom > 1.01 ? { zoom: 1, pan: { x: 0, y: 0 } } : zoomAround(L.zoom, L.pan, 2.5, tap, L.view, image);
|
|
738
|
+
setZoom(next2.zoom);
|
|
739
|
+
setPan(next2.pan);
|
|
740
|
+
L.lastTap = 0;
|
|
741
|
+
} else {
|
|
742
|
+
L.lastTap = now;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
L.current = null;
|
|
746
|
+
L.gesture = null;
|
|
747
|
+
setCurrent(null);
|
|
748
|
+
redraw((n) => n + 1);
|
|
749
|
+
}
|
|
750
|
+
}),
|
|
751
|
+
[]
|
|
752
|
+
);
|
|
753
|
+
const scale = fitScale(view, image) * zoom;
|
|
754
|
+
const o = origin(pan, zoom, view, image);
|
|
755
|
+
const width = strokeFor(image);
|
|
756
|
+
const zoomBy = (f) => {
|
|
757
|
+
const next2 = zoomAround(zoom, pan, zoom * f, { x: view.width / 2, y: view.height / 2 }, view, image);
|
|
758
|
+
setZoom(next2.zoom);
|
|
759
|
+
setPan(next2.pan);
|
|
760
|
+
};
|
|
761
|
+
const next = async () => {
|
|
762
|
+
setBusy(true);
|
|
763
|
+
setZoom(1);
|
|
764
|
+
setPan({ x: 0, y: 0 });
|
|
765
|
+
await new Promise((r) => setTimeout(r, 80));
|
|
766
|
+
let out = shot;
|
|
767
|
+
const shooter = viewShot();
|
|
768
|
+
if (shapes.current.length && shooter && content.current) {
|
|
769
|
+
try {
|
|
770
|
+
const uri = await shooter.captureRef(content.current, { format: "jpg", quality: 0.85, result: "tmpfile" });
|
|
771
|
+
out = { uri, width: shot.width, height: shot.height };
|
|
772
|
+
} catch {
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
setBusy(false);
|
|
776
|
+
onNext(out);
|
|
777
|
+
};
|
|
778
|
+
const tools = [
|
|
779
|
+
["pen", t("pen"), "\u270E"],
|
|
780
|
+
["rect", t("rect"), "\u25A2"],
|
|
781
|
+
["arrow", t("arrow"), "\u2197"]
|
|
782
|
+
];
|
|
783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: { flex: 1 }, children: [
|
|
784
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Bar, { children: [
|
|
785
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BarButton, { label: t("mBack"), glyph: "\u2039", onPress: onBack }),
|
|
786
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: { flex: 1 } }),
|
|
787
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconButton, { label: t("mZoomOut"), glyph: "\u2212", onPress: () => zoomBy(1 / 1.5) }),
|
|
788
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.Text, { style: s.zoom, children: [
|
|
789
|
+
Math.round(zoom * 100),
|
|
790
|
+
"%"
|
|
791
|
+
] }),
|
|
792
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconButton, { label: t("mZoomIn"), glyph: "+", onPress: () => zoomBy(1.5) }),
|
|
793
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: { flex: 1 } }),
|
|
794
|
+
busy ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.ActivityIndicator, { color: C.white, style: { marginHorizontal: 8 } }) : null,
|
|
795
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primary, { label: t("mNext"), onPress: next, disabled: busy })
|
|
796
|
+
] }),
|
|
797
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
798
|
+
import_react_native.View,
|
|
799
|
+
{
|
|
800
|
+
ref: box,
|
|
801
|
+
style: s.stage,
|
|
802
|
+
onLayout: (e) => {
|
|
803
|
+
const { width: w, height: h } = e.nativeEvent.layout;
|
|
804
|
+
box.current?.measureInWindow((x, y) => setView({ width: w, height: h, x, y }));
|
|
805
|
+
setView((v) => ({ ...v, width: w, height: h }));
|
|
806
|
+
},
|
|
807
|
+
...responder.panHandlers,
|
|
808
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { ref: content, collapsable: false, style: { position: "absolute", left: o.x, top: o.y, width: shot.width * scale, height: shot.height * scale }, pointerEvents: "none", children: [
|
|
809
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Image, { source: { uri: shot.uri }, style: import_react_native.StyleSheet.absoluteFill, resizeMode: "stretch" }),
|
|
810
|
+
[...shapes.current, ...current ? [current] : []].map((shape, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Mark, { shape, scale, width: width * scale }, i))
|
|
811
|
+
] })
|
|
812
|
+
}
|
|
813
|
+
),
|
|
814
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: s.tools, children: [
|
|
815
|
+
tools.map(([id, label, glyph]) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolButton, { label, glyph, on: tool === id, onPress: () => setTool(id) }, id)),
|
|
816
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
817
|
+
ToolButton,
|
|
818
|
+
{
|
|
819
|
+
label: t("undo"),
|
|
820
|
+
glyph: "\u21B6",
|
|
821
|
+
onPress: () => {
|
|
822
|
+
shapes.current.pop();
|
|
823
|
+
redraw((n) => n + 1);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
),
|
|
827
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
828
|
+
ToolButton,
|
|
829
|
+
{
|
|
830
|
+
label: t("mFit"),
|
|
831
|
+
glyph: "\u2922",
|
|
832
|
+
onPress: () => {
|
|
833
|
+
setZoom(1);
|
|
834
|
+
setPan({ x: 0, y: 0 });
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
)
|
|
838
|
+
] })
|
|
839
|
+
] });
|
|
840
|
+
}
|
|
841
|
+
function Mark({ shape, scale, width }) {
|
|
842
|
+
const line = (a2, b2, key) => {
|
|
843
|
+
const ax = a2.x * scale;
|
|
844
|
+
const ay = a2.y * scale;
|
|
845
|
+
const len = Math.hypot(b2.x * scale - ax, b2.y * scale - ay);
|
|
846
|
+
const angle = Math.atan2(b2.y * scale - ay, b2.x * scale - ax);
|
|
847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: { position: "absolute", left: ax + (b2.x * scale - ax - len) / 2, top: ay + (b2.y * scale - ay) / 2 - width / 2, width: len, height: width, borderRadius: width / 2, backgroundColor: C.mark, transform: [{ rotate: `${angle}rad` }] } }, key);
|
|
848
|
+
};
|
|
849
|
+
const a = shape.points[0];
|
|
850
|
+
const b = shape.points[shape.points.length - 1];
|
|
851
|
+
if (shape.tool === "rect") {
|
|
852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: { position: "absolute", left: Math.min(a.x, b.x) * scale, top: Math.min(a.y, b.y) * scale, width: Math.abs(b.x - a.x) * scale, height: Math.abs(b.y - a.y) * scale, borderWidth: width, borderColor: C.mark } });
|
|
853
|
+
}
|
|
854
|
+
if (shape.tool === "arrow") {
|
|
855
|
+
const angle = Math.atan2(b.y - a.y, b.x - a.x);
|
|
856
|
+
const head = width / scale * 5;
|
|
857
|
+
const wing = (side) => ({ x: b.x + head * Math.cos(angle + side), y: b.y + head * Math.sin(angle + side) });
|
|
858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: [line(a, b, 0), line(b, wing(Math.PI * 0.8), 1), line(b, wing(-Math.PI * 0.8), 2)] });
|
|
859
|
+
}
|
|
860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: shape.points.slice(1).map((p, i) => line(shape.points[i], p, i)) });
|
|
861
|
+
}
|
|
862
|
+
function IconButton({ label, glyph, onPress }) {
|
|
863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Pressable, { accessibilityRole: "button", accessibilityLabel: label, onPress, style: s.icon, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: s.iconText, children: glyph }) });
|
|
864
|
+
}
|
|
865
|
+
function ToolButton({ label, glyph, on, onPress }) {
|
|
866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.Pressable, { accessibilityRole: "button", accessibilityLabel: label, accessibilityState: { selected: !!on }, onPress, style: [s.tool, on && { backgroundColor: C.brand }], children: [
|
|
867
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: [s.toolGlyph, { color: on ? C.white : C.muted }], children: glyph }),
|
|
868
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: [s.toolText, { color: on ? C.white : C.muted }], numberOfLines: 1, children: label })
|
|
869
|
+
] });
|
|
870
|
+
}
|
|
871
|
+
function Details({ t, lang, shot, flat, shapes, notice, onBack, onDone }) {
|
|
872
|
+
const [title, setTitle] = (0, import_react.useState)("");
|
|
873
|
+
const [message, setMessage] = (0, import_react.useState)("");
|
|
874
|
+
const [email, setEmail] = (0, import_react.useState)("");
|
|
875
|
+
const [status, setStatus] = (0, import_react.useState)(notice ? { text: notice, error: true } : { text: "", error: false });
|
|
876
|
+
const [busy, setBusy] = (0, import_react.useState)(false);
|
|
877
|
+
const image = flat ?? shot;
|
|
878
|
+
const submit = async () => {
|
|
879
|
+
if (busy || !config) return;
|
|
880
|
+
if (!message.trim()) {
|
|
881
|
+
setStatus({ text: t("required"), error: true });
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
setBusy(true);
|
|
885
|
+
setStatus({ text: t("sending"), error: false });
|
|
886
|
+
try {
|
|
887
|
+
const receipt = await config.client.send(feedbackBody({ title, message: message.trim(), email, context: config.device(), shapes, image: shot, screenshots: image ? 1 : 0, locale: lang }));
|
|
888
|
+
let uploaded = true;
|
|
889
|
+
if (image) {
|
|
890
|
+
try {
|
|
891
|
+
const blob = await (await fetch(image.uri)).blob();
|
|
892
|
+
await config.client.uploadScreenshot(receipt, blob, "image/jpeg");
|
|
893
|
+
} catch {
|
|
894
|
+
uploaded = false;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
const done = receipt.ref ? t("sentRef").replace("{ref}", receipt.ref) : t("sentTitle");
|
|
898
|
+
setStatus({ text: uploaded ? done : `${done} \xB7 ${t("noShot")}`, error: !uploaded });
|
|
899
|
+
setTimeout(onDone, 1600);
|
|
900
|
+
} catch {
|
|
901
|
+
setStatus({ text: t("error"), error: true });
|
|
902
|
+
} finally {
|
|
903
|
+
setBusy(false);
|
|
904
|
+
}
|
|
905
|
+
};
|
|
906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.KeyboardAvoidingView, { style: { flex: 1 }, behavior: import_react_native.Platform.OS === "ios" ? "padding" : void 0, children: [
|
|
907
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Bar, { children: [
|
|
908
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BarButton, { label: t("mBack"), glyph: "\u2039", onPress: () => !busy && onBack() }),
|
|
909
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: { flex: 1 } }),
|
|
910
|
+
busy ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.ActivityIndicator, { color: C.white, style: { marginHorizontal: 10 } }) : null,
|
|
911
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primary, { label: t("send"), onPress: submit, disabled: busy })
|
|
912
|
+
] }),
|
|
913
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.ScrollView, { contentContainerStyle: { padding: 20, paddingTop: 8, gap: 12 }, keyboardShouldPersistTaps: "handled", children: [
|
|
914
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: s.h2, children: t("title") }),
|
|
915
|
+
image ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Image, { source: { uri: image.uri }, style: s.preview, resizeMode: "contain", accessibilityIgnoresInvertColors: true }) : null,
|
|
916
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.TextInput, { value: title, onChangeText: setTitle, placeholder: t("fTitle"), placeholderTextColor: C.muted, style: s.input, accessibilityLabel: t("fTitle") }),
|
|
917
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.TextInput, { value: message, onChangeText: setMessage, placeholder: t("fDesc"), placeholderTextColor: C.muted, style: [s.input, { minHeight: 120, textAlignVertical: "top" }], multiline: true, accessibilityLabel: t("fDesc") }),
|
|
918
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.TextInput, { value: email, onChangeText: setEmail, placeholder: t("email"), placeholderTextColor: C.muted, style: s.input, keyboardType: "email-address", autoCapitalize: "none", autoCorrect: false, accessibilityLabel: t("email") }),
|
|
919
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { accessibilityLiveRegion: "polite", style: { color: status.error ? C.danger : C.muted, fontSize: 14 }, children: status.text })
|
|
920
|
+
] })
|
|
921
|
+
] });
|
|
922
|
+
}
|
|
923
|
+
var s = import_react_native.StyleSheet.create({
|
|
924
|
+
screen: { flex: 1, backgroundColor: C.navy, paddingTop: import_react_native.Platform.OS === "android" ? import_react_native.StatusBar.currentHeight ?? 0 : 0 },
|
|
925
|
+
pad: { flex: 1, paddingHorizontal: 20 },
|
|
926
|
+
center: { flex: 1, justifyContent: "center", gap: 14 },
|
|
927
|
+
h1: { color: C.white, fontSize: 24, fontWeight: "700", marginBottom: 8 },
|
|
928
|
+
h2: { color: C.white, fontSize: 22, fontWeight: "700" },
|
|
929
|
+
bar: { height: 56, flexDirection: "row", alignItems: "center", paddingHorizontal: 8 },
|
|
930
|
+
barButton: { flexDirection: "row", alignItems: "center", minHeight: 48, minWidth: 48, paddingHorizontal: 6, flexShrink: 1 },
|
|
931
|
+
barText: { color: C.white, fontSize: 16, flexShrink: 1 },
|
|
932
|
+
glyph: { color: C.white, fontSize: 22, marginEnd: 6 },
|
|
933
|
+
primary: { backgroundColor: C.brand, borderRadius: 12, minHeight: 44, paddingHorizontal: 18, justifyContent: "center" },
|
|
934
|
+
primaryText: { color: C.white, fontSize: 16, fontWeight: "600" },
|
|
935
|
+
card: { flexDirection: "row", alignItems: "center", backgroundColor: C.card, borderRadius: 16, borderWidth: 1, borderColor: "rgba(255,255,255,0.1)", padding: 16, minHeight: 64 },
|
|
936
|
+
cardGlyph: { color: C.brand, fontSize: 22, width: 32, marginEnd: 14, textAlign: "center" },
|
|
937
|
+
cardText: { color: C.white, fontSize: 17, fontWeight: "600", flex: 1 },
|
|
938
|
+
stage: { flex: 1, overflow: "hidden", backgroundColor: "rgba(0,0,0,0.25)" },
|
|
939
|
+
zoom: { color: C.muted, fontSize: 13, width: 48, textAlign: "center" },
|
|
940
|
+
icon: { width: 44, height: 44, alignItems: "center", justifyContent: "center" },
|
|
941
|
+
iconText: { color: C.white, fontSize: 24 },
|
|
942
|
+
tools: { flexDirection: "row", paddingHorizontal: 8, paddingVertical: 6 },
|
|
943
|
+
tool: { flex: 1, height: 60, alignItems: "center", justifyContent: "center", borderRadius: 12, marginHorizontal: 2 },
|
|
944
|
+
toolGlyph: { fontSize: 20 },
|
|
945
|
+
toolText: { fontSize: 11, marginTop: 2 },
|
|
946
|
+
preview: { height: 150, borderRadius: 12, backgroundColor: C.card },
|
|
947
|
+
input: { backgroundColor: C.card, borderRadius: 12, color: C.white, fontSize: 16, paddingHorizontal: 14, paddingVertical: 12, minHeight: 48 },
|
|
948
|
+
fab: { position: "absolute", right: 16, bottom: 32, height: 48, borderRadius: 24, backgroundColor: C.brand, flexDirection: "row", alignItems: "center", paddingHorizontal: 18, elevation: 6, shadowColor: "#000", shadowOpacity: 0.25, shadowRadius: 10, shadowOffset: { width: 0, height: 4 } },
|
|
949
|
+
fabIcon: { color: C.white, fontSize: 15, fontWeight: "800", marginEnd: 8, width: 20, height: 20, borderRadius: 10, borderWidth: 1.5, borderColor: C.white, textAlign: "center", lineHeight: 17 },
|
|
950
|
+
fabText: { color: C.white, fontSize: 15, fontWeight: "600" }
|
|
951
|
+
});
|
|
952
|
+
|
|
953
|
+
// src/index.ts
|
|
954
|
+
var import_react_native3 = require("@sentry/react-native");
|
|
50
955
|
var DEFAULT_ENDPOINT = "https://in.blipit.io";
|
|
51
|
-
var VERSION = "0.
|
|
956
|
+
var VERSION = "0.3.0";
|
|
52
957
|
var PACKAGE = { name: "npm:@blipit/react-native", version: VERSION };
|
|
53
958
|
function withIdentity(user) {
|
|
54
959
|
return (event, hint) => {
|
|
@@ -86,8 +991,26 @@ function init2(options) {
|
|
|
86
991
|
...rest,
|
|
87
992
|
beforeSend: withIdentity(rest.beforeSend)
|
|
88
993
|
});
|
|
994
|
+
configureReporter(new ReportClient(endpoint ?? DEFAULT_ENDPOINT, k), () => deviceContext(rest.release));
|
|
89
995
|
return true;
|
|
90
996
|
}
|
|
997
|
+
function deviceContext(release) {
|
|
998
|
+
const { width, height, scale } = import_react_native2.Dimensions.get("window");
|
|
999
|
+
let language = "";
|
|
1000
|
+
let timezone = "";
|
|
1001
|
+
try {
|
|
1002
|
+
const o = Intl.DateTimeFormat().resolvedOptions();
|
|
1003
|
+
language = o.locale;
|
|
1004
|
+
timezone = o.timeZone;
|
|
1005
|
+
} catch {
|
|
1006
|
+
}
|
|
1007
|
+
return {
|
|
1008
|
+
platform: "react-native",
|
|
1009
|
+
sdk: { name: PACKAGE.name, version: VERSION },
|
|
1010
|
+
...release ? { app: { release } } : {},
|
|
1011
|
+
device: { os: import_react_native2.Platform.OS, os_version: String(import_react_native2.Platform.Version), screen: `${Math.round(width)}x${Math.round(height)}`, dpr: scale, language, timezone, touch: true }
|
|
1012
|
+
};
|
|
1013
|
+
}
|
|
91
1014
|
function captureSecurity(kind, actor, details = {}) {
|
|
92
1015
|
const context = { kind, actor };
|
|
93
1016
|
const extra = { outcome: details.outcome, actor_id: details.actorId, ip: details.ip, user_agent: details.userAgent, target: details.target };
|
|
@@ -103,6 +1026,7 @@ function captureSecurity(kind, actor, details = {}) {
|
|
|
103
1026
|
}
|
|
104
1027
|
// Annotate the CommonJS export names for ESM import in node:
|
|
105
1028
|
0 && (module.exports = {
|
|
1029
|
+
BlipitReporter,
|
|
106
1030
|
DEFAULT_ENDPOINT,
|
|
107
1031
|
VERSION,
|
|
108
1032
|
addBreadcrumb,
|
|
@@ -114,6 +1038,7 @@ function captureSecurity(kind, actor, details = {}) {
|
|
|
114
1038
|
init,
|
|
115
1039
|
setTag,
|
|
116
1040
|
setUser,
|
|
1041
|
+
showReport,
|
|
117
1042
|
withIdentity,
|
|
118
1043
|
wrap
|
|
119
1044
|
});
|