@web-site-utilities/feedback 0.0.18 → 0.0.19-dev.60aa6a2
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.cjs.js +255 -73
- package/dist/index.d.ts +94 -53
- package/dist/index.es.js +255 -73
- package/dist/index.iife.js +255 -73
- package/dist/{common → src/common}/components/Checkbox.d.ts +5 -5
- package/dist/{common → src/common}/components/ErrorMessage.d.ts +1 -1
- package/dist/src/common/components/Modal.d.ts +19 -0
- package/dist/{common → src/common}/components/QuestionMatrix.d.ts +6 -4
- package/dist/{common → src/common}/components/Radio.d.ts +3 -3
- package/dist/{common → src/common}/components/RangeSlide.d.ts +5 -5
- package/dist/{common → src/common}/components/Rating.d.ts +1 -1
- package/dist/{common → src/common}/components/Select.d.ts +4 -4
- package/dist/{common → src/common}/components/Step.d.ts +3 -2
- package/dist/{common → src/common}/components/StepsProgress.d.ts +1 -1
- package/dist/{common → src/common}/components/TextInput.d.ts +3 -3
- package/dist/{common → src/common}/components/Textarea.d.ts +2 -2
- package/dist/{common → src/common}/components/Typography.d.ts +2 -2
- package/dist/src/common/conf/endpoints.d.ts +5 -0
- package/dist/src/common/conf.d.ts +1 -0
- package/dist/src/common/conf.template.d.ts +1 -0
- package/dist/{common → src/common}/hooks/useStepper.d.ts +3 -0
- package/dist/{common → src/common}/theme/ThemeProvider.d.ts +1 -0
- package/dist/src/common/theme/breakpoints.d.ts +17 -0
- package/dist/src/common/types/DTO.d.ts +2288 -0
- package/dist/src/common/types/EndpointsConfig.d.ts +8 -0
- package/dist/{common → src/common}/types/FormConfig.d.ts +1 -1
- package/dist/{form → src/common}/types/InitiateFeedbackModuleOptions.d.ts +2 -1
- package/dist/{fields → src/fields}/Field/Field.d.ts +1 -2
- package/dist/{form → src/form}/App.d.ts +3 -4
- package/dist/{form → src/form}/api/baseApi.d.ts +3 -1
- package/dist/src/form/api/getFormConf.d.ts +8 -0
- package/dist/src/form/api/saveForm.d.ts +3 -0
- package/dist/src/form/api/useRequest.d.ts +13 -0
- package/dist/{form → src/form}/features/InPlaceForm/InPlaceForm.d.ts +10 -4
- package/dist/src/form/features/PopupForm/PopupForm.d.ts +11 -0
- package/dist/{form → src/form}/index.d.ts +4 -5
- package/package.json +6 -7
- package/tsconfig.json +7 -6
- package/dist/common/components/Modal.d.ts +0 -23
- package/dist/form/api/getFormConf.d.ts +0 -8
- package/dist/form/api/saveForm.d.ts +0 -2
- package/dist/form/api/useRequest.d.ts +0 -9
- package/dist/form/features/PopupForm/PopupForm.d.ts +0 -9
- /package/dist/{common → src/common}/components/Button.d.ts +0 -0
- /package/dist/{common → src/common}/hooks/useForm.d.ts +0 -0
- /package/dist/{common → src/common}/types/CommonFieldProps.d.ts +0 -0
- /package/dist/{common → src/common}/types/FormError.d.ts +0 -0
- /package/dist/{common → src/common}/types/Locale.d.ts +0 -0
- /package/dist/{common → src/common}/types/Nullable.d.ts +0 -0
- /package/dist/{common → src/common}/types/Option.d.ts +0 -0
- /package/dist/{common → src/common}/types/ValidationPerStep.d.ts +0 -0
- /package/dist/{common → src/common}/types/isNil.d.ts +0 -0
- /package/dist/{form → src/form}/components/FeedbackInput/FeedbackInput.d.ts +0 -0
- /package/dist/{form → src/form}/hooks/useIsClient.d.ts +0 -0
- /package/dist/{form → src/form}/index.dev.d.ts +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Locale } from '
|
|
1
|
+
import { Locale } from './Locale';
|
|
2
2
|
import { Container } from 'react-dom/client';
|
|
3
3
|
export type InitiateFeedbackModuleOptions = {
|
|
4
4
|
container?: Container;
|
|
5
5
|
formId: string;
|
|
6
|
+
sessionId?: string;
|
|
6
7
|
locale?: Locale;
|
|
7
8
|
};
|
|
8
9
|
export type InitiateFeedbackModuleOptionsCmp = Omit<InitiateFeedbackModuleOptions, 'container'>;
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { AllFields } from "@web-site-utilities/common/types/FormConfig";
|
|
3
3
|
import { FormError } from '@web-site-utilities/common/types/FormError';
|
|
4
4
|
import { Nullable } from '@web-site-utilities/common/types/Nullable';
|
|
5
|
-
import { SelectProps } from "@web-site-utilities/common/components/Select";
|
|
6
5
|
type Props = {
|
|
7
6
|
type: AllFields['type'];
|
|
8
7
|
fieldProps: AllFields;
|
|
@@ -14,6 +13,6 @@ type Props = {
|
|
|
14
13
|
dataField: Nullable<string>;
|
|
15
14
|
};
|
|
16
15
|
export declare const Field: (props: Props) => React.DOMElement<{
|
|
17
|
-
children: React.FunctionComponentElement<import("@web-site-utilities/common/components/QuestionMatrix").QuestionMatrixProps> | React.FunctionComponentElement<SelectProps> | React.FunctionComponentElement<import("@web-site-utilities/common/components/Radio").RadioGroupProps> | React.FunctionComponentElement<import("@web-site-utilities/common/components/Checkbox").CheckboxGroupProps> | React.FunctionComponentElement<import("@web-site-utilities/common/components/RangeSlide").RangeSlideProps> | React.FunctionComponentElement<import("@web-site-utilities/common/components/Rating").RatingProps> | React.FunctionComponentElement<import("@web-site-utilities/common/components/Textarea").TextareaProps
|
|
16
|
+
children: React.FunctionComponentElement<import("@web-site-utilities/common/components/QuestionMatrix").QuestionMatrixProps> | React.FunctionComponentElement<import("@web-site-utilities/common/components/Select").SelectProps> | React.FunctionComponentElement<import("@web-site-utilities/common/components/Radio").RadioGroupProps> | React.FunctionComponentElement<import("@web-site-utilities/common/components/Checkbox").CheckboxGroupProps> | React.FunctionComponentElement<import("@web-site-utilities/common/components/RangeSlide").RangeSlideProps> | React.FunctionComponentElement<import("@web-site-utilities/common/components/Rating").RatingProps> | React.FunctionComponentElement<import("@web-site-utilities/common/components/Textarea").TextareaProps>;
|
|
18
17
|
}, Element>;
|
|
19
18
|
export {};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { InitiateFeedbackModuleOptions } from "@web-site-utilities/common/types/InitiateFeedbackModuleOptions";
|
|
3
3
|
type AppProps = {
|
|
4
|
-
|
|
5
|
-
locale?: Locale;
|
|
4
|
+
options: InitiateFeedbackModuleOptions;
|
|
6
5
|
};
|
|
7
6
|
export declare const App: (props: AppProps) => string | React.FunctionComponentElement<{
|
|
8
7
|
theme: typeof import("@web-site-utilities/common/theme/ThemeProvider").theme;
|
|
9
8
|
selectedVariant?: import("@web-site-utilities/common/theme/ThemeProvider").Variants;
|
|
10
9
|
children: React.ReactNode;
|
|
11
|
-
}
|
|
10
|
+
}>;
|
|
12
11
|
export {};
|
|
@@ -4,5 +4,7 @@ export type RequestOptions = {
|
|
|
4
4
|
};
|
|
5
5
|
export declare const createBaseApi: () => {
|
|
6
6
|
post: <R, B extends object>(path: string, body: B, options?: RequestOptions) => Promise<R>;
|
|
7
|
-
get: <R>(path: string, options?: RequestOptions) => Promise<
|
|
7
|
+
get: <R>(path: string, options?: RequestOptions) => Promise<{
|
|
8
|
+
data: R;
|
|
9
|
+
}>;
|
|
8
10
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormConfig } from '@web-site-utilities/common/types/FormConfig';
|
|
2
|
+
import { RequestOptions } from './baseApi';
|
|
3
|
+
export declare const getFormConf: (payload: {
|
|
4
|
+
formId: string;
|
|
5
|
+
locale: string;
|
|
6
|
+
}, options?: RequestOptions) => Promise<{
|
|
7
|
+
data: FormConfig;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type UseRequestProps<T> = () => Promise<{
|
|
2
|
+
data: T;
|
|
3
|
+
}>;
|
|
4
|
+
export declare const useRequest: <T>(props: {
|
|
5
|
+
request: UseRequestProps<T>;
|
|
6
|
+
preventInitial?: boolean;
|
|
7
|
+
}) => {
|
|
8
|
+
data: T;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
error: Error;
|
|
11
|
+
exec: () => AbortController;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { InlineForm } from "@web-site-utilities/common/types/FormConfig";
|
|
3
3
|
import { Nullable } from "@web-site-utilities/common/types/Nullable";
|
|
4
|
+
import { InitiateFeedbackModuleOptions } from "@web-site-utilities/common/types/InitiateFeedbackModuleOptions";
|
|
4
5
|
export type InPlaceFormProps = {
|
|
5
6
|
formId: string;
|
|
6
7
|
domainId: string;
|
|
7
|
-
|
|
8
|
+
options: InitiateFeedbackModuleOptions;
|
|
9
|
+
versionId: string;
|
|
10
|
+
formTheme: any;
|
|
8
11
|
inlineForm: InlineForm;
|
|
9
12
|
};
|
|
10
13
|
export declare const InPlaceForm: (props: InPlaceFormProps) => React.DOMElement<{
|
|
11
|
-
children: (
|
|
12
|
-
variant?: "
|
|
14
|
+
children: (React.FunctionComponentElement<{
|
|
15
|
+
variant?: "section" | "title" | "subtitle" | "subsection" | "paragraph";
|
|
13
16
|
linear?: boolean;
|
|
14
17
|
children?: React.ReactNode;
|
|
15
18
|
}> | React.FunctionComponentElement<{
|
|
@@ -18,11 +21,14 @@ export declare const InPlaceForm: (props: InPlaceFormProps) => React.DOMElement<
|
|
|
18
21
|
onSetMaxHeight: (height: number) => void;
|
|
19
22
|
children: React.ReactNode;
|
|
20
23
|
}>[] | React.DOMElement<{
|
|
24
|
+
key: string;
|
|
25
|
+
$isFirstStep: boolean;
|
|
21
26
|
children: (React.FunctionComponentElement<{
|
|
22
27
|
steps: Array<import("@web-site-utilities/common/types/FormConfig").Step>;
|
|
23
28
|
currentStepIndex: number;
|
|
24
29
|
colorVariant?: import("@web-site-utilities/common/theme/ThemeProvider").Variants;
|
|
25
30
|
}> | React.DOMElement<{
|
|
31
|
+
key: string;
|
|
26
32
|
children: string;
|
|
27
33
|
onClick: () => void;
|
|
28
34
|
}, Element>)[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { PopupForm as PopupFormType } from '@web-site-utilities/common/types/FormConfig';
|
|
3
|
+
import { InitiateFeedbackModuleOptionsCmp } from "@web-site-utilities/common/types/InitiateFeedbackModuleOptions";
|
|
4
|
+
export type PopupFormProps = {
|
|
5
|
+
formId: string;
|
|
6
|
+
domainId: string;
|
|
7
|
+
formTheme: any;
|
|
8
|
+
options: InitiateFeedbackModuleOptionsCmp;
|
|
9
|
+
popupForm: PopupFormType;
|
|
10
|
+
};
|
|
11
|
+
export declare const PopupForm: (props: PopupFormProps) => React.FunctionComponentElement<React.FragmentProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { InitiateFeedbackModuleOptions, InitiateFeedbackModuleOptionsCmp } from '
|
|
2
|
+
import { InitiateFeedbackModuleOptions, InitiateFeedbackModuleOptionsCmp } from '../common/types/InitiateFeedbackModuleOptions';
|
|
3
3
|
import { InPlaceFormProps } from "./features/InPlaceForm/InPlaceForm";
|
|
4
4
|
import { PopupFormProps } from "./features/PopupForm/PopupForm";
|
|
5
5
|
import { theme, Variants } from "@web-site-utilities/common/theme/ThemeProvider";
|
|
@@ -12,11 +12,10 @@ import { TextareaProps } from "@web-site-utilities/common/components/Textarea";
|
|
|
12
12
|
import { RangeSlideProps } from "@web-site-utilities/common/components/RangeSlide";
|
|
13
13
|
export declare const initiateFeedbackModule: (options: InitiateFeedbackModuleOptions) => void;
|
|
14
14
|
export declare const renderFeedbackModule: (options: InitiateFeedbackModuleOptionsCmp) => React.FunctionComponentElement<{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}> | null;
|
|
15
|
+
options: InitiateFeedbackModuleOptions;
|
|
16
|
+
}>;
|
|
18
17
|
export declare const FeedbackModule: (options: InitiateFeedbackModuleOptionsCmp) => React.FunctionComponentElement<{
|
|
19
|
-
|
|
18
|
+
options: InitiateFeedbackModuleOptionsCmp;
|
|
20
19
|
}> | null;
|
|
21
20
|
export declare const PreviewInPlaceForm: (props: InPlaceFormProps & {
|
|
22
21
|
variant: Variants;
|
package/package.json
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@web-site-utilities/feedback",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"workspaces": [
|
|
5
|
-
"src/**",
|
|
6
|
-
"examples/**"
|
|
7
|
-
],
|
|
3
|
+
"version": "0.0.19-dev.60aa6a2",
|
|
8
4
|
"description": "Site utils feedback snippet deployed to npm and external script",
|
|
9
5
|
"exports": {
|
|
10
6
|
".": {
|
|
@@ -23,7 +19,8 @@
|
|
|
23
19
|
],
|
|
24
20
|
"scripts": {
|
|
25
21
|
"typecheck": "tsc",
|
|
26
|
-
"
|
|
22
|
+
"gen-conf": "if [ -n \"$SITE_UTILS_ENV\" ]; then sed \"s/__SITE_UTILS_ENV__/$SITE_UTILS_ENV/\" src/common/conf.template.ts > src/common/conf.ts; fi",
|
|
23
|
+
"build-lib": "npm run gen-conf && vite build -c vite.build.ts",
|
|
27
24
|
"build-types": "tsc --declarationDir dist --noEmit false --emitDeclarationOnly",
|
|
28
25
|
"build": "npm run build-lib && npm run build-types",
|
|
29
26
|
"dev": "vite -c vite.build.ts",
|
|
@@ -65,7 +62,9 @@
|
|
|
65
62
|
"styled-components": "6.1.19"
|
|
66
63
|
},
|
|
67
64
|
"dependencies": {
|
|
68
|
-
"dompurify": "^3.
|
|
65
|
+
"dompurify": "^3.3.1",
|
|
66
|
+
"slick-carousel": "^1.8.1",
|
|
67
|
+
"uuid": "^13.0.0",
|
|
69
68
|
"vite-plugin-dts": "^4.5.4"
|
|
70
69
|
}
|
|
71
70
|
}
|
package/tsconfig.json
CHANGED
|
@@ -3,17 +3,18 @@
|
|
|
3
3
|
"lib": ["DOM", "ES2024"],
|
|
4
4
|
"types": ["react", "node"],
|
|
5
5
|
"jsx": "react-jsx",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"moduleResolution": "node",
|
|
6
|
+
"jsxImportSource": "@emotion/react",
|
|
7
|
+
"strict": false,
|
|
8
|
+
"strictNullChecks": false,
|
|
10
9
|
"noEmit": true,
|
|
10
|
+
"composite": true,
|
|
11
11
|
"allowUnusedLabels": false,
|
|
12
12
|
"allowUnreachableCode": false,
|
|
13
|
-
"exactOptionalPropertyTypes":
|
|
13
|
+
"exactOptionalPropertyTypes": false,
|
|
14
14
|
"noFallthroughCasesInSwitch": true,
|
|
15
15
|
"noImplicitOverride": true,
|
|
16
16
|
"noImplicitReturns": true,
|
|
17
|
+
"resolveJsonModule": true,
|
|
17
18
|
"noPropertyAccessFromIndexSignature": true,
|
|
18
19
|
"noUncheckedIndexedAccess": true,
|
|
19
20
|
"noUnusedLocals": true,
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
"esModuleInterop": true,
|
|
23
24
|
"skipLibCheck": true
|
|
24
25
|
},
|
|
25
|
-
"include": ["src"
|
|
26
|
+
"include": ["src"],
|
|
26
27
|
"exclude": [
|
|
27
28
|
"vite.build.ts"
|
|
28
29
|
]
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type ModalProps = {
|
|
3
|
-
isOpen: boolean;
|
|
4
|
-
onClose: () => void;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
heading: React.ReactNode;
|
|
7
|
-
footer: React.ReactNode;
|
|
8
|
-
};
|
|
9
|
-
export declare const Modal: (props: ModalProps) => React.DOMElement<{
|
|
10
|
-
$visible: boolean;
|
|
11
|
-
onClick: React.MouseEventHandler<HTMLDialogElement>;
|
|
12
|
-
ref: React.RefObject<HTMLDialogElement | null>;
|
|
13
|
-
id: string;
|
|
14
|
-
children: React.DOMElement<{
|
|
15
|
-
$visible: boolean;
|
|
16
|
-
children: (string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.FunctionComponentElement<{
|
|
17
|
-
variant?: "title" | "section" | "subtitle" | "subsection" | "paragraph";
|
|
18
|
-
linear?: boolean;
|
|
19
|
-
children?: React.ReactNode;
|
|
20
|
-
}> | null | undefined)[];
|
|
21
|
-
}, Element>;
|
|
22
|
-
}, HTMLDialogElement>;
|
|
23
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FormConfig } from '@web-site-utilities/common/types/FormConfig';
|
|
2
|
-
import { Locale } from '@web-site-utilities/common/types/Locale';
|
|
3
|
-
import { RequestOptions } from './baseApi';
|
|
4
|
-
export declare const getFormConf: (formId: string, options?: RequestOptions) => Promise<FormConfig>;
|
|
5
|
-
export declare const getFormConfigMock: (_payload: {
|
|
6
|
-
formId: string;
|
|
7
|
-
locale: Locale;
|
|
8
|
-
}, _options?: RequestOptions) => Promise<FormConfig>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { FormConfigTheme, PopupForm as PopupFormType } from '@web-site-utilities/common/types/FormConfig';
|
|
3
|
-
export type PopupFormProps = {
|
|
4
|
-
formId: string;
|
|
5
|
-
domainId: string;
|
|
6
|
-
formTheme: FormConfigTheme;
|
|
7
|
-
popupForm: PopupFormType;
|
|
8
|
-
};
|
|
9
|
-
export declare const PopupForm: (props: PopupFormProps) => React.FunctionComponentElement<React.FragmentProps>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|