@redneckz/wildless-cms-uni-blocks 0.14.1024 → 0.14.1026
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/bundle/bundle.umd.js +16 -6
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/ui-kit/UserSurveyDialog/UserSurveyDialogContent.d.ts +1 -0
- package/dist/ui-kit/UserSurveyDialog/UserSurveyDialog.js +8 -3
- package/dist/ui-kit/UserSurveyDialog/UserSurveyDialog.js.map +1 -1
- package/dist/ui-kit/UserSurveyDialog/UserSurveyDialogContent.d.ts +1 -0
- package/dist/ui-kit/UserSurveyDialog/useUserSurveyDialog.js +7 -2
- package/dist/ui-kit/UserSurveyDialog/useUserSurveyDialog.js.map +1 -1
- package/lib/ui-kit/UserSurveyDialog/UserSurveyDialog.js +8 -3
- package/lib/ui-kit/UserSurveyDialog/UserSurveyDialog.js.map +1 -1
- package/lib/ui-kit/UserSurveyDialog/UserSurveyDialogContent.d.ts +1 -0
- package/lib/ui-kit/UserSurveyDialog/useUserSurveyDialog.js +7 -2
- package/lib/ui-kit/UserSurveyDialog/useUserSurveyDialog.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +16 -6
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/ui-kit/UserSurveyDialog/UserSurveyDialogContent.d.ts +1 -0
- package/mobile/dist/ui-kit/UserSurveyDialog/UserSurveyDialog.js +8 -3
- package/mobile/dist/ui-kit/UserSurveyDialog/UserSurveyDialog.js.map +1 -1
- package/mobile/dist/ui-kit/UserSurveyDialog/UserSurveyDialogContent.d.ts +1 -0
- package/mobile/dist/ui-kit/UserSurveyDialog/useUserSurveyDialog.js +7 -2
- package/mobile/dist/ui-kit/UserSurveyDialog/useUserSurveyDialog.js.map +1 -1
- package/mobile/lib/ui-kit/UserSurveyDialog/UserSurveyDialog.js +8 -3
- package/mobile/lib/ui-kit/UserSurveyDialog/UserSurveyDialog.js.map +1 -1
- package/mobile/lib/ui-kit/UserSurveyDialog/UserSurveyDialogContent.d.ts +1 -0
- package/mobile/lib/ui-kit/UserSurveyDialog/useUserSurveyDialog.js +7 -2
- package/mobile/lib/ui-kit/UserSurveyDialog/useUserSurveyDialog.js.map +1 -1
- package/mobile/src/ui-kit/UserSurveyDialog/UserSurveyDialog.tsx +9 -3
- package/mobile/src/ui-kit/UserSurveyDialog/UserSurveyDialogContent.ts +1 -0
- package/mobile/src/ui-kit/UserSurveyDialog/useUserSurveyDialog.ts +9 -2
- package/package.json +1 -1
- package/src/ui-kit/UserSurveyDialog/UserSurveyDialog.tsx +9 -3
- package/src/ui-kit/UserSurveyDialog/UserSurveyDialogContent.ts +1 -0
- package/src/ui-kit/UserSurveyDialog/useUserSurveyDialog.ts +9 -2
package/bundle/bundle.umd.js
CHANGED
|
@@ -1923,7 +1923,7 @@
|
|
|
1923
1923
|
|
|
1924
1924
|
const STEPS$3 = [FirstStep, SecondStep, FinalStep];
|
|
1925
1925
|
const LAST_STEP_INDEX = 2;
|
|
1926
|
-
const UserSurveyDialog = UniBlock(({ onClose = noop, isAfterTargetAction = false, reasonsSource = {} }) => {
|
|
1926
|
+
const UserSurveyDialog = UniBlock(({ onClose = noop, isAfterTargetAction = false, reasonsSource = {}, onSkip = noop }) => {
|
|
1927
1927
|
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
1928
1928
|
const [currentRating, setCurrentRating] = useState(0);
|
|
1929
1929
|
const [currentReason, setCurrentReason] = useState();
|
|
@@ -1952,7 +1952,13 @@
|
|
|
1952
1952
|
};
|
|
1953
1953
|
setStep(LAST_STEP_INDEX);
|
|
1954
1954
|
}, [currentRating, currentReason]);
|
|
1955
|
-
|
|
1955
|
+
const handleClose = useCallback(() => {
|
|
1956
|
+
if (step !== LAST_STEP_INDEX) {
|
|
1957
|
+
onSkip();
|
|
1958
|
+
}
|
|
1959
|
+
onClose();
|
|
1960
|
+
}, [step]);
|
|
1961
|
+
return (jsx(Dialog, { maxWidth: "xl", onClose: handleClose, children: jsx(ActiveStep, { currentRating: currentRating, currentReason: currentReason, reasons: reasons, surveyType: surveyType, isSending: isSending, setCurrentReason: setCurrentReason, setCurrentRating: setCurrentRating, onSubmit: handleSubmit, onNextStep: handleNextStep }) }));
|
|
1956
1962
|
});
|
|
1957
1963
|
const getMessage = (currentReason, message) => {
|
|
1958
1964
|
if (currentReason?.text !== 'Другое') {
|
|
@@ -1964,7 +1970,6 @@
|
|
|
1964
1970
|
const getTimeAfter30days = () => Date.now() + 30 * 24 * 60 * 60 * 1000;
|
|
1965
1971
|
// Если пользователь проходил опрос то показываем другой, иначе показываем случайный тип опроса
|
|
1966
1972
|
const getUserSurveyType = (lastShownType) => {
|
|
1967
|
-
console.log('Расчитал');
|
|
1968
1973
|
if (lastShownType) {
|
|
1969
1974
|
return lastShownType === 'NPS' ? 'CSI' : 'NPS';
|
|
1970
1975
|
}
|
|
@@ -1983,8 +1988,9 @@
|
|
|
1983
1988
|
? Date.now() - Number.parseInt(sessionStore.surveyTimerStart)
|
|
1984
1989
|
: 0;
|
|
1985
1990
|
const isShowSurvey = !isSurveySkipped &&
|
|
1991
|
+
!isOtherLanguagePortal &&
|
|
1986
1992
|
(!userSurveyStore.userSurvey || userSurveyStore.userSurvey?.nextDueAt <= Date.now());
|
|
1987
|
-
const
|
|
1993
|
+
const handleSkipSurvey = useCallback(() => {
|
|
1988
1994
|
sessionStore.isSurveySkipped = true;
|
|
1989
1995
|
}, []);
|
|
1990
1996
|
const openUserSurveyDialog = useCallback((isAfterTargetAction = false) => {
|
|
@@ -1993,7 +1999,7 @@
|
|
|
1993
1999
|
$ref: '/wcms-resources/user-survey-reasons.json',
|
|
1994
2000
|
},
|
|
1995
2001
|
isAfterTargetAction,
|
|
1996
|
-
|
|
2002
|
+
onSkip: handleSkipSurvey,
|
|
1997
2003
|
});
|
|
1998
2004
|
}, []);
|
|
1999
2005
|
const handleOpenSurveyAction = useCallback(() => {
|
|
@@ -2021,6 +2027,10 @@
|
|
|
2021
2027
|
}, [isShowSurvey]);
|
|
2022
2028
|
return handleOpenSurveyAction;
|
|
2023
2029
|
};
|
|
2030
|
+
const isOtherLanguagePortal = () => {
|
|
2031
|
+
const regexp = new RegExp('^/(cn|en)($|/.*)');
|
|
2032
|
+
return regexp.test(globalThis.location.pathname);
|
|
2033
|
+
};
|
|
2024
2034
|
|
|
2025
2035
|
const SERVICE_TYPES = [{ key: 'ULTRASERVICE', text: 'Ультра' }];
|
|
2026
2036
|
const SERVICE_DIRECTIONS = [
|
|
@@ -14370,7 +14380,7 @@
|
|
|
14370
14380
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
14371
14381
|
});
|
|
14372
14382
|
|
|
14373
|
-
const packageVersion = "0.14.
|
|
14383
|
+
const packageVersion = "0.14.1025";
|
|
14374
14384
|
|
|
14375
14385
|
exports.Blocks = Blocks;
|
|
14376
14386
|
exports.ContentPage = ContentPage;
|