@rose42/t3-feedback 0.1.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.
Files changed (106) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +516 -0
  3. package/dist/bridge/attachments.d.ts +27 -0
  4. package/dist/bridge/attachments.js +109 -0
  5. package/dist/bridge/format.d.ts +70 -0
  6. package/dist/bridge/format.js +358 -0
  7. package/dist/bridge/http.d.ts +31 -0
  8. package/dist/bridge/http.js +169 -0
  9. package/dist/bridge/index.d.ts +13 -0
  10. package/dist/bridge/index.js +12 -0
  11. package/dist/bridge/parse.d.ts +16 -0
  12. package/dist/bridge/parse.js +82 -0
  13. package/dist/bridge/paths.d.ts +10 -0
  14. package/dist/bridge/paths.js +10 -0
  15. package/dist/bridge/probeThreads.d.ts +13 -0
  16. package/dist/bridge/probeThreads.js +66 -0
  17. package/dist/bridge/readSource.d.ts +8 -0
  18. package/dist/bridge/readSource.js +64 -0
  19. package/dist/bridge/sendFeedback.d.ts +99 -0
  20. package/dist/bridge/sendFeedback.js +417 -0
  21. package/dist/cli/bin.d.ts +2 -0
  22. package/dist/cli/bin.js +40 -0
  23. package/dist/cli/constants.d.ts +4 -0
  24. package/dist/cli/constants.js +4 -0
  25. package/dist/cli/detect.d.ts +17 -0
  26. package/dist/cli/detect.js +118 -0
  27. package/dist/cli/index.d.ts +4 -0
  28. package/dist/cli/index.js +4 -0
  29. package/dist/cli/init.d.ts +18 -0
  30. package/dist/cli/init.js +165 -0
  31. package/dist/cli/pm.d.ts +12 -0
  32. package/dist/cli/pm.js +49 -0
  33. package/dist/cli/prompt.d.ts +2 -0
  34. package/dist/cli/prompt.js +19 -0
  35. package/dist/cli/wire/next.d.ts +8 -0
  36. package/dist/cli/wire/next.js +71 -0
  37. package/dist/cli/wire/node.d.ts +3 -0
  38. package/dist/cli/wire/node.js +76 -0
  39. package/dist/cli/wire/vite.d.ts +25 -0
  40. package/dist/cli/wire/vite.js +71 -0
  41. package/dist/client/activeThreads.d.ts +23 -0
  42. package/dist/client/activeThreads.js +89 -0
  43. package/dist/client/cropScreenshot.d.ts +39 -0
  44. package/dist/client/cropScreenshot.js +212 -0
  45. package/dist/client/customPlugins.d.ts +7 -0
  46. package/dist/client/customPlugins.js +38 -0
  47. package/dist/client/draft.d.ts +33 -0
  48. package/dist/client/draft.js +222 -0
  49. package/dist/client/index.d.ts +24 -0
  50. package/dist/client/index.js +20 -0
  51. package/dist/client/mount.d.ts +210 -0
  52. package/dist/client/mount.js +2408 -0
  53. package/dist/client/openInT3.d.ts +28 -0
  54. package/dist/client/openInT3.js +81 -0
  55. package/dist/client/readClipboardImage.d.ts +2 -0
  56. package/dist/client/readClipboardImage.js +2 -0
  57. package/dist/client/reportType.d.ts +43 -0
  58. package/dist/client/reportType.js +110 -0
  59. package/dist/client/selectBurstFrames.d.ts +21 -0
  60. package/dist/client/selectBurstFrames.js +101 -0
  61. package/dist/client/sessionThread.d.ts +26 -0
  62. package/dist/client/sessionThread.js +93 -0
  63. package/dist/client/threadPicker.d.ts +20 -0
  64. package/dist/client/threadPicker.js +51 -0
  65. package/dist/client/transport.d.ts +11 -0
  66. package/dist/client/transport.js +35 -0
  67. package/dist/client/ui/commentPanelPlugin.d.ts +46 -0
  68. package/dist/client/ui/commentPanelPlugin.js +126 -0
  69. package/dist/client/ui/defaultPlugins.d.ts +19 -0
  70. package/dist/client/ui/defaultPlugins.js +48 -0
  71. package/dist/client/ui/elementTargetChip.d.ts +64 -0
  72. package/dist/client/ui/elementTargetChip.js +185 -0
  73. package/dist/client/ui/elementTargetPanelPlugin.d.ts +43 -0
  74. package/dist/client/ui/elementTargetPanelPlugin.js +167 -0
  75. package/dist/client/ui/elementTargetPanelSession.d.ts +49 -0
  76. package/dist/client/ui/elementTargetPanelSession.js +279 -0
  77. package/dist/client/ui/elementTargetUi.d.ts +36 -0
  78. package/dist/client/ui/elementTargetUi.js +105 -0
  79. package/dist/client/ui/host.d.ts +112 -0
  80. package/dist/client/ui/host.js +132 -0
  81. package/dist/client/ui/html.d.ts +22 -0
  82. package/dist/client/ui/html.js +26 -0
  83. package/dist/client/ui/labeledPluginPreview.d.ts +8 -0
  84. package/dist/client/ui/labeledPluginPreview.js +71 -0
  85. package/dist/client/ui/resolveContributions.d.ts +13 -0
  86. package/dist/client/ui/resolveContributions.js +20 -0
  87. package/dist/client/ui/screenshotPanelPlugin.d.ts +39 -0
  88. package/dist/client/ui/screenshotPanelPlugin.js +212 -0
  89. package/dist/client/ui/screenshotPanelSession.d.ts +84 -0
  90. package/dist/client/ui/screenshotPanelSession.js +445 -0
  91. package/dist/client/ui/screenshotUi.d.ts +31 -0
  92. package/dist/client/ui/screenshotUi.js +130 -0
  93. package/dist/client/ui/shortcuts.d.ts +32 -0
  94. package/dist/client/ui/shortcuts.js +40 -0
  95. package/dist/client/ui/slots.d.ts +73 -0
  96. package/dist/client/ui/slots.js +112 -0
  97. package/dist/controls.d.ts +8 -0
  98. package/dist/controls.js +16 -0
  99. package/dist/index.d.ts +3 -0
  100. package/dist/index.js +2 -0
  101. package/dist/plugin.d.ts +9 -0
  102. package/dist/plugin.js +186 -0
  103. package/dist/types.d.ts +464 -0
  104. package/dist/types.js +283 -0
  105. package/docs/devcontainer.md +160 -0
  106. package/package.json +107 -0
@@ -0,0 +1,210 @@
1
+ import { type FeedbackCapturePlugin, type FeedbackTransport, type ResolveElementSource } from "@rose42/feedback-capture";
2
+ import { type T3BuiltinPluginId, type T3FeedbackBuiltinPluginOptions, type T3FeedbackClientConfig, type T3FeedbackFabOptions, type T3FeedbackPickOptions, type T3FeedbackRecordOptions, type T3FeedbackReportTypeGlyph, type T3FeedbackScreenshotOptions, type T3FeedbackShortcutOptions, type T3FeedbackThreadReuse } from "../types.js";
3
+ import { buildReportTypeHint, gatePluginByReportType, pageContextForReportType, pluginAppliesToReportType, type FeedbackReportType } from "./reportType.js";
4
+ import { type FeedbackCapturePluginWithUi } from "./ui/slots.js";
5
+ export type { FeedbackReportType };
6
+ export type { FeedbackDraft } from "./draft.js";
7
+ export { buildReportTypeHint, gatePluginByReportType, pageContextForReportType, pluginAppliesToReportType, };
8
+ export { readFeedbackDraft } from "./draft.js";
9
+ export type T3FeedbackMountCopy = {
10
+ fabTitle: string;
11
+ fabAriaLabel: string;
12
+ panelTitle: string;
13
+ commentPlaceholder: string;
14
+ captureLabel: string;
15
+ pickLabel: string;
16
+ clearPickLabel: string;
17
+ /** Tooltip on a resolved component file path (open in IDE). */
18
+ openInEditorLabel: string;
19
+ clearScreenshotLabel: string;
20
+ recordLabel: string;
21
+ stopRecordLabel: string;
22
+ recordingStatus: string;
23
+ recordFailedStatus: string;
24
+ burstAttachedStatus: string;
25
+ galleryFullStatus: string;
26
+ /** Tooltip when Capture is disabled because the image limit is reached. */
27
+ galleryFullTooltip: string;
28
+ pickBurstHint: string;
29
+ pickBurstConfirmLabel: string;
30
+ removeImageLabel: string;
31
+ /** Discard the screenshot from the crop dialog (same X as thumb remove). */
32
+ discardScreenshotLabel: string;
33
+ pickingStatus: string;
34
+ pickCancelledStatus: string;
35
+ cancelLabel: string;
36
+ /** Tooltip on the panel × — clarifies discard vs Esc / outside. */
37
+ cancelTitle: string;
38
+ sendLabel: string;
39
+ capturingStatus: string;
40
+ captureFailedStatus: string;
41
+ screenshotAttachedStatus: string;
42
+ pastedAttachedStatus: string;
43
+ commentRequiredStatus: string;
44
+ sendingStatus: string;
45
+ sentStatus: string;
46
+ openInT3Label: string;
47
+ /** Toast title after a successful send. */
48
+ toastSentLabel: string;
49
+ /** Activity popover heading. */
50
+ activityTitle: string;
51
+ activityEmptyLabel: string;
52
+ activityNewLabel: string;
53
+ activityOpenLabel: string;
54
+ activityContinueLabel: string;
55
+ activitySettleLabel: string;
56
+ activityDismissLabel: string;
57
+ activityClearLabel: string;
58
+ activityFabTitle: string;
59
+ activityFabAriaLabel: string;
60
+ cropHint: string;
61
+ cropHintSeeded: string;
62
+ cropLabel: string;
63
+ useFullLabel: string;
64
+ changeRegionLabel: string;
65
+ /** Short visible label on the clipboard-insert button. */
66
+ insertClipboardLabel: string;
67
+ /** Full tooltip / accessible name for clipboard insert. */
68
+ insertClipboardTitle: string;
69
+ dismissClipboardLabel: string;
70
+ autoCapturingStatus: string;
71
+ autoCroppedStatus: string;
72
+ autoCapturedStatus: string;
73
+ /** Label for the include-innerHTML checkbox. */
74
+ includeInnerHTMLLabel: string;
75
+ /** Label prefix for the styles select. */
76
+ stylesLabel: string;
77
+ stylesNoneLabel: string;
78
+ stylesLayoutLabel: string;
79
+ stylesComputedLabel: string;
80
+ /** Section label above the picked-element card. */
81
+ elementSectionLabel: string;
82
+ /** Section label above the screenshot card. */
83
+ screenshotSectionLabel: string;
84
+ reportTypeBugLabel: string;
85
+ reportTypeFeedbackLabel: string;
86
+ reportTypeSuggestionLabel: string;
87
+ /**
88
+ * Optional hint overrides. When omitted, hints are derived from active
89
+ * plugins + report-type field filtering ({@link buildReportTypeHint}).
90
+ */
91
+ reportTypeBugHint?: string;
92
+ reportTypeFeedbackHint?: string;
93
+ reportTypeSuggestionHint?: string;
94
+ /** Emoji used when `reportTypeGlyph` is `"emoji"` (ignored when a custom map is set). */
95
+ reportTypeBugEmoji: string;
96
+ reportTypeFeedbackEmoji: string;
97
+ reportTypeSuggestionEmoji: string;
98
+ /** Section label / aria for New vs Continue. */
99
+ threadDestinationLabel: string;
100
+ threadNewLabel: string;
101
+ /** Accessible name prefix for the Continue control (icon + title). */
102
+ threadContinueLabel: string;
103
+ /** Visible + accessible label when the prior thread has no title. */
104
+ threadContinueUntitledLabel: string;
105
+ /** Opens the searchable continue-thread picker. */
106
+ threadPickLabel: string;
107
+ /** Search field placeholder in the thread picker. */
108
+ threadSearchPlaceholder: string;
109
+ /** Empty state when the search matches nothing. */
110
+ threadSearchEmptyLabel: string;
111
+ /** Status chip when a listed thread is still open / working. */
112
+ threadStateWorkingLabel: string;
113
+ /** Status chip when a listed thread is settled. */
114
+ threadStateSettledLabel: string;
115
+ /**
116
+ * Footer under truncated results. `{shown}` / `{total}` are replaced.
117
+ * Example: "Showing 48 of 46".
118
+ */
119
+ threadSearchTruncatedLabel: string;
120
+ };
121
+ export type MountT3FeedbackOptions = {
122
+ /** POST path for the Vite middleware (default: /__t3-feedback). */
123
+ endpoint?: string;
124
+ /** Override transport (default: wrapped HTTP POST supporting session-route reuse). */
125
+ transport?: FeedbackTransport;
126
+ /** DOM id for the mount root (default: t3-feedback-root). */
127
+ rootId?: string;
128
+ /**
129
+ * Full keyboard chord (key + modifiers). Default when omitted: Ctrl/⌘+Shift+F.
130
+ * When set, omitted modifiers are false — e.g. `{ key: "f" }` is bare F.
131
+ * Bare keys are ignored while focus is in an editable field; Ctrl/⌘+Shift+key
132
+ * still opens as a global override. Escape still closes.
133
+ */
134
+ shortcut?: T3FeedbackShortcutOptions;
135
+ /**
136
+ * @deprecated Use `shortcut: { key }` instead. Letter only; modifiers stay Ctrl/⌘+Shift.
137
+ */
138
+ shortcutKey?: string;
139
+ /** Floating ✎ button visibility, position, and size (default: mobile-only). */
140
+ fab?: T3FeedbackFabOptions;
141
+ /** Element pick shortcut + after-pick capture/crop behavior. */
142
+ pick?: T3FeedbackPickOptions & {
143
+ /**
144
+ * Custom DOM → source resolver (programmatic mount only).
145
+ * Wins over `pick.sourceFramework`. Not available via the Vite plugin JSON config.
146
+ */
147
+ resolveSource?: ResolveElementSource;
148
+ };
149
+ /** Capture / Change-region crop behavior. */
150
+ screenshot?: T3FeedbackScreenshotOptions;
151
+ /** Frame-burst record shortcut. */
152
+ record?: T3FeedbackRecordOptions;
153
+ /**
154
+ * Thread reuse across sends. Default: `"ask"`.
155
+ * With the default HTTP transport, `"ask"` / `"session-route"` persist a
156
+ * per-pathname thread id; `"never"` always creates. Custom `transport`
157
+ * still shows the ask UI when a prior record exists, but must handle reuse
158
+ * itself if it needs the thread id on the wire.
159
+ */
160
+ threadReuse?: T3FeedbackThreadReuse;
161
+ /**
162
+ * Report-type glyphs in the overlay and on new thread titles: SVG `"icon"`
163
+ * (default), `"emoji"`, or a custom map (`{ Bug: "🐛", Feedback: "💬", Suggestion: "💡" }`).
164
+ * `"emoji"` / map replace `Bug` / `Feedback` / `Suggestion` in new chat names.
165
+ */
166
+ reportTypeGlyph?: T3FeedbackReportTypeGlyph;
167
+ /** Optional UI string overrides. */
168
+ copy?: Partial<T3FeedbackMountCopy>;
169
+ /**
170
+ * Extra capture plugins (setup via session on mount, collect on send).
171
+ * Built-ins are selected via {@link MountT3FeedbackOptions.activePlugins}.
172
+ * Comment, reportType, and screenshot (when active) collect from their panel
173
+ * plugins on `session.build()` — no submit-time extra plugins.
174
+ */
175
+ plugins?: FeedbackCapturePluginWithUi[];
176
+ /**
177
+ * Which built-in plugins to enable. Omit = all four.
178
+ * See {@link T3BuiltinPluginId}.
179
+ */
180
+ activePlugins?: T3BuiltinPluginId[];
181
+ /** Options for selected built-ins (e.g. console ring size). */
182
+ pluginOptions?: T3FeedbackBuiltinPluginOptions;
183
+ /**
184
+ * @deprecated Prefer `activePlugins` without `"consoleLogs"`.
185
+ * When `false`, strips `consoleLogs` from the resolved set.
186
+ */
187
+ includeConsoleLogs?: boolean;
188
+ /**
189
+ * App version for `envelope.version`. When set, installs the version
190
+ * plugin; in DEV also tracks HMR generation (`#n`).
191
+ */
192
+ version?: string;
193
+ };
194
+ /** Imperative controls returned from {@link mountT3Feedback}. */
195
+ export type T3FeedbackHandle = {
196
+ open: () => void;
197
+ close: () => void;
198
+ /** Start element picking (opens the panel afterward). */
199
+ pick: () => void;
200
+ /** Start Capture screenshot (opens the panel afterward). */
201
+ capture: () => void;
202
+ /** Start frame-burst recording (opens the panel afterward). */
203
+ record: () => void;
204
+ unmount: () => void;
205
+ };
206
+ export { buildOpenInEditorUrl, buildTargetChipHtml, componentHierarchy, formatComponentLocation, formatElementChip, formatSelectorBreadcrumb, openSourceInEditor, selectorAtAncestorDepth, splitCssSelectorParts, } from "./ui/elementTargetChip.js";
207
+ /** Mount the floating feedback control and keyboard shortcut; returns a handle. */
208
+ export declare function mountT3Feedback(options?: MountT3FeedbackOptions): T3FeedbackHandle;
209
+ /** Convenience for the injected virtual module (config + optional custom plugins). */
210
+ export declare function mountT3FeedbackFromConfig(config: T3FeedbackClientConfig, customPlugins?: FeedbackCapturePlugin[]): T3FeedbackHandle;