@uxbertlabs/reportly 1.0.32 → 1.0.34
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/Reportly.d.ts.map +1 -1
- package/dist/components/ReportlyProvider.d.ts +2 -0
- package/dist/components/ReportlyProvider.d.ts.map +1 -1
- package/dist/features/screenshot.d.ts.map +1 -1
- package/dist/index.cjs.js +47 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +48 -18
- 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":"Reportly.d.ts","sourceRoot":"","sources":["../../src/components/Reportly.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAMjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CAClC;
|
|
1
|
+
{"version":3,"file":"Reportly.d.ts","sourceRoot":"","sources":["../../src/components/Reportly.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAMjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CAClC;AA0GD,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,qBAMjD;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import type { ReportlyConfig, IssueData, CompleteIssue, AnnotationTool } from "../types";
|
|
3
3
|
import type { N8nResponse } from "../features/n8n-integration";
|
|
4
|
+
import Screenshot from "../features/screenshot";
|
|
4
5
|
import AnnotationManager from "../features/annotation";
|
|
5
6
|
export interface ReportlyState {
|
|
6
7
|
isOpen: boolean;
|
|
@@ -14,6 +15,7 @@ export interface ReportlyState {
|
|
|
14
15
|
}
|
|
15
16
|
interface ReportlyContextType {
|
|
16
17
|
state: ReportlyState;
|
|
18
|
+
screenshot: Screenshot;
|
|
17
19
|
annotationManager: AnnotationManager | null;
|
|
18
20
|
setAnnotationManager: (manager: AnnotationManager | null) => void;
|
|
19
21
|
openModal: () => void;
|
|
@@ -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,EAA2C,MAAM,OAAO,CAAC;AACzH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG/D,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,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,UAAU,EAAE,UAAU,CAAC;IACvB,iBAAiB,EAAE,iB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eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAIjC;;OAEG;IACH,eAAe,IAAI,MAAM;IAIzB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAWtC;;OAEG;IACH,QAAQ,IAAI,eAAe;IAI3B;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI;IAIhD;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIjC,aAAa,IAAI,MAAM,GAAG,IAAI;IAI9B,KAAK,IAAI,IAAI;CAGd;AAED,eAAe,UAAU,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -9307,6 +9307,12 @@ class Screenshot {
|
|
|
9307
9307
|
this.quality = 0.95; // Default quality for JPEG/WebP
|
|
9308
9308
|
this.format = "png"; // Default format
|
|
9309
9309
|
this.currentScreenshot = null;
|
|
9310
|
+
console.log("Screenshot module initialized", {
|
|
9311
|
+
hooks,
|
|
9312
|
+
captureDelay,
|
|
9313
|
+
quality,
|
|
9314
|
+
format
|
|
9315
|
+
});
|
|
9310
9316
|
if (hooks) this.hooks = hooks;
|
|
9311
9317
|
if (captureDelay !== undefined) this.captureDelay = captureDelay;
|
|
9312
9318
|
if (quality !== undefined) this.quality = quality;
|
|
@@ -9670,6 +9676,13 @@ class Screenshot {
|
|
|
9670
9676
|
...this.hooks,
|
|
9671
9677
|
...hooks
|
|
9672
9678
|
};
|
|
9679
|
+
console.log("[Screenshot] Hooks updated:", {
|
|
9680
|
+
hasBeforeCapture: !!this.hooks.beforeCapture,
|
|
9681
|
+
hasAfterCapture: !!this.hooks.afterCapture,
|
|
9682
|
+
hasOnCaptureStart: !!this.hooks.onCaptureStart,
|
|
9683
|
+
hasOnCaptureComplete: !!this.hooks.onCaptureComplete,
|
|
9684
|
+
hasOnCaptureError: !!this.hooks.onCaptureError
|
|
9685
|
+
});
|
|
9673
9686
|
}
|
|
9674
9687
|
/**
|
|
9675
9688
|
* Get current hooks configuration
|
|
@@ -9701,11 +9714,6 @@ class Screenshot {
|
|
|
9701
9714
|
}
|
|
9702
9715
|
}
|
|
9703
9716
|
|
|
9704
|
-
var screenshot = /*#__PURE__*/Object.freeze({
|
|
9705
|
-
__proto__: null,
|
|
9706
|
-
default: Screenshot
|
|
9707
|
-
});
|
|
9708
|
-
|
|
9709
9717
|
const initialState = {
|
|
9710
9718
|
isOpen: false,
|
|
9711
9719
|
isAnnotating: false,
|
|
@@ -9816,7 +9824,30 @@ function ReportlyProvider({
|
|
|
9816
9824
|
// Initialize services with useMemo to ensure they're only created once and support SSR
|
|
9817
9825
|
const deviceInfo = React.useMemo(() => new DeviceInfo(), []);
|
|
9818
9826
|
const exportService = React.useMemo(() => new Export(config.integrations?.n8n), [config.integrations?.n8n]);
|
|
9819
|
-
|
|
9827
|
+
// Use ref for Screenshot to prevent recreation on config changes
|
|
9828
|
+
const screenshotRef = React.useRef(null);
|
|
9829
|
+
// Initialize Screenshot once
|
|
9830
|
+
if (screenshotRef.current === null) {
|
|
9831
|
+
screenshotRef.current = new Screenshot(config.screenshot?.hooks, config.screenshot?.captureDelay, config.screenshot?.quality, config.screenshot?.format);
|
|
9832
|
+
}
|
|
9833
|
+
// Update Screenshot configuration when config changes
|
|
9834
|
+
React.useEffect(() => {
|
|
9835
|
+
if (screenshotRef.current) {
|
|
9836
|
+
if (config.screenshot?.hooks) {
|
|
9837
|
+
screenshotRef.current.setHooks(config.screenshot.hooks);
|
|
9838
|
+
}
|
|
9839
|
+
if (config.screenshot?.captureDelay !== undefined) {
|
|
9840
|
+
screenshotRef.current.setCaptureDelay(config.screenshot.captureDelay);
|
|
9841
|
+
}
|
|
9842
|
+
if (config.screenshot?.quality !== undefined) {
|
|
9843
|
+
screenshotRef.current.setQuality(config.screenshot.quality);
|
|
9844
|
+
}
|
|
9845
|
+
if (config.screenshot?.format) {
|
|
9846
|
+
screenshotRef.current.setFormat(config.screenshot.format);
|
|
9847
|
+
}
|
|
9848
|
+
}
|
|
9849
|
+
}, [config.screenshot?.hooks, config.screenshot?.captureDelay, config.screenshot?.quality, config.screenshot?.format]);
|
|
9850
|
+
const screenshot = screenshotRef.current;
|
|
9820
9851
|
const openModal = React.useCallback(() => {
|
|
9821
9852
|
dispatch({
|
|
9822
9853
|
type: "OPEN_MODAL"
|
|
@@ -9972,6 +10003,7 @@ function ReportlyProvider({
|
|
|
9972
10003
|
}, [annotationManager]);
|
|
9973
10004
|
const contextValue = {
|
|
9974
10005
|
state,
|
|
10006
|
+
screenshot,
|
|
9975
10007
|
annotationManager,
|
|
9976
10008
|
setAnnotationManager: setAnnotationManagerState,
|
|
9977
10009
|
openModal,
|
|
@@ -10013,7 +10045,7 @@ function cn(...inputs) {
|
|
|
10013
10045
|
|
|
10014
10046
|
function Butterfly({
|
|
10015
10047
|
width = "100%",
|
|
10016
|
-
height = "
|
|
10048
|
+
height = "100%",
|
|
10017
10049
|
className = "",
|
|
10018
10050
|
style = {}
|
|
10019
10051
|
}) {
|
|
@@ -10060,7 +10092,8 @@ function FloatingButton({
|
|
|
10060
10092
|
}, /*#__PURE__*/React.createElement(Butterfly, {
|
|
10061
10093
|
style: {
|
|
10062
10094
|
color: "currentColor",
|
|
10063
|
-
width: "40px"
|
|
10095
|
+
width: "40px",
|
|
10096
|
+
height: "40px"
|
|
10064
10097
|
}
|
|
10065
10098
|
}));
|
|
10066
10099
|
}
|
|
@@ -10378,7 +10411,7 @@ const X = createLucideIcon("x", __iconNode);
|
|
|
10378
10411
|
|
|
10379
10412
|
function AminahUXbertLogo({
|
|
10380
10413
|
width = "100%",
|
|
10381
|
-
height = "
|
|
10414
|
+
height = "100%",
|
|
10382
10415
|
className = ""
|
|
10383
10416
|
}) {
|
|
10384
10417
|
return /*#__PURE__*/React.createElement("svg", {
|
|
@@ -10766,9 +10799,7 @@ function IssueModal({
|
|
|
10766
10799
|
}, /*#__PURE__*/React.createElement("label", {
|
|
10767
10800
|
htmlFor: "issue-title",
|
|
10768
10801
|
className: "uxbert-form-label"
|
|
10769
|
-
}, "Issue Title
|
|
10770
|
-
className: "uxbert-form-required"
|
|
10771
|
-
}, "*")), /*#__PURE__*/React.createElement("input", {
|
|
10802
|
+
}, "Issue Title"), /*#__PURE__*/React.createElement("input", {
|
|
10772
10803
|
id: "issue-title",
|
|
10773
10804
|
type: "text",
|
|
10774
10805
|
value: formData.title,
|
|
@@ -10848,7 +10879,7 @@ function IssueModal({
|
|
|
10848
10879
|
|
|
10849
10880
|
function AminahLogo({
|
|
10850
10881
|
width = "100%",
|
|
10851
|
-
height = "
|
|
10882
|
+
height = "100%",
|
|
10852
10883
|
className = ""
|
|
10853
10884
|
}) {
|
|
10854
10885
|
return /*#__PURE__*/React.createElement("svg", {
|
|
@@ -11644,6 +11675,7 @@ class AnnotationManager {
|
|
|
11644
11675
|
function ReportlyInner() {
|
|
11645
11676
|
const {
|
|
11646
11677
|
state,
|
|
11678
|
+
screenshot,
|
|
11647
11679
|
endAnnotation,
|
|
11648
11680
|
updateScreenshot,
|
|
11649
11681
|
setAnnotationManager
|
|
@@ -11689,15 +11721,13 @@ function ReportlyInner() {
|
|
|
11689
11721
|
const handleDone = async () => {
|
|
11690
11722
|
if (!annotationRef.current) return;
|
|
11691
11723
|
try {
|
|
11692
|
-
const Screenshot = (await Promise.resolve().then(function () { return screenshot; })).default;
|
|
11693
11724
|
// Use the current mode from annotation manager (it has auto-adjusted based on drawing location)
|
|
11694
11725
|
const captureMode = annotationRef.current.getCurrentMode();
|
|
11695
11726
|
console.log('Using capture mode from annotation manager:', captureMode);
|
|
11696
11727
|
// Hide the annotation canvas temporarily
|
|
11697
11728
|
annotationRef.current.hide();
|
|
11698
|
-
// Capture the screenshot
|
|
11699
|
-
const
|
|
11700
|
-
const baseScreenshot = await screenshotService.capture(captureMode);
|
|
11729
|
+
// Capture the screenshot using the configured screenshot instance from context
|
|
11730
|
+
const baseScreenshot = await screenshot.capture(captureMode);
|
|
11701
11731
|
// Export the annotated screenshot (combine base screenshot + annotations)
|
|
11702
11732
|
// Pass the capture mode so annotations can be positioned correctly
|
|
11703
11733
|
const annotatedScreenshot = await annotationRef.current.exportAnnotatedScreenshot(baseScreenshot, captureMode);
|