@cuemath/leap 3.2.34-mb → 3.2.34-mbx
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/line-icons/icons/info.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/question-overview.js +16 -16
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-styled.js +4 -4
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome-styled.js +4 -4
- package/dist/features/sheets/sheets-list/sheet-item/sheet-item-styled.js +8 -8
- package/dist/features/stickers/sticker-selector/sticker-selector.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-sidebar/question-guide.js +90 -51
- package/dist/features/worksheet/worksheet/worksheet-sidebar/question-guide.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-sidebar/worksheet-sidebar-styled.js +27 -22
- package/dist/features/worksheet/worksheet/worksheet-sidebar/worksheet-sidebar-styled.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.js","sources":["../../../../src/assets/line-icons/icons/info.tsx"],"sourcesContent":["const InfoIcon: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M12.0003 20.3334C16.6027 20.3334 20.3337 16.6025 20.3337 12.0001C20.3337 7.39771 16.6027 3.66675 12.0003 3.66675C7.39795 3.66675 3.66699 7.39771 3.66699 12.0001C3.66699 16.6025 7.39795 20.3334 12.0003 20.3334Z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M12 15.3333V12\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"square\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M12 8.66675H12.0083\"\n stroke=\"currentColor\"\n strokeWidth=\"2.08\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport default InfoIcon;\n"],"names":["InfoIcon","props","jsxs","jsx","
|
|
1
|
+
{"version":3,"file":"info.js","sources":["../../../../src/assets/line-icons/icons/info.tsx"],"sourcesContent":["const InfoIcon: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M12.0003 20.3334C16.6027 20.3334 20.3337 16.6025 20.3337 12.0001C20.3337 7.39771 16.6027 3.66675 12.0003 3.66675C7.39795 3.66675 3.66699 7.39771 3.66699 12.0001C3.66699 16.6025 7.39795 20.3334 12.0003 20.3334Z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M12 15.3333V12\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"square\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M12 8.66675H12.0083\"\n stroke=\"currentColor\"\n strokeWidth=\"2.08\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport default InfoIcon;\n"],"names":["InfoIcon","props","jsxs","jsx","StickerIcon"],"mappings":";AAAA,MAAMA,IAAoD,CACxDC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACL,GAAGD;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,eAAc;AAAA,UACd,gBAAe;AAAA,QAAA;AAAA,MACjB;AAAA,MACA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,eAAc;AAAA,UACd,gBAAe;AAAA,QAAA;AAAA,MACjB;AAAA,MACA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,eAAc;AAAA,UACd,gBAAe;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EAAA;AACF,GAGFC,IAAeJ;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { memo as a } from "react";
|
|
3
3
|
import h from "../../../../../../assets/line-icons/icons/info.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import y from "../../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
|
5
|
+
import f from "../../../../../ui/buttons/text-button/text-button.js";
|
|
6
6
|
import { ZINDEX as p } from "../../../../../ui/constants/z-index.js";
|
|
7
7
|
import o from "../../../../../ui/layout/flex-view.js";
|
|
8
8
|
import i from "../../../../../ui/text/text.js";
|
|
9
9
|
import { SAT_TEST_QUESTION_STATUS as $ } from "../../../constants/index.js";
|
|
10
|
-
import { FlexText as A, StyledCheckIcon as
|
|
10
|
+
import { FlexText as A, StyledCheckIcon as S, StyledCrossIcon as T, StyledMinusIcon as b, TableRow as d, StyledTableBody as I } from "./sat-sheet-summary-styled.js";
|
|
11
11
|
const { CORRECT: g, INCORRECT: C, UNSCORED: x } = $, w = [
|
|
12
12
|
{
|
|
13
13
|
key: "section-column",
|
|
@@ -29,35 +29,35 @@ const { CORRECT: g, INCORRECT: C, UNSCORED: x } = $, w = [
|
|
|
29
29
|
label: "Action",
|
|
30
30
|
centerAlign: !0
|
|
31
31
|
}
|
|
32
|
-
],
|
|
32
|
+
], k = "Unscored questions are those which do not impact your final mark, so it does not matter if you get them right or wrong.", R = a(({ status: r }) => r === x ? /* @__PURE__ */ c(A, { $renderAs: "body2", $align: "center", $opacity: 0.5, children: [
|
|
33
33
|
"Unscored",
|
|
34
34
|
" ",
|
|
35
35
|
/* @__PURE__ */ e(
|
|
36
|
-
|
|
36
|
+
y,
|
|
37
37
|
{
|
|
38
38
|
renderAs: "primary",
|
|
39
39
|
position: "bottom",
|
|
40
|
-
tooltipItem:
|
|
40
|
+
tooltipItem: k,
|
|
41
41
|
zIndex: p.SAT_SUMMARY_SCORE,
|
|
42
42
|
widthX: 19.6025,
|
|
43
43
|
children: /* @__PURE__ */ e(h, {})
|
|
44
44
|
}
|
|
45
45
|
)
|
|
46
|
-
] }) : r === g ? /* @__PURE__ */ e(
|
|
46
|
+
] }) : r === g ? /* @__PURE__ */ e(S, {}) : r === C ? /* @__PURE__ */ e(T, {}) : /* @__PURE__ */ e(b, {})), X = ({ questionByQuestionList: r, onReview: m }) => /* @__PURE__ */ c(o, { $flexGapX: 1, children: [
|
|
47
47
|
/* @__PURE__ */ e(i, { $renderAs: "eyebrow2", children: "Question by question overview" }),
|
|
48
48
|
/* @__PURE__ */ c("table", { children: [
|
|
49
49
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e(d, { children: w.map((l) => {
|
|
50
|
-
const { key:
|
|
51
|
-
return /* @__PURE__ */ e("th", { children: /* @__PURE__ */ e(i, { $renderAs: "body2", $opacity: 0.5, $align: s ? "center" : "left", children:
|
|
50
|
+
const { key: t, label: n, centerAlign: s } = l;
|
|
51
|
+
return /* @__PURE__ */ e("th", { children: /* @__PURE__ */ e(i, { $renderAs: "body2", $opacity: 0.5, $align: s ? "center" : "left", children: n }) }, t);
|
|
52
52
|
}) }) }),
|
|
53
|
-
/* @__PURE__ */ e(
|
|
54
|
-
const { question_no:
|
|
53
|
+
/* @__PURE__ */ e(I, { children: r.map((l) => {
|
|
54
|
+
const { question_no: t, section: n, score: s, user_node_id: u } = l;
|
|
55
55
|
return /* @__PURE__ */ c(d, { children: [
|
|
56
|
-
/* @__PURE__ */ e(i, { $renderAs: "body2", children:
|
|
57
|
-
/* @__PURE__ */ e(o, { $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ e(i, { $renderAs: "cta2", $align: "center", children:
|
|
58
|
-
/* @__PURE__ */ e(o, { $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ e(
|
|
59
|
-
/* @__PURE__ */ e(o, { $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ e(
|
|
60
|
-
] }, `${
|
|
56
|
+
/* @__PURE__ */ e(i, { $renderAs: "body2", children: n }),
|
|
57
|
+
/* @__PURE__ */ e(o, { $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ e(i, { $renderAs: "cta2", $align: "center", children: t }) }),
|
|
58
|
+
/* @__PURE__ */ e(o, { $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ e(R, { status: s }) }),
|
|
59
|
+
/* @__PURE__ */ e(o, { $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ e(f, { label: "Review", onClick: () => m(u, t - 1) }) })
|
|
60
|
+
] }, `${t}_${n}`);
|
|
61
61
|
}) })
|
|
62
62
|
] })
|
|
63
63
|
] });
|
|
@@ -3,7 +3,7 @@ import g from "../../../../../assets/line-icons/icons/chevron-down.js";
|
|
|
3
3
|
import $ from "../../../../../assets/line-icons/icons/info.js";
|
|
4
4
|
import i from "../../../../ui/layout/flex-view.js";
|
|
5
5
|
import s from "../../../../ui/text/text.js";
|
|
6
|
-
const
|
|
6
|
+
const m = x`
|
|
7
7
|
0% {
|
|
8
8
|
opacity: 0;
|
|
9
9
|
}
|
|
@@ -12,7 +12,7 @@ const f = x`
|
|
|
12
12
|
}
|
|
13
13
|
`, v = r(i)`
|
|
14
14
|
position: relative;
|
|
15
|
-
animation: ${
|
|
15
|
+
animation: ${m} 0.3s ease-in-out;
|
|
16
16
|
`;
|
|
17
17
|
r(g)(({ theme: o, $expanded: t }) => {
|
|
18
18
|
const {
|
|
@@ -129,7 +129,7 @@ const A = r.div(({ theme: o }) => {
|
|
|
129
129
|
position: absolute;
|
|
130
130
|
inset: 50%;
|
|
131
131
|
transform: translate(-50%, -50%) rotate(-90deg);
|
|
132
|
-
`),
|
|
132
|
+
`), S = r.circle(
|
|
133
133
|
({ theme: o, $progressCircle: t, $progress: e, $progressBackground: n }) => {
|
|
134
134
|
const { colors: p, layout: l } = o, { GREY_2: c } = p, { gutter: a } = l, d = a * 12.5, u = t ? d - e : e;
|
|
135
135
|
return `
|
|
@@ -148,7 +148,7 @@ r(s)(({ theme: o, $backgroundColor: t }) => `
|
|
|
148
148
|
`);
|
|
149
149
|
export {
|
|
150
150
|
G as ChapterProgressSVG,
|
|
151
|
-
|
|
151
|
+
S as ChapterProgressSVGCircle,
|
|
152
152
|
C as Content,
|
|
153
153
|
k as ContentWrapper,
|
|
154
154
|
v as MainContainer,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import t from "styled-components";
|
|
2
|
-
import
|
|
2
|
+
import p from "../../../../../../assets/line-icons/icons/info.js";
|
|
3
3
|
import e from "../../../../../ui/layout/flex-view.js";
|
|
4
4
|
import r from "../../../../../ui/text/text.js";
|
|
5
5
|
const m = t(e)`
|
|
6
6
|
transform: translateY(2px);
|
|
7
|
-
`,
|
|
7
|
+
`, c = t(r)(() => `
|
|
8
8
|
display: -webkit-box;
|
|
9
9
|
-webkit-box-orient: vertical;
|
|
10
10
|
-webkit-line-clamp: 2;
|
|
@@ -25,7 +25,7 @@ t(e)(({ theme: o }) => {
|
|
|
25
25
|
grid-row-gap: ${i * 0.625}px;
|
|
26
26
|
`;
|
|
27
27
|
});
|
|
28
|
-
t(
|
|
28
|
+
t(p)(
|
|
29
29
|
() => `
|
|
30
30
|
position: relative;
|
|
31
31
|
cursor: pointer;
|
|
@@ -33,6 +33,6 @@ t(n)(
|
|
|
33
33
|
);
|
|
34
34
|
export {
|
|
35
35
|
m as NumbersWrapper,
|
|
36
|
-
|
|
36
|
+
c as StyledText
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=outcome-styled.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "styled-components";
|
|
2
|
-
import
|
|
2
|
+
import i from "../../../../assets/line-icons/icons/info.js";
|
|
3
3
|
import p from "../../../ui/layout/flex-view.js";
|
|
4
|
-
import
|
|
4
|
+
import s from "../../../ui/text/text.js";
|
|
5
5
|
const x = e(p)(({
|
|
6
6
|
theme: t,
|
|
7
7
|
$disabled: o
|
|
@@ -29,11 +29,11 @@ const x = e(p)(({
|
|
|
29
29
|
flex-grow: 1;
|
|
30
30
|
opacity: ${t ? 0.5 : 1};
|
|
31
31
|
`), y = e.img(
|
|
32
|
-
({ theme: t, $gutter: o, $gap: r, $width: n, $height:
|
|
33
|
-
const { gutter:
|
|
32
|
+
({ theme: t, $gutter: o, $gap: r, $width: n, $height: a }) => {
|
|
33
|
+
const { gutter: c } = t.layout;
|
|
34
34
|
return `
|
|
35
|
-
width: ${n ||
|
|
36
|
-
height: ${
|
|
35
|
+
width: ${n || c * 3}px;
|
|
36
|
+
height: ${a || c * 2.75}px;
|
|
37
37
|
padding: ${r || 0}px ${o || 0}px;
|
|
38
38
|
`;
|
|
39
39
|
}
|
|
@@ -43,7 +43,7 @@ const x = e(p)(({
|
|
|
43
43
|
display: flex;
|
|
44
44
|
gap: ${o * 0.25}px;
|
|
45
45
|
`;
|
|
46
|
-
}), f = e(
|
|
46
|
+
}), f = e(s)(({ theme: t }) => {
|
|
47
47
|
const { gutter: o } = t.layout, { GREY_1: r } = t.colors;
|
|
48
48
|
return `
|
|
49
49
|
padding: ${o * 0.5}px;
|
|
@@ -52,7 +52,7 @@ const x = e(p)(({
|
|
|
52
52
|
font-weight: 700;
|
|
53
53
|
font-size: ${o * 0.625}px;
|
|
54
54
|
`;
|
|
55
|
-
}), S = e(
|
|
55
|
+
}), S = e(i)(({ theme: t }) => `
|
|
56
56
|
transform: rotate(180deg);
|
|
57
57
|
|
|
58
58
|
path {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticker-selector.js","sources":["../../../../src/features/stickers/sticker-selector/sticker-selector.tsx"],"sourcesContent":["import type { IStickerSelectorProps, IStickerData } from './sticker-selector-types';\n\nimport React, { memo, useCallback, useMemo } from 'react';\n\nimport useInClassMessageBroker from '../../communication/hooks/use-inclass-message-broker/use-inclass-message-broker';\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport { stickerData } from '../sticker-data';\nimport StickerSelectorGrid from './sticker-selector-grid';\n\nconst
|
|
1
|
+
{"version":3,"file":"sticker-selector.js","sources":["../../../../src/features/stickers/sticker-selector/sticker-selector.tsx"],"sourcesContent":["import type { IStickerSelectorProps, IStickerData } from './sticker-selector-types';\n\nimport React, { memo, useCallback, useMemo } from 'react';\n\nimport useInClassMessageBroker from '../../communication/hooks/use-inclass-message-broker/use-inclass-message-broker';\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport { stickerData } from '../sticker-data';\nimport StickerSelectorGrid from './sticker-selector-grid';\n\nconst StickersSelector: React.FC<IStickerSelectorProps> = ({\n triggerNode,\n studentClassroomId,\n gridConfig,\n tooltipConfig,\n visible,\n}) => {\n const { columns = 4, gap = 8, stickerSize = 48 } = gridConfig;\n const {\n isAnimated,\n arrowColor,\n arrowSize,\n arrowXCoOrdinates,\n arrowYCoOrdinates,\n backgroundColor,\n borderColor,\n position = 'bottom',\n renderAs = 'primary',\n textVariant,\n tooltipOffset,\n tooltipXCoOrdinates,\n tooltipYCoOrdinates,\n width,\n widthX,\n zIndex,\n parentWidth,\n isBlocking = false,\n } = tooltipConfig;\n const { publish } = useInClassMessageBroker({ studentClassroomId });\n\n const handleSend = useCallback(\n (sticker: IStickerData) =>\n publish?.({\n eventName: 'TEACHER_BADGE',\n eventPayload: {\n data: {\n selectedBadge: { id: sticker.id, name: sticker.name },\n badgeId: sticker.id,\n },\n },\n }),\n [publish],\n );\n\n const tooltipItem = useMemo(\n () => (\n <StickerSelectorGrid\n stickers={stickerData}\n columns={columns}\n gap={gap}\n stickerSize={stickerSize}\n onStickerClick={handleSend}\n />\n ),\n [columns, gap, handleSend, stickerSize],\n );\n\n return (\n <ArrowTooltip\n children={triggerNode}\n alwaysVisible\n hidden={!visible}\n tooltipItem={tooltipItem}\n renderAs={renderAs}\n position={position}\n isBlocking={isBlocking}\n isAnimated={isAnimated}\n zIndex={zIndex}\n width={width}\n widthX={widthX}\n parentWidth={parentWidth}\n backgroundColor={backgroundColor}\n borderColor={borderColor}\n textVariant={textVariant}\n tooltipOffset={tooltipOffset}\n arrowColor={arrowColor}\n arrowSize={arrowSize}\n arrowXCoOrdinates={arrowXCoOrdinates}\n arrowYCoOrdinates={arrowYCoOrdinates}\n tooltipXCoOrdinates={tooltipXCoOrdinates}\n tooltipYCoOrdinates={tooltipYCoOrdinates}\n />\n );\n};\n\nexport default memo(StickersSelector);\n"],"names":["StickersSelector","triggerNode","studentClassroomId","gridConfig","tooltipConfig","visible","columns","gap","stickerSize","isAnimated","arrowColor","arrowSize","arrowXCoOrdinates","arrowYCoOrdinates","backgroundColor","borderColor","position","renderAs","textVariant","tooltipOffset","tooltipXCoOrdinates","tooltipYCoOrdinates","width","widthX","zIndex","parentWidth","isBlocking","publish","useInClassMessageBroker","handleSend","useCallback","sticker","tooltipItem","useMemo","jsx","StickerSelectorGrid","stickerData","ArrowTooltip","StickerSelector","memo"],"mappings":";;;;;;AASA,MAAMA,IAAoD,CAAC;AAAA,EACzD,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,SAAAC;AACF,MAAM;AACJ,QAAM,EAAE,SAAAC,IAAU,GAAG,KAAAC,IAAM,GAAG,aAAAC,IAAc,GAAO,IAAAL,GAC7C;AAAA,IACJ,YAAAM;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IAC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eAAAC;AAAA,MACA,YAAAT;AAAA,MACA,WAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,qBAAAO;AAAA,MACA,qBAAAC;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeiB,IAAAC,EAAKvC,CAAgB;"}
|
|
@@ -1,80 +1,119 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { memo as
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { memo as V, useState as p, useCallback as s, useMemo as m, useRef as w, useEffect as W } from "react";
|
|
3
|
+
import Y from "../../../stickers/sticker-selector/sticker-selector.js";
|
|
4
|
+
import { useTrialSessionContext as M } from "../../../trial-session/context/use-trial-session-context.js";
|
|
3
5
|
import $ from "../../../ui/buttons/clickable/clickable.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { GuideContainer as
|
|
9
|
-
const
|
|
10
|
-
({ questionWidth:
|
|
11
|
-
var
|
|
12
|
-
const [t,
|
|
6
|
+
import i from "../../../ui/layout/flex-view.js";
|
|
7
|
+
import O from "../../../ui/separator/separator.js";
|
|
8
|
+
import d from "../../../ui/text/text.js";
|
|
9
|
+
import R from "../../constants/events.js";
|
|
10
|
+
import { StickersIcon as q, GuideContainer as z, HintIcon as U, SolIcon as D, Pointer as F, SectionContainer as Q, Section as J, CloseIcon as Z, Guide as ee } from "./worksheet-sidebar-styled.js";
|
|
11
|
+
const he = V(
|
|
12
|
+
({ questionWidth: C, questions: A, activeQuestionIndex: G, learnosity: b, actionbarHeight: I, loggerRef: a }) => {
|
|
13
|
+
var _;
|
|
14
|
+
const [t, h] = p(), [L, X] = p({
|
|
13
15
|
top: 0,
|
|
14
16
|
left: 0
|
|
15
|
-
}),
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}, [
|
|
20
|
-
|
|
17
|
+
}), [g, v] = p(!1), { studentId: T } = M(), { top: E, left: k } = L;
|
|
18
|
+
console.log("id", T);
|
|
19
|
+
const y = s(() => {
|
|
20
|
+
h("HINT"), a.current(R.WORKSHEET_V3_HINT_SEEN);
|
|
21
|
+
}, [a]), x = s(() => {
|
|
22
|
+
h("SOL"), a.current(R.WORKSHEET_V3_SOLUTION_SEEN);
|
|
23
|
+
}, [a]), B = s(() => {
|
|
24
|
+
h(() => {
|
|
21
25
|
});
|
|
22
|
-
}, []),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
}, []), S = s(() => {
|
|
27
|
+
v((c) => !c);
|
|
28
|
+
}, []), { hints: n, solution: u } = ((_ = A[G]) == null ? void 0 : _.metadata) || {}, r = m(() => t === void 0 ? void 0 : t === "HINT" ? n : u, [t, n, u]), H = w(null), N = w(null), f = s((c) => {
|
|
29
|
+
if (c.current) {
|
|
30
|
+
const l = c.current.getBoundingClientRect();
|
|
31
|
+
X({
|
|
32
|
+
top: l.top + l.height / 2 - 8,
|
|
33
|
+
left: l.right - 78
|
|
28
34
|
// 52px (sidebar width) + 16px (gutter) + 10px
|
|
29
35
|
});
|
|
30
36
|
}
|
|
31
|
-
}, [])
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/* @__PURE__ */ e(V, { width: 32, height: 32, $disabled: !n }),
|
|
37
|
-
/* @__PURE__ */ e(u, { $renderAs: "eyebrow2", $color: n ? "BLACK" : "GREY_4", children: "HINT" }),
|
|
38
|
-
/* @__PURE__ */ e(c, { $gap: 8, $alignItems: "center", children: /* @__PURE__ */ e(y, { width: 24, height: 1, background: "GREY_2" }) })
|
|
37
|
+
}, []), j = m(
|
|
38
|
+
() => /* @__PURE__ */ e($, { label: "teacher-badges", onClick: S, children: /* @__PURE__ */ o(i, { $alignItems: "center", $justifyContent: "center", children: [
|
|
39
|
+
/* @__PURE__ */ e(q, { width: 32, height: 32, $disabled: !g }),
|
|
40
|
+
/* @__PURE__ */ e(d, { $renderAs: "eyebrow2", $color: g ? "BLACK" : "GREY_4", children: "STICKERS" }),
|
|
41
|
+
/* @__PURE__ */ e(i, { $gap: 8, $alignItems: "center", children: /* @__PURE__ */ e(O, { width: 24, height: 1, background: "GREY_2" }) })
|
|
39
42
|
] }) }),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
[g, S]
|
|
44
|
+
), K = m(
|
|
45
|
+
() => ({
|
|
46
|
+
stickerSize: 48,
|
|
47
|
+
columns: 4,
|
|
48
|
+
gap: 8
|
|
49
|
+
}),
|
|
50
|
+
[]
|
|
51
|
+
), P = m(
|
|
52
|
+
() => ({
|
|
53
|
+
position: "bottom",
|
|
54
|
+
zIndex: 1e3,
|
|
55
|
+
arrowXCoOrdinates: 87.5,
|
|
56
|
+
tooltipXCoOrdinates: "-32.5%"
|
|
57
|
+
}),
|
|
58
|
+
[]
|
|
59
|
+
);
|
|
60
|
+
return t && r && b && b.renderMath("mathjax"), W(() => {
|
|
61
|
+
t === "HINT" ? f(N) : t === "SOL" ? f(H) : r || h(void 0);
|
|
62
|
+
}, [t, f, r]), /* @__PURE__ */ o(z, { $background: "WHITE", children: [
|
|
63
|
+
/* @__PURE__ */ e(
|
|
64
|
+
Y,
|
|
65
|
+
{
|
|
66
|
+
triggerNode: j,
|
|
67
|
+
studentClassroomId: T,
|
|
68
|
+
gridConfig: K,
|
|
69
|
+
tooltipConfig: P,
|
|
70
|
+
visible: g,
|
|
71
|
+
onToggle: S
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ e($, { label: "hints", onClick: y, disabled: !n, children: /* @__PURE__ */ o(i, { $alignItems: "center", $justifyContent: "center", ref: N, children: [
|
|
75
|
+
/* @__PURE__ */ e(U, { width: 32, height: 32, $disabled: !n }),
|
|
76
|
+
/* @__PURE__ */ e(d, { $renderAs: "eyebrow2", $color: n ? "BLACK" : "GREY_4", children: "HINT" }),
|
|
77
|
+
/* @__PURE__ */ e(i, { $gap: 8, $alignItems: "center", children: /* @__PURE__ */ e(O, { width: 24, height: 1, background: "GREY_2" }) })
|
|
78
|
+
] }) }),
|
|
79
|
+
/* @__PURE__ */ e($, { label: "solution", onClick: x, disabled: !u, children: /* @__PURE__ */ o(i, { $alignItems: "center", $justifyContent: "center", ref: H, children: [
|
|
80
|
+
/* @__PURE__ */ e(D, { width: 32, height: 32, $disabled: !u }),
|
|
81
|
+
/* @__PURE__ */ e(d, { $renderAs: "eyebrow2", $color: n ? "BLACK" : "GREY_4", children: "SOL" })
|
|
43
82
|
] }) }),
|
|
44
|
-
t &&
|
|
83
|
+
t && E && k && /* @__PURE__ */ e(F, { topValue: E, leftValue: k }),
|
|
45
84
|
t && /* @__PURE__ */ e(
|
|
46
|
-
|
|
85
|
+
Q,
|
|
47
86
|
{
|
|
48
87
|
$background: "WHITE",
|
|
49
|
-
$questionWidth:
|
|
50
|
-
$actionbarHeight:
|
|
88
|
+
$questionWidth: C,
|
|
89
|
+
$actionbarHeight: I,
|
|
51
90
|
$borderRadius: 10,
|
|
52
|
-
children: /* @__PURE__ */
|
|
53
|
-
|
|
91
|
+
children: /* @__PURE__ */ o(
|
|
92
|
+
J,
|
|
54
93
|
{
|
|
55
94
|
$gutterX: 1,
|
|
56
95
|
$gapX: 1,
|
|
57
|
-
$questionWidth:
|
|
58
|
-
$actionbarHeight:
|
|
96
|
+
$questionWidth: C,
|
|
97
|
+
$actionbarHeight: I,
|
|
59
98
|
children: [
|
|
60
|
-
/* @__PURE__ */ e($, { label: "close", onClick:
|
|
61
|
-
/* @__PURE__ */ e(
|
|
62
|
-
|
|
63
|
-
|
|
99
|
+
/* @__PURE__ */ e($, { label: "close", onClick: B, children: /* @__PURE__ */ e(Z, {}) }),
|
|
100
|
+
/* @__PURE__ */ e(i, { $gutterX: 0.5, children: /* @__PURE__ */ e(d, { $renderAs: "eyebrow2", $color: "ORANGE_5", $marginBottomX: 0.25, children: t === "HINT" ? "HINTS:" : "SOLUTION:" }) }),
|
|
101
|
+
r && r.map((c, l) => /* @__PURE__ */ o(i, { $gutterX: 0.5, $gapX: 0.5, children: [
|
|
102
|
+
r.length > 1 && /* @__PURE__ */ o(d, { $renderAs: "eyebrow2", $color: "ORANGE_5", $marginBottomX: 0.25, children: [
|
|
64
103
|
t,
|
|
65
104
|
" ",
|
|
66
|
-
|
|
105
|
+
l + 1,
|
|
67
106
|
":"
|
|
68
107
|
] }),
|
|
69
108
|
/* @__PURE__ */ e(
|
|
70
|
-
|
|
109
|
+
ee,
|
|
71
110
|
{
|
|
72
111
|
dangerouslySetInnerHTML: {
|
|
73
|
-
__html:
|
|
112
|
+
__html: c
|
|
74
113
|
}
|
|
75
114
|
}
|
|
76
115
|
)
|
|
77
|
-
] },
|
|
116
|
+
] }, l.toString()))
|
|
78
117
|
]
|
|
79
118
|
}
|
|
80
119
|
)
|
|
@@ -84,6 +123,6 @@ const Z = L(
|
|
|
84
123
|
}
|
|
85
124
|
);
|
|
86
125
|
export {
|
|
87
|
-
|
|
126
|
+
he as default
|
|
88
127
|
};
|
|
89
128
|
//# sourceMappingURL=question-guide.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-guide.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/question-guide.tsx"],"sourcesContent":["import type { ILearnosity, IWorksheetProps, IWorksheetQuestion } from '../worksheet-types';\n\nimport React, { memo, useCallback, useEffect, useMemo, useState, useRef } from 'react';\n\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport EVENTS from '../../constants/events';\nimport {\n Section,\n GuideContainer,\n CloseIcon,\n SolIcon,\n HintIcon,\n SectionContainer,\n Guide,\n Pointer,\n} from './worksheet-sidebar-styled';\n\ntype TSections = 'HINT' | 'SOL';\n\ninterface IQuestionGuideProps extends Pick<IWorksheetProps, 'loggerRef'> {\n questionWidth: number;\n questions: IWorksheetQuestion[];\n activeQuestionIndex: number;\n learnosity: ILearnosity;\n actionbarHeight: number;\n}\n\nconst QuestionGuide: React.FC<IQuestionGuideProps> = memo(\n ({ questionWidth, questions, activeQuestionIndex, learnosity, actionbarHeight, loggerRef }) => {\n const [activeSection, setActiveSection] = useState<TSections | undefined>();\n const [pointerPosition, setPointerPosition] = useState({\n top: 0,\n left: 0,\n });\n const { top, left } = pointerPosition;\n\n const handleHintClick = useCallback(() => {\n setActiveSection('HINT');\n loggerRef.current(EVENTS.WORKSHEET_V3_HINT_SEEN);\n }, [loggerRef]);\n const handleSolClick = useCallback(() => {\n setActiveSection('SOL');\n loggerRef.current(EVENTS.WORKSHEET_V3_SOLUTION_SEEN);\n }, [loggerRef]);\n const handleClose = useCallback(() => {\n setActiveSection(() => undefined);\n }, []);\n\n const { hints, solution } = questions[activeQuestionIndex]?.metadata || {};\n\n const activeSectionData = useMemo(() => {\n return activeSection === undefined ? undefined : activeSection === 'HINT' ? hints : solution;\n }, [activeSection, hints, solution]);\n\n const sqlRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const hintRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n\n const updatePointerPosition = useCallback((ref: React.RefObject<HTMLDivElement>) => {\n if (ref.current) {\n const rect = ref.current.getBoundingClientRect();\n\n setPointerPosition({\n top: rect.top + rect.height / 2 - 8,\n left: rect.right - 78, // 52px (sidebar width) + 16px (gutter) + 10px\n });\n }\n }, []);\n\n if (activeSection && activeSectionData && learnosity) {\n learnosity.renderMath('mathjax');\n }\n\n useEffect(() => {\n if (activeSection === 'HINT') {\n updatePointerPosition(hintRef);\n } else if (activeSection === 'SOL') {\n updatePointerPosition(sqlRef);\n } else if (!activeSectionData) {\n setActiveSection(undefined);\n }\n }, [activeSection, updatePointerPosition, activeSectionData]);\n\n return (\n <GuideContainer $background=\"WHITE\">\n <Clickable label=\"hints\" onClick={handleHintClick} disabled={!hints}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" ref={hintRef}>\n <HintIcon width={32} height={32} $disabled={!hints} />\n <Text $renderAs=\"eyebrow2\" $color={!hints ? 'GREY_4' : 'BLACK'}>\n HINT\n </Text>\n <FlexView $gap={8} $alignItems=\"center\">\n <Separator width={24} height={1} background=\"GREY_2\" />\n </FlexView>\n </FlexView>\n </Clickable>\n <Clickable label=\"solution\" onClick={handleSolClick} disabled={!solution}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" ref={sqlRef}>\n <SolIcon width={32} height={32} $disabled={!solution} />\n <Text $renderAs=\"eyebrow2\" $color={!hints ? 'GREY_4' : 'BLACK'}>\n SOL\n </Text>\n </FlexView>\n </Clickable>\n {activeSection && top && left && <Pointer topValue={top} leftValue={left} />}\n {activeSection && (\n <SectionContainer\n $background=\"WHITE\"\n $questionWidth={questionWidth}\n $actionbarHeight={actionbarHeight}\n $borderRadius={10}\n >\n <Section\n $gutterX={1}\n $gapX={1}\n $questionWidth={questionWidth}\n $actionbarHeight={actionbarHeight}\n >\n <Clickable label=\"close\" onClick={handleClose}>\n <CloseIcon />\n </Clickable>\n <FlexView $gutterX={0.5}>\n <Text $renderAs=\"eyebrow2\" $color=\"ORANGE_5\" $marginBottomX={0.25}>\n {activeSection === 'HINT' ? 'HINTS:' : 'SOLUTION:'}\n </Text>\n </FlexView>\n {activeSectionData &&\n activeSectionData.map((item, index) => (\n <FlexView $gutterX={0.5} $gapX={0.5} key={index.toString()}>\n {activeSectionData.length > 1 && (\n <Text $renderAs=\"eyebrow2\" $color=\"ORANGE_5\" $marginBottomX={0.25}>\n {activeSection} {index + 1}:\n </Text>\n )}\n <Guide\n dangerouslySetInnerHTML={{\n __html: item,\n }}\n />\n </FlexView>\n ))}\n </Section>\n </SectionContainer>\n )}\n </GuideContainer>\n );\n },\n);\n\nexport default QuestionGuide;\n"],"names":["QuestionGuide","memo","questionWidth","questions","activeQuestionIndex","learnosity","actionbarHeight","loggerRef","activeSection","setActiveSection","useState","pointerPosition","setPointerPosition","top","left","handleHintClick","useCallback","EVENTS","handleSolClick","handleClose","hints","solution","_a","activeSectionData","useMemo","sqlRef","useRef","hintRef","updatePointerPosition","ref","rect","useEffect","jsxs","GuideContainer","jsx","Clickable","FlexView","HintIcon","Text","Separator","SolIcon","Pointer","SectionContainer","Section","CloseIcon","item","index","Guide"],"mappings":";;;;;;;;AA8BA,MAAMA,IAA+CC;AAAA,EACnD,CAAC,EAAE,eAAAC,GAAe,WAAAC,GAAW,qBAAAC,GAAqB,YAAAC,GAAY,iBAAAC,GAAiB,WAAAC,QAAgB;;AAC7F,UAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAgC,GACpE,CAACC,GAAiBC,CAAkB,IAAIF,EAAS;AAAA,MACrD,KAAK;AAAA,MACL,MAAM;AAAA,IAAA,CACP,GACK,EAAE,KAAAG,GAAK,MAAAC,EAAS,IAAAH,GAEhBI,IAAkBC,EAAY,MAAM;AACxC,MAAAP,EAAiB,MAAM,GACbF,EAAA,QAAQU,EAAO,sBAAsB;AAAA,IAAA,GAC9C,CAACV,CAAS,CAAC,GACRW,IAAiBF,EAAY,MAAM;AACvC,MAAAP,EAAiB,KAAK,GACZF,EAAA,QAAQU,EAAO,0BAA0B;AAAA,IAAA,GAClD,CAACV,CAAS,CAAC,GACRY,IAAcH,EAAY,MAAM;AACpC,MAAAP,EAAiB,MAAA;AAAA,OAAe;AAAA,IAClC,GAAG,CAAE,CAAA,GAEC,EAAE,OAAAW,GAAO,UAAAC,EAAS,MAAIC,IAAAnB,EAAUC,CAAmB,MAA7B,gBAAAkB,EAAgC,aAAY,IAElEC,IAAoBC,EAAQ,MACzBhB,MAAkB,SAAY,SAAYA,MAAkB,SAASY,IAAQC,GACnF,CAACb,GAAeY,GAAOC,CAAQ,CAAC,GAE7BI,IAASC,EAAuB,IAAI,GACpCC,IAAUD,EAAuB,IAAI,GAErCE,IAAwBZ,EAAY,CAACa,MAAyC;AAClF,UAAIA,EAAI,SAAS;AACT,cAAAC,IAAOD,EAAI,Q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A,QAAA;AAAA,MACF;AAAA,IAEJ,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
|
1
|
+
{"version":3,"file":"question-guide.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/question-guide.tsx"],"sourcesContent":["import type { TPositionProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { ILearnosity, IWorksheetProps, IWorksheetQuestion } from '../worksheet-types';\n\nimport React, { memo, useCallback, useEffect, useMemo, useState, useRef } from 'react';\n\nimport StickerSelector from '../../../stickers/sticker-selector/sticker-selector';\nimport { useTrialSessionContext } from '../../../trial-session/context/use-trial-session-context';\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport EVENTS from '../../constants/events';\nimport {\n Section,\n GuideContainer,\n CloseIcon,\n SolIcon,\n HintIcon,\n StickersIcon,\n SectionContainer,\n Guide,\n Pointer,\n} from './worksheet-sidebar-styled';\n\ntype TSections = 'HINT' | 'SOL';\n\ninterface IQuestionGuideProps extends Pick<IWorksheetProps, 'loggerRef'> {\n questionWidth: number;\n questions: IWorksheetQuestion[];\n activeQuestionIndex: number;\n learnosity: ILearnosity;\n actionbarHeight: number;\n}\n\nconst QuestionGuide: React.FC<IQuestionGuideProps> = memo(\n ({ questionWidth, questions, activeQuestionIndex, learnosity, actionbarHeight, loggerRef }) => {\n const [activeSection, setActiveSection] = useState<TSections | undefined>();\n const [pointerPosition, setPointerPosition] = useState({\n top: 0,\n left: 0,\n });\n const [showStickers, setShowStickers] = useState(false);\n const { studentId } = useTrialSessionContext();\n const { top, left } = pointerPosition;\n\n console.log('id', studentId);\n\n const handleHintClick = useCallback(() => {\n setActiveSection('HINT');\n loggerRef.current(EVENTS.WORKSHEET_V3_HINT_SEEN);\n }, [loggerRef]);\n const handleSolClick = useCallback(() => {\n setActiveSection('SOL');\n loggerRef.current(EVENTS.WORKSHEET_V3_SOLUTION_SEEN);\n }, [loggerRef]);\n const handleClose = useCallback(() => {\n setActiveSection(() => undefined);\n }, []);\n const handleBadgeToggle = useCallback(() => {\n setShowStickers(prev => !prev);\n }, []);\n\n const { hints, solution } = questions[activeQuestionIndex]?.metadata || {};\n\n const activeSectionData = useMemo(() => {\n return activeSection === undefined ? undefined : activeSection === 'HINT' ? hints : solution;\n }, [activeSection, hints, solution]);\n\n const sqlRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const hintRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n\n const updatePointerPosition = useCallback((ref: React.RefObject<HTMLDivElement>) => {\n if (ref.current) {\n const rect = ref.current.getBoundingClientRect();\n\n setPointerPosition({\n top: rect.top + rect.height / 2 - 8,\n left: rect.right - 78, // 52px (sidebar width) + 16px (gutter) + 10px\n });\n }\n }, []);\n\n const stickerTrigger = useMemo(\n () => (\n <Clickable label=\"teacher-badges\" onClick={handleBadgeToggle}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n <StickersIcon width={32} height={32} $disabled={!showStickers} />\n <Text $renderAs=\"eyebrow2\" $color={!showStickers ? 'GREY_4' : 'BLACK'}>\n STICKERS\n </Text>\n <FlexView $gap={8} $alignItems=\"center\">\n <Separator width={24} height={1} background=\"GREY_2\" />\n </FlexView>\n </FlexView>\n </Clickable>\n ),\n [showStickers, handleBadgeToggle],\n );\n\n const stickerGridConfig = useMemo(\n () => ({\n stickerSize: 48,\n columns: 4,\n gap: 8,\n }),\n [],\n );\n\n const stickerTooltipConfig = useMemo(\n () => ({\n position: 'bottom' as TPositionProps,\n zIndex: 1000,\n arrowXCoOrdinates: 87.5,\n tooltipXCoOrdinates: '-32.5%',\n }),\n [],\n );\n\n if (activeSection && activeSectionData && learnosity) {\n learnosity.renderMath('mathjax');\n }\n\n useEffect(() => {\n if (activeSection === 'HINT') {\n updatePointerPosition(hintRef);\n } else if (activeSection === 'SOL') {\n updatePointerPosition(sqlRef);\n } else if (!activeSectionData) {\n setActiveSection(undefined);\n }\n }, [activeSection, updatePointerPosition, activeSectionData]);\n\n return (\n <GuideContainer $background=\"WHITE\">\n <StickerSelector\n triggerNode={stickerTrigger}\n studentClassroomId={studentId}\n gridConfig={stickerGridConfig}\n tooltipConfig={stickerTooltipConfig}\n visible={showStickers}\n onToggle={handleBadgeToggle}\n />\n <Clickable label=\"hints\" onClick={handleHintClick} disabled={!hints}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" ref={hintRef}>\n <HintIcon width={32} height={32} $disabled={!hints} />\n <Text $renderAs=\"eyebrow2\" $color={!hints ? 'GREY_4' : 'BLACK'}>\n HINT\n </Text>\n <FlexView $gap={8} $alignItems=\"center\">\n <Separator width={24} height={1} background=\"GREY_2\" />\n </FlexView>\n </FlexView>\n </Clickable>\n <Clickable label=\"solution\" onClick={handleSolClick} disabled={!solution}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" ref={sqlRef}>\n <SolIcon width={32} height={32} $disabled={!solution} />\n <Text $renderAs=\"eyebrow2\" $color={!hints ? 'GREY_4' : 'BLACK'}>\n SOL\n </Text>\n </FlexView>\n </Clickable>\n {activeSection && top && left && <Pointer topValue={top} leftValue={left} />}\n {activeSection && (\n <SectionContainer\n $background=\"WHITE\"\n $questionWidth={questionWidth}\n $actionbarHeight={actionbarHeight}\n $borderRadius={10}\n >\n <Section\n $gutterX={1}\n $gapX={1}\n $questionWidth={questionWidth}\n $actionbarHeight={actionbarHeight}\n >\n <Clickable label=\"close\" onClick={handleClose}>\n <CloseIcon />\n </Clickable>\n <FlexView $gutterX={0.5}>\n <Text $renderAs=\"eyebrow2\" $color=\"ORANGE_5\" $marginBottomX={0.25}>\n {activeSection === 'HINT' ? 'HINTS:' : 'SOLUTION:'}\n </Text>\n </FlexView>\n {activeSectionData &&\n activeSectionData.map((item, index) => (\n <FlexView $gutterX={0.5} $gapX={0.5} key={index.toString()}>\n {activeSectionData.length > 1 && (\n <Text $renderAs=\"eyebrow2\" $color=\"ORANGE_5\" $marginBottomX={0.25}>\n {activeSection} {index + 1}:\n </Text>\n )}\n <Guide\n dangerouslySetInnerHTML={{\n __html: item,\n }}\n />\n </FlexView>\n ))}\n </Section>\n </SectionContainer>\n )}\n </GuideContainer>\n );\n },\n);\n\nexport default QuestionGuide;\n"],"names":["QuestionGuide","memo","questionWidth","questions","activeQuestionIndex","learnosity","actionbarHeight","loggerRef","activeSection","setActiveSection","useState","pointerPosition","setPointerPosition","showStickers","setShowStickers","studentId","useTrialSessionContext","top","left","handleHintClick","useCallback","EVENTS","handleSolClick","handleClose","handleBadgeToggle","prev","hints","solution","_a","activeSectionData","useMemo","sqlRef","useRef","hintRef","updatePointerPosition","ref","rect","stickerTrigger","jsx","Clickable","jsxs","FlexView","StickersIcon","Text","Separator","stickerGridConfig","stickerTooltipConfig","useEffect","GuideContainer","StickerSelector","HintIcon","SolIcon","Pointer","SectionContainer","Section","CloseIcon","item","index","Guide"],"mappings":";;;;;;;;;;AAkCA,MAAMA,KAA+CC;AAAA,EACnD,CAAC,EAAE,eAAAC,GAAe,WAAAC,GAAW,qBAAAC,GAAqB,YAAAC,GAAY,iBAAAC,GAAiB,WAAAC,QAAgB;;AAC7F,UAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAgC,GACpE,CAACC,GAAiBC,CAAkB,IAAIF,EAAS;AAAA,MACrD,KAAK;AAAA,MACL,MAAM;AAAA,IAAA,CACP,GACK,CAACG,GAAcC,CAAe,IAAIJ,EAAS,EAAK,GAChD,EAAE,WAAAK,MAAcC,KAChB,EAAE,KAAAC,GAAK,MAAAC,EAAS,IAAAP;AAEd,YAAA,IAAI,MAAMI,CAAS;AAErB,UAAAI,IAAkBC,EAAY,MAAM;AACxC,MAAAX,EAAiB,MAAM,GACbF,EAAA,QAAQc,EAAO,sBAAsB;AAAA,IAAA,GAC9C,CAACd,CAAS,CAAC,GACRe,IAAiBF,EAAY,MAAM;AACvC,MAAAX,EAAiB,KAAK,GACZF,EAAA,QAAQc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Z,EAAA,SAAS,KACzB,gBAAAW,EAAAG,GAAA,EAAK,WAAU,YAAW,QAAO,YAAW,gBAAgB,MAC1D,UAAA;AAAA,oBAAAnC;AAAA,oBAAc;AAAA,oBAAEiD,IAAQ;AAAA,oBAAE;AAAA,kBAAA,GAC7B;AAAA,kBAEF,gBAAAnB;AAAA,oBAACoB;AAAA,oBAAA;AAAA,sBACC,yBAAyB;AAAA,wBACvB,QAAQF;AAAA,sBACV;AAAA,oBAAA;AAAA,kBACF;AAAA,gBAAA,KAVwCC,EAAM,SAAS,CAWzD,CACD;AAAA,cAAA;AAAA,YAAA;AAAA,UACL;AAAA,QAAA;AAAA,MACF;AAAA,IAEJ,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import r from "styled-components";
|
|
2
|
-
import
|
|
2
|
+
import l from "../../../../assets/line-icons/icons/bulb.js";
|
|
3
3
|
import d from "../../../../assets/line-icons/icons/cross.js";
|
|
4
|
-
import
|
|
4
|
+
import p from "../../../../assets/line-icons/icons/info.js";
|
|
5
5
|
import e from "../../../ui/layout/flex-view.js";
|
|
6
6
|
import a from "../../../ui/text/text.js";
|
|
7
7
|
import { CustomElement as x } from "../worksheet-question/worksheet-question-styled.js";
|
|
8
8
|
r(e)`
|
|
9
9
|
border: 2px solid #000;
|
|
10
10
|
`;
|
|
11
|
-
const
|
|
11
|
+
const C = r(e)(
|
|
12
12
|
({ $questionWidth: t, $actionbarHeight: o, theme: i }) => `
|
|
13
13
|
position: absolute;
|
|
14
14
|
bottom: ${o}px;
|
|
@@ -19,14 +19,14 @@ const y = r(e)(
|
|
|
19
19
|
border: 1px solid ${i.colors.GREY_2};
|
|
20
20
|
overflow: hidden;
|
|
21
21
|
`
|
|
22
|
-
),
|
|
22
|
+
), y = r(e)`
|
|
23
23
|
cursor: pointer;
|
|
24
|
-
`,
|
|
24
|
+
`, S = r(a)`
|
|
25
25
|
text-decoration: underline;
|
|
26
26
|
white-space: nowrap;
|
|
27
27
|
writing-mode: vertical-rl;
|
|
28
28
|
text-align: right;
|
|
29
|
-
`, s = (t) => t.startsWith("calc(") ? t.replace(")", " - 0px)") : t,
|
|
29
|
+
`, s = (t) => t.startsWith("calc(") ? t.replace(")", " - 0px)") : t, c = (t) => t.trim().split(/\s+(?=[+-])/).map((n) => n.startsWith("-") ? `+${n.slice(1)}` : n.startsWith("+") ? `-${n.slice(1)}` : `-${n}`).join(" "), u = (t) => t.startsWith("calc(") && t.endsWith(")") ? (t = t.slice(5, -1), `calc(${c(t)})`) : c(t), k = r(e)(
|
|
30
30
|
({ $questionWidth: t }) => `
|
|
31
31
|
width: calc(${t}px - 32px); // 32px is the left + right padding
|
|
32
32
|
overflow-y: auto;
|
|
@@ -34,7 +34,7 @@ const y = r(e)(
|
|
|
34
34
|
display: flex;
|
|
35
35
|
`
|
|
36
36
|
), E = r(e)(({ $questionWidth: t, $height: o }) => `
|
|
37
|
-
margin-top: ${typeof o == "number" ? `${-o}px` :
|
|
37
|
+
margin-top: ${typeof o == "number" ? `${-o}px` : u(s(o))};
|
|
38
38
|
position: sticky;
|
|
39
39
|
left: calc((100% - ${t}px ) *.5 + ${t}px + 12px);
|
|
40
40
|
bottom: 16px;
|
|
@@ -50,7 +50,7 @@ const y = r(e)(
|
|
|
50
50
|
align-items: center;
|
|
51
51
|
padding: 10px;
|
|
52
52
|
`
|
|
53
|
-
),
|
|
53
|
+
), I = r.div`
|
|
54
54
|
position: fixed;
|
|
55
55
|
top: ${({ topValue: t }) => `${t}px`};
|
|
56
56
|
left: ${({ leftValue: t }) => `${t}px`};
|
|
@@ -60,32 +60,37 @@ const y = r(e)(
|
|
|
60
60
|
background: white;
|
|
61
61
|
border-top: 1px solid #e0e0e0;
|
|
62
62
|
border-right: 1px solid #e0e0e0;
|
|
63
|
-
`,
|
|
63
|
+
`, T = r(d)`
|
|
64
64
|
position: absolute;
|
|
65
65
|
top: 8px;
|
|
66
66
|
right: 16px;
|
|
67
|
-
`,
|
|
67
|
+
`, B = r(p)(({ theme: t, $disabled: o }) => `
|
|
68
68
|
& path {
|
|
69
69
|
stroke: ${o ? t.colors.GREY_4 : t.colors.BLACK};
|
|
70
70
|
}
|
|
71
|
-
`),
|
|
71
|
+
`), R = r(l)(({ theme: t, $disabled: o }) => `
|
|
72
72
|
& path {
|
|
73
73
|
stroke: ${o ? t.colors.GREY_4 : t.colors.BLACK};
|
|
74
74
|
}
|
|
75
|
-
`),
|
|
75
|
+
`), W = r(p)(({ theme: t, $disabled: o }) => `
|
|
76
|
+
& path {
|
|
77
|
+
stroke: ${o ? t.colors.GREY_4 : t.colors.BLACK};
|
|
78
|
+
}
|
|
79
|
+
`), Y = r(x)``;
|
|
76
80
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
T as CloseIcon,
|
|
82
|
+
Y as Guide,
|
|
79
83
|
G as GuideContainer,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
B as HintIcon,
|
|
85
|
+
I as Pointer,
|
|
86
|
+
k as Section,
|
|
87
|
+
C as SectionContainer,
|
|
84
88
|
E as SideBarContainer,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
R as SolIcon,
|
|
90
|
+
W as StickersIcon,
|
|
91
|
+
S as UnderlinedText,
|
|
92
|
+
y as UnderlinedTextWrapper,
|
|
88
93
|
s as getMinHeightFromString,
|
|
89
|
-
|
|
94
|
+
u as negateExpression
|
|
90
95
|
};
|
|
91
96
|
//# sourceMappingURL=worksheet-sidebar-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worksheet-sidebar-styled.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/worksheet-sidebar-styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport BulbIcon from '../../../../assets/line-icons/icons/bulb';\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport InfoIcon from '../../../../assets/line-icons/icons/info';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { CustomElement } from '../worksheet-question/worksheet-question-styled';\n\nexport const Circle = styled(FlexView)`\n border: 2px solid #000;\n`;\nexport const SectionContainer = styled(FlexView)<{\n $questionWidth: number;\n $actionbarHeight: number;\n}>(\n ({ $questionWidth, $actionbarHeight, theme }) => `\n position: absolute;\n bottom: ${$actionbarHeight}px;\n right: 80px; //52px(sidebar(width) +12px(gutter) + (16px)\n width: calc(${$questionWidth}px - 32px); // 32px is the left + right padding\n height: 30%;\n display: flex;\n border: 1px solid ${theme.colors.GREY_2};\n overflow: hidden;\n`,\n);\n\nexport const UnderlinedTextWrapper = styled(FlexView)`\n cursor: pointer;\n`;\n\nexport const UnderlinedText = styled(Text)`\n text-decoration: underline;\n white-space: nowrap;\n writing-mode: vertical-rl;\n text-align: right;\n`;\n\nexport const getMinHeightFromString = (minHeight: string) => {\n if (minHeight.startsWith('calc(')) {\n return minHeight.replace(')', ' - 0px)');\n }\n\n return minHeight;\n};\n\nconst negateString = (expression: string) => {\n const terms = expression.trim().split(/\\s+(?=[+-])/);\n const negatedTerms = terms.map(term => {\n if (term.startsWith('-')) {\n return `+${term.slice(1)}`; // change - to +\n }\n\n if (term.startsWith('+')) {\n return `-${term.slice(1)}`; // change + to -\n }\n\n return `-${term}`; // add leading '-'\n });\n\n return negatedTerms.join(' ');\n};\n\nexport const negateExpression = (expression: string) => {\n if (expression.startsWith('calc(') && expression.endsWith(')')) {\n expression = expression.slice(5, -1); // Remove 'calc(' and ')'\n const negatedTerms = negateString(expression);\n\n return `calc(${negatedTerms})`;\n }\n\n return negateString(expression);\n};\n\nexport const Section = styled(FlexView)<{\n $questionWidth: number;\n $actionbarHeight: number;\n}>(\n ({ $questionWidth }) => `\n width: calc(${$questionWidth}px - 32px); // 32px is the left + right padding\n overflow-y: auto;\n height: 100%;\n display: flex;\n`,\n);\nexport const SideBarContainer = styled(FlexView)<{\n $questionWidth: number;\n $height: number | string;\n}>(({ $questionWidth, $height }) => {\n return `\n margin-top: ${\n typeof $height === 'number'\n ? `${-$height}px`\n : negateExpression(getMinHeightFromString($height))\n };\n position: sticky;\n left: calc((100% - ${$questionWidth}px ) *.5 + ${$questionWidth}px + 12px);\n bottom: 16px;\n align-items: center;\n height: ${typeof $height === 'number' ? `${$height}px` : getMinHeightFromString($height)};\n z-index: 1;\n`;\n});\n\nexport const GuideContainer = styled(FlexView)(\n ({ theme }) => `\n width: 100%;\n border-radius: 8px;\n border: 1px solid ${theme.colors.GREY_2};\n justify-content: center;\n align-items: center;\n padding: 10px;\n`,\n);\n\nexport const Pointer = styled.div<{ topValue: number; leftValue: number }>`\n position: fixed;\n top: ${({ topValue }) => `${topValue}px`};\n left: ${({ leftValue }) => `${leftValue}px`};\n width: 15px;\n height: 15px;\n transform: rotate(45deg);\n background: white;\n border-top: 1px solid #e0e0e0;\n border-right: 1px solid #e0e0e0;\n`;\n\nexport const CloseIcon = styled(CrossIcon)`\n position: absolute;\n top: 8px;\n right: 16px;\n`;\n\nexport const HintIcon = styled(InfoIcon)<{ $disabled: boolean }>(({ theme, $disabled }) => {\n return `\n & path {\n stroke: ${$disabled ? theme.colors.GREY_4 : theme.colors.BLACK};\n }\n `;\n});\n\nexport const SolIcon = styled(BulbIcon)<{ $disabled: boolean }>(({ theme, $disabled }) => {\n return `\n & path {\n stroke: ${$disabled ? theme.colors.GREY_4 : theme.colors.BLACK};\n }\n `;\n});\n\nexport const Guide = styled(CustomElement)``;\n"],"names":["styled","FlexView","SectionContainer","$questionWidth","$actionbarHeight","theme","UnderlinedTextWrapper","UnderlinedText","Text","getMinHeightFromString","minHeight","negateString","expression","term","negateExpression","Section","SideBarContainer","$height","GuideContainer","Pointer","topValue","leftValue","CloseIcon","CrossIcon","HintIcon","InfoIcon","$disabled","SolIcon","BulbIcon","Guide","CustomElement"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"worksheet-sidebar-styled.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/worksheet-sidebar-styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport BulbIcon from '../../../../assets/line-icons/icons/bulb';\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport InfoIcon from '../../../../assets/line-icons/icons/info';\nimport StickerIcon from '../../../../assets/line-icons/icons/info';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { CustomElement } from '../worksheet-question/worksheet-question-styled';\n\nexport const Circle = styled(FlexView)`\n border: 2px solid #000;\n`;\nexport const SectionContainer = styled(FlexView)<{\n $questionWidth: number;\n $actionbarHeight: number;\n}>(\n ({ $questionWidth, $actionbarHeight, theme }) => `\n position: absolute;\n bottom: ${$actionbarHeight}px;\n right: 80px; //52px(sidebar(width) +12px(gutter) + (16px)\n width: calc(${$questionWidth}px - 32px); // 32px is the left + right padding\n height: 30%;\n display: flex;\n border: 1px solid ${theme.colors.GREY_2};\n overflow: hidden;\n`,\n);\n\nexport const UnderlinedTextWrapper = styled(FlexView)`\n cursor: pointer;\n`;\n\nexport const UnderlinedText = styled(Text)`\n text-decoration: underline;\n white-space: nowrap;\n writing-mode: vertical-rl;\n text-align: right;\n`;\n\nexport const getMinHeightFromString = (minHeight: string) => {\n if (minHeight.startsWith('calc(')) {\n return minHeight.replace(')', ' - 0px)');\n }\n\n return minHeight;\n};\n\nconst negateString = (expression: string) => {\n const terms = expression.trim().split(/\\s+(?=[+-])/);\n const negatedTerms = terms.map(term => {\n if (term.startsWith('-')) {\n return `+${term.slice(1)}`; // change - to +\n }\n\n if (term.startsWith('+')) {\n return `-${term.slice(1)}`; // change + to -\n }\n\n return `-${term}`; // add leading '-'\n });\n\n return negatedTerms.join(' ');\n};\n\nexport const negateExpression = (expression: string) => {\n if (expression.startsWith('calc(') && expression.endsWith(')')) {\n expression = expression.slice(5, -1); // Remove 'calc(' and ')'\n const negatedTerms = negateString(expression);\n\n return `calc(${negatedTerms})`;\n }\n\n return negateString(expression);\n};\n\nexport const Section = styled(FlexView)<{\n $questionWidth: number;\n $actionbarHeight: number;\n}>(\n ({ $questionWidth }) => `\n width: calc(${$questionWidth}px - 32px); // 32px is the left + right padding\n overflow-y: auto;\n height: 100%;\n display: flex;\n`,\n);\nexport const SideBarContainer = styled(FlexView)<{\n $questionWidth: number;\n $height: number | string;\n}>(({ $questionWidth, $height }) => {\n return `\n margin-top: ${\n typeof $height === 'number'\n ? `${-$height}px`\n : negateExpression(getMinHeightFromString($height))\n };\n position: sticky;\n left: calc((100% - ${$questionWidth}px ) *.5 + ${$questionWidth}px + 12px);\n bottom: 16px;\n align-items: center;\n height: ${typeof $height === 'number' ? `${$height}px` : getMinHeightFromString($height)};\n z-index: 1;\n`;\n});\n\nexport const GuideContainer = styled(FlexView)(\n ({ theme }) => `\n width: 100%;\n border-radius: 8px;\n border: 1px solid ${theme.colors.GREY_2};\n justify-content: center;\n align-items: center;\n padding: 10px;\n`,\n);\n\nexport const Pointer = styled.div<{ topValue: number; leftValue: number }>`\n position: fixed;\n top: ${({ topValue }) => `${topValue}px`};\n left: ${({ leftValue }) => `${leftValue}px`};\n width: 15px;\n height: 15px;\n transform: rotate(45deg);\n background: white;\n border-top: 1px solid #e0e0e0;\n border-right: 1px solid #e0e0e0;\n`;\n\nexport const CloseIcon = styled(CrossIcon)`\n position: absolute;\n top: 8px;\n right: 16px;\n`;\n\nexport const HintIcon = styled(InfoIcon)<{ $disabled: boolean }>(({ theme, $disabled }) => {\n return `\n & path {\n stroke: ${$disabled ? theme.colors.GREY_4 : theme.colors.BLACK};\n }\n `;\n});\n\nexport const SolIcon = styled(BulbIcon)<{ $disabled: boolean }>(({ theme, $disabled }) => {\n return `\n & path {\n stroke: ${$disabled ? theme.colors.GREY_4 : theme.colors.BLACK};\n }\n `;\n});\n\nexport const StickersIcon = styled(StickerIcon)<{ $disabled: boolean }>(({ theme, $disabled }) => {\n return `\n & path {\n stroke: ${$disabled ? theme.colors.GREY_4 : theme.colors.BLACK};\n }\n `;\n});\n\nexport const Guide = styled(CustomElement)``;\n"],"names":["styled","FlexView","SectionContainer","$questionWidth","$actionbarHeight","theme","UnderlinedTextWrapper","UnderlinedText","Text","getMinHeightFromString","minHeight","negateString","expression","term","negateExpression","Section","SideBarContainer","$height","GuideContainer","Pointer","topValue","leftValue","CloseIcon","CrossIcon","HintIcon","InfoIcon","$disabled","SolIcon","BulbIcon","StickersIcon","StickerIcon","Guide","CustomElement"],"mappings":";;;;;;;AAUsBA,EAAOC,CAAQ;AAAA;AAAA;AAGxB,MAAAC,IAAmBF,EAAOC,CAAQ;AAAA,EAI7C,CAAC,EAAE,gBAAAE,GAAgB,kBAAAC,GAAkB,OAAAC,EAAY,MAAA;AAAA;AAAA,YAEvCD,CAAgB;AAAA;AAAA,gBAEZD,CAAc;AAAA;AAAA;AAAA,sBAGRE,EAAM,OAAO,MAAM;AAAA;AAAA;AAGzC,GAEaC,IAAwBN,EAAOC,CAAQ;AAAA;AAAA,GAIvCM,IAAiBP,EAAOQ,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA,GAO5BC,IAAyB,CAACC,MACjCA,EAAU,WAAW,OAAO,IACvBA,EAAU,QAAQ,KAAK,SAAS,IAGlCA,GAGHC,IAAe,CAACC,MACNA,EAAW,KAAK,EAAE,MAAM,aAAa,EACxB,IAAI,CAAQC,MACjCA,EAAK,WAAW,GAAG,IACd,IAAIA,EAAK,MAAM,CAAC,CAAC,KAGtBA,EAAK,WAAW,GAAG,IACd,IAAIA,EAAK,MAAM,CAAC,CAAC,KAGnB,IAAIA,CAAI,EAChB,EAEmB,KAAK,GAAG,GAGjBC,IAAmB,CAACF,MAC3BA,EAAW,WAAW,OAAO,KAAKA,EAAW,SAAS,GAAG,KAC9CA,IAAAA,EAAW,MAAM,GAAG,EAAE,GAG5B,QAFcD,EAAaC,CAAU,CAEjB,OAGtBD,EAAaC,CAAU,GAGnBG,IAAUf,EAAOC,CAAQ;AAAA,EAIpC,CAAC,EAAE,gBAAAE,EAAA,MAAqB;AAAA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