Skip to content

Commit d3b1c9f

Browse files
committed
adds experiment flag for annotations
1 parent 17b1ec9 commit d3b1c9f

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

packages/core/src/types-hoist/feedback/config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ export interface FeedbackGeneralConfiguration {
5757
name: string;
5858
};
5959

60+
/**
61+
* _experiments allows users to enable experimental or internal features.
62+
* We don't consider such features as part of the public API and hence we don't guarantee semver for them.
63+
* Experimental features can be added, changed or removed at any time.
64+
*
65+
* Default: undefined
66+
*/
67+
_experiments: Partial<{annotations: boolean;}>
68+
6069
/**
6170
* Set an object that will be merged sent as tags data with the event.
6271
*/

packages/feedback/src/core/integration.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export const buildFeedbackIntegration = ({
8484
email: 'email',
8585
name: 'username',
8686
},
87+
_experiments = {},
8788
tags,
8889
styleNonce,
8990
scriptNonce,
@@ -158,6 +159,8 @@ export const buildFeedbackIntegration = ({
158159
onSubmitError,
159160
onSubmitSuccess,
160161
onFormSubmitted,
162+
163+
_experiments,
161164
};
162165

163166
let _shadow: ShadowRoot | null = null;

packages/feedback/src/screenshot/components/ScreenshotEditor.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -395,14 +395,16 @@ export function ScreenshotEditorFactory({
395395
return (
396396
<div class="editor">
397397
<style nonce={options.styleNonce} dangerouslySetInnerHTML={styles} />
398-
<button
399-
class="editor__pen-tool"
400-
style={{ background: isAnnotating ? 'red' : 'white' }}
401-
onClick={e => {
402-
e.preventDefault();
403-
setIsAnnotating(!isAnnotating);
404-
}}
405-
></button>
398+
{options._experiments.annotations && (
399+
<button
400+
class="editor__pen-tool"
401+
style={{ background: isAnnotating ? 'red' : 'white' }}
402+
onClick={e => {
403+
e.preventDefault();
404+
setIsAnnotating(!isAnnotating);
405+
}}
406+
></button>
407+
)}
406408
<div class="editor__canvas-container" ref={canvasContainerRef}>
407409
<div
408410
class="editor__crop-container"

0 commit comments

Comments
 (0)