@cuemath/leap 3.4.5 → 3.4.7-m-t

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.
@@ -1,9 +1,9 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { memo as B, useState as G, useCallback as H, useMemo as c } from "react";
3
- import K from "../../ui/arrow-tooltip/arrow-tooltip.js";
4
- import R from "./comps/stiker-selector-grid/sticker-selector-grid.js";
5
- import { useHandleStickerSend as _ } from "./hooks/use-handle-sticker-send.js";
6
- import { TriggerWrapper as $ } from "./sticker-selector-styled.js";
2
+ import { memo as j, useState as B, useCallback as G, useMemo as c } from "react";
3
+ import H from "../../ui/arrow-tooltip/arrow-tooltip.js";
4
+ import K from "./comps/stiker-selector-grid/sticker-selector-grid.js";
5
+ import { useHandleStickerSend as R } from "./hooks/use-handle-sticker-send.js";
6
+ import { TriggerWrapper as _ } from "./sticker-selector-styled.js";
7
7
  const q = ({
8
8
  triggerNode: e,
9
9
  studentClassroomId: m,
@@ -30,20 +30,20 @@ const q = ({
30
30
  zIndex: M,
31
31
  parentWidth: X,
32
32
  isBlocking: D = !1
33
- } = f, [o, n] = G(!1), r = _(m), l = H(
33
+ } = f, [o, n] = B(!1), r = R(m), l = G(
34
34
  (W) => {
35
35
  if (o) return;
36
36
  const d = ["burst-from-edges", "pop-expand", "float-up", "fall-down"], Y = d[Math.floor(Math.random() * d.length)];
37
37
  r == null || r(W, Y), n(!0);
38
- const j = setTimeout(() => {
38
+ const $ = setTimeout(() => {
39
39
  n(!1);
40
40
  }, 5e3);
41
- return () => clearTimeout(j);
41
+ return () => clearTimeout($);
42
42
  },
43
43
  [r, o]
44
44
  ), F = c(
45
45
  () => /* @__PURE__ */ t(
46
- R,
46
+ K,
47
47
  {
48
48
  columns: i,
49
49
  gap: s,
@@ -53,9 +53,9 @@ const q = ({
53
53
  }
54
54
  ),
55
55
  [i, s, a, l, o]
56
- ), V = c(() => /* @__PURE__ */ t($, { $disabled: o, children: e }), [o, e]);
56
+ ), V = c(() => /* @__PURE__ */ t(_, { $disabled: o, children: e }), [o, e]);
57
57
  return /* @__PURE__ */ t(
58
- K,
58
+ H,
59
59
  {
60
60
  children: V,
61
61
  alwaysVisible: !0,
@@ -81,7 +81,7 @@ const q = ({
81
81
  tooltipYCoOrdinates: I
82
82
  }
83
83
  );
84
- }, Z = B(q);
84
+ }, Z = j(q);
85
85
  export {
86
86
  Z as default
87
87
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sticker-selector.js","sources":["../../../../src/features/stickers/sticker-selector/sticker-selector.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { memo, useMemo, useState, useCallback } from 'react';\n\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport type { IStickerData, TStickerAnimationEffects } from '../stickers-types';\nimport StickerSelectorGrid from './comps/stiker-selector-grid/sticker-selector-grid';\nimport { useHandleStickerSend } from './hooks/use-handle-sticker-send';\nimport * as Styled from './sticker-selector-styled';\nimport type { IStickerSelectorProps } from './sticker-selector-types';\n\nconst StickerSelector: 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\n const [isTemporarilyDisabled, setIsTemporarilyDisabled] = useState(false);\n\n const sendSticker = useHandleStickerSend(studentClassroomId);\n\n const handleStickerSend = useCallback(\n (sticker: IStickerData) => {\n if (isTemporarilyDisabled) return;\n\n const STICKER_EFFECTS = ['burst-from-edges', 'pop-expand', 'float-up', 'fall-down'] as const;\n\n const randomEffect: TStickerAnimationEffects =\n STICKER_EFFECTS[Math.floor(Math.random() * STICKER_EFFECTS.length)]!;\n\n sendSticker?.(sticker, randomEffect);\n setIsTemporarilyDisabled(true);\n\n const timeout = setTimeout(() => {\n setIsTemporarilyDisabled(false);\n }, 5000);\n\n return () => clearTimeout(timeout);\n },\n [sendSticker, isTemporarilyDisabled],\n );\n\n const tooltipItem = useMemo(\n () => (\n <StickerSelectorGrid\n columns={columns}\n gap={gap}\n stickerSize={stickerSize}\n onStickerClick={handleStickerSend}\n disabled={isTemporarilyDisabled}\n />\n ),\n [columns, gap, stickerSize, handleStickerSend, isTemporarilyDisabled],\n );\n\n const triggerEle = useMemo(() => {\n return (\n <Styled.TriggerWrapper $disabled={isTemporarilyDisabled}>{triggerNode}</Styled.TriggerWrapper>\n );\n }, [isTemporarilyDisabled, triggerNode]);\n\n return (\n <ArrowTooltip\n children={triggerEle}\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(StickerSelector);\n"],"names":["StickerSelector","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","isTemporarilyDisabled","setIsTemporarilyDisabled","useState","sendSticker","useHandleStickerSend","handleStickerSend","useCallback","sticker","STICKER_EFFECTS","randomEffect","timeout","tooltipItem","useMemo","jsx","StickerSelectorGrid","triggerEle","Styled.TriggerWrapper","ArrowTooltip","stickerSelector","memo"],"mappings":";;;;;;AAUA,MAAMA,IAA6C,CAAC;AAAA,EAClD,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,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,EACX,IAAAtB,GAEE,CAACuB,GAAuBC,CAAwB,IAAIC,EAAS,EAAK,GAElEC,IAAcC,EAAqB7B,CAAkB,GAErD8B,IAAoBC;AAAA,IACxB,CAACC,MAA0B;AACzB,UAAIP,EAAuB;AAE3B,YAAMQ,IAAkB,CAAC,oBAAoB,cAAc,YAAY,WAAW,GAE5EC,IACJD,EAAgB,KAAK,MAAM,KAAK,WAAWA,EAAgB,MAAM,CAAC;AAEpE,MAAAL,KAAA,QAAAA,EAAcI,GAASE,IACvBR,EAAyB,EAAI;AAEvB,YAAAS,IAAU,WAAW,MAAM;AAC/B,QAAAT,EAAyB,EAAK;AAAA,SAC7B,GAAI;AAEA,aAAA,MAAM,aAAaS,CAAO;AAAA,IACnC;AAAA,IACA,CAACP,GAAaH,CAAqB;AAAA,EAAA,GAG/BW,IAAcC;AAAA,IAClB,MACE,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,SAAAnC;AAAA,QACA,KAAAC;AAAA,QACA,aAAAC;AAAA,QACA,gBAAgBwB;AAAA,QAChB,UAAUL;AAAA,MAAA;AAAA,IACZ;AAAA,IAEF,CAACrB,GAASC,GAAKC,GAAawB,GAAmBL,CAAqB;AAAA,EAAA,GAGhEe,IAAaH,EAAQ,wBAEtBI,GAAA,EAAsB,WAAWhB,GAAwB,UAAY1B,EAAA,CAAA,GAEvE,CAAC0B,GAAuB1B,CAAW,CAAC;AAGrC,SAAA,gBAAAuC;AAAA,IAACI;AAAA,IAAA;AAAA,MACC,UAAUF;AAAA,MACV,eAAa;AAAA,MACb,QAAQ,CAACrC;AAAA,MACT,aAAAiC;AAAA,MACA,UAAArB;AAAA,MACA,UAAAD;AAAA,MACA,YAAAU;AAAA,MACA,YAAAjB;AAAA,MACA,QAAAe;AAAA,MACA,OAAAF;AAAA,MACA,QAAAC;AAAA,MACA,aAAAE;AAAA,MACA,iBAAAX;AAAA,MACA,aAAAC;AAAA,MACA,aAAAG;AAAA,MACA,eAAAC;AAAA,MACA,YAAAT;AAAA,MACA,WAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,qBAAAO;AAAA,MACA,qBAAAC;AAAA,IAAA;AAAA,EAAA;AAGN,GAEewB,IAAAC,EAAK9C,CAAe;"}
1
+ {"version":3,"file":"sticker-selector.js","sources":["../../../../src/features/stickers/sticker-selector/sticker-selector.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { memo, useMemo, useState, useCallback } from 'react';\n\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport type { IStickerData, TStickerAnimationEffects } from '../stickers-types';\nimport StickerSelectorGrid from './comps/stiker-selector-grid/sticker-selector-grid';\nimport { useHandleStickerSend } from './hooks/use-handle-sticker-send';\nimport * as Styled from './sticker-selector-styled';\nimport type { IStickerSelectorProps } from './sticker-selector-types';\n\nconst StickerSelector: 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\n const [isTemporarilyDisabled, setIsTemporarilyDisabled] = useState(false);\n\n const sendSticker = useHandleStickerSend(studentClassroomId);\n\n const handleStickerSend = useCallback(\n (sticker: IStickerData) => {\n if (isTemporarilyDisabled) return;\n\n const STICKER_EFFECTS = ['burst-from-edges', 'pop-expand', 'float-up', 'fall-down'] as const;\n\n const randomEffect: TStickerAnimationEffects =\n STICKER_EFFECTS[Math.floor(Math.random() * STICKER_EFFECTS.length)]!;\n\n sendSticker?.(sticker, randomEffect);\n setIsTemporarilyDisabled(true);\n\n const timeout = setTimeout(() => {\n setIsTemporarilyDisabled(false);\n }, 5000);\n\n return () => clearTimeout(timeout);\n },\n [sendSticker, isTemporarilyDisabled],\n );\n\n const tooltipItem = useMemo(\n () => (\n <StickerSelectorGrid\n columns={columns}\n gap={gap}\n stickerSize={stickerSize}\n onStickerClick={handleStickerSend}\n disabled={isTemporarilyDisabled}\n />\n ),\n [columns, gap, stickerSize, handleStickerSend, isTemporarilyDisabled],\n );\n\n const triggerEle = useMemo(() => {\n return (\n <Styled.TriggerWrapper $disabled={isTemporarilyDisabled}>{triggerNode}</Styled.TriggerWrapper>\n );\n }, [isTemporarilyDisabled, triggerNode]);\n\n return (\n <ArrowTooltip\n children={triggerEle}\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(StickerSelector);\n"],"names":["StickerSelector","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","isTemporarilyDisabled","setIsTemporarilyDisabled","useState","sendSticker","useHandleStickerSend","handleStickerSend","useCallback","sticker","STICKER_EFFECTS","randomEffect","timeout","tooltipItem","useMemo","jsx","StickerSelectorGrid","triggerEle","Styled.TriggerWrapper","ArrowTooltip","StickerSelector$1","memo"],"mappings":";;;;;;AAUA,MAAMA,IAA6C,CAAC;AAAA,EAClD,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,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,OAAAC;AAAA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,MACA,iBAAAX;AAAA,MACA,aAAAC;AAAA,MACA,aAAAG;AAAA,MACA,eAAAC;AAAA,MACA,YAAAT;AAAA,MACA,WAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,qBAAAO;AAAA,MACA,qBAAAC;AAAA,IAAA;AAAA,EAAA;AAGN,GAEewB,IAAAC,EAAK9C,CAAe;"}
@@ -1,80 +1,146 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { memo as L, useState as T, useCallback as h, useMemo as v, useRef as H, useEffect as X } from "react";
3
- import $ from "../../../ui/buttons/clickable/clickable.js";
4
- import c from "../../../ui/layout/flex-view.js";
5
- import y from "../../../ui/separator/separator.js";
6
- import u from "../../../ui/text/text.js";
7
- import N from "../../constants/events.js";
8
- import { GuideContainer as P, HintIcon as V, SolIcon as j, Pointer as x, SectionContainer as B, Section as W, CloseIcon as K, Guide as M } from "./worksheet-sidebar-styled.js";
9
- const Z = L(
10
- ({ questionWidth: f, questions: _, activeQuestionIndex: O, learnosity: S, actionbarHeight: p, loggerRef: l }) => {
11
- var C;
12
- const [t, s] = T(), [k, A] = T({
1
+ import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
+ import { memo as M, useState as S, useRef as C, useCallback as s, useMemo as m, useEffect as q } from "react";
3
+ import { useGetEligibleJourneysViaRoute as z } from "../../../journey/hooks/use-get-eligible-journeys-via-route.js";
4
+ import { JOURNEY_ID_TEACHER as D } from "../../../journey/journey-id/journey-id-teacher.js";
5
+ import { useJourney as F } from "../../../journey/use-journey/use-journey.js";
6
+ import { useStickersJourney as Q } from "../../../stickers/sticker-selector/hooks/use-stickers-journey/use-stickers-journey.js";
7
+ import Z from "../../../stickers/sticker-selector/sticker-selector.js";
8
+ import f from "../../../ui/buttons/clickable/clickable.js";
9
+ import i from "../../../ui/layout/flex-view.js";
10
+ import G from "../../../ui/separator/separator.js";
11
+ import d from "../../../ui/text/text.js";
12
+ import v from "../../constants/events.js";
13
+ import { StickersIcon as ee, GuideContainer as te, HintIcon as oe, SolIcon as ie, Pointer as ne, SectionContainer as re, Section as ce, CloseIcon as le, Guide as se } from "./worksheet-sidebar-styled.js";
14
+ const Ie = M(
15
+ ({
16
+ questionWidth: E,
17
+ questions: Y,
18
+ activeQuestionIndex: L,
19
+ learnosity: b,
20
+ actionbarHeight: I,
21
+ loggerRef: a,
22
+ studentClassroomId: T
23
+ }) => {
24
+ var A;
25
+ const [t, h] = S(), [X, J] = S({
13
26
  top: 0,
14
27
  left: 0
15
- }), { top: g, left: b } = k, R = h(() => {
16
- s("HINT"), l.current(N.WORKSHEET_V3_HINT_SEEN);
17
- }, [l]), w = h(() => {
18
- s("SOL"), l.current(N.WORKSHEET_V3_SOLUTION_SEEN);
19
- }, [l]), G = h(() => {
20
- s(() => {
28
+ }), [g, B] = S(!1), k = C(null), { top: O, left: R } = X, K = s(() => {
29
+ h("HINT"), a.current(v.WORKSHEET_V3_HINT_SEEN);
30
+ }, [a]), V = s(() => {
31
+ h("SOL"), a.current(v.WORKSHEET_V3_SOLUTION_SEEN);
32
+ }, [a]), j = s(() => {
33
+ h(() => {
21
34
  });
22
- }, []), { hints: n, solution: d } = ((C = _[O]) == null ? void 0 : C.metadata) || {}, o = v(() => t === void 0 ? void 0 : t === "HINT" ? n : d, [t, n, d]), E = H(null), I = H(null), m = h((a) => {
23
- if (a.current) {
24
- const i = a.current.getBoundingClientRect();
25
- A({
26
- top: i.top + i.height / 2 - 8,
27
- left: i.right - 78
35
+ }, []), p = s(() => {
36
+ B((c) => !c);
37
+ }, []), { hints: n, solution: u } = ((A = Y[L]) == null ? void 0 : A.metadata) || {}, r = m(() => t === void 0 ? void 0 : t === "HINT" ? n : u, [t, n, u]), _ = C(null), N = C(null), $ = s((c) => {
38
+ if (c.current) {
39
+ const l = c.current.getBoundingClientRect();
40
+ J({
41
+ top: l.top + l.height / 2 - 8,
42
+ left: l.right - 78
28
43
  // 52px (sidebar width) + 16px (gutter) + 10px
29
44
  });
30
45
  }
31
- }, []);
32
- return t && o && S && S.renderMath("mathjax"), X(() => {
33
- t === "HINT" ? m(I) : t === "SOL" ? m(E) : o || s(void 0);
34
- }, [t, m, o]), /* @__PURE__ */ r(P, { $background: "WHITE", children: [
35
- /* @__PURE__ */ e($, { label: "hints", onClick: R, disabled: !n, children: /* @__PURE__ */ r(c, { $alignItems: "center", $justifyContent: "center", ref: I, children: [
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" }) })
46
+ }, []), H = m(
47
+ () => /* @__PURE__ */ e("div", { ref: k, children: /* @__PURE__ */ e(f, { label: "teacher-badges", onClick: p, children: /* @__PURE__ */ o(i, { $alignItems: "center", $justifyContent: "center", children: [
48
+ /* @__PURE__ */ e(ee, { width: 32, height: 32, $disabled: !g }),
49
+ /* @__PURE__ */ e(d, { $renderAs: "eyebrow2", $color: g ? "BLACK" : "GREY_4", children: "STICKERS" }),
50
+ /* @__PURE__ */ e(i, { $gap: 8, $alignItems: "center", children: /* @__PURE__ */ e(G, { width: 24, height: 1, background: "GREY_2" }) })
51
+ ] }) }) }),
52
+ [g, p]
53
+ ), x = m(
54
+ () => ({
55
+ stickerSize: 48,
56
+ columns: 4,
57
+ gap: 8
58
+ }),
59
+ []
60
+ ), P = m(
61
+ () => ({
62
+ position: "left",
63
+ zIndex: 1e3,
64
+ arrowYCoOrdinates: -175,
65
+ tooltipXCoOrdinates: "7.5%",
66
+ tooltipYCoOrdinates: "40%"
67
+ }),
68
+ []
69
+ ), W = {
70
+ position: "left",
71
+ tooltipXCoOrdinates: 20,
72
+ tooltipYCoOrdinates: -20
73
+ }, U = z([
74
+ D.STICKERS_INTRO_JOURNEY
75
+ ]), { isJourneyActive: w } = F(), { startTeacherStickersJourney: y } = Q({
76
+ triggerRef: k,
77
+ triggerElement: H,
78
+ tooltipConfig: W
79
+ });
80
+ return t && r && b && b.renderMath("mathjax"), q(() => {
81
+ t === "HINT" ? $(N) : t === "SOL" ? $(_) : r || h(void 0), w || y();
82
+ }, [
83
+ t,
84
+ $,
85
+ r,
86
+ U,
87
+ w,
88
+ y
89
+ ]), /* @__PURE__ */ o(te, { $background: "WHITE", children: [
90
+ T && /* @__PURE__ */ e(
91
+ Z,
92
+ {
93
+ triggerNode: H,
94
+ studentClassroomId: T,
95
+ gridConfig: x,
96
+ tooltipConfig: P,
97
+ visible: g,
98
+ onToggle: p
99
+ }
100
+ ),
101
+ /* @__PURE__ */ e(f, { label: "hints", onClick: K, disabled: !n, children: /* @__PURE__ */ o(i, { $alignItems: "center", $justifyContent: "center", ref: N, children: [
102
+ /* @__PURE__ */ e(oe, { width: 32, height: 32, $disabled: !n }),
103
+ /* @__PURE__ */ e(d, { $renderAs: "eyebrow2", $color: n ? "BLACK" : "GREY_4", children: "HINT" }),
104
+ /* @__PURE__ */ e(i, { $gap: 8, $alignItems: "center", children: /* @__PURE__ */ e(G, { width: 24, height: 1, background: "GREY_2" }) })
39
105
  ] }) }),
40
- /* @__PURE__ */ e($, { label: "solution", onClick: w, disabled: !d, children: /* @__PURE__ */ r(c, { $alignItems: "center", $justifyContent: "center", ref: E, children: [
41
- /* @__PURE__ */ e(j, { width: 32, height: 32, $disabled: !d }),
42
- /* @__PURE__ */ e(u, { $renderAs: "eyebrow2", $color: n ? "BLACK" : "GREY_4", children: "SOL" })
106
+ /* @__PURE__ */ e(f, { label: "solution", onClick: V, disabled: !u, children: /* @__PURE__ */ o(i, { $alignItems: "center", $justifyContent: "center", ref: _, children: [
107
+ /* @__PURE__ */ e(ie, { width: 32, height: 32, $disabled: !u }),
108
+ /* @__PURE__ */ e(d, { $renderAs: "eyebrow2", $color: n ? "BLACK" : "GREY_4", children: "SOL" })
43
109
  ] }) }),
44
- t && g && b && /* @__PURE__ */ e(x, { topValue: g, leftValue: b }),
110
+ t && O && R && /* @__PURE__ */ e(ne, { topValue: O, leftValue: R }),
45
111
  t && /* @__PURE__ */ e(
46
- B,
112
+ re,
47
113
  {
48
114
  $background: "WHITE",
49
- $questionWidth: f,
50
- $actionbarHeight: p,
115
+ $questionWidth: E,
116
+ $actionbarHeight: I,
51
117
  $borderRadius: 10,
52
- children: /* @__PURE__ */ r(
53
- W,
118
+ children: /* @__PURE__ */ o(
119
+ ce,
54
120
  {
55
121
  $gutterX: 1,
56
122
  $gapX: 1,
57
- $questionWidth: f,
58
- $actionbarHeight: p,
123
+ $questionWidth: E,
124
+ $actionbarHeight: I,
59
125
  children: [
60
- /* @__PURE__ */ e($, { label: "close", onClick: G, children: /* @__PURE__ */ e(K, {}) }),
61
- /* @__PURE__ */ e(c, { $gutterX: 0.5, children: /* @__PURE__ */ e(u, { $renderAs: "eyebrow2", $color: "ORANGE_5", $marginBottomX: 0.25, children: t === "HINT" ? "HINTS:" : "SOLUTION:" }) }),
62
- o && o.map((a, i) => /* @__PURE__ */ r(c, { $gutterX: 0.5, $gapX: 0.5, children: [
63
- o.length > 1 && /* @__PURE__ */ r(u, { $renderAs: "eyebrow2", $color: "ORANGE_5", $marginBottomX: 0.25, children: [
126
+ /* @__PURE__ */ e(f, { label: "close", onClick: j, children: /* @__PURE__ */ e(le, {}) }),
127
+ /* @__PURE__ */ e(i, { $gutterX: 0.5, children: /* @__PURE__ */ e(d, { $renderAs: "eyebrow2", $color: "ORANGE_5", $marginBottomX: 0.25, children: t === "HINT" ? "HINTS:" : "SOLUTION:" }) }),
128
+ r && r.map((c, l) => /* @__PURE__ */ o(i, { $gutterX: 0.5, $gapX: 0.5, children: [
129
+ r.length > 1 && /* @__PURE__ */ o(d, { $renderAs: "eyebrow2", $color: "ORANGE_5", $marginBottomX: 0.25, children: [
64
130
  t,
65
131
  " ",
66
- i + 1,
132
+ l + 1,
67
133
  ":"
68
134
  ] }),
69
135
  /* @__PURE__ */ e(
70
- M,
136
+ se,
71
137
  {
72
138
  dangerouslySetInnerHTML: {
73
- __html: a
139
+ __html: c
74
140
  }
75
141
  }
76
142
  )
77
- ] }, i.toString()))
143
+ ] }, l.toString()))
78
144
  ]
79
145
  }
80
146
  )
@@ -84,6 +150,6 @@ const Z = L(
84
150
  }
85
151
  );
86
152
  export {
87
- Z as default
153
+ Ie as default
88
154
  };
89
155
  //# 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 {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useState,\n useRef,\n type FC,\n type RefObject,\n} 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 type { ILearnosity, IWorksheetProps, IWorksheetQuestion } from '../worksheet-types';\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: 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 RefObject<HTMLDivElement>;\n const hintRef = useRef<HTMLDivElement>(null) as RefObject<HTMLDivElement>;\n\n const updatePointerPosition = useCallback((ref: 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":";;;;;;;;AAsCA,MAAMA,IAAyCC;AAAA,EAC7C,CAAC,EAAE,eAAAC,GAAe,WAAAC,GAAW,qBAAAC,GAAqB,YAAAC,GAAY,iBAAAC,GAAiB,WAAAC,QAAgB;;AAC7F,UAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAgC,GACpE,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AAO;AAAA,cACP,gBAAgBzC;AAAA,cAChB,kBAAkBI;AAAA,cAElB,UAAA;AAAA,gBAAA,gBAAA4B,EAACC,KAAU,OAAM,SAAQ,SAAShB,GAChC,UAAA,gBAAAe,EAACU,KAAU,EACb,CAAA;AAAA,kCACCR,GAAS,EAAA,UAAU,KAClB,UAAA,gBAAAF,EAACI,KAAK,WAAU,YAAW,QAAO,YAAW,gBAAgB,MAC1D,UAAA9B,MAAkB,SAAS,WAAW,YACzC,CAAA,GACF;AAAA,gBACCe,KACCA,EAAkB,IAAI,CAACsB,GAAMC,MAC3B,gBAAAd,EAACI,GAAS,EAAA,UAAU,KAAK,OAAO,KAC7B,UAAA;AAAA,kBAAkBb,EAAA,SAAS,KACzB,gBAAAS,EAAAM,GAAA,EAAK,WAAU,YAAW,QAAO,YAAW,gBAAgB,MAC1D,UAAA;AAAA,oBAAA9B;AAAA,oBAAc;AAAA,oBAAEsC,IAAQ;AAAA,oBAAE;AAAA,kBAAA,GAC7B;AAAA,kBAEF,gBAAAZ;AAAA,oBAACa;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
+ {"version":3,"file":"question-guide.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/question-guide.tsx"],"sourcesContent":["import React, {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useState,\n useRef,\n type ReactElement,\n type RefObject,\n} from 'react';\n\nimport { useGetEligibleJourneysViaRoute } from '../../../journey/hooks/use-get-eligible-journeys-via-route';\nimport { JOURNEY_ID_TEACHER } from '../../../journey/journey-id/journey-id-teacher';\nimport { useJourney } from '../../../journey/use-journey/use-journey';\nimport { useStickersJourney } from '../../../stickers/sticker-selector/hooks/use-stickers-journey/use-stickers-journey';\nimport StickerSelector from '../../../stickers/sticker-selector/sticker-selector';\nimport {\n type IArrowTooltipProps,\n type TPositionProps,\n} from '../../../ui/arrow-tooltip/arrow-tooltip-types';\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 type { ILearnosity, IWorksheetProps, IWorksheetQuestion } from '../worksheet-types';\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 studentClassroomId?: string;\n}\n\nconst QuestionGuide: React.FC<IQuestionGuideProps> = memo(\n ({\n questionWidth,\n questions,\n activeQuestionIndex,\n learnosity,\n actionbarHeight,\n loggerRef,\n studentClassroomId,\n }) => {\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 triggerRef = useRef<HTMLDivElement | null>(null);\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 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 <div ref={triggerRef}>\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 </div>\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: 'left' as TPositionProps,\n zIndex: 1000,\n arrowYCoOrdinates: -175,\n tooltipXCoOrdinates: '7.5%',\n tooltipYCoOrdinates: '40%',\n }),\n [],\n );\n\n const coachmarkConfig = {\n position: 'left',\n tooltipXCoOrdinates: 20,\n tooltipYCoOrdinates: -20,\n };\n\n const eligibleJourneyIds = useGetEligibleJourneysViaRoute([\n JOURNEY_ID_TEACHER.STICKERS_INTRO_JOURNEY,\n ]);\n\n const { isJourneyActive } = useJourney();\n\n const { startTeacherStickersJourney } = useStickersJourney({\n triggerRef: triggerRef as RefObject<HTMLDivElement>,\n triggerElement: stickerTrigger as ReactElement,\n tooltipConfig: coachmarkConfig as IArrowTooltipProps,\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\n if (\n // eligibleJourneyIds.includes(JOURNEY_ID_TEACHER.STICKERS_INTRO_JOURNEY) &&\n !isJourneyActive\n ) {\n startTeacherStickersJourney();\n }\n }, [\n activeSection,\n updatePointerPosition,\n activeSectionData,\n eligibleJourneyIds,\n isJourneyActive,\n startTeacherStickersJourney,\n ]);\n\n return (\n <GuideContainer $background=\"WHITE\">\n {studentClassroomId && (\n <StickerSelector\n triggerNode={stickerTrigger}\n studentClassroomId={studentClassroomId}\n gridConfig={stickerGridConfig}\n tooltipConfig={stickerTooltipConfig}\n visible={showStickers}\n onToggle={handleBadgeToggle}\n />\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","studentClassroomId","activeSection","setActiveSection","useState","pointerPosition","setPointerPosition","showStickers","setShowStickers","triggerRef","useRef","top","left","handleHintClick","useCallback","EVENTS","handleSolClick","handleClose","handleBadgeToggle","prev","hints","solution","_a","activeSectionData","useMemo","sqlRef","hintRef","updatePointerPosition","ref","rect","stickerTrigger","jsx","Clickable","jsxs","FlexView","StickersIcon","Text","Separator","stickerGridConfig","stickerTooltipConfig","coachmarkConfig","eligibleJourneyIds","useGetEligibleJourneysViaRoute","JOURNEY_ID_TEACHER","isJourneyActive","useJourney","startTeacherStickersJourney","useStickersJourney","useEffect","GuideContainer","StickerSelector","HintIcon","SolIcon","Pointer","SectionContainer","Section","CloseIcon","item","index","Guide"],"mappings":";;;;;;;;;;;;;AAiDA,MAAMA,KAA+CC;AAAA,EACnD,CAAC;AAAA,IACC,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,YAAAC;AA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AAQF;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,12 +1,12 @@
1
1
  import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
- import { memo as $, useCallback as x } from "react";
3
- import C from "../../../ui/layout/flex-view.js";
4
- import g from "../../../ui/separator/separator.js";
2
+ import { memo as x, useCallback as C } from "react";
3
+ import g from "../../../ui/layout/flex-view.js";
4
+ import u from "../../../ui/separator/separator.js";
5
5
  import { SIDEBAR_WIDTH as f } from "../constants.js";
6
- import u from "./navigator.js";
7
- import w from "./question-guide.js";
8
- import { SideBarContainer as S, UnderlinedTextWrapper as T, UnderlinedText as j } from "./worksheet-sidebar-styled.js";
9
- const I = $(
6
+ import w from "./navigator.js";
7
+ import S from "./question-guide.js";
8
+ import { SideBarContainer as T, UnderlinedTextWrapper as j, UnderlinedText as k } from "./worksheet-sidebar-styled.js";
9
+ const U = x(
10
10
  ({
11
11
  questionWidth: t,
12
12
  questions: i,
@@ -16,34 +16,36 @@ const I = $(
16
16
  height: l,
17
17
  actionbarHeight: s,
18
18
  openQuestionFeedbackModal: e,
19
- loggerRef: h
19
+ loggerRef: h,
20
+ studentClassroomId: p
20
21
  }) => {
21
- const p = i[m], { item_reference: o } = p ?? {}, d = x(() => {
22
+ const d = i[m], { item_reference: o } = d ?? {}, $ = C(() => {
22
23
  e && e(o || "");
23
24
  }, [o, e]);
24
25
  return c !== "TEACHER" || !e ? null : /* @__PURE__ */ n(
25
- S,
26
+ T,
26
27
  {
27
28
  $width: f,
28
29
  $questionWidth: t,
29
30
  $height: l,
30
31
  $justifyContent: "space-between",
31
32
  children: [
32
- /* @__PURE__ */ r(T, { $width: f, $alignItems: "flex-start", $gapX: 0.5, children: /* @__PURE__ */ r(j, { $renderAs: "cta1", onClick: d, children: "Question Feedback" }) }),
33
- /* @__PURE__ */ n(C, { children: [
33
+ /* @__PURE__ */ r(j, { $width: f, $alignItems: "flex-start", $gapX: 0.5, children: /* @__PURE__ */ r(k, { $renderAs: "cta1", onClick: $, children: "Question Feedback" }) }),
34
+ /* @__PURE__ */ n(g, { children: [
34
35
  /* @__PURE__ */ r(
35
- w,
36
+ S,
36
37
  {
37
38
  questionWidth: t,
38
39
  questions: i,
39
40
  activeQuestionIndex: m,
40
41
  learnosity: a,
41
42
  actionbarHeight: s,
42
- loggerRef: h
43
+ loggerRef: h,
44
+ studentClassroomId: p
43
45
  }
44
46
  ),
45
- /* @__PURE__ */ r(g, { heightX: 0.5 }),
46
- /* @__PURE__ */ r(u, {})
47
+ /* @__PURE__ */ r(u, { heightX: 0.5 }),
48
+ /* @__PURE__ */ r(w, {})
47
49
  ] })
48
50
  ]
49
51
  }
@@ -51,6 +53,6 @@ const I = $(
51
53
  }
52
54
  );
53
55
  export {
54
- I as default
56
+ U as default
55
57
  };
56
58
  //# sourceMappingURL=sidebar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/sidebar.tsx"],"sourcesContent":["import { memo, useCallback, type FC } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport type { TUserTypes } from '../../../ui/types';\nimport { SIDEBAR_WIDTH } from '../constants';\nimport type { ILearnosity, IWorksheetProps, IWorksheetQuestion } from '../worksheet-types';\nimport Navigator from './navigator';\nimport QuestionGuide from './question-guide';\nimport {\n SideBarContainer,\n UnderlinedText,\n UnderlinedTextWrapper,\n} from './worksheet-sidebar-styled';\n\ninterface IWorksheetSideBarProps extends Pick<IWorksheetProps, 'loggerRef'> {\n questionWidth: number;\n questions: IWorksheetQuestion[];\n activeQuestionIndex: number;\n learnosity: ILearnosity;\n userType: TUserTypes;\n height: number | string;\n actionbarHeight: number;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n}\n\nconst WorksheetSideBar: FC<IWorksheetSideBarProps> = memo(\n ({\n questionWidth,\n questions,\n activeQuestionIndex,\n learnosity,\n userType,\n height,\n actionbarHeight,\n openQuestionFeedbackModal,\n loggerRef,\n }) => {\n const activeQuestion = questions[activeQuestionIndex];\n const { item_reference: itemRef } = activeQuestion ?? {};\n\n const onFeedbackClick = useCallback(() => {\n if (openQuestionFeedbackModal) {\n openQuestionFeedbackModal(itemRef || '');\n }\n }, [itemRef, openQuestionFeedbackModal]);\n\n if (userType !== 'TEACHER' || !openQuestionFeedbackModal) return null;\n\n return (\n <SideBarContainer\n $width={SIDEBAR_WIDTH}\n $questionWidth={questionWidth}\n $height={height}\n $justifyContent=\"space-between\"\n >\n <UnderlinedTextWrapper $width={SIDEBAR_WIDTH} $alignItems=\"flex-start\" $gapX={0.5}>\n <UnderlinedText $renderAs=\"cta1\" onClick={onFeedbackClick}>\n Question Feedback\n </UnderlinedText>\n </UnderlinedTextWrapper>\n\n <FlexView>\n <QuestionGuide\n questionWidth={questionWidth}\n questions={questions}\n activeQuestionIndex={activeQuestionIndex}\n learnosity={learnosity}\n actionbarHeight={actionbarHeight}\n loggerRef={loggerRef}\n />\n <Separator heightX={0.5} />\n <Navigator />\n </FlexView>\n </SideBarContainer>\n );\n },\n);\n\nexport default WorksheetSideBar;\n"],"names":["WorksheetSideBar","memo","questionWidth","questions","activeQuestionIndex","learnosity","userType","height","actionbarHeight","openQuestionFeedbackModal","loggerRef","activeQuestion","itemRef","onFeedbackClick","useCallback","jsxs","SideBarContainer","SIDEBAR_WIDTH","jsx","UnderlinedTextWrapper","UnderlinedText","FlexView","QuestionGuide","Separator","Navigator"],"mappings":";;;;;;;;AA0BA,MAAMA,IAA+CC;AAAA,EACnD,CAAC;AAAA,IACC,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,WAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAiBR,EAAUC,CAAmB,GAC9C,EAAE,gBAAgBQ,MAAYD,KAAkB,CAAA,GAEhDE,IAAkBC,EAAY,MAAM;AACxC,MAAIL,KACFA,EAA0BG,KAAW,EAAE;AAAA,IACzC,GACC,CAACA,GAASH,CAAyB,CAAC;AAEvC,WAAIH,MAAa,aAAa,CAACG,IAAkC,OAG/D,gBAAAM;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,QAAQC;AAAA,QACR,gBAAgBf;AAAA,QAChB,SAASK;AAAA,QACT,iBAAgB;AAAA,QAEhB,UAAA;AAAA,UAAA,gBAAAW,EAACC,GAAsB,EAAA,QAAQF,GAAe,aAAY,cAAa,OAAO,KAC5E,UAAC,gBAAAC,EAAAE,GAAA,EAAe,WAAU,QAAO,SAASP,GAAiB,8BAE3D,CAAA,GACF;AAAA,4BAECQ,GACC,EAAA,UAAA;AAAA,YAAA,gBAAAH;AAAA,cAACI;AAAA,cAAA;AAAA,gBACC,eAAApB;AAAA,gBACA,WAAAC;AAAA,gBACA,qBAAAC;AAAA,gBACA,YAAAC;AAAA,gBACA,iBAAAG;AAAA,gBACA,WAAAE;AAAA,cAAA;AAAA,YACF;AAAA,YACA,gBAAAQ,EAACK,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,8BACxBC,GAAU,EAAA;AAAA,UAAA,GACb;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
1
+ {"version":3,"file":"sidebar.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/sidebar.tsx"],"sourcesContent":["import { memo, useCallback, type FC } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport type { TUserTypes } from '../../../ui/types';\nimport { SIDEBAR_WIDTH } from '../constants';\nimport type { ILearnosity, IWorksheetProps, IWorksheetQuestion } from '../worksheet-types';\nimport Navigator from './navigator';\nimport QuestionGuide from './question-guide';\nimport {\n SideBarContainer,\n UnderlinedText,\n UnderlinedTextWrapper,\n} from './worksheet-sidebar-styled';\n\ninterface IWorksheetSideBarProps extends Pick<IWorksheetProps, 'loggerRef'> {\n questionWidth: number;\n questions: IWorksheetQuestion[];\n activeQuestionIndex: number;\n learnosity: ILearnosity;\n userType: TUserTypes;\n height: number | string;\n actionbarHeight: number;\n studentClassroomId?: string;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n}\n\nconst WorksheetSideBar: FC<IWorksheetSideBarProps> = memo(\n ({\n questionWidth,\n questions,\n activeQuestionIndex,\n learnosity,\n userType,\n height,\n actionbarHeight,\n openQuestionFeedbackModal,\n loggerRef,\n studentClassroomId,\n }) => {\n const activeQuestion = questions[activeQuestionIndex];\n const { item_reference: itemRef } = activeQuestion ?? {};\n\n const onFeedbackClick = useCallback(() => {\n if (openQuestionFeedbackModal) {\n openQuestionFeedbackModal(itemRef || '');\n }\n }, [itemRef, openQuestionFeedbackModal]);\n\n if (userType !== 'TEACHER' || !openQuestionFeedbackModal) return null;\n\n return (\n <SideBarContainer\n $width={SIDEBAR_WIDTH}\n $questionWidth={questionWidth}\n $height={height}\n $justifyContent=\"space-between\"\n >\n <UnderlinedTextWrapper $width={SIDEBAR_WIDTH} $alignItems=\"flex-start\" $gapX={0.5}>\n <UnderlinedText $renderAs=\"cta1\" onClick={onFeedbackClick}>\n Question Feedback\n </UnderlinedText>\n </UnderlinedTextWrapper>\n\n <FlexView>\n <QuestionGuide\n questionWidth={questionWidth}\n questions={questions}\n activeQuestionIndex={activeQuestionIndex}\n learnosity={learnosity}\n actionbarHeight={actionbarHeight}\n loggerRef={loggerRef}\n studentClassroomId={studentClassroomId}\n />\n <Separator heightX={0.5} />\n <Navigator />\n </FlexView>\n </SideBarContainer>\n );\n },\n);\n\nexport default WorksheetSideBar;\n"],"names":["WorksheetSideBar","memo","questionWidth","questions","activeQuestionIndex","learnosity","userType","height","actionbarHeight","openQuestionFeedbackModal","loggerRef","studentClassroomId","activeQuestion","itemRef","onFeedbackClick","useCallback","jsxs","SideBarContainer","SIDEBAR_WIDTH","jsx","UnderlinedTextWrapper","UnderlinedText","FlexView","QuestionGuide","Separator","Navigator"],"mappings":";;;;;;;;AA2BA,MAAMA,IAA+CC;AAAA,EACnD,CAAC;AAAA,IACC,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,WAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAiBT,EAAUC,CAAmB,GAC9C,EAAE,gBAAgBS,MAAYD,KAAkB,CAAA,GAEhDE,IAAkBC,EAAY,MAAM;AACxC,MAAIN,KACFA,EAA0BI,KAAW,EAAE;AAAA,IACzC,GACC,CAACA,GAASJ,CAAyB,CAAC;AAEvC,WAAIH,MAAa,aAAa,CAACG,IAAkC,OAG/D,gBAAAO;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,QAAQC;AAAA,QACR,gBAAgBhB;AAAA,QAChB,SAASK;AAAA,QACT,iBAAgB;AAAA,QAEhB,UAAA;AAAA,UAAA,gBAAAY,EAACC,GAAsB,EAAA,QAAQF,GAAe,aAAY,cAAa,OAAO,KAC5E,UAAC,gBAAAC,EAAAE,GAAA,EAAe,WAAU,QAAO,SAASP,GAAiB,8BAE3D,CAAA,GACF;AAAA,4BAECQ,GACC,EAAA,UAAA;AAAA,YAAA,gBAAAH;AAAA,cAACI;AAAA,cAAA;AAAA,gBACC,eAAArB;AAAA,gBACA,WAAAC;AAAA,gBACA,qBAAAC;AAAA,gBACA,YAAAC;AAAA,gBACA,iBAAAG;AAAA,gBACA,WAAAE;AAAA,gBACA,oBAAAC;AAAA,cAAA;AAAA,YACF;AAAA,YACA,gBAAAQ,EAACK,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,8BACxBC,GAAU,EAAA;AAAA,UAAA,GACb;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
@@ -1,10 +1,11 @@
1
1
  import r from "styled-components";
2
- import c from "../../../../assets/line-icons/icons/bulb.js";
3
- import d from "../../../../assets/line-icons/icons/cross.js";
4
- import l from "../../../../assets/line-icons/icons/info.js";
2
+ import p from "../../../../assets/line-icons/icons/bulb.js";
3
+ import l from "../../../../assets/line-icons/icons/cross.js";
4
+ import d from "../../../../assets/line-icons/icons/info.js";
5
+ import a from "../../../../assets/line-icons/icons/sticker.js";
5
6
  import e from "../../../ui/layout/flex-view.js";
6
- import a from "../../../ui/text/text.js";
7
- import { CustomElement as x } from "../worksheet-question/worksheet-question-styled.js";
7
+ import x from "../../../ui/text/text.js";
8
+ import { CustomElement as m } from "../worksheet-question/worksheet-question-styled.js";
8
9
  r(e)`
9
10
  border: 2px solid #000;
10
11
  `;
@@ -19,29 +20,29 @@ const y = r(e)(
19
20
  border: 1px solid ${i.colors.GREY_2};
20
21
  overflow: hidden;
21
22
  `
22
- ), C = r(e)`
23
+ ), S = r(e)`
23
24
  cursor: pointer;
24
- `, I = r(a)`
25
+ `, k = r(x)`
25
26
  text-decoration: underline;
26
27
  white-space: nowrap;
27
28
  writing-mode: vertical-rl;
28
29
  text-align: right;
29
- `, s = (t) => t.startsWith("calc(") ? t.replace(")", " - 0px)") : t, p = (t) => t.trim().split(/\s+(?=[+-])/).map((n) => n.startsWith("-") ? `+${n.slice(1)}` : n.startsWith("+") ? `-${n.slice(1)}` : `-${n}`).join(" "), m = (t) => t.startsWith("calc(") && t.endsWith(")") ? (t = t.slice(5, -1), `calc(${p(t)})`) : p(t), T = r(e)(
30
+ `, 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(" "), f = (t) => t.startsWith("calc(") && t.endsWith(")") ? (t = t.slice(5, -1), `calc(${c(t)})`) : c(t), E = r(e)(
30
31
  ({ $questionWidth: t }) => `
31
32
  width: calc(${t}px - 32px); // 32px is the left + right padding
32
33
  overflow-y: auto;
33
34
  height: 100%;
34
35
  display: flex;
35
36
  `
36
- ), E = r(e)(({ $questionWidth: t, $height: o }) => `
37
- margin-top: ${typeof o == "number" ? `${-o}px` : m(s(o))};
37
+ ), G = r(e)(({ $questionWidth: t, $height: o }) => `
38
+ margin-top: ${typeof o == "number" ? `${-o}px` : f(s(o))};
38
39
  position: sticky;
39
40
  left: calc((100% - ${t}px ) *.5 + ${t}px + 12px);
40
41
  bottom: 16px;
41
42
  align-items: center;
42
43
  height: ${typeof o == "number" ? `${o}px` : s(o)};
43
44
  z-index: 1;
44
- `), G = r(e)(
45
+ `), T = r(e)(
45
46
  ({ theme: t }) => `
46
47
  width: 100%;
47
48
  border-radius: 8px;
@@ -50,7 +51,7 @@ const y = r(e)(
50
51
  align-items: center;
51
52
  padding: 10px;
52
53
  `
53
- ), S = r.div`
54
+ ), B = r.div`
54
55
  position: fixed;
55
56
  top: ${({ topValue: t }) => `${t}px`};
56
57
  left: ${({ leftValue: t }) => `${t}px`};
@@ -60,32 +61,37 @@ const y = r(e)(
60
61
  background: white;
61
62
  border-top: 1px solid #e0e0e0;
62
63
  border-right: 1px solid #e0e0e0;
63
- `, W = r(d)`
64
+ `, R = r(l)`
64
65
  position: absolute;
65
66
  top: 8px;
66
67
  right: 16px;
67
- `, k = r(l)(({ theme: t, $disabled: o }) => `
68
+ `, W = r(d)(({ theme: t, $disabled: o }) => `
68
69
  & path {
69
70
  stroke: ${o ? t.colors.GREY_4 : t.colors.BLACK};
70
71
  }
71
- `), v = r(c)(({ theme: t, $disabled: o }) => `
72
+ `), Y = r(p)(({ theme: t, $disabled: o }) => `
72
73
  & path {
73
74
  stroke: ${o ? t.colors.GREY_4 : t.colors.BLACK};
74
75
  }
75
- `), B = r(x)``;
76
+ `), _ = r(a)(({ theme: t, $disabled: o }) => `
77
+ & path {
78
+ stroke: ${o ? t.colors.GREY_4 : t.colors.BLACK};
79
+ }
80
+ `), v = r(m)``;
76
81
  export {
77
- W as CloseIcon,
78
- B as Guide,
79
- G as GuideContainer,
80
- k as HintIcon,
81
- S as Pointer,
82
- T as Section,
82
+ R as CloseIcon,
83
+ v as Guide,
84
+ T as GuideContainer,
85
+ W as HintIcon,
86
+ B as Pointer,
87
+ E as Section,
83
88
  y as SectionContainer,
84
- E as SideBarContainer,
85
- v as SolIcon,
86
- I as UnderlinedText,
87
- C as UnderlinedTextWrapper,
89
+ G as SideBarContainer,
90
+ Y as SolIcon,
91
+ _ as StickersIcon,
92
+ k as UnderlinedText,
93
+ S as UnderlinedTextWrapper,
88
94
  s as getMinHeightFromString,
89
- m as negateExpression
95
+ f as negateExpression
90
96
  };
91
97
  //# 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":";;;;;;;AASsBA,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,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A;AAAA,GAM5BC,IAAWxB,EAAOyB,CAAQ,EAA0B,CAAC,EAAE,OAAApB,GAAO,WAAAqB,QAClE;AAAA;AAAA,gBAEOA,IAAYrB,EAAM,OAAO,SAASA,EAAM,OAAO,KAAK;AAAA;AAAA,GAGnE,GAEYsB,IAAU3B,EAAO4B,CAAQ,EAA0B,CAAC,EAAE,OAAAvB,GAAO,WAAAqB,QACjE;AAAA;AAAA,gBAEOA,IAAYrB,EAAM,OAAO,SAASA,EAAM,OAAO,KAAK;AAAA;AAAA,GAGnE,GAEYwB,IAAQ7B,EAAO8B,CAAa;"}
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/sticker';\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});\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,EAC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