@athome-solution/feedjet 2.4.0 → 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.
- package/README.md +36 -9
- package/dist/css/feedback.css +1 -1
- package/dist/css/feedback.css.map +1 -1
- package/dist/css/feedbot.css +1 -1
- package/dist/css/feedbot.css.map +1 -1
- package/dist/index.cjs +1 -0
- package/dist/{locales/fr.d.ts → index.d.cts} +107 -2
- package/dist/index.d.ts +265 -6
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +20 -7
- package/dist/feedback.d.ts +0 -48
- package/dist/feedbot.d.ts +0 -26
- package/dist/i18n.d.ts +0 -12
- package/dist/integration-test.d.ts +0 -33
- package/dist/locales/en.d.ts +0 -2
- package/dist/locales/es.d.ts +0 -2
- package/dist/locales/nl.d.ts +0 -2
- package/dist/types.d.ts +0 -6
- package/dist/utils.d.ts +0 -11
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@athome-solution/feedjet",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.0",
|
|
5
5
|
"description": "A library for feedback with form and screenshot support.",
|
|
6
6
|
"author": "Athome Solution",
|
|
7
7
|
"license": "MIT",
|
|
@@ -17,15 +17,22 @@
|
|
|
17
17
|
],
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
"import": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"default": "./dist/index.esm.js"
|
|
23
|
+
},
|
|
24
|
+
"require": {
|
|
25
|
+
"types": "./dist/index.d.cts",
|
|
26
|
+
"default": "./dist/index.cjs"
|
|
27
|
+
}
|
|
23
28
|
},
|
|
24
29
|
"./*": "./dist/*"
|
|
25
30
|
},
|
|
26
|
-
"main": "./dist/index.
|
|
31
|
+
"main": "./dist/index.cjs",
|
|
27
32
|
"module": "./dist/index.esm.js",
|
|
28
|
-
"
|
|
33
|
+
"unpkg": "./dist/index.umd.js",
|
|
34
|
+
"jsdelivr": "./dist/index.umd.js",
|
|
35
|
+
"types": "./dist/index.d.cts",
|
|
29
36
|
"files": [
|
|
30
37
|
"dist"
|
|
31
38
|
],
|
|
@@ -39,6 +46,8 @@
|
|
|
39
46
|
},
|
|
40
47
|
"devDependencies": {
|
|
41
48
|
"@antfu/eslint-config": "^3.12.1",
|
|
49
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
50
|
+
"@playwright/test": "1.65.1",
|
|
42
51
|
"@rollup/plugin-commonjs": "^28.0.2",
|
|
43
52
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
44
53
|
"@rollup/plugin-replace": "^6.0.3",
|
|
@@ -54,7 +63,9 @@
|
|
|
54
63
|
"magic-string": "^0.30.17",
|
|
55
64
|
"postcss": "^8.4.49",
|
|
56
65
|
"postcss-cli": "^11.0.0",
|
|
66
|
+
"publint": "^0.3.25",
|
|
57
67
|
"rollup": "^4.30.0",
|
|
68
|
+
"rollup-plugin-dts": "^6.5.1",
|
|
58
69
|
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
59
70
|
"rollup-plugin-string": "^3.0.0",
|
|
60
71
|
"sass": "^1.83.1",
|
|
@@ -71,6 +82,8 @@
|
|
|
71
82
|
"scripts": {
|
|
72
83
|
"lint:fix": "eslint --fix .",
|
|
73
84
|
"svg": "svgo --recursive --input=./src/assets --output=./src/assets",
|
|
74
|
-
"playground": "vite --open"
|
|
85
|
+
"playground": "vite --open",
|
|
86
|
+
"test:e2e": "playwright test",
|
|
87
|
+
"check:package": "bash scripts/check-package.sh"
|
|
75
88
|
}
|
|
76
89
|
}
|
package/dist/feedback.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { Locale } from './i18n';
|
|
2
|
-
import type { MaybeFunction, UserType } from './types';
|
|
3
|
-
type MaybeHTMLElement = HTMLElement | null | undefined;
|
|
4
|
-
type TargetType = MaybeHTMLElement | {
|
|
5
|
-
feedback?: MaybeHTMLElement;
|
|
6
|
-
};
|
|
7
|
-
interface FeedbackOptions {
|
|
8
|
-
target: TargetType;
|
|
9
|
-
projectId: string;
|
|
10
|
-
apiUrl?: string;
|
|
11
|
-
baseApiUrl?: string;
|
|
12
|
-
user?: MaybeFunction<UserType | undefined>;
|
|
13
|
-
locale?: Locale;
|
|
14
|
-
}
|
|
15
|
-
export declare class Feedback {
|
|
16
|
-
private readonly options;
|
|
17
|
-
private form;
|
|
18
|
-
private submitError;
|
|
19
|
-
private hasConsentFeedback;
|
|
20
|
-
private hasConsentScreenFeedback;
|
|
21
|
-
private hasConsentAttachment;
|
|
22
|
-
private isFeedbackButtonInitialized;
|
|
23
|
-
private submitHandler;
|
|
24
|
-
private previouslyFocusedElement;
|
|
25
|
-
private integrationTest;
|
|
26
|
-
private decisions;
|
|
27
|
-
private decisionsLoading;
|
|
28
|
-
constructor(options: FeedbackOptions);
|
|
29
|
-
private init;
|
|
30
|
-
private createFeedbackButton;
|
|
31
|
-
private startFeedback;
|
|
32
|
-
private loadConsents;
|
|
33
|
-
private fetchDecisions;
|
|
34
|
-
showThanks(type?: 'issue' | 'enhancement' | 'decision'): void;
|
|
35
|
-
private render;
|
|
36
|
-
private renderForm;
|
|
37
|
-
private updateFormContent;
|
|
38
|
-
private renderThanks;
|
|
39
|
-
private renderTabs;
|
|
40
|
-
private renderFields;
|
|
41
|
-
private renderDecisionList;
|
|
42
|
-
private renderDecisionCard;
|
|
43
|
-
private renderConsent;
|
|
44
|
-
private attachFormEvents;
|
|
45
|
-
private submit;
|
|
46
|
-
private formatDecisionDate;
|
|
47
|
-
}
|
|
48
|
-
export {};
|
package/dist/feedbot.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Locale } from './i18n';
|
|
2
|
-
import type { MaybeFunction, UserType } from './types';
|
|
3
|
-
interface FeedbotOptions {
|
|
4
|
-
apiUrl?: string;
|
|
5
|
-
baseApiUrl?: string;
|
|
6
|
-
surveyId: string;
|
|
7
|
-
user?: MaybeFunction<UserType | undefined>;
|
|
8
|
-
locale?: Locale;
|
|
9
|
-
}
|
|
10
|
-
export declare class Feedbot {
|
|
11
|
-
private options;
|
|
12
|
-
private form;
|
|
13
|
-
private ratingError;
|
|
14
|
-
private submitError;
|
|
15
|
-
private survey;
|
|
16
|
-
private apiUrl;
|
|
17
|
-
private previouslyFocusedElement;
|
|
18
|
-
private integrationTest;
|
|
19
|
-
get user(): UserType | undefined;
|
|
20
|
-
constructor(options: FeedbotOptions);
|
|
21
|
-
showThanks(declined?: boolean): void;
|
|
22
|
-
private render;
|
|
23
|
-
increment(): Promise<void>;
|
|
24
|
-
submit(): Promise<void>;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
package/dist/i18n.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const Locales: {
|
|
2
|
-
readonly FR: "fr";
|
|
3
|
-
readonly EN: "en";
|
|
4
|
-
readonly ES: "es";
|
|
5
|
-
readonly NL: "nl";
|
|
6
|
-
};
|
|
7
|
-
export type Locale = typeof Locales[keyof typeof Locales];
|
|
8
|
-
export declare function setLocale(locale: Locale): void;
|
|
9
|
-
export declare function getLocale(): Locale;
|
|
10
|
-
export declare function t(key: string): string;
|
|
11
|
-
export declare function tf(key: string, params: Record<string, string | number>): string;
|
|
12
|
-
export declare function requiredMark(cssClass?: string): string;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export type IntegrationStatus = 'pending' | 'ok' | 'ko';
|
|
2
|
-
export type ConnectivityError = 'communication_error' | 'no_subscription' | null;
|
|
3
|
-
export interface IntegrationTestConfig {
|
|
4
|
-
modalId: string;
|
|
5
|
-
bodyOpenClass: string;
|
|
6
|
-
toggleHtmlClass: boolean;
|
|
7
|
-
btnPrimaryClasses: string;
|
|
8
|
-
btnOutlineClasses: string;
|
|
9
|
-
btnLoadingClass: string;
|
|
10
|
-
pendingTitleKey: string;
|
|
11
|
-
pendingTextKey: string;
|
|
12
|
-
checkingTextKey: string;
|
|
13
|
-
cancelLabelKey: string;
|
|
14
|
-
connectivityCheckUrl: string;
|
|
15
|
-
connectivityCheckBody: Record<string, unknown>;
|
|
16
|
-
onSuccess: () => void;
|
|
17
|
-
}
|
|
18
|
-
export declare class IntegrationTest {
|
|
19
|
-
private _connectivityError;
|
|
20
|
-
private _integrationStatus;
|
|
21
|
-
private config;
|
|
22
|
-
constructor(config: IntegrationTestConfig);
|
|
23
|
-
get connectivityError(): ConnectivityError;
|
|
24
|
-
get integrationStatus(): IntegrationStatus;
|
|
25
|
-
setStatus(status: IntegrationStatus, error?: ConnectivityError): void;
|
|
26
|
-
handleIntegrationStatus(): boolean;
|
|
27
|
-
closeModal(): void;
|
|
28
|
-
private checkConnectivity;
|
|
29
|
-
private openModal;
|
|
30
|
-
private renderError;
|
|
31
|
-
private renderErrorContent;
|
|
32
|
-
private renderPendingTest;
|
|
33
|
-
}
|
package/dist/locales/en.d.ts
DELETED
package/dist/locales/es.d.ts
DELETED
package/dist/locales/nl.d.ts
DELETED
package/dist/types.d.ts
DELETED
package/dist/utils.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare function trapFocus(modal: HTMLElement, event: KeyboardEvent): void;
|
|
2
|
-
export declare function getBrowserInfo(): {
|
|
3
|
-
name: string;
|
|
4
|
-
version: string;
|
|
5
|
-
};
|
|
6
|
-
export declare function getScreenInfo(): {
|
|
7
|
-
resolution: string;
|
|
8
|
-
zoom: string;
|
|
9
|
-
};
|
|
10
|
-
export declare function getOSClient(): string;
|
|
11
|
-
export declare function captureScreenShot(): Promise<Blob | null>;
|