@cuemath/leap 2.9.1-j2 → 2.9.1
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/assets/illustrations/illustrations.js +0 -3
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/lib/lib.js +7 -0
- package/dist/assets/lib/lib.js.map +1 -0
- package/dist/assets/lottie/lottie.js +1 -11
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sheet-item/rewards-n-actions/student-actions/student-actions.js +45 -46
- package/dist/features/chapters/lpar-chapter/block-section/sheet-item/rewards-n-actions/student-actions/student-actions.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sheet-item/rewards-n-actions/teacher-actions/teacher-actions.js +25 -26
- package/dist/features/chapters/lpar-chapter/block-section/sheet-item/rewards-n-actions/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-provider.js.map +1 -1
- package/dist/features/sheets/lessons-list/lesson-item/lesson-item-cta-info.js +59 -60
- package/dist/features/sheets/lessons-list/lesson-item/lesson-item-cta-info.js.map +1 -1
- package/dist/features/sheets/resources-list/resource-item/resource-item.js +89 -90
- package/dist/features/sheets/resources-list/resource-item/resource-item.js.map +1 -1
- package/dist/features/sheets/sheets-list/sheet-item/reward-n-actions/student-actions/student-actions.js +60 -61
- package/dist/features/sheets/sheets-list/sheet-item/reward-n-actions/student-actions/student-actions.js.map +1 -1
- package/dist/features/sheets/sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions.js +63 -64
- package/dist/features/sheets/sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/sheets/utils/is-v3-worksheet.js +4 -14
- package/dist/features/sheets/utils/is-v3-worksheet.js.map +1 -1
- package/dist/features/ui/context-menu/context-menu.js +18 -20
- package/dist/features/ui/context-menu/context-menu.js.map +1 -1
- package/dist/features/ui/image/image.js +12 -12
- package/dist/features/ui/image/image.js.map +1 -1
- package/dist/features/ui/lottie-animation/helper.js +5 -6
- package/dist/features/ui/lottie-animation/helper.js.map +1 -1
- package/dist/features/ui/lottie-animation/lottie-animation.js +28 -37
- package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
- package/dist/features/ui/text/text.js +27 -29
- package/dist/features/ui/text/text.js.map +1 -1
- package/dist/features/worksheet/constants/events.js +3 -0
- package/dist/features/worksheet/constants/events.js.map +1 -1
- package/dist/features/worksheet/learnosity-preloader/learnosity-preloader.js +69 -50
- package/dist/features/worksheet/learnosity-preloader/learnosity-preloader.js.map +1 -1
- package/dist/index.d.ts +11 -185
- package/dist/index.js +373 -406
- package/dist/index.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +5 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +2 -3
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +10 -6
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +9 -12
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +8 -0
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
- package/dist/static/lib/polypad.js +34463 -0
- package/package.json +2 -3
- package/dist/assets/line-icons/icons/apple-icon.js +0 -48
- package/dist/assets/line-icons/icons/apple-icon.js.map +0 -1
- package/dist/assets/line-icons/icons/google-icon.js +0 -42
- package/dist/assets/line-icons/icons/google-icon.js.map +0 -1
- package/dist/features/auth/account-selector/account-selector-styled.js +0 -26
- package/dist/features/auth/account-selector/account-selector-styled.js.map +0 -1
- package/dist/features/auth/account-selector/account-selector.js +0 -75
- package/dist/features/auth/account-selector/account-selector.js.map +0 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styles.js +0 -12
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styles.js.map +0 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +0 -11
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +0 -1
- package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js +0 -24
- package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js.map +0 -1
- package/dist/features/auth/comps/overlay-loader/overlay-loader-styled.js +0 -29
- package/dist/features/auth/comps/overlay-loader/overlay-loader-styled.js.map +0 -1
- package/dist/features/auth/comps/overlay-loader/overlay-loader.js +0 -8
- package/dist/features/auth/comps/overlay-loader/overlay-loader.js.map +0 -1
- package/dist/features/auth/comps/resend-otp/otp-timer/otp-timer.js +0 -26
- package/dist/features/auth/comps/resend-otp/otp-timer/otp-timer.js.map +0 -1
- package/dist/features/auth/comps/resend-otp/resend-otp.js +0 -41
- package/dist/features/auth/comps/resend-otp/resend-otp.js.map +0 -1
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper-styled.js +0 -48
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper-styled.js.map +0 -1
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js +0 -115
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js.map +0 -1
- package/dist/features/auth/signup/claim-user-account/claim-user-account-styled.js +0 -16
- package/dist/features/auth/signup/claim-user-account/claim-user-account-styled.js.map +0 -1
- package/dist/features/auth/signup/claim-user-account/claim-user-account.js +0 -71
- package/dist/features/auth/signup/claim-user-account/claim-user-account.js.map +0 -1
- package/dist/features/auth/signup/custom-input/custom-input-styled.js +0 -38
- package/dist/features/auth/signup/custom-input/custom-input-styled.js.map +0 -1
- package/dist/features/auth/signup/custom-input/date-picker-input/date-picker-input-styled.js +0 -79
- package/dist/features/auth/signup/custom-input/date-picker-input/date-picker-input-styled.js.map +0 -1
- package/dist/features/auth/signup/custom-input/date-picker-input/date-picker-input.js +0 -54
- package/dist/features/auth/signup/custom-input/date-picker-input/date-picker-input.js.map +0 -1
- package/dist/features/auth/signup/custom-input/email-input/email-input.js +0 -30
- package/dist/features/auth/signup/custom-input/email-input/email-input.js.map +0 -1
- package/dist/features/auth/signup/custom-input/grade-input/grade-input-styled.js +0 -31
- package/dist/features/auth/signup/custom-input/grade-input/grade-input-styled.js.map +0 -1
- package/dist/features/auth/signup/custom-input/grade-input/grade-input.js +0 -30
- package/dist/features/auth/signup/custom-input/grade-input/grade-input.js.map +0 -1
- package/dist/features/auth/signup/custom-input/input-wrapper/input-wrapper-styled.js +0 -19
- package/dist/features/auth/signup/custom-input/input-wrapper/input-wrapper-styled.js.map +0 -1
- package/dist/features/auth/signup/custom-input/input-wrapper/input-wrapper.js +0 -33
- package/dist/features/auth/signup/custom-input/input-wrapper/input-wrapper.js.map +0 -1
- package/dist/features/auth/signup/custom-input/otp-input/otp-input.js +0 -41
- package/dist/features/auth/signup/custom-input/otp-input/otp-input.js.map +0 -1
- package/dist/features/auth/signup/custom-input/phone-input/country-selector/country-code-button.js +0 -33
- package/dist/features/auth/signup/custom-input/phone-input/country-selector/country-code-button.js.map +0 -1
- package/dist/features/auth/signup/custom-input/phone-input/country-selector/country-list-menu.js +0 -28
- package/dist/features/auth/signup/custom-input/phone-input/country-selector/country-list-menu.js.map +0 -1
- package/dist/features/auth/signup/custom-input/phone-input/phone-input-styled.js +0 -29
- package/dist/features/auth/signup/custom-input/phone-input/phone-input-styled.js.map +0 -1
- package/dist/features/auth/signup/custom-input/phone-input/phone-input.js +0 -64
- package/dist/features/auth/signup/custom-input/phone-input/phone-input.js.map +0 -1
- package/dist/features/auth/signup/custom-input/student-password/student-password.js +0 -53
- package/dist/features/auth/signup/custom-input/student-password/student-password.js.map +0 -1
- package/dist/features/auth/signup/custom-input/student-username/student-username.js +0 -38
- package/dist/features/auth/signup/custom-input/student-username/student-username.js.map +0 -1
- package/dist/features/auth/signup/signup-constants.js +0 -1022
- package/dist/features/auth/signup/signup-constants.js.map +0 -1
- package/dist/features/auth/signup/signup-methods/signup-methods.js +0 -58
- package/dist/features/auth/signup/signup-methods/signup-methods.js.map +0 -1
- package/dist/features/auth/signup/user-type-selector/user-type-card/user-type-card-styled.js +0 -19
- package/dist/features/auth/signup/user-type-selector/user-type-card/user-type-card-styled.js.map +0 -1
- package/dist/features/auth/signup/user-type-selector/user-type-card/user-type-card.js +0 -61
- package/dist/features/auth/signup/user-type-selector/user-type-card/user-type-card.js.map +0 -1
- package/dist/features/auth/signup/user-type-selector/user-type-selector-styled.js +0 -24
- package/dist/features/auth/signup/user-type-selector/user-type-selector-styled.js.map +0 -1
- package/dist/features/auth/signup/user-type-selector/user-type-selector.js +0 -87
- package/dist/features/auth/signup/user-type-selector/user-type-selector.js.map +0 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -332
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +0 -1
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -370
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +0 -1
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.js +0 -252
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.js.map +0 -1
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +0 -24
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js.map +0 -1
- package/dist/node_modules/@floating-ui/react/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -192
- package/dist/node_modules/@floating-ui/react/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +0 -1
- package/dist/node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -19
- package/dist/node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +0 -1
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -129
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +0 -1
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -129
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +0 -1
- package/dist/node_modules/clsx/dist/clsx.js +0 -18
- package/dist/node_modules/clsx/dist/clsx.js.map +0 -1
- package/dist/node_modules/date-fns/subYears.js +0 -9
- package/dist/node_modules/date-fns/subYears.js.map +0 -1
- package/dist/node_modules/react-datepicker/dist/index.es.js +0 -2700
- package/dist/node_modules/react-datepicker/dist/index.es.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/addLeadingZeros.js +0 -8
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/addLeadingZeros.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/defaultOptions.js +0 -8
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/defaultOptions.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/formatters.js +0 -518
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/formatters.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/lightFormatters.js +0 -60
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/lightFormatters.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/longFormatters.js +0 -53
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/longFormatters.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +0 -19
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/normalizeDates.js +0 -12
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/normalizeDates.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/protectedTokens.js +0 -21
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/protectedTokens.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addDays.js +0 -11
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addDays.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addHours.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addHours.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addMilliseconds.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addMilliseconds.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addMinutes.js +0 -11
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addMinutes.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addMonths.js +0 -21
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addMonths.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addQuarters.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addQuarters.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addSeconds.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addSeconds.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addWeeks.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addWeeks.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addYears.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addYears.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/constants.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/constants.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/constructFrom.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/constructFrom.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarDays.js +0 -17
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarDays.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarMonths.js +0 -14
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarMonths.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarQuarters.js +0 -15
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarQuarters.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarYears.js +0 -14
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarYears.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInDays.js +0 -23
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInDays.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfDay.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfDay.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfMonth.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfMonth.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfWeek.js +0 -12
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfWeek.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfYear.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfYear.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/format.js +0 -60
- package/dist/node_modules/react-datepicker/node_modules/date-fns/format.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDate.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDate.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDay.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDay.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDayOfYear.js +0 -12
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDayOfYear.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDaysInMonth.js +0 -11
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDaysInMonth.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDefaultOptions.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDefaultOptions.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getHours.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getHours.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getISODay.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getISODay.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getISOWeek.js +0 -13
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getISOWeek.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getISOWeekYear.js +0 -16
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getISOWeekYear.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getMinutes.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getMinutes.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getMonth.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getMonth.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getQuarter.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getQuarter.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getSeconds.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getSeconds.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getTime.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getTime.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getWeek.js +0 -13
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getWeek.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getWeekYear.js +0 -18
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getWeekYear.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getYear.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getYear.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isAfter.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isAfter.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isBefore.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isBefore.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isDate.js +0 -8
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isDate.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isEqual.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isEqual.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameDay.js +0 -15
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameDay.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameMonth.js +0 -14
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameMonth.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameQuarter.js +0 -15
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameQuarter.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameYear.js +0 -14
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameYear.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isValid.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isValid.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isWithinInterval.js +0 -13
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isWithinInterval.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildFormatLongFn.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -19
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildLocalizeFn.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -32
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildMatchFn.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -16
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +0 -71
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatDistance.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -34
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatLong.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +0 -12
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatRelative.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -156
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/localize.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/match.js +0 -111
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/match.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US.js +0 -22
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/max.js +0 -15
- package/dist/node_modules/react-datepicker/node_modules/date-fns/max.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/min.js +0 -15
- package/dist/node_modules/react-datepicker/node_modules/date-fns/min.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/Parser.js +0 -23
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/Parser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/Setter.js +0 -42
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/Setter.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/constants.js +0 -50
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/constants.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js +0 -50
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js +0 -50
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DateParser.js +0 -62
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DateParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js +0 -52
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayParser.js +0 -46
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js +0 -50
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/EraParser.js +0 -31
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/EraParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js +0 -22
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js +0 -23
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js +0 -33
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js +0 -33
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js +0 -34
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js +0 -34
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js +0 -100
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js +0 -49
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js +0 -49
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js +0 -50
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js +0 -41
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js +0 -75
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js +0 -49
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js +0 -70
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js +0 -33
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/MonthParser.js +0 -72
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/MonthParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js +0 -71
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/SecondParser.js +0 -33
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/SecondParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js +0 -75
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js +0 -72
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js +0 -71
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js +0 -23
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js +0 -23
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/YearParser.js +0 -50
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/YearParser.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers.js +0 -68
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/utils.js +0 -104
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/utils.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse.js +0 -88
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parseISO.js +0 -123
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parseISO.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setDay.js +0 -13
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setDay.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setHours.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setHours.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setISODay.js +0 -12
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setISODay.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setISOWeek.js +0 -11
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setISOWeek.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setMinutes.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setMinutes.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setMonth.js +0 -14
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setMonth.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setQuarter.js +0 -11
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setQuarter.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setSeconds.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setSeconds.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setWeek.js +0 -11
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setWeek.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setYear.js +0 -11
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setYear.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfDay.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfDay.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfISOWeek.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfISOWeek.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfISOWeekYear.js +0 -12
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfISOWeekYear.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfMonth.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfMonth.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfQuarter.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfQuarter.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfWeek.js +0 -12
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfWeek.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfWeekYear.js +0 -14
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfWeekYear.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfYear.js +0 -10
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfYear.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subDays.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subDays.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subMonths.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subMonths.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subQuarters.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subQuarters.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subWeeks.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subWeeks.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subYears.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subYears.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/toDate.js +0 -9
- package/dist/node_modules/react-datepicker/node_modules/date-fns/toDate.js.map +0 -1
- package/dist/node_modules/react-datepicker/node_modules/date-fns/transpose.js +0 -19
- package/dist/node_modules/react-datepicker/node_modules/date-fns/transpose.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -7
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
- package/dist/static/avatar-selected.860ee923.json +0 -1
- package/dist/static/circle-cuemath-logo-white.e9fafb91.svg +0 -1
- package/dist/static/cuemath-app-qr-code.ba6cc09b.svg +0 -1
- package/dist/static/cuemath-app-qr-code.d0912fc7.png +0 -0
- package/dist/static/dob.9ce3c15b.json +0 -1
- package/dist/static/grade.b3730524.json +0 -1
- package/dist/static/key.d6846476.json +0 -1
- package/dist/static/mail.c30e8708.json +0 -1
- package/dist/static/otp.2d08f874.json +0 -1
- package/dist/static/otp.a3029760.json +0 -1
- package/dist/static/parent-avatar.772d53e0.json +0 -1
- package/dist/static/phone-number.0be312ea.json +0 -1
- package/dist/static/phone-number.84f55562.json +0 -1
- package/dist/static/student-avatar.524226bd.json +0 -1
- package/dist/static/user-type-selector-grid-bg.3c9c8ad6.svg +0 -1
- package/dist/static/user-type-selector-grid-bg.3ce8142d.svg +0 -1
- package/dist/static/user-type-selector-grid-bg.aad0b059.svg +0 -1
- package/dist/static/username.9e034d51.json +0 -1
@@ -1,20 +1,19 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
2
|
+
import { memo as G, useMemo as O, useCallback as $, Fragment as M } from "react";
|
3
3
|
import B from "../../../../assets/line-icons/icons/bulb2.js";
|
4
4
|
import F from "../../../../assets/line-icons/icons/practice.js";
|
5
|
-
import { IS_CHAPTER_COMPLETED_STATES as
|
5
|
+
import { IS_CHAPTER_COMPLETED_STATES as A } from "../../../milestone/create/milestone-create-constants.js";
|
6
6
|
import H from "../../../ui/arrow-tooltip/arrow-tooltip.js";
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import { NODE_TYPE as
|
10
|
-
|
11
|
-
|
12
|
-
if (n === P || b.some((d) => d === n))
|
7
|
+
import V from "../../../ui/layout/flex-view.js";
|
8
|
+
import j from "../../comps/sheet-button/index.js";
|
9
|
+
import { NODE_TYPE as K, SHEET_STATE as U } from "../../constants/sheet.js";
|
10
|
+
const { TARGET_PRACTICE: I, PRACTICE: b, LEARNING: X } = K, { COMPLETED: y, IN_PROGRESS: Y } = U, q = (n, o, i) => {
|
11
|
+
if (n === y || A.some((f) => f === n))
|
13
12
|
return {
|
14
13
|
state: "completed",
|
15
14
|
renderAs: "secondary_black"
|
16
15
|
};
|
17
|
-
if ((o ===
|
16
|
+
if ((o === b || o === I) && i === "PENDING_TARGET_PRACTICE")
|
18
17
|
return {
|
19
18
|
state: "overdue",
|
20
19
|
renderAs: "tertiary"
|
@@ -24,85 +23,85 @@ const { TARGET_PRACTICE: v, PRACTICE: y, LEARNING: X } = U, { COMPLETED: P, IN_P
|
|
24
23
|
state: "in_progress",
|
25
24
|
renderAs: "primary"
|
26
25
|
};
|
27
|
-
},
|
28
|
-
({ sheetsListData: n, userType: o, isLessonDisabled:
|
29
|
-
const { lessonTagType:
|
30
|
-
(
|
31
|
-
const { permissions: E, node_id:
|
32
|
-
can_start:
|
33
|
-
can_resume:
|
34
|
-
can_reattempt:
|
35
|
-
can_review:
|
36
|
-
can_teacher_review:
|
37
|
-
} = E,
|
38
|
-
if (
|
39
|
-
if (
|
40
|
-
if (
|
41
|
-
|
26
|
+
}, ae = G(
|
27
|
+
({ sheetsListData: n, userType: o, isLessonDisabled: i, ...T }) => {
|
28
|
+
const { lessonTagType: f, onStart: d, onResume: p, onReattempt: u, onReview: l, onPreview: _ } = T, r = O(() => o === "STUDENT", [o]), v = $(
|
29
|
+
(s) => {
|
30
|
+
const { permissions: E, node_id: t, user_node_id: e } = s, {
|
31
|
+
can_start: a,
|
32
|
+
can_resume: c,
|
33
|
+
can_reattempt: w,
|
34
|
+
can_review: C,
|
35
|
+
can_teacher_review: h
|
36
|
+
} = E, R = r ? C : h;
|
37
|
+
if (r) {
|
38
|
+
if (a || c) {
|
39
|
+
if (a && typeof d == "function") {
|
40
|
+
d(t, e);
|
42
41
|
return;
|
43
42
|
}
|
44
|
-
if (
|
45
|
-
|
43
|
+
if (c && typeof p == "function") {
|
44
|
+
p(t, e);
|
46
45
|
return;
|
47
46
|
}
|
48
47
|
throw new Error("No callback is available");
|
49
|
-
} else if (
|
50
|
-
if (typeof
|
48
|
+
} else if (w) {
|
49
|
+
if (typeof u != "function")
|
51
50
|
throw new Error("canReattempt must be a function");
|
52
|
-
|
51
|
+
u(t, e);
|
53
52
|
return;
|
54
53
|
}
|
55
54
|
}
|
56
|
-
if (
|
57
|
-
if (typeof
|
55
|
+
if (R) {
|
56
|
+
if (typeof l != "function")
|
58
57
|
throw new Error("onReview must be a function");
|
59
|
-
if (!
|
58
|
+
if (!e)
|
60
59
|
throw new Error("user node id must be present to review the sheet");
|
61
|
-
|
60
|
+
l(e);
|
62
61
|
return;
|
63
62
|
}
|
64
|
-
if (typeof
|
63
|
+
if (typeof _ != "function")
|
65
64
|
throw new Error("onPreview must be a function");
|
66
|
-
|
65
|
+
_(s);
|
67
66
|
},
|
68
|
-
[
|
67
|
+
[r, l, d, _, u, p]
|
69
68
|
);
|
70
|
-
return /* @__PURE__ */
|
69
|
+
return /* @__PURE__ */ m(V, { $flexDirection: "row", $flexGapX: 1, $alignItems: "center", children: n.map((s, E) => {
|
71
70
|
const {
|
72
|
-
node_type:
|
73
|
-
state:
|
74
|
-
permissions:
|
75
|
-
sheet_statement:
|
76
|
-
} =
|
77
|
-
can_start:
|
78
|
-
can_resume:
|
79
|
-
can_reattempt:
|
80
|
-
can_review:
|
81
|
-
} =
|
82
|
-
return /* @__PURE__ */
|
71
|
+
node_type: t,
|
72
|
+
state: e,
|
73
|
+
permissions: a,
|
74
|
+
sheet_statement: c
|
75
|
+
} = s, {
|
76
|
+
can_start: w,
|
77
|
+
can_resume: C,
|
78
|
+
can_reattempt: h,
|
79
|
+
can_review: R
|
80
|
+
} = a, S = t === I ? b : t, P = t === X, N = e === "LOCKED", D = q(e, t, f), { state: g, renderAs: L } = D || {}, k = !(e === y || A.some((x) => x === e)) && !(w || C || R || h);
|
81
|
+
return /* @__PURE__ */ m(M, { children: /* @__PURE__ */ m(
|
83
82
|
H,
|
84
83
|
{
|
85
84
|
renderAs: "secondary",
|
86
85
|
position: "bottom",
|
87
|
-
tooltipItem:
|
86
|
+
tooltipItem: c,
|
88
87
|
textVariant: "ab3",
|
89
|
-
children: /* @__PURE__ */
|
90
|
-
|
88
|
+
children: /* @__PURE__ */ m(
|
89
|
+
j,
|
91
90
|
{
|
92
|
-
renderAs: L ?? (
|
93
|
-
label:
|
94
|
-
Icon:
|
95
|
-
onClick: () =>
|
96
|
-
disabled:
|
97
|
-
state:
|
91
|
+
renderAs: L ?? (i || !r && N ? "secondary_grey" : "primary"),
|
92
|
+
label: S,
|
93
|
+
Icon: P ? B : F,
|
94
|
+
onClick: () => v(s),
|
95
|
+
disabled: r && (i || k),
|
96
|
+
state: g
|
98
97
|
}
|
99
98
|
)
|
100
99
|
}
|
101
|
-
) }, `${
|
100
|
+
) }, `${S}__lesson_button__${E}`);
|
102
101
|
}) });
|
103
102
|
}
|
104
103
|
);
|
105
104
|
export {
|
106
|
-
|
105
|
+
ae as default
|
107
106
|
};
|
108
107
|
//# sourceMappingURL=lesson-item-cta-info.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lesson-item-cta-info.js","sources":["../../../../../src/features/sheets/lessons-list/lesson-item/lesson-item-cta-info.tsx"],"sourcesContent":["import type { TSheetButtonVariant } from '../../comps/sheet-button/types';\nimport type { ISheetDataProps } from '../../sheets-list/sheet-item/sheet-item-types';\nimport type { IGetLessonCtaInfo, ILessonItemCtaInfoProps } from './lesson-item-types';\nimport type { FC } from 'react';\n\nimport { Fragment, memo, useCallback, useMemo } from 'react';\n\nimport Bulb2Icon from '../../../../assets/line-icons/icons/bulb2';\nimport PracticeIcon from '../../../../assets/line-icons/icons/practice';\nimport { IS_CHAPTER_COMPLETED_STATES } from '../../../milestone/create/milestone-create-constants';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../../../ui/layout/flex-view';\nimport SheetButton from '../../comps/sheet-button';\nimport { NODE_TYPE, SHEET_STATE } from '../../constants/sheet';\
|
1
|
+
{"version":3,"file":"lesson-item-cta-info.js","sources":["../../../../../src/features/sheets/lessons-list/lesson-item/lesson-item-cta-info.tsx"],"sourcesContent":["import type { TSheetButtonVariant } from '../../comps/sheet-button/types';\nimport type { ISheetDataProps } from '../../sheets-list/sheet-item/sheet-item-types';\nimport type { IGetLessonCtaInfo, ILessonItemCtaInfoProps } from './lesson-item-types';\nimport type { FC } from 'react';\n\nimport { Fragment, memo, useCallback, useMemo } from 'react';\n\nimport Bulb2Icon from '../../../../assets/line-icons/icons/bulb2';\nimport PracticeIcon from '../../../../assets/line-icons/icons/practice';\nimport { IS_CHAPTER_COMPLETED_STATES } from '../../../milestone/create/milestone-create-constants';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../../../ui/layout/flex-view';\nimport SheetButton from '../../comps/sheet-button';\nimport { NODE_TYPE, SHEET_STATE } from '../../constants/sheet';\n\nconst { TARGET_PRACTICE, PRACTICE, LEARNING } = NODE_TYPE;\nconst { COMPLETED, IN_PROGRESS } = SHEET_STATE;\n\nconst getLessonCtaInfo: IGetLessonCtaInfo = (state, nodeType, lessonTagType) => {\n const isSheetCompleted =\n state === COMPLETED || IS_CHAPTER_COMPLETED_STATES.some(sheetState => sheetState === state);\n\n if (isSheetCompleted) {\n return {\n state: 'completed',\n renderAs: 'secondary_black',\n };\n }\n\n if (\n (nodeType === PRACTICE || nodeType === TARGET_PRACTICE) &&\n lessonTagType === 'PENDING_TARGET_PRACTICE'\n ) {\n return {\n state: 'overdue',\n renderAs: 'tertiary',\n };\n }\n\n if (state === IN_PROGRESS) {\n return {\n state: 'in_progress',\n renderAs: 'primary',\n };\n }\n\n return undefined;\n};\n\nconst LessonItemCtaInfo: FC<ILessonItemCtaInfoProps> = memo(\n ({ sheetsListData, userType, isLessonDisabled, ...restLessonItemCtaInfoProps }) => {\n const { lessonTagType, onStart, onResume, onReattempt, onReview, onPreview } =\n restLessonItemCtaInfoProps;\n\n const isStudent = useMemo(() => userType === 'STUDENT', [userType]);\n\n const handleOnClick = useCallback(\n (sheetInfo: ISheetDataProps) => {\n const { permissions, node_id: nodeId, user_node_id: userNodeId } = sheetInfo;\n const {\n can_start: canStart,\n can_resume: canResume,\n can_reattempt: canReattempt,\n can_review: canReview,\n can_teacher_review: canTeacherReview,\n } = permissions;\n const canReviewSheet = isStudent ? canReview : canTeacherReview;\n\n if (isStudent) {\n //* Student actions\n\n if (canStart || canResume) {\n if (canStart && typeof onStart === 'function') {\n onStart(nodeId, userNodeId);\n\n return;\n }\n\n if (canResume && typeof onResume === 'function') {\n onResume(nodeId, userNodeId);\n\n return;\n }\n\n throw new Error('No callback is available');\n } else if (canReattempt) {\n if (typeof onReattempt !== 'function') {\n throw new Error('canReattempt must be a function');\n }\n\n onReattempt(nodeId, userNodeId);\n\n return;\n }\n }\n\n if (canReviewSheet) {\n if (typeof onReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n\n onReview(userNodeId);\n\n return;\n }\n\n if (typeof onPreview !== 'function') {\n throw new Error('onPreview must be a function');\n }\n\n onPreview(sheetInfo);\n\n return;\n },\n [isStudent, onReview, onStart, onPreview, onReattempt, onResume],\n );\n\n return (\n <FlexView $flexDirection=\"row\" $flexGapX={1} $alignItems=\"center\">\n {sheetsListData.map((sheet, idx) => {\n const {\n node_type: nodeType,\n state,\n permissions,\n sheet_statement: sheetStatement,\n } = sheet;\n const {\n can_start: canStart,\n can_resume: canResume,\n can_reattempt: canReattempt,\n can_review: canReview,\n } = permissions;\n const sheetType = nodeType === TARGET_PRACTICE ? PRACTICE : nodeType;\n const isLearningNodeType = nodeType === LEARNING;\n const isSheetLocked = state === 'LOCKED';\n\n const lessonCtaInfo = getLessonCtaInfo(state, nodeType, lessonTagType);\n const { state: lessonCtaState, renderAs } = lessonCtaInfo || {};\n\n const isSheetCompleted =\n state === COMPLETED ||\n IS_CHAPTER_COMPLETED_STATES.some(sheetState => sheetState === state);\n const sheetPermissionDisability =\n !isSheetCompleted && !(canStart || canResume || canReview || canReattempt);\n const disableCta = isStudent && (isLessonDisabled || sheetPermissionDisability);\n const sheetCtaDefaultRenderAs: TSheetButtonVariant =\n isLessonDisabled || (!isStudent && isSheetLocked) ? 'secondary_grey' : 'primary';\n\n return (\n <Fragment key={`${sheetType}__lesson_button__${idx}`}>\n <ArrowTooltip\n renderAs=\"secondary\"\n position=\"bottom\"\n tooltipItem={sheetStatement}\n textVariant=\"ab3\"\n >\n <SheetButton\n renderAs={renderAs ?? sheetCtaDefaultRenderAs}\n label={sheetType}\n Icon={isLearningNodeType ? Bulb2Icon : PracticeIcon}\n onClick={() => handleOnClick(sheet)}\n disabled={disableCta}\n state={lessonCtaState}\n />\n </ArrowTooltip>\n </Fragment>\n );\n })}\n </FlexView>\n );\n },\n);\n\nexport default LessonItemCtaInfo;\n"],"names":["TARGET_PRACTICE","PRACTICE","LEARNING","NODE_TYPE","COMPLETED","IN_PROGRESS","SHEET_STATE","getLessonCtaInfo","state","nodeType","lessonTagType","IS_CHAPTER_COMPLETED_STATES","sheetState","LessonItemCtaInfo","memo","sheetsListData","userType","isLessonDisabled","restLessonItemCtaInfoProps","onStart","onResume","onReattempt","onReview","onPreview","isStudent","useMemo","handleOnClick","useCallback","sheetInfo","permissions","nodeId","userNodeId","canStart","canResume","canReattempt","canReview","canTeacherReview","canReviewSheet","jsx","FlexView","sheet","idx","sheetStatement","sheetType","isLearningNodeType","isSheetLocked","lessonCtaInfo","lessonCtaState","renderAs","sheetPermissionDisability","Fragment","ArrowTooltip","SheetButton","Bulb2Icon","PracticeIcon"],"mappings":";;;;;;;;;AAeA,MAAM,EAAE,iBAAAA,GAAiB,UAAAC,GAAU,UAAAC,EAAA,IAAaC,GAC1C,EAAE,WAAAC,GAAW,aAAAC,EAAgB,IAAAC,GAE7BC,IAAsC,CAACC,GAAOC,GAAUC,MAAkB;AAI9E,MAFEF,MAAUJ,KAAaO,EAA4B,KAAK,CAAAC,MAAcA,MAAeJ,CAAK;AAGnF,WAAA;AAAA,MACL,OAAO;AAAA,MACP,UAAU;AAAA,IAAA;AAId,OACGC,MAAaR,KAAYQ,MAAaT,MACvCU,MAAkB;AAEX,WAAA;AAAA,MACL,OAAO;AAAA,MACP,UAAU;AAAA,IAAA;AAId,MAAIF,MAAUH;AACL,WAAA;AAAA,MACL,OAAO;AAAA,MACP,UAAU;AAAA,IAAA;AAKhB,GAEMQ,KAAiDC;AAAA,EACrD,CAAC,EAAE,gBAAAC,GAAgB,UAAAC,GAAU,kBAAAC,GAAkB,GAAGC,QAAiC;AACjF,UAAM,EAAE,eAAAR,GAAe,SAAAS,GAAS,UAAAC,GAAU,aAAAC,GAAa,UAAAC,GAAU,WAAAC,EAC/D,IAAAL,GAEIM,IAAYC,EAAQ,MAAMT,MAAa,WAAW,CAACA,CAAQ,CAAC,GAE5DU,IAAgBC;AAAA,MACpB,CAACC,MAA+B;AAC9B,cAAM,EAAE,aAAAC,GAAa,SAASC,GAAQ,cAAcC,EAAe,IAAAH,GAC7D;AAAA,UACJ,WAAWI;AAAA,UACX,YAAYC;AAAA,UACZ,eAAeC;AAAA,UACf,YAAYC;AAAA,UACZ,oBAAoBC;AAAA,QAClB,IAAAP,GACEQ,IAAiBb,IAAYW,IAAYC;AAE/C,YAAIZ;AAGF,cAAIQ,KAAYC,GAAW;AAC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DG,IACJ,EAHAzC,MAAUJ,KACVO,EAA4B,KAAK,CAAAC,MAAcA,MAAeJ,CAAK,MAE9C,EAAEwB,KAAYC,KAAaE,KAAaD;AAK/D,+BACGgB,GACC,EAAA,UAAA,gBAAAZ;AAAA,QAACa;AAAA,QAAA;AAAA,UACC,UAAS;AAAA,UACT,UAAS;AAAA,UACT,aAAaT;AAAA,UACb,aAAY;AAAA,UAEZ,UAAA,gBAAAJ;AAAA,YAACc;AAAA,YAAA;AAAA,cACC,UAAUJ,MAXhB/B,KAAqB,CAACO,KAAaqB,IAAiB,mBAAmB;AAAA,cAYjE,OAAOF;AAAA,cACP,MAAMC,IAAqBS,IAAYC;AAAA,cACvC,SAAS,MAAM5B,EAAcc,CAAK;AAAA,cAClC,UAjBWhB,MAAcP,KAAoBgC;AAAA,cAkB7C,OAAOF;AAAA,YAAA;AAAA,UACT;AAAA,QAAA;AAAA,MAAA,EAdW,GAAA,GAAGJ,CAAS,oBAAoBF,CAAG,EAgBlD;AAAA,IAEH,CAAA,EACH,CAAA;AAAA,EAEJ;AACF;"}
|
@@ -1,85 +1,84 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
1
|
+
import { jsxs as $, jsx as e } from "react/jsx-runtime";
|
2
|
+
import { memo as z, useRef as J, useState as Q, useMemo as Z, useCallback as d, useLayoutEffect as ee } from "react";
|
3
|
+
import te from "../../../../assets/line-icons/icons/minus2.js";
|
4
|
+
import oe from "../../../../assets/line-icons/icons/plus2.js";
|
5
|
+
import re from "../../../../assets/line-icons/icons/redo.js";
|
6
6
|
import A from "../../../ui/arrow-tooltip/arrow-tooltip.js";
|
7
|
-
import
|
8
|
-
import { useUIContext as
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import { SHEETS_ANALYTICS_EVENTS as
|
13
|
-
import { TEACHER_MENU_OPTIONS as
|
14
|
-
import { isV3Worksheet as h } from "../../utils/is-v3-worksheet.js";
|
7
|
+
import ne from "../../../ui/context-menu/context-menu.js";
|
8
|
+
import { useUIContext as ie } from "../../../ui/context/context.js";
|
9
|
+
import ce from "../../../ui/layout/flex-view.js";
|
10
|
+
import se from "../../comps/sheet-button/index.js";
|
11
|
+
import ae from "../../lessons-list/lesson-item/context-menu-helper/target-element.js";
|
12
|
+
import { SHEETS_ANALYTICS_EVENTS as v } from "../../sheets-analytics-events.js";
|
13
|
+
import { TEACHER_MENU_OPTIONS as ue } from "../../sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions-constant.js";
|
15
14
|
import le from "./context-menu-helper/menu-element.js";
|
16
|
-
import { ResourceItemCard as
|
17
|
-
import { getResourceItemCtaState as
|
18
|
-
const { UNASSIGN: x, REDO: N } =
|
15
|
+
import { ResourceItemCard as me, ResourceItemTitle as pe, IconButtonWrapper as fe } from "./styled.js";
|
16
|
+
import { getResourceItemCtaState as de, getResourceItemCtaInfo as he, getResourceItemBackgroundColor as _e } from "./utils.js";
|
17
|
+
const { UNASSIGN: x, REDO: N } = ue, Oe = z(
|
19
18
|
({
|
20
19
|
sheet: t,
|
21
|
-
userType:
|
22
|
-
isMilestoneWidget:
|
20
|
+
userType: k,
|
21
|
+
isMilestoneWidget: h,
|
23
22
|
userMilestoneId: _,
|
24
23
|
onUnlock: i,
|
25
24
|
onUnAssignSheet: u,
|
26
|
-
onReset:
|
27
|
-
onPreview:
|
25
|
+
onReset: l,
|
26
|
+
onPreview: m,
|
28
27
|
onReview: p,
|
29
28
|
onStart: f
|
30
29
|
}) => {
|
31
|
-
const { onClick: c } =
|
32
|
-
accuracy:
|
33
|
-
permissions:
|
34
|
-
title:
|
35
|
-
sheet_statement:
|
36
|
-
state:
|
30
|
+
const { onClick: c } = ie(), r = J(null), [O, D] = Q(!1), {
|
31
|
+
accuracy: w,
|
32
|
+
permissions: M,
|
33
|
+
title: b,
|
34
|
+
sheet_statement: X,
|
35
|
+
state: C,
|
37
36
|
node_id: o,
|
38
37
|
user_node_id: s,
|
39
|
-
node_sub_group:
|
40
|
-
node_type:
|
38
|
+
node_sub_group: j,
|
39
|
+
node_type: E
|
41
40
|
} = t, {
|
42
|
-
can_start:
|
43
|
-
can_resume:
|
44
|
-
can_unlock:
|
45
|
-
can_review:
|
46
|
-
can_teacher_review:
|
47
|
-
can_unassign:
|
48
|
-
can_reset:
|
49
|
-
} =
|
41
|
+
can_start: y,
|
42
|
+
can_resume: I,
|
43
|
+
can_unlock: S,
|
44
|
+
can_review: G,
|
45
|
+
can_teacher_review: H,
|
46
|
+
can_unassign: L,
|
47
|
+
can_reset: B
|
48
|
+
} = M, U = typeof w == "number" ? `${w}%` : void 0, n = k === "STUDENT", g = n ? G : H, P = de(C), { label: V, Icon: F } = he(j) || {}, a = Z(
|
50
49
|
() => ({
|
51
50
|
node_id: o,
|
52
|
-
node_type:
|
51
|
+
node_type: E
|
53
52
|
}),
|
54
|
-
[o,
|
53
|
+
[o, E]
|
55
54
|
), K = d(() => {
|
56
55
|
c({
|
57
|
-
analyticsLabel:
|
56
|
+
analyticsLabel: v.RESOURCE_ASSIGNED,
|
58
57
|
props: a
|
59
58
|
}), i == null || i(o);
|
60
|
-
}, [i, o, c, a]),
|
61
|
-
if (n && (
|
59
|
+
}, [i, o, c, a]), W = d(() => {
|
60
|
+
if (n && (y || I)) {
|
62
61
|
if (typeof f == "function") {
|
63
|
-
f(o,
|
62
|
+
f(o, s);
|
64
63
|
return;
|
65
64
|
}
|
66
65
|
throw new Error("No callback is available");
|
67
66
|
}
|
68
|
-
if (
|
67
|
+
if (g) {
|
69
68
|
if (typeof p != "function")
|
70
69
|
throw new Error("onReview must be a function");
|
71
70
|
if (!s)
|
72
71
|
throw new Error("user node id must be present to review the sheet");
|
73
|
-
p(s,
|
72
|
+
p(s, _);
|
74
73
|
return;
|
75
74
|
}
|
76
|
-
if (typeof
|
75
|
+
if (typeof m != "function")
|
77
76
|
throw new Error("onPreview must be a function");
|
78
|
-
|
77
|
+
m(t);
|
79
78
|
}, [
|
80
|
-
S,
|
81
|
-
R,
|
82
79
|
I,
|
80
|
+
g,
|
81
|
+
y,
|
83
82
|
n,
|
84
83
|
o,
|
85
84
|
t,
|
@@ -87,104 +86,104 @@ const { UNASSIGN: x, REDO: N } = me, Me = J(
|
|
87
86
|
s,
|
88
87
|
f,
|
89
88
|
p,
|
90
|
-
|
91
|
-
]),
|
92
|
-
(
|
93
|
-
switch (
|
89
|
+
m
|
90
|
+
]), R = d(
|
91
|
+
(q) => {
|
92
|
+
switch (q) {
|
94
93
|
case x:
|
95
94
|
if (typeof u != "function")
|
96
95
|
throw new Error("onUnassignSheet must be a function");
|
97
96
|
c({
|
98
|
-
analyticsLabel:
|
97
|
+
analyticsLabel: v.RESOURCE_UNASSIGNED,
|
99
98
|
props: a
|
100
99
|
}), u(t);
|
101
100
|
return;
|
102
101
|
case N:
|
103
|
-
if (typeof
|
102
|
+
if (typeof l != "function")
|
104
103
|
throw new Error("onReset must be a function");
|
105
|
-
|
104
|
+
l(t);
|
106
105
|
return;
|
107
106
|
}
|
108
107
|
},
|
109
|
-
[t, u,
|
108
|
+
[t, u, l, a, c]
|
110
109
|
);
|
111
|
-
|
112
|
-
r.current && r.current.scrollHeight > r.current.clientHeight &&
|
110
|
+
ee(() => {
|
111
|
+
r.current && r.current.scrollHeight > r.current.clientHeight && D(!0);
|
113
112
|
}, [r]);
|
114
|
-
const
|
113
|
+
const Y = [
|
115
114
|
{
|
116
115
|
id: "supplementary_resources_unassign",
|
117
116
|
label: "Unassign",
|
118
|
-
icon: /* @__PURE__ */ e(
|
117
|
+
icon: /* @__PURE__ */ e(te, { width: 20, height: 20 }),
|
119
118
|
option: x,
|
120
|
-
visible:
|
121
|
-
onClick:
|
119
|
+
visible: L,
|
120
|
+
onClick: R
|
122
121
|
},
|
123
122
|
{
|
124
123
|
id: "supplementary_resources_redo",
|
125
124
|
label: "Redo",
|
126
|
-
icon: /* @__PURE__ */ e(
|
125
|
+
icon: /* @__PURE__ */ e(re, {}),
|
127
126
|
option: N,
|
128
|
-
visible:
|
129
|
-
onClick:
|
127
|
+
visible: B,
|
128
|
+
onClick: R
|
130
129
|
}
|
131
|
-
],
|
132
|
-
|
130
|
+
], T = _e(
|
131
|
+
C,
|
133
132
|
n,
|
134
|
-
|
135
|
-
!!
|
133
|
+
S,
|
134
|
+
!!h
|
136
135
|
);
|
137
|
-
return /* @__PURE__ */
|
138
|
-
|
136
|
+
return /* @__PURE__ */ $(
|
137
|
+
me,
|
139
138
|
{
|
140
139
|
$gapX: 1,
|
141
140
|
$gutterX: 1,
|
142
141
|
$flexGapX: 1.25,
|
143
|
-
$background:
|
142
|
+
$background: T,
|
144
143
|
$justifyContent: "space-between",
|
145
144
|
$heightX: 8,
|
146
|
-
$isMilestoneWidget:
|
145
|
+
$isMilestoneWidget: h,
|
147
146
|
children: [
|
148
147
|
/* @__PURE__ */ e(
|
149
148
|
A,
|
150
149
|
{
|
151
150
|
renderAs: "primary",
|
152
151
|
position: "bottom",
|
153
|
-
tooltipItem:
|
154
|
-
hidden: !
|
152
|
+
tooltipItem: b,
|
153
|
+
hidden: !O,
|
155
154
|
widthX: 21.75,
|
156
|
-
children: /* @__PURE__ */ e(
|
155
|
+
children: /* @__PURE__ */ e(pe, { ref: r, $renderAs: "ab2", $color: "BLACK_T_87", children: b })
|
157
156
|
}
|
158
157
|
),
|
159
|
-
/* @__PURE__ */
|
160
|
-
/* @__PURE__ */ e(A, { position: "bottom", tooltipItem:
|
161
|
-
|
158
|
+
/* @__PURE__ */ $(ce, { $flexDirection: "row", $justifyContent: "space-between", $alignItems: "center", children: [
|
159
|
+
/* @__PURE__ */ e(A, { position: "bottom", tooltipItem: X, renderAs: "secondary", children: /* @__PURE__ */ e(
|
160
|
+
se,
|
162
161
|
{
|
163
162
|
renderAs: "primary",
|
164
|
-
label:
|
163
|
+
label: V ?? "",
|
165
164
|
Icon: F,
|
166
|
-
backgroundColor:
|
165
|
+
backgroundColor: T,
|
167
166
|
state: P,
|
168
167
|
hoverActive: !1,
|
169
|
-
onClick:
|
170
|
-
accuracy:
|
168
|
+
onClick: W,
|
169
|
+
accuracy: U,
|
171
170
|
widthX: 8.5
|
172
171
|
}
|
173
172
|
) }),
|
174
|
-
!n && (
|
175
|
-
|
173
|
+
!n && (S ? /* @__PURE__ */ e(
|
174
|
+
fe,
|
176
175
|
{
|
177
176
|
$flexDirection: "row",
|
178
177
|
$alignItems: "center",
|
179
178
|
$justifyContent: "center",
|
180
179
|
onClick: K,
|
181
|
-
children: /* @__PURE__ */ e(
|
180
|
+
children: /* @__PURE__ */ e(oe, {})
|
182
181
|
}
|
183
182
|
) : /* @__PURE__ */ e(
|
184
|
-
|
183
|
+
ne,
|
185
184
|
{
|
186
|
-
targetElement: /* @__PURE__ */ e(
|
187
|
-
menuElement: /* @__PURE__ */ e(le, { menuOptions:
|
185
|
+
targetElement: /* @__PURE__ */ e(ae, { invertHover: !0 }),
|
186
|
+
menuElement: /* @__PURE__ */ e(le, { menuOptions: Y })
|
188
187
|
}
|
189
188
|
))
|
190
189
|
] })
|
@@ -194,6 +193,6 @@ const { UNASSIGN: x, REDO: N } = me, Me = J(
|
|
194
193
|
}
|
195
194
|
);
|
196
195
|
export {
|
197
|
-
|
196
|
+
Oe as default
|
198
197
|
};
|
199
198
|
//# sourceMappingURL=resource-item.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"resource-item.js","sources":["../../../../../src/features/sheets/resources-list/resource-item/resource-item.tsx"],"sourcesContent":["import type { IMenuOptionsProps } from './context-menu-helper/menu-element-types';\nimport type { IResourceItemProps } from './types';\nimport type { FC } from 'react';\n\nimport { useCallback, useLayoutEffect, useRef, memo, useState, useMemo } from 'react';\n\nimport Minus2Icon from '../../../../assets/line-icons/icons/minus2';\nimport Plus2Icon from '../../../../assets/line-icons/icons/plus2';\nimport RedoIcon from '../../../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport ContextMenu from '../../../ui/context-menu/context-menu';\nimport { useUIContext } from '../../../ui/context/context';\nimport FlexView from '../../../ui/layout/flex-view';\nimport SheetButton from '../../comps/sheet-button';\nimport ContextMenuTargetElement from '../../lessons-list/lesson-item/context-menu-helper/target-element';\nimport { SHEETS_ANALYTICS_EVENTS } from '../../sheets-analytics-events';\nimport { TEACHER_MENU_OPTIONS } from '../../sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions-constant';\nimport { isV3Worksheet } from '../../utils/is-v3-worksheet';\nimport ContextMenuElement from './context-menu-helper/menu-element';\nimport * as Styled from './styled';\nimport {\n getResourceItemBackgroundColor,\n getResourceItemCtaInfo,\n getResourceItemCtaState,\n} from './utils';\n\nconst { UNASSIGN, REDO } = TEACHER_MENU_OPTIONS;\n\nconst ResourceItem: FC<IResourceItemProps> = memo(\n ({\n sheet,\n userType,\n isMilestoneWidget,\n userMilestoneId,\n onUnlock,\n onUnAssignSheet,\n onReset,\n onPreview,\n onReview,\n onStart,\n }) => {\n const { onClick: trackClick } = useUIContext();\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const {\n accuracy,\n permissions,\n title,\n sheet_statement: sheetStatement,\n state: sheetState,\n node_id: nodeId,\n user_node_id: userNodeId,\n node_sub_group: nodeSubGroup,\n node_type: nodeType,\n } = sheet;\n const {\n can_start: canStart,\n can_resume: canResume,\n can_unlock: canUnlock,\n can_review: canReview,\n can_teacher_review: canTeacherReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n } = permissions;\n\n const sheetAccuracy = typeof accuracy === 'number' ? `${accuracy}%` : undefined;\n const isStudent = userType === 'STUDENT';\n const canReviewSheet = isStudent ? canReview : canTeacherReview;\n\n const ctaState = getResourceItemCtaState(sheetState);\n const { label, Icon } = getResourceItemCtaInfo(nodeSubGroup) || {};\n\n const analyticsProps = useMemo(\n () => ({\n node_id: nodeId,\n node_type: nodeType,\n }),\n [nodeId, nodeType],\n );\n\n const handleAssignSheet = useCallback(() => {\n trackClick({\n analyticsLabel: SHEETS_ANALYTICS_EVENTS.RESOURCE_ASSIGNED,\n props: analyticsProps,\n });\n\n onUnlock?.(nodeId);\n }, [onUnlock, nodeId, trackClick, analyticsProps]);\n\n const handleOnClick = useCallback(() => {\n if (isStudent && (canStart || canResume)) {\n if (typeof onStart === 'function') {\n onStart(nodeId, isV3Worksheet(sheet), userNodeId);\n\n return;\n }\n\n throw new Error('No callback is available');\n }\n\n if (canReviewSheet) {\n if (typeof onReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n\n onReview(userNodeId, isV3Worksheet(sheet, 'review'), userMilestoneId);\n\n return;\n }\n\n if (typeof onPreview !== 'function') {\n throw new Error('onPreview must be a function');\n }\n\n onPreview(sheet, isV3Worksheet(sheet));\n }, [\n canResume,\n canReviewSheet,\n canStart,\n isStudent,\n nodeId,\n sheet,\n userMilestoneId,\n userNodeId,\n onStart,\n onReview,\n onPreview,\n ]);\n\n const handleMenuOptionClick = useCallback(\n (selectedOption: string) => {\n switch (selectedOption) {\n case UNASSIGN:\n if (typeof onUnAssignSheet !== 'function') {\n throw new Error('onUnassignSheet must be a function');\n }\n\n trackClick({\n analyticsLabel: SHEETS_ANALYTICS_EVENTS.RESOURCE_UNASSIGNED,\n props: analyticsProps,\n });\n\n onUnAssignSheet(sheet);\n\n return;\n\n case REDO:\n if (typeof onReset !== 'function') {\n throw new Error('onReset must be a function');\n }\n\n onReset(sheet);\n\n return;\n }\n },\n [sheet, onUnAssignSheet, onReset, analyticsProps, trackClick],\n );\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n const menuOptions: IMenuOptionsProps[] = [\n {\n id: 'supplementary_resources_unassign',\n label: 'Unassign',\n icon: <Minus2Icon width={20} height={20} />,\n option: UNASSIGN,\n visible: canUnassign,\n onClick: handleMenuOptionClick,\n },\n {\n id: 'supplementary_resources_redo',\n label: 'Redo',\n icon: <RedoIcon />,\n option: REDO,\n visible: canReset,\n onClick: handleMenuOptionClick,\n },\n ];\n\n const backgroundColor = getResourceItemBackgroundColor(\n sheetState,\n isStudent,\n canUnlock,\n !!isMilestoneWidget,\n );\n\n return (\n <Styled.ResourceItemCard\n $gapX={1}\n $gutterX={1}\n $flexGapX={1.25}\n $background={backgroundColor}\n $justifyContent=\"space-between\"\n $heightX={8}\n $isMilestoneWidget={isMilestoneWidget}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={title}\n hidden={!showTitleTooltip}\n widthX={21.75}\n >\n <Styled.ResourceItemTitle ref={titleTextRef} $renderAs=\"ab2\" $color=\"BLACK_T_87\">\n {title}\n </Styled.ResourceItemTitle>\n </ArrowTooltip>\n\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $alignItems=\"center\">\n <ArrowTooltip position=\"bottom\" tooltipItem={sheetStatement} renderAs=\"secondary\">\n <SheetButton\n renderAs=\"primary\"\n label={label ?? ''}\n Icon={Icon}\n backgroundColor={backgroundColor}\n state={ctaState}\n hoverActive={false}\n onClick={handleOnClick}\n accuracy={sheetAccuracy}\n widthX={8.5}\n />\n </ArrowTooltip>\n\n {!isStudent &&\n (canUnlock ? (\n <Styled.IconButtonWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n onClick={handleAssignSheet}\n >\n <Plus2Icon />\n </Styled.IconButtonWrapper>\n ) : (\n <ContextMenu\n targetElement={<ContextMenuTargetElement invertHover />}\n menuElement={<ContextMenuElement menuOptions={menuOptions} />}\n />\n ))}\n </FlexView>\n </Styled.ResourceItemCard>\n );\n },\n);\n\nexport default ResourceItem;\n"],"names":["UNASSIGN","REDO","TEACHER_MENU_OPTIONS","ResourceItem","memo","sheet","userType","isMilestoneWidget","userMilestoneId","onUnlock","onUnAssignSheet","onReset","onPreview","onReview","onStart","trackClick","useUIContext","titleTextRef","useRef","showTitleTooltip","setShowTitleTooltip","useState","accuracy","permissions","title","sheetStatement","sheetState","nodeId","userNodeId","nodeSubGroup","nodeType","canStart","canResume","canUnlock","canReview","canTeacherReview","canUnassign","canReset","sheetAccuracy","isStudent","canReviewSheet","ctaState","getResourceItemCtaState","label","Icon","getResourceItemCtaInfo","analyticsProps","useMemo","handleAssignSheet","useCallback","SHEETS_ANALYTICS_EVENTS","handleOnClick","isV3Worksheet","handleMenuOptionClick","selectedOption","useLayoutEffect","menuOptions","jsx","Minus2Icon","RedoIcon","backgroundColor","getResourceItemBackgroundColor","jsxs","Styled.ResourceItemCard","ArrowTooltip","Styled.ResourceItemTitle","FlexView","SheetButton","Styled.IconButtonWrapper","Plus2Icon","ContextMenu","ContextMenuTargetElement","ContextMenuElement"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,MAAM,EAAE,UAAAA,GAAU,MAAAC,EAAS,IAAAC,IAErBC,KAAuCC;AAAA,EAC3C,CAAC;AAAA,IACC,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,MACI;AACJ,UAAM,EAAE,SAASC,EAAW,IAAIC,GAAa,GACvCC,IAAeC,EAAuB,IAAI,GAC1C,CAACC,GAAkBC,CAAmB,IAAIC,EAAS,EAAK,GAExD;AAAA,MACJ,UAAAC;AAAA,MACA,aAAAC;AAAA,MACA,OAAAC;AAAA,MACA,iBAAiBC;AAAA,MACjB,OAAOC;AAAA,MACP,SAASC;AAAA,MACT,cAAcC;AAAA,MACd,gBAAgBC;AAAA,MAChB,WAAWC;AAAA,IACT,IAAAzB,GACE;AAAA,MACJ,WAAW0B;AAAA,MACX,YAAYC;AAAA,MACZ,YAAYC;AAAA,MACZ,YAAYC;AAAA,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AA,IAAA;AAAA,EAGN;AACF;"}
|
1
|
+
{"version":3,"file":"resource-item.js","sources":["../../../../../src/features/sheets/resources-list/resource-item/resource-item.tsx"],"sourcesContent":["import type { IMenuOptionsProps } from './context-menu-helper/menu-element-types';\nimport type { IResourceItemProps } from './types';\nimport type { FC } from 'react';\n\nimport { useCallback, useLayoutEffect, useRef, memo, useState, useMemo } from 'react';\n\nimport Minus2Icon from '../../../../assets/line-icons/icons/minus2';\nimport Plus2Icon from '../../../../assets/line-icons/icons/plus2';\nimport RedoIcon from '../../../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport ContextMenu from '../../../ui/context-menu/context-menu';\nimport { useUIContext } from '../../../ui/context/context';\nimport FlexView from '../../../ui/layout/flex-view';\nimport SheetButton from '../../comps/sheet-button';\nimport ContextMenuTargetElement from '../../lessons-list/lesson-item/context-menu-helper/target-element';\nimport { SHEETS_ANALYTICS_EVENTS } from '../../sheets-analytics-events';\nimport { TEACHER_MENU_OPTIONS } from '../../sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions-constant';\nimport ContextMenuElement from './context-menu-helper/menu-element';\nimport * as Styled from './styled';\nimport {\n getResourceItemBackgroundColor,\n getResourceItemCtaInfo,\n getResourceItemCtaState,\n} from './utils';\n\nconst { UNASSIGN, REDO } = TEACHER_MENU_OPTIONS;\n\nconst ResourceItem: FC<IResourceItemProps> = memo(\n ({\n sheet,\n userType,\n isMilestoneWidget,\n userMilestoneId,\n onUnlock,\n onUnAssignSheet,\n onReset,\n onPreview,\n onReview,\n onStart,\n }) => {\n const { onClick: trackClick } = useUIContext();\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const {\n accuracy,\n permissions,\n title,\n sheet_statement: sheetStatement,\n state: sheetState,\n node_id: nodeId,\n user_node_id: userNodeId,\n node_sub_group: nodeSubGroup,\n node_type: nodeType,\n } = sheet;\n const {\n can_start: canStart,\n can_resume: canResume,\n can_unlock: canUnlock,\n can_review: canReview,\n can_teacher_review: canTeacherReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n } = permissions;\n\n const sheetAccuracy = typeof accuracy === 'number' ? `${accuracy}%` : undefined;\n const isStudent = userType === 'STUDENT';\n const canReviewSheet = isStudent ? canReview : canTeacherReview;\n\n const ctaState = getResourceItemCtaState(sheetState);\n const { label, Icon } = getResourceItemCtaInfo(nodeSubGroup) || {};\n\n const analyticsProps = useMemo(\n () => ({\n node_id: nodeId,\n node_type: nodeType,\n }),\n [nodeId, nodeType],\n );\n\n const handleAssignSheet = useCallback(() => {\n trackClick({\n analyticsLabel: SHEETS_ANALYTICS_EVENTS.RESOURCE_ASSIGNED,\n props: analyticsProps,\n });\n\n onUnlock?.(nodeId);\n }, [onUnlock, nodeId, trackClick, analyticsProps]);\n\n const handleOnClick = useCallback(() => {\n if (isStudent && (canStart || canResume)) {\n if (typeof onStart === 'function') {\n onStart(nodeId, userNodeId);\n\n return;\n }\n\n throw new Error('No callback is available');\n }\n\n if (canReviewSheet) {\n if (typeof onReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n\n onReview(userNodeId, userMilestoneId);\n\n return;\n }\n\n if (typeof onPreview !== 'function') {\n throw new Error('onPreview must be a function');\n }\n\n onPreview(sheet);\n }, [\n canResume,\n canReviewSheet,\n canStart,\n isStudent,\n nodeId,\n sheet,\n userMilestoneId,\n userNodeId,\n onStart,\n onReview,\n onPreview,\n ]);\n\n const handleMenuOptionClick = useCallback(\n (selectedOption: string) => {\n switch (selectedOption) {\n case UNASSIGN:\n if (typeof onUnAssignSheet !== 'function') {\n throw new Error('onUnassignSheet must be a function');\n }\n\n trackClick({\n analyticsLabel: SHEETS_ANALYTICS_EVENTS.RESOURCE_UNASSIGNED,\n props: analyticsProps,\n });\n\n onUnAssignSheet(sheet);\n\n return;\n\n case REDO:\n if (typeof onReset !== 'function') {\n throw new Error('onReset must be a function');\n }\n\n onReset(sheet);\n\n return;\n }\n },\n [sheet, onUnAssignSheet, onReset, analyticsProps, trackClick],\n );\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n const menuOptions: IMenuOptionsProps[] = [\n {\n id: 'supplementary_resources_unassign',\n label: 'Unassign',\n icon: <Minus2Icon width={20} height={20} />,\n option: UNASSIGN,\n visible: canUnassign,\n onClick: handleMenuOptionClick,\n },\n {\n id: 'supplementary_resources_redo',\n label: 'Redo',\n icon: <RedoIcon />,\n option: REDO,\n visible: canReset,\n onClick: handleMenuOptionClick,\n },\n ];\n\n const backgroundColor = getResourceItemBackgroundColor(\n sheetState,\n isStudent,\n canUnlock,\n !!isMilestoneWidget,\n );\n\n return (\n <Styled.ResourceItemCard\n $gapX={1}\n $gutterX={1}\n $flexGapX={1.25}\n $background={backgroundColor}\n $justifyContent=\"space-between\"\n $heightX={8}\n $isMilestoneWidget={isMilestoneWidget}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={title}\n hidden={!showTitleTooltip}\n widthX={21.75}\n >\n <Styled.ResourceItemTitle ref={titleTextRef} $renderAs=\"ab2\" $color=\"BLACK_T_87\">\n {title}\n </Styled.ResourceItemTitle>\n </ArrowTooltip>\n\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $alignItems=\"center\">\n <ArrowTooltip position=\"bottom\" tooltipItem={sheetStatement} renderAs=\"secondary\">\n <SheetButton\n renderAs=\"primary\"\n label={label ?? ''}\n Icon={Icon}\n backgroundColor={backgroundColor}\n state={ctaState}\n hoverActive={false}\n onClick={handleOnClick}\n accuracy={sheetAccuracy}\n widthX={8.5}\n />\n </ArrowTooltip>\n\n {!isStudent &&\n (canUnlock ? (\n <Styled.IconButtonWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n onClick={handleAssignSheet}\n >\n <Plus2Icon />\n </Styled.IconButtonWrapper>\n ) : (\n <ContextMenu\n targetElement={<ContextMenuTargetElement invertHover />}\n menuElement={<ContextMenuElement menuOptions={menuOptions} />}\n />\n ))}\n </FlexView>\n </Styled.ResourceItemCard>\n );\n },\n);\n\nexport default ResourceItem;\n"],"names":["UNASSIGN","REDO","TEACHER_MENU_OPTIONS","ResourceItem","memo","sheet","userType","isMilestoneWidget","userMilestoneId","onUnlock","onUnAssignSheet","onReset","onPreview","onReview","onStart","trackClick","useUIContext","titleTextRef","useRef","showTitleTooltip","setShowTitleTooltip","useState","accuracy","permissions","title","sheetStatement","sheetState","nodeId","userNodeId","nodeSubGroup","nodeType","canStart","canResume","canUnlock","canReview","canTeacherReview","canUnassign","canReset","sheetAccuracy","isStudent","canReviewSheet","ctaState","getResourceItemCtaState","label","Icon","getResourceItemCtaInfo","analyticsProps","useMemo","handleAssignSheet","useCallback","SHEETS_ANALYTICS_EVENTS","handleOnClick","handleMenuOptionClick","selectedOption","useLayoutEffect","menuOptions","jsx","Minus2Icon","RedoIcon","backgroundColor","getResourceItemBackgroundColor","jsxs","Styled.ResourceItemCard","ArrowTooltip","Styled.ResourceItemTitle","FlexView","SheetButton","Styled.IconButtonWrapper","Plus2Icon","ContextMenu","ContextMenuTargetElement","ContextMenuElement"],"mappings":";;;;;;;;;;;;;;;;AAyBA,MAAM,EAAE,UAAAA,GAAU,MAAAC,EAAS,IAAAC,IAErBC,KAAuCC;AAAA,EAC3C,CAAC;AAAA,IACC,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,MACI;AACJ,UAAM,EAAE,SAASC,EAAW,IAAIC,GAAa,GACvCC,IAAeC,EAAuB,IAAI,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