@cuemath/leap 3.2.16-as1 → 3.2.16-pzd-beta-0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/illustrations/illustrations.js +1 -0
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/cue-board-filled.js +33 -0
- package/dist/assets/line-icons/icons/cue-board-filled.js.map +1 -0
- package/dist/assets/line-icons/icons/cue-board.js +23 -0
- package/dist/assets/line-icons/icons/cue-board.js.map +1 -0
- package/dist/assets/line-icons/icons/screen-grab-filled.js +35 -0
- package/dist/assets/line-icons/icons/screen-grab-filled.js.map +1 -0
- package/dist/assets/line-icons/icons/screen-grab.js +23 -0
- package/dist/assets/line-icons/icons/screen-grab.js.map +1 -0
- package/dist/assets/line-icons/icons/sticker-filled.js +64 -0
- package/dist/assets/line-icons/icons/sticker-filled.js.map +1 -0
- package/dist/assets/line-icons/icons/sticker.js +46 -0
- package/dist/assets/line-icons/icons/sticker.js.map +1 -0
- package/dist/assets/lottie/lottie.js +5 -0
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/analytics-events/platform-events-student.js +2 -1
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/analytics-events/platform-events-teacher.js +6 -4
- package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +10 -8
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +2 -2
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +7 -4
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +85 -97
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +44 -42
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +31 -29
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +57 -50
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/utils.js +33 -27
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +17 -11
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +72 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +63 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +67 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +70 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +70 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +1 -0
- package/dist/features/journey/journey-id/journey-id-student.js +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
- package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
- package/dist/features/puzzles/api/puzzle-dashboard.js +10 -0
- package/dist/features/puzzles/api/puzzle-dashboard.js.map +1 -0
- package/dist/features/puzzles/app/puzzle-app.js +53 -73
- package/dist/features/puzzles/app/puzzle-app.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card-styled.js +24 -69
- package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card.js +64 -30
- package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
- package/dist/features/puzzles/constants/puzzle-container.js +8 -0
- package/dist/features/puzzles/constants/puzzle-container.js.map +1 -0
- package/dist/features/puzzles/puzzle-analytics-events.js +11 -0
- package/dist/features/puzzles/puzzle-analytics-events.js.map +1 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +55 -25
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +55 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +1 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container.js +100 -107
- package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +37 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +1 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +110 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +1 -0
- package/dist/features/puzzles/utils/puzzle-pattern.js +28 -13
- package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
- package/dist/features/ui/inputs/base-select-input/base-select-input.js +55 -57
- package/dist/features/ui/inputs/base-select-input/base-select-input.js.map +1 -1
- package/dist/features/ui/inputs/checkbox-input/checkbox-input.js +21 -21
- package/dist/features/ui/inputs/checkbox-input/checkbox-input.js.map +1 -1
- package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list.js +5 -5
- package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list.js.map +1 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +28 -0
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +43 -43
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +16 -12
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +101 -47
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +149 -146
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +242 -207
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +37 -37
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +307 -313
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +44 -35
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +108 -5
- package/dist/index.js +480 -458
- package/dist/index.js.map +1 -1
- package/dist/static/puzzle-blue-lottie.7017e2e8.json +1 -0
- package/dist/static/puzzle-blue-lottie.bf64ebc5.json +12760 -0
- package/dist/static/puzzle-dashboard-banner.b7956519.svg +1 -0
- package/dist/static/puzzle-green-lottie.1da90698.json +1 -0
- package/dist/static/puzzle-orange-lottie.cfcf3724.json +1 -0
- package/dist/static/puzzle-purple-lottie.e70de110.json +9860 -0
- package/dist/static/puzzle-yellow-lottie.275b5cf4.json +1 -0
- package/package.json +1 -1
- package/dist/features/worksheet/worksheet/mocks/activity.js +0 -6
- package/dist/features/worksheet/worksheet/mocks/activity.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/assessment.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/assessment.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/chapter_assessment.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/chapter_assessment.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/diagnostic.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/diagnostic.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/dynamic.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/dynamic.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/extra_practice.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/extra_practice.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/index.js +0 -95
- package/dist/features/worksheet/worksheet/mocks/behaviors/index.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/learning-v3.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/learning-v3.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/learning.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/learning.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/legacy.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/legacy.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/level2.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/level2.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/level3.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/level3.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/mastery.js +0 -41
- package/dist/features/worksheet/worksheet/mocks/behaviors/mastery.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/practice.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/practice.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle-card.js +0 -39
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle-card.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_easy.js +0 -39
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_easy.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_hard.js +0 -39
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_hard.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_medium.js +0 -39
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_medium.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/recap.js +0 -39
- package/dist/features/worksheet/worksheet/mocks/behaviors/recap.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/remedial.js +0 -39
- package/dist/features/worksheet/worksheet/mocks/behaviors/remedial.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/revision.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/revision.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat-math-assessment.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat-math-assessment.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat_english_learning.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat_english_learning.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat_math_learning.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat_math_learning.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat_math_recap.js +0 -39
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat_math_recap.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/target_practice.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/target_practice.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/trial-diagnostic-v2.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/trial-diagnostic-v2.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/trial-diagnostic.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/trial-diagnostic.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/turing_assessment.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/turing_assessment.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/turing_practice.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/turing_practice.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/signed-requests.js +0 -5
- package/dist/features/worksheet/worksheet/mocks/signed-requests.js.map +0 -1
- package/dist/features/worksheet/worksheet/stories/use-canvas-sync-broker-story.js +0 -57
- package/dist/features/worksheet/worksheet/stories/use-canvas-sync-broker-story.js.map +0 -1
- package/dist/features/worksheet/worksheet/stories/worksheet-story-container.js +0 -231
- package/dist/features/worksheet/worksheet/stories/worksheet-story-container.js.map +0 -1
- package/dist/features/worksheet/worksheet/stories/worksheet-student.js +0 -174
- package/dist/features/worksheet/worksheet/stories/worksheet-student.js.map +0 -1
- package/dist/features/worksheet/worksheet/stories/worksheet-teacher.js +0 -255
- package/dist/features/worksheet/worksheet/stories/worksheet-teacher.js.map +0 -1
- package/dist/types/models/worksheet.js +0 -5
- package/dist/types/models/worksheet.js.map +0 -1
@@ -1,5 +1,5 @@
|
|
1
|
-
import { jsxs as k, jsx as
|
2
|
-
import { useMemo as W, useRef as T, useCallback as
|
1
|
+
import { jsxs as k, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { useMemo as W, useRef as T, useCallback as d } from "react";
|
3
3
|
import X from "../../../../assets/line-icons/icons/cross.js";
|
4
4
|
import H from "../../hooks/use-context-menu-click-handler.js";
|
5
5
|
import q from "../base-input/base-input.js";
|
@@ -10,108 +10,106 @@ import Y from "./select-section/select-section.js";
|
|
10
10
|
const ae = (y) => {
|
11
11
|
const {
|
12
12
|
label: C,
|
13
|
-
value:
|
14
|
-
options:
|
15
|
-
searchable:
|
16
|
-
searchText:
|
13
|
+
value: r,
|
14
|
+
options: u,
|
15
|
+
searchable: n = !1,
|
16
|
+
searchText: g,
|
17
17
|
onCloseWithoutSelection: V,
|
18
|
-
onSearchTextChange:
|
19
|
-
onChange:
|
20
|
-
renderAs:
|
18
|
+
onSearchTextChange: o,
|
19
|
+
onChange: b,
|
20
|
+
renderAs: h,
|
21
21
|
width: A,
|
22
22
|
widthX: E,
|
23
|
-
disabled:
|
24
|
-
willShowMessage:
|
25
|
-
mandatory:
|
23
|
+
disabled: p,
|
24
|
+
willShowMessage: R,
|
25
|
+
mandatory: j,
|
26
26
|
size: v = "regular",
|
27
27
|
shape: m,
|
28
|
-
theme:
|
28
|
+
theme: f = "light",
|
29
29
|
isTransparent: w = !1,
|
30
30
|
renderOptionsAs: $ = "list",
|
31
|
-
errorMessage:
|
32
|
-
} = y, i = $ === "section-list" &&
|
33
|
-
var e;
|
34
|
-
if (
|
35
|
-
if (i)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
if (l) return (e = l.find((n) => n.id === s)) == null ? void 0 : e.label;
|
40
|
-
}, [t, b, i, l, s]), S = T(null), x = T(null), { menuVisible: a, onMenuClick: z, hideMenu: M } = H(
|
31
|
+
errorMessage: z
|
32
|
+
} = y, i = $ === "section-list" && u, s = $ === "list" && u, I = W(() => {
|
33
|
+
var e, c;
|
34
|
+
if (n) return g;
|
35
|
+
if (i)
|
36
|
+
return (e = i.flatMap((l) => l.data).find(({ id: l }) => l === r)) == null ? void 0 : e.label;
|
37
|
+
if (s) return (c = s.find((l) => l.id === r)) == null ? void 0 : c.label;
|
38
|
+
}, [n, g, i, s, r]), S = T(null), x = T(null), { menuVisible: a, onMenuClick: B, hideMenu: M } = H(
|
41
39
|
S,
|
42
40
|
void 0,
|
43
|
-
!
|
41
|
+
!n,
|
44
42
|
V,
|
45
|
-
|
46
|
-
),
|
43
|
+
p
|
44
|
+
), D = d(
|
47
45
|
(e) => {
|
48
|
-
|
46
|
+
n && o && o(e.target.value);
|
49
47
|
},
|
50
|
-
[
|
51
|
-
), O =
|
52
|
-
(e,
|
53
|
-
M(),
|
48
|
+
[o, n]
|
49
|
+
), O = d(
|
50
|
+
(e, c) => {
|
51
|
+
M(), b(e, c);
|
54
52
|
},
|
55
|
-
[M,
|
56
|
-
),
|
53
|
+
[M, b]
|
54
|
+
), F = d((e) => {
|
57
55
|
e.target.select(), setTimeout(() => {
|
58
56
|
e.target.scrollIntoView({
|
59
57
|
behavior: "smooth"
|
60
58
|
});
|
61
59
|
}, 300);
|
62
|
-
}, []),
|
60
|
+
}, []), L = d(() => {
|
63
61
|
var e;
|
64
|
-
|
65
|
-
}, [
|
66
|
-
return /* @__PURE__ */ k(J, { ref: S, $width: A, $widthX: E, onClick:
|
67
|
-
/* @__PURE__ */
|
62
|
+
o && (o(""), (e = x.current) == null || e.focus());
|
63
|
+
}, [o]);
|
64
|
+
return /* @__PURE__ */ k(J, { ref: S, $width: A, $widthX: E, onClick: B, children: [
|
65
|
+
/* @__PURE__ */ t(
|
68
66
|
q,
|
69
67
|
{
|
70
|
-
renderAs:
|
68
|
+
renderAs: h,
|
71
69
|
label: C,
|
72
70
|
stickyLabel: !0,
|
73
|
-
disabled:
|
74
|
-
willShowMessage:
|
71
|
+
disabled: p,
|
72
|
+
willShowMessage: R,
|
75
73
|
size: v,
|
76
|
-
mandatory:
|
74
|
+
mandatory: j,
|
77
75
|
shape: m,
|
78
76
|
isTransparent: w,
|
79
|
-
inputElement: /* @__PURE__ */
|
77
|
+
inputElement: /* @__PURE__ */ t(
|
80
78
|
G,
|
81
79
|
{
|
82
80
|
ref: x,
|
83
|
-
$renderAs:
|
81
|
+
$renderAs: h,
|
84
82
|
$size: v,
|
85
83
|
placeholder: I ? "" : C,
|
86
|
-
disabled:
|
87
|
-
readOnly: !
|
84
|
+
disabled: p,
|
85
|
+
readOnly: !n,
|
88
86
|
value: I ?? "",
|
89
|
-
onFocus:
|
90
|
-
onChange:
|
87
|
+
onFocus: n ? F : void 0,
|
88
|
+
onChange: n ? D : void 0,
|
91
89
|
$isTransparent: w
|
92
90
|
}
|
93
91
|
),
|
94
|
-
siblingElement:
|
95
|
-
errorMessage:
|
92
|
+
siblingElement: n && a ? /* @__PURE__ */ t(X, { onClick: L }) : m === "curved" || m === "borderLess" ? /* @__PURE__ */ t(P, { $menuVisible: a, pointerEvents: "none" }) : /* @__PURE__ */ t(Q, { $menuVisible: a, pointerEvents: "none" }),
|
93
|
+
errorMessage: z
|
96
94
|
}
|
97
95
|
),
|
98
|
-
|
99
|
-
i && /* @__PURE__ */
|
96
|
+
u.length > 0 && /* @__PURE__ */ t(K, { $visible: a, children: /* @__PURE__ */ k(N, { $renderAs: h, $theme: f, children: [
|
97
|
+
i && /* @__PURE__ */ t(
|
100
98
|
Y,
|
101
99
|
{
|
102
100
|
sectionOptions: i,
|
103
|
-
theme:
|
104
|
-
value:
|
101
|
+
theme: f,
|
102
|
+
value: r,
|
105
103
|
onChange: O
|
106
104
|
}
|
107
105
|
),
|
108
|
-
|
106
|
+
s && s.map((e) => /* @__PURE__ */ t(
|
109
107
|
U,
|
110
108
|
{
|
111
109
|
option: e,
|
112
|
-
selected: e.id ===
|
110
|
+
selected: e.id === r,
|
113
111
|
onChange: O,
|
114
|
-
theme:
|
112
|
+
theme: f
|
115
113
|
},
|
116
114
|
e.id
|
117
115
|
))
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base-select-input.js","sources":["../../../../../src/features/ui/inputs/base-select-input/base-select-input.tsx"],"sourcesContent":["import type { ISectionOption } from '../../section-list/section-list-types';\nimport type { IBaseSelectInputProps, ISelectOption } from './base-select-input-types';\nimport type { ChangeEvent, FocusEvent, ReactElement } from 'react';\n\nimport { useCallback, useMemo, useRef } from 'react';\n\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport useContextMenuClickHandler from '../../hooks/use-context-menu-click-handler';\nimport BaseInput from '../base-input/base-input';\nimport { Input } from '../text-input/text-input-styled';\nimport * as Styled from './base-select-input-styled';\nimport SelectOption from './select-option/select-option';\nimport SelectSection from './select-section/select-section';\n\nconst BaseSelectInput = <IDType extends string | number>(\n props: IBaseSelectInputProps<IDType>,\n): ReactElement => {\n const {\n label,\n value,\n options,\n searchable = false,\n searchText,\n onCloseWithoutSelection,\n onSearchTextChange,\n onChange,\n renderAs,\n width,\n widthX,\n disabled,\n willShowMessage,\n mandatory,\n size = 'regular',\n shape,\n theme = 'light',\n isTransparent = false,\n renderOptionsAs = 'list',\n errorMessage,\n } = props;\n\n const sectionOptions =\n renderOptionsAs === 'section-list' && (options as ISectionOption<ISelectOption<IDType>>[]);\n const selectOptions = renderOptionsAs === 'list' && (options as ISelectOption<IDType>[]);\n\n const inputValue = useMemo(() => {\n if (searchable) return searchText;\n\n if (sectionOptions) {\n
|
1
|
+
{"version":3,"file":"base-select-input.js","sources":["../../../../../src/features/ui/inputs/base-select-input/base-select-input.tsx"],"sourcesContent":["import type { ISectionOption } from '../../section-list/section-list-types';\nimport type { IBaseSelectInputProps, ISelectOption } from './base-select-input-types';\nimport type { ChangeEvent, FocusEvent, ReactElement } from 'react';\n\nimport { useCallback, useMemo, useRef } from 'react';\n\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport useContextMenuClickHandler from '../../hooks/use-context-menu-click-handler';\nimport BaseInput from '../base-input/base-input';\nimport { Input } from '../text-input/text-input-styled';\nimport * as Styled from './base-select-input-styled';\nimport SelectOption from './select-option/select-option';\nimport SelectSection from './select-section/select-section';\n\nconst BaseSelectInput = <IDType extends string | number>(\n props: IBaseSelectInputProps<IDType>,\n): ReactElement => {\n const {\n label,\n value,\n options,\n searchable = false,\n searchText,\n onCloseWithoutSelection,\n onSearchTextChange,\n onChange,\n renderAs,\n width,\n widthX,\n disabled,\n willShowMessage,\n mandatory,\n size = 'regular',\n shape,\n theme = 'light',\n isTransparent = false,\n renderOptionsAs = 'list',\n errorMessage,\n } = props;\n\n const sectionOptions =\n renderOptionsAs === 'section-list' && (options as ISectionOption<ISelectOption<IDType>>[]);\n const selectOptions = renderOptionsAs === 'list' && (options as ISelectOption<IDType>[]);\n\n const inputValue = useMemo(() => {\n if (searchable) return searchText;\n\n if (sectionOptions) {\n return sectionOptions.flatMap(section => section.data).find(({ id }) => id === value)\n ?.label as string;\n }\n\n if (selectOptions) return selectOptions.find(option => option.id === value)?.label;\n }, [searchable, searchText, sectionOptions, selectOptions, value]);\n\n const containerRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const inputRef = useRef<HTMLInputElement>(null) as React.RefObject<HTMLInputElement>;\n const { menuVisible, onMenuClick, hideMenu } = useContextMenuClickHandler(\n containerRef,\n undefined,\n !searchable,\n onCloseWithoutSelection,\n disabled,\n );\n\n const handleTextChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n if (searchable && onSearchTextChange) {\n onSearchTextChange(e.target.value);\n }\n },\n [onSearchTextChange, searchable],\n );\n\n const handleChange = useCallback<IBaseSelectInputProps<IDType>['onChange']>(\n (id, option) => {\n hideMenu();\n onChange(id, option);\n },\n [hideMenu, onChange],\n );\n\n const handleFocus = useCallback((e: FocusEvent<HTMLInputElement>) => {\n e.target.select();\n setTimeout(() => {\n e.target.scrollIntoView({\n behavior: 'smooth',\n });\n }, 300);\n }, []);\n\n const handleClear = useCallback(() => {\n if (onSearchTextChange) {\n onSearchTextChange('');\n inputRef.current?.focus();\n }\n }, [onSearchTextChange]);\n\n const downIcon =\n shape === 'curved' || shape === 'borderLess' ? (\n <Styled.StyledChevronDownIcon $menuVisible={menuVisible} pointerEvents=\"none\" />\n ) : (\n <Styled.StyledDownIcon $menuVisible={menuVisible} pointerEvents=\"none\" />\n );\n\n return (\n <Styled.Container ref={containerRef} $width={width} $widthX={widthX} onClick={onMenuClick}>\n <BaseInput\n renderAs={renderAs}\n label={label}\n stickyLabel={true}\n disabled={disabled}\n willShowMessage={willShowMessage}\n size={size}\n mandatory={mandatory}\n shape={shape}\n isTransparent={isTransparent}\n inputElement={\n <Input\n ref={inputRef}\n $renderAs={renderAs}\n $size={size}\n placeholder={inputValue ? '' : label}\n disabled={disabled}\n readOnly={!searchable}\n value={inputValue ?? ''}\n onFocus={searchable ? handleFocus : undefined}\n onChange={searchable ? handleTextChange : undefined}\n $isTransparent={isTransparent}\n />\n }\n siblingElement={searchable && menuVisible ? <CrossIcon onClick={handleClear} /> : downIcon}\n errorMessage={errorMessage}\n />\n\n {options.length > 0 && (\n <Styled.OptionsContainer $visible={menuVisible}>\n <Styled.OptionsWrapper $renderAs={renderAs} $theme={theme}>\n {sectionOptions && (\n <SelectSection<IDType>\n sectionOptions={sectionOptions}\n theme={theme}\n value={value}\n onChange={handleChange}\n />\n )}\n\n {selectOptions &&\n selectOptions.map(option => (\n <SelectOption<IDType>\n key={option.id}\n option={option}\n selected={option.id === value}\n onChange={handleChange}\n theme={theme}\n />\n ))}\n </Styled.OptionsWrapper>\n </Styled.OptionsContainer>\n )}\n </Styled.Container>\n );\n};\n\nexport default BaseSelectInput;\n"],"names":["BaseSelectInput","props","label","value","options","searchable","searchText","onCloseWithoutSelection","onSearchTextChange","onChange","renderAs","width","widthX","disabled","willShowMessage","mandatory","size","shape","theme","isTransparent","renderOptionsAs","errorMessage","sectionOptions","selectOptions","inputValue","useMemo","_a","section","id","_b","option","containerRef","useRef","inputRef","menuVisible","onMenuClick","hideMenu","useContextMenuClickHandler","handleTextChange","useCallback","handleChange","handleFocus","handleClear","jsxs","Styled.Container","jsx","BaseInput","Input","CrossIcon","Styled.StyledChevronDownIcon","Styled.StyledDownIcon","Styled.OptionsContainer","Styled.OptionsWrapper","SelectSection","SelectOption"],"mappings":"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"}
|
@@ -1,29 +1,29 @@
|
|
1
1
|
import { jsxs as b, jsx as t } from "react/jsx-runtime";
|
2
|
-
import { useCallback as
|
3
|
-
import { useTheme as
|
4
|
-
import
|
5
|
-
import { CheckboxOptionWrapper as W, CheckboxInputWrapper as z, CheckboxInput as A, CheckIcon as
|
6
|
-
const
|
2
|
+
import { useCallback as g } from "react";
|
3
|
+
import { useTheme as v } from "styled-components";
|
4
|
+
import I from "../../text/text.js";
|
5
|
+
import { CheckboxOptionWrapper as W, CheckboxInputWrapper as z, CheckboxInput as A, CheckIcon as O, IndeterminateIcon as T, CheckboxLabelWrapper as y } from "./checkbox-input-styled.js";
|
6
|
+
const L = (h) => {
|
7
7
|
const {
|
8
8
|
size: r,
|
9
9
|
label: i,
|
10
|
-
value:
|
10
|
+
value: a,
|
11
11
|
checked: e,
|
12
12
|
disabled: n,
|
13
|
-
renderAs:
|
13
|
+
renderAs: o,
|
14
14
|
labelWidthX: p,
|
15
|
-
indeterminate:
|
16
|
-
visibleOnCheck:
|
17
|
-
alignTopWithLabel:
|
15
|
+
indeterminate: k,
|
16
|
+
visibleOnCheck: u,
|
17
|
+
alignTopWithLabel: C = !1,
|
18
18
|
onChange: l
|
19
19
|
} = h, {
|
20
|
-
layout: { gutter:
|
20
|
+
layout: { gutter: $ },
|
21
21
|
checkbox: c
|
22
|
-
} =
|
22
|
+
} = v(), { textVariant: m } = c.sizes[r ?? "regular"], { textColorName: x } = c.variants[o ?? "black"], s = u ? e : !0, f = !e && k, d = g(() => {
|
23
23
|
if (n) return null;
|
24
|
-
l(
|
25
|
-
}, [e, n, l,
|
26
|
-
return /* @__PURE__ */ b(W, { $alignTop:
|
24
|
+
l(a, !e);
|
25
|
+
}, [e, n, l, a]);
|
26
|
+
return /* @__PURE__ */ b(W, { $alignTop: C, $disabled: n, children: [
|
27
27
|
/* @__PURE__ */ b(z, { onClick: d, $disabled: n, children: [
|
28
28
|
/* @__PURE__ */ t(
|
29
29
|
A,
|
@@ -32,15 +32,15 @@ const O = (h) => {
|
|
32
32
|
checked: e,
|
33
33
|
disabled: !!n,
|
34
34
|
onChange: () => null,
|
35
|
-
$renderAs:
|
35
|
+
$renderAs: o,
|
36
36
|
$size: r
|
37
37
|
}
|
38
38
|
),
|
39
|
-
e && /* @__PURE__ */ t(
|
40
|
-
f && /* @__PURE__ */ t(
|
39
|
+
e && /* @__PURE__ */ t(O, { $renderAs: o, $size: r }),
|
40
|
+
f && /* @__PURE__ */ t(T, { $disabled: n, $size: $ * 1.125 })
|
41
41
|
] }),
|
42
42
|
/* @__PURE__ */ t(
|
43
|
-
|
43
|
+
y,
|
44
44
|
{
|
45
45
|
$labelWidthX: p,
|
46
46
|
$visible: s,
|
@@ -48,7 +48,7 @@ const O = (h) => {
|
|
48
48
|
$disabled: n,
|
49
49
|
$checked: e,
|
50
50
|
children: typeof i == "string" ? /* @__PURE__ */ t(
|
51
|
-
|
51
|
+
I,
|
52
52
|
{
|
53
53
|
$renderAs: m[e ? "active" : "inactive"],
|
54
54
|
$color: x[e ? "active" : "inactive"],
|
@@ -58,7 +58,7 @@ const O = (h) => {
|
|
58
58
|
}
|
59
59
|
)
|
60
60
|
] });
|
61
|
-
}, q =
|
61
|
+
}, q = L;
|
62
62
|
export {
|
63
63
|
q as default
|
64
64
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"checkbox-input.js","sources":["../../../../../src/features/ui/inputs/checkbox-input/checkbox-input.tsx"],"sourcesContent":["import type { ICheckboxOptionProps } from './checkbox-input-types';\n\nimport { useCallback } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Text from '../../text/text';\nimport * as Styled from './checkbox-input-styled';\n\nconst CheckboxInput = <IDType extends string | number>(props: ICheckboxOptionProps<IDType>) => {\n const {\n size,\n label,\n value,\n checked,\n disabled,\n renderAs,\n labelWidthX,\n indeterminate,\n visibleOnCheck,\n alignTopWithLabel = false,\n onChange,\n } = props;\n\n const {\n layout: { gutter },\n checkbox,\n } = useTheme();\n\n const { textVariant } = checkbox.sizes[size ?? 'regular'];\n const { textColorName } = checkbox.variants[renderAs ?? 'black'];\n\n const renderLabel = visibleOnCheck ? checked : true;\n const renderIndeterminateState = !checked && indeterminate;\n\n const handleOnChange = useCallback(() => {\n if (disabled) return null;\n\n onChange(value, !checked);\n }, [checked, disabled, onChange, value]);\n\n return (\n <Styled.CheckboxOptionWrapper $alignTop={alignTopWithLabel} $disabled={disabled}>\n <Styled.CheckboxInputWrapper onClick={handleOnChange} $disabled={disabled}>\n <Styled.CheckboxInput\n type=\"checkbox\"\n checked={checked}\n disabled={!!disabled}\n onChange={() => null}\n $renderAs={renderAs}\n $size={size}\n />\n {checked && <Styled.CheckIcon $renderAs={renderAs} $size={size} />}\n\n {renderIndeterminateState && (\n <Styled.IndeterminateIcon $disabled={disabled} $size={gutter * 1.125} />\n )}\n </Styled.CheckboxInputWrapper>\n\n <Styled.CheckboxLabelWrapper\n $labelWidthX={labelWidthX}\n $visible={renderLabel}\n onClick={renderLabel ? handleOnChange : () => null}\n $disabled={disabled}\n $checked={checked}\n >\n {typeof label === 'string' ? (\n <Text\n $renderAs={textVariant[checked ? 'active' : 'inactive']}\n $color={textColorName[checked ? 'active' : 'inactive']}\n >\n {label}\n </Text>\n ) : (\n label\n )}\n </Styled.CheckboxLabelWrapper>\n </Styled.CheckboxOptionWrapper>\n );\n};\n\nexport default CheckboxInput;\n"],"names":["CheckboxInput","props","size","label","value","checked","disabled","renderAs","labelWidthX","indeterminate","visibleOnCheck","alignTopWithLabel","onChange","gutter","checkbox","useTheme","textVariant","textColorName","renderLabel","renderIndeterminateState","handleOnChange","useCallback","Styled.CheckboxOptionWrapper","jsxs","Styled.CheckboxInputWrapper","jsx","Styled.CheckboxInput","Styled.CheckIcon","Styled.IndeterminateIcon","Styled.CheckboxLabelWrapper","Text","
|
1
|
+
{"version":3,"file":"checkbox-input.js","sources":["../../../../../src/features/ui/inputs/checkbox-input/checkbox-input.tsx"],"sourcesContent":["import type { ICheckboxOptionProps } from './checkbox-input-types';\n\nimport { useCallback } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Text from '../../text/text';\nimport * as Styled from './checkbox-input-styled';\n\nconst CheckboxInput = <IDType extends string | number>(props: ICheckboxOptionProps<IDType>) => {\n const {\n size,\n label,\n value,\n checked,\n disabled,\n renderAs,\n labelWidthX,\n indeterminate,\n visibleOnCheck,\n alignTopWithLabel = false,\n onChange,\n } = props;\n\n const {\n layout: { gutter },\n checkbox,\n } = useTheme();\n\n const { textVariant } = checkbox.sizes[size ?? 'regular'];\n const { textColorName } = checkbox.variants[renderAs ?? 'black'];\n\n const renderLabel = visibleOnCheck ? checked : true;\n const renderIndeterminateState = !checked && indeterminate;\n\n const handleOnChange = useCallback(() => {\n if (disabled) return null;\n\n onChange(value, !checked);\n }, [checked, disabled, onChange, value]);\n\n return (\n <Styled.CheckboxOptionWrapper $alignTop={alignTopWithLabel} $disabled={disabled}>\n <Styled.CheckboxInputWrapper onClick={handleOnChange} $disabled={disabled}>\n <Styled.CheckboxInput\n type=\"checkbox\"\n checked={checked}\n disabled={!!disabled}\n onChange={() => null}\n $renderAs={renderAs}\n $size={size}\n />\n {checked && <Styled.CheckIcon $renderAs={renderAs} $size={size} />}\n\n {renderIndeterminateState && (\n <Styled.IndeterminateIcon $disabled={disabled} $size={gutter * 1.125} />\n )}\n </Styled.CheckboxInputWrapper>\n\n <Styled.CheckboxLabelWrapper\n $labelWidthX={labelWidthX}\n $visible={renderLabel}\n onClick={renderLabel ? handleOnChange : () => null}\n $disabled={disabled}\n $checked={checked}\n >\n {typeof label === 'string' ? (\n <Text\n $renderAs={textVariant[checked ? 'active' : 'inactive']}\n $color={textColorName[checked ? 'active' : 'inactive']}\n >\n {label}\n </Text>\n ) : (\n label\n )}\n </Styled.CheckboxLabelWrapper>\n </Styled.CheckboxOptionWrapper>\n );\n};\n\nexport default CheckboxInput;\n"],"names":["CheckboxInput","props","size","label","value","checked","disabled","renderAs","labelWidthX","indeterminate","visibleOnCheck","alignTopWithLabel","onChange","gutter","checkbox","useTheme","textVariant","textColorName","renderLabel","renderIndeterminateState","handleOnChange","useCallback","Styled.CheckboxOptionWrapper","jsxs","Styled.CheckboxInputWrapper","jsx","Styled.CheckboxInput","Styled.CheckIcon","Styled.IndeterminateIcon","Styled.CheckboxLabelWrapper","Text","CheckboxOption"],"mappings":";;;;;AAQA,MAAMA,IAAgB,CAAiCC,MAAwC;AACvF,QAAA;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,mBAAAC,IAAoB;AAAA,IACpB,UAAAC;AAAA,EACE,IAAAX,GAEE;AAAA,IACJ,QAAQ,EAAE,QAAAY,EAAO;AAAA,IACjB,UAAAC;AAAA,MACEC,EAAS,GAEP,EAAE,aAAAC,EAAY,IAAIF,EAAS,MAAMZ,KAAQ,SAAS,GAClD,EAAE,eAAAe,EAAc,IAAIH,EAAS,SAASP,KAAY,OAAO,GAEzDW,IAAcR,IAAiBL,IAAU,IACzCc,IAA2B,CAACd,KAAWI,GAEvCW,IAAiBC,EAAY,MAAM;AACvC,QAAIf,EAAiB,QAAA;AAEZ,IAAAM,EAAAR,GAAO,CAACC,CAAO;AAAA,KACvB,CAACA,GAASC,GAAUM,GAAUR,CAAK,CAAC;AAEvC,2BACGkB,GAAA,EAA6B,WAAWX,GAAmB,WAAWL,GACrE,UAAA;AAAA,IAAA,gBAAAiB,EAACC,GAAA,EAA4B,SAASJ,GAAgB,WAAWd,GAC/D,UAAA;AAAA,MAAA,gBAAAmB;AAAA,QAACC;AAAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAArB;AAAA,UACA,UAAU,CAAC,CAACC;AAAA,UACZ,UAAU,MAAM;AAAA,UAChB,WAAWC;AAAA,UACX,OAAOL;AAAA,QAAA;AAAA,MACT;AAAA,MACCG,uBAAYsB,GAAA,EAAiB,WAAWpB,GAAU,OAAOL,GAAM;AAAA,MAE/DiB,uBACES,GAAA,EAAyB,WAAWtB,GAAU,OAAOO,IAAS,OAAO;AAAA,IAAA,GAE1E;AAAA,IAEA,gBAAAY;AAAA,MAACI;AAAAA,MAAA;AAAA,QACC,cAAcrB;AAAA,QACd,UAAUU;AAAA,QACV,SAASA,IAAcE,IAAiB,MAAM;AAAA,QAC9C,WAAWd;AAAA,QACX,UAAUD;AAAA,QAET,UAAA,OAAOF,KAAU,WAChB,gBAAAsB;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,WAAWd,EAAYX,IAAU,WAAW,UAAU;AAAA,YACtD,QAAQY,EAAcZ,IAAU,WAAW,UAAU;AAAA,YAEpD,UAAAF;AAAA,UAAA;AAAA,QAAA,IAGHA;AAAA,MAAA;AAAA,IAEJ;AAAA,EACF,EAAA,CAAA;AAEJ,GAEA4B,IAAe/B;"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
2
2
|
import { useMemo as g, useCallback as I } from "react";
|
3
3
|
import L from "../../arrow-tooltip/arrow-tooltip.js";
|
4
|
-
import
|
5
|
-
import { CheckboxInputListWrapper as
|
4
|
+
import O from "../checkbox-input/checkbox-input.js";
|
5
|
+
import { CheckboxInputListWrapper as v, CheckboxOptionWrapper as A } from "./checkbox-input-list-styled.js";
|
6
6
|
const $ = (h) => {
|
7
7
|
const {
|
8
8
|
size: a,
|
@@ -24,9 +24,9 @@ const $ = (h) => {
|
|
24
24
|
},
|
25
25
|
[e, i, c, o]
|
26
26
|
);
|
27
|
-
return /* @__PURE__ */ r(
|
27
|
+
return /* @__PURE__ */ r(v, { children: d.map((t) => {
|
28
28
|
const { id: n, label: l } = t, p = o.includes(n), m = c && !p, k = (s == null ? void 0 : s.includes(n)) || m;
|
29
|
-
return /* @__PURE__ */ r(
|
29
|
+
return /* @__PURE__ */ r(A, { $numColumns: C ?? 1, children: /* @__PURE__ */ r(
|
30
30
|
L,
|
31
31
|
{
|
32
32
|
renderAs: "primary",
|
@@ -35,7 +35,7 @@ const $ = (h) => {
|
|
35
35
|
hidden: !m,
|
36
36
|
zIndex: 2,
|
37
37
|
children: /* @__PURE__ */ r(
|
38
|
-
|
38
|
+
O,
|
39
39
|
{
|
40
40
|
value: n,
|
41
41
|
size: a,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"checkbox-input-list.js","sources":["../../../../../src/features/ui/inputs/checkbox-input-list/checkbox-input-list.tsx"],"sourcesContent":["import type { ICheckboxInputProps } from './checkbox-input-list-types';\n\nimport { useCallback, useMemo } from 'react';\n\nimport ArrowTooltip from '../../arrow-tooltip/arrow-tooltip';\nimport CheckboxOption from '../checkbox-input/checkbox-input';\nimport * as Styled from './checkbox-input-list-styled';\n\nconst CheckboxInputList = <IDType extends string | number>(props: ICheckboxInputProps<IDType>) => {\n const {\n size,\n value,\n options,\n disabled,\n renderAs,\n numColumns,\n indeterminate,\n visibleOnCheck,\n maximumSelection,\n onChange,\n } = props;\n\n const reachedMaxLength = useMemo(\n () => !!(maximumSelection && maximumSelection > 1 && value.length >= maximumSelection),\n [maximumSelection, value.length],\n );\n\n const handleOnChange = useCallback(\n (selectedValue: IDType, selected: boolean) => {\n if (!selected) {\n onChange(value.filter(val => val !== selectedValue));\n } else {\n if (maximumSelection === 1) {\n onChange([selectedValue]);\n } else if (!reachedMaxLength || !maximumSelection) {\n onChange([...value, selectedValue]);\n }\n }\n },\n [maximumSelection, onChange, reachedMaxLength, value],\n );\n\n return (\n <Styled.CheckboxInputListWrapper>\n {options.map(option => {\n const { id, label } = option;\n\n const checked = value.includes(id);\n const showTooltip = reachedMaxLength && !checked;\n const disableCheck = disabled?.includes(id) || showTooltip;\n\n return (\n <Styled.CheckboxOptionWrapper key={id} $numColumns={numColumns ?? 1}>\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"top\"\n tooltipItem={`${maximumSelection} options already selected`}\n hidden={!showTooltip}\n zIndex={2}\n >\n <CheckboxOption<IDType>\n value={id}\n size={size}\n label={label}\n checked={checked}\n renderAs={renderAs}\n disabled={disableCheck}\n onChange={handleOnChange}\n indeterminate={indeterminate} //* Took this name from Mui.\n visibleOnCheck={visibleOnCheck}\n />\n </ArrowTooltip>\n </Styled.CheckboxOptionWrapper>\n );\n })}\n </Styled.CheckboxInputListWrapper>\n );\n};\n\nexport default CheckboxInputList;\n"],"names":["CheckboxInputList","props","size","value","options","disabled","renderAs","numColumns","indeterminate","visibleOnCheck","maximumSelection","onChange","reachedMaxLength","useMemo","handleOnChange","useCallback","selectedValue","selected","val","Styled.CheckboxInputListWrapper","option","id","label","checked","showTooltip","disableCheck","Styled.CheckboxOptionWrapper","jsx","ArrowTooltip","CheckboxOption","CheckboxInputList$1"],"mappings":";;;;;AAQA,MAAMA,IAAoB,CAAiCC,MAAuC;AAC1F,QAAA;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,UAAAC;AAAA,EACE,IAAAV,GAEEW,IAAmBC;AAAA,IACvB,MAAM,CAAC,EAAEH,KAAoBA,IAAmB,KAAKP,EAAM,UAAUO;AAAA,IACrE,CAACA,GAAkBP,EAAM,MAAM;AAAA,EAAA,GAG3BW,IAAiBC;AAAA,IACrB,CAACC,GAAuBC,MAAsB;AAC5C,MAAKA,IAGCP,MAAqB,IACdC,EAAA,CAACK,CAAa,CAAC,KACf,CAACJ,KAAoB,CAACF,MAC/BC,EAAS,CAAC,GAAGR,GAAOa,CAAa,CAAC,IALpCL,EAASR,EAAM,OAAO,CAAOe,MAAAA,MAAQF,CAAa,CAAC;AAAA,IAQvD;AAAA,IACA,CAACN,GAAkBC,GAAUC,GAAkBT,CAAK;AAAA,EAAA;AAGtD,2BACGgB,GAAA,EACE,UAAAf,EAAQ,IAAI,CAAUgB,MAAA;AACf,UAAA,EAAE,IAAAC,GAAI,OAAAC,EAAU,IAAAF,GAEhBG,IAAUpB,EAAM,SAASkB,CAAE,GAC3BG,IAAcZ,KAAoB,CAACW,GACnCE,KAAepB,KAAA,gBAAAA,EAAU,SAASgB,OAAOG;AAE/C,6BACGE,GAAA,EAAsC,aAAanB,KAAc,GAChE,UAAA,gBAAAoB;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,UAAS;AAAA,QACT,aAAa,GAAGlB,CAAgB;AAAA,QAChC,QAAQ,CAACc;AAAA,QACT,QAAQ;AAAA,QAER,UAAA,gBAAAG;AAAA,UAACE;
|
1
|
+
{"version":3,"file":"checkbox-input-list.js","sources":["../../../../../src/features/ui/inputs/checkbox-input-list/checkbox-input-list.tsx"],"sourcesContent":["import type { ICheckboxInputProps } from './checkbox-input-list-types';\n\nimport { useCallback, useMemo } from 'react';\n\nimport ArrowTooltip from '../../arrow-tooltip/arrow-tooltip';\nimport CheckboxOption from '../checkbox-input/checkbox-input';\nimport * as Styled from './checkbox-input-list-styled';\n\nconst CheckboxInputList = <IDType extends string | number>(props: ICheckboxInputProps<IDType>) => {\n const {\n size,\n value,\n options,\n disabled,\n renderAs,\n numColumns,\n indeterminate,\n visibleOnCheck,\n maximumSelection,\n onChange,\n } = props;\n\n const reachedMaxLength = useMemo(\n () => !!(maximumSelection && maximumSelection > 1 && value.length >= maximumSelection),\n [maximumSelection, value.length],\n );\n\n const handleOnChange = useCallback(\n (selectedValue: IDType, selected: boolean) => {\n if (!selected) {\n onChange(value.filter(val => val !== selectedValue));\n } else {\n if (maximumSelection === 1) {\n onChange([selectedValue]);\n } else if (!reachedMaxLength || !maximumSelection) {\n onChange([...value, selectedValue]);\n }\n }\n },\n [maximumSelection, onChange, reachedMaxLength, value],\n );\n\n return (\n <Styled.CheckboxInputListWrapper>\n {options.map(option => {\n const { id, label } = option;\n\n const checked = value.includes(id);\n const showTooltip = reachedMaxLength && !checked;\n const disableCheck = disabled?.includes(id) || showTooltip;\n\n return (\n <Styled.CheckboxOptionWrapper key={id} $numColumns={numColumns ?? 1}>\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"top\"\n tooltipItem={`${maximumSelection} options already selected`}\n hidden={!showTooltip}\n zIndex={2}\n >\n <CheckboxOption<IDType>\n value={id}\n size={size}\n label={label}\n checked={checked}\n renderAs={renderAs}\n disabled={disableCheck}\n onChange={handleOnChange}\n indeterminate={indeterminate} //* Took this name from Mui.\n visibleOnCheck={visibleOnCheck}\n />\n </ArrowTooltip>\n </Styled.CheckboxOptionWrapper>\n );\n })}\n </Styled.CheckboxInputListWrapper>\n );\n};\n\nexport default CheckboxInputList;\n"],"names":["CheckboxInputList","props","size","value","options","disabled","renderAs","numColumns","indeterminate","visibleOnCheck","maximumSelection","onChange","reachedMaxLength","useMemo","handleOnChange","useCallback","selectedValue","selected","val","Styled.CheckboxInputListWrapper","option","id","label","checked","showTooltip","disableCheck","Styled.CheckboxOptionWrapper","jsx","ArrowTooltip","CheckboxOption","CheckboxInputList$1"],"mappings":";;;;;AAQA,MAAMA,IAAoB,CAAiCC,MAAuC;AAC1F,QAAA;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,UAAAC;AAAA,EACE,IAAAV,GAEEW,IAAmBC;AAAA,IACvB,MAAM,CAAC,EAAEH,KAAoBA,IAAmB,KAAKP,EAAM,UAAUO;AAAA,IACrE,CAACA,GAAkBP,EAAM,MAAM;AAAA,EAAA,GAG3BW,IAAiBC;AAAA,IACrB,CAACC,GAAuBC,MAAsB;AAC5C,MAAKA,IAGCP,MAAqB,IACdC,EAAA,CAACK,CAAa,CAAC,KACf,CAACJ,KAAoB,CAACF,MAC/BC,EAAS,CAAC,GAAGR,GAAOa,CAAa,CAAC,IALpCL,EAASR,EAAM,OAAO,CAAOe,MAAAA,MAAQF,CAAa,CAAC;AAAA,IAQvD;AAAA,IACA,CAACN,GAAkBC,GAAUC,GAAkBT,CAAK;AAAA,EAAA;AAGtD,2BACGgB,GAAA,EACE,UAAAf,EAAQ,IAAI,CAAUgB,MAAA;AACf,UAAA,EAAE,IAAAC,GAAI,OAAAC,EAAU,IAAAF,GAEhBG,IAAUpB,EAAM,SAASkB,CAAE,GAC3BG,IAAcZ,KAAoB,CAACW,GACnCE,KAAepB,KAAA,gBAAAA,EAAU,SAASgB,OAAOG;AAE/C,6BACGE,GAAA,EAAsC,aAAanB,KAAc,GAChE,UAAA,gBAAAoB;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,UAAS;AAAA,QACT,aAAa,GAAGlB,CAAgB;AAAA,QAChC,QAAQ,CAACc;AAAA,QACT,QAAQ;AAAA,QAER,UAAA,gBAAAG;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,OAAOR;AAAA,YACP,MAAAnB;AAAA,YACA,OAAAoB;AAAA,YACA,SAAAC;AAAA,YACA,UAAAjB;AAAA,YACA,UAAUmB;AAAA,YACV,UAAUX;AAAA,YACV,eAAAN;AAAA,YACA,gBAAAC;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA,KAlB+BY,CAoBnC;AAAA,EAEH,CAAA,EACH,CAAA;AAEJ,GAEAS,IAAe9B;"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { useMemo as p, useEffect as m } from "react";
|
2
|
+
import { usePuzzleAttemptJourney as c } from "../../../journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js";
|
3
|
+
import { usePuzzleReviewJourney as f } from "../../../journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js";
|
4
|
+
import { usePuzzleUnassignJourney as l } from "../../../journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js";
|
5
|
+
import { useJourney as P } from "../../../journey/use-journey/use-journey.js";
|
6
|
+
const C = ({ behavior: a }) => {
|
7
|
+
const { maximumAttempts: e, canStartJourney: t } = a, { isJourneyActive: r, clearJourney: o } = P(), { puzzleAttemptCtaRef: i, startJourney: u } = c(), { puzzleReviewCtaRef: y, startJourney: n } = f(), { puzzleUnassignRef: J, startJourney: s } = l(), z = p(() => e === -2, [e]);
|
8
|
+
return m(() => {
|
9
|
+
z && t && !r && (u(), n(), s());
|
10
|
+
}, [
|
11
|
+
t,
|
12
|
+
r,
|
13
|
+
z,
|
14
|
+
u,
|
15
|
+
n,
|
16
|
+
s
|
17
|
+
]), m(() => () => {
|
18
|
+
o();
|
19
|
+
}, [o]), {
|
20
|
+
puzzleAttemptCtaRef: i,
|
21
|
+
puzzleReviewCtaRef: y,
|
22
|
+
puzzleUnassignRef: J
|
23
|
+
};
|
24
|
+
};
|
25
|
+
export {
|
26
|
+
C as useWorksheetJourney
|
27
|
+
};
|
28
|
+
//# sourceMappingURL=use-worksheet-journey.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"use-worksheet-journey.js","sources":["../../../../../src/features/worksheet/worksheet/hooks/use-worksheet-journey.ts"],"sourcesContent":["import type { IWorksheetBehavior } from '../worksheet-types';\n\nimport { useEffect, useMemo } from 'react';\n\nimport { usePuzzleAttemptJourney } from '../../../journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey';\nimport { usePuzzleReviewJourney } from '../../../journey/hooks/use-puzzles-journey/use-puzzle-review-journey';\nimport { usePuzzleUnassignJourney } from '../../../journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey';\nimport { useJourney } from '../../../journey/use-journey/use-journey';\n\ninterface IUseWorksheetJourney {\n behavior: IWorksheetBehavior;\n}\n\nconst useWorksheetJourney = ({ behavior }: IUseWorksheetJourney) => {\n const { maximumAttempts, canStartJourney } = behavior;\n\n const { isJourneyActive, clearJourney } = useJourney();\n\n const { puzzleAttemptCtaRef, startJourney: startPuzzleAttemptJourney } =\n usePuzzleAttemptJourney();\n\n const { puzzleReviewCtaRef, startJourney: startPuzzleReviewJourney } = usePuzzleReviewJourney();\n const { puzzleUnassignRef, startJourney: startPuzzleUnassignJourney } =\n usePuzzleUnassignJourney();\n\n const isPuzzleCard = useMemo(() => maximumAttempts === -2, [maximumAttempts]);\n\n useEffect(() => {\n if (isPuzzleCard && canStartJourney && !isJourneyActive) {\n //* This will be triggered by STUDENT during resume sheet.\n startPuzzleAttemptJourney();\n //* This will be triggered by TEACHER during review sheet\n startPuzzleReviewJourney();\n //* This will be trigger by TEACHER during preview sheet.\n startPuzzleUnassignJourney();\n }\n }, [\n canStartJourney,\n isJourneyActive,\n isPuzzleCard,\n startPuzzleAttemptJourney,\n startPuzzleReviewJourney,\n startPuzzleUnassignJourney,\n ]);\n\n useEffect(() => {\n return () => {\n clearJourney();\n };\n }, [clearJourney]);\n\n return {\n puzzleAttemptCtaRef,\n puzzleReviewCtaRef,\n puzzleUnassignRef,\n };\n};\n\nexport { useWorksheetJourney };\n"],"names":["useWorksheetJourney","behavior","maximumAttempts","canStartJourney","isJourneyActive","clearJourney","useJourney","puzzleAttemptCtaRef","startPuzzleAttemptJourney","usePuzzleAttemptJourney","puzzleReviewCtaRef","startPuzzleReviewJourney","usePuzzleReviewJourney","puzzleUnassignRef","startPuzzleUnassignJourney","usePuzzleUnassignJourney","isPuzzleCard","useMemo","useEffect"],"mappings":";;;;;AAaA,MAAMA,IAAsB,CAAC,EAAE,UAAAC,QAAqC;AAC5D,QAAA,EAAE,iBAAAC,GAAiB,iBAAAC,EAAoB,IAAAF,GAEvC,EAAE,iBAAAG,GAAiB,cAAAC,EAAa,IAAIC,EAAW,GAE/C,EAAE,qBAAAC,GAAqB,cAAcC,MACzCC,EAAwB,GAEpB,EAAE,oBAAAC,GAAoB,cAAcC,MAA6BC,EAAuB,GACxF,EAAE,mBAAAC,GAAmB,cAAcC,MACvCC,EAAyB,GAErBC,IAAeC,EAAQ,MAAMf,MAAoB,IAAI,CAACA,CAAe,CAAC;AAE5E,SAAAgB,EAAU,MAAM;AACV,IAAAF,KAAgBb,KAAmB,CAACC,MAEZI,KAEDG,KAEEG;EAC7B,GACC;AAAA,IACDX;AAAA,IACAC;AAAA,IACAY;AAAA,IACAR;AAAA,IACAG;AAAA,IACAG;AAAA,EAAA,CACD,GAEDI,EAAU,MACD,MAAM;AACE,IAAAb;EAAA,GAEd,CAACA,CAAY,CAAC,GAEV;AAAA,IACL,qBAAAE;AAAA,IACA,oBAAAG;AAAA,IACA,mBAAAG;AAAA,EAAA;AAEJ;"}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import
|
2
|
-
import
|
1
|
+
import w from "../../../assets/line-icons/icons/bulb2.js";
|
2
|
+
import S from "../../../assets/line-icons/icons/edit-star.js";
|
3
3
|
import A from "../../../assets/line-icons/icons/edit2.js";
|
4
|
-
import
|
5
|
-
import
|
4
|
+
import k from "../../../assets/line-icons/icons/question-letter.js";
|
5
|
+
import L from "../../../assets/line-icons/icons/star2.js";
|
6
6
|
import b from "../constants/events.js";
|
7
|
-
import { OPTIONAL_ITEM_TYPES as
|
7
|
+
import { OPTIONAL_ITEM_TYPES as O, ACTION_BAR_HEIGHT as R, QUESTION_WIDTH as C, SPLIT_QUESTION_WIDTH as N, CLOZE_FORMULA_RESPONSE_LIMIT as x } from "./constants.js";
|
8
8
|
import { QUESTION_TAGS as E } from "./worksheet-types.js";
|
9
9
|
const Q = (e) => {
|
10
10
|
switch (e) {
|
@@ -30,12 +30,12 @@ const Q = (e) => {
|
|
30
30
|
default:
|
31
31
|
return;
|
32
32
|
}
|
33
|
-
},
|
33
|
+
}, B = (e) => {
|
34
34
|
if (!e)
|
35
35
|
return !1;
|
36
36
|
const r = e.toLowerCase();
|
37
37
|
return r === "intro" || r === "concept-intro";
|
38
|
-
},
|
38
|
+
}, y = (e) => e.reduce((r, t) => {
|
39
39
|
const [n, s] = t.split(":"), a = n == null ? void 0 : n.trim(), c = s == null ? void 0 : s.trim();
|
40
40
|
return !a || !c ? r : {
|
41
41
|
...r,
|
@@ -44,16 +44,16 @@ const Q = (e) => {
|
|
44
44
|
}, {}), Y = (e, { sectioned: r = !1, adaptive: t = !1 }) => {
|
45
45
|
if (r)
|
46
46
|
return e.reduce((s, a, c) => {
|
47
|
-
var
|
47
|
+
var T;
|
48
48
|
let d = !1;
|
49
49
|
const { content: u, questions: i, itemType: o } = a, l = Q(o), m = s[s.length - 1], g = l === (m == null ? void 0 : m.section_name) && (m != null && m.item_display_number) ? m.item_display_number + 1 : 1, _ = u.match(/question-[^"]*/g), p = _ == null ? void 0 : _.map((f, h) => {
|
50
|
-
const
|
50
|
+
const v = i.find(
|
51
51
|
({ response_id: I }) => I === f.replace("question-", "")
|
52
52
|
);
|
53
|
-
if (!
|
53
|
+
if (!v)
|
54
54
|
throw new Error(`Question not found for the response id: ${f}`);
|
55
|
-
return d = d ||
|
56
|
-
...
|
55
|
+
return d = d || B(v.instructor_stimulus), {
|
56
|
+
...v,
|
57
57
|
// Some questions are set to limited number of attempts which can show feedback which is causing the question to be stuck in the errored state
|
58
58
|
feedback_attempts: void 0,
|
59
59
|
item_reference: a.reference,
|
@@ -61,16 +61,16 @@ const Q = (e) => {
|
|
61
61
|
item_display_number: g,
|
62
62
|
section_name: l,
|
63
63
|
item_type: r ? o : void 0,
|
64
|
-
is_optional: o ?
|
64
|
+
is_optional: o ? O.includes(o) : !1,
|
65
65
|
item_tags: a.tags ?? [],
|
66
|
-
item_tags_map:
|
66
|
+
item_tags_map: y(a.tags ?? []),
|
67
67
|
question_number: h - (d ? 1 : 0),
|
68
68
|
total_questions: _.length
|
69
69
|
};
|
70
70
|
});
|
71
71
|
if (d = !1, p != null && p[0] && c > 0 && e.length > 0) {
|
72
|
-
const f = (
|
73
|
-
if ((h === "practice-basic" || h === "practice-regular" || h === "exit-ticket" || h === "advanced") && h !==
|
72
|
+
const f = (T = e[c - 1]) == null ? void 0 : T.itemType, h = o != null && o.startsWith("advanced-") ? "advanced" : o, v = f != null && f.startsWith("advanced-") ? "advanced" : f;
|
73
|
+
if ((h === "practice-basic" || h === "practice-regular" || h === "exit-ticket" || h === "advanced") && h !== v)
|
74
74
|
return [
|
75
75
|
...s,
|
76
76
|
{
|
@@ -105,7 +105,7 @@ const Q = (e) => {
|
|
105
105
|
item_number: c,
|
106
106
|
item_display_number: c + 1,
|
107
107
|
item_tags: a.tags ?? [],
|
108
|
-
item_tags_map:
|
108
|
+
item_tags_map: y(a.tags ?? []),
|
109
109
|
question_number: m,
|
110
110
|
total_questions: i.length
|
111
111
|
};
|
@@ -131,7 +131,7 @@ const Q = (e) => {
|
|
131
131
|
});
|
132
132
|
}
|
133
133
|
return n;
|
134
|
-
},
|
134
|
+
}, z = ({
|
135
135
|
questions: e,
|
136
136
|
initialQuestion: r,
|
137
137
|
initialResponseId: t,
|
@@ -154,7 +154,7 @@ const Q = (e) => {
|
|
154
154
|
if ((u = e[0]) != null && u.response_id)
|
155
155
|
return e[0].response_id;
|
156
156
|
throw new Error("Initial question not found");
|
157
|
-
},
|
157
|
+
}, J = ({
|
158
158
|
questions: e,
|
159
159
|
responses: r,
|
160
160
|
behavior: t,
|
@@ -186,7 +186,7 @@ const Q = (e) => {
|
|
186
186
|
}
|
187
187
|
return e.length - u;
|
188
188
|
};
|
189
|
-
function
|
189
|
+
function M(e, r) {
|
190
190
|
var n, s;
|
191
191
|
const t = Array.isArray(e) ? e.find((a) => a.response_id === r) : e;
|
192
192
|
if (!t)
|
@@ -206,10 +206,10 @@ function B(e, r) {
|
|
206
206
|
}
|
207
207
|
};
|
208
208
|
}
|
209
|
-
const
|
209
|
+
const V = (e) => e.reduce(
|
210
210
|
(r, t) => ({
|
211
211
|
...r,
|
212
|
-
[t.response_id]:
|
212
|
+
[t.response_id]: M(e, t.response_id)
|
213
213
|
}),
|
214
214
|
{}
|
215
215
|
), X = (e, r) => {
|
@@ -217,9 +217,9 @@ const z = (e) => e.reduce(
|
|
217
217
|
return {
|
218
218
|
questionsContainerWidth: !e.some(
|
219
219
|
(a) => a.questions.some((c) => c.stimulus_review)
|
220
|
-
) ?
|
221
|
-
maxQuestionWidth:
|
222
|
-
actionbarHeight: t === "bottom" ?
|
220
|
+
) ? C : N,
|
221
|
+
maxQuestionWidth: C,
|
222
|
+
actionbarHeight: t === "bottom" ? R : 0
|
223
223
|
};
|
224
224
|
}, Z = ({
|
225
225
|
questions: e,
|
@@ -346,21 +346,21 @@ const z = (e) => e.reduce(
|
|
346
346
|
}, ae = (e) => {
|
347
347
|
switch (e) {
|
348
348
|
case "learning":
|
349
|
-
return
|
349
|
+
return w;
|
350
350
|
case "practice-basic":
|
351
351
|
return A;
|
352
352
|
case "practice-regular":
|
353
|
-
return
|
353
|
+
return S;
|
354
354
|
case "exit-ticket":
|
355
|
-
return
|
355
|
+
return k;
|
356
356
|
case "advanced":
|
357
|
-
return
|
357
|
+
return L;
|
358
358
|
default:
|
359
|
-
return
|
359
|
+
return w;
|
360
360
|
}
|
361
|
-
}, ie = (e) =>
|
361
|
+
}, ie = (e) => Array.isArray(e.value) ? e.value.some(
|
362
362
|
(t) => typeof t == "string" && t.length > x
|
363
|
-
) : !1,
|
363
|
+
) : !1, se = (e, r) => {
|
364
364
|
const t = e === "TEACHER";
|
365
365
|
return r ? {
|
366
366
|
bannerBackgroundColor: "GREEN_4",
|
@@ -369,7 +369,7 @@ const z = (e) => e.reduce(
|
|
369
369
|
bannerBackgroundColor: "ORANGE_2",
|
370
370
|
label: "Complete this with your tutor in class"
|
371
371
|
};
|
372
|
-
},
|
372
|
+
}, ce = ({
|
373
373
|
isPuzzleWorksheet: e,
|
374
374
|
isTestWorksheet: r,
|
375
375
|
imageHue: t = "BLUE"
|
@@ -385,27 +385,27 @@ const z = (e) => e.reduce(
|
|
385
385
|
bgColor: "BLACK",
|
386
386
|
borderColor: "BLACK_4",
|
387
387
|
textColor: "WHITE"
|
388
|
-
};
|
388
|
+
}, ue = (e) => e ? `${e}_1` : "BLUE_1";
|
389
389
|
export {
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
390
|
+
ie as checkIsClozeFormulaResponseInvalid,
|
391
|
+
z as getInitialQuestionId,
|
392
|
+
V as getInitialResponses,
|
393
|
+
J as getLastUnlockedQuestionIndex,
|
394
394
|
ne as getNavigationSectionBackgroundColor,
|
395
395
|
ae as getNavigationSectionIcon,
|
396
396
|
oe as getNavigationSectionName,
|
397
397
|
ee as getPaperColorByQuestion,
|
398
|
+
ue as getPuzzleWorksheetBackgroundColor,
|
398
399
|
te as getQuestionBackgroundImage,
|
399
400
|
re as getQuestionBorderColor,
|
400
|
-
|
401
|
+
M as getQuestionMetadata,
|
401
402
|
Y as getQuestionsFromItems,
|
402
403
|
Z as getRenderableQuestions,
|
403
404
|
X as getWorksheetDimensions,
|
404
|
-
|
405
|
-
|
406
|
-
|
405
|
+
ce as getWorksheetHeaderLayout,
|
406
|
+
se as getWorksheetNudgeBannerInfo,
|
407
|
+
B as isConceptIntroWidget,
|
407
408
|
W as isOkayTypeQuestion,
|
408
|
-
ie as isSATAssessmentNode,
|
409
409
|
j as scrollToQuestion,
|
410
410
|
q as setMathJaxConfigInWindow
|
411
411
|
};
|