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