@lightworkai.official/debug-capture-react 0.6.0 → 0.7.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/README.md +14 -12
- package/dist/SupportPortalButton.d.ts +20 -0
- package/dist/index.d.ts +3 -9
- package/dist/index.mjs +48 -1560
- package/package.json +2 -2
- package/src/SupportPortalButton.tsx +80 -0
- package/src/index.ts +12 -11
- package/dist/components/ImageAnnotatorDialog.d.ts +0 -11
- package/dist/components/MyTicketsPanel.d.ts +0 -11
- package/dist/components/ReopenPanel.d.ts +0 -7
- package/dist/components/RichReplyEditor.d.ts +0 -29
- package/dist/components/StatusHero.d.ts +0 -8
- package/dist/components/StatusPill.d.ts +0 -14
- package/dist/components/TicketBody.d.ts +0 -5
- package/dist/components/TicketConversation.d.ts +0 -13
- package/dist/components/TicketDetail.d.ts +0 -23
- package/dist/components/TicketScreenshots.d.ts +0 -6
- package/dist/components/TicketTable.d.ts +0 -18
- package/dist/components/TicketTimeline.d.ts +0 -14
- package/dist/components/ToolbarButton.d.ts +0 -18
- package/dist/components/icons.d.ts +0 -35
- package/src/components/ImageAnnotatorDialog.tsx +0 -160
- package/src/components/MyTicketsPanel.tsx +0 -321
- package/src/components/ReopenPanel.tsx +0 -52
- package/src/components/RichReplyEditor.tsx +0 -264
- package/src/components/StatusHero.tsx +0 -92
- package/src/components/StatusPill.tsx +0 -14
- package/src/components/TicketBody.tsx +0 -50
- package/src/components/TicketConversation.tsx +0 -177
- package/src/components/TicketDetail.tsx +0 -110
- package/src/components/TicketScreenshots.tsx +0 -41
- package/src/components/TicketTable.tsx +0 -161
- package/src/components/TicketTimeline.tsx +0 -81
- package/src/components/ToolbarButton.tsx +0 -37
- package/src/components/icons.tsx +0 -79
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ configureDebugCapture({
|
|
|
29
29
|
| `<DebugCaptureInit />` | Arms the buffers, mounts the reporter. Renders nothing. |
|
|
30
30
|
| `<ReportProblemButton />` | Opens the reporter. Unstyled; `className` and children are yours. |
|
|
31
31
|
| `<DebugErrorBoundary />` | Catches a render crash and offers to report it. |
|
|
32
|
-
| `<
|
|
32
|
+
| `<SupportPortalButton />` | Sends the user to their tickets on the support host, signed in. |
|
|
33
33
|
|
|
34
34
|
`DebugErrorBoundary` is the one thing React needs that Vue and Angular do not: a
|
|
35
35
|
render error never reaches `window.onerror`, so the core's crash watcher cannot
|
|
@@ -58,21 +58,23 @@ an error that explains nothing.
|
|
|
58
58
|
/>
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
**`
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
**`SupportPortalButton` sends someone to their tickets** on the support host,
|
|
62
|
+
already signed in. It needs `identity` in the config: a token your *server*
|
|
63
|
+
signs, because `realmKey` is public and can authorise filing a report but never
|
|
64
|
+
reading one back. See
|
|
65
|
+
[the core README](../debug-capture/README.md#it-needs-to-know-who-is-asking).
|
|
66
|
+
|
|
67
|
+
This replaced an embedded panel. The panel was a ticket list, a thread and a
|
|
68
|
+
reply editor in three frameworks over a read API — which meant every change to
|
|
69
|
+
the way a ticket looks landed in four repositories. The support host renders
|
|
70
|
+
that screen already, so it owns it now; the cost is a context switch, and the
|
|
71
|
+
panel is still in the 0.6.x line if you would rather pay the other price.
|
|
65
72
|
|
|
66
73
|
```tsx
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
74
|
+
<SupportPortalButton />
|
|
75
|
+
<SupportPortalButton newTab onError={notify} />
|
|
70
76
|
```
|
|
71
77
|
|
|
72
|
-
It is a real React component now — props, callbacks, and children where they
|
|
73
|
-
make sense — not a web component mounted through a ref. The logic it arranges
|
|
74
|
-
lives in the core and is shared with the Vue and Angular packages.
|
|
75
|
-
|
|
76
78
|
Import the stylesheet once, from anywhere:
|
|
77
79
|
|
|
78
80
|
```ts
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "ดูปัญหาที่แจ้ง" — hands the current user to their tickets on the support host,
|
|
3
|
+
* already signed in.
|
|
4
|
+
*
|
|
5
|
+
* Unlike the reporter button this one awaits: the token comes from the host's
|
|
6
|
+
* own server at click time, because it lives about two minutes and is spent on
|
|
7
|
+
* arrival. So it has a pending state, and a failure path — most often "nobody
|
|
8
|
+
* is signed in", which is the host's question to answer and not ours.
|
|
9
|
+
*/
|
|
10
|
+
import { type ButtonHTMLAttributes, type ReactNode } from "react";
|
|
11
|
+
export interface SupportPortalButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
12
|
+
children?: ReactNode | ((state: {
|
|
13
|
+
pending: boolean;
|
|
14
|
+
}) => ReactNode);
|
|
15
|
+
label?: string;
|
|
16
|
+
/** Open in a new tab instead of navigating away. */
|
|
17
|
+
newTab?: boolean;
|
|
18
|
+
onError?: (err: unknown) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function SupportPortalButton({ children, label, newTab, onError, className, style, onClick, disabled, ...rest }: SupportPortalButtonProps): import("react").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,13 +11,7 @@ export type { DebugCaptureInitProps } from "./DebugCaptureInit";
|
|
|
11
11
|
export { ReportProblemButton } from "./ReportProblemButton";
|
|
12
12
|
export type { ReportProblemButtonProps } from "./ReportProblemButton";
|
|
13
13
|
export { DebugErrorBoundary } from "./DebugErrorBoundary";
|
|
14
|
-
export {
|
|
15
|
-
export type {
|
|
16
|
-
export { TicketTable } from "./components/TicketTable";
|
|
17
|
-
export { TicketDetail } from "./components/TicketDetail";
|
|
18
|
-
export { TicketConversation } from "./components/TicketConversation";
|
|
19
|
-
export { RichReplyEditor } from "./components/RichReplyEditor";
|
|
20
|
-
export { TicketBody } from "./components/TicketBody";
|
|
21
|
-
export { ImageAnnotatorDialog } from "./components/ImageAnnotatorDialog";
|
|
14
|
+
export { SupportPortalButton } from "./SupportPortalButton";
|
|
15
|
+
export type { SupportPortalButtonProps } from "./SupportPortalButton";
|
|
22
16
|
export { configureDebugCapture, launch, onCrash } from "@lightworkai.official/debug-capture";
|
|
23
|
-
export type { DebugCaptureConfig, DebugReason, ErroredQuery
|
|
17
|
+
export type { DebugCaptureConfig, DebugReason, ErroredQuery } from "@lightworkai.official/debug-capture";
|