freemium-survey-components 2.0.89 → 2.0.91

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
- import { FILE_UPLOAD_OPTIONS, PointScaleRatingType, QuestionType } from './types';
1
+ import { FILE_UPLOAD_OPTIONS, PointScaleRatingType, QuestionType, FreshSurveyDebugType } from './types';
2
2
  export declare const AUTO_COMMIT_FIELD_TYPES: string[];
3
3
  export declare const SKIP_DISABLED_QUESTIONS: string[];
4
4
  export declare const RADIO_CHECKBOX_OTHERS_OPTION_KEY = "Others";
@@ -37,4 +37,4 @@ export declare const CONSENT_QUESTION_OPTIONS: {
37
37
  recordAs: boolean;
38
38
  }[];
39
39
  export declare const SUPPORTED_FILE_FORMATS: Record<FILE_UPLOAD_OPTIONS, string>;
40
- export declare const FSC_DEBUG = "fsc:debug";
40
+ export declare const FRESH_SURVEY_DEBUG: keyof FreshSurveyDebugType;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { SurveyProps } from '../../types';
2
+ import { PreviewChannelType, SurveyProps } from '../../types';
3
3
  declare const ChannelPreview: (props: SurveyProps & {
4
- channel: 'whatsapp' | 'instagram';
4
+ channel: PreviewChannelType;
5
5
  }) => React.JSX.Element | null;
6
6
  export { ChannelPreview };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { AugmentedSurveyProps } from '../../types';
3
+ type PreviewChannelProps = AugmentedSurveyProps & {
4
+ type?: 'instagram' | 'whatsapp';
5
+ };
6
+ declare const PreviewChannel: (props: PreviewChannelProps) => React.JSX.Element | null;
7
+ export { PreviewChannel };
@@ -7,6 +7,7 @@ export declare const useStandardSurvey: (props: AugmentedSurveyProps) => {
7
7
  clearRadioSelection: (blockIndex: number) => void;
8
8
  onSubmitHandler: (status?: AnswerStatus) => void;
9
9
  navigateToStart: () => void;
10
+ isValidQuestion: (blockToValidate: BlockWithQuestionType, commitDirtyValue?: boolean) => boolean;
10
11
  resetSurvey: () => void;
11
12
  moveToNextPage: (nullifyValues?: boolean) => void;
12
13
  moveToNextSet: (nullifyValues?: boolean) => void;
@@ -15,6 +16,7 @@ export declare const useStandardSurvey: (props: AugmentedSurveyProps) => {
15
16
  expanded: boolean;
16
17
  setExpanded: React.Dispatch<React.SetStateAction<boolean>>;
17
18
  activeIndexOfSet: number;
19
+ setActiveRenderedBlockIndex: React.Dispatch<React.SetStateAction<number>>;
18
20
  formQuestionErrors: Record<string, Record<string, string>>;
19
21
  dateQuestionErrors: Record<string, string[]>;
20
22
  textboxQuestionErrors: Record<string, string>;
@@ -2,8 +2,6 @@ import { ReactNode } from 'react';
2
2
  import { MatrixValueType } from './components/matrix';
3
3
  import { CustomRange } from './utils';
4
4
  import { CanDisplayDisableButtonProps } from './survey/utils';
5
- import { SelectProps, SelectTriggerProps } from '@radix-ui/react-select';
6
- import { RadioGroupItemProps, RadioGroupProps } from '@radix-ui/react-radio-group';
7
5
  export type SurveyTypes = 'NPS' | 'CES' | 'CSAT' | 'NONE';
8
6
  export type SurveyStateTypes = 'DRAFT' | 'ACTIVE' | 'PAUSE';
9
7
  export type PromptChoiceType = {
@@ -655,7 +653,6 @@ export type QuestionFooterProps = {
655
653
  activeIndexOfBlocks: number;
656
654
  saveFormValues: (block: BlockWithQuestionType, value: QuestionAnswerType, commitDirtyValue?: boolean, blockIndex?: number, skipPage?: boolean) => void;
657
655
  isInitialTransition?: boolean;
658
- onSubmitHandler: (status: AnswerStatus) => void;
659
656
  initialPivotAnswer?: number;
660
657
  translationVariables?: TranslationVariablesType;
661
658
  questions: SurveyQuestionType[];
@@ -674,6 +671,7 @@ export type CardQuestionFooterProps = QuestionFooterProps & {
674
671
  navigateToNextBlock: () => void;
675
672
  skipStatement: () => void;
676
673
  skipBlock: () => void;
674
+ onSubmitHandler: (status: AnswerStatus) => void;
677
675
  setFooterElementRef?: Function;
678
676
  isReverseAnimation?: boolean;
679
677
  buttonRef?: React.Ref<HTMLButtonElement>;
@@ -795,13 +793,6 @@ export type ValidatingQuestions = {
795
793
  fileUploadErrors: Record<string, string>;
796
794
  contactFormErrors: Record<string, Record<string, string>>;
797
795
  };
798
- export type FscDebugType = {
799
- selectRoot?: SelectProps;
800
- selectTrigger?: SelectTriggerProps;
801
- radioGroupRoot?: RadioGroupProps;
802
- radioGroupItemRoot?: RadioGroupItemProps;
803
- log?: boolean;
804
- };
805
796
  export type RoleType = 'OWNER' | 'ADMIN' | 'ANALYST' | 'VIEWER';
806
797
  export type SurveyServAuthAccountType = {
807
798
  id?: string | null;
@@ -985,6 +976,7 @@ export interface SurveyServResponseType {
985
976
  ces_rating?: number | null;
986
977
  nps_rating?: number | null;
987
978
  }
979
+ export type PreviewChannelType = 'whatsapp' | 'email' | 'instagram';
988
980
  export type ExportedComponentType = {
989
981
  goToRoute: GoToRouteType;
990
982
  hostParams: HostParamsType;
@@ -997,11 +989,22 @@ export type ExportedComponentType = {
997
989
  placeholders: EmailPlaceholdersType;
998
990
  response: SurveyServResponseType;
999
991
  accountInfo: SurveyServAuthAccountType;
1000
- channel: CollectorChannelType;
992
+ channel: PreviewChannelType;
1001
993
  survey: SurveyType;
1002
994
  collectorId: string;
1003
995
  surveyId: string;
1004
996
  id: string;
1005
997
  locale: string;
1006
998
  };
999
+ export type CommonDebugType = {
1000
+ log?: boolean;
1001
+ };
1002
+ export type FreshSurveyDebugType = {
1003
+ ['fsc:debug']: CommonDebugType;
1004
+ ['fwa:debug']: CommonDebugType;
1005
+ ['mfe:debug']: CommonDebugType;
1006
+ ['spw:debug']: CommonDebugType;
1007
+ ['spp:debug']: CommonDebugType;
1008
+ ['fui:debug']: CommonDebugType;
1009
+ };
1007
1010
  export {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { BlockWithQuestionType, FscDebugType, PropertiesLabelsPreferenceType, SurveyBlockType, SurveyQuestionType, SurveyResponseType, SurveyType, SurveyUiThemeType } from './types';
2
+ import { BlockWithQuestionType, PropertiesLabelsPreferenceType, SurveyBlockType, SurveyQuestionType, SurveyResponseType, FreshSurveyDebugType, SurveyType, SurveyUiThemeType } from './types';
3
3
  export declare const withDefaults: <P, DP>(component: React.ComponentType<P>, defaultProps: DP) => React.ComponentType<Partial<DP> & Omit<P, keyof DP>>;
4
4
  export declare const isNil: (value: unknown) => boolean;
5
5
  export declare const isEmpty: (value: unknown) => boolean;
@@ -33,7 +33,7 @@ export declare const blockInvalidInteger: (e: React.KeyboardEvent) => false | vo
33
33
  export declare const blockInvalidPhone: (e: React.KeyboardEvent) => false | void;
34
34
  export declare const getFirstBlock: (blocks?: SurveyBlockType[]) => SurveyBlockType;
35
35
  export declare const convertQuillHTMLToText: (quillHtml: string, preserveNewLine?: boolean) => string;
36
- export declare const getFscDebug: () => FscDebugType;
36
+ export declare const getFreshSurveyDebug: () => FreshSurveyDebugType['fsc:debug'];
37
37
  export declare const appLogger: (title: string, props?: any) => void;
38
38
  export declare const isBgDark: (bgColor: string) => boolean;
39
39
  export declare const setOrderForRenderedBlocks: (rBlocks: BlockWithQuestionType[], orderMap: React.MutableRefObject<Record<string, number>>) => BlockWithQuestionType[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-survey-components",
3
- "version": "2.0.89",
3
+ "version": "2.0.91",
4
4
  "description": "React Survey Ui Components",
5
5
  "main": "lib/index.cjs.js",
6
6
  "module": "lib/index.esm.js",