posthog-react-native 4.78.2 → 4.78.3
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.
|
@@ -13,12 +13,13 @@ export declare function LinkQuestion({ question, appearance, onSubmit, }: Questi
|
|
|
13
13
|
export declare function RatingQuestion({ question, appearance, onSubmit, }: QuestionCommonProps & {
|
|
14
14
|
onSubmit: (rating: number | null) => void;
|
|
15
15
|
}): JSX.Element;
|
|
16
|
-
export declare function RatingButton({ index, num, active, appearance, setActiveNumber, }: {
|
|
16
|
+
export declare function RatingButton({ index, num, active, appearance, setActiveNumber, accessibilityLabel, }: {
|
|
17
17
|
index: number;
|
|
18
18
|
num: number;
|
|
19
19
|
active: boolean;
|
|
20
20
|
appearance: SurveyAppearanceTheme;
|
|
21
21
|
setActiveNumber: (num: number) => void;
|
|
22
|
+
accessibilityLabel?: string;
|
|
22
23
|
}): JSX.Element;
|
|
23
24
|
export declare function MultipleChoiceQuestion({ question, appearance, onSubmit, }: QuestionCommonProps & {
|
|
24
25
|
onSubmit: (choices: string | string[] | null) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _typeof=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:true});exports.LinkQuestion=LinkQuestion;exports.MultipleChoiceQuestion=MultipleChoiceQuestion;exports.OpenTextQuestion=OpenTextQuestion;exports.RatingButton=RatingButton;exports.RatingQuestion=RatingQuestion;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _safeStyleSheet=require("../safeStyleSheet");var _icons=require("../icons");var _surveysUtils=require("../surveys-utils");var _surveyShuffling=require("../survey-shuffling");var _core=require("@posthog/core");var _surveys=require("@posthog/core/surveys");var _BottomSection=require("./BottomSection");var _QuestionHeader=require("./QuestionHeader");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/QuestionTypes.js";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,"default":e};if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t2 in e)"default"!==_t2&&{}.hasOwnProperty.call(e,_t2)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t2))&&(i.get||i.set)?o(f,_t2,i):f[_t2]=e[_t2]);return f;})(e,t);}function QuestionLayout(_ref){var children=_ref.children,footer=_ref.footer;var _useState=(0,_react.useState)(0),_useState2=(0,_slicedToArray2["default"])(_useState,2),viewportHeight=_useState2[0],setViewportHeight=_useState2[1];var _useState3=(0,_react.useState)(0),_useState4=(0,_slicedToArray2["default"])(_useState3,2),contentHeight=_useState4[0],setContentHeight=_useState4[1];var isOverflowing=contentHeight>viewportHeight+1;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:questionLayoutStyles.container,children:[(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:questionLayoutStyles.scroll,keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:false,scrollEnabled:isOverflowing,bounces:isOverflowing,onLayout:function onLayout(e){return setViewportHeight(e.nativeEvent.layout.height);},onContentSizeChange:function onContentSizeChange(_width,height){return setContentHeight(height);},children:children}),footer]});}var questionLayoutStyles=(0,_safeStyleSheet.createSafeStyleSheet)({container:{flexShrink:1},scroll:{flexShrink:1}});function OpenTextQuestion(_ref2){var question=_ref2.question,appearance=_ref2.appearance,onSubmit=_ref2.onSubmit;var _a,_b,_c,_d;var _useState5=(0,_react.useState)(''),_useState6=(0,_slicedToArray2["default"])(_useState5,2),text=_useState6[0],setText=_useState6[1];var validationError=(0,_react.useMemo)(function(){return(0,_surveys.getValidationError)(text,question.validation,question.optional);},[text,question.validation,question.optional]);var minLength=(0,_surveys.getLengthFromRules)(question.validation,_core.SurveyValidationType.MinLength);var maxLength=(0,_surveys.getLengthFromRules)(question.validation,_core.SurveyValidationType.MaxLength);var requirementsHint=(0,_react.useMemo)(function(){return(0,_surveys.getRequirementsHint)(minLength,maxLength);},[minLength,maxLength]);var handleSubmit=function handleSubmit(){if(validationError){return;}onSubmit(text.trim());};return(0,_jsxRuntime.jsxs)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_a=question.buttonText)!==null&&_a!==void 0?_a:appearance.submitButtonText,submitDisabled:!!validationError,appearance:appearance,onSubmit:handleSubmit}),children:[(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.textInputContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.TextInput,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'input'),style:[styles.textInput,{backgroundColor:appearance.inputBackground,color:(_b=appearance.inputTextColor)!==null&&_b!==void 0?_b:(0,_surveysUtils.getContrastingTextColor)(appearance.inputBackground),borderColor:appearance.borderColor}],multiline:true,numberOfLines:4,placeholder:appearance.placeholder,placeholderTextColor:(0,_surveysUtils.getContrastingTextColor)((_c=appearance.inputTextColor)!==null&&_c!==void 0?_c:(0,_surveysUtils.getContrastingTextColor)(appearance.inputBackground))==='white'?'rgba(0, 0, 0, 0.5)':'rgba(255, 255, 255, 0.5)',onChangeText:setText,value:text}),requirementsHint&&(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'validationHint'),style:[styles.validationHint,{color:(_d=appearance.textColor)!==null&&_d!==void 0?_d:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor)}],children:requirementsHint})]})]});}function LinkQuestion(_ref3){var question=_ref3.question,appearance=_ref3.appearance,_onSubmit=_ref3.onSubmit;var _a,_b;question=question;return(0,_jsxRuntime.jsx)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_b=(_a=question.buttonText)!==null&&_a!==void 0?_a:appearance.submitButtonText)!==null&&_b!==void 0?_b:'Submit',submitDisabled:false,link:question.link,appearance:appearance,onSubmit:function onSubmit(){return _onSubmit('link clicked');}}),children:(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance})});}function RatingQuestion(_ref4){var _this=this;var question=_ref4.question,appearance=_ref4.appearance,_onSubmit2=_ref4.onSubmit;var _a;var _b,_c,_d;var _useState7=(0,_react.useState)(null),_useState8=(0,_slicedToArray2["default"])(_useState7,2),rating=_useState8[0],setRating=_useState8[1];question=question;return(0,_jsxRuntime.jsxs)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_b=question.buttonText)!==null&&_b!==void 0?_b:appearance.submitButtonText,submitDisabled:rating===null&&!question.optional,appearance:appearance,onSubmit:function onSubmit(){return _onSubmit2(rating);},skipSubmitButton:question.skipSubmitButton}),children:[(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.ratingSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.ratingOptions,children:[question.display===_core.SurveyRatingDisplay.Emoji&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.ratingOptionsEmoji,children:(_a=emojiScaleLists[question.scale])===null||_a===void 0?void 0:_a.map(function(Emoji,idx){var active=idx+1===rating;return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.ratingsEmoji,onPress:function onPress(){var response=idx+1;setRating(response);if(question.skipSubmitButton){_onSubmit2(response);}},children:(0,_jsxRuntime.jsx)(Emoji,{fill:active?appearance.ratingButtonActiveColor:appearance.ratingButtonColor})},idx);})}),question.display===_core.SurveyRatingDisplay.Number&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.ratingOptionsNumber,{borderColor:appearance.borderColor}],children:getScaleNumbers(question.scale).map(function(number,idx){var active=rating===number;return(0,_jsxRuntime.jsx)(RatingButton,{index:idx,active:active,appearance:appearance,num:number,setActiveNumber:function setActiveNumber(response){setRating(response);if(question.skipSubmitButton){_onSubmit2(response);}}},idx);})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.ratingText,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'ratingLabel'),style:{color:(_c=appearance.textColor)!==null&&_c!==void 0?_c:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor),opacity:_surveysUtils.defaultRatingLabelOpacity},children:question.lowerBoundLabel}),(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'ratingLabel'),style:{color:(_d=appearance.textColor)!==null&&_d!==void 0?_d:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor),opacity:_surveysUtils.defaultRatingLabelOpacity},children:question.upperBoundLabel})]})]})]});}function RatingButton(_ref5){var index=_ref5.index,num=_ref5.num,active=_ref5.active,appearance=_ref5.appearance,setActiveNumber=_ref5.setActiveNumber;var _a;var backgroundColor=active?appearance.ratingButtonActiveColor:appearance.ratingButtonColor;var textColor=active?(0,_surveysUtils.getContrastingTextColor)(backgroundColor):(_a=appearance.inputTextColor)!==null&&_a!==void 0?_a:(0,_surveysUtils.getContrastingTextColor)(backgroundColor);return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.ratingsNumber,index===0&&{borderLeftWidth:0},{backgroundColor:backgroundColor,borderColor:appearance.borderColor}],onPress:function onPress(){return setActiveNumber(num);},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'ratingNumber'),style:{color:textColor},children:num})});}function MultipleChoiceQuestion(_ref6){var _this2=this;var question=_ref6.question,appearance=_ref6.appearance,_onSubmit3=_ref6.onSubmit;var _a;question=question;var isSingleChoice=question.type===_core.SurveyQuestionType.SingleChoice;var allowMultiple=question.type===_core.SurveyQuestionType.MultipleChoice;var openChoiceIndex=question.hasOpenChoice?question.choices.length-1:-1;var choices=(0,_react.useMemo)(function(){return(0,_surveyShuffling.getDisplayOrderChoices)(question);},[question]);var _useState9=(0,_react.useState)([]),_useState0=(0,_slicedToArray2["default"])(_useState9,2),selectedChoiceIndices=_useState0[0],setSelectedChoiceIndices=_useState0[1];var _useState1=(0,_react.useState)(''),_useState10=(0,_slicedToArray2["default"])(_useState1,2),openEndedInput=_useState10[0],setOpenEndedInput=_useState10[1];var shouldSkipSubmit=question.skipSubmitButton&&isSingleChoice&&!question.hasOpenChoice;return(0,_jsxRuntime.jsxs)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_a=question.buttonText)!==null&&_a!==void 0?_a:appearance.submitButtonText,submitDisabled:!question.optional&&(selectedChoiceIndices.length===0||selectedChoiceIndices.includes(openChoiceIndex)&&openEndedInput.length===0),appearance:appearance,onSubmit:function onSubmit(){var result=selectedChoiceIndices.map(function(index){return index===openChoiceIndex?openEndedInput:choices[index];});_onSubmit3(allowMultiple?result:result[0]);},skipSubmitButton:shouldSkipSubmit}),children:[(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.multipleChoiceOptions,children:choices.map(function(choice,choiceIndex){var _a;var isOpenChoice=choiceIndex===openChoiceIndex;var isSelected=selectedChoiceIndices.includes(choiceIndex);var choiceTextColor=(_a=appearance.inputTextColor)!==null&&_a!==void 0?_a:(0,_surveysUtils.getContrastingTextColor)(appearance.inputBackground);return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{style:[styles.choiceOption,{backgroundColor:appearance.inputBackground},isSelected?{borderColor:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor)}:{}],onPress:function onPress(){if(allowMultiple){setSelectedChoiceIndices(isSelected?selectedChoiceIndices.filter(function(index){return index!==choiceIndex;}):[].concat((0,_toConsumableArray2["default"])(selectedChoiceIndices),[choiceIndex]));}else{setSelectedChoiceIndices([choiceIndex]);if(shouldSkipSubmit&&!isOpenChoice){_onSubmit3(choice);}}},children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.choiceText,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'choice'),style:{flexGrow:1,color:choiceTextColor},children:[choice,isOpenChoice?':':'']}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rightCheckArea,children:isSelected&&(0,_jsxRuntime.jsx)(_icons.CheckSVG,{})})]}),isOpenChoice&&(0,_jsxRuntime.jsx)(_reactNative.TextInput,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'input'),style:styles.openEndedInput,onChangeText:function onChangeText(userValue){setOpenEndedInput(userValue);if(!isSelected){setSelectedChoiceIndices(allowMultiple?[].concat((0,_toConsumableArray2["default"])(selectedChoiceIndices),[choiceIndex]):[choiceIndex]);}}})]},choiceIndex);})})]});}var emojiScaleLists={2:[_icons.ThumbsUpEmoji,_icons.ThumbsDownEmoji],3:[_icons.DissatisfiedEmoji,_icons.NeutralEmoji,_icons.SatisfiedEmoji],5:[_icons.VeryDissatisfiedEmoji,_icons.DissatisfiedEmoji,_icons.NeutralEmoji,_icons.SatisfiedEmoji,_icons.VerySatisfiedEmoji]};var fiveScaleNumbers=[1,2,3,4,5];var sevenScaleNumbers=[1,2,3,4,5,6,7];var tenScaleNumbers=[0,1,2,3,4,5,6,7,8,9,10];function getScaleNumbers(scale){switch(scale){case 5:return fiveScaleNumbers;case 7:return sevenScaleNumbers;case 10:return tenScaleNumbers;default:return fiveScaleNumbers;}}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({textInputContainer:{padding:10},textInput:{borderColor:'#ccc',borderWidth:1,padding:10,marginVertical:10,fontSize:16,height:80,textAlignVertical:'top'},ratingSection:{marginVertical:10},ratingOptions:{flexDirection:'row',justifyContent:'space-between'},ratingOptionsEmoji:{flexDirection:'row',justifyContent:'space-around',flexWrap:'nowrap',flex:1},ratingsEmoji:{padding:4},ratingOptionsNumber:{margin:10,flexGrow:1,flexDirection:'row',justifyContent:'space-between',borderRadius:5,borderWidth:1,overflow:'hidden'},ratingsNumber:{flex:1,paddingVertical:10,alignItems:'center',borderLeftWidth:1},ratingText:{flexDirection:'row',justifyContent:'space-between',padding:10},multipleChoiceOptions:{padding:10},choiceOption:{flexDirection:'column',marginVertical:5,borderWidth:1,borderColor:'grey',borderRadius:5,padding:10},choiceText:{flexDirection:'row'},rightCheckArea:{flexGrow:0},openEndedInput:{padding:5},validationHint:{fontSize:12,opacity:0.7,marginTop:4}});
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _typeof=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:true});exports.LinkQuestion=LinkQuestion;exports.MultipleChoiceQuestion=MultipleChoiceQuestion;exports.OpenTextQuestion=OpenTextQuestion;exports.RatingButton=RatingButton;exports.RatingQuestion=RatingQuestion;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _safeStyleSheet=require("../safeStyleSheet");var _icons=require("../icons");var _surveysUtils=require("../surveys-utils");var _surveyShuffling=require("../survey-shuffling");var _core=require("@posthog/core");var _surveys=require("@posthog/core/surveys");var _BottomSection=require("./BottomSection");var _QuestionHeader=require("./QuestionHeader");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/QuestionTypes.js";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,"default":e};if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t2 in e)"default"!==_t2&&{}.hasOwnProperty.call(e,_t2)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t2))&&(i.get||i.set)?o(f,_t2,i):f[_t2]=e[_t2]);return f;})(e,t);}function QuestionLayout(_ref){var children=_ref.children,footer=_ref.footer;var _useState=(0,_react.useState)(0),_useState2=(0,_slicedToArray2["default"])(_useState,2),viewportHeight=_useState2[0],setViewportHeight=_useState2[1];var _useState3=(0,_react.useState)(0),_useState4=(0,_slicedToArray2["default"])(_useState3,2),contentHeight=_useState4[0],setContentHeight=_useState4[1];var isOverflowing=contentHeight>viewportHeight+1;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:questionLayoutStyles.container,children:[(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:questionLayoutStyles.scroll,keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:false,scrollEnabled:isOverflowing,bounces:isOverflowing,onLayout:function onLayout(e){return setViewportHeight(e.nativeEvent.layout.height);},onContentSizeChange:function onContentSizeChange(_width,height){return setContentHeight(height);},children:children}),footer]});}var questionLayoutStyles=(0,_safeStyleSheet.createSafeStyleSheet)({container:{flexShrink:1},scroll:{flexShrink:1}});function OpenTextQuestion(_ref2){var question=_ref2.question,appearance=_ref2.appearance,onSubmit=_ref2.onSubmit;var _a,_b,_c,_d;var _useState5=(0,_react.useState)(''),_useState6=(0,_slicedToArray2["default"])(_useState5,2),text=_useState6[0],setText=_useState6[1];var validationError=(0,_react.useMemo)(function(){return(0,_surveys.getValidationError)(text,question.validation,question.optional);},[text,question.validation,question.optional]);var minLength=(0,_surveys.getLengthFromRules)(question.validation,_core.SurveyValidationType.MinLength);var maxLength=(0,_surveys.getLengthFromRules)(question.validation,_core.SurveyValidationType.MaxLength);var requirementsHint=(0,_react.useMemo)(function(){return(0,_surveys.getRequirementsHint)(minLength,maxLength);},[minLength,maxLength]);var handleSubmit=function handleSubmit(){if(validationError){return;}onSubmit(text.trim());};return(0,_jsxRuntime.jsxs)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_a=question.buttonText)!==null&&_a!==void 0?_a:appearance.submitButtonText,submitDisabled:!!validationError,appearance:appearance,onSubmit:handleSubmit}),children:[(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.textInputContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.TextInput,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'input'),style:[styles.textInput,{backgroundColor:appearance.inputBackground,color:(_b=appearance.inputTextColor)!==null&&_b!==void 0?_b:(0,_surveysUtils.getContrastingTextColor)(appearance.inputBackground),borderColor:appearance.borderColor}],multiline:true,numberOfLines:4,placeholder:appearance.placeholder,placeholderTextColor:(0,_surveysUtils.getContrastingTextColor)((_c=appearance.inputTextColor)!==null&&_c!==void 0?_c:(0,_surveysUtils.getContrastingTextColor)(appearance.inputBackground))==='white'?'rgba(0, 0, 0, 0.5)':'rgba(255, 255, 255, 0.5)',onChangeText:setText,value:text}),requirementsHint&&(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'validationHint'),style:[styles.validationHint,{color:(_d=appearance.textColor)!==null&&_d!==void 0?_d:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor)}],children:requirementsHint})]})]});}function LinkQuestion(_ref3){var question=_ref3.question,appearance=_ref3.appearance,_onSubmit=_ref3.onSubmit;var _a,_b;question=question;return(0,_jsxRuntime.jsx)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_b=(_a=question.buttonText)!==null&&_a!==void 0?_a:appearance.submitButtonText)!==null&&_b!==void 0?_b:'Submit',submitDisabled:false,link:question.link,appearance:appearance,onSubmit:function onSubmit(){return _onSubmit('link clicked');}}),children:(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance})});}function RatingQuestion(_ref4){var _this=this;var question=_ref4.question,appearance=_ref4.appearance,_onSubmit2=_ref4.onSubmit;var _a;var _b,_c,_d;var _useState7=(0,_react.useState)(null),_useState8=(0,_slicedToArray2["default"])(_useState7,2),rating=_useState8[0],setRating=_useState8[1];question=question;return(0,_jsxRuntime.jsxs)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_b=question.buttonText)!==null&&_b!==void 0?_b:appearance.submitButtonText,submitDisabled:rating===null&&!question.optional,appearance:appearance,onSubmit:function onSubmit(){return _onSubmit2(rating);},skipSubmitButton:question.skipSubmitButton}),children:[(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.ratingSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.ratingOptions,children:[question.display===_core.SurveyRatingDisplay.Emoji&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.ratingOptionsEmoji,children:(_a=emojiScaleLists[question.scale])===null||_a===void 0?void 0:_a.map(function(Emoji,idx){var active=idx+1===rating;return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.ratingsEmoji,onPress:function onPress(){var response=idx+1;setRating(response);if(question.skipSubmitButton){_onSubmit2(response);}},children:(0,_jsxRuntime.jsx)(Emoji,{fill:active?appearance.ratingButtonActiveColor:appearance.ratingButtonColor})},idx);})}),question.display===_core.SurveyRatingDisplay.Number&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.ratingOptionsNumber,{borderColor:appearance.borderColor}],children:getScaleNumbers(question.scale).map(function(number,idx,numbers){var active=rating===number;return(0,_jsxRuntime.jsx)(RatingButton,{index:idx,active:active,appearance:appearance,num:number,accessibilityLabel:[String(number),question.question,idx===0?question.lowerBoundLabel:idx===numbers.length-1?question.upperBoundLabel:''].filter(Boolean).join(', '),setActiveNumber:function setActiveNumber(response){setRating(response);if(question.skipSubmitButton){_onSubmit2(response);}}},idx);})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.ratingText,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'ratingLabel'),style:{color:(_c=appearance.textColor)!==null&&_c!==void 0?_c:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor),opacity:_surveysUtils.defaultRatingLabelOpacity},children:question.lowerBoundLabel}),(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'ratingLabel'),style:{color:(_d=appearance.textColor)!==null&&_d!==void 0?_d:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor),opacity:_surveysUtils.defaultRatingLabelOpacity},children:question.upperBoundLabel})]})]})]});}function RatingButton(_ref5){var index=_ref5.index,num=_ref5.num,active=_ref5.active,appearance=_ref5.appearance,setActiveNumber=_ref5.setActiveNumber,accessibilityLabel=_ref5.accessibilityLabel;var _a;var backgroundColor=active?appearance.ratingButtonActiveColor:appearance.ratingButtonColor;var textColor=active?(0,_surveysUtils.getContrastingTextColor)(backgroundColor):(_a=appearance.inputTextColor)!==null&&_a!==void 0?_a:(0,_surveysUtils.getContrastingTextColor)(backgroundColor);return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{accessibilityRole:"radio",accessibilityLabel:accessibilityLabel,accessibilityState:{checked:active},style:[styles.ratingsNumber,index===0&&{borderLeftWidth:0},{backgroundColor:backgroundColor,borderColor:appearance.borderColor}],onPress:function onPress(){return setActiveNumber(num);},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'ratingNumber'),style:{color:textColor},children:num})});}function MultipleChoiceQuestion(_ref6){var _this2=this;var question=_ref6.question,appearance=_ref6.appearance,_onSubmit3=_ref6.onSubmit;var _a;question=question;var isSingleChoice=question.type===_core.SurveyQuestionType.SingleChoice;var allowMultiple=question.type===_core.SurveyQuestionType.MultipleChoice;var openChoiceIndex=question.hasOpenChoice?question.choices.length-1:-1;var choices=(0,_react.useMemo)(function(){return(0,_surveyShuffling.getDisplayOrderChoices)(question);},[question]);var _useState9=(0,_react.useState)([]),_useState0=(0,_slicedToArray2["default"])(_useState9,2),selectedChoiceIndices=_useState0[0],setSelectedChoiceIndices=_useState0[1];var _useState1=(0,_react.useState)(''),_useState10=(0,_slicedToArray2["default"])(_useState1,2),openEndedInput=_useState10[0],setOpenEndedInput=_useState10[1];var shouldSkipSubmit=question.skipSubmitButton&&isSingleChoice&&!question.hasOpenChoice;return(0,_jsxRuntime.jsxs)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_a=question.buttonText)!==null&&_a!==void 0?_a:appearance.submitButtonText,submitDisabled:!question.optional&&(selectedChoiceIndices.length===0||selectedChoiceIndices.includes(openChoiceIndex)&&openEndedInput.length===0),appearance:appearance,onSubmit:function onSubmit(){var result=selectedChoiceIndices.map(function(index){return index===openChoiceIndex?openEndedInput:choices[index];});_onSubmit3(allowMultiple?result:result[0]);},skipSubmitButton:shouldSkipSubmit}),children:[(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.multipleChoiceOptions,children:choices.map(function(choice,choiceIndex){var _a;var isOpenChoice=choiceIndex===openChoiceIndex;var isSelected=selectedChoiceIndices.includes(choiceIndex);var choiceTextColor=(_a=appearance.inputTextColor)!==null&&_a!==void 0?_a:(0,_surveysUtils.getContrastingTextColor)(appearance.inputBackground);return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{style:[styles.choiceOption,{backgroundColor:appearance.inputBackground},isSelected?{borderColor:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor)}:{}],onPress:function onPress(){if(allowMultiple){setSelectedChoiceIndices(isSelected?selectedChoiceIndices.filter(function(index){return index!==choiceIndex;}):[].concat((0,_toConsumableArray2["default"])(selectedChoiceIndices),[choiceIndex]));}else{setSelectedChoiceIndices([choiceIndex]);if(shouldSkipSubmit&&!isOpenChoice){_onSubmit3(choice);}}},children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.choiceText,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'choice'),style:{flexGrow:1,color:choiceTextColor},children:[choice,isOpenChoice?':':'']}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rightCheckArea,children:isSelected&&(0,_jsxRuntime.jsx)(_icons.CheckSVG,{})})]}),isOpenChoice&&(0,_jsxRuntime.jsx)(_reactNative.TextInput,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'input'),style:styles.openEndedInput,onChangeText:function onChangeText(userValue){setOpenEndedInput(userValue);if(!isSelected){setSelectedChoiceIndices(allowMultiple?[].concat((0,_toConsumableArray2["default"])(selectedChoiceIndices),[choiceIndex]):[choiceIndex]);}}})]},choiceIndex);})})]});}var emojiScaleLists={2:[_icons.ThumbsUpEmoji,_icons.ThumbsDownEmoji],3:[_icons.DissatisfiedEmoji,_icons.NeutralEmoji,_icons.SatisfiedEmoji],5:[_icons.VeryDissatisfiedEmoji,_icons.DissatisfiedEmoji,_icons.NeutralEmoji,_icons.SatisfiedEmoji,_icons.VerySatisfiedEmoji]};var fiveScaleNumbers=[1,2,3,4,5];var sevenScaleNumbers=[1,2,3,4,5,6,7];var tenScaleNumbers=[0,1,2,3,4,5,6,7,8,9,10];function getScaleNumbers(scale){switch(scale){case 5:return fiveScaleNumbers;case 7:return sevenScaleNumbers;case 10:return tenScaleNumbers;default:return fiveScaleNumbers;}}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({textInputContainer:{padding:10},textInput:{borderColor:'#ccc',borderWidth:1,padding:10,marginVertical:10,fontSize:16,height:80,textAlignVertical:'top'},ratingSection:{marginVertical:10},ratingOptions:{flexDirection:'row',justifyContent:'space-between'},ratingOptionsEmoji:{flexDirection:'row',justifyContent:'space-around',flexWrap:'nowrap',flex:1},ratingsEmoji:{padding:4},ratingOptionsNumber:{margin:10,flexGrow:1,flexDirection:'row',justifyContent:'space-between',borderRadius:5,borderWidth:1,overflow:'hidden'},ratingsNumber:{flex:1,paddingVertical:10,alignItems:'center',borderLeftWidth:1},ratingText:{flexDirection:'row',justifyContent:'space-between',padding:10},multipleChoiceOptions:{padding:10},choiceOption:{flexDirection:'column',marginVertical:5,borderWidth:1,borderColor:'grey',borderRadius:5,padding:10},choiceText:{flexDirection:'row'},rightCheckArea:{flexGrow:0},openEndedInput:{padding:5},validationHint:{fontSize:12,opacity:0.7,marginTop:4}});
|
|
2
2
|
//# sourceMappingURL=QuestionTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionTypes.js","names":["_react","_interopRequireWildcard","require","_reactNative","_safeStyleSheet","_icons","_surveysUtils","_surveyShuffling","_core","_surveys","_BottomSection","_QuestionHeader","_jsxRuntime","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t2","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","QuestionLayout","_ref","children","footer","_useState","useState","_useState2","_slicedToArray2","viewportHeight","setViewportHeight","_useState3","_useState4","contentHeight","setContentHeight","isOverflowing","jsxs","View","style","questionLayoutStyles","container","jsx","ScrollView","scroll","keyboardShouldPersistTaps","showsVerticalScrollIndicator","scrollEnabled","bounces","onLayout","nativeEvent","layout","height","onContentSizeChange","_width","createSafeStyleSheet","flexShrink","OpenTextQuestion","_ref2","question","appearance","onSubmit","_useState5","_useState6","text","setText","validationError","useMemo","getValidationError","validation","optional","minLength","getLengthFromRules","SurveyValidationType","MinLength","maxLength","MaxLength","requirementsHint","getRequirementsHint","handleSubmit","trim","BottomSection","_a","buttonText","submitButtonText","submitDisabled","QuestionHeader","description","descriptionContentType","styles","textInputContainer","TextInput","maxFontSizeMultiplier","getMaxFontSizeMultiplier","textInput","backgroundColor","inputBackground","color","_b","inputTextColor","getContrastingTextColor","borderColor","multiline","numberOfLines","placeholder","placeholderTextColor","_c","onChangeText","value","Text","validationHint","_d","textColor","LinkQuestion","_ref3","link","RatingQuestion","_ref4","_this","_useState7","_useState8","rating","setRating","skipSubmitButton","ratingSection","ratingOptions","display","SurveyRatingDisplay","Emoji","ratingOptionsEmoji","emojiScaleLists","scale","map","idx","active","TouchableOpacity","ratingsEmoji","onPress","response","fill","ratingButtonActiveColor","ratingButtonColor","Number","ratingOptionsNumber","getScaleNumbers","number","RatingButton","index","num","setActiveNumber","ratingText","opacity","defaultRatingLabelOpacity","lowerBoundLabel","upperBoundLabel","_ref5","ratingsNumber","borderLeftWidth","MultipleChoiceQuestion","_ref6","_this2","isSingleChoice","type","SurveyQuestionType","SingleChoice","allowMultiple","MultipleChoice","openChoiceIndex","hasOpenChoice","choices","length","getDisplayOrderChoices","_useState9","_useState0","selectedChoiceIndices","setSelectedChoiceIndices","_useState1","_useState10","openEndedInput","setOpenEndedInput","shouldSkipSubmit","includes","result","multipleChoiceOptions","choice","choiceIndex","isOpenChoice","isSelected","choiceTextColor","Pressable","choiceOption","filter","concat","_toConsumableArray2","choiceText","flexGrow","rightCheckArea","CheckSVG","userValue","ThumbsUpEmoji","ThumbsDownEmoji","DissatisfiedEmoji","NeutralEmoji","SatisfiedEmoji","VeryDissatisfiedEmoji","VerySatisfiedEmoji","fiveScaleNumbers","sevenScaleNumbers","tenScaleNumbers","padding","borderWidth","marginVertical","fontSize","textAlignVertical","flexDirection","justifyContent","flexWrap","flex","margin","borderRadius","overflow","paddingVertical","alignItems","marginTop"],"sources":["../../../src/surveys/components/QuestionTypes.tsx"],"sourcesContent":["import React, { ReactNode, useMemo, useState } from 'react'\nimport { LayoutChangeEvent, Pressable, ScrollView, Text, TextInput, TouchableOpacity, View } from 'react-native'\n\nimport { createSafeStyleSheet } from '../safeStyleSheet'\nimport {\n CheckSVG,\n DissatisfiedEmoji,\n NeutralEmoji,\n SatisfiedEmoji,\n ThumbsDownEmoji,\n ThumbsUpEmoji,\n VeryDissatisfiedEmoji,\n VerySatisfiedEmoji,\n} from '../icons'\nimport {\n defaultRatingLabelOpacity,\n getContrastingTextColor,\n getMaxFontSizeMultiplier,\n SurveyAppearanceTheme,\n} from '../surveys-utils'\nimport { getDisplayOrderChoices } from '../survey-shuffling'\nimport {\n SurveyQuestion,\n SurveyRatingDisplay,\n SurveyQuestionType,\n LinkSurveyQuestion,\n RatingSurveyQuestion,\n MultipleSurveyQuestion,\n SurveyValidationType,\n} from '@posthog/core'\nimport { getValidationError, getLengthFromRules, getRequirementsHint } from '@posthog/core/surveys'\nimport { BottomSection } from './BottomSection'\nimport { QuestionHeader } from './QuestionHeader'\n\ninterface QuestionCommonProps {\n question: SurveyQuestion\n appearance: SurveyAppearanceTheme\n}\n\n// Wraps question content in a scrollable region with a sticky BottomSection\n// (Submit button) at the bottom. The ScrollView has flexShrink: 1 so it\n// shrinks to fit when the parent modal is capped at its keyboard-aware\n// maxHeight, keeping Submit visible regardless of survey length. Scrolling is\n// enabled only while the content overflows the viewport, so short surveys don't\n// scroll or bounce.\nfunction QuestionLayout({ children, footer }: { children: ReactNode; footer: ReactNode }): JSX.Element {\n const [viewportHeight, setViewportHeight] = useState(0)\n const [contentHeight, setContentHeight] = useState(0)\n // 1px threshold absorbs sub-pixel layout rounding.\n const isOverflowing = contentHeight > viewportHeight + 1\n\n return (\n <View style={questionLayoutStyles.container}>\n <ScrollView\n style={questionLayoutStyles.scroll}\n keyboardShouldPersistTaps=\"handled\"\n showsVerticalScrollIndicator={false}\n scrollEnabled={isOverflowing}\n bounces={isOverflowing}\n onLayout={(e: LayoutChangeEvent) => setViewportHeight(e.nativeEvent.layout.height)}\n onContentSizeChange={(_width, height) => setContentHeight(height)}\n >\n {children}\n </ScrollView>\n {footer}\n </View>\n )\n}\n\nconst questionLayoutStyles = createSafeStyleSheet({\n container: {\n flexShrink: 1,\n },\n scroll: {\n flexShrink: 1,\n },\n})\n\nexport function OpenTextQuestion({\n question,\n appearance,\n onSubmit,\n}: QuestionCommonProps & {\n onSubmit: (text: string) => void\n}): JSX.Element {\n const [text, setText] = useState('')\n\n // Memoize validation error to avoid recalculating on every render\n const validationError = useMemo(\n () => getValidationError(text, question.validation, question.optional),\n [text, question.validation, question.optional]\n )\n\n // Build requirements hint message\n const minLength = getLengthFromRules(question.validation, SurveyValidationType.MinLength)\n const maxLength = getLengthFromRules(question.validation, SurveyValidationType.MaxLength)\n const requirementsHint = useMemo(() => getRequirementsHint(minLength, maxLength), [minLength, maxLength])\n\n const handleSubmit = () => {\n if (validationError) {\n return\n }\n onSubmit(text.trim())\n }\n\n return (\n <QuestionLayout\n footer={\n <BottomSection\n text={question.buttonText ?? appearance.submitButtonText}\n submitDisabled={!!validationError}\n appearance={appearance}\n onSubmit={handleSubmit}\n />\n }\n >\n <QuestionHeader\n question={question.question}\n description={question.description}\n descriptionContentType={question.descriptionContentType}\n appearance={appearance}\n />\n <View style={styles.textInputContainer}>\n <TextInput\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'input')}\n style={[\n styles.textInput,\n {\n backgroundColor: appearance.inputBackground,\n color: appearance.inputTextColor ?? getContrastingTextColor(appearance.inputBackground),\n borderColor: appearance.borderColor,\n },\n ]}\n multiline\n numberOfLines={4}\n placeholder={appearance.placeholder}\n placeholderTextColor={\n getContrastingTextColor(\n appearance.inputTextColor ?? getContrastingTextColor(appearance.inputBackground)\n ) === 'white'\n ? 'rgba(0, 0, 0, 0.5)'\n : 'rgba(255, 255, 255, 0.5)'\n }\n onChangeText={setText}\n value={text}\n />\n {requirementsHint && (\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'validationHint')}\n style={[\n styles.validationHint,\n { color: appearance.textColor ?? getContrastingTextColor(appearance.backgroundColor) },\n ]}\n >\n {requirementsHint}\n </Text>\n )}\n </View>\n </QuestionLayout>\n )\n}\n\nexport function LinkQuestion({\n question,\n appearance,\n onSubmit,\n}: QuestionCommonProps & {\n onSubmit: (clicked: string) => void\n}): JSX.Element {\n question = question as LinkSurveyQuestion\n\n return (\n <QuestionLayout\n footer={\n <BottomSection\n text={question.buttonText ?? appearance.submitButtonText ?? 'Submit'}\n submitDisabled={false}\n link={question.link}\n appearance={appearance}\n onSubmit={() => onSubmit('link clicked')}\n />\n }\n >\n <QuestionHeader\n question={question.question}\n description={question.description}\n descriptionContentType={question.descriptionContentType}\n appearance={appearance}\n />\n </QuestionLayout>\n )\n}\n\nexport function RatingQuestion({\n question,\n appearance,\n onSubmit,\n}: QuestionCommonProps & {\n onSubmit: (rating: number | null) => void\n}): JSX.Element {\n //const starting = question.scale === 10 ? 0 : 1;\n const [rating, setRating] = useState<number | null>(null)\n question = question as RatingSurveyQuestion\n\n return (\n <QuestionLayout\n footer={\n <BottomSection\n text={question.buttonText ?? appearance.submitButtonText}\n submitDisabled={rating === null && !question.optional}\n appearance={appearance}\n onSubmit={() => onSubmit(rating)}\n skipSubmitButton={question.skipSubmitButton}\n />\n }\n >\n <QuestionHeader\n question={question.question}\n description={question.description}\n descriptionContentType={question.descriptionContentType}\n appearance={appearance}\n />\n <View style={styles.ratingSection}>\n <View style={styles.ratingOptions}>\n {question.display === SurveyRatingDisplay.Emoji && (\n <View style={styles.ratingOptionsEmoji}>\n {emojiScaleLists[question.scale]?.map((Emoji, idx) => {\n const active = idx + 1 === rating\n return (\n <TouchableOpacity\n key={idx}\n style={styles.ratingsEmoji}\n onPress={() => {\n const response = idx + 1\n setRating(response)\n if (question.skipSubmitButton) {\n onSubmit(response)\n }\n }}\n >\n <Emoji fill={active ? appearance.ratingButtonActiveColor : appearance.ratingButtonColor} />\n </TouchableOpacity>\n )\n })}\n </View>\n )}\n {question.display === SurveyRatingDisplay.Number && (\n <View style={[styles.ratingOptionsNumber, { borderColor: appearance.borderColor }]}>\n {getScaleNumbers(question.scale).map((number, idx) => {\n const active = rating === number\n return (\n <RatingButton\n key={idx}\n index={idx}\n active={active}\n appearance={appearance}\n num={number}\n setActiveNumber={(response) => {\n setRating(response)\n if (question.skipSubmitButton) {\n onSubmit(response)\n }\n }}\n />\n )\n })}\n </View>\n )}\n </View>\n <View style={styles.ratingText}>\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'ratingLabel')}\n style={{\n color: appearance.textColor ?? getContrastingTextColor(appearance.backgroundColor),\n opacity: defaultRatingLabelOpacity,\n }}\n >\n {question.lowerBoundLabel}\n </Text>\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'ratingLabel')}\n style={{\n color: appearance.textColor ?? getContrastingTextColor(appearance.backgroundColor),\n opacity: defaultRatingLabelOpacity,\n }}\n >\n {question.upperBoundLabel}\n </Text>\n </View>\n </View>\n </QuestionLayout>\n )\n}\n\nexport function RatingButton({\n index,\n num,\n active,\n appearance,\n setActiveNumber,\n}: {\n index: number\n num: number\n active: boolean\n appearance: SurveyAppearanceTheme\n setActiveNumber: (num: number) => void\n}): JSX.Element {\n const backgroundColor = active ? appearance.ratingButtonActiveColor : appearance.ratingButtonColor\n // Active state always auto-calculates for contrast; inactive uses inputTextColor override if provided\n const textColor = active\n ? getContrastingTextColor(backgroundColor)\n : (appearance.inputTextColor ?? getContrastingTextColor(backgroundColor))\n\n return (\n <TouchableOpacity\n style={[\n styles.ratingsNumber,\n index === 0 && { borderLeftWidth: 0 },\n { backgroundColor, borderColor: appearance.borderColor },\n ]}\n onPress={() => setActiveNumber(num)}\n >\n <Text maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'ratingNumber')} style={{ color: textColor }}>\n {num}\n </Text>\n </TouchableOpacity>\n )\n}\n\nexport function MultipleChoiceQuestion({\n question,\n appearance,\n onSubmit,\n}: QuestionCommonProps & {\n onSubmit: (choices: string | string[] | null) => void\n}): JSX.Element {\n question = question as MultipleSurveyQuestion\n const isSingleChoice = question.type === SurveyQuestionType.SingleChoice\n const allowMultiple = question.type === SurveyQuestionType.MultipleChoice\n const openChoiceIndex = question.hasOpenChoice ? question.choices.length - 1 : -1\n const choices = useMemo(() => getDisplayOrderChoices(question as MultipleSurveyQuestion), [question])\n // Choice labels change with survey translations; keep selection tied to the original order.\n const [selectedChoiceIndices, setSelectedChoiceIndices] = useState<number[]>([])\n const [openEndedInput, setOpenEndedInput] = useState('')\n\n // Only skip submit for single-choice questions without open choice\n const shouldSkipSubmit = question.skipSubmitButton && isSingleChoice && !question.hasOpenChoice\n\n return (\n <QuestionLayout\n footer={\n <BottomSection\n text={question.buttonText ?? appearance.submitButtonText}\n submitDisabled={\n !question.optional &&\n (selectedChoiceIndices.length === 0 ||\n (selectedChoiceIndices.includes(openChoiceIndex) && openEndedInput.length === 0))\n }\n appearance={appearance}\n onSubmit={() => {\n const result = selectedChoiceIndices.map((index) =>\n index === openChoiceIndex ? openEndedInput : choices[index]\n )\n onSubmit(allowMultiple ? result : result[0])\n }}\n skipSubmitButton={shouldSkipSubmit}\n />\n }\n >\n <QuestionHeader\n question={question.question}\n description={question.description}\n descriptionContentType={question.descriptionContentType}\n appearance={appearance}\n />\n <View style={styles.multipleChoiceOptions}>\n {choices.map((choice: string, choiceIndex: number) => {\n const isOpenChoice = choiceIndex === openChoiceIndex\n const isSelected = selectedChoiceIndices.includes(choiceIndex)\n\n const choiceTextColor = appearance.inputTextColor ?? getContrastingTextColor(appearance.inputBackground)\n\n return (\n <Pressable\n key={choiceIndex}\n style={[\n styles.choiceOption,\n { backgroundColor: appearance.inputBackground },\n isSelected ? { borderColor: getContrastingTextColor(appearance.backgroundColor) } : {},\n ]}\n onPress={() => {\n if (allowMultiple) {\n setSelectedChoiceIndices(\n isSelected\n ? selectedChoiceIndices.filter((index) => index !== choiceIndex)\n : [...selectedChoiceIndices, choiceIndex]\n )\n } else {\n setSelectedChoiceIndices([choiceIndex])\n if (shouldSkipSubmit && !isOpenChoice) {\n onSubmit(choice)\n }\n }\n }}\n >\n <View style={styles.choiceText}>\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'choice')}\n style={{ flexGrow: 1, color: choiceTextColor }}\n >\n {choice}\n {isOpenChoice ? ':' : ''}\n </Text>\n <View style={styles.rightCheckArea}>{isSelected && <CheckSVG />}</View>\n </View>\n {isOpenChoice && (\n <TextInput\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'input')}\n style={styles.openEndedInput}\n onChangeText={(userValue) => {\n setOpenEndedInput(userValue)\n if (!isSelected) {\n setSelectedChoiceIndices(allowMultiple ? [...selectedChoiceIndices, choiceIndex] : [choiceIndex])\n }\n }}\n />\n )}\n </Pressable>\n )\n })}\n </View>\n </QuestionLayout>\n )\n}\n\nconst emojiScaleLists: Record<number, (typeof ThumbsUpEmoji)[]> = {\n 2: [ThumbsUpEmoji, ThumbsDownEmoji],\n 3: [DissatisfiedEmoji, NeutralEmoji, SatisfiedEmoji],\n 5: [VeryDissatisfiedEmoji, DissatisfiedEmoji, NeutralEmoji, SatisfiedEmoji, VerySatisfiedEmoji],\n}\nconst fiveScaleNumbers = [1, 2, 3, 4, 5]\nconst sevenScaleNumbers = [1, 2, 3, 4, 5, 6, 7]\nconst tenScaleNumbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n\nfunction getScaleNumbers(scale: number): number[] {\n switch (scale) {\n case 5:\n return fiveScaleNumbers\n case 7:\n return sevenScaleNumbers\n case 10:\n return tenScaleNumbers\n default:\n return fiveScaleNumbers\n }\n}\n\nconst styles = createSafeStyleSheet({\n textInputContainer: {\n padding: 10,\n },\n textInput: {\n borderColor: '#ccc',\n borderWidth: 1,\n padding: 10,\n marginVertical: 10,\n fontSize: 16,\n // Fixed height keeps the surrounding layout stable as the user types —\n // the TextInput scrolls its own content internally\n height: 80,\n textAlignVertical: 'top',\n },\n ratingSection: {\n marginVertical: 10,\n },\n ratingOptions: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n ratingOptionsEmoji: {\n flexDirection: 'row',\n justifyContent: 'space-around',\n flexWrap: 'nowrap',\n flex: 1,\n },\n ratingsEmoji: {\n padding: 4,\n },\n ratingOptionsNumber: {\n margin: 10,\n flexGrow: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n borderRadius: 5,\n borderWidth: 1,\n overflow: 'hidden',\n },\n ratingsNumber: {\n flex: 1,\n paddingVertical: 10,\n alignItems: 'center',\n borderLeftWidth: 1,\n },\n ratingText: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 10,\n },\n multipleChoiceOptions: {\n padding: 10,\n },\n choiceOption: {\n flexDirection: 'column',\n marginVertical: 5,\n borderWidth: 1,\n borderColor: 'grey',\n borderRadius: 5,\n padding: 10,\n },\n choiceText: {\n flexDirection: 'row',\n },\n rightCheckArea: {\n flexGrow: 0,\n },\n openEndedInput: {\n padding: 5,\n },\n validationHint: {\n fontSize: 12,\n opacity: 0.7,\n marginTop: 4,\n },\n})\n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AQ,CAAE,C,CACX,CACDjB,cAAc,CAAE,CACd+B,OAAO,CAAE,C,CACV,CACDnG,cAAc,CAAE,CACdsG,QAAQ,CAAE,EAAE,CACZ7D,OAAO,CAAE,GAAG,CACZwE,SAAS,CAAE,C,EAEd,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"QuestionTypes.js","names":["_react","_interopRequireWildcard","require","_reactNative","_safeStyleSheet","_icons","_surveysUtils","_surveyShuffling","_core","_surveys","_BottomSection","_QuestionHeader","_jsxRuntime","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t2","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","QuestionLayout","_ref","children","footer","_useState","useState","_useState2","_slicedToArray2","viewportHeight","setViewportHeight","_useState3","_useState4","contentHeight","setContentHeight","isOverflowing","jsxs","View","style","questionLayoutStyles","container","jsx","ScrollView","scroll","keyboardShouldPersistTaps","showsVerticalScrollIndicator","scrollEnabled","bounces","onLayout","nativeEvent","layout","height","onContentSizeChange","_width","createSafeStyleSheet","flexShrink","OpenTextQuestion","_ref2","question","appearance","onSubmit","_useState5","_useState6","text","setText","validationError","useMemo","getValidationError","validation","optional","minLength","getLengthFromRules","SurveyValidationType","MinLength","maxLength","MaxLength","requirementsHint","getRequirementsHint","handleSubmit","trim","BottomSection","_a","buttonText","submitButtonText","submitDisabled","QuestionHeader","description","descriptionContentType","styles","textInputContainer","TextInput","maxFontSizeMultiplier","getMaxFontSizeMultiplier","textInput","backgroundColor","inputBackground","color","_b","inputTextColor","getContrastingTextColor","borderColor","multiline","numberOfLines","placeholder","placeholderTextColor","_c","onChangeText","value","Text","validationHint","_d","textColor","LinkQuestion","_ref3","link","RatingQuestion","_ref4","_this","_useState7","_useState8","rating","setRating","skipSubmitButton","ratingSection","ratingOptions","display","SurveyRatingDisplay","Emoji","ratingOptionsEmoji","emojiScaleLists","scale","map","idx","active","TouchableOpacity","ratingsEmoji","onPress","response","fill","ratingButtonActiveColor","ratingButtonColor","Number","ratingOptionsNumber","getScaleNumbers","number","numbers","RatingButton","index","num","accessibilityLabel","String","lowerBoundLabel","length","upperBoundLabel","filter","Boolean","join","setActiveNumber","ratingText","opacity","defaultRatingLabelOpacity","_ref5","accessibilityRole","accessibilityState","checked","ratingsNumber","borderLeftWidth","MultipleChoiceQuestion","_ref6","_this2","isSingleChoice","type","SurveyQuestionType","SingleChoice","allowMultiple","MultipleChoice","openChoiceIndex","hasOpenChoice","choices","getDisplayOrderChoices","_useState9","_useState0","selectedChoiceIndices","setSelectedChoiceIndices","_useState1","_useState10","openEndedInput","setOpenEndedInput","shouldSkipSubmit","includes","result","multipleChoiceOptions","choice","choiceIndex","isOpenChoice","isSelected","choiceTextColor","Pressable","choiceOption","concat","_toConsumableArray2","choiceText","flexGrow","rightCheckArea","CheckSVG","userValue","ThumbsUpEmoji","ThumbsDownEmoji","DissatisfiedEmoji","NeutralEmoji","SatisfiedEmoji","VeryDissatisfiedEmoji","VerySatisfiedEmoji","fiveScaleNumbers","sevenScaleNumbers","tenScaleNumbers","padding","borderWidth","marginVertical","fontSize","textAlignVertical","flexDirection","justifyContent","flexWrap","flex","margin","borderRadius","overflow","paddingVertical","alignItems","marginTop"],"sources":["../../../src/surveys/components/QuestionTypes.tsx"],"sourcesContent":["import React, { ReactNode, useMemo, useState } from 'react'\nimport { LayoutChangeEvent, Pressable, ScrollView, Text, TextInput, TouchableOpacity, View } from 'react-native'\n\nimport { createSafeStyleSheet } from '../safeStyleSheet'\nimport {\n CheckSVG,\n DissatisfiedEmoji,\n NeutralEmoji,\n SatisfiedEmoji,\n ThumbsDownEmoji,\n ThumbsUpEmoji,\n VeryDissatisfiedEmoji,\n VerySatisfiedEmoji,\n} from '../icons'\nimport {\n defaultRatingLabelOpacity,\n getContrastingTextColor,\n getMaxFontSizeMultiplier,\n SurveyAppearanceTheme,\n} from '../surveys-utils'\nimport { getDisplayOrderChoices } from '../survey-shuffling'\nimport {\n SurveyQuestion,\n SurveyRatingDisplay,\n SurveyQuestionType,\n LinkSurveyQuestion,\n RatingSurveyQuestion,\n MultipleSurveyQuestion,\n SurveyValidationType,\n} from '@posthog/core'\nimport { getValidationError, getLengthFromRules, getRequirementsHint } from '@posthog/core/surveys'\nimport { BottomSection } from './BottomSection'\nimport { QuestionHeader } from './QuestionHeader'\n\ninterface QuestionCommonProps {\n question: SurveyQuestion\n appearance: SurveyAppearanceTheme\n}\n\n// Wraps question content in a scrollable region with a sticky BottomSection\n// (Submit button) at the bottom. The ScrollView has flexShrink: 1 so it\n// shrinks to fit when the parent modal is capped at its keyboard-aware\n// maxHeight, keeping Submit visible regardless of survey length. Scrolling is\n// enabled only while the content overflows the viewport, so short surveys don't\n// scroll or bounce.\nfunction QuestionLayout({ children, footer }: { children: ReactNode; footer: ReactNode }): JSX.Element {\n const [viewportHeight, setViewportHeight] = useState(0)\n const [contentHeight, setContentHeight] = useState(0)\n // 1px threshold absorbs sub-pixel layout rounding.\n const isOverflowing = contentHeight > viewportHeight + 1\n\n return (\n <View style={questionLayoutStyles.container}>\n <ScrollView\n style={questionLayoutStyles.scroll}\n keyboardShouldPersistTaps=\"handled\"\n showsVerticalScrollIndicator={false}\n scrollEnabled={isOverflowing}\n bounces={isOverflowing}\n onLayout={(e: LayoutChangeEvent) => setViewportHeight(e.nativeEvent.layout.height)}\n onContentSizeChange={(_width, height) => setContentHeight(height)}\n >\n {children}\n </ScrollView>\n {footer}\n </View>\n )\n}\n\nconst questionLayoutStyles = createSafeStyleSheet({\n container: {\n flexShrink: 1,\n },\n scroll: {\n flexShrink: 1,\n },\n})\n\nexport function OpenTextQuestion({\n question,\n appearance,\n onSubmit,\n}: QuestionCommonProps & {\n onSubmit: (text: string) => void\n}): JSX.Element {\n const [text, setText] = useState('')\n\n // Memoize validation error to avoid recalculating on every render\n const validationError = useMemo(\n () => getValidationError(text, question.validation, question.optional),\n [text, question.validation, question.optional]\n )\n\n // Build requirements hint message\n const minLength = getLengthFromRules(question.validation, SurveyValidationType.MinLength)\n const maxLength = getLengthFromRules(question.validation, SurveyValidationType.MaxLength)\n const requirementsHint = useMemo(() => getRequirementsHint(minLength, maxLength), [minLength, maxLength])\n\n const handleSubmit = () => {\n if (validationError) {\n return\n }\n onSubmit(text.trim())\n }\n\n return (\n <QuestionLayout\n footer={\n <BottomSection\n text={question.buttonText ?? appearance.submitButtonText}\n submitDisabled={!!validationError}\n appearance={appearance}\n onSubmit={handleSubmit}\n />\n }\n >\n <QuestionHeader\n question={question.question}\n description={question.description}\n descriptionContentType={question.descriptionContentType}\n appearance={appearance}\n />\n <View style={styles.textInputContainer}>\n <TextInput\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'input')}\n style={[\n styles.textInput,\n {\n backgroundColor: appearance.inputBackground,\n color: appearance.inputTextColor ?? getContrastingTextColor(appearance.inputBackground),\n borderColor: appearance.borderColor,\n },\n ]}\n multiline\n numberOfLines={4}\n placeholder={appearance.placeholder}\n placeholderTextColor={\n getContrastingTextColor(\n appearance.inputTextColor ?? getContrastingTextColor(appearance.inputBackground)\n ) === 'white'\n ? 'rgba(0, 0, 0, 0.5)'\n : 'rgba(255, 255, 255, 0.5)'\n }\n onChangeText={setText}\n value={text}\n />\n {requirementsHint && (\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'validationHint')}\n style={[\n styles.validationHint,\n { color: appearance.textColor ?? getContrastingTextColor(appearance.backgroundColor) },\n ]}\n >\n {requirementsHint}\n </Text>\n )}\n </View>\n </QuestionLayout>\n )\n}\n\nexport function LinkQuestion({\n question,\n appearance,\n onSubmit,\n}: QuestionCommonProps & {\n onSubmit: (clicked: string) => void\n}): JSX.Element {\n question = question as LinkSurveyQuestion\n\n return (\n <QuestionLayout\n footer={\n <BottomSection\n text={question.buttonText ?? appearance.submitButtonText ?? 'Submit'}\n submitDisabled={false}\n link={question.link}\n appearance={appearance}\n onSubmit={() => onSubmit('link clicked')}\n />\n }\n >\n <QuestionHeader\n question={question.question}\n description={question.description}\n descriptionContentType={question.descriptionContentType}\n appearance={appearance}\n />\n </QuestionLayout>\n )\n}\n\nexport function RatingQuestion({\n question,\n appearance,\n onSubmit,\n}: QuestionCommonProps & {\n onSubmit: (rating: number | null) => void\n}): JSX.Element {\n //const starting = question.scale === 10 ? 0 : 1;\n const [rating, setRating] = useState<number | null>(null)\n question = question as RatingSurveyQuestion\n\n return (\n <QuestionLayout\n footer={\n <BottomSection\n text={question.buttonText ?? appearance.submitButtonText}\n submitDisabled={rating === null && !question.optional}\n appearance={appearance}\n onSubmit={() => onSubmit(rating)}\n skipSubmitButton={question.skipSubmitButton}\n />\n }\n >\n <QuestionHeader\n question={question.question}\n description={question.description}\n descriptionContentType={question.descriptionContentType}\n appearance={appearance}\n />\n <View style={styles.ratingSection}>\n <View style={styles.ratingOptions}>\n {question.display === SurveyRatingDisplay.Emoji && (\n <View style={styles.ratingOptionsEmoji}>\n {emojiScaleLists[question.scale]?.map((Emoji, idx) => {\n const active = idx + 1 === rating\n return (\n <TouchableOpacity\n key={idx}\n style={styles.ratingsEmoji}\n onPress={() => {\n const response = idx + 1\n setRating(response)\n if (question.skipSubmitButton) {\n onSubmit(response)\n }\n }}\n >\n <Emoji fill={active ? appearance.ratingButtonActiveColor : appearance.ratingButtonColor} />\n </TouchableOpacity>\n )\n })}\n </View>\n )}\n {question.display === SurveyRatingDisplay.Number && (\n <View style={[styles.ratingOptionsNumber, { borderColor: appearance.borderColor }]}>\n {getScaleNumbers(question.scale).map((number, idx, numbers) => {\n const active = rating === number\n return (\n <RatingButton\n key={idx}\n index={idx}\n active={active}\n appearance={appearance}\n num={number}\n accessibilityLabel={[\n String(number),\n question.question,\n idx === 0 ? question.lowerBoundLabel : idx === numbers.length - 1 ? question.upperBoundLabel : '',\n ]\n .filter(Boolean)\n .join(', ')}\n setActiveNumber={(response) => {\n setRating(response)\n if (question.skipSubmitButton) {\n onSubmit(response)\n }\n }}\n />\n )\n })}\n </View>\n )}\n </View>\n <View style={styles.ratingText}>\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'ratingLabel')}\n style={{\n color: appearance.textColor ?? getContrastingTextColor(appearance.backgroundColor),\n opacity: defaultRatingLabelOpacity,\n }}\n >\n {question.lowerBoundLabel}\n </Text>\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'ratingLabel')}\n style={{\n color: appearance.textColor ?? getContrastingTextColor(appearance.backgroundColor),\n opacity: defaultRatingLabelOpacity,\n }}\n >\n {question.upperBoundLabel}\n </Text>\n </View>\n </View>\n </QuestionLayout>\n )\n}\n\nexport function RatingButton({\n index,\n num,\n active,\n appearance,\n setActiveNumber,\n accessibilityLabel,\n}: {\n index: number\n num: number\n active: boolean\n appearance: SurveyAppearanceTheme\n setActiveNumber: (num: number) => void\n accessibilityLabel?: string\n}): JSX.Element {\n const backgroundColor = active ? appearance.ratingButtonActiveColor : appearance.ratingButtonColor\n // Active state always auto-calculates for contrast; inactive uses inputTextColor override if provided\n const textColor = active\n ? getContrastingTextColor(backgroundColor)\n : (appearance.inputTextColor ?? getContrastingTextColor(backgroundColor))\n\n return (\n <TouchableOpacity\n accessibilityRole=\"radio\"\n accessibilityLabel={accessibilityLabel}\n accessibilityState={{ checked: active }}\n style={[\n styles.ratingsNumber,\n index === 0 && { borderLeftWidth: 0 },\n { backgroundColor, borderColor: appearance.borderColor },\n ]}\n onPress={() => setActiveNumber(num)}\n >\n <Text maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'ratingNumber')} style={{ color: textColor }}>\n {num}\n </Text>\n </TouchableOpacity>\n )\n}\n\nexport function MultipleChoiceQuestion({\n question,\n appearance,\n onSubmit,\n}: QuestionCommonProps & {\n onSubmit: (choices: string | string[] | null) => void\n}): JSX.Element {\n question = question as MultipleSurveyQuestion\n const isSingleChoice = question.type === SurveyQuestionType.SingleChoice\n const allowMultiple = question.type === SurveyQuestionType.MultipleChoice\n const openChoiceIndex = question.hasOpenChoice ? question.choices.length - 1 : -1\n const choices = useMemo(() => getDisplayOrderChoices(question as MultipleSurveyQuestion), [question])\n // Choice labels change with survey translations; keep selection tied to the original order.\n const [selectedChoiceIndices, setSelectedChoiceIndices] = useState<number[]>([])\n const [openEndedInput, setOpenEndedInput] = useState('')\n\n // Only skip submit for single-choice questions without open choice\n const shouldSkipSubmit = question.skipSubmitButton && isSingleChoice && !question.hasOpenChoice\n\n return (\n <QuestionLayout\n footer={\n <BottomSection\n text={question.buttonText ?? appearance.submitButtonText}\n submitDisabled={\n !question.optional &&\n (selectedChoiceIndices.length === 0 ||\n (selectedChoiceIndices.includes(openChoiceIndex) && openEndedInput.length === 0))\n }\n appearance={appearance}\n onSubmit={() => {\n const result = selectedChoiceIndices.map((index) =>\n index === openChoiceIndex ? openEndedInput : choices[index]\n )\n onSubmit(allowMultiple ? result : result[0])\n }}\n skipSubmitButton={shouldSkipSubmit}\n />\n }\n >\n <QuestionHeader\n question={question.question}\n description={question.description}\n descriptionContentType={question.descriptionContentType}\n appearance={appearance}\n />\n <View style={styles.multipleChoiceOptions}>\n {choices.map((choice: string, choiceIndex: number) => {\n const isOpenChoice = choiceIndex === openChoiceIndex\n const isSelected = selectedChoiceIndices.includes(choiceIndex)\n\n const choiceTextColor = appearance.inputTextColor ?? getContrastingTextColor(appearance.inputBackground)\n\n return (\n <Pressable\n key={choiceIndex}\n style={[\n styles.choiceOption,\n { backgroundColor: appearance.inputBackground },\n isSelected ? { borderColor: getContrastingTextColor(appearance.backgroundColor) } : {},\n ]}\n onPress={() => {\n if (allowMultiple) {\n setSelectedChoiceIndices(\n isSelected\n ? selectedChoiceIndices.filter((index) => index !== choiceIndex)\n : [...selectedChoiceIndices, choiceIndex]\n )\n } else {\n setSelectedChoiceIndices([choiceIndex])\n if (shouldSkipSubmit && !isOpenChoice) {\n onSubmit(choice)\n }\n }\n }}\n >\n <View style={styles.choiceText}>\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'choice')}\n style={{ flexGrow: 1, color: choiceTextColor }}\n >\n {choice}\n {isOpenChoice ? ':' : ''}\n </Text>\n <View style={styles.rightCheckArea}>{isSelected && <CheckSVG />}</View>\n </View>\n {isOpenChoice && (\n <TextInput\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'input')}\n style={styles.openEndedInput}\n onChangeText={(userValue) => {\n setOpenEndedInput(userValue)\n if (!isSelected) {\n setSelectedChoiceIndices(allowMultiple ? [...selectedChoiceIndices, choiceIndex] : [choiceIndex])\n }\n }}\n />\n )}\n </Pressable>\n )\n })}\n </View>\n </QuestionLayout>\n )\n}\n\nconst emojiScaleLists: Record<number, (typeof ThumbsUpEmoji)[]> = {\n 2: [ThumbsUpEmoji, ThumbsDownEmoji],\n 3: [DissatisfiedEmoji, NeutralEmoji, SatisfiedEmoji],\n 5: [VeryDissatisfiedEmoji, DissatisfiedEmoji, NeutralEmoji, SatisfiedEmoji, VerySatisfiedEmoji],\n}\nconst fiveScaleNumbers = [1, 2, 3, 4, 5]\nconst sevenScaleNumbers = [1, 2, 3, 4, 5, 6, 7]\nconst tenScaleNumbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n\nfunction getScaleNumbers(scale: number): number[] {\n switch (scale) {\n case 5:\n return fiveScaleNumbers\n case 7:\n return sevenScaleNumbers\n case 10:\n return tenScaleNumbers\n default:\n return fiveScaleNumbers\n }\n}\n\nconst styles = createSafeStyleSheet({\n textInputContainer: {\n padding: 10,\n },\n textInput: {\n borderColor: '#ccc',\n borderWidth: 1,\n padding: 10,\n marginVertical: 10,\n fontSize: 16,\n // Fixed height keeps the surrounding layout stable as the user types —\n // the TextInput scrolls its own content internally\n height: 80,\n textAlignVertical: 'top',\n },\n ratingSection: {\n marginVertical: 10,\n },\n ratingOptions: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n ratingOptionsEmoji: {\n flexDirection: 'row',\n justifyContent: 'space-around',\n flexWrap: 'nowrap',\n flex: 1,\n },\n ratingsEmoji: {\n padding: 4,\n },\n ratingOptionsNumber: {\n margin: 10,\n flexGrow: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n borderRadius: 5,\n borderWidth: 1,\n overflow: 'hidden',\n },\n ratingsNumber: {\n flex: 1,\n paddingVertical: 10,\n alignItems: 'center',\n borderLeftWidth: 1,\n },\n ratingText: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 10,\n },\n multipleChoiceOptions: {\n padding: 10,\n },\n choiceOption: {\n flexDirection: 'column',\n marginVertical: 5,\n borderWidth: 1,\n borderColor: 'grey',\n borderRadius: 5,\n padding: 10,\n },\n choiceText: {\n flexDirection: 'row',\n },\n rightCheckArea: {\n flexGrow: 0,\n },\n openEndedInput: {\n padding: 5,\n },\n validationHint: {\n fontSize: 12,\n opacity: 0.7,\n marginTop: 4,\n },\n})\n"],"mappings":"wlBAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBAEA,IAAAE,eAAA,CAAAF,OAAA,sBACA,IAAAG,MAAA,CAAAH,OAAA,aAUA,IAAAI,aAAA,CAAAJ,OAAA,qBAMA,IAAAK,gBAAA,CAAAL,OAAA,wBACA,IAAAM,KAAA,CAAAN,OAAA,kBASA,IAAAO,QAAA,CAAAP,OAAA,0BACA,IAAAQ,cAAA,CAAAR,OAAA,oBACA,IAAAS,eAAA,CAAAT,OAAA,qBAAiD,IAAAU,WAAA,CAAAV,OAAA,0BAAAW,YAAA,mHAAAZ,wBAAAa,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAf,uBAAA,UAAAA,wBAAAa,CAAA,CAAAC,CAAA,MAAAA,CAAA,EAAAD,CAAA,EAAAA,CAAA,CAAAK,UAAA,QAAAL,CAAA,KAAAM,CAAA,CAAAC,CAAA,CAAAC,CAAA,EAAAC,SAAA,gBAAAT,CAAA,YAAAA,CAAA,YAAAU,OAAA,CAAAV,CAA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78.
|
|
1
|
+
export declare const version = "4.78.3";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="4.78.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="4.78.3";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":["version","exports"],"sources":["../src/version.ts"],"sourcesContent":["export const version = \"4.78.
|
|
1
|
+
{"version":3,"file":"version.js","names":["version","exports"],"sources":["../src/version.ts"],"sourcesContent":["export const version = \"4.78.3\"\n"],"mappings":"6FAAO,GAAM,CAAAA,OAAO,CAAAC,OAAA,CAAAD,OAAA,CAAG,QAAQ","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "posthog-react-native",
|
|
3
|
-
"version": "4.78.
|
|
3
|
+
"version": "4.78.3",
|
|
4
4
|
"bugs": {
|
|
5
5
|
"url": "https://github.com/PostHog/posthog-js/issues"
|
|
6
6
|
},
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"directory": "packages/react-native"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@posthog/
|
|
38
|
-
"@posthog/
|
|
37
|
+
"@posthog/core": "^1.55.3",
|
|
38
|
+
"@posthog/types": "^1.413.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@babel/cli": "^7.19.3",
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"typescript": "7.0.2",
|
|
74
74
|
"@vitest/coverage-v8": "^1.6.1",
|
|
75
75
|
"vitest": "^1.6.1",
|
|
76
|
+
"@posthog-tooling/tsconfig-base": "1.1.1",
|
|
76
77
|
"@posthog-tooling/rollup-utils": "1.1.1",
|
|
77
|
-
"@posthog/react-native-plugin": "2.12.
|
|
78
|
-
"@posthog-tooling/tsconfig-base": "1.1.1"
|
|
78
|
+
"@posthog/react-native-plugin": "2.12.3"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"@react-native-async-storage/async-storage": ">=1.0.0",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"test:unit": "vitest run",
|
|
146
146
|
"test:built": "node --test scripts/check-sourcemaps.mjs",
|
|
147
147
|
"test": "pnpm test:unit",
|
|
148
|
-
"prebuild": "node -
|
|
148
|
+
"prebuild": "node ../../tooling/write-version.mjs",
|
|
149
149
|
"build": "tsc -b && babel ./dist --out-dir dist --extensions '.js' --source-maps",
|
|
150
150
|
"package": "pnpm pack --out $PACKAGE_DEST/%s.tgz",
|
|
151
151
|
"generate-references": "pnpm exec api-extractor run --config ./api-extractor.json --local && node scripts/generate-docs.cjs"
|