@cuemath/leap 3.2.15-link.0 → 3.2.15
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 -6
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/cue-board-filled.js +33 -0
- package/dist/assets/line-icons/icons/cue-board-filled.js.map +1 -0
- package/dist/assets/line-icons/icons/cue-board.js +23 -0
- package/dist/assets/line-icons/icons/cue-board.js.map +1 -0
- package/dist/assets/line-icons/icons/hint-fill.js +35 -0
- package/dist/assets/line-icons/icons/hint-fill.js.map +1 -0
- package/dist/assets/line-icons/icons/screen-grab-filled.js +35 -0
- package/dist/assets/line-icons/icons/screen-grab-filled.js.map +1 -0
- package/dist/assets/line-icons/icons/screen-grab.js +23 -0
- package/dist/assets/line-icons/icons/screen-grab.js.map +1 -0
- package/dist/assets/line-icons/icons/sticker-filled.js +64 -0
- package/dist/assets/line-icons/icons/sticker-filled.js.map +1 -0
- package/dist/assets/line-icons/icons/sticker.js +46 -0
- package/dist/assets/line-icons/icons/sticker.js.map +1 -0
- package/dist/assets/lottie/lottie.js +1 -11
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +13 -18
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
- package/dist/features/auth/comps/resend-otp/resend-otp.js +47 -54
- package/dist/features/auth/comps/resend-otp/resend-otp.js.map +1 -1
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js +17 -29
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js.map +1 -1
- package/dist/features/auth/comps/tabs/tabs-styled.js +10 -22
- package/dist/features/auth/comps/tabs/tabs-styled.js.map +1 -1
- package/dist/features/auth/comps/tabs/tabs.js +5 -5
- package/dist/features/auth/comps/tabs/tabs.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +7 -7
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/journey/comps/coachmark/coachmark.js +29 -28
- package/dist/features/journey/comps/coachmark/coachmark.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js +2 -2
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/use-journey/journey-context-provider.js +73 -72
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/journey/use-journey/journey-styled.js +6 -4
- package/dist/features/journey/use-journey/journey-styled.js.map +1 -1
- package/dist/features/puzzles/app/puzzle-app-styled.js +81 -0
- package/dist/features/puzzles/app/puzzle-app-styled.js.map +1 -0
- package/dist/features/puzzles/app/puzzle-app-view.js +120 -0
- package/dist/features/puzzles/app/puzzle-app-view.js.map +1 -0
- package/dist/features/puzzles/app/puzzle-app.js +62 -0
- package/dist/features/puzzles/app/puzzle-app.js.map +1 -0
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js +50 -7
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js +69 -15
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js +6 -0
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js.map +1 -0
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js +12 -60
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js +72 -77
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js +63 -0
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js.map +1 -0
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js +21 -0
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js.map +1 -0
- package/dist/features/ui/image/image.js +1 -1
- package/dist/features/ui/image/image.js.map +1 -1
- package/dist/features/ui/inputs/base-input/base-input.js +11 -11
- package/dist/features/ui/inputs/base-input/base-input.js.map +1 -1
- package/dist/features/ui/inputs/text-input/text-input.js +18 -19
- package/dist/features/ui/inputs/text-input/text-input.js.map +1 -1
- package/dist/features/ui/modals/modal-styled.js +8 -43
- package/dist/features/ui/modals/modal-styled.js.map +1 -1
- package/dist/features/ui/modals/modal.js +27 -37
- package/dist/features/ui/modals/modal.js.map +1 -1
- package/dist/features/ui/nudge/nudge-styled.js +14 -7
- package/dist/features/ui/nudge/nudge-styled.js.map +1 -1
- package/dist/features/ui/nudge/nudge.js +13 -12
- package/dist/features/ui/nudge/nudge.js.map +1 -1
- package/dist/features/ui/text/text.js +29 -31
- package/dist/features/ui/text/text.js.map +1 -1
- package/dist/features/ui/theme/button.js +78 -78
- package/dist/features/ui/theme/button.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +24 -24
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/index.d.ts +38 -151
- package/dist/index.js +516 -530
- package/dist/index.js.map +1 -1
- package/dist/static/nudge-tap.0591aef4.json +1 -0
- package/package.json +3 -2
- package/dist/assets/line-icons/icons/after-noon.js +0 -34
- package/dist/assets/line-icons/icons/after-noon.js.map +0 -1
- package/dist/assets/line-icons/icons/apple-icon-white.js +0 -42
- package/dist/assets/line-icons/icons/apple-icon-white.js.map +0 -1
- package/dist/assets/line-icons/icons/evening.js +0 -35
- package/dist/assets/line-icons/icons/evening.js.map +0 -1
- package/dist/assets/line-icons/icons/morning.js +0 -35
- package/dist/assets/line-icons/icons/morning.js.map +0 -1
- package/dist/assets/line-icons/icons/star3.js +0 -32
- package/dist/assets/line-icons/icons/star3.js.map +0 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js +0 -9
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js.map +0 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js +0 -65
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js.map +0 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js +0 -92
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js.map +0 -1
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js +0 -12
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js.map +0 -1
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js +0 -34
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js.map +0 -1
- package/dist/features/auth/comps/otp-input/otp-input-styled.js +0 -22
- package/dist/features/auth/comps/otp-input/otp-input-styled.js.map +0 -1
- package/dist/features/auth/comps/otp-input/otp-input.js +0 -51
- package/dist/features/auth/comps/otp-input/otp-input.js.map +0 -1
- package/dist/features/auth/comps/pill-button/pill-button-styled.js +0 -44
- package/dist/features/auth/comps/pill-button/pill-button-styled.js.map +0 -1
- package/dist/features/auth/comps/pill-button/pill-button.js +0 -75
- package/dist/features/auth/comps/pill-button/pill-button.js.map +0 -1
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js +0 -17
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js.map +0 -1
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js +0 -67
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js.map +0 -1
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-constants.js +0 -19
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-constants.js.map +0 -1
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-styled.js +0 -32
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-styled.js.map +0 -1
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide.js +0 -44
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide.js.map +0 -1
- package/dist/features/auth/signup-v2/signup-header/signup-header.js +0 -54
- package/dist/features/auth/signup-v2/signup-header/signup-header.js.map +0 -1
- package/dist/features/auth/signup-v2/signup-options/signup-options.js +0 -83
- package/dist/features/auth/signup-v2/signup-options/signup-options.js.map +0 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js +0 -49
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js.map +0 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +0 -64
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +0 -1
- package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js +0 -28
- package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js.map +0 -1
- package/dist/features/ui/accordion/accordion-items/accordion-items.js +0 -83
- package/dist/features/ui/accordion/accordion-items/accordion-items.js.map +0 -1
- package/dist/features/ui/accordion/accordion.js +0 -62
- package/dist/features/ui/accordion/accordion.js.map +0 -1
- package/dist/static/animated-avatar.1ad58b1d.json +0 -1
- package/dist/static/animated-avatar.69b07505.json +0 -1
- package/dist/static/animated-avatar.9c560b46.json +0 -1
- package/dist/static/calendar-purple.1a840b41.svg +0 -1
- package/dist/static/flying-disk.c7f6ed39.json +0 -1
- package/dist/static/graduation-cap.3be3340a.json +0 -1
- package/dist/static/handshake.287e7dfb.svg +0 -1
- package/dist/static/light-bulb.c6db0b23.json +0 -1
- package/dist/static/money.332aacf1.svg +0 -1
- package/dist/static/muscle.9bcfb8a7.json +0 -1
- package/dist/static/nudge-tap.5cb30093.json +0 -1057
- package/dist/static/parent-avatar.822c7b9b.svg +0 -1
- package/dist/static/pencil.23df9da0.json +0 -1
- package/dist/static/plus-sign.de6af957.json +0 -1
- package/dist/static/racing-car.2cbf864e.json +0 -1
- package/dist/static/rocket.0a3ccab0.json +0 -1
- package/dist/static/shovel.abeec04c.json +0 -1
- package/dist/static/stripe-blurple.6abf422f.svg +0 -1
- package/dist/static/trustpilot.bd3d79e1.svg +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"text.js","sources":["../../../../src/features/ui/text/text.tsx"],"sourcesContent":["import type { TColorNames, TTextVariants } from '../types';\n\nimport { useMemo } from 'react';\nimport styled from 'styled-components';\n\nimport { EDeviceType } from '../theme/constants';\n\nexport interface TextProps {\n $renderAs: TTextVariants;\n $color?: TColorNames;\n $align?: 'auto' | 'left' | 'right' | 'center' | 'justify';\n $alignSelf?: 'auto' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';\n $opacity?: number | undefined;\n $width?: number | string;\n $widthX?: number;\n $marginBottom?: number;\n $marginBottomX?: number;\n $inline?: boolean;\n $textDecoration?: string;\n $whiteSpace?: 'pre-line' | 'normal' | 'pre-wrap' | 'no-wrap' | 'pre' | 'break-spaces';\n $renderOnMobileAs?: TTextVariants;\n $renderOnTabletAs?: TTextVariants;\n
|
1
|
+
{"version":3,"file":"text.js","sources":["../../../../src/features/ui/text/text.tsx"],"sourcesContent":["import type { TColorNames, TTextVariants } from '../types';\n\nimport { useMemo } from 'react';\nimport styled from 'styled-components';\n\nimport { EDeviceType } from '../theme/constants';\n\nexport interface TextProps {\n $renderAs: TTextVariants;\n $color?: TColorNames;\n $align?: 'auto' | 'left' | 'right' | 'center' | 'justify';\n $alignSelf?: 'auto' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';\n $opacity?: number | undefined;\n $width?: number | string;\n $widthX?: number;\n $marginBottom?: number;\n $marginBottomX?: number;\n $inline?: boolean;\n $textDecoration?: string;\n $whiteSpace?: 'pre-line' | 'normal' | 'pre-wrap' | 'no-wrap' | 'pre' | 'break-spaces';\n $renderOnMobileAs?: TTextVariants;\n $renderOnTabletAs?: TTextVariants;\n}\n\n/**\n * @param $renderAs (fallback for any device), @param $renderOnMobileAs, @param $renderOnTabletAs - The text variant to render as (ah1-ah4, ab1-ab3, ac1-ac4, ub1-ub3), anything else is deprecated\n */\nconst Text = styled.div<TextProps>(\n ({\n theme,\n $renderAs,\n $color,\n $align = 'left',\n $width,\n $widthX,\n $marginBottom,\n $marginBottomX,\n $alignSelf,\n $opacity = 1,\n $inline,\n $textDecoration,\n $whiteSpace,\n $renderOnMobileAs,\n $renderOnTabletAs,\n }) => {\n const { text, colors, layout, device } = theme;\n const renderAs = useMemo(() => {\n if (device <= EDeviceType.MOBILE) {\n return $renderOnMobileAs || $renderOnTabletAs || $renderAs;\n }\n\n if (device <= EDeviceType.TABLET) {\n return $renderOnTabletAs || $renderAs;\n }\n\n return $renderAs;\n }, [device, $renderAs, $renderOnMobileAs, $renderOnTabletAs]);\n\n const {\n fontFamily,\n fontSize,\n lineHeight,\n letterSpacing,\n textTransform = 'none',\n } = text[renderAs];\n\n return `\n display: ${$inline ? 'inline-block' : 'block'};\n font-family: ${fontFamily};\n font-size: ${fontSize}px;\n text-align: ${$align};\n line-height: ${lineHeight}px;\n text-transform: ${textTransform};\n ${typeof letterSpacing === 'number' ? `letter-spacing: ${letterSpacing}px;` : ''}\n color: ${$color ? colors[$color] : colors.BLACK};\n opacity: ${$opacity};\n width: ${$width ? `${$width}` : 'auto'}${typeof $width === 'number' ? 'px' : ''};\n ${$widthX ? `width: ${$widthX * layout.gutter}px;` : ''}\n margin-bottom: ${$marginBottom ? `${$marginBottom}` : 'initial'}${\n typeof $marginBottom === 'number' ? 'px' : ''\n };\n ${$marginBottomX ? `margin-bottom: ${$marginBottomX * layout.gutter}px;` : ''}\n ${$alignSelf ? `align-self: ${$alignSelf};` : ''}\n ${$textDecoration ? `text-decoration: ${$textDecoration};` : ''}\n ${$whiteSpace ? `white-space: ${$whiteSpace};` : ''}\n `;\n },\n);\n\nText.displayName = 'Text';\n\nexport default Text;\n"],"names":["Text","styled","theme","$renderAs","$color","$align","$width","$widthX","$marginBottom","$marginBottomX","$alignSelf","$opacity","$inline","$textDecoration","$whiteSpace","$renderOnMobileAs","$renderOnTabletAs","text","colors","layout","device","renderAs","useMemo","EDeviceType","fontFamily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AK,SAAS,GAC7D,OAAOA,KAAkB,WAAW,OAAO,EAC7C;AAAA,QACEC,IAAiB,kBAAkBA,IAAiBU,EAAO,MAAM,QAAQ,EAAE;AAAA,QAC3ET,IAAa,eAAeA,CAAU,MAAM,EAAE;AAAA,QAC9CG,IAAkB,oBAAoBA,CAAe,MAAM,EAAE;AAAA,QAC7DC,IAAc,gBAAgBA,CAAW,MAAM,EAAE;AAAA;AAAA,EAEvD;AACF;AAEAd,EAAK,cAAc;AAEnB,MAAA6B,IAAe7B;"}
|
@@ -1,48 +1,48 @@
|
|
1
|
-
const
|
1
|
+
const e = (i) => ({ sizes: {
|
2
2
|
xsmall: {
|
3
|
-
height:
|
4
|
-
paddingHorizontal:
|
3
|
+
height: i * 2,
|
4
|
+
paddingHorizontal: i * 1.375,
|
5
5
|
textVariant: "ub3-bold",
|
6
6
|
borderWidth: 1,
|
7
|
-
iconSize:
|
8
|
-
iconPadding:
|
9
|
-
loaderSize:
|
7
|
+
iconSize: i,
|
8
|
+
iconPadding: i * 0.25,
|
9
|
+
loaderSize: i * 1.25
|
10
10
|
},
|
11
11
|
small: {
|
12
|
-
height:
|
13
|
-
paddingHorizontal:
|
12
|
+
height: i * 2.5,
|
13
|
+
paddingHorizontal: i * 1.625,
|
14
14
|
textVariant: "ub2-bold",
|
15
15
|
borderWidth: 1,
|
16
|
-
iconSize:
|
17
|
-
iconPadding:
|
18
|
-
loaderSize:
|
16
|
+
iconSize: i * 1.25,
|
17
|
+
iconPadding: i * 0.375,
|
18
|
+
loaderSize: i * 1.5
|
19
19
|
},
|
20
20
|
regular: {
|
21
|
-
height:
|
22
|
-
paddingHorizontal:
|
21
|
+
height: i * 3,
|
22
|
+
paddingHorizontal: i * 1.875,
|
23
23
|
textVariant: "ub1-bold",
|
24
24
|
borderWidth: 1,
|
25
|
-
iconSize:
|
26
|
-
iconPadding:
|
27
|
-
loaderSize:
|
25
|
+
iconSize: i * 1.5,
|
26
|
+
iconPadding: i * 0.5,
|
27
|
+
loaderSize: i * 1.75
|
28
28
|
},
|
29
29
|
medium: {
|
30
|
-
height:
|
31
|
-
paddingHorizontal:
|
30
|
+
height: i * 3.5,
|
31
|
+
paddingHorizontal: i * 2.125,
|
32
32
|
textVariant: "ub1-bold",
|
33
33
|
borderWidth: 1.5,
|
34
|
-
iconSize:
|
35
|
-
iconPadding:
|
36
|
-
loaderSize:
|
34
|
+
iconSize: i * 1.5,
|
35
|
+
iconPadding: i * 0.5,
|
36
|
+
loaderSize: i * 2
|
37
37
|
},
|
38
38
|
large: {
|
39
|
-
height:
|
40
|
-
paddingHorizontal:
|
39
|
+
height: i * 4,
|
40
|
+
paddingHorizontal: i * 2.375,
|
41
41
|
textVariant: "ub1-bold",
|
42
42
|
borderWidth: 2,
|
43
|
-
iconSize:
|
44
|
-
iconPadding:
|
45
|
-
loaderSize:
|
43
|
+
iconSize: i * 1.5,
|
44
|
+
iconPadding: i * 0.5,
|
45
|
+
loaderSize: i * 2.25
|
46
46
|
}
|
47
47
|
}, variants: {
|
48
48
|
primary: {
|
@@ -129,57 +129,6 @@ const d = (a) => ({ sizes: {
|
|
129
129
|
active: "BLACK",
|
130
130
|
disabled: "WHITE_T_15"
|
131
131
|
}
|
132
|
-
},
|
133
|
-
black: {
|
134
|
-
backgroundColorName: {
|
135
|
-
inactive: "BLACK_1",
|
136
|
-
active: "BLACK_T_60",
|
137
|
-
disabled: "BLACK_T_15"
|
138
|
-
},
|
139
|
-
borderColorName: {
|
140
|
-
inactive: "BLACK_1",
|
141
|
-
active: "BLACK_1",
|
142
|
-
disabled: "BLACK_T_15"
|
143
|
-
},
|
144
|
-
colorName: {
|
145
|
-
inactive: "WHITE_1",
|
146
|
-
active: "WHITE_1",
|
147
|
-
disabled: "WHITE_T_87"
|
148
|
-
}
|
149
|
-
},
|
150
|
-
"black-dark": {
|
151
|
-
backgroundColorName: {
|
152
|
-
inactive: "BLACK_1",
|
153
|
-
active: "BLACK_4",
|
154
|
-
disabled: "WHITE_T_10"
|
155
|
-
},
|
156
|
-
borderColorName: {
|
157
|
-
inactive: "WHITE_1",
|
158
|
-
active: "WHITE_1",
|
159
|
-
disabled: "WHITE_T_15"
|
160
|
-
},
|
161
|
-
colorName: {
|
162
|
-
inactive: "WHITE_1",
|
163
|
-
active: "WHITE_1",
|
164
|
-
disabled: "WHITE_T_38"
|
165
|
-
}
|
166
|
-
},
|
167
|
-
"yellow-dark": {
|
168
|
-
backgroundColorName: {
|
169
|
-
inactive: "YELLOW_4",
|
170
|
-
active: "YELLOW_3",
|
171
|
-
disabled: "WHITE_T_10"
|
172
|
-
},
|
173
|
-
borderColorName: {
|
174
|
-
inactive: "WHITE",
|
175
|
-
active: "WHITE",
|
176
|
-
disabled: "WHITE_T_15"
|
177
|
-
},
|
178
|
-
colorName: {
|
179
|
-
inactive: "BLACK_1",
|
180
|
-
active: "BLACK_1",
|
181
|
-
disabled: "WHITE_T_38"
|
182
|
-
}
|
183
132
|
}
|
184
133
|
// 'yellow': {
|
185
134
|
// backgroundColorName: {
|
@@ -198,6 +147,23 @@ const d = (a) => ({ sizes: {
|
|
198
147
|
// disabled: 'BLACK_T_35',
|
199
148
|
// },
|
200
149
|
// },
|
150
|
+
// 'yellow-dark': {
|
151
|
+
// backgroundColorName: {
|
152
|
+
// inactive: 'YELLOW_4',
|
153
|
+
// active: 'WHITE_4',
|
154
|
+
// disabled: 'WHITE_T_40',
|
155
|
+
// },
|
156
|
+
// borderColorName: {
|
157
|
+
// inactive: 'BLACK_4',
|
158
|
+
// active: 'BLACK_4',
|
159
|
+
// disabled: 'WHITE_T_40',
|
160
|
+
// },
|
161
|
+
// colorName: {
|
162
|
+
// inactive: 'BLACK_4',
|
163
|
+
// active: 'BLACK_4',
|
164
|
+
// disabled: 'WHITE_T_40',
|
165
|
+
// },
|
166
|
+
// },
|
201
167
|
// 'white': {
|
202
168
|
// backgroundColorName: {
|
203
169
|
// inactive: 'WHITE_1',
|
@@ -232,8 +198,42 @@ const d = (a) => ({ sizes: {
|
|
232
198
|
// disabled: 'WHITE_T_40',
|
233
199
|
// },
|
234
200
|
// },
|
201
|
+
// 'black': {
|
202
|
+
// backgroundColorName: {
|
203
|
+
// inactive: 'BLACK_4',
|
204
|
+
// active: 'BLACK_T_60',
|
205
|
+
// disabled: 'BLACK_T_35',
|
206
|
+
// },
|
207
|
+
// borderColorName: {
|
208
|
+
// inactive: 'BLACK_4',
|
209
|
+
// active: 'BLACK_4',
|
210
|
+
// disabled: 'BLACK_T_35',
|
211
|
+
// },
|
212
|
+
// colorName: {
|
213
|
+
// inactive: 'WHITE_4',
|
214
|
+
// active: 'WHITE_4',
|
215
|
+
// disabled: 'BLACK_T_35',
|
216
|
+
// },
|
217
|
+
// },
|
218
|
+
// 'black-dark': {
|
219
|
+
// backgroundColorName: {
|
220
|
+
// inactive: 'BLACK_4',
|
221
|
+
// active: 'WHITE_T_40',
|
222
|
+
// disabled: 'WHITE_T_40',
|
223
|
+
// },
|
224
|
+
// borderColorName: {
|
225
|
+
// inactive: 'WHITE_4',
|
226
|
+
// active: 'WHITE_4',
|
227
|
+
// disabled: 'WHITE_T_40',
|
228
|
+
// },
|
229
|
+
// colorName: {
|
230
|
+
// inactive: 'WHITE_4',
|
231
|
+
// active: 'WHITE_4',
|
232
|
+
// disabled: 'WHITE_T_40',
|
233
|
+
// },
|
234
|
+
// },
|
235
235
|
} });
|
236
236
|
export {
|
237
|
-
|
237
|
+
e as default
|
238
238
|
};
|
239
239
|
//# sourceMappingURL=button.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../../../src/features/ui/theme/button.ts"],"sourcesContent":["import type {\n IButtonSizeConfig,\n TButtonSizes,\n IButtonVariantConfig,\n TButtonVariants,\n} from '../types';\n\ninterface IGetButtonConfig {\n (gutter: number): {\n sizes: Record<TButtonSizes, IButtonSizeConfig>;\n variants: Record<TButtonVariants, IButtonVariantConfig>;\n };\n}\n\nconst getButtonConfig: IGetButtonConfig = (gutter: number) => {\n const sizes: Record<TButtonSizes, IButtonSizeConfig> = {\n xsmall: {\n height: gutter * 2,\n paddingHorizontal: gutter * (1 + 0.375),\n textVariant: 'ub3-bold',\n borderWidth: 1,\n iconSize: gutter,\n iconPadding: gutter * 0.25,\n loaderSize: gutter * 1.25,\n },\n small: {\n height: gutter * 2.5,\n paddingHorizontal: gutter * (1 + 0.625),\n textVariant: 'ub2-bold',\n borderWidth: 1,\n iconSize: gutter * 1.25,\n iconPadding: gutter * 0.375,\n loaderSize: gutter * 1.5,\n },\n regular: {\n height: gutter * 3,\n paddingHorizontal: gutter * (1 + 0.875),\n textVariant: 'ub1-bold',\n borderWidth: 1,\n iconSize: gutter * 1.5,\n iconPadding: gutter * 0.5,\n loaderSize: gutter * 1.75,\n },\n medium: {\n height: gutter * 3.5,\n paddingHorizontal: gutter * (1 + 1.125),\n textVariant: 'ub1-bold',\n borderWidth: 1.5,\n iconSize: gutter * 1.5,\n iconPadding: gutter * 0.5,\n loaderSize: gutter * 2,\n },\n large: {\n height: gutter * 4,\n paddingHorizontal: gutter * (1 + 1.375),\n textVariant: 'ub1-bold',\n borderWidth: 2,\n iconSize: gutter * 1.5,\n iconPadding: gutter * 0.5,\n loaderSize: gutter * 2.25,\n },\n };\n\n const variants: Record<TButtonVariants, IButtonVariantConfig> = {\n 'primary': {\n backgroundColorName: {\n inactive: 'YELLOW_4',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'WHITE',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'secondary': {\n backgroundColorName: {\n inactive: 'WHITE',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'WHITE',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'tertiary': {\n backgroundColorName: {\n inactive: 'RED',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'WHITE',\n active: 'WHITE',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'secondary-gray': {\n backgroundColorName: {\n inactive: 'WHITE',\n active: 'WHITE_4',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'secondary-dark': {\n backgroundColorName: {\n inactive: 'WHITE',\n active: 'BLACK',\n disabled: 'WHITE_T_10',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'WHITE',\n disabled: 'WHITE_T_38',\n },\n borderColorName: {\n inactive: 'WHITE',\n active: 'BLACK',\n disabled: 'WHITE_T_15',\n },\n },\n '
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../../src/features/ui/theme/button.ts"],"sourcesContent":["import type {\n IButtonSizeConfig,\n TButtonSizes,\n IButtonVariantConfig,\n TButtonVariants,\n} from '../types';\n\ninterface IGetButtonConfig {\n (gutter: number): {\n sizes: Record<TButtonSizes, IButtonSizeConfig>;\n variants: Record<TButtonVariants, IButtonVariantConfig>;\n };\n}\n\nconst getButtonConfig: IGetButtonConfig = (gutter: number) => {\n const sizes: Record<TButtonSizes, IButtonSizeConfig> = {\n xsmall: {\n height: gutter * 2,\n paddingHorizontal: gutter * (1 + 0.375),\n textVariant: 'ub3-bold',\n borderWidth: 1,\n iconSize: gutter,\n iconPadding: gutter * 0.25,\n loaderSize: gutter * 1.25,\n },\n small: {\n height: gutter * 2.5,\n paddingHorizontal: gutter * (1 + 0.625),\n textVariant: 'ub2-bold',\n borderWidth: 1,\n iconSize: gutter * 1.25,\n iconPadding: gutter * 0.375,\n loaderSize: gutter * 1.5,\n },\n regular: {\n height: gutter * 3,\n paddingHorizontal: gutter * (1 + 0.875),\n textVariant: 'ub1-bold',\n borderWidth: 1,\n iconSize: gutter * 1.5,\n iconPadding: gutter * 0.5,\n loaderSize: gutter * 1.75,\n },\n medium: {\n height: gutter * 3.5,\n paddingHorizontal: gutter * (1 + 1.125),\n textVariant: 'ub1-bold',\n borderWidth: 1.5,\n iconSize: gutter * 1.5,\n iconPadding: gutter * 0.5,\n loaderSize: gutter * 2,\n },\n large: {\n height: gutter * 4,\n paddingHorizontal: gutter * (1 + 1.375),\n textVariant: 'ub1-bold',\n borderWidth: 2,\n iconSize: gutter * 1.5,\n iconPadding: gutter * 0.5,\n loaderSize: gutter * 2.25,\n },\n };\n\n const variants: Record<TButtonVariants, IButtonVariantConfig> = {\n 'primary': {\n backgroundColorName: {\n inactive: 'YELLOW_4',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'WHITE',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'secondary': {\n backgroundColorName: {\n inactive: 'WHITE',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'WHITE',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'tertiary': {\n backgroundColorName: {\n inactive: 'RED',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'WHITE',\n active: 'WHITE',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'secondary-gray': {\n backgroundColorName: {\n inactive: 'WHITE',\n active: 'WHITE_4',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'secondary-dark': {\n backgroundColorName: {\n inactive: 'WHITE',\n active: 'BLACK',\n disabled: 'WHITE_T_10',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'WHITE',\n disabled: 'WHITE_T_38',\n },\n borderColorName: {\n inactive: 'WHITE',\n active: 'BLACK',\n disabled: 'WHITE_T_15',\n },\n },\n // 'yellow': {\n // backgroundColorName: {\n // inactive: 'YELLOW_4',\n // active: 'BLACK_4',\n // disabled: 'BLACK_T_35',\n // },\n // borderColorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'BLACK_T_35',\n // },\n // colorName: {\n // inactive: 'BLACK_4',\n // active: 'WHITE_4',\n // disabled: 'BLACK_T_35',\n // },\n // },\n // 'yellow-dark': {\n // backgroundColorName: {\n // inactive: 'YELLOW_4',\n // active: 'WHITE_4',\n // disabled: 'WHITE_T_40',\n // },\n // borderColorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'WHITE_T_40',\n // },\n // colorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'WHITE_T_40',\n // },\n // },\n // 'white': {\n // backgroundColorName: {\n // inactive: 'WHITE_1',\n // active: 'BLACK_T_35',\n // disabled: 'BLACK_T_35',\n // },\n // borderColorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'BLACK_T_35',\n // },\n // colorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'BLACK_T_35',\n // },\n // },\n // 'white-dark': {\n // backgroundColorName: {\n // inactive: 'WHITE_4',\n // active: 'WHITE_T_70',\n // disabled: 'WHITE_T_40',\n // },\n // borderColorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'WHITE_T_40',\n // },\n // colorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'WHITE_T_40',\n // },\n // },\n // 'black': {\n // backgroundColorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_T_60',\n // disabled: 'BLACK_T_35',\n // },\n // borderColorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'BLACK_T_35',\n // },\n // colorName: {\n // inactive: 'WHITE_4',\n // active: 'WHITE_4',\n // disabled: 'BLACK_T_35',\n // },\n // },\n // 'black-dark': {\n // backgroundColorName: {\n // inactive: 'BLACK_4',\n // active: 'WHITE_T_40',\n // disabled: 'WHITE_T_40',\n // },\n // borderColorName: {\n // inactive: 'WHITE_4',\n // active: 'WHITE_4',\n // disabled: 'WHITE_T_40',\n // },\n // colorName: {\n // inactive: 'WHITE_4',\n // active: 'WHITE_4',\n // disabled: 'WHITE_T_40',\n // },\n // },\n };\n\n return { sizes, variants };\n};\n\nexport default getButtonConfig;\n"],"names":["getButtonConfig","gutter"],"mappings":"AAcM,MAAAA,IAAoC,CAACC,OA+OlC,EAAE,OA9O8C;AAAA,EACrD,QAAQ;AAAA,IACN,QAAQA,IAAS;AAAA,IACjB,mBAAmBA,IAAU;AAAA,IAC7B,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAUA;AAAA,IACV,aAAaA,IAAS;AAAA,IACtB,YAAYA,IAAS;AAAA,EACvB;AAAA,EACA,OAAO;AAAA,IACL,QAAQA,IAAS;AAAA,IACjB,mBAAmBA,IAAU;AAAA,IAC7B,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAUA,IAAS;AAAA,IACnB,aAAaA,IAAS;AAAA,IACtB,YAAYA,IAAS;AAAA,EACvB;AAAA,EACA,SAAS;AAAA,IACP,QAAQA,IAAS;AAAA,IACjB,mBAAmBA,IAAU;AAAA,IAC7B,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAUA,IAAS;AAAA,IACnB,aAAaA,IAAS;AAAA,IACtB,YAAYA,IAAS;AAAA,EACvB;AAAA,EACA,QAAQ;AAAA,IACN,QAAQA,IAAS;AAAA,IACjB,mBAAmBA,IAAU;AAAA,IAC7B,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAUA,IAAS;AAAA,IACnB,aAA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,MACV,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,IACA,iBAAiB;AAAA,MACf,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA,kBAAkB;AAAA,IAChB,qBAAqB;AAAA,MACnB,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,IACA,WAAW;AAAA,MACT,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,IACA,iBAAiB;AAAA,MACf,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -1,21 +1,21 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
1
|
+
import { jsx as L } from "react/jsx-runtime";
|
2
|
+
import { memo as M, useRef as y, useCallback as R, useEffect as m } from "react";
|
3
3
|
import g from "../hooks/use-learnosity-append.js";
|
4
|
-
import { LearnosityQuestionContainer as
|
5
|
-
const
|
4
|
+
import { LearnosityQuestionContainer as O } from "./worksheet-question-styled.js";
|
5
|
+
const Q = ["numberline", "imageclozeassociationV2"], $ = M(
|
6
6
|
({
|
7
|
-
signedRequest:
|
7
|
+
signedRequest: v,
|
8
8
|
appended: o,
|
9
9
|
canRender: I,
|
10
10
|
canForceAppend: a,
|
11
11
|
question: t,
|
12
12
|
response: s,
|
13
|
-
learnosity:
|
14
|
-
isConceptIntro:
|
13
|
+
learnosity: _,
|
14
|
+
isConceptIntro: A,
|
15
15
|
simState: c,
|
16
|
-
onMediaStateChange:
|
16
|
+
onMediaStateChange: w
|
17
17
|
}) => {
|
18
|
-
const l =
|
18
|
+
const l = y(null), n = y(s), { forceAppend: p } = g(v), d = R(
|
19
19
|
(e) => {
|
20
20
|
const { source: r, data: i } = e, { type: u } = i ?? {};
|
21
21
|
u === "SIM_IS_READY" ? r.postMessage(
|
@@ -27,10 +27,10 @@ const N = R(
|
|
27
27
|
}
|
28
28
|
},
|
29
29
|
"*"
|
30
|
-
) : u === "SIM_STATE_UPDATE" &&
|
30
|
+
) : u === "SIM_STATE_UPDATE" && w(t, "SIMULATION", e.data.payload);
|
31
31
|
},
|
32
|
-
[a, c,
|
33
|
-
),
|
32
|
+
[a, c, w, t]
|
33
|
+
), E = R(
|
34
34
|
(e) => {
|
35
35
|
window.requestAnimationFrame(() => {
|
36
36
|
var i, u, T;
|
@@ -40,20 +40,20 @@ const N = R(
|
|
40
40
|
}), (T = l.current) == null || T.append(r), p({
|
41
41
|
question: t,
|
42
42
|
response: e,
|
43
|
-
removeOldElements: t.type
|
43
|
+
removeOldElements: Q.includes(t.type) ? "before" : "after",
|
44
44
|
callback: (f) => {
|
45
|
-
f || (n.current && n.current !== e ?
|
45
|
+
f || (n.current && n.current !== e ? E(n.current) : n.current = void 0);
|
46
46
|
}
|
47
47
|
});
|
48
48
|
});
|
49
49
|
},
|
50
50
|
[p, t]
|
51
|
-
),
|
51
|
+
), S = y(!1);
|
52
52
|
return m(() => {
|
53
53
|
let e;
|
54
|
-
return I && (
|
54
|
+
return I && (S.current || (e = window.requestAnimationFrame(() => {
|
55
55
|
const r = n.current ?? s;
|
56
|
-
|
56
|
+
S.current = !0, _.appendQuestion({
|
57
57
|
questions: [t],
|
58
58
|
...r ? {
|
59
59
|
responses: {
|
@@ -67,7 +67,7 @@ const N = R(
|
|
67
67
|
}))), () => {
|
68
68
|
e && window.cancelAnimationFrame(e);
|
69
69
|
};
|
70
|
-
}, [I,
|
70
|
+
}, [I, _, t, s]), m(() => {
|
71
71
|
var e;
|
72
72
|
return o && (n.current = void 0, (e = l.current) != null && e.querySelector("iframe") && window.addEventListener("message", d)), () => {
|
73
73
|
window.removeEventListener("message", d);
|
@@ -85,19 +85,19 @@ const N = R(
|
|
85
85
|
));
|
86
86
|
}
|
87
87
|
}, [o, a, c]), m(() => {
|
88
|
-
o && s && a && s !== n.current && (n.current ? n.current = s : (n.current = s,
|
89
|
-
}, [o, a, s,
|
90
|
-
|
88
|
+
o && s && a && s !== n.current && (n.current ? n.current = s : (n.current = s, E(s)));
|
89
|
+
}, [o, a, s, E]), /* @__PURE__ */ L(
|
90
|
+
O,
|
91
91
|
{
|
92
92
|
ref: l,
|
93
|
-
$isConceptIntro:
|
93
|
+
$isConceptIntro: A,
|
94
94
|
$isTeacher: a,
|
95
|
-
children: /* @__PURE__ */
|
95
|
+
children: /* @__PURE__ */ L("div", { className: `learnosity-response question-${t.response_id}` })
|
96
96
|
}
|
97
97
|
);
|
98
98
|
}
|
99
99
|
);
|
100
100
|
export {
|
101
|
-
|
101
|
+
$ as default
|
102
102
|
};
|
103
103
|
//# sourceMappingURL=learnosity-question.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"learnosity-question.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-question/learnosity-question.tsx"],"sourcesContent":["import type { ILearnosityQuestionResponse } from '../worksheet-types';\nimport type { ILearnosityQuestionProps } from './worksheet-question-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useRef } from 'react';\n\nimport useLearnosityAppend from '../hooks/use-learnosity-append';\nimport * as Styled from './worksheet-question-styled';\n\nconst LearnosityQuestion: FC<ILearnosityQuestionProps> = memo(\n ({\n signedRequest,\n appended,\n canRender,\n canForceAppend,\n question,\n response,\n learnosity,\n isConceptIntro,\n simState,\n onMediaStateChange,\n }) => {\n const containerElementRef = useRef<HTMLDivElement>(null);\n const latestQuestionResponseRef = useRef<ILearnosityQuestionResponse | undefined>(response);\n const { forceAppend } = useLearnosityAppend(signedRequest);\n\n const handleSimIframeMessage = useCallback(\n (event: MessageEvent) => {\n const { source, data } = event;\n const { type } = data ?? ({} as { type: string });\n\n if (type === 'SIM_IS_READY') {\n (source as Window).postMessage(\n {\n type: 'SIMULATION_CONFIG',\n payload: {\n userRole: canForceAppend ? 'teacher' : 'student',\n simulationState: simState,\n },\n },\n '*',\n );\n } else if (type === 'SIM_STATE_UPDATE') {\n onMediaStateChange(question, 'SIMULATION', event.data.payload);\n }\n },\n [canForceAppend, simState, onMediaStateChange, question],\n );\n\n const updateResponse = useCallback(\n (newResponse: ILearnosityQuestionResponse) => {\n window.requestAnimationFrame(() => {\n const questionElement = document.createElement('div');\n\n questionElement.classList.add('learnosity-response');\n questionElement.classList.add(`question-${question.response_id}`);\n // Drawing questions looks for already appended path elements with id, if present it will not append the path, to overcome this issue we are adding temp to the id\n containerElementRef.current?.children[0]\n ?.querySelectorAll('.lrn_drawing svg path')\n .forEach(path => {\n path.id = `${path.id} + temp`;\n });\n\n containerElementRef.current?.append(questionElement);\n forceAppend({\n question,\n response: newResponse,\n removeOldElements: question.type
|
1
|
+
{"version":3,"file":"learnosity-question.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-question/learnosity-question.tsx"],"sourcesContent":["import type { ILearnosityQuestionResponse } from '../worksheet-types';\nimport type { ILearnosityQuestionProps } from './worksheet-question-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useRef } from 'react';\n\nimport useLearnosityAppend from '../hooks/use-learnosity-append';\nimport * as Styled from './worksheet-question-styled';\n\nconst REMOVE_BEFORE_QUESTIONS = ['numberline', 'imageclozeassociationV2'];\n\nconst LearnosityQuestion: FC<ILearnosityQuestionProps> = memo(\n ({\n signedRequest,\n appended,\n canRender,\n canForceAppend,\n question,\n response,\n learnosity,\n isConceptIntro,\n simState,\n onMediaStateChange,\n }) => {\n const containerElementRef = useRef<HTMLDivElement>(null);\n const latestQuestionResponseRef = useRef<ILearnosityQuestionResponse | undefined>(response);\n const { forceAppend } = useLearnosityAppend(signedRequest);\n\n const handleSimIframeMessage = useCallback(\n (event: MessageEvent) => {\n const { source, data } = event;\n const { type } = data ?? ({} as { type: string });\n\n if (type === 'SIM_IS_READY') {\n (source as Window).postMessage(\n {\n type: 'SIMULATION_CONFIG',\n payload: {\n userRole: canForceAppend ? 'teacher' : 'student',\n simulationState: simState,\n },\n },\n '*',\n );\n } else if (type === 'SIM_STATE_UPDATE') {\n onMediaStateChange(question, 'SIMULATION', event.data.payload);\n }\n },\n [canForceAppend, simState, onMediaStateChange, question],\n );\n\n const updateResponse = useCallback(\n (newResponse: ILearnosityQuestionResponse) => {\n window.requestAnimationFrame(() => {\n const questionElement = document.createElement('div');\n\n questionElement.classList.add('learnosity-response');\n questionElement.classList.add(`question-${question.response_id}`);\n // Drawing questions looks for already appended path elements with id, if present it will not append the path, to overcome this issue we are adding temp to the id\n containerElementRef.current?.children[0]\n ?.querySelectorAll('.lrn_drawing svg path')\n .forEach(path => {\n path.id = `${path.id} + temp`;\n });\n\n containerElementRef.current?.append(questionElement);\n forceAppend({\n question,\n response: newResponse,\n removeOldElements: REMOVE_BEFORE_QUESTIONS.includes(question.type) ? 'before' : 'after',\n callback: error => {\n if (error) return;\n\n if (\n latestQuestionResponseRef.current &&\n latestQuestionResponseRef.current !== newResponse\n )\n updateResponse(latestQuestionResponseRef.current);\n else latestQuestionResponseRef.current = undefined;\n },\n });\n });\n },\n [forceAppend, question],\n );\n\n const appendQuestionCalledRef = useRef(false);\n\n useEffect(() => {\n let requestId: number;\n\n if (canRender) {\n if (!appendQuestionCalledRef.current) {\n requestId = window.requestAnimationFrame(() => {\n const appenndableResponse = latestQuestionResponseRef.current ?? response;\n\n appendQuestionCalledRef.current = true;\n learnosity.appendQuestion({\n questions: [question],\n ...(appenndableResponse\n ? {\n responses: {\n [question.response_id]: {\n // Learnosity is mutating the response object, so we need to clone it\n ...appenndableResponse,\n },\n },\n }\n : {}),\n });\n });\n }\n }\n\n return () => {\n if (requestId) window.cancelAnimationFrame(requestId);\n };\n }, [canRender, learnosity, question, response]);\n\n useEffect(() => {\n if (appended) {\n latestQuestionResponseRef.current = undefined;\n\n if (containerElementRef.current?.querySelector('iframe')) {\n window.addEventListener('message', handleSimIframeMessage);\n }\n }\n\n return () => {\n window.removeEventListener('message', handleSimIframeMessage);\n };\n }, [appended, handleSimIframeMessage]);\n\n useEffect(() => {\n if (simState && appended) {\n const simIframe = containerElementRef.current?.querySelector('iframe');\n\n if (simIframe) {\n simIframe.contentWindow?.postMessage(\n {\n type: 'SIM_STATE_UPDATE',\n payload: simState,\n },\n '*',\n );\n }\n }\n }, [appended, canForceAppend, simState]);\n\n useEffect(() => {\n if (appended && response && canForceAppend) {\n if (response !== latestQuestionResponseRef.current) {\n if (!latestQuestionResponseRef.current) {\n latestQuestionResponseRef.current = response;\n updateResponse(response);\n } else {\n latestQuestionResponseRef.current = response;\n }\n }\n }\n }, [appended, canForceAppend, response, updateResponse]);\n\n return (\n <Styled.LearnosityQuestionContainer\n ref={containerElementRef}\n $isConceptIntro={isConceptIntro}\n $isTeacher={canForceAppend}\n >\n <div className={`learnosity-response question-${question.response_id}`} />\n </Styled.LearnosityQuestionContainer>\n );\n },\n);\n\nexport default LearnosityQuestion;\n"],"names":["REMOVE_BEFORE_QUESTIONS","LearnosityQuestion","memo","signedRequest","appended","canRender","canForceAppend","question","response","learnosity","isConceptIntro","simState","onMediaStateChange","containerElementRef","useRef","latestQuestionResponseRef","forceAppend","useLearnosityAppend","handleSimIframeMessage","useCallback","event","source","data","type","updateResponse","newResponse","questionElement","_b","_a","path","_c","error","appendQuestionCalledRef","useEffect","requestId","appenndableResponse","simIframe","jsx","Styled.LearnosityQuestionContainer"],"mappings":";;;;AASA,MAAMA,IAA0B,CAAC,cAAc,yBAAyB,GAElEC,IAAmDC;AAAA,EACvD,CAAC;AAAA,IACC,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAsBC,EAAuB,IAAI,GACjDC,IAA4BD,EAAgDN,CAAQ,GACpF,EAAE,aAAAQ,EAAA,IAAgBC,EAAoBd,CAAa,GAEnDe,IAAyBC;AAAA,MAC7B,CAACC,MAAwB;AACjB,cAAA,EAAE,QAAAC,GAAQ,MAAAC,EAAS,IAAAF,GACnB,EAAE,MAAAG,EAAA,IAASD,KAAS;AAE1B,QAAIC,MAAS,iBACVF,EAAkB;AAAA,UACjB;AAAA,YACE,MAAM;AAAA,YACN,SAAS;AAAA,cACP,UAAUf,IAAiB,YAAY;AAAA,cACvC,iBAAiBK;AAAA,YACnB;AAAA,UACF;AAAA,UACA;AAAA,QAAA,IAEOY,MAAS,sBAClBX,EAAmBL,GAAU,cAAca,EAAM,KAAK,OAAO;AAAA,MAEjE;AAAA,MACA,CAACd,GAAgBK,GAAUC,GAAoBL,CAAQ;AAAA,IAAA,GAGnDiB,IAAiBL;AAAA,MACrB,CAACM,MAA6C;AAC5C,eAAO,sBAAsB,MAAM;;AAC3B,gBAAAC,IAAkB,SAAS,cAAc,KAAK;AAEpC,UAAAA,EAAA,UAAU,IAAI,qBAAqB,GACnDA,EAAgB,UAAU,IAAI,YAAYnB,EAAS,WAAW,EAAE,IAE5CoB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