@athome-solution/feedjet 2.4.0 → 2.6.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/dist/index.d.ts CHANGED
@@ -1,6 +1,272 @@
1
- import type { Locale } from './i18n';
2
- import { Feedback } from './feedback';
3
- import { Feedbot } from './feedbot';
4
- import { Locales } from './i18n';
5
- export { Feedback, Feedbot, Locales };
6
- export type { Locale };
1
+ declare const fr: {
2
+ issue: {
3
+ tab: string;
4
+ form: {
5
+ title: string;
6
+ description: string;
7
+ field: {
8
+ title: string;
9
+ description: string;
10
+ };
11
+ };
12
+ thanks: {
13
+ title: string;
14
+ description: string;
15
+ };
16
+ };
17
+ enhancement: {
18
+ tab: string;
19
+ form: {
20
+ title: string;
21
+ description: string;
22
+ field: {
23
+ title: string;
24
+ description: string;
25
+ };
26
+ };
27
+ thanks: {
28
+ title: string;
29
+ description: string;
30
+ };
31
+ };
32
+ decision: {
33
+ tab: string;
34
+ description: string;
35
+ loading: string;
36
+ empty: string;
37
+ error: string;
38
+ retry: string;
39
+ card: {
40
+ type: {
41
+ issue: string;
42
+ enhancement: string;
43
+ };
44
+ date_prefix: string;
45
+ };
46
+ status: {
47
+ enhancement: {
48
+ loved: string;
49
+ planned: string;
50
+ next_step: string;
51
+ to_study: string;
52
+ impossible: string;
53
+ transmitted: string;
54
+ };
55
+ issue: {
56
+ planned: string;
57
+ next_step: string;
58
+ not_a_bug: string;
59
+ impossible: string;
60
+ transmitted: string;
61
+ out_of_scope: string;
62
+ };
63
+ };
64
+ form: {
65
+ title: string;
66
+ description: string;
67
+ field: {
68
+ title: string;
69
+ description: string;
70
+ };
71
+ };
72
+ thanks: {
73
+ title: string;
74
+ description: string;
75
+ };
76
+ };
77
+ feedbot: {
78
+ anonymous: string;
79
+ rating_error: string;
80
+ cancel: string;
81
+ submit: string;
82
+ bubble_default: string;
83
+ star_label: string;
84
+ thanks: {
85
+ title: string;
86
+ sub_title: string;
87
+ declined: {
88
+ title: string;
89
+ sub_title: string;
90
+ };
91
+ };
92
+ };
93
+ integration_test: {
94
+ pending: {
95
+ button: string;
96
+ feedback: {
97
+ title: string;
98
+ text: string;
99
+ };
100
+ feedbot: {
101
+ title: string;
102
+ text: string;
103
+ };
104
+ };
105
+ checking: {
106
+ title: string;
107
+ button: string;
108
+ feedback_text: string;
109
+ feedbot_text: string;
110
+ };
111
+ ok: {
112
+ title: string;
113
+ text: string;
114
+ button: string;
115
+ };
116
+ ko: {
117
+ title: string;
118
+ text: string;
119
+ button: string;
120
+ };
121
+ };
122
+ error: {
123
+ communication: {
124
+ title: string;
125
+ description: string;
126
+ };
127
+ no_subscription: {
128
+ title: string;
129
+ description: string;
130
+ };
131
+ };
132
+ consent: {
133
+ feedback: {
134
+ label: string;
135
+ tooltip: string;
136
+ };
137
+ screen: {
138
+ label: string;
139
+ tooltip: string;
140
+ };
141
+ attachment: {
142
+ button: string;
143
+ no_file: string;
144
+ tooltip: string;
145
+ file_too_large: string;
146
+ invalid_type: string;
147
+ };
148
+ };
149
+ global: {
150
+ date_at: string;
151
+ cancel: string;
152
+ send: string;
153
+ close: string;
154
+ sending: string;
155
+ submit_error: string;
156
+ rate_limited: string;
157
+ required: string;
158
+ required_field: string;
159
+ required_choice: string;
160
+ required_consent: string;
161
+ };
162
+ a11y: {
163
+ feedback_button: string;
164
+ feedbot_bubble: string;
165
+ };
166
+ };
167
+ type Translations = typeof fr;
168
+
169
+ declare const Locales: {
170
+ readonly FR: "fr";
171
+ readonly EN: "en";
172
+ readonly ES: "es";
173
+ readonly NL: "nl";
174
+ };
175
+ type Locale = typeof Locales[keyof typeof Locales];
176
+ declare const messages: Readonly<Record<Locale, Translations>>;
177
+
178
+ type MaybeFunction<T> = T | (() => T);
179
+ interface UserType {
180
+ id: string;
181
+ fullName?: string;
182
+ profile?: string;
183
+ }
184
+
185
+ type MaybeHTMLElement = HTMLElement | null | undefined;
186
+ type TargetType = MaybeHTMLElement | {
187
+ feedback?: MaybeHTMLElement;
188
+ };
189
+ interface FeedbackOptions {
190
+ target: TargetType;
191
+ projectId: string;
192
+ apiUrl?: string;
193
+ baseApiUrl?: string;
194
+ user?: MaybeFunction<UserType | undefined>;
195
+ locale?: Locale;
196
+ }
197
+ declare class Feedback {
198
+ private readonly options;
199
+ private form;
200
+ private submitError;
201
+ private submitErrorKey;
202
+ private hasConsentFeedback;
203
+ private hasConsentScreenFeedback;
204
+ private hasConsentAttachment;
205
+ private feedbackButton;
206
+ private createdButtonWrapper;
207
+ private opening;
208
+ private readonly onFeedbackButtonClick;
209
+ private submitHandler;
210
+ private state;
211
+ private readonly abortController;
212
+ private destroyed;
213
+ private previouslyFocusedElement;
214
+ private integrationTest;
215
+ private decisions;
216
+ private decisionsStatus;
217
+ constructor(options: FeedbackOptions);
218
+ destroy(): void;
219
+ private get draftKey();
220
+ private restoreDraft;
221
+ private saveDraft;
222
+ private init;
223
+ private createFeedbackButton;
224
+ private startFeedback;
225
+ private loadConsents;
226
+ private loadDecisions;
227
+ private refreshDecisionView;
228
+ showThanks(type?: 'issue' | 'enhancement' | 'decision'): void;
229
+ private render;
230
+ private renderForm;
231
+ private updateFormContent;
232
+ private renderThanks;
233
+ private renderTabs;
234
+ private renderFields;
235
+ private renderDecisionList;
236
+ private renderDecisionCard;
237
+ private renderConsent;
238
+ private attachFormEvents;
239
+ private submit;
240
+ private formatDecisionDate;
241
+ }
242
+
243
+ interface FeedbotOptions {
244
+ apiUrl?: string;
245
+ baseApiUrl?: string;
246
+ surveyId: string;
247
+ user?: MaybeFunction<UserType | undefined>;
248
+ locale?: Locale;
249
+ }
250
+ declare class Feedbot {
251
+ private options;
252
+ private form;
253
+ private ratingError;
254
+ private submitError;
255
+ private submitErrorKey;
256
+ private survey;
257
+ private apiUrl;
258
+ private previouslyFocusedElement;
259
+ private integrationTest;
260
+ private readonly abortController;
261
+ private destroyed;
262
+ get user(): UserType | undefined;
263
+ constructor(options: FeedbotOptions);
264
+ destroy(): void;
265
+ showThanks(declined?: boolean): void;
266
+ private render;
267
+ increment(): Promise<void>;
268
+ submit(): Promise<void>;
269
+ }
270
+
271
+ export { Feedback, Feedbot, Locales, messages };
272
+ export type { Locale, Translations };