@cuemath/leap 3.0.22-aa15 → 3.0.22-aa16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,21 +1,21 @@
|
|
1
|
-
import { jsx as o, jsxs as
|
1
|
+
import { jsx as o, jsxs as R } from "react/jsx-runtime";
|
2
2
|
import { h as c } from "../../../../node_modules/humanize-plus/dist/humanize.js";
|
3
|
-
import { memo as
|
3
|
+
import { memo as q, useCallback as k } from "react";
|
4
4
|
import y from "../../../ui/buttons/clickable/clickable.js";
|
5
|
-
import
|
5
|
+
import $ from "../../../ui/layout/flex-view.js";
|
6
6
|
import d from "../../../ui/text/text.js";
|
7
|
-
import { useCueCanvasActions as
|
8
|
-
import { getDateInInputFormat as
|
9
|
-
import { HWImageContainer as
|
7
|
+
import { useCueCanvasActions as W } from "../../hooks/use-cue-canvas-actions.js";
|
8
|
+
import { getDateInInputFormat as _, getMonthNameforNumber as E } from "./helper.js";
|
9
|
+
import { HWImageContainer as T } from "./homework-styled.js";
|
10
10
|
import l from "../../../../node_modules/uuid/dist/esm-browser/v4.js";
|
11
|
-
const
|
11
|
+
const v = (u) => {
|
12
12
|
var a;
|
13
|
-
const { hwRequest:
|
14
|
-
problem_description:
|
13
|
+
const { hwRequest: p, onSelect: r, studentName: h } = u, {
|
14
|
+
problem_description: m,
|
15
15
|
problem_image_urls: e,
|
16
16
|
created_on_ts: f,
|
17
|
-
homework_id:
|
18
|
-
} =
|
17
|
+
homework_id: s
|
18
|
+
} = p, { setHomeworkId: n, activeInstance: t } = W(), g = k(() => {
|
19
19
|
const x = l();
|
20
20
|
if (e && e.length > 0) {
|
21
21
|
const i = {
|
@@ -24,7 +24,7 @@ const j = (u) => {
|
|
24
24
|
void 0,
|
25
25
|
{
|
26
26
|
name: "text",
|
27
|
-
html:
|
27
|
+
html: m,
|
28
28
|
x: 500,
|
29
29
|
y: 75,
|
30
30
|
rot: 0
|
@@ -33,12 +33,12 @@ const j = (u) => {
|
|
33
33
|
}
|
34
34
|
};
|
35
35
|
e.forEach((C) => {
|
36
|
-
const H = l()
|
36
|
+
const H = l();
|
37
37
|
i.data[H] = [
|
38
38
|
void 0,
|
39
39
|
{
|
40
40
|
name: "image",
|
41
|
-
href:
|
41
|
+
href: C + "?dummyProp=true",
|
42
42
|
x: 48,
|
43
43
|
y: 72,
|
44
44
|
rot: 0,
|
@@ -47,22 +47,22 @@ const j = (u) => {
|
|
47
47
|
];
|
48
48
|
}), t == null || t.replaceCanvas(i);
|
49
49
|
}
|
50
|
-
r(),
|
51
|
-
}, [t,
|
52
|
-
return /* @__PURE__ */ o(y, { label: "HW Request Item", onClick: g, children: /* @__PURE__ */
|
50
|
+
r(), n(s);
|
51
|
+
}, [t, m, s, e, r, n]), { date: I, month: w } = _(f), b = `${c.ordinal(I)} ${c.titleCase((a = E(w)) == null ? void 0 : a.toLowerCase())}`;
|
52
|
+
return /* @__PURE__ */ o(y, { label: "HW Request Item", onClick: g, children: /* @__PURE__ */ R($, { $alignItems: "center", $justifyContent: "center", $borderRadius: 8, $background: "WHITE", children: [
|
53
53
|
/* @__PURE__ */ o(
|
54
|
-
|
54
|
+
T,
|
55
55
|
{
|
56
|
-
src: e[0],
|
56
|
+
src: e[0] + "?dummyProp=true",
|
57
57
|
alt: "Homework Request",
|
58
58
|
crossOrigin: "anonymous"
|
59
59
|
}
|
60
60
|
),
|
61
|
-
/* @__PURE__ */ o(d, { $renderAs: "body3", color: "WHITE", children:
|
61
|
+
/* @__PURE__ */ o(d, { $renderAs: "body3", color: "WHITE", children: h }),
|
62
62
|
/* @__PURE__ */ o(d, { $renderAs: "body3", color: "WHITE", children: b })
|
63
63
|
] }) });
|
64
|
-
},
|
64
|
+
}, M = q(v);
|
65
65
|
export {
|
66
|
-
|
66
|
+
M as default
|
67
67
|
};
|
68
68
|
//# sourceMappingURL=homework-request.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"homework-request.js","sources":["../../../../../src/features/cue-canvas/sidebar/homework/homework-request.tsx"],"sourcesContent":["import type { IReplaceCanvas } from '../../types/cue-canvas';\nimport type { IHomeWorkRequestProps } from './homework-types';\n\nimport { ordinal, titleCase } from 'humanize-plus';\nimport { memo, useCallback } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { useCueCanvasActions } from '../../hooks/use-cue-canvas-actions';\nimport { getDateInInputFormat, getMonthNameforNumber } from './helper';\nimport * as Styled from './homework-styled';\n\nconst HomeWorkRequest: React.FC<IHomeWorkRequestProps> = props => {\n const { hwRequest, onSelect, studentName } = props;\n const {\n problem_description: hwRequestDesc,\n problem_image_urls: hwRequestImages,\n created_on_ts: createdOnTs,\n homework_id: hwRequestId,\n } = hwRequest;\n const { setHomeworkId, activeInstance } = useCueCanvasActions();\n\n const onSelectHwRequest = useCallback(() => {\n const textId = uuidv4();\n\n if (hwRequestImages && hwRequestImages.length > 0) {\n const actionData: IReplaceCanvas = {\n data: {\n [textId]: [\n undefined,\n {\n name: 'text',\n html: hwRequestDesc,\n x: 500,\n y: 75,\n rot: 0,\n },\n ],\n },\n };\n\n hwRequestImages.forEach(image => {\n const imgId = uuidv4();\n
|
1
|
+
{"version":3,"file":"homework-request.js","sources":["../../../../../src/features/cue-canvas/sidebar/homework/homework-request.tsx"],"sourcesContent":["import type { IReplaceCanvas } from '../../types/cue-canvas';\nimport type { IHomeWorkRequestProps } from './homework-types';\n\nimport { ordinal, titleCase } from 'humanize-plus';\nimport { memo, useCallback } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { useCueCanvasActions } from '../../hooks/use-cue-canvas-actions';\nimport { getDateInInputFormat, getMonthNameforNumber } from './helper';\nimport * as Styled from './homework-styled';\n\nconst HomeWorkRequest: React.FC<IHomeWorkRequestProps> = props => {\n const { hwRequest, onSelect, studentName } = props;\n const {\n problem_description: hwRequestDesc,\n problem_image_urls: hwRequestImages,\n created_on_ts: createdOnTs,\n homework_id: hwRequestId,\n } = hwRequest;\n const { setHomeworkId, activeInstance } = useCueCanvasActions();\n\n const onSelectHwRequest = useCallback(() => {\n const textId = uuidv4();\n\n if (hwRequestImages && hwRequestImages.length > 0) {\n const actionData: IReplaceCanvas = {\n data: {\n [textId]: [\n undefined,\n {\n name: 'text',\n html: hwRequestDesc,\n x: 500,\n y: 75,\n rot: 0,\n },\n ],\n },\n };\n\n hwRequestImages.forEach(image => {\n const imgId = uuidv4();\n\n actionData.data[imgId] = [\n undefined,\n {\n name: 'image',\n href: image + '?dummyProp=true',\n x: 48,\n y: 72,\n rot: 0,\n width: 400,\n },\n ];\n });\n\n activeInstance?.replaceCanvas(actionData);\n }\n // const url = new URL(window.location.href);\n // url.searchParams.set('homeworkId', hwRequestId);\n // console.log('url', url);\n // window.history.replaceState({}, '', url.toString());\n onSelect();\n setHomeworkId(hwRequestId);\n }, [activeInstance, hwRequestDesc, hwRequestId, hwRequestImages, onSelect, setHomeworkId]);\n\n const { date, month } = getDateInInputFormat(createdOnTs);\n\n const dateString = `${ordinal(date)} ${titleCase(getMonthNameforNumber(month)?.toLowerCase())}`;\n\n return (\n <Clickable label=\"HW Request Item\" onClick={onSelectHwRequest}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" $borderRadius={8} $background=\"WHITE\">\n <Styled.HWImageContainer\n src={hwRequestImages[0] + '?dummyProp=true'}\n alt=\"Homework Request\"\n crossOrigin=\"anonymous\"\n />\n <Text $renderAs=\"body3\" color=\"WHITE\">\n {studentName}\n </Text>\n <Text $renderAs=\"body3\" color=\"WHITE\">\n {dateString}\n </Text>\n </FlexView>\n </Clickable>\n );\n};\n\nexport default memo(HomeWorkRequest);\n"],"names":["HomeWorkRequest","props","hwRequest","onSelect","studentName","hwRequestDesc","hwRequestImages","createdOnTs","hwRequestId","setHomeworkId","activeInstance","useCueCanvasActions","onSelectHwRequest","useCallback","textId","uuidv4","actionData","image","imgId","date","month","getDateInInputFormat","dateString","ordinal","titleCase","_a","getMonthNameforNumber","jsx","Clickable","jsxs","FlexView","Styled.HWImageContainer","Text","HWRequest","memo"],"mappings":";;;;;;;;;;AAcA,MAAMA,IAAmD,CAASC,MAAA;;AAChE,QAAM,EAAE,WAAAC,GAAW,UAAAC,GAAU,aAAAC,EAAA,IAAgBH,GACvC;AAAA,IACJ,qBAAqBI;AAAA,IACrB,oBAAoBC;AAAA,IACpB,eAAeC;AAAA,IACf,aAAaC;AAAA,EACX,IAAAN,GACE,EAAE,eAAAO,GAAe,gBAAAC,EAAe,IAAIC,EAAoB,GAExDC,IAAoBC,EAAY,MAAM;AAC1C,UAAMC,IAASC;AAEX,QAAAT,KAAmBA,EAAgB,SAAS,GAAG;AACjD,YAAMU,IAA6B;AAAA,QACjC,MAAM;AAAA,UACJ,CAACF,CAAM,GAAG;AAAA,YACR;AAAA,YACA;AAAA,cACE,MAAM;AAAA,cACN,MAAMT;AAAA,cACN,GAAG;AAAA,cACH,GAAG;AAAA,cACH,KAAK;AAAA,YACP;AAAA,UACF;AAAA,QACF;AAAA,MAAA;AAGF,MAAAC,EAAgB,QAAQ,CAASW,MAAA;AAC/B,cAAMC,IAAQH;AAEH,QAAAC,EAAA,KAAKE,CAAK,IAAI;AAAA,UACvB;AAAA,UACA;AAAA,YACE,MAAM;AAAA,YACN,MAAMD,IAAQ;AAAA,YACd,GAAG;AAAA,YACH,GAAG;AAAA,YACH,KAAK;AAAA,YACL,OAAO;AAAA,UACT;AAAA,QAAA;AAAA,MACF,CACD,GAEDP,KAAA,QAAAA,EAAgB,cAAcM;AAAA,IAChC;AAKS,IAAAb,KACTM,EAAcD,CAAW;AAAA,EAAA,GACxB,CAACE,GAAgBL,GAAeG,GAAaF,GAAiBH,GAAUM,CAAa,CAAC,GAEnF,EAAE,MAAAU,GAAM,OAAAC,EAAM,IAAIC,EAAqBd,CAAW,GAElDe,IAAa,GAAGC,UAAQJ,CAAI,CAAC,IAAIK,aAAUC,IAAAC,EAAsBN,CAAK,MAA3B,gBAAAK,EAA8B,aAAa,CAAC;AAE7F,SACG,gBAAAE,EAAAC,GAAA,EAAU,OAAM,mBAAkB,SAAShB,GAC1C,UAAA,gBAAAiB,EAACC,GAAS,EAAA,aAAY,UAAS,iBAAgB,UAAS,eAAe,GAAG,aAAY,SACpF,UAAA;AAAA,IAAA,gBAAAH;AAAA,MAACI;AAAAA,MAAA;AAAA,QACC,KAAKzB,EAAgB,CAAC,IAAI;AAAA,QAC1B,KAAI;AAAA,QACJ,aAAY;AAAA,MAAA;AAAA,IACd;AAAA,sBACC0B,GAAK,EAAA,WAAU,SAAQ,OAAM,SAC3B,UACH5B,GAAA;AAAA,sBACC4B,GAAK,EAAA,WAAU,SAAQ,OAAM,SAC3B,UACHV,GAAA;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ,GAEeW,IAAAC,EAAKlC,CAAe;"}
|