@uxbertlabs/reportly 1.0.20 → 1.0.21
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/components/ReportlyProvider.d.ts.map +1 -1
- package/dist/features/export.d.ts.map +1 -1
- package/dist/index.cjs.js +47 -22
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +48 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportlyProvider.d.ts","sourceRoot":"","sources":["../../src/components/ReportlyProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAyC,SAAS,
|
|
1
|
+
{"version":3,"file":"ReportlyProvider.d.ts","sourceRoot":"","sources":["../../src/components/ReportlyProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAyC,SAAS,EAAwB,MAAM,OAAO,CAAC;AACtG,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAI/D,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAEvD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,UAAU,GAAG,UAAU,CAAC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;CACxB;AAmED,UAAU,mBAAmB;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C,oB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,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -298,29 +298,40 @@ class N8nIntegration {
|
|
|
298
298
|
|
|
299
299
|
class Export {
|
|
300
300
|
constructor(n8nConfig) {
|
|
301
|
-
this.savedIssues =
|
|
301
|
+
this.savedIssues = [];
|
|
302
302
|
this.n8nIntegration = new N8nIntegration(n8nConfig);
|
|
303
|
+
// Defer localStorage access to avoid SSR issues
|
|
304
|
+
if (typeof window !== 'undefined' && typeof localStorage !== 'undefined') {
|
|
305
|
+
this.savedIssues = this.loadSavedIssues();
|
|
306
|
+
}
|
|
303
307
|
}
|
|
304
308
|
exportToJSON(issueData) {
|
|
305
309
|
const json = JSON.stringify(issueData, null, 2);
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
310
|
+
// Check if we're in a browser environment
|
|
311
|
+
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
312
|
+
const blob = new Blob([json], {
|
|
313
|
+
type: 'application/json'
|
|
314
|
+
});
|
|
315
|
+
const url = URL.createObjectURL(blob);
|
|
316
|
+
// Create download link
|
|
317
|
+
const link = document.createElement('a');
|
|
318
|
+
link.href = url;
|
|
319
|
+
link.download = `issue-${Date.now()}.json`;
|
|
320
|
+
document.body.appendChild(link);
|
|
321
|
+
link.click();
|
|
322
|
+
document.body.removeChild(link);
|
|
323
|
+
// Clean up
|
|
324
|
+
URL.revokeObjectURL(url);
|
|
325
|
+
// Save to localStorage
|
|
326
|
+
this.saveIssue(issueData);
|
|
327
|
+
}
|
|
321
328
|
return json;
|
|
322
329
|
}
|
|
323
330
|
saveIssue(issueData) {
|
|
331
|
+
// Check if we're in a browser environment
|
|
332
|
+
if (typeof window === 'undefined' || typeof localStorage === 'undefined') {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
324
335
|
try {
|
|
325
336
|
this.savedIssues.push({
|
|
326
337
|
...issueData,
|
|
@@ -337,6 +348,10 @@ class Export {
|
|
|
337
348
|
}
|
|
338
349
|
}
|
|
339
350
|
loadSavedIssues() {
|
|
351
|
+
// Check if we're in a browser environment
|
|
352
|
+
if (typeof window === 'undefined' || typeof localStorage === 'undefined') {
|
|
353
|
+
return [];
|
|
354
|
+
}
|
|
340
355
|
try {
|
|
341
356
|
const saved = localStorage.getItem('uxbert-saved-issues');
|
|
342
357
|
return saved ? JSON.parse(saved) : [];
|
|
@@ -350,13 +365,23 @@ class Export {
|
|
|
350
365
|
}
|
|
351
366
|
deleteSavedIssue(issueId) {
|
|
352
367
|
this.savedIssues = this.savedIssues.filter(issue => issue.id !== issueId);
|
|
353
|
-
|
|
368
|
+
// Check if we're in a browser environment
|
|
369
|
+
if (typeof window !== 'undefined' && typeof localStorage !== 'undefined') {
|
|
370
|
+
localStorage.setItem('uxbert-saved-issues', JSON.stringify(this.savedIssues));
|
|
371
|
+
}
|
|
354
372
|
}
|
|
355
373
|
clearSavedIssues() {
|
|
356
374
|
this.savedIssues = [];
|
|
357
|
-
|
|
375
|
+
// Check if we're in a browser environment
|
|
376
|
+
if (typeof window !== 'undefined' && typeof localStorage !== 'undefined') {
|
|
377
|
+
localStorage.removeItem('uxbert-saved-issues');
|
|
378
|
+
}
|
|
358
379
|
}
|
|
359
380
|
exportAllIssues() {
|
|
381
|
+
// Check if we're in a browser environment
|
|
382
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
360
385
|
const json = JSON.stringify(this.savedIssues, null, 2);
|
|
361
386
|
const blob = new Blob([json], {
|
|
362
387
|
type: 'application/json'
|
|
@@ -9579,10 +9604,10 @@ function ReportlyProvider({
|
|
|
9579
9604
|
});
|
|
9580
9605
|
// Annotation manager state - will be set by Reportly component
|
|
9581
9606
|
const [annotationManager, setAnnotationManagerState] = React.useState(null);
|
|
9582
|
-
// Initialize services
|
|
9583
|
-
const deviceInfo = new DeviceInfo();
|
|
9584
|
-
const exportService = new Export(config.integrations?.n8n);
|
|
9585
|
-
const screenshot = new Screenshot();
|
|
9607
|
+
// Initialize services with useMemo to ensure they're only created once and support SSR
|
|
9608
|
+
const deviceInfo = React.useMemo(() => new DeviceInfo(), []);
|
|
9609
|
+
const exportService = React.useMemo(() => new Export(config.integrations?.n8n), [config.integrations?.n8n]);
|
|
9610
|
+
const screenshot = React.useMemo(() => new Screenshot(), []);
|
|
9586
9611
|
const openModal = React.useCallback(() => {
|
|
9587
9612
|
dispatch({
|
|
9588
9613
|
type: 'OPEN_MODAL'
|