@cuemath/leap 3.0.29-aa0 → 3.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/line-icons/icons/check.js +3 -3
- package/dist/assets/line-icons/icons/check.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-context.js +5 -8
- package/dist/features/cue-canvas/cue-canvas-context.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-core.js +70 -68
- package/dist/features/cue-canvas/cue-canvas-core.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-helpers.js +25 -31
- package/dist/features/cue-canvas/cue-canvas-helpers.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-provider.js +12 -14
- package/dist/features/cue-canvas/cue-canvas-provider.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas.js +66 -85
- package/dist/features/cue-canvas/cue-canvas.js.map +1 -1
- package/dist/features/cue-canvas/cue-cavas-styled.js +42 -45
- package/dist/features/cue-canvas/cue-cavas-styled.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js +54 -61
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-cue-canvas-actions.js +14 -18
- package/dist/features/cue-canvas/hooks/use-cue-canvas-actions.js.map +1 -1
- package/dist/features/cue-canvas/toolbar/grid-menu.js +13 -13
- package/dist/features/cue-canvas/toolbar/grid-menu.js.map +1 -1
- package/dist/features/homework/styles.js +5 -4
- package/dist/features/homework/styles.js.map +1 -1
- package/dist/features/ui/stepper/stepper.js +7 -7
- package/dist/features/worksheet/worksheet/hooks/use-s3-helper.js +19 -22
- package/dist/features/worksheet/worksheet/hooks/use-s3-helper.js.map +1 -1
- package/dist/index.d.ts +2 -48
- package/dist/index.js +180 -184
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/dist/assets/line-icons/icons/puzzle-icon.js +0 -51
- package/dist/assets/line-icons/icons/puzzle-icon.js.map +0 -1
- package/dist/assets/line-icons/icons/share.js +0 -48
- package/dist/assets/line-icons/icons/share.js.map +0 -1
- package/dist/assets/line-icons/icons/tile.js +0 -54
- package/dist/assets/line-icons/icons/tile.js.map +0 -1
- package/dist/features/cue-canvas/bottombar/homework-controls.js +0 -73
- package/dist/features/cue-canvas/bottombar/homework-controls.js.map +0 -1
- package/dist/features/cue-canvas/hooks/use-upload-helper.js +0 -23
- package/dist/features/cue-canvas/hooks/use-upload-helper.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/homework/helper.js +0 -20
- package/dist/features/cue-canvas/sidebar/homework/helper.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/homework/homework-menu.js +0 -33
- package/dist/features/cue-canvas/sidebar/homework/homework-menu.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/homework/homework-request.js +0 -68
- package/dist/features/cue-canvas/sidebar/homework/homework-request.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/homework/homework-styled.js +0 -25
- package/dist/features/cue-canvas/sidebar/homework/homework-styled.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/homework/homework.js +0 -39
- package/dist/features/cue-canvas/sidebar/homework/homework.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/api/get-puzzles.js +0 -13
- package/dist/features/cue-canvas/sidebar/puzzles/api/get-puzzles.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/filter-selection-menu.js +0 -60
- package/dist/features/cue-canvas/sidebar/puzzles/filter-selection-menu.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/filters-section.js +0 -44
- package/dist/features/cue-canvas/sidebar/puzzles/filters-section.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/filters.js +0 -107
- package/dist/features/cue-canvas/sidebar/puzzles/filters.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/hooks/use-fetch-cue-canvas-activity.js +0 -42
- package/dist/features/cue-canvas/sidebar/puzzles/hooks/use-fetch-cue-canvas-activity.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/launch-puzzle.js +0 -84
- package/dist/features/cue-canvas/sidebar/puzzles/launch-puzzle.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu-header.js +0 -36
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu-header.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu.js +0 -133
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles-styled.js +0 -96
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles-styled.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles.js +0 -29
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/puzzles/utils.js +0 -120
- package/dist/features/cue-canvas/sidebar/puzzles/utils.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/sidebar-styled.js +0 -32
- package/dist/features/cue-canvas/sidebar/sidebar-styled.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/sidebar.js +0 -29
- package/dist/features/cue-canvas/sidebar/sidebar.js.map +0 -1
- package/dist/features/cue-canvas/sidebar/tiles/tile.js +0 -16
- package/dist/features/cue-canvas/sidebar/tiles/tile.js.map +0 -1
- package/dist/features/hooks/use-debounce.js +0 -16
- package/dist/features/hooks/use-debounce.js.map +0 -1
@@ -1,81 +1,74 @@
|
|
1
|
-
import { useMessageBrokerChannel as
|
2
|
-
import { useState as
|
3
|
-
const
|
4
|
-
userId:
|
5
|
-
data:
|
6
|
-
height:
|
7
|
-
responseId:
|
8
|
-
|
9
|
-
|
10
|
-
}), W = (r, m, f, a = "canvas") => {
|
11
|
-
const [p, b] = E(
|
1
|
+
import { useMessageBrokerChannel as q } from "@cuemath/cue-message-broker";
|
2
|
+
import { useState as x, useRef as w, useMemo as E, useCallback as h } from "react";
|
3
|
+
const I = (c) => ({
|
4
|
+
userId: c.userId,
|
5
|
+
data: c.data,
|
6
|
+
height: c.height,
|
7
|
+
responseId: c.responseId
|
8
|
+
}), F = (c, f, g) => {
|
9
|
+
const [d, m] = x(
|
12
10
|
() => {
|
13
|
-
var o,
|
14
|
-
const
|
15
|
-
if (!
|
16
|
-
for (const { message:
|
17
|
-
const e = (o =
|
11
|
+
var o, r;
|
12
|
+
const n = {};
|
13
|
+
if (!g) return n;
|
14
|
+
for (const { message: a } of g) {
|
15
|
+
const e = (o = a.payload) == null ? void 0 : o.eventPayload, s = e == null ? void 0 : e.responseId;
|
18
16
|
if (!(e != null && e.responseId)) continue;
|
19
|
-
const t =
|
20
|
-
s &&
|
17
|
+
const t = I(e);
|
18
|
+
s && n[s] ? (r = n[s]) == null || r.push(t) : n[s] = [t];
|
21
19
|
}
|
22
|
-
return
|
20
|
+
return n;
|
23
21
|
}
|
24
|
-
), u =
|
22
|
+
), u = w({}), b = E(
|
25
23
|
() => ({
|
26
|
-
channelId:
|
27
|
-
ttl:
|
28
|
-
logger:
|
24
|
+
channelId: c,
|
25
|
+
ttl: 0,
|
26
|
+
logger: f
|
29
27
|
}),
|
30
|
-
[
|
31
|
-
), S =
|
32
|
-
u.current = { ...u.current, [
|
33
|
-
}, []),
|
34
|
-
(
|
35
|
-
const
|
36
|
-
|
37
|
-
var
|
38
|
-
const { payload: e } =
|
39
|
-
if (!o &&
|
40
|
-
|
41
|
-
data:
|
42
|
-
height:
|
43
|
-
userId:
|
44
|
-
responseId: t
|
45
|
-
gridName: s == null ? void 0 : s.gridName,
|
46
|
-
dimension: s == null ? void 0 : s.dimension
|
28
|
+
[c, f]
|
29
|
+
), S = h((n, o) => {
|
30
|
+
u.current = { ...u.current, [n]: o };
|
31
|
+
}, []), C = h(
|
32
|
+
(n, o) => {
|
33
|
+
const r = {};
|
34
|
+
n.forEach((a) => {
|
35
|
+
var p;
|
36
|
+
const { payload: e } = a.message, { eventPayload: s } = e, t = s == null ? void 0 : s.responseId, R = s == null ? void 0 : s.data, B = s == null ? void 0 : s.userId, j = s == null ? void 0 : s.height, l = u.current[t];
|
37
|
+
if (!o && l)
|
38
|
+
l({
|
39
|
+
data: R,
|
40
|
+
height: j,
|
41
|
+
userId: B,
|
42
|
+
responseId: t
|
47
43
|
});
|
48
44
|
else {
|
49
|
-
const
|
50
|
-
t &&
|
45
|
+
const k = I(s);
|
46
|
+
t && r[t] ? (p = r[t]) == null || p.push(k) : r[t] = [k];
|
51
47
|
}
|
52
|
-
}), Object.keys(
|
53
|
-
const e = { ...
|
54
|
-
return Object.keys(
|
48
|
+
}), Object.keys(r).length > 0 && m((a) => {
|
49
|
+
const e = { ...a };
|
50
|
+
return Object.keys(r).forEach((s) => {
|
55
51
|
var t;
|
56
|
-
s && e[s] ? (t = e[s]) == null || t.push(...
|
52
|
+
s && e[s] ? (t = e[s]) == null || t.push(...r[s] ?? []) : e[s] = r[s] ?? [];
|
57
53
|
}), e;
|
58
54
|
});
|
59
55
|
},
|
60
56
|
[]
|
61
|
-
), { publish: D, channelStatus:
|
62
|
-
channelOptions:
|
63
|
-
consumerFn:
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
}, [h]);
|
57
|
+
), { publish: D, channelStatus: M, channel: i } = q({
|
58
|
+
channelOptions: b,
|
59
|
+
consumerFn: C
|
60
|
+
}), O = h(() => {
|
61
|
+
i && i.destroyChannel();
|
62
|
+
}, [i]);
|
68
63
|
return {
|
69
64
|
publishStrokes: D,
|
70
|
-
channelStatus:
|
71
|
-
closeChannel:
|
72
|
-
initialStrokesData:
|
73
|
-
registerCallback: S
|
74
|
-
setChannelMetadata: O,
|
75
|
-
channelMetadata: N
|
65
|
+
channelStatus: M,
|
66
|
+
closeChannel: O,
|
67
|
+
initialStrokesData: d,
|
68
|
+
registerCallback: S
|
76
69
|
};
|
77
|
-
},
|
70
|
+
}, $ = F;
|
78
71
|
export {
|
79
|
-
|
72
|
+
$ as default
|
80
73
|
};
|
81
74
|
//# sourceMappingURL=use-canvas-sync-broker.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-canvas-sync-broker.js","sources":["../../../../src/features/cue-canvas/hooks/use-canvas-sync-broker.ts"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"file":"use-canvas-sync-broker.js","sources":["../../../../src/features/cue-canvas/hooks/use-canvas-sync-broker.ts"],"sourcesContent":["import type { IActionData, TCueCanvasChangeDataObject } from '../types/cue-canvas';\n\nimport { useMessageBrokerChannel, type IChannelMessage } from '@cuemath/cue-message-broker';\nimport { useMemo, useCallback, useState, useRef } from 'react';\n\ninterface IMessage {\n eventName: string;\n eventPayload: {\n responseId: string;\n data: TCueCanvasChangeDataObject;\n userId: string;\n height: number;\n };\n}\n\nconst extractStrokeData = (payload: IMessage['eventPayload']): IActionData => ({\n userId: payload.userId,\n data: payload.data,\n height: payload.height,\n responseId: payload.responseId,\n});\n\nconst useCanvasSyncBroker = (\n channelId: string,\n logEvent: (type: string, payload?: Record<string, unknown>) => void,\n initialCanvasData?: Array<IChannelMessage>,\n) => {\n const [initialStrokesData, setInitialStrokesData] = useState<Record<string, IActionData[]>>(\n () => {\n const map: Record<string, IActionData[]> = {};\n\n if (!initialCanvasData) return map;\n\n for (const { message } of initialCanvasData) {\n const payload = (message.payload as IMessage)?.eventPayload;\n const qrId = payload?.responseId;\n\n if (!payload?.responseId) continue;\n\n const strokeData = extractStrokeData(payload);\n\n if (qrId && map[qrId]) {\n map[qrId]?.push(strokeData);\n } else {\n map[qrId] = [strokeData];\n }\n }\n\n return map;\n },\n );\n const callbacksMapRef = useRef<Record<string, (data: IActionData) => void>>({});\n\n const channelOptions = useMemo(\n () => ({\n channelId,\n ttl: 0,\n logger: logEvent,\n }),\n [channelId, logEvent],\n );\n\n const registerCallback = useCallback((qrId: string, cb: (data: IActionData) => void) => {\n callbacksMapRef.current = { ...callbacksMapRef.current, [qrId]: cb };\n }, []);\n\n const onMessageReceive = useCallback(\n (messages: Array<IChannelMessage>, initialData?: boolean) => {\n const strokesPerWidgetMap: Record<string, Array<IActionData>> = {};\n\n messages.forEach(message => {\n const { payload } = message.message;\n const { eventPayload } = payload as IMessage;\n const qrId = eventPayload?.responseId as string;\n const strokes = eventPayload?.data;\n const userId = eventPayload?.userId;\n const canvasHeight = eventPayload?.height;\n const widgetOnReceiveCallback = callbacksMapRef.current[qrId];\n\n if (!initialData && widgetOnReceiveCallback) {\n widgetOnReceiveCallback({\n data: strokes,\n height: canvasHeight,\n userId,\n responseId: qrId,\n });\n } else {\n const strokeData = extractStrokeData(eventPayload);\n\n if (qrId && strokesPerWidgetMap[qrId]) {\n strokesPerWidgetMap[qrId]?.push(strokeData);\n } else {\n strokesPerWidgetMap[qrId] = [strokeData];\n }\n }\n });\n\n if (Object.keys(strokesPerWidgetMap).length > 0) {\n setInitialStrokesData(prevData => {\n const currentData = { ...prevData };\n\n Object.keys(strokesPerWidgetMap).forEach(key => {\n if (key && currentData[key]) {\n currentData[key]?.push(...(strokesPerWidgetMap[key] ?? []));\n } else {\n currentData[key] = strokesPerWidgetMap[key] ?? [];\n }\n });\n\n return currentData;\n });\n }\n },\n [],\n );\n\n const { publish, channelStatus, channel } = useMessageBrokerChannel({\n channelOptions,\n consumerFn: onMessageReceive,\n });\n\n const closeChannel = useCallback(() => {\n if (channel) {\n channel.destroyChannel();\n }\n }, [channel]);\n\n return {\n publishStrokes: publish,\n channelStatus,\n closeChannel,\n initialStrokesData,\n registerCallback,\n };\n};\n\nexport default useCanvasSyncBroker;\n"],"names":["extractStrokeData","payload","useCanvasSyncBroker","channelId","logEvent","initialCanvasData","initialStrokesData","setInitialStrokesData","useState","map","message","_a","qrId","strokeData","_b","callbacksMapRef","useRef","channelOptions","useMemo","registerCallback","useCallback","cb","onMessageReceive","messages","initialData","strokesPerWidgetMap","eventPayload","strokes","userId","canvasHeight","widgetOnReceiveCallback","prevData","currentData","key","publish","channelStatus","channel","useMessageBrokerChannel","closeChannel","useCanvasSyncBroker$1"],"mappings":"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"}
|
@@ -1,32 +1,28 @@
|
|
1
|
-
import { useContext as
|
2
|
-
import
|
3
|
-
const
|
1
|
+
import { useContext as c, useMemo as l } from "react";
|
2
|
+
import a from "../cue-canvas-context.js";
|
3
|
+
const m = () => {
|
4
4
|
const {
|
5
|
-
activeInstance:
|
6
|
-
setActiveTool:
|
5
|
+
activeInstance: t,
|
6
|
+
setActiveTool: o,
|
7
7
|
activeTool: e,
|
8
|
-
setActiveInstance:
|
8
|
+
setActiveInstance: i,
|
9
9
|
activeColor: s,
|
10
|
-
setActiveColor:
|
11
|
-
|
12
|
-
setHomeworkId: c
|
13
|
-
} = a(v), l = m(
|
10
|
+
setActiveColor: n
|
11
|
+
} = c(a), r = l(
|
14
12
|
() => e ? ["pen", "ruler", "highlighter", "marker"].includes(e) : !1,
|
15
13
|
[e]
|
16
14
|
);
|
17
15
|
return {
|
18
|
-
activeInstance:
|
19
|
-
setActiveTool:
|
16
|
+
activeInstance: t,
|
17
|
+
setActiveTool: o,
|
20
18
|
activeTool: e,
|
21
|
-
setActiveInstance:
|
19
|
+
setActiveInstance: i,
|
22
20
|
activeColor: s,
|
23
|
-
setActiveColor:
|
24
|
-
isWritingToolActive:
|
25
|
-
homeworkId: n,
|
26
|
-
setHomeworkId: c
|
21
|
+
setActiveColor: n,
|
22
|
+
isWritingToolActive: r
|
27
23
|
};
|
28
24
|
};
|
29
25
|
export {
|
30
|
-
|
26
|
+
m as useCueCanvasActions
|
31
27
|
};
|
32
28
|
//# sourceMappingURL=use-cue-canvas-actions.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-cue-canvas-actions.js","sources":["../../../../src/features/cue-canvas/hooks/use-cue-canvas-actions.ts"],"sourcesContent":["import { useContext, useMemo } from 'react';\n\nimport PolyContext from '../cue-canvas-context';\n\nexport const useCueCanvasActions = () => {\n const {\n activeInstance,\n setActiveTool,\n activeTool,\n setActiveInstance,\n activeColor,\n setActiveColor,\n
|
1
|
+
{"version":3,"file":"use-cue-canvas-actions.js","sources":["../../../../src/features/cue-canvas/hooks/use-cue-canvas-actions.ts"],"sourcesContent":["import { useContext, useMemo } from 'react';\n\nimport PolyContext from '../cue-canvas-context';\n\nexport const useCueCanvasActions = () => {\n const {\n activeInstance,\n setActiveTool,\n activeTool,\n setActiveInstance,\n activeColor,\n setActiveColor,\n } = useContext(PolyContext);\n\n const isWritingToolActive = useMemo(\n () => (activeTool ? ['pen', 'ruler', 'highlighter', 'marker'].includes(activeTool) : false),\n [activeTool],\n );\n\n return {\n activeInstance,\n setActiveTool,\n activeTool,\n setActiveInstance,\n activeColor,\n setActiveColor,\n isWritingToolActive,\n };\n};\n"],"names":["useCueCanvasActions","activeInstance","setActiveTool","activeTool","setActiveInstance","activeColor","setActiveColor","useContext","PolyContext","isWritingToolActive","useMemo"],"mappings":";;AAIO,MAAMA,IAAsB,MAAM;AACjC,QAAA;AAAA,IACJ,gBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,EAAA,IACEC,EAAWC,CAAW,GAEpBC,IAAsBC;AAAA,IAC1B,MAAOP,IAAa,CAAC,OAAO,SAAS,eAAe,QAAQ,EAAE,SAASA,CAAU,IAAI;AAAA,IACrF,CAACA,CAAU;AAAA,EAAA;AAGN,SAAA;AAAA,IACL,gBAAAF;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,qBAAAG;AAAA,EAAA;AAEJ;"}
|
@@ -1,27 +1,27 @@
|
|
1
1
|
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
2
2
|
import { memo as f, useRef as C, useCallback as $ } from "react";
|
3
|
-
import
|
3
|
+
import n from "../../ui/buttons/clickable/clickable.js";
|
4
4
|
import h from "../../ui/hooks/use-context-menu-click-handler.js";
|
5
|
-
import
|
5
|
+
import t from "../../ui/layout/flex-view.js";
|
6
6
|
import { GRID_NAMES as b } from "../cue-canvas-helpers.js";
|
7
7
|
import { StyledWrapper as k, MenuWrapper as G } from "../cue-cavas-styled.js";
|
8
|
-
import { useCueCanvasActions as
|
8
|
+
import { useCueCanvasActions as l } from "../hooks/use-cue-canvas-actions.js";
|
9
9
|
import { GRID_TO_COMP as x } from "./icon-map.js";
|
10
|
-
const A = f(({ GridIcon:
|
11
|
-
const { activeInstance: e } =
|
12
|
-
|
10
|
+
const A = f(({ GridIcon: c }) => {
|
11
|
+
const { activeInstance: e } = l(), i = C(null), { activeTool: d } = l(), { menuVisible: m, onMenuClick: u } = h(
|
12
|
+
i,
|
13
13
|
void 0,
|
14
14
|
!0,
|
15
15
|
void 0
|
16
16
|
), p = $(
|
17
17
|
(o) => {
|
18
|
-
e == null || e.changeGrid(o)
|
18
|
+
e == null || e.changeGrid(o);
|
19
19
|
},
|
20
|
-
[e
|
20
|
+
[e]
|
21
21
|
);
|
22
|
-
return /* @__PURE__ */ a(
|
23
|
-
/* @__PURE__ */ r(
|
24
|
-
|
22
|
+
return /* @__PURE__ */ a(t, { $gutterX: 0.25, ref: i, children: [
|
23
|
+
/* @__PURE__ */ r(n, { onClick: u, label: "grid", children: /* @__PURE__ */ r(k, { $active: d === "grid", children: /* @__PURE__ */ r(c, {}) }) }),
|
24
|
+
m && /* @__PURE__ */ r(
|
25
25
|
G,
|
26
26
|
{
|
27
27
|
$borderColor: "GREY_1",
|
@@ -33,12 +33,12 @@ const A = f(({ GridIcon: d }) => {
|
|
33
33
|
children: b.map((o) => {
|
34
34
|
const s = x[o];
|
35
35
|
return /* @__PURE__ */ r(
|
36
|
-
|
36
|
+
n,
|
37
37
|
{
|
38
38
|
onClick: () => p(o),
|
39
39
|
label: o,
|
40
40
|
children: /* @__PURE__ */ r(
|
41
|
-
|
41
|
+
t,
|
42
42
|
{
|
43
43
|
$width: 48,
|
44
44
|
$height: 48,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"grid-menu.js","sources":["../../../../src/features/cue-canvas/toolbar/grid-menu.tsx"],"sourcesContent":["import type { TCueCanvasGridName } from '../types/cue-canvas';\nimport type { IGridMenu, TToolComponentType } from '../types/toolbar';\n\nimport React, { memo, useCallback, useRef } from 'react';\n\nimport Clickable from '../../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../../ui/layout/flex-view';\nimport { GRID_NAMES } from '../cue-canvas-helpers';\nimport { MenuWrapper, StyledWrapper } from '../cue-cavas-styled';\nimport { useCueCanvasActions } from '../hooks/use-cue-canvas-actions';\nimport { GRID_TO_COMP } from './icon-map';\n\nconst GridMenu: React.FC<IGridMenu> = memo(({ GridIcon }) => {\n const { activeInstance: cueCanvas } = useCueCanvasActions();\n const gridMenuRef = useRef(null);\n const { activeTool } = useCueCanvasActions();\n const { menuVisible, onMenuClick } = useContextMenuClickHandler(\n gridMenuRef,\n undefined,\n true,\n undefined,\n );\n const onGridOptionClick = useCallback(\n (gridOption: TCueCanvasGridName) => {\n cueCanvas?.changeGrid(gridOption);\n
|
1
|
+
{"version":3,"file":"grid-menu.js","sources":["../../../../src/features/cue-canvas/toolbar/grid-menu.tsx"],"sourcesContent":["import type { TCueCanvasGridName } from '../types/cue-canvas';\nimport type { IGridMenu, TToolComponentType } from '../types/toolbar';\n\nimport React, { memo, useCallback, useRef } from 'react';\n\nimport Clickable from '../../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../../ui/layout/flex-view';\nimport { GRID_NAMES } from '../cue-canvas-helpers';\nimport { MenuWrapper, StyledWrapper } from '../cue-cavas-styled';\nimport { useCueCanvasActions } from '../hooks/use-cue-canvas-actions';\nimport { GRID_TO_COMP } from './icon-map';\n\nconst GridMenu: React.FC<IGridMenu> = memo(({ GridIcon }) => {\n const { activeInstance: cueCanvas } = useCueCanvasActions();\n const gridMenuRef = useRef(null);\n const { activeTool } = useCueCanvasActions();\n const { menuVisible, onMenuClick } = useContextMenuClickHandler(\n gridMenuRef,\n undefined,\n true,\n undefined,\n );\n const onGridOptionClick = useCallback(\n (gridOption: TCueCanvasGridName) => {\n cueCanvas?.changeGrid(gridOption);\n },\n [cueCanvas],\n );\n\n return (\n <FlexView $gutterX={0.25} ref={gridMenuRef}>\n <Clickable onClick={onMenuClick} label=\"grid\">\n <StyledWrapper $active={activeTool === 'grid'}>\n <GridIcon />\n </StyledWrapper>\n </Clickable>\n {menuVisible && (\n <MenuWrapper\n $borderColor=\"GREY_1\"\n $background=\"GREY_1\"\n $flexDirection=\"row\"\n $widthX={11.15}\n $flexWrap={true}\n $flexGapX={0.5}\n >\n {GRID_NAMES.map(gridName => {\n const GridComponent = GRID_TO_COMP[gridName] as TToolComponentType;\n\n return (\n <Clickable\n key={gridName}\n onClick={() => onGridOptionClick(gridName)}\n label={gridName}\n >\n <FlexView\n $width={48}\n $height={48}\n $borderColor=\"BLACK\"\n $borderRadius={4}\n $background=\"WHITE\"\n >\n <GridComponent />\n </FlexView>\n </Clickable>\n );\n })}\n </MenuWrapper>\n )}\n </FlexView>\n );\n});\n\nexport default GridMenu;\n"],"names":["GridMenu","memo","GridIcon","cueCanvas","useCueCanvasActions","gridMenuRef","useRef","activeTool","menuVisible","onMenuClick","useContextMenuClickHandler","onGridOptionClick","useCallback","gridOption","jsxs","FlexView","jsx","Clickable","StyledWrapper","MenuWrapper","GRID_NAMES","gridName","GridComponent","GRID_TO_COMP"],"mappings":";;;;;;;;;AAaA,MAAMA,IAAgCC,EAAK,CAAC,EAAE,UAAAC,QAAe;AAC3D,QAAM,EAAE,gBAAgBC,EAAU,IAAIC,EAAoB,GACpDC,IAAcC,EAAO,IAAI,GACzB,EAAE,YAAAC,MAAeH,KACjB,EAAE,aAAAI,GAAa,aAAAC,EAAA,IAAgBC;AAAA,IACnCL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,GAEIM,IAAoBC;AAAA,IACxB,CAACC,MAAmC;AAClC,MAAAV,KAAA,QAAAA,EAAW,WAAWU;AAAA,IACxB;AAAA,IACA,CAACV,CAAS;AAAA,EAAA;AAGZ,SACG,gBAAAW,EAAAC,GAAA,EAAS,UAAU,MAAM,KAAKV,GAC7B,UAAA;AAAA,IAAA,gBAAAW,EAACC,GAAU,EAAA,SAASR,GAAa,OAAM,QACrC,UAAA,gBAAAO,EAACE,GAAc,EAAA,SAASX,MAAe,QACrC,UAAC,gBAAAS,EAAAd,GAAA,CAAA,CAAS,EACZ,CAAA,GACF;AAAA,IACCM,KACC,gBAAAQ;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,cAAa;AAAA,QACb,aAAY;AAAA,QACZ,gBAAe;AAAA,QACf,SAAS;AAAA,QACT,WAAW;AAAA,QACX,WAAW;AAAA,QAEV,UAAAC,EAAW,IAAI,CAAYC,MAAA;AACpB,gBAAAC,IAAgBC,EAAaF,CAAQ;AAGzC,iBAAA,gBAAAL;AAAA,YAACC;AAAA,YAAA;AAAA,cAEC,SAAS,MAAMN,EAAkBU,CAAQ;AAAA,cACzC,OAAOA;AAAA,cAEP,UAAA,gBAAAL;AAAA,gBAACD;AAAA,gBAAA;AAAA,kBACC,QAAQ;AAAA,kBACR,SAAS;AAAA,kBACT,cAAa;AAAA,kBACb,eAAe;AAAA,kBACf,aAAY;AAAA,kBAEZ,4BAACO,GAAc,EAAA;AAAA,gBAAA;AAAA,cACjB;AAAA,YAAA;AAAA,YAZKD;AAAA,UAAA;AAAA,QAaP,CAEH;AAAA,MAAA;AAAA,IACH;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
|
@@ -18,7 +18,7 @@ const c = r(e)(({ theme: o }) => `
|
|
18
18
|
-webkit-box-orient: vertical;
|
19
19
|
overflow: hidden;
|
20
20
|
text-overflow: ellipsis;
|
21
|
-
`,
|
21
|
+
`, x = r(e)(({
|
22
22
|
$shouldopenonright: o,
|
23
23
|
$visible: t
|
24
24
|
}) => `
|
@@ -33,8 +33,9 @@ const c = r(e)(({ theme: o }) => `
|
|
33
33
|
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
|
34
34
|
box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.4);
|
35
35
|
z-index: 10;
|
36
|
-
`),
|
36
|
+
`), u = r(e)`
|
37
37
|
border: 1px solid ${({ theme: o }) => o.colors.BLACK_T_15};
|
38
|
+
border-top-width: 2px;
|
38
39
|
&:hover {
|
39
40
|
border: 1px solid ${({ theme: o }) => o.colors.BLACK};
|
40
41
|
border-top-width: 2px;
|
@@ -117,9 +118,9 @@ export {
|
|
117
118
|
w as BannerImageWrapper,
|
118
119
|
v as BlurContainer,
|
119
120
|
$ as BlurFlexView,
|
120
|
-
|
121
|
+
u as CardContainer,
|
121
122
|
c as CardKebabMenuWrapper,
|
122
|
-
|
123
|
+
x as CardMenuOptionsWrapper,
|
123
124
|
b as CardWrapper,
|
124
125
|
m as HeaderText,
|
125
126
|
h as IconWrapper,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../src/features/homework/styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport Minus2Icon from '../../assets/line-icons/icons/minus2';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\ninterface ICardWrapperProps {\n $bgImage: string;\n}\ninterface ICardOptionsMenuWrapperProps {\n $visible: boolean;\n $shouldopenonright: boolean;\n}\n\nexport const CardKebabMenuWrapper = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n width: 24px;\n height: 24px;\n \n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport const SubHeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const CardMenuOptionsWrapper = styled(FlexView)<ICardOptionsMenuWrapperProps>(({\n $shouldopenonright,\n $visible,\n}) => {\n return `\n cursor: pointer;\n position: absolute;\n z-index: 6;\n top: calc(100% + 4px);\n right: ${$shouldopenonright ? 0 : 'auto'};\n transform-origin: top;\n transform: scaleY(${$visible ? 1 : 0});\n opacity: ${$visible ? 1 : 0};\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.4);\n z-index: 10;\n `;\n});\n\nexport const CardContainer = styled(FlexView)`\n border: 1px solid ${({ theme }) => theme.colors.BLACK_T_15};\n &:hover {\n border: 1px solid ${({ theme }) => theme.colors.BLACK};\n border-top-width: 2px;\n }\n`;\n\nexport const CardWrapper = styled(FlexView)<ICardWrapperProps>(({ $bgImage }) => {\n if ($bgImage) {\n return `\n background-image: url(${$bgImage});\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n overflow: hidden;\n `;\n }\n\n return 'overflow: hidden;';\n});\n\nexport const IconWrapper = styled(FlexView)`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const BannerImageWrapper = styled(FlexView)`\n position: absolute;\n right: -18px;\n top: -4px;\n`;\n\nexport const BannerImage = styled.img(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n border: 1px solid ${theme.colors.BLACK_T_15};\n width: ${gutter * 4}px;\n height: ${gutter * 4}px;\n border-radius: 50%;\n `;\n});\n\nexport const StyledMinus2Icon = styled(Minus2Icon)`\n path {\n stroke: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const HeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: break-spaces;\n`;\n\ninterface ICardOptionWrapperProps {\n $disabled?: boolean;\n}\ninterface ICardOptionsProps {\n $top: number;\n $left: number;\n}\n\nexport const CardOptions = styled(FlexView)<ICardOptionsProps>``;\n\nexport const CardOptionWrapper = styled(FlexView)<ICardOptionWrapperProps>(({\n theme,\n $disabled,\n}) => {\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n \n &:hover {\n background: ${$disabled ? 'transparent' : theme.colors.BLACK};\n };\n \n path {\n fill: ${theme.colors.WHITE_1};\n }\n `;\n});\n\nexport const OptionText = styled(Text)`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const MenuWrapper = styled(FlexView)`\n position: absolute;\n z-index: 6;\n top: calc(100% - 36px);\n right: 12px;\n transform-origin: top;\n transform: scaleY(1);\n`;\n\nexport const BlurContainer = styled(FlexView)`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.5;\n`;\n\nexport const BlurFlexView = styled(FlexView)`\n position: absolute;\n right: 42px;\n top: 24px;\n`;\n"],"names":["CardKebabMenuWrapper","styled","FlexView","theme","SubHeaderText","Text","CardMenuOptionsWrapper","$shouldopenonright","$visible","CardContainer","CardWrapper","$bgImage","IconWrapper","BannerImageWrapper","BannerImage","gutter","StyledMinus2Icon","Minus2Icon","HeaderText","$disabled","MenuWrapper","BlurContainer","BlurFlexView"],"mappings":";;;;AAcO,MAAMA,IAAuBC,EAAOC,CAAQ,EAAE,CAAC,EAAE,OAAAC,QAC/C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAQWA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGvC,GAEYC,IAAgBH,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQ3BC,IAAyBL,EAAOC,CAAQ,EAAgC,CAAC;AAAA,EACpF,oBAAAK;AAAA,EACA,UAAAC;AACF,MACS;AAAA;AAAA;AAAA;AAAA;AAAA,aAKID,IAAqB,IAAI,MAAM;AAAA;AAAA,wBAEpBC,IAAW,IAAI,CAAC;AAAA,eACzBA,IAAW,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA,GAK9B,GAEYC,IAAgBR,EAAOC,CAAQ;AAAA,sBACtB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,UAAU;AAAA;AAAA,
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../src/features/homework/styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport Minus2Icon from '../../assets/line-icons/icons/minus2';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\ninterface ICardWrapperProps {\n $bgImage: string;\n}\ninterface ICardOptionsMenuWrapperProps {\n $visible: boolean;\n $shouldopenonright: boolean;\n}\n\nexport const CardKebabMenuWrapper = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n width: 24px;\n height: 24px;\n \n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport const SubHeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const CardMenuOptionsWrapper = styled(FlexView)<ICardOptionsMenuWrapperProps>(({\n $shouldopenonright,\n $visible,\n}) => {\n return `\n cursor: pointer;\n position: absolute;\n z-index: 6;\n top: calc(100% + 4px);\n right: ${$shouldopenonright ? 0 : 'auto'};\n transform-origin: top;\n transform: scaleY(${$visible ? 1 : 0});\n opacity: ${$visible ? 1 : 0};\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.4);\n z-index: 10;\n `;\n});\n\nexport const CardContainer = styled(FlexView)`\n border: 1px solid ${({ theme }) => theme.colors.BLACK_T_15};\n border-top-width: 2px;\n &:hover {\n border: 1px solid ${({ theme }) => theme.colors.BLACK};\n border-top-width: 2px;\n }\n`;\n\nexport const CardWrapper = styled(FlexView)<ICardWrapperProps>(({ $bgImage }) => {\n if ($bgImage) {\n return `\n background-image: url(${$bgImage});\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n overflow: hidden;\n `;\n }\n\n return 'overflow: hidden;';\n});\n\nexport const IconWrapper = styled(FlexView)`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const BannerImageWrapper = styled(FlexView)`\n position: absolute;\n right: -18px;\n top: -4px;\n`;\n\nexport const BannerImage = styled.img(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n border: 1px solid ${theme.colors.BLACK_T_15};\n width: ${gutter * 4}px;\n height: ${gutter * 4}px;\n border-radius: 50%;\n `;\n});\n\nexport const StyledMinus2Icon = styled(Minus2Icon)`\n path {\n stroke: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const HeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: break-spaces;\n`;\n\ninterface ICardOptionWrapperProps {\n $disabled?: boolean;\n}\ninterface ICardOptionsProps {\n $top: number;\n $left: number;\n}\n\nexport const CardOptions = styled(FlexView)<ICardOptionsProps>``;\n\nexport const CardOptionWrapper = styled(FlexView)<ICardOptionWrapperProps>(({\n theme,\n $disabled,\n}) => {\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n \n &:hover {\n background: ${$disabled ? 'transparent' : theme.colors.BLACK};\n };\n \n path {\n fill: ${theme.colors.WHITE_1};\n }\n `;\n});\n\nexport const OptionText = styled(Text)`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const MenuWrapper = styled(FlexView)`\n position: absolute;\n z-index: 6;\n top: calc(100% - 36px);\n right: 12px;\n transform-origin: top;\n transform: scaleY(1);\n`;\n\nexport const BlurContainer = styled(FlexView)`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.5;\n`;\n\nexport const BlurFlexView = styled(FlexView)`\n position: absolute;\n right: 42px;\n top: 24px;\n`;\n"],"names":["CardKebabMenuWrapper","styled","FlexView","theme","SubHeaderText","Text","CardMenuOptionsWrapper","$shouldopenonright","$visible","CardContainer","CardWrapper","$bgImage","IconWrapper","BannerImageWrapper","BannerImage","gutter","StyledMinus2Icon","Minus2Icon","HeaderText","$disabled","MenuWrapper","BlurContainer","BlurFlexView"],"mappings":";;;;AAcO,MAAMA,IAAuBC,EAAOC,CAAQ,EAAE,CAAC,EAAE,OAAAC,QAC/C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAQWA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGvC,GAEYC,IAAgBH,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQ3BC,IAAyBL,EAAOC,CAAQ,EAAgC,CAAC;AAAA,EACpF,oBAAAK;AAAA,EACA,UAAAC;AACF,MACS;AAAA;AAAA;AAAA;AAAA;AAAA,aAKID,IAAqB,IAAI,MAAM;AAAA;AAAA,wBAEpBC,IAAW,IAAI,CAAC;AAAA,eACzBA,IAAW,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA,GAK9B,GAEYC,IAAgBR,EAAOC,CAAQ;AAAA,sBACtB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA,wBAGpC,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA,GAK5CO,IAAcT,EAAOC,CAAQ,EAAqB,CAAC,EAAE,UAAAS,QAC5DA,IACK;AAAA,8BACmBA,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,QAQ7B,mBACR,GAEYC,IAAcX,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,GAM7BW,IAAqBZ,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,GAMpCY,IAAcb,EAAO,IAAI,CAAC,EAAE,OAAAE,QAAY;AAC7C,QAAA,EAAE,QAAAY,EAAO,IAAIZ,EAAM;AAElB,SAAA;AAAA,wBACeA,EAAM,OAAO,UAAU;AAAA,aAClCY,IAAS,CAAC;AAAA,cACTA,IAAS,CAAC;AAAA;AAAA;AAGxB,CAAC,GAEYC,IAAmBf,EAAOgB,CAAU;AAAA;AAAA,cAEnC,CAAC,EAAE,OAAAd,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA,GAIlCe,IAAajB,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBVJ,EAAOC,CAAQ;AAETD,EAAOC,CAAQ,EAA2B,CAAC;AAAA,EAC1E,OAAAC;AAAA,EACA,WAAAgB;AACF,MACS;AAAA,cACKA,IAAY,gBAAgB,SAAS;AAAA;AAAA;AAAA,oBAG/BA,IAAY,gBAAgBhB,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA,cAIpDA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGjC;AAEyBF,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA;AAMxB,MAAAe,IAAcnB,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAS7BmB,IAAgBpB,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAS/BoB,IAAerB,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
2
|
-
import
|
3
|
-
import
|
2
|
+
import m from "../../../assets/line-icons/icons/check.js";
|
3
|
+
import h from "../text/text.js";
|
4
4
|
import { getTheme as p } from "../theme/get-theme.js";
|
5
5
|
import { MainWrapper as a, HorizontalLine as d, Wrapper as g, NumberWrapper as f, StyledText as s } from "./stepper-styled.js";
|
6
6
|
const { layout: u } = p(), { gutter: i } = u;
|
7
|
-
function
|
7
|
+
function j({ stepsInfo: n = [], currentStep: e = 2 }) {
|
8
8
|
const c = n.length && e >= 1 ? (e - 1) / n.length * 100 : 0;
|
9
9
|
return /* @__PURE__ */ o(a, { $flexDirection: "row", $width: "fit-content", $gutterX: 0.625, $gapX: 0.625, children: [
|
10
10
|
/* @__PURE__ */ t(d, { $percentageCompleted: c, $height: 1 }),
|
11
|
-
n.map(({ id: $, label:
|
11
|
+
n.map(({ id: $, label: l }, r) => /* @__PURE__ */ o(
|
12
12
|
g,
|
13
13
|
{
|
14
14
|
$flexDirection: "row",
|
@@ -25,10 +25,10 @@ function W({ stepsInfo: n = [], currentStep: e = 2 }) {
|
|
25
25
|
$justifyContent: "center",
|
26
26
|
$heightX: 1.25,
|
27
27
|
$widthX: 1.25,
|
28
|
-
children: r + 1 < e ? /* @__PURE__ */ t(
|
28
|
+
children: r + 1 < e ? /* @__PURE__ */ t(m, { height: i, width: i }) : /* @__PURE__ */ t(h, { $renderAs: "body3", $color: "WHITE", children: $ })
|
29
29
|
}
|
30
30
|
),
|
31
|
-
r + 1 === e && /* @__PURE__ */ t(s, { $renderAs: "body2", children:
|
31
|
+
r + 1 === e && /* @__PURE__ */ t(s, { $renderAs: "body2", children: l })
|
32
32
|
]
|
33
33
|
},
|
34
34
|
r
|
@@ -36,6 +36,6 @@ function W({ stepsInfo: n = [], currentStep: e = 2 }) {
|
|
36
36
|
] });
|
37
37
|
}
|
38
38
|
export {
|
39
|
-
|
39
|
+
j as default
|
40
40
|
};
|
41
41
|
//# sourceMappingURL=stepper.js.map
|
@@ -1,36 +1,33 @@
|
|
1
|
-
import {
|
2
|
-
import { useAwsSignedKey as
|
3
|
-
import
|
4
|
-
const
|
5
|
-
const { studentId: t, query: o
|
6
|
-
return
|
7
|
-
|
8
|
-
}, [s]),
|
9
|
-
|
10
|
-
}, [o, d, t, r]), k(
|
11
|
-
async ({ images: g, onSuccess: n, onError: p, fileKey: w, fileName: K }) => {
|
12
|
-
const a = c.current;
|
1
|
+
import { useEffect as g, useCallback as w } from "react";
|
2
|
+
import { useAwsSignedKey as S } from "../api/subjective-review.js";
|
3
|
+
import h from "../../../../node_modules/uuid/dist/esm-browser/v4.js";
|
4
|
+
const A = (c) => {
|
5
|
+
const { studentId: t, query: o } = c, { data: a, get: s } = S();
|
6
|
+
return g(() => {
|
7
|
+
s(t, o);
|
8
|
+
}, [o, s, t]), w(
|
9
|
+
async ({ images: d, onSuccess: i, onError: l, fileKey: u, fileName: m }) => {
|
13
10
|
if (!a) return;
|
14
|
-
const
|
11
|
+
const r = `https://${a.bucketName}.s3.amazonaws.com/`;
|
15
12
|
try {
|
16
|
-
const
|
17
|
-
const e = new FormData(),
|
18
|
-
if (e.append("key",
|
13
|
+
const n = d.map(async (f) => {
|
14
|
+
const e = new FormData(), p = `${u}${m ?? h()}`;
|
15
|
+
if (e.append("key", p), e.append("AWSAccessKeyId", a.awsKey), e.append("acl", "public-read"), e.append("success_action_redirect", ""), e.append("policy", a.policy), e.append("signature", a.signature), e.append("Content-Type", "image/jpeg"), e.append("file", f.file), !(await fetch(r, {
|
19
16
|
method: "POST",
|
20
17
|
body: e
|
21
18
|
})).ok)
|
22
19
|
throw new Error("Upload failed");
|
23
|
-
return `${
|
24
|
-
}),
|
25
|
-
|
20
|
+
return `${r}${p}`;
|
21
|
+
}), y = await Promise.all(n);
|
22
|
+
i(y);
|
26
23
|
} catch {
|
27
|
-
|
24
|
+
l();
|
28
25
|
}
|
29
26
|
},
|
30
|
-
[]
|
27
|
+
[a]
|
31
28
|
);
|
32
29
|
};
|
33
30
|
export {
|
34
|
-
|
31
|
+
A as default
|
35
32
|
};
|
36
33
|
//# sourceMappingURL=use-s3-helper.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-s3-helper.js","sources":["../../../../../src/features/worksheet/worksheet/hooks/use-s3-helper.ts"],"sourcesContent":["import type { IFile } from '../worksheet-question/subjective-review';\n\nimport { useCallback, useEffect
|
1
|
+
{"version":3,"file":"use-s3-helper.js","sources":["../../../../../src/features/worksheet/worksheet/hooks/use-s3-helper.ts"],"sourcesContent":["import type { IFile } from '../worksheet-question/subjective-review';\n\nimport { useCallback, useEffect } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { useAwsSignedKey } from '../api/subjective-review';\n\ninterface IUseS3helper {\n (params: {\n studentId: string;\n query: {\n type: string;\n };\n }): (props: IUploadImageProps) => void;\n}\n\ninterface IUploadImageProps {\n images: IFile[];\n onSuccess: (urls: string[]) => void;\n onError: () => void;\n fileKey: string;\n fileName?: string;\n}\n\nconst useS3ImageUploadHelper: IUseS3helper = props => {\n const { studentId, query } = props;\n const { data: awsSignedKey, get: getAwsSignedKey } = useAwsSignedKey();\n\n useEffect(() => {\n getAwsSignedKey(studentId, query);\n }, [query, getAwsSignedKey, studentId]);\n\n const uploadImagesToS3 = useCallback(\n async ({ images, onSuccess, onError, fileKey, fileName }: IUploadImageProps) => {\n if (!awsSignedKey) return;\n\n const url = `https://${awsSignedKey.bucketName}.s3.amazonaws.com/`;\n\n try {\n const uploadPromises = images.map(async (item: { file: string | Blob }) => {\n const formData = new FormData();\n const key = `${fileKey}${fileName ?? uuidv4()}`;\n\n formData.append('key', key);\n formData.append('AWSAccessKeyId', awsSignedKey.awsKey);\n formData.append('acl', 'public-read');\n formData.append('success_action_redirect', '');\n formData.append('policy', awsSignedKey.policy);\n formData.append('signature', awsSignedKey.signature);\n formData.append('Content-Type', 'image/jpeg');\n formData.append('file', item.file);\n\n const res = await fetch(url, {\n method: 'POST',\n body: formData,\n });\n\n if (!res.ok) {\n throw new Error('Upload failed');\n }\n\n return `${url}${key}`;\n });\n\n const uploadedUrls = await Promise.all(uploadPromises);\n\n onSuccess(uploadedUrls);\n } catch (error) {\n onError();\n }\n },\n [awsSignedKey],\n );\n\n return uploadImagesToS3;\n};\n\nexport default useS3ImageUploadHelper;\n"],"names":["useS3ImageUploadHelper","props","studentId","query","awsSignedKey","getAwsSignedKey","useAwsSignedKey","useEffect","useCallback","images","onSuccess","onError","fileKey","fileName","url","uploadPromises","item","formData","key","uuidv4","uploadedUrls"],"mappings":";;;AAwBA,MAAMA,IAAuC,CAASC,MAAA;AAC9C,QAAA,EAAE,WAAAC,GAAW,OAAAC,EAAU,IAAAF,GACvB,EAAE,MAAMG,GAAc,KAAKC,EAAA,IAAoBC;AAErD,SAAAC,EAAU,MAAM;AACd,IAAAF,EAAgBH,GAAWC,CAAK;AAAA,EAC/B,GAAA,CAACA,GAAOE,GAAiBH,CAAS,CAAC,GAEbM;AAAA,IACvB,OAAO,EAAE,QAAAC,GAAQ,WAAAC,GAAW,SAAAC,GAAS,SAAAC,GAAS,UAAAC,QAAkC;AAC9E,UAAI,CAACT,EAAc;AAEb,YAAAU,IAAM,WAAWV,EAAa,UAAU;AAE1C,UAAA;AACF,cAAMW,IAAiBN,EAAO,IAAI,OAAOO,MAAkC;AACnE,gBAAAC,IAAW,IAAI,YACfC,IAAM,GAAGN,CAAO,GAAGC,KAAYM,EAAQ,CAAA;AAgBzC,cAdKF,EAAA,OAAO,OAAOC,CAAG,GACjBD,EAAA,OAAO,kBAAkBb,EAAa,MAAM,GAC5Ca,EAAA,OAAO,OAAO,aAAa,GAC3BA,EAAA,OAAO,2BAA2B,EAAE,GACpCA,EAAA,OAAO,UAAUb,EAAa,MAAM,GACpCa,EAAA,OAAO,aAAab,EAAa,SAAS,GAC1Ca,EAAA,OAAO,gBAAgB,YAAY,GACnCA,EAAA,OAAO,QAAQD,EAAK,IAAI,GAO7B,EALQ,MAAM,MAAMF,GAAK;AAAA,YAC3B,QAAQ;AAAA,YACR,MAAMG;AAAA,UAAA,CACP,GAEQ;AACD,kBAAA,IAAI,MAAM,eAAe;AAG1B,iBAAA,GAAGH,CAAG,GAAGI,CAAG;AAAA,QAAA,CACpB,GAEKE,IAAe,MAAM,QAAQ,IAAIL,CAAc;AAErD,QAAAL,EAAUU,CAAY;AAAA,cACR;AACN,QAAAT;MACV;AAAA,IACF;AAAA,IACA,CAACP,CAAY;AAAA,EAAA;AAIjB;"}
|
package/dist/index.d.ts
CHANGED
@@ -295,14 +295,10 @@ export declare const CueCanvas: React.FC<ICueCanvas>;
|
|
295
295
|
|
296
296
|
export declare const CueCanvasController: React_2.FC<IToolbarProps>;
|
297
297
|
|
298
|
-
export declare const CueCanvasHomeworkController: NamedExoticComponent<IHomeWorkControllerProps>;
|
299
|
-
|
300
298
|
export declare const CueCanvasProvider: FC<PropsWithChildren<{
|
301
299
|
userType: TUserTypes;
|
302
300
|
}>>;
|
303
301
|
|
304
|
-
export declare const CueCanvasSideBar: NamedExoticComponent<ISidebar>;
|
305
|
-
|
306
302
|
export declare const CuemathLogo: React_2.FC<React_2.SVGProps<SVGSVGElement>>;
|
307
303
|
|
308
304
|
export declare const CueRocket: React.FC<React.SVGProps<SVGSVGElement>>;
|
@@ -803,11 +799,6 @@ declare interface ICalloutProps {
|
|
803
799
|
marginBottomX: number;
|
804
800
|
}
|
805
801
|
|
806
|
-
declare interface ICanvasUpdateConfig {
|
807
|
-
dimesion?: IViewport;
|
808
|
-
gridName?: TCueCanvasGridName;
|
809
|
-
}
|
810
|
-
|
811
802
|
declare interface ICascadeSelectValue {
|
812
803
|
variant: string;
|
813
804
|
detail: string;
|
@@ -1213,8 +1204,6 @@ declare interface ICueCanvas {
|
|
1213
1204
|
onUpdateHeight?: TUpdateHeight;
|
1214
1205
|
onPublish?: TPublish;
|
1215
1206
|
onSubscribe?: TSubscribe;
|
1216
|
-
canvasConfig?: ICanvasUpdateConfig | null;
|
1217
|
-
updateCanvasConfig?: TUpdateCanvasConfig;
|
1218
1207
|
}
|
1219
1208
|
|
1220
1209
|
declare interface ICueCanvasCallbackProps {
|
@@ -1489,30 +1478,6 @@ export declare interface IHomepageStartJourneyProps {
|
|
1489
1478
|
userType: TUserTypes;
|
1490
1479
|
}
|
1491
1480
|
|
1492
|
-
declare interface IHomeWorkControllerProps {
|
1493
|
-
width: number;
|
1494
|
-
hwRequests?: IHomeWorkHelpRequestModel[];
|
1495
|
-
onMarkAsResolved?: (homeworkId: string, onSuccess: () => void) => void;
|
1496
|
-
onSendImageToChat?: (homeworkId: string, snapshot: Blob[], onSuccess: () => void) => void;
|
1497
|
-
}
|
1498
|
-
|
1499
|
-
export declare interface IHomeWorkHelpRequestModel {
|
1500
|
-
channel_id: string;
|
1501
|
-
created_on_ts: number;
|
1502
|
-
homework_id: string;
|
1503
|
-
id: string;
|
1504
|
-
message_timestamp: string;
|
1505
|
-
problem_description: string;
|
1506
|
-
problem_image_urls: string[];
|
1507
|
-
state: string;
|
1508
|
-
student_id: string;
|
1509
|
-
teacher_id: string;
|
1510
|
-
}
|
1511
|
-
|
1512
|
-
declare interface IHomeWorkHelpRequestModelWithStudentName extends IHomeWorkHelpRequestModel {
|
1513
|
-
student_name: string;
|
1514
|
-
}
|
1515
|
-
|
1516
1481
|
declare interface IIconButtonProps extends Omit<IButtonProps, 'label' | 'shape' | 'widthX' | 'width' | 'iconPosition' | 'alignSelf' | 'analyticsLabel' | 'renderAs'>, Required<Pick<IClickableAnalyticsProps, 'analyticsLabel'>> {
|
1517
1482
|
Icon: React.FC<React.SVGProps<SVGSVGElement>>;
|
1518
1483
|
customBgColor?: TColorNames;
|
@@ -3006,11 +2971,6 @@ declare interface ISheetsListProps extends ISheetItemCallbackProps {
|
|
3006
2971
|
section?: TSheetsSection;
|
3007
2972
|
}
|
3008
2973
|
|
3009
|
-
declare interface ISidebar {
|
3010
|
-
grade?: string;
|
3011
|
-
hwRequests?: IHomeWorkHelpRequestModelWithStudentName[];
|
3012
|
-
}
|
3013
|
-
|
3014
2974
|
declare interface ISignupMethodsProps {
|
3015
2975
|
onEmailSignup: () => void;
|
3016
2976
|
onPhoneSignup: () => void;
|
@@ -3379,8 +3339,6 @@ declare interface ITile {
|
|
3379
3339
|
toPort?: string;
|
3380
3340
|
toTileId: string;
|
3381
3341
|
}[];
|
3382
|
-
html?: string;
|
3383
|
-
width?: number | string;
|
3384
3342
|
}
|
3385
3343
|
|
3386
3344
|
declare interface ITimeLeftTimelineProps {
|
@@ -5611,8 +5569,6 @@ export declare type TTrialSessionMessage = {
|
|
5611
5569
|
};
|
5612
5570
|
};
|
5613
5571
|
|
5614
|
-
declare type TUpdateCanvasConfig = (data: ICanvasUpdateConfig) => void;
|
5615
|
-
|
5616
5572
|
declare type TUpdateHeight = (height: number) => void;
|
5617
5573
|
|
5618
5574
|
declare type TUserAccount = {
|
@@ -5664,14 +5620,12 @@ export declare const UpIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
5664
5620
|
|
5665
5621
|
export declare const useAutoPlayPermission: () => IAutoPlayPermissionContextType;
|
5666
5622
|
|
5667
|
-
export declare const useCanvasSyncBroker: (channelId: string, logEvent: (type: string, payload?: Record<string, unknown>) => void, initialCanvasData?: Array<IChannelMessage
|
5668
|
-
publishStrokes: ((message:
|
5623
|
+
export declare const useCanvasSyncBroker: (channelId: string, logEvent: (type: string, payload?: Record<string, unknown>) => void, initialCanvasData?: Array<IChannelMessage>) => {
|
5624
|
+
publishStrokes: ((message: unknown) => boolean) | undefined;
|
5669
5625
|
channelStatus: ChannelStatus | undefined;
|
5670
5626
|
closeChannel: () => void;
|
5671
5627
|
initialStrokesData: Record<string, IActionData[]>;
|
5672
5628
|
registerCallback: (qrId: string, cb: (data: IActionData) => void) => void;
|
5673
|
-
setChannelMetadata: ((metadata: ICanvasUpdateConfig, merge?: boolean) => void) | undefined;
|
5674
|
-
channelMetadata: ICanvasUpdateConfig | null | undefined;
|
5675
5629
|
};
|
5676
5630
|
|
5677
5631
|
export declare const useChapterPageJourney: () => {
|