@athome-solution/feedjet 2.7.1 → 3.0.0-rc.1

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,123 @@
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
+ credit: 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
+ new_reply: string;
103
+ reply: string;
104
+ more: string;
105
+ less: string;
106
+ sent_on: string;
107
+ type: {
108
+ issue: string;
109
+ enhancement: string;
110
+ };
35
111
  loading: string;
36
- empty: string;
37
- error: string;
112
+ empty_title: string;
113
+ empty_text: string;
114
+ empty_filtered: string;
115
+ propose: string;
116
+ report: string;
117
+ error_title: string;
118
+ error_text: string;
38
119
  retry: string;
39
- card: {
40
- type: {
41
- issue: string;
42
- enhancement: string;
43
- };
44
- date_prefix: string;
45
- };
120
+ see: string;
46
121
  status: {
47
122
  enhancement: {
48
123
  loved: string;
@@ -61,52 +136,57 @@ declare const fr: {
61
136
  out_of_scope: string;
62
137
  };
63
138
  };
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
139
  };
77
140
  feedbot: {
78
- anonymous: string;
141
+ region: string;
142
+ bubble_default: string;
143
+ questions: string;
144
+ questions_one: string;
145
+ open: string;
146
+ later: string;
147
+ close_bubble: string;
148
+ progress: string;
149
+ progress_one: string;
150
+ progress_label: string;
151
+ rating_low: string;
152
+ rating_high: string;
153
+ rating_value: string;
154
+ rating_labels: {
155
+ 1: string;
156
+ 2: string;
157
+ 3: string;
158
+ 4: string;
159
+ 5: string;
160
+ };
161
+ star_label: string;
79
162
  rating_error: string;
163
+ choice_error: string;
164
+ quality_error: string;
165
+ anonymous: string;
166
+ anonymous_hint: string;
80
167
  cancel: string;
81
168
  submit: string;
82
- bubble_default: string;
83
- star_label: string;
84
169
  thanks: {
85
170
  title: string;
86
- sub_title: string;
87
- declined: {
88
- title: string;
89
- sub_title: string;
90
- };
171
+ text: string;
172
+ };
173
+ declined: {
174
+ title: string;
175
+ text: string;
91
176
  };
92
177
  };
93
- integration_test: {
178
+ integration: {
179
+ label: string;
94
180
  pending: {
95
- button: string;
96
- feedback: {
97
- title: string;
98
- text: string;
99
- };
100
- feedbot: {
101
- title: string;
102
- text: string;
103
- };
181
+ title: string;
182
+ text: string;
183
+ later: string;
184
+ start: string;
104
185
  };
105
186
  checking: {
106
187
  title: string;
107
- button: string;
108
- feedback_text: string;
109
- feedbot_text: string;
188
+ text: string;
189
+ cancel: string;
110
190
  };
111
191
  ok: {
112
192
  title: string;
@@ -116,52 +196,37 @@ declare const fr: {
116
196
  ko: {
117
197
  title: string;
118
198
  text: string;
119
- button: string;
199
+ copy: string;
200
+ copied: string;
201
+ retry: string;
120
202
  };
121
- };
122
- error: {
123
- communication: {
203
+ expired: {
124
204
  title: string;
125
- description: string;
205
+ text: string;
206
+ close: string;
126
207
  };
127
- no_subscription: {
128
- title: string;
129
- description: string;
208
+ steps: {
209
+ project: string;
210
+ api: string;
211
+ subscription: string;
130
212
  };
131
- };
132
- consent: {
133
- feedback: {
134
- label: string;
135
- tooltip: string;
213
+ state: {
214
+ ok: string;
215
+ run: string;
216
+ err: string;
217
+ wait: string;
136
218
  };
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;
219
+ details: {
220
+ project: string;
221
+ api: string;
222
+ domain: string;
223
+ subscription: string;
147
224
  };
148
225
  };
149
226
  global: {
150
- date_at: string;
151
- cancel: string;
152
- send: string;
153
227
  close: string;
154
- sending: string;
155
228
  submit_error: string;
156
229
  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
230
  };
166
231
  };
167
232
  type Translations = typeof fr;
@@ -183,6 +248,8 @@ interface UserType {
183
248
  profile?: string;
184
249
  }
185
250
 
251
+ type FeedbackType = 'issue' | 'enhancement';
252
+ type Tab = FeedbackType | 'decision';
186
253
  type MaybeHTMLElement = HTMLElement | null | undefined;
187
254
  type TargetType = MaybeHTMLElement | {
188
255
  feedback?: MaybeHTMLElement;
@@ -195,52 +262,122 @@ interface FeedbackOptions {
195
262
  user?: MaybeFunction<UserType | undefined>;
196
263
  locale?: Locale;
197
264
  theme?: Theme;
265
+ removeCredit?: boolean;
266
+ onOpen?: () => void;
267
+ onClose?: () => void;
268
+ onSubmit?: (feedback: {
269
+ type: FeedbackType;
270
+ }) => void;
271
+ onUpdates?: (count: number) => void;
198
272
  }
199
273
  declare class Feedback {
274
+ private i18n;
200
275
  private readonly options;
201
- private get theme();
202
- private form;
203
- private submitError;
204
- private submitErrorKey;
276
+ private readonly abortController;
277
+ private readonly surface;
278
+ private readonly modal;
279
+ private readonly integrationTest;
280
+ private destroyed;
281
+ private launcher;
282
+ private launcherSurface;
283
+ private opening;
284
+ private updatesCount;
205
285
  private hasConsentFeedback;
206
286
  private hasConsentScreenFeedback;
207
287
  private hasConsentAttachment;
208
- private feedbackButton;
209
- private createdButtonWrapper;
210
- private opening;
211
- private readonly onFeedbackButtonClick;
212
- private submitHandler;
213
- private state;
214
- private readonly abortController;
215
- private destroyed;
216
- private previouslyFocusedElement;
217
- private integrationTest;
288
+ private view;
289
+ private tab;
290
+ private sentType;
291
+ private title;
292
+ private description;
293
+ private category;
294
+ private consent;
295
+ private file;
296
+ private fileError;
297
+ private capture;
298
+ private errors;
299
+ private submitError;
300
+ private sending;
301
+ private startedAt;
302
+ private disclosure;
218
303
  private decisions;
219
304
  private decisionsStatus;
305
+ private filter;
306
+ private expanded;
307
+ private newIds;
308
+ private decisionsViewed;
220
309
  constructor(options: FeedbackOptions);
221
- destroy(): void;
310
+ private launcherFace;
311
+ private static emptyCapture;
312
+ private get theme();
313
+ private get user();
314
+ private get canFollow();
315
+ private get tabs();
222
316
  private get draftKey();
223
- private restoreDraft;
224
- private saveDraft;
317
+ private get seenKey();
318
+ private get updatesKey();
319
+ destroy(): void;
320
+ showThanks(type?: Tab): void;
321
+ open(tab?: Tab): Promise<void>;
322
+ close(): Promise<void>;
323
+ setLocale(locale: Locale): void;
324
+ setTheme(theme: Theme): void;
325
+ setUser(user: FeedbackOptions['user']): void;
326
+ private rerender;
327
+ private readonly onLauncherClick;
225
328
  private init;
226
- private createFeedbackButton;
329
+ private readonly placeLauncherLabel;
330
+ private setLauncherOpen;
331
+ private renderLauncherBadge;
332
+ private setUpdatesCount;
333
+ private refreshUpdates;
227
334
  private startFeedback;
335
+ private openModal;
336
+ private onClosed;
337
+ private resetForm;
338
+ private dropCapture;
339
+ private restoreDraft;
340
+ private saveDraft;
228
341
  private loadConsents;
229
- private loadDecisions;
230
- private refreshDecisionView;
231
- showThanks(type?: 'issue' | 'enhancement' | 'decision'): void;
232
- private render;
233
342
  private renderForm;
234
- private updateFormContent;
235
- private renderThanks;
236
- private renderTabs;
343
+ private renderTab;
344
+ private renderView;
345
+ private drawView;
346
+ private renderHead;
347
+ private renderFoot;
237
348
  private renderFields;
238
- private renderDecisionList;
239
- private renderDecisionCard;
349
+ private invalid;
350
+ private fieldMessage;
351
+ private renderCategories;
352
+ private renderCapture;
240
353
  private renderConsent;
241
- private attachFormEvents;
354
+ private renderFile;
355
+ private renderDecisions;
356
+ private sortedDecisions;
357
+ private renderCard;
358
+ private renderStatus;
359
+ private renderThanks;
360
+ private bindShell;
361
+ private selectTab;
362
+ private bindView;
363
+ private bindDecisions;
364
+ private bindCapture;
365
+ private refreshCapture;
366
+ private takeCapture;
367
+ private bindFile;
368
+ private setFile;
369
+ private clearError;
370
+ private focusFirstField;
371
+ private fetchDecisions;
372
+ private loadDecisions;
373
+ private refreshDecisions;
374
+ private refreshTabBadge;
375
+ private findNew;
376
+ private readSeen;
377
+ private markSeen;
378
+ private validate;
242
379
  private submit;
243
- private formatDecisionDate;
380
+ private toFormData;
244
381
  }
245
382
 
246
383
  interface FeedbotOptions {
@@ -250,28 +387,72 @@ interface FeedbotOptions {
250
387
  user?: MaybeFunction<UserType | undefined>;
251
388
  locale?: Locale;
252
389
  theme?: Theme;
390
+ removeCredit?: boolean;
391
+ onOpen?: () => void;
392
+ onClose?: () => void;
393
+ onAnswer?: (answer: {
394
+ status: AnswerStatus;
395
+ }) => void;
253
396
  }
397
+ type AnswerStatus = 'SENT' | 'DECLINED';
254
398
  declare class Feedbot {
255
- private options;
256
- private get theme();
257
- private form;
258
- private ratingError;
259
- private submitError;
260
- private submitErrorKey;
261
- private survey;
262
- private apiUrl;
263
- private previouslyFocusedElement;
264
- private integrationTest;
399
+ private i18n;
400
+ private readonly options;
401
+ private readonly apiUrl;
265
402
  private readonly abortController;
403
+ private readonly surface;
404
+ private readonly modal;
405
+ private readonly integrationTest;
266
406
  private destroyed;
267
- get user(): UserType | undefined;
407
+ private survey;
408
+ private bubble;
409
+ private toast;
410
+ private toastTimer;
411
+ private rating;
412
+ private quality;
413
+ private closed;
414
+ private anonymous;
415
+ private errors;
416
+ private submitError;
417
+ private sending;
268
418
  constructor(options: FeedbotOptions);
419
+ private get theme();
420
+ get user(): UserType | undefined;
269
421
  destroy(): void;
270
422
  showThanks(declined?: boolean): void;
271
- private render;
272
423
  increment(): Promise<void>;
273
- submit(): Promise<void>;
424
+ private get questions();
425
+ private showBubble;
426
+ private get snoozeKey();
427
+ private get snoozed();
428
+ private snooze;
429
+ private hideBubble;
430
+ open(): boolean;
431
+ close(): Promise<void>;
432
+ setLocale(locale: Locale): void;
433
+ setTheme(theme: Theme): void;
434
+ setUser(user: FeedbotOptions['user']): void;
435
+ private openSurvey;
436
+ private resetAnswers;
437
+ private get answered();
438
+ private get progressPercent();
439
+ private renderProgress;
440
+ private renderSurvey;
441
+ private error;
442
+ private renderRating;
443
+ private renderRatingHelp;
444
+ private renderQuality;
445
+ private renderClosed;
446
+ private bindSurvey;
447
+ private updateStars;
448
+ private updateProgress;
449
+ private clearError;
450
+ private validate;
451
+ private send;
452
+ private toJson;
453
+ private showToast;
454
+ private hideToast;
274
455
  }
275
456
 
276
457
  export { Feedback, Feedbot, Locales, messages };
277
- export type { Locale, Translations };
458
+ export type { Tab as FeedbackTab, Locale, Translations };