@athome-solution/feedjet 2.6.0 → 3.0.0-rc.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.cts CHANGED
@@ -1,48 +1,119 @@
1
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
- };
2
+ launcher: {
3
+ label: string;
4
+ updates: string;
5
+ updates_one: string;
6
+ };
7
+ form: {
8
+ tablist: string;
9
+ version: string;
10
+ cancel: string;
11
+ close: string;
12
+ sending: string;
13
+ required: string;
14
+ optional: string;
15
+ counter: string;
16
+ summary: string;
17
+ summary_one: string;
18
+ summary_focus: string;
19
+ consent: {
20
+ label: string;
21
+ more: string;
22
+ detail: string;
23
+ error: string;
11
24
  };
12
- thanks: {
13
- title: string;
14
- description: string;
25
+ tech: {
26
+ label: string;
27
+ hint: string;
28
+ more: string;
29
+ };
30
+ capture: {
31
+ on: string;
32
+ on_hint: string;
33
+ off: string;
34
+ off_hint: string;
35
+ pending: string;
36
+ failed: string;
37
+ toggle: string;
38
+ hide: string;
39
+ show: string;
40
+ };
41
+ attachment: {
42
+ add: string;
43
+ drop: string;
44
+ hint: string;
45
+ hint_short: string;
46
+ remove: string;
47
+ too_large: string;
48
+ invalid_type: string;
15
49
  };
16
50
  };
17
51
  enhancement: {
18
52
  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;
53
+ title: string;
54
+ subtitle: string;
55
+ field_title: string;
56
+ placeholder_title: string;
57
+ hint_title: string;
58
+ field_description: string;
59
+ placeholder_description: string;
60
+ error_title: string;
61
+ error_description: string;
62
+ submit: string;
63
+ thanks_title: string;
64
+ thanks_text: string;
65
+ thanks_text_anonymous: string;
66
+ };
67
+ issue: {
68
+ tab: string;
69
+ title: string;
70
+ subtitle: string;
71
+ category: string;
72
+ categories: {
73
+ broken: string;
74
+ display: string;
75
+ slow: string;
76
+ error_message: string;
77
+ other: string;
30
78
  };
79
+ field_title: string;
80
+ placeholder_title: string;
81
+ hint_title: string;
82
+ field_description: string;
83
+ placeholder_description: string;
84
+ error_title: string;
85
+ error_description: string;
86
+ submit: string;
87
+ thanks_title: string;
88
+ thanks_text: string;
89
+ thanks_text_anonymous: string;
31
90
  };
32
91
  decision: {
33
92
  tab: string;
34
- description: string;
93
+ title: string;
94
+ subtitle: string;
95
+ filter: string;
96
+ all: string;
97
+ ideas: string;
98
+ issues: string;
99
+ updates: string;
100
+ updates_one: string;
101
+ new_status: string;
102
+ sent_on: string;
103
+ type: {
104
+ issue: string;
105
+ enhancement: string;
106
+ };
35
107
  loading: string;
36
- empty: string;
37
- error: string;
108
+ empty_title: string;
109
+ empty_text: string;
110
+ empty_filtered: string;
111
+ propose: string;
112
+ report: string;
113
+ error_title: string;
114
+ error_text: string;
38
115
  retry: string;
39
- card: {
40
- type: {
41
- issue: string;
42
- enhancement: string;
43
- };
44
- date_prefix: string;
45
- };
116
+ see: string;
46
117
  status: {
47
118
  enhancement: {
48
119
  loved: string;
@@ -61,52 +132,57 @@ declare const fr: {
61
132
  out_of_scope: string;
62
133
  };
63
134
  };
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
135
  };
77
136
  feedbot: {
78
- anonymous: string;
137
+ region: string;
138
+ bubble_default: string;
139
+ questions: string;
140
+ questions_one: string;
141
+ open: string;
142
+ later: string;
143
+ close_bubble: string;
144
+ progress: string;
145
+ progress_one: string;
146
+ progress_label: string;
147
+ rating_low: string;
148
+ rating_high: string;
149
+ rating_value: string;
150
+ rating_labels: {
151
+ 1: string;
152
+ 2: string;
153
+ 3: string;
154
+ 4: string;
155
+ 5: string;
156
+ };
157
+ star_label: string;
79
158
  rating_error: string;
159
+ choice_error: string;
160
+ quality_error: string;
161
+ anonymous: string;
162
+ anonymous_hint: string;
80
163
  cancel: string;
81
164
  submit: string;
82
- bubble_default: string;
83
- star_label: string;
84
165
  thanks: {
85
166
  title: string;
86
- sub_title: string;
87
- declined: {
88
- title: string;
89
- sub_title: string;
90
- };
167
+ text: string;
168
+ };
169
+ declined: {
170
+ title: string;
171
+ text: string;
91
172
  };
92
173
  };
93
- integration_test: {
174
+ integration: {
175
+ label: string;
94
176
  pending: {
95
- button: string;
96
- feedback: {
97
- title: string;
98
- text: string;
99
- };
100
- feedbot: {
101
- title: string;
102
- text: string;
103
- };
177
+ title: string;
178
+ text: string;
179
+ later: string;
180
+ start: string;
104
181
  };
105
182
  checking: {
106
183
  title: string;
107
- button: string;
108
- feedback_text: string;
109
- feedbot_text: string;
184
+ text: string;
185
+ cancel: string;
110
186
  };
111
187
  ok: {
112
188
  title: string;
@@ -116,52 +192,37 @@ declare const fr: {
116
192
  ko: {
117
193
  title: string;
118
194
  text: string;
119
- button: string;
120
- };
121
- };
122
- error: {
123
- communication: {
124
- title: string;
125
- description: string;
195
+ copy: string;
196
+ copied: string;
197
+ retry: string;
126
198
  };
127
- no_subscription: {
199
+ expired: {
128
200
  title: string;
129
- description: string;
201
+ text: string;
202
+ close: string;
130
203
  };
131
- };
132
- consent: {
133
- feedback: {
134
- label: string;
135
- tooltip: string;
204
+ steps: {
205
+ project: string;
206
+ api: string;
207
+ subscription: string;
136
208
  };
137
- screen: {
138
- label: string;
139
- tooltip: string;
209
+ state: {
210
+ ok: string;
211
+ run: string;
212
+ err: string;
213
+ wait: string;
140
214
  };
141
- attachment: {
142
- button: string;
143
- no_file: string;
144
- tooltip: string;
145
- file_too_large: string;
146
- invalid_type: string;
215
+ details: {
216
+ project: string;
217
+ api: string;
218
+ domain: string;
219
+ subscription: string;
147
220
  };
148
221
  };
149
222
  global: {
150
- date_at: string;
151
- cancel: string;
152
- send: string;
153
223
  close: string;
154
- sending: string;
155
224
  submit_error: string;
156
225
  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
226
  };
166
227
  };
167
228
  type Translations = typeof fr;
@@ -176,12 +237,15 @@ type Locale = typeof Locales[keyof typeof Locales];
176
237
  declare const messages: Readonly<Record<Locale, Translations>>;
177
238
 
178
239
  type MaybeFunction<T> = T | (() => T);
240
+ type Theme = 'light' | 'dark' | 'auto';
179
241
  interface UserType {
180
242
  id: string;
181
243
  fullName?: string;
182
244
  profile?: string;
183
245
  }
184
246
 
247
+ type FeedbackType = 'issue' | 'enhancement';
248
+ type Tab = FeedbackType | 'decision';
185
249
  type MaybeHTMLElement = HTMLElement | null | undefined;
186
250
  type TargetType = MaybeHTMLElement | {
187
251
  feedback?: MaybeHTMLElement;
@@ -193,51 +257,105 @@ interface FeedbackOptions {
193
257
  baseApiUrl?: string;
194
258
  user?: MaybeFunction<UserType | undefined>;
195
259
  locale?: Locale;
260
+ theme?: Theme;
196
261
  }
197
262
  declare class Feedback {
198
263
  private readonly options;
199
- private form;
200
- private submitError;
201
- private submitErrorKey;
264
+ private readonly abortController;
265
+ private readonly surface;
266
+ private readonly modal;
267
+ private readonly integrationTest;
268
+ private destroyed;
269
+ private launcher;
270
+ private launcherSurface;
271
+ private opening;
272
+ private updatesCount;
202
273
  private hasConsentFeedback;
203
274
  private hasConsentScreenFeedback;
204
275
  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;
276
+ private view;
277
+ private tab;
278
+ private sentType;
279
+ private title;
280
+ private description;
281
+ private category;
282
+ private consent;
283
+ private file;
284
+ private fileError;
285
+ private capture;
286
+ private errors;
287
+ private submitError;
288
+ private sending;
289
+ private startedAt;
290
+ private disclosure;
215
291
  private decisions;
216
292
  private decisionsStatus;
293
+ private filter;
294
+ private newIds;
295
+ private decisionsViewed;
217
296
  constructor(options: FeedbackOptions);
218
- destroy(): void;
297
+ private static emptyCapture;
298
+ private get theme();
299
+ private get user();
300
+ private get canFollow();
301
+ private get tabs();
219
302
  private get draftKey();
220
- private restoreDraft;
221
- private saveDraft;
303
+ private get seenKey();
304
+ private get updatesKey();
305
+ destroy(): void;
306
+ showThanks(type?: Tab): void;
307
+ private readonly onLauncherClick;
222
308
  private init;
223
- private createFeedbackButton;
309
+ private setLauncherOpen;
310
+ private renderLauncherBadge;
311
+ private refreshUpdates;
224
312
  private startFeedback;
313
+ private openModal;
314
+ private onClosed;
315
+ private resetForm;
316
+ private dropCapture;
317
+ private restoreDraft;
318
+ private saveDraft;
225
319
  private loadConsents;
226
- private loadDecisions;
227
- private refreshDecisionView;
228
- showThanks(type?: 'issue' | 'enhancement' | 'decision'): void;
229
- private render;
230
320
  private renderForm;
231
- private updateFormContent;
232
- private renderThanks;
233
- private renderTabs;
321
+ private renderTab;
322
+ private renderView;
323
+ private drawView;
324
+ private renderHead;
325
+ private renderFoot;
234
326
  private renderFields;
235
- private renderDecisionList;
236
- private renderDecisionCard;
327
+ private invalid;
328
+ private fieldMessage;
329
+ private renderCategories;
330
+ private renderCapture;
237
331
  private renderConsent;
238
- private attachFormEvents;
332
+ private renderFile;
333
+ private renderDecisions;
334
+ private sortedDecisions;
335
+ private renderCard;
336
+ private renderStatus;
337
+ private renderThanks;
338
+ private bindShell;
339
+ private selectTab;
340
+ private bindView;
341
+ private bindDecisions;
342
+ private bindCapture;
343
+ private refreshCapture;
344
+ private takeCapture;
345
+ private bindFile;
346
+ private setFile;
347
+ private clearError;
348
+ private focusFirstField;
349
+ private fetchDecisions;
350
+ private loadDecisions;
351
+ private refreshDecisions;
352
+ private refreshTabBadge;
353
+ private findNew;
354
+ private readSeen;
355
+ private markSeen;
356
+ private validate;
239
357
  private submit;
240
- private formatDecisionDate;
358
+ private toFormData;
241
359
  }
242
360
 
243
361
  interface FeedbotOptions {
@@ -246,26 +364,55 @@ interface FeedbotOptions {
246
364
  surveyId: string;
247
365
  user?: MaybeFunction<UserType | undefined>;
248
366
  locale?: Locale;
367
+ theme?: Theme;
249
368
  }
250
369
  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;
370
+ private readonly options;
371
+ private readonly apiUrl;
260
372
  private readonly abortController;
373
+ private readonly surface;
374
+ private readonly modal;
375
+ private readonly integrationTest;
261
376
  private destroyed;
262
- get user(): UserType | undefined;
377
+ private survey;
378
+ private bubble;
379
+ private toast;
380
+ private toastTimer;
381
+ private rating;
382
+ private quality;
383
+ private closed;
384
+ private anonymous;
385
+ private errors;
386
+ private submitError;
387
+ private sending;
263
388
  constructor(options: FeedbotOptions);
389
+ private get theme();
390
+ get user(): UserType | undefined;
264
391
  destroy(): void;
265
392
  showThanks(declined?: boolean): void;
266
- private render;
267
393
  increment(): Promise<void>;
268
- submit(): Promise<void>;
394
+ private get questions();
395
+ private showBubble;
396
+ private hideBubble;
397
+ private openSurvey;
398
+ private resetAnswers;
399
+ private get answered();
400
+ private renderProgress;
401
+ private renderSurvey;
402
+ private error;
403
+ private renderRating;
404
+ private renderRatingHelp;
405
+ private renderQuality;
406
+ private renderClosed;
407
+ private bindSurvey;
408
+ private updateStars;
409
+ private updateProgress;
410
+ private clearError;
411
+ private validate;
412
+ private send;
413
+ private toJson;
414
+ private showToast;
415
+ private hideToast;
269
416
  }
270
417
 
271
418
  export { Feedback, Feedbot, Locales, messages };