File tree Expand file tree Collapse file tree 5 files changed +34
-4
lines changed
core/src/types-hoist/feedback Expand file tree Collapse file tree 5 files changed +34
-4
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,21 @@ export interface FeedbackTextConfiguration {
176176 * The label for the button that removes a screenshot and hides the image editor
177177 */
178178 removeScreenshotButtonLabel : string ;
179+
180+ /**
181+ * The label for the button that highlights portions ofthe screenshot
182+ */
183+ highlightToolText : string ;
184+
185+ /**
186+ * The label for the button that hides portions of the screenshot
187+ */
188+ hideToolText : string ;
189+
190+ /**
191+ * The label for the button that removed a highlight/hidden section of the screenshot.
192+ */
193+ removeHighlightText : string ;
179194}
180195
181196/**
Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ export const SUCCESS_MESSAGE_TEXT = 'Thank you for your report!';
2222export const IS_REQUIRED_LABEL = '(required)' ;
2323export const ADD_SCREENSHOT_LABEL = 'Add a screenshot' ;
2424export const REMOVE_SCREENSHOT_LABEL = 'Remove screenshot' ;
25+ export const HIGHLIGHT_TOOL_TEXT = 'Highlight' ;
26+ export const HIDE_TOOL_TEXT = 'Hide' ;
27+ export const REMOVE_HIGHLIGHT_TEXT = 'Remove' ;
2528
2629export const FEEDBACK_WIDGET_SOURCE = 'widget' ;
2730export const FEEDBACK_API_SOURCE = 'api' ;
Original file line number Diff line number Diff line change @@ -14,11 +14,14 @@ import {
1414 EMAIL_LABEL ,
1515 EMAIL_PLACEHOLDER ,
1616 FORM_TITLE ,
17+ HIDE_TOOL_TEXT ,
18+ HIGHLIGHT_TOOL_TEXT ,
1719 IS_REQUIRED_LABEL ,
1820 MESSAGE_LABEL ,
1921 MESSAGE_PLACEHOLDER ,
2022 NAME_LABEL ,
2123 NAME_PLACEHOLDER ,
24+ REMOVE_HIGHLIGHT_TEXT ,
2225 REMOVE_SCREENSHOT_LABEL ,
2326 SUBMIT_BUTTON_LABEL ,
2427 SUCCESS_MESSAGE_TEXT ,
@@ -110,6 +113,9 @@ export const buildFeedbackIntegration = ({
110113 successMessageText = SUCCESS_MESSAGE_TEXT ,
111114 triggerLabel = TRIGGER_LABEL ,
112115 triggerAriaLabel = '' ,
116+ highlightToolText = HIGHLIGHT_TOOL_TEXT ,
117+ hideToolText = HIDE_TOOL_TEXT ,
118+ removeHighlightText = REMOVE_HIGHLIGHT_TEXT ,
113119
114120 // FeedbackCallbacks
115121 onFormOpen,
@@ -152,6 +158,9 @@ export const buildFeedbackIntegration = ({
152158 isRequiredLabel,
153159 addScreenshotButtonLabel,
154160 removeScreenshotButtonLabel,
161+ highlightToolText,
162+ hideToolText,
163+ removeHighlightText,
155164
156165 onFormClose,
157166 onFormOpen,
Original file line number Diff line number Diff line change @@ -310,7 +310,7 @@ export function ScreenshotEditorFactory({
310310 } }
311311 >
312312 < button
313- aria-label = "Remove"
313+ aria-label = { options . removeHighlightText }
314314 onClick = { deleteRect ( index ) }
315315 onMouseDown = { handleStopPropagation }
316316 onMouseUp = { handleStopPropagation }
@@ -323,7 +323,7 @@ export function ScreenshotEditorFactory({
323323 </ div >
324324 </ div >
325325 </ div >
326- < Toolbar action = { action } setAction = { setAction } />
326+ < Toolbar options = { options } action = { action } setAction = { setAction } />
327327 </ div >
328328 ) ;
329329 } ;
Original file line number Diff line number Diff line change 11import type { h as hType , VNode } from 'preact' ;
22import type * as Hooks from 'preact/hooks' ;
3+ import type { FeedbackInternalOptions } from '@sentry/core' ;
34
45interface FactoryParams {
56 h : typeof hType ;
@@ -11,9 +12,11 @@ export default function ToolbarFactory({
1112 return function Toolbar ( {
1213 action,
1314 setAction,
15+ options,
1416 } : {
1517 action : 'highlight' | 'hide' | '' ;
1618 setAction : Hooks . StateUpdater < 'highlight' | 'hide' | '' > ;
19+ options : FeedbackInternalOptions ;
1720 } ) : VNode {
1821 return (
1922 < div class = "editor__tool-container" >
@@ -25,7 +28,7 @@ export default function ToolbarFactory({
2528 setAction ( action === 'highlight' ? '' : 'highlight' ) ;
2629 } }
2730 >
28- Highlight
31+ { options . highlightToolText }
2932 </ button >
3033 < button
3134 type = "button"
@@ -34,7 +37,7 @@ export default function ToolbarFactory({
3437 setAction ( action === 'hide' ? '' : 'hide' ) ;
3538 } }
3639 >
37- Hide
40+ { options . hideToolText }
3841 </ button >
3942 </ div >
4043 </ div >
You can’t perform that action at this time.
0 commit comments