@cuemath/leap 2.9.0 → 2.9.1-j1
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 +3 -0
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/apple-icon.js +48 -0
- package/dist/assets/line-icons/icons/apple-icon.js.map +1 -0
- package/dist/assets/line-icons/icons/google-icon.js +42 -0
- package/dist/assets/line-icons/icons/google-icon.js.map +1 -0
- package/dist/assets/lottie/lottie.js +11 -1
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/auth/account-selector/account-selector-styled.js +26 -0
- package/dist/features/auth/account-selector/account-selector-styled.js.map +1 -0
- package/dist/features/auth/account-selector/account-selector.js +75 -0
- package/dist/features/auth/account-selector/account-selector.js.map +1 -0
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styles.js +12 -0
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styles.js.map +1 -0
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +11 -0
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -0
- package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js +24 -0
- package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js.map +1 -0
- package/dist/features/auth/comps/overlay-loader/overlay-loader-styled.js +29 -0
- package/dist/features/auth/comps/overlay-loader/overlay-loader-styled.js.map +1 -0
- package/dist/features/auth/comps/overlay-loader/overlay-loader.js +8 -0
- package/dist/features/auth/comps/overlay-loader/overlay-loader.js.map +1 -0
- package/dist/features/auth/comps/resend-otp/otp-timer/otp-timer.js +26 -0
- package/dist/features/auth/comps/resend-otp/otp-timer/otp-timer.js.map +1 -0
- package/dist/features/auth/comps/resend-otp/resend-otp.js +41 -0
- package/dist/features/auth/comps/resend-otp/resend-otp.js.map +1 -0
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper-styled.js +48 -0
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper-styled.js.map +1 -0
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js +115 -0
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js.map +1 -0
- package/dist/features/auth/signup/claim-user-account/claim-user-account-styled.js +16 -0
- package/dist/features/auth/signup/claim-user-account/claim-user-account-styled.js.map +1 -0
- package/dist/features/auth/signup/claim-user-account/claim-user-account.js +71 -0
- package/dist/features/auth/signup/claim-user-account/claim-user-account.js.map +1 -0
- package/dist/features/auth/signup/custom-input/custom-input-styled.js +38 -0
- package/dist/features/auth/signup/custom-input/custom-input-styled.js.map +1 -0
- package/dist/features/auth/signup/custom-input/date-picker-input/date-picker-input-styled.js +79 -0
- package/dist/features/auth/signup/custom-input/date-picker-input/date-picker-input-styled.js.map +1 -0
- package/dist/features/auth/signup/custom-input/date-picker-input/date-picker-input.js +54 -0
- package/dist/features/auth/signup/custom-input/date-picker-input/date-picker-input.js.map +1 -0
- package/dist/features/auth/signup/custom-input/email-input/email-input.js +30 -0
- package/dist/features/auth/signup/custom-input/email-input/email-input.js.map +1 -0
- package/dist/features/auth/signup/custom-input/grade-input/grade-input-styled.js +31 -0
- package/dist/features/auth/signup/custom-input/grade-input/grade-input-styled.js.map +1 -0
- package/dist/features/auth/signup/custom-input/grade-input/grade-input.js +30 -0
- package/dist/features/auth/signup/custom-input/grade-input/grade-input.js.map +1 -0
- package/dist/features/auth/signup/custom-input/input-wrapper/input-wrapper-styled.js +19 -0
- package/dist/features/auth/signup/custom-input/input-wrapper/input-wrapper-styled.js.map +1 -0
- package/dist/features/auth/signup/custom-input/input-wrapper/input-wrapper.js +33 -0
- package/dist/features/auth/signup/custom-input/input-wrapper/input-wrapper.js.map +1 -0
- package/dist/features/auth/signup/custom-input/otp-input/otp-input.js +41 -0
- package/dist/features/auth/signup/custom-input/otp-input/otp-input.js.map +1 -0
- package/dist/features/auth/signup/custom-input/phone-input/country-selector/country-code-button.js +33 -0
- package/dist/features/auth/signup/custom-input/phone-input/country-selector/country-code-button.js.map +1 -0
- package/dist/features/auth/signup/custom-input/phone-input/country-selector/country-list-menu.js +28 -0
- package/dist/features/auth/signup/custom-input/phone-input/country-selector/country-list-menu.js.map +1 -0
- package/dist/features/auth/signup/custom-input/phone-input/phone-input-styled.js +29 -0
- package/dist/features/auth/signup/custom-input/phone-input/phone-input-styled.js.map +1 -0
- package/dist/features/auth/signup/custom-input/phone-input/phone-input.js +64 -0
- package/dist/features/auth/signup/custom-input/phone-input/phone-input.js.map +1 -0
- package/dist/features/auth/signup/custom-input/student-password/student-password.js +53 -0
- package/dist/features/auth/signup/custom-input/student-password/student-password.js.map +1 -0
- package/dist/features/auth/signup/custom-input/student-username/student-username.js +38 -0
- package/dist/features/auth/signup/custom-input/student-username/student-username.js.map +1 -0
- package/dist/features/auth/signup/signup-constants.js +1022 -0
- package/dist/features/auth/signup/signup-constants.js.map +1 -0
- package/dist/features/auth/signup/signup-methods/signup-methods.js +58 -0
- package/dist/features/auth/signup/signup-methods/signup-methods.js.map +1 -0
- package/dist/features/auth/signup/user-type-selector/user-type-card/user-type-card-styled.js +19 -0
- package/dist/features/auth/signup/user-type-selector/user-type-card/user-type-card-styled.js.map +1 -0
- package/dist/features/auth/signup/user-type-selector/user-type-card/user-type-card.js +61 -0
- package/dist/features/auth/signup/user-type-selector/user-type-card/user-type-card.js.map +1 -0
- package/dist/features/auth/signup/user-type-selector/user-type-selector-styled.js +24 -0
- package/dist/features/auth/signup/user-type-selector/user-type-selector-styled.js.map +1 -0
- package/dist/features/auth/signup/user-type-selector/user-type-selector.js +87 -0
- package/dist/features/auth/signup/user-type-selector/user-type-selector.js.map +1 -0
- package/dist/features/chapters/lpar-chapter/block-section/sheet-item/rewards-n-actions/student-actions/student-actions.js +46 -45
- 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 +26 -25
- 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 +8 -9
- 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 +60 -59
- 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 +90 -89
- 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 +61 -60
- 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 +64 -63
- 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 +14 -4
- package/dist/features/sheets/utils/is-v3-worksheet.js.map +1 -1
- package/dist/features/ui/context-menu/context-menu.js +20 -18
- 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 +6 -5
- package/dist/features/ui/lottie-animation/helper.js.map +1 -1
- package/dist/features/ui/lottie-animation/lottie-animation.js +37 -28
- package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
- package/dist/features/ui/text/text.js +29 -27
- package/dist/features/ui/text/text.js.map +1 -1
- package/dist/index.d.ts +186 -11
- package/dist/index.js +406 -373
- package/dist/index.js.map +1 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +332 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +370 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.js +252 -0
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.js.map +1 -0
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +24 -0
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js.map +1 -0
- package/dist/node_modules/@floating-ui/react/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +192 -0
- package/dist/node_modules/@floating-ui/react/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +1 -0
- package/dist/node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +19 -0
- package/dist/node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +129 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +129 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
- package/dist/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/date-fns/subYears.js +9 -0
- package/dist/node_modules/date-fns/subYears.js.map +1 -0
- package/dist/node_modules/react-datepicker/dist/index.es.js +2700 -0
- package/dist/node_modules/react-datepicker/dist/index.es.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/addLeadingZeros.js +8 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/addLeadingZeros.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/defaultOptions.js +8 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/defaultOptions.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/formatters.js +518 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/formatters.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/lightFormatters.js +60 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/lightFormatters.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/longFormatters.js +53 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/longFormatters.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +19 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/normalizeDates.js +12 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/normalizeDates.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/protectedTokens.js +21 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/protectedTokens.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addDays.js +11 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addDays.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addHours.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addHours.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addMilliseconds.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addMilliseconds.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addMinutes.js +11 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addMinutes.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addMonths.js +21 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addMonths.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addQuarters.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addQuarters.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addSeconds.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addSeconds.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addWeeks.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addWeeks.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addYears.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/addYears.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/constants.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/constants.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/constructFrom.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/constructFrom.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarDays.js +17 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarDays.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarMonths.js +14 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarMonths.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarQuarters.js +15 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarQuarters.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarYears.js +14 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarYears.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInDays.js +23 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInDays.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfDay.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfDay.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfMonth.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfMonth.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfWeek.js +12 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfWeek.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfYear.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfYear.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/format.js +60 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/format.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDate.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDate.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDay.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDay.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDayOfYear.js +12 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDayOfYear.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDaysInMonth.js +11 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDaysInMonth.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDefaultOptions.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getDefaultOptions.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getHours.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getHours.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getISODay.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getISODay.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getISOWeek.js +13 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getISOWeek.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getISOWeekYear.js +16 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getISOWeekYear.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getMinutes.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getMinutes.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getMonth.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getMonth.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getQuarter.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getQuarter.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getSeconds.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getSeconds.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getTime.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getTime.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getWeek.js +13 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getWeek.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getWeekYear.js +18 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getWeekYear.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getYear.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/getYear.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isAfter.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isAfter.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isBefore.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isBefore.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isDate.js +8 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isDate.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isEqual.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isEqual.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameDay.js +15 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameDay.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameMonth.js +14 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameMonth.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameQuarter.js +15 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameQuarter.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameYear.js +14 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameYear.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isValid.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isValid.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isWithinInterval.js +13 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/isWithinInterval.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildFormatLongFn.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +19 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildLocalizeFn.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildMatchFn.js +32 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildMatchFn.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +16 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +71 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatDistance.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatLong.js +34 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatLong.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +12 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatRelative.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/localize.js +156 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/localize.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/match.js +111 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/match.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US.js +22 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/max.js +15 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/max.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/min.js +15 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/min.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/Parser.js +23 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/Parser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/Setter.js +42 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/Setter.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/constants.js +50 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/constants.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js +50 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js +50 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DateParser.js +62 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DateParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js +52 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayParser.js +46 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js +50 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/EraParser.js +31 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/EraParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js +22 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js +23 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js +33 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js +33 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js +34 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js +34 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js +100 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js +49 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js +49 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js +50 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js +41 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js +75 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js +49 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js +70 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js +33 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/MonthParser.js +72 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/MonthParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js +71 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/SecondParser.js +33 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/SecondParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js +75 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js +72 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js +71 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js +23 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js +23 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/YearParser.js +50 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/YearParser.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers.js +68 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/utils.js +104 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/utils.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse.js +88 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parse.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parseISO.js +123 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/parseISO.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setDay.js +13 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setDay.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setHours.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setHours.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setISODay.js +12 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setISODay.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setISOWeek.js +11 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setISOWeek.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setMinutes.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setMinutes.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setMonth.js +14 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setMonth.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setQuarter.js +11 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setQuarter.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setSeconds.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setSeconds.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setWeek.js +11 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setWeek.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setYear.js +11 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/setYear.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfDay.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfDay.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfISOWeek.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfISOWeek.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfISOWeekYear.js +12 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfISOWeekYear.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfMonth.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfMonth.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfQuarter.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfQuarter.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfWeek.js +12 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfWeek.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfWeekYear.js +14 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfWeekYear.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfYear.js +10 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfYear.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subDays.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subDays.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subMonths.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subMonths.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subQuarters.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subQuarters.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subWeeks.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subWeeks.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subYears.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/subYears.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/toDate.js +9 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/toDate.js.map +1 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/transpose.js +19 -0
- package/dist/node_modules/react-datepicker/node_modules/date-fns/transpose.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/native.js +7 -0
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +3 -2
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +6 -10
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +12 -9
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/dist/static/avatar-selected.860ee923.json +1 -0
- package/dist/static/circle-cuemath-logo-white.e9fafb91.svg +1 -0
- package/dist/static/cuemath-app-qr-code.ba6cc09b.svg +1 -0
- package/dist/static/cuemath-app-qr-code.d0912fc7.png +0 -0
- package/dist/static/dob.9ce3c15b.json +1 -0
- package/dist/static/grade.b3730524.json +1 -0
- package/dist/static/key.d6846476.json +1 -0
- package/dist/static/mail.c30e8708.json +1 -0
- package/dist/static/otp.2d08f874.json +1 -0
- package/dist/static/otp.a3029760.json +1 -0
- package/dist/static/parent-avatar.772d53e0.json +1 -0
- package/dist/static/phone-number.0be312ea.json +1 -0
- package/dist/static/phone-number.84f55562.json +1 -0
- package/dist/static/student-avatar.524226bd.json +1 -0
- package/dist/static/user-type-selector-grid-bg.3c9c8ad6.svg +1 -0
- package/dist/static/user-type-selector-grid-bg.3ce8142d.svg +1 -0
- package/dist/static/user-type-selector-grid-bg.aad0b059.svg +1 -0
- package/dist/static/username.9e034d51.json +1 -0
- package/package.json +4 -5
- package/dist/library/polypad.js +0 -24965
- package/dist/library/polypad.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +0 -5
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +0 -8
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +0 -1
@@ -1,84 +1,85 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
1
|
+
import { jsxs as v, jsx as e } from "react/jsx-runtime";
|
2
|
+
import { memo as J, useRef as Q, useState as Z, useMemo as ee, useCallback as d, useLayoutEffect as te } from "react";
|
3
|
+
import oe from "../../../../assets/line-icons/icons/minus2.js";
|
4
|
+
import re from "../../../../assets/line-icons/icons/plus2.js";
|
5
|
+
import ne 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
|
7
|
+
import ie from "../../../ui/context-menu/context-menu.js";
|
8
|
+
import { useUIContext as ce } from "../../../ui/context/context.js";
|
9
|
+
import se from "../../../ui/layout/flex-view.js";
|
10
|
+
import ae from "../../comps/sheet-button/index.js";
|
11
|
+
import ue from "../../lessons-list/lesson-item/context-menu-helper/target-element.js";
|
12
|
+
import { SHEETS_ANALYTICS_EVENTS as k } from "../../sheets-analytics-events.js";
|
13
|
+
import { TEACHER_MENU_OPTIONS as me } from "../../sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions-constant.js";
|
14
|
+
import { isV3Worksheet as h } from "../../utils/is-v3-worksheet.js";
|
14
15
|
import le from "./context-menu-helper/menu-element.js";
|
15
|
-
import { ResourceItemCard as
|
16
|
-
import { getResourceItemCtaState as
|
17
|
-
const { UNASSIGN: x, REDO: N } =
|
16
|
+
import { ResourceItemCard as pe, ResourceItemTitle as fe, IconButtonWrapper as de } from "./styled.js";
|
17
|
+
import { getResourceItemCtaState as he, getResourceItemCtaInfo as we, getResourceItemBackgroundColor as _e } from "./utils.js";
|
18
|
+
const { UNASSIGN: x, REDO: N } = me, Me = J(
|
18
19
|
({
|
19
20
|
sheet: t,
|
20
|
-
userType:
|
21
|
-
isMilestoneWidget:
|
21
|
+
userType: O,
|
22
|
+
isMilestoneWidget: w,
|
22
23
|
userMilestoneId: _,
|
23
24
|
onUnlock: i,
|
24
25
|
onUnAssignSheet: u,
|
25
|
-
onReset:
|
26
|
-
onPreview:
|
26
|
+
onReset: m,
|
27
|
+
onPreview: l,
|
27
28
|
onReview: p,
|
28
29
|
onStart: f
|
29
30
|
}) => {
|
30
|
-
const { onClick: c } =
|
31
|
-
accuracy:
|
32
|
-
permissions:
|
33
|
-
title:
|
34
|
-
sheet_statement:
|
35
|
-
state:
|
31
|
+
const { onClick: c } = ce(), r = Q(null), [D, M] = Z(!1), {
|
32
|
+
accuracy: b,
|
33
|
+
permissions: X,
|
34
|
+
title: C,
|
35
|
+
sheet_statement: j,
|
36
|
+
state: E,
|
36
37
|
node_id: o,
|
37
38
|
user_node_id: s,
|
38
|
-
node_sub_group:
|
39
|
-
node_type:
|
39
|
+
node_sub_group: G,
|
40
|
+
node_type: y
|
40
41
|
} = t, {
|
41
|
-
can_start:
|
42
|
-
can_resume:
|
43
|
-
can_unlock:
|
44
|
-
can_review:
|
45
|
-
can_teacher_review:
|
46
|
-
can_unassign:
|
47
|
-
can_reset:
|
48
|
-
} =
|
42
|
+
can_start: I,
|
43
|
+
can_resume: S,
|
44
|
+
can_unlock: g,
|
45
|
+
can_review: H,
|
46
|
+
can_teacher_review: L,
|
47
|
+
can_unassign: B,
|
48
|
+
can_reset: U
|
49
|
+
} = X, V = typeof b == "number" ? `${b}%` : void 0, n = O === "STUDENT", R = n ? H : L, P = he(E), { label: W, Icon: F } = we(G) || {}, a = ee(
|
49
50
|
() => ({
|
50
51
|
node_id: o,
|
51
|
-
node_type:
|
52
|
+
node_type: y
|
52
53
|
}),
|
53
|
-
[o,
|
54
|
+
[o, y]
|
54
55
|
), K = d(() => {
|
55
56
|
c({
|
56
|
-
analyticsLabel:
|
57
|
+
analyticsLabel: k.RESOURCE_ASSIGNED,
|
57
58
|
props: a
|
58
59
|
}), i == null || i(o);
|
59
|
-
}, [i, o, c, a]),
|
60
|
-
if (n && (
|
60
|
+
}, [i, o, c, a]), Y = d(() => {
|
61
|
+
if (n && (I || S)) {
|
61
62
|
if (typeof f == "function") {
|
62
|
-
f(o, s);
|
63
|
+
f(o, h(t), s);
|
63
64
|
return;
|
64
65
|
}
|
65
66
|
throw new Error("No callback is available");
|
66
67
|
}
|
67
|
-
if (
|
68
|
+
if (R) {
|
68
69
|
if (typeof p != "function")
|
69
70
|
throw new Error("onReview must be a function");
|
70
71
|
if (!s)
|
71
72
|
throw new Error("user node id must be present to review the sheet");
|
72
|
-
p(s, _);
|
73
|
+
p(s, h(t, "review"), _);
|
73
74
|
return;
|
74
75
|
}
|
75
|
-
if (typeof
|
76
|
+
if (typeof l != "function")
|
76
77
|
throw new Error("onPreview must be a function");
|
77
|
-
|
78
|
+
l(t, h(t));
|
78
79
|
}, [
|
80
|
+
S,
|
81
|
+
R,
|
79
82
|
I,
|
80
|
-
g,
|
81
|
-
y,
|
82
83
|
n,
|
83
84
|
o,
|
84
85
|
t,
|
@@ -86,104 +87,104 @@ const { UNASSIGN: x, REDO: N } = ue, Oe = z(
|
|
86
87
|
s,
|
87
88
|
f,
|
88
89
|
p,
|
89
|
-
|
90
|
-
]),
|
91
|
-
(
|
92
|
-
switch (
|
90
|
+
l
|
91
|
+
]), T = d(
|
92
|
+
(z) => {
|
93
|
+
switch (z) {
|
93
94
|
case x:
|
94
95
|
if (typeof u != "function")
|
95
96
|
throw new Error("onUnassignSheet must be a function");
|
96
97
|
c({
|
97
|
-
analyticsLabel:
|
98
|
+
analyticsLabel: k.RESOURCE_UNASSIGNED,
|
98
99
|
props: a
|
99
100
|
}), u(t);
|
100
101
|
return;
|
101
102
|
case N:
|
102
|
-
if (typeof
|
103
|
+
if (typeof m != "function")
|
103
104
|
throw new Error("onReset must be a function");
|
104
|
-
|
105
|
+
m(t);
|
105
106
|
return;
|
106
107
|
}
|
107
108
|
},
|
108
|
-
[t, u,
|
109
|
+
[t, u, m, a, c]
|
109
110
|
);
|
110
|
-
|
111
|
-
r.current && r.current.scrollHeight > r.current.clientHeight &&
|
111
|
+
te(() => {
|
112
|
+
r.current && r.current.scrollHeight > r.current.clientHeight && M(!0);
|
112
113
|
}, [r]);
|
113
|
-
const
|
114
|
+
const q = [
|
114
115
|
{
|
115
116
|
id: "supplementary_resources_unassign",
|
116
117
|
label: "Unassign",
|
117
|
-
icon: /* @__PURE__ */ e(
|
118
|
+
icon: /* @__PURE__ */ e(oe, { width: 20, height: 20 }),
|
118
119
|
option: x,
|
119
|
-
visible:
|
120
|
-
onClick:
|
120
|
+
visible: B,
|
121
|
+
onClick: T
|
121
122
|
},
|
122
123
|
{
|
123
124
|
id: "supplementary_resources_redo",
|
124
125
|
label: "Redo",
|
125
|
-
icon: /* @__PURE__ */ e(
|
126
|
+
icon: /* @__PURE__ */ e(ne, {}),
|
126
127
|
option: N,
|
127
|
-
visible:
|
128
|
-
onClick:
|
128
|
+
visible: U,
|
129
|
+
onClick: T
|
129
130
|
}
|
130
|
-
],
|
131
|
-
|
131
|
+
], $ = _e(
|
132
|
+
E,
|
132
133
|
n,
|
133
|
-
|
134
|
-
!!
|
134
|
+
g,
|
135
|
+
!!w
|
135
136
|
);
|
136
|
-
return /* @__PURE__ */
|
137
|
-
|
137
|
+
return /* @__PURE__ */ v(
|
138
|
+
pe,
|
138
139
|
{
|
139
140
|
$gapX: 1,
|
140
141
|
$gutterX: 1,
|
141
142
|
$flexGapX: 1.25,
|
142
|
-
$background:
|
143
|
+
$background: $,
|
143
144
|
$justifyContent: "space-between",
|
144
145
|
$heightX: 8,
|
145
|
-
$isMilestoneWidget:
|
146
|
+
$isMilestoneWidget: w,
|
146
147
|
children: [
|
147
148
|
/* @__PURE__ */ e(
|
148
149
|
A,
|
149
150
|
{
|
150
151
|
renderAs: "primary",
|
151
152
|
position: "bottom",
|
152
|
-
tooltipItem:
|
153
|
-
hidden: !
|
153
|
+
tooltipItem: C,
|
154
|
+
hidden: !D,
|
154
155
|
widthX: 21.75,
|
155
|
-
children: /* @__PURE__ */ e(
|
156
|
+
children: /* @__PURE__ */ e(fe, { ref: r, $renderAs: "ab2", $color: "BLACK_T_87", children: C })
|
156
157
|
}
|
157
158
|
),
|
158
|
-
/* @__PURE__ */
|
159
|
-
/* @__PURE__ */ e(A, { position: "bottom", tooltipItem:
|
160
|
-
|
159
|
+
/* @__PURE__ */ v(se, { $flexDirection: "row", $justifyContent: "space-between", $alignItems: "center", children: [
|
160
|
+
/* @__PURE__ */ e(A, { position: "bottom", tooltipItem: j, renderAs: "secondary", children: /* @__PURE__ */ e(
|
161
|
+
ae,
|
161
162
|
{
|
162
163
|
renderAs: "primary",
|
163
|
-
label:
|
164
|
+
label: W ?? "",
|
164
165
|
Icon: F,
|
165
|
-
backgroundColor:
|
166
|
+
backgroundColor: $,
|
166
167
|
state: P,
|
167
168
|
hoverActive: !1,
|
168
|
-
onClick:
|
169
|
-
accuracy:
|
169
|
+
onClick: Y,
|
170
|
+
accuracy: V,
|
170
171
|
widthX: 8.5
|
171
172
|
}
|
172
173
|
) }),
|
173
|
-
!n && (
|
174
|
-
|
174
|
+
!n && (g ? /* @__PURE__ */ e(
|
175
|
+
de,
|
175
176
|
{
|
176
177
|
$flexDirection: "row",
|
177
178
|
$alignItems: "center",
|
178
179
|
$justifyContent: "center",
|
179
180
|
onClick: K,
|
180
|
-
children: /* @__PURE__ */ e(
|
181
|
+
children: /* @__PURE__ */ e(re, {})
|
181
182
|
}
|
182
183
|
) : /* @__PURE__ */ e(
|
183
|
-
|
184
|
+
ie,
|
184
185
|
{
|
185
|
-
targetElement: /* @__PURE__ */ e(
|
186
|
-
menuElement: /* @__PURE__ */ e(le, { menuOptions:
|
186
|
+
targetElement: /* @__PURE__ */ e(ue, { invertHover: !0 }),
|
187
|
+
menuElement: /* @__PURE__ */ e(le, { menuOptions: q })
|
187
188
|
}
|
188
189
|
))
|
189
190
|
] })
|
@@ -193,6 +194,6 @@ const { UNASSIGN: x, REDO: N } = ue, Oe = z(
|
|
193
194
|
}
|
194
195
|
);
|
195
196
|
export {
|
196
|
-
|
197
|
+
Me as default
|
197
198
|
};
|
198
199
|
//# 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 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,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,WA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GN;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 { 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;AAA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,gBAAAwB;AAAA,cAACW;AAAAA,cAAA;AAAA,gBACC,gBAAe;AAAA,gBACf,aAAY;AAAA,gBACZ,iBAAgB;AAAA,gBAChB,SAASpB;AAAA,gBAET,4BAACqB,IAAU,EAAA;AAAA,cAAA;AAAA,YAAA,IAGb,gBAAAZ;AAAA,cAACa;AAAA,cAAA;AAAA,gBACC,eAAe,gBAAAb,EAACc,IAAyB,EAAA,aAAW,GAAC,CAAA;AAAA,gBACrD,aAAc,gBAAAd,EAAAe,IAAA,EAAmB,aAAAhB,EAA0B,CAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UAC7D,GAEN;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
|
@@ -1,110 +1,111 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { useMemo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import { useUIContext as
|
6
|
-
import { NODE_TYPE as
|
7
|
-
import
|
8
|
-
import Y from "../context-menu-helper/
|
9
|
-
import
|
10
|
-
|
11
|
-
|
1
|
+
import { jsxs as A, Fragment as g, jsx as s } from "react/jsx-runtime";
|
2
|
+
import { useMemo as I, useCallback as C } from "react";
|
3
|
+
import V from "../../../../../ui/buttons/button/button.js";
|
4
|
+
import W from "../../../../../ui/context-menu/context-menu.js";
|
5
|
+
import { useUIContext as j } from "../../../../../ui/context/context.js";
|
6
|
+
import { NODE_TYPE as U } from "../../../../constants/sheet.js";
|
7
|
+
import { isV3Worksheet as m } from "../../../../utils/is-v3-worksheet.js";
|
8
|
+
import Y from "../context-menu-helper/menu-element/menu-element.js";
|
9
|
+
import z from "../context-menu-helper/target-element/target-element.js";
|
10
|
+
import { MENU_OPTIONS as R } from "./student-actions-constant.js";
|
11
|
+
const $ = ({
|
12
|
+
sheet: t,
|
12
13
|
isDefocused: o,
|
13
|
-
isLastSheet:
|
14
|
-
...
|
14
|
+
isLastSheet: N,
|
15
|
+
...x
|
15
16
|
}) => {
|
16
|
-
const { teacherId:
|
17
|
-
can_start:
|
18
|
-
can_resume:
|
17
|
+
const { teacherId: b, milestoneId: d, section: c, onStart: u, onResume: p, onReattempt: l, onReview: f } = x, { permissions: M, node_id: w, user_node_id: e, node_type: T } = t, {
|
18
|
+
can_start: i,
|
19
|
+
can_resume: E,
|
19
20
|
can_review: h,
|
20
|
-
can_reattempt:
|
21
|
-
is_review_disabled:
|
22
|
-
} =
|
23
|
-
const
|
24
|
-
teacher_id:
|
25
|
-
node_id:
|
21
|
+
can_reattempt: _,
|
22
|
+
is_review_disabled: y
|
23
|
+
} = M, n = T === U.DYNAMIC ? e : w, { onEvent: v } = j(), a = I(() => {
|
24
|
+
const r = {
|
25
|
+
teacher_id: b,
|
26
|
+
node_id: w,
|
26
27
|
user_node_id: e
|
27
28
|
};
|
28
|
-
return
|
29
|
-
}, [
|
30
|
-
if (!
|
29
|
+
return d && (r.milestone_id = d), c && (r.section = c), r;
|
30
|
+
}, [d, w, c, b, e]), k = C(() => {
|
31
|
+
if (!n)
|
31
32
|
throw new Error("No required id is present to open the sheet.");
|
32
|
-
if (
|
33
|
-
|
33
|
+
if (i && typeof u == "function") {
|
34
|
+
u(n, m(t), e);
|
34
35
|
return;
|
35
36
|
}
|
36
|
-
if (
|
37
|
-
|
37
|
+
if (E && typeof p == "function") {
|
38
|
+
p(n, m(t), e);
|
38
39
|
return;
|
39
40
|
}
|
40
41
|
throw new Error("No callback provided. If provided it must be a function");
|
41
|
-
}, [
|
42
|
-
(
|
43
|
-
if (
|
44
|
-
...
|
45
|
-
cta:
|
46
|
-
}),
|
42
|
+
}, [E, i, n, p, u, t, e]), S = C(
|
43
|
+
(r) => {
|
44
|
+
if (v("clicked", {
|
45
|
+
...a,
|
46
|
+
cta: r
|
47
|
+
}), r === R.REVIEW) {
|
47
48
|
if (!e)
|
48
49
|
throw new Error("No required id is present to open the sheet.");
|
49
|
-
if (typeof
|
50
|
+
if (typeof f != "function")
|
50
51
|
throw new Error("onReview must be a function");
|
51
|
-
|
52
|
+
f(e, m(t, "review"));
|
52
53
|
return;
|
53
54
|
}
|
54
|
-
if (!
|
55
|
+
if (!n)
|
55
56
|
throw new Error("No required id is present to open the sheet.");
|
56
|
-
if (typeof
|
57
|
+
if (typeof l != "function")
|
57
58
|
throw new Error("onReattempt must be a function");
|
58
|
-
|
59
|
+
l(n, m(t), e);
|
59
60
|
},
|
60
|
-
[
|
61
|
-
),
|
61
|
+
[a, n, l, f, t, v, e]
|
62
|
+
), O = i || E, P = !o && _ || h, q = I(
|
62
63
|
() => [
|
63
64
|
{
|
64
65
|
show: h,
|
65
|
-
label:
|
66
|
-
disable:
|
66
|
+
label: R.REVIEW,
|
67
|
+
disable: y
|
67
68
|
},
|
68
69
|
{
|
69
|
-
show: !o &&
|
70
|
-
label:
|
70
|
+
show: !o && _,
|
71
|
+
label: R.REATTEMPT
|
71
72
|
}
|
72
73
|
],
|
73
|
-
[
|
74
|
+
[_, h, o, y]
|
74
75
|
);
|
75
|
-
return /* @__PURE__ */
|
76
|
-
|
77
|
-
|
76
|
+
return /* @__PURE__ */ A(g, { children: [
|
77
|
+
O && /* @__PURE__ */ s(
|
78
|
+
V,
|
78
79
|
{
|
79
|
-
label:
|
80
|
+
label: i ? "Start" : "Resume",
|
80
81
|
widthX: 7,
|
81
82
|
renderAs: "primary",
|
82
83
|
size: "xsmall",
|
83
|
-
onClick:
|
84
|
+
onClick: k,
|
84
85
|
disabled: o,
|
85
|
-
analyticsProps:
|
86
|
+
analyticsProps: a,
|
86
87
|
shape: "square"
|
87
88
|
}
|
88
89
|
),
|
89
|
-
|
90
|
-
|
90
|
+
P && /* @__PURE__ */ s(
|
91
|
+
W,
|
91
92
|
{
|
92
|
-
targetElement: /* @__PURE__ */ s(
|
93
|
+
targetElement: /* @__PURE__ */ s(z, { analyticsLabel: "Sheet menu", analyticsProps: a }),
|
93
94
|
menuElement: /* @__PURE__ */ s(
|
94
|
-
|
95
|
+
Y,
|
95
96
|
{
|
96
|
-
options:
|
97
|
+
options: q,
|
97
98
|
handleOnMenuOptionSelection: S
|
98
99
|
}
|
99
100
|
),
|
100
101
|
menuOffset: 10,
|
101
102
|
menuZIndex: 1,
|
102
|
-
placeTop:
|
103
|
+
placeTop: N
|
103
104
|
}
|
104
105
|
)
|
105
106
|
] });
|
106
107
|
};
|
107
108
|
export {
|
108
|
-
|
109
|
+
$ as default
|
109
110
|
};
|
110
111
|
//# sourceMappingURL=student-actions.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"student-actions.js","sources":["../../../../../../../src/features/sheets/sheets-list/sheet-item/reward-n-actions/student-actions/student-actions.tsx"],"sourcesContent":["import type { IRewardNActionsProps, TTrackEventPayloadProps } from '../reward-n-actions-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useMemo } from 'react';\n\nimport Button from '../../../../../ui/buttons/button/button';\nimport ContextMenu from '../../../../../ui/context-menu/context-menu';\nimport { useUIContext } from '../../../../../ui/context/context';\nimport { NODE_TYPE } from '../../../../constants/sheet';\nimport MenuElement from '../context-menu-helper/menu-element/menu-element';\nimport TargetElement from '../context-menu-helper/target-element/target-element';\nimport { MENU_OPTIONS } from './student-actions-constant';\n\nconst StudentActions: FC<IRewardNActionsProps> = ({\n sheet,\n isDefocused,\n isLastSheet,\n ...restStudentActionProps\n}) => {\n const { teacherId, milestoneId, section, onStart, onResume, onReattempt, onReview } =\n restStudentActionProps;\n const { permissions, node_id: nodeId, user_node_id: userNodeId, node_type: nodeType } = sheet;\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_reattempt: canReattempt,\n is_review_disabled: isReviewHidden,\n } = permissions;\n\n const id = nodeType === NODE_TYPE.DYNAMIC ? userNodeId : nodeId;\n\n const { onEvent: trackEvent } = useUIContext();\n\n const analyticsProps = useMemo(() => {\n const payload: TTrackEventPayloadProps = {\n teacher_id: teacherId,\n node_id: nodeId,\n user_node_id: userNodeId,\n };\n\n if (milestoneId) {\n payload.milestone_id = milestoneId;\n }\n\n if (section) {\n payload.section = section;\n }\n\n return payload;\n }, [milestoneId, nodeId, section, teacherId, userNodeId]);\n\n const handleOnPrimaryCtaClick = useCallback(() => {\n if (!id) {\n throw new Error('No required id is present to open the sheet.');\n }\n\n if (canStart && typeof onStart === 'function') {\n onStart(id, userNodeId);\n\n return;\n }\n\n if (canResume && typeof onResume === 'function') {\n onResume(id, userNodeId);\n\n return;\n }\n\n throw new Error('No callback provided. If provided it must be a function');\n }, [canResume, canStart, id, onResume, onStart, userNodeId]);\n\n const handleOnMenuOptionSelection = useCallback(\n (selectedOption: string) => {\n trackEvent('clicked', {\n ...analyticsProps,\n cta: selectedOption,\n });\n if (selectedOption === MENU_OPTIONS.REVIEW) {\n if (!userNodeId) {\n throw new Error('No required id is present to open the sheet.');\n }\n\n if (typeof onReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n onReview(userNodeId);\n\n return;\n }\n\n if (!id) {\n throw new Error('No required id is present to open the sheet.');\n }\n\n if (typeof onReattempt !== 'function') {\n throw new Error('onReattempt must be a function');\n }\n\n onReattempt(id, userNodeId);\n\n return;\n },\n [analyticsProps, id, onReattempt, onReview, trackEvent, userNodeId],\n );\n\n const renderPrimaryCta = canStart || canResume;\n const renderContextMenu = (!isDefocused && canReattempt) || canReview;\n\n const options = useMemo(\n () => [\n {\n show: canReview,\n label: MENU_OPTIONS.REVIEW,\n disable: isReviewHidden,\n },\n {\n show: !isDefocused && canReattempt,\n label: MENU_OPTIONS.REATTEMPT,\n },\n ],\n [canReattempt, canReview, isDefocused, isReviewHidden],\n );\n\n return (\n <>\n {renderPrimaryCta && (\n <Button\n label={canStart ? 'Start' : 'Resume'}\n widthX={7}\n renderAs=\"primary\"\n size=\"xsmall\"\n onClick={handleOnPrimaryCtaClick}\n disabled={isDefocused}\n analyticsProps={analyticsProps}\n shape=\"square\"\n />\n )}\n\n {renderContextMenu && (\n <ContextMenu\n targetElement={\n <TargetElement analyticsLabel=\"Sheet menu\" analyticsProps={analyticsProps} />\n }\n menuElement={\n <MenuElement\n options={options}\n handleOnMenuOptionSelection={handleOnMenuOptionSelection}\n />\n }\n menuOffset={10}\n menuZIndex={1}\n placeTop={isLastSheet}\n />\n )}\n </>\n );\n};\n\nexport default StudentActions;\n"],"names":["StudentActions","sheet","isDefocused","isLastSheet","restStudentActionProps","teacherId","milestoneId","section","onStart","onResume","onReattempt","onReview","permissions","nodeId","userNodeId","nodeType","canStart","canResume","canReview","canReattempt","isReviewHidden","id","NODE_TYPE","trackEvent","useUIContext","analyticsProps","useMemo","payload","handleOnPrimaryCtaClick","useCallback","handleOnMenuOptionSelection","selectedOption","MENU_OPTIONS","renderPrimaryCta","renderContextMenu","options","jsxs","Fragment","jsx","Button","ContextMenu","TargetElement","MenuElement"],"mappings":"
|
1
|
+
{"version":3,"file":"student-actions.js","sources":["../../../../../../../src/features/sheets/sheets-list/sheet-item/reward-n-actions/student-actions/student-actions.tsx"],"sourcesContent":["import type { IRewardNActionsProps, TTrackEventPayloadProps } from '../reward-n-actions-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useMemo } from 'react';\n\nimport Button from '../../../../../ui/buttons/button/button';\nimport ContextMenu from '../../../../../ui/context-menu/context-menu';\nimport { useUIContext } from '../../../../../ui/context/context';\nimport { NODE_TYPE } from '../../../../constants/sheet';\nimport { isV3Worksheet } from '../../../../utils/is-v3-worksheet';\nimport MenuElement from '../context-menu-helper/menu-element/menu-element';\nimport TargetElement from '../context-menu-helper/target-element/target-element';\nimport { MENU_OPTIONS } from './student-actions-constant';\n\nconst StudentActions: FC<IRewardNActionsProps> = ({\n sheet,\n isDefocused,\n isLastSheet,\n ...restStudentActionProps\n}) => {\n const { teacherId, milestoneId, section, onStart, onResume, onReattempt, onReview } =\n restStudentActionProps;\n const { permissions, node_id: nodeId, user_node_id: userNodeId, node_type: nodeType } = sheet;\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_reattempt: canReattempt,\n is_review_disabled: isReviewHidden,\n } = permissions;\n\n const id = nodeType === NODE_TYPE.DYNAMIC ? userNodeId : nodeId;\n\n const { onEvent: trackEvent } = useUIContext();\n\n const analyticsProps = useMemo(() => {\n const payload: TTrackEventPayloadProps = {\n teacher_id: teacherId,\n node_id: nodeId,\n user_node_id: userNodeId,\n };\n\n if (milestoneId) {\n payload.milestone_id = milestoneId;\n }\n\n if (section) {\n payload.section = section;\n }\n\n return payload;\n }, [milestoneId, nodeId, section, teacherId, userNodeId]);\n\n const handleOnPrimaryCtaClick = useCallback(() => {\n if (!id) {\n throw new Error('No required id is present to open the sheet.');\n }\n\n if (canStart && typeof onStart === 'function') {\n onStart(id, isV3Worksheet(sheet), userNodeId);\n\n return;\n }\n\n if (canResume && typeof onResume === 'function') {\n onResume(id, isV3Worksheet(sheet), userNodeId);\n\n return;\n }\n\n throw new Error('No callback provided. If provided it must be a function');\n }, [canResume, canStart, id, onResume, onStart, sheet, userNodeId]);\n\n const handleOnMenuOptionSelection = useCallback(\n (selectedOption: string) => {\n trackEvent('clicked', {\n ...analyticsProps,\n cta: selectedOption,\n });\n if (selectedOption === MENU_OPTIONS.REVIEW) {\n if (!userNodeId) {\n throw new Error('No required id is present to open the sheet.');\n }\n\n if (typeof onReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n onReview(userNodeId, isV3Worksheet(sheet, 'review'));\n\n return;\n }\n\n if (!id) {\n throw new Error('No required id is present to open the sheet.');\n }\n\n if (typeof onReattempt !== 'function') {\n throw new Error('onReattempt must be a function');\n }\n\n onReattempt(id, isV3Worksheet(sheet), userNodeId);\n\n return;\n },\n [analyticsProps, id, onReattempt, onReview, sheet, trackEvent, userNodeId],\n );\n\n const renderPrimaryCta = canStart || canResume;\n const renderContextMenu = (!isDefocused && canReattempt) || canReview;\n\n const options = useMemo(\n () => [\n {\n show: canReview,\n label: MENU_OPTIONS.REVIEW,\n disable: isReviewHidden,\n },\n {\n show: !isDefocused && canReattempt,\n label: MENU_OPTIONS.REATTEMPT,\n },\n ],\n [canReattempt, canReview, isDefocused, isReviewHidden],\n );\n\n return (\n <>\n {renderPrimaryCta && (\n <Button\n label={canStart ? 'Start' : 'Resume'}\n widthX={7}\n renderAs=\"primary\"\n size=\"xsmall\"\n onClick={handleOnPrimaryCtaClick}\n disabled={isDefocused}\n analyticsProps={analyticsProps}\n shape=\"square\"\n />\n )}\n\n {renderContextMenu && (\n <ContextMenu\n targetElement={\n <TargetElement analyticsLabel=\"Sheet menu\" analyticsProps={analyticsProps} />\n }\n menuElement={\n <MenuElement\n options={options}\n handleOnMenuOptionSelection={handleOnMenuOptionSelection}\n />\n }\n menuOffset={10}\n menuZIndex={1}\n placeTop={isLastSheet}\n />\n )}\n </>\n );\n};\n\nexport default StudentActions;\n"],"names":["StudentActions","sheet","isDefocused","isLastSheet","restStudentActionProps","teacherId","milestoneId","section","onStart","onResume","onReattempt","onReview","permissions","nodeId","userNodeId","nodeType","canStart","canResume","canReview","canReattempt","isReviewHidden","id","NODE_TYPE","trackEvent","useUIContext","analyticsProps","useMemo","payload","handleOnPrimaryCtaClick","useCallback","isV3Worksheet","handleOnMenuOptionSelection","selectedOption","MENU_OPTIONS","renderPrimaryCta","renderContextMenu","options","jsxs","Fragment","jsx","Button","ContextMenu","TargetElement","MenuElement"],"mappings":";;;;;;;;;;AAcA,MAAMA,IAA2C,CAAC;AAAA,EAChD,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACE,QAAA,EAAE,WAAAC,GAAW,aAAAC,GAAa,SAAAC,GAAS,SAAAC,GAAS,UAAAC,GAAU,aAAAC,GAAa,UAAAC,EACvE,IAAAP,GACI,EAAE,aAAAQ,GAAa,SAASC,GAAQ,cAAcC,GAAY,WAAWC,EAAa,IAAAd,GAElF;AAAA,IACJ,WAAWe;AAAA,IACX,YAAYC;AAAA,IACZ,YAAYC;AAAA,IACZ,eAAeC;AAAA,IACf,oBAAoBC;AAAA,EAClB,IAAAR,GAEES,IAAKN,MAAaO,EAAU,UAAUR,IAAaD,GAEnD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