@cuemath/leap 3.0.31 → 3.1.0-aa0
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/assets/line-icons/icons/puzzle-icon.js +51 -0
- package/dist/assets/line-icons/icons/puzzle-icon.js.map +1 -0
- package/dist/assets/line-icons/icons/share.js +48 -0
- package/dist/assets/line-icons/icons/share.js.map +1 -0
- package/dist/assets/line-icons/icons/tile.js +54 -0
- package/dist/assets/line-icons/icons/tile.js.map +1 -0
- package/dist/features/cue-canvas/bottombar/homework-controls.js +73 -0
- package/dist/features/cue-canvas/bottombar/homework-controls.js.map +1 -0
- package/dist/features/cue-canvas/cue-canvas-context.js +8 -5
- package/dist/features/cue-canvas/cue-canvas-context.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-core.js +68 -70
- package/dist/features/cue-canvas/cue-canvas-core.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-helpers.js +31 -25
- package/dist/features/cue-canvas/cue-canvas-helpers.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-provider.js +14 -12
- package/dist/features/cue-canvas/cue-canvas-provider.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas.js +86 -66
- package/dist/features/cue-canvas/cue-canvas.js.map +1 -1
- package/dist/features/cue-canvas/cue-cavas-styled.js +45 -42
- package/dist/features/cue-canvas/cue-cavas-styled.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js +61 -54
- 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 +18 -14
- package/dist/features/cue-canvas/hooks/use-cue-canvas-actions.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-upload-helper.js +23 -0
- package/dist/features/cue-canvas/hooks/use-upload-helper.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/homework/helper.js +20 -0
- package/dist/features/cue-canvas/sidebar/homework/helper.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/homework/homework-menu.js +33 -0
- package/dist/features/cue-canvas/sidebar/homework/homework-menu.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/homework/homework-request.js +68 -0
- package/dist/features/cue-canvas/sidebar/homework/homework-request.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/homework/homework-styled.js +25 -0
- package/dist/features/cue-canvas/sidebar/homework/homework-styled.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/homework/homework.js +39 -0
- package/dist/features/cue-canvas/sidebar/homework/homework.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/api/get-puzzles.js +13 -0
- package/dist/features/cue-canvas/sidebar/puzzles/api/get-puzzles.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/filter-selection-menu.js +60 -0
- package/dist/features/cue-canvas/sidebar/puzzles/filter-selection-menu.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/filters-section.js +44 -0
- package/dist/features/cue-canvas/sidebar/puzzles/filters-section.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/filters.js +107 -0
- package/dist/features/cue-canvas/sidebar/puzzles/filters.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/hooks/use-fetch-cue-canvas-activity.js +42 -0
- package/dist/features/cue-canvas/sidebar/puzzles/hooks/use-fetch-cue-canvas-activity.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/launch-puzzle.js +84 -0
- package/dist/features/cue-canvas/sidebar/puzzles/launch-puzzle.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu-header.js +36 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu-header.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu.js +133 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles-styled.js +96 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles-styled.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles.js +29 -0
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/puzzles/utils.js +120 -0
- package/dist/features/cue-canvas/sidebar/puzzles/utils.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/sidebar-styled.js +32 -0
- package/dist/features/cue-canvas/sidebar/sidebar-styled.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/sidebar.js +29 -0
- package/dist/features/cue-canvas/sidebar/sidebar.js.map +1 -0
- package/dist/features/cue-canvas/sidebar/tiles/tile.js +16 -0
- package/dist/features/cue-canvas/sidebar/tiles/tile.js.map +1 -0
- 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 +4 -5
- package/dist/features/homework/styles.js.map +1 -1
- package/dist/features/hooks/use-debounce.js +16 -0
- package/dist/features/hooks/use-debounce.js.map +1 -0
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js +36 -38
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js +22 -24
- package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js +22 -23
- package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/utils.js +47 -49
- package/dist/features/milestone/create/comps/chapters-selection-step/utils.js.map +1 -1
- package/dist/features/milestone/create/comps/class-details-step/class-details-step.js +87 -94
- package/dist/features/milestone/create/comps/class-details-step/class-details-step.js.map +1 -1
- package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js +12 -13
- package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js.map +1 -1
- package/dist/features/milestone/create/comps/test-type-step/test-type-step.js +21 -23
- package/dist/features/milestone/create/comps/test-type-step/test-type-step.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-helpers.js +162 -165
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/ui/stepper/stepper.js +7 -7
- package/dist/features/worksheet/worksheet/hooks/use-s3-helper.js +22 -19
- package/dist/features/worksheet/worksheet/hooks/use-s3-helper.js.map +1 -1
- package/dist/index.d.ts +48 -3
- package/dist/index.js +184 -180
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
2
|
-
const
|
2
|
+
const t = (e) => /* @__PURE__ */ o(
|
3
3
|
"svg",
|
4
4
|
{
|
5
5
|
width: "24",
|
@@ -7,7 +7,7 @@ const e = (t) => /* @__PURE__ */ o(
|
|
7
7
|
viewBox: "0 0 24 24",
|
8
8
|
fill: "none",
|
9
9
|
xmlns: "http://www.w3.org/2000/svg",
|
10
|
-
...
|
10
|
+
...e,
|
11
11
|
children: /* @__PURE__ */ o(
|
12
12
|
"path",
|
13
13
|
{
|
@@ -19,7 +19,7 @@ const e = (t) => /* @__PURE__ */ o(
|
|
19
19
|
}
|
20
20
|
)
|
21
21
|
}
|
22
|
-
), n =
|
22
|
+
), n = t;
|
23
23
|
export {
|
24
24
|
n as default
|
25
25
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"check.js","sources":["../../../../src/assets/line-icons/icons/check.tsx"],"sourcesContent":["const CheckIcon: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M18.6663 7L9.49967 16.1667L5.33301 12\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66882\"\n strokeLinecap=\"square\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport default CheckIcon;\n"],"names":["CheckIcon","props","jsx","
|
1
|
+
{"version":3,"file":"check.js","sources":["../../../../src/assets/line-icons/icons/check.tsx"],"sourcesContent":["const CheckIcon: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M18.6663 7L9.49967 16.1667L5.33301 12\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66882\"\n strokeLinecap=\"square\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport default CheckIcon;\n"],"names":["CheckIcon","props","jsx","CheckIcon$1"],"mappings":";AAAA,MAAMA,IAAqD,CACzDC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACL,GAAGD;AAAA,IAEJ,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,GAAE;AAAA,QACF,QAAO;AAAA,QACP,aAAY;AAAA,QACZ,eAAc;AAAA,QACd,gBAAe;AAAA,MAAA;AAAA,IACjB;AAAA,EAAA;AACF,GAGFC,IAAeH;"}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
2
|
+
const e = (c) => /* @__PURE__ */ l(
|
3
|
+
"svg",
|
4
|
+
{
|
5
|
+
width: "20",
|
6
|
+
height: "20",
|
7
|
+
viewBox: "0 0 20 20",
|
8
|
+
fill: "none",
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
10
|
+
...c,
|
11
|
+
children: [
|
12
|
+
/* @__PURE__ */ r(
|
13
|
+
"path",
|
14
|
+
{
|
15
|
+
d: "M4.84375 5.78632L4.84375 4.37218C4.84375 3.98865 5.15466 3.67773 5.53819 3.67773H7.11038",
|
16
|
+
stroke: "currentColor",
|
17
|
+
strokeWidth: "1.39167"
|
18
|
+
}
|
19
|
+
),
|
20
|
+
/* @__PURE__ */ r(
|
21
|
+
"path",
|
22
|
+
{
|
23
|
+
d: "M14.6472 16.5289L17.3453 4.68253C17.4304 4.30858 17.1963 3.93638 16.8224 3.85121L10.0307 2.30435C9.67373 2.22305 9.31497 2.43282 9.21075 2.78377L8.31911 5.78642",
|
24
|
+
stroke: "currentColor",
|
25
|
+
strokeWidth: "1.39167"
|
26
|
+
}
|
27
|
+
),
|
28
|
+
/* @__PURE__ */ r(
|
29
|
+
"rect",
|
30
|
+
{
|
31
|
+
x: "3.33325",
|
32
|
+
y: "7.59961",
|
33
|
+
width: "9.0665",
|
34
|
+
height: "9.0665",
|
35
|
+
rx: "0.694444",
|
36
|
+
fill: "#F6F6F6",
|
37
|
+
stroke: "currentColor",
|
38
|
+
strokeWidth: "1.39167"
|
39
|
+
}
|
40
|
+
),
|
41
|
+
/* @__PURE__ */ r("circle", { cx: "6.29508", cy: "10.563", r: "0.695833", fill: "black" }),
|
42
|
+
/* @__PURE__ */ r("circle", { cx: "6.29508", cy: "13.7359", r: "0.695833", fill: "black" }),
|
43
|
+
/* @__PURE__ */ r("circle", { cx: "9.4689", cy: "10.563", r: "0.695833", fill: "black" }),
|
44
|
+
/* @__PURE__ */ r("circle", { cx: "9.4689", cy: "13.7359", r: "0.695833", fill: "black" })
|
45
|
+
]
|
46
|
+
}
|
47
|
+
);
|
48
|
+
export {
|
49
|
+
e as default
|
50
|
+
};
|
51
|
+
//# sourceMappingURL=puzzle-icon.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"puzzle-icon.js","sources":["../../../../src/assets/line-icons/icons/puzzle-icon.tsx"],"sourcesContent":["const PuzzleIcon: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M4.84375 5.78632L4.84375 4.37218C4.84375 3.98865 5.15466 3.67773 5.53819 3.67773H7.11038\"\n stroke=\"currentColor\"\n strokeWidth=\"1.39167\"\n />\n <path\n d=\"M14.6472 16.5289L17.3453 4.68253C17.4304 4.30858 17.1963 3.93638 16.8224 3.85121L10.0307 2.30435C9.67373 2.22305 9.31497 2.43282 9.21075 2.78377L8.31911 5.78642\"\n stroke=\"currentColor\"\n strokeWidth=\"1.39167\"\n />\n <rect\n x=\"3.33325\"\n y=\"7.59961\"\n width=\"9.0665\"\n height=\"9.0665\"\n rx=\"0.694444\"\n fill=\"#F6F6F6\"\n stroke=\"currentColor\"\n strokeWidth=\"1.39167\"\n />\n <circle cx=\"6.29508\" cy=\"10.563\" r=\"0.695833\" fill=\"black\" />\n <circle cx=\"6.29508\" cy=\"13.7359\" r=\"0.695833\" fill=\"black\" />\n <circle cx=\"9.4689\" cy=\"10.563\" r=\"0.695833\" fill=\"black\" />\n <circle cx=\"9.4689\" cy=\"13.7359\" r=\"0.695833\" fill=\"black\" />\n </svg>\n);\n\nexport default PuzzleIcon;\n"],"names":["PuzzleIcon","props","jsxs","jsx"],"mappings":";AAAA,MAAMA,IAAsD,CAC1DC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACL,GAAGD;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,QAAA;AAAA,MACd;AAAA,MACA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,QAAA;AAAA,MACd;AAAA,MACA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,GAAE;AAAA,UACF,OAAM;AAAA,UACN,QAAO;AAAA,UACP,IAAG;AAAA,UACH,MAAK;AAAA,UACL,QAAO;AAAA,UACP,aAAY;AAAA,QAAA;AAAA,MACd;AAAA,MACA,gBAAAA,EAAC,YAAO,IAAG,WAAU,IAAG,UAAS,GAAE,YAAW,MAAK,QAAQ,CAAA;AAAA,MAC3D,gBAAAA,EAAC,YAAO,IAAG,WAAU,IAAG,WAAU,GAAE,YAAW,MAAK,QAAQ,CAAA;AAAA,MAC5D,gBAAAA,EAAC,YAAO,IAAG,UAAS,IAAG,UAAS,GAAE,YAAW,MAAK,QAAQ,CAAA;AAAA,MAC1D,gBAAAA,EAAC,YAAO,IAAG,UAAS,IAAG,WAAU,GAAE,YAAW,MAAK,QAAQ,CAAA;AAAA,IAAA;AAAA,EAAA;AAC7D;"}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
2
|
+
const s = (o) => /* @__PURE__ */ t(
|
3
|
+
"svg",
|
4
|
+
{
|
5
|
+
width: "21",
|
6
|
+
height: "20",
|
7
|
+
viewBox: "0 0 21 20",
|
8
|
+
fill: "none",
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
10
|
+
...o,
|
11
|
+
children: [
|
12
|
+
/* @__PURE__ */ e(
|
13
|
+
"path",
|
14
|
+
{
|
15
|
+
d: "M14.6667 10.6951V14.8618C14.6667 15.2301 14.5203 15.5834 14.2599 15.8439C13.9994 16.1043 13.6461 16.2507 13.2778 16.2507H5.63889C5.27053 16.2507 4.91726 16.1043 4.6568 15.8439C4.39633 15.5834 4.25 15.2301 4.25 14.8618V7.22287C4.25 6.85452 4.39633 6.50125 4.6568 6.24078C4.91726 5.98031 5.27053 5.83398 5.63889 5.83398H9.80556",
|
16
|
+
stroke: "#2B2B2B",
|
17
|
+
strokeWidth: "1.66667",
|
18
|
+
strokeLinecap: "square",
|
19
|
+
strokeLinejoin: "round"
|
20
|
+
}
|
21
|
+
),
|
22
|
+
/* @__PURE__ */ e(
|
23
|
+
"path",
|
24
|
+
{
|
25
|
+
d: "M12.5835 3.75H16.7502V7.91667",
|
26
|
+
stroke: "#2B2B2B",
|
27
|
+
strokeWidth: "1.66667",
|
28
|
+
strokeLinecap: "square",
|
29
|
+
strokeLinejoin: "round"
|
30
|
+
}
|
31
|
+
),
|
32
|
+
/* @__PURE__ */ e(
|
33
|
+
"path",
|
34
|
+
{
|
35
|
+
d: "M9.11133 11.3898L16.0558 4.44531",
|
36
|
+
stroke: "#2B2B2B",
|
37
|
+
strokeWidth: "1.66667",
|
38
|
+
strokeLinecap: "square",
|
39
|
+
strokeLinejoin: "round"
|
40
|
+
}
|
41
|
+
)
|
42
|
+
]
|
43
|
+
}
|
44
|
+
);
|
45
|
+
export {
|
46
|
+
s as default
|
47
|
+
};
|
48
|
+
//# sourceMappingURL=share.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"share.js","sources":["../../../../src/assets/line-icons/icons/share.tsx"],"sourcesContent":["const ShareIcon: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n width=\"21\"\n height=\"20\"\n viewBox=\"0 0 21 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M14.6667 10.6951V14.8618C14.6667 15.2301 14.5203 15.5834 14.2599 15.8439C13.9994 16.1043 13.6461 16.2507 13.2778 16.2507H5.63889C5.27053 16.2507 4.91726 16.1043 4.6568 15.8439C4.39633 15.5834 4.25 15.2301 4.25 14.8618V7.22287C4.25 6.85452 4.39633 6.50125 4.6568 6.24078C4.91726 5.98031 5.27053 5.83398 5.63889 5.83398H9.80556\"\n stroke=\"#2B2B2B\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"square\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M12.5835 3.75H16.7502V7.91667\"\n stroke=\"#2B2B2B\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"square\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M9.11133 11.3898L16.0558 4.44531\"\n stroke=\"#2B2B2B\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"square\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport default ShareIcon;\n"],"names":["ShareIcon","props","jsxs","jsx"],"mappings":";AAAA,MAAMA,IAAqD,CACzDC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACL,GAAGD;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,eAAc;AAAA,UACd,gBAAe;AAAA,QAAA;AAAA,MACjB;AAAA,MACA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,eAAc;AAAA,UACd,gBAAe;AAAA,QAAA;AAAA,MACjB;AAAA,MACA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,eAAc;AAAA,UACd,gBAAe;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EAAA;AACF;"}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
2
|
+
const o = (e) => /* @__PURE__ */ i(
|
3
|
+
"svg",
|
4
|
+
{
|
5
|
+
className: "tile-icon",
|
6
|
+
width: "32",
|
7
|
+
height: "32",
|
8
|
+
viewBox: "0 0 32 32",
|
9
|
+
fill: "none",
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
11
|
+
...e,
|
12
|
+
children: [
|
13
|
+
/* @__PURE__ */ t("rect", { x: "0.5", y: "0.5", width: "31", height: "31", rx: "15.5", fill: "white" }),
|
14
|
+
/* @__PURE__ */ t("rect", { x: "0.5", y: "0.5", width: "31", height: "31", rx: "15.5", stroke: "white" }),
|
15
|
+
/* @__PURE__ */ t(
|
16
|
+
"rect",
|
17
|
+
{
|
18
|
+
x: "8.5",
|
19
|
+
y: "16",
|
20
|
+
width: "5.83333",
|
21
|
+
height: "6.66667",
|
22
|
+
rx: "0.833333",
|
23
|
+
stroke: "#2B2B2B",
|
24
|
+
strokeWidth: "1.39167",
|
25
|
+
strokeLinejoin: "round"
|
26
|
+
}
|
27
|
+
),
|
28
|
+
/* @__PURE__ */ t(
|
29
|
+
"circle",
|
30
|
+
{
|
31
|
+
cx: "20.1667",
|
32
|
+
cy: "19.2542",
|
33
|
+
r: "3.33333",
|
34
|
+
stroke: "#2B2B2B",
|
35
|
+
strokeWidth: "1.39167",
|
36
|
+
strokeLinejoin: "round"
|
37
|
+
}
|
38
|
+
),
|
39
|
+
/* @__PURE__ */ t(
|
40
|
+
"path",
|
41
|
+
{
|
42
|
+
d: "M18.8222 13.6583H11.7094C10.9896 13.6583 10.6084 12.8073 11.0875 12.2702L14.644 8.28391C14.9753 7.91249 15.5563 7.9125 15.8876 8.28391L19.444 12.2702C19.9232 12.8073 19.542 13.6583 18.8222 13.6583Z",
|
43
|
+
stroke: "#2B2B2B",
|
44
|
+
strokeWidth: "1.39167",
|
45
|
+
strokeLinejoin: "round"
|
46
|
+
}
|
47
|
+
)
|
48
|
+
]
|
49
|
+
}
|
50
|
+
);
|
51
|
+
export {
|
52
|
+
o as default
|
53
|
+
};
|
54
|
+
//# sourceMappingURL=tile.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tile.js","sources":["../../../../src/assets/line-icons/icons/tile.tsx"],"sourcesContent":["const TileIcon: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n className=\"tile-icon\"\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <rect x=\"0.5\" y=\"0.5\" width=\"31\" height=\"31\" rx=\"15.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"0.5\" width=\"31\" height=\"31\" rx=\"15.5\" stroke=\"white\" />\n <rect\n x=\"8.5\"\n y=\"16\"\n width=\"5.83333\"\n height=\"6.66667\"\n rx=\"0.833333\"\n stroke=\"#2B2B2B\"\n strokeWidth=\"1.39167\"\n strokeLinejoin=\"round\"\n />\n <circle\n cx=\"20.1667\"\n cy=\"19.2542\"\n r=\"3.33333\"\n stroke=\"#2B2B2B\"\n strokeWidth=\"1.39167\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M18.8222 13.6583H11.7094C10.9896 13.6583 10.6084 12.8073 11.0875 12.2702L14.644 8.28391C14.9753 7.91249 15.5563 7.9125 15.8876 8.28391L19.444 12.2702C19.9232 12.8073 19.542 13.6583 18.8222 13.6583Z\"\n stroke=\"#2B2B2B\"\n strokeWidth=\"1.39167\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport default TileIcon;\n"],"names":["TileIcon","props","jsxs","jsx"],"mappings":";AAAA,MAAMA,IAAoD,CACxDC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACL,GAAGD;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAE,EAAC,QAAK,EAAA,GAAE,OAAM,GAAE,OAAM,OAAM,MAAK,QAAO,MAAK,IAAG,QAAO,MAAK,SAAQ;AAAA,MACnE,gBAAAA,EAAA,QAAA,EAAK,GAAE,OAAM,GAAE,OAAM,OAAM,MAAK,QAAO,MAAK,IAAG,QAAO,QAAO,SAAQ;AAAA,MACtE,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,GAAE;AAAA,UACF,OAAM;AAAA,UACN,QAAO;AAAA,UACP,IAAG;AAAA,UACH,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,gBAAe;AAAA,QAAA;AAAA,MACjB;AAAA,MACA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAG;AAAA,UACH,IAAG;AAAA,UACH,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,gBAAe;AAAA,QAAA;AAAA,MACjB;AAAA,MACA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,gBAAe;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EAAA;AACF;"}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import { jsx as n, jsxs as g } from "react/jsx-runtime";
|
2
|
+
import { memo as b, useState as w, useCallback as i } from "react";
|
3
|
+
import k from "../../../assets/line-icons/icons/check.js";
|
4
|
+
import y from "../../../assets/line-icons/icons/share.js";
|
5
|
+
import f from "../../ui/buttons/button/button.js";
|
6
|
+
import p from "../../ui/layout/flex-view.js";
|
7
|
+
import I from "../../ui/separator/separator.js";
|
8
|
+
import B from "../../ui/text/text.js";
|
9
|
+
import { dataURIToBlob as x } from "../cue-canvas-helpers.js";
|
10
|
+
import { useCueCanvasActions as A } from "../hooks/use-cue-canvas-actions.js";
|
11
|
+
const S = (h) => {
|
12
|
+
const { width: c, onSendImageToChat: t, onMarkAsResolved: s } = h, { homeworkId: o, activeInstance: r, setHomeworkId: l } = A(), [m, u] = w(!1), a = i(() => {
|
13
|
+
r == null || r.clearCanvas(), l(void 0), u(!1);
|
14
|
+
}, [r, l]), d = i(async () => {
|
15
|
+
if (!r) return;
|
16
|
+
const e = await (r == null ? void 0 : r.getCanvasAsImage());
|
17
|
+
return e ? [x(e)] : void 0;
|
18
|
+
}, [r]), $ = i(async () => {
|
19
|
+
const e = await d();
|
20
|
+
!o || !t || !e || t == null || t(o, e, a);
|
21
|
+
}, [d, o, t, a]), C = i(() => {
|
22
|
+
o && (u(!0), s == null || s(o, a));
|
23
|
+
}, [o, s, a]);
|
24
|
+
return o ? m ? /* @__PURE__ */ n(
|
25
|
+
p,
|
26
|
+
{
|
27
|
+
$gapX: 1,
|
28
|
+
$gutterX: 0.5,
|
29
|
+
$alignItems: "center",
|
30
|
+
$justifyContent: "center",
|
31
|
+
$width: c,
|
32
|
+
$background: "YELLOW_1",
|
33
|
+
children: /* @__PURE__ */ n(B, { $renderAs: "body3", $color: "BLACK", children: "Resolving...." })
|
34
|
+
}
|
35
|
+
) : /* @__PURE__ */ g(
|
36
|
+
p,
|
37
|
+
{
|
38
|
+
$flexDirection: "row",
|
39
|
+
$gapX: 1,
|
40
|
+
$gutterX: 0.5,
|
41
|
+
$alignItems: "center",
|
42
|
+
$justifyContent: "center",
|
43
|
+
$width: c,
|
44
|
+
$background: "YELLOW_1",
|
45
|
+
children: [
|
46
|
+
/* @__PURE__ */ n(
|
47
|
+
f,
|
48
|
+
{
|
49
|
+
label: "Mark as reolved",
|
50
|
+
onClick: C,
|
51
|
+
renderAs: "primary",
|
52
|
+
Icon: k,
|
53
|
+
busy: m
|
54
|
+
}
|
55
|
+
),
|
56
|
+
/* @__PURE__ */ n(I, { width: 16 }),
|
57
|
+
/* @__PURE__ */ n(
|
58
|
+
f,
|
59
|
+
{
|
60
|
+
label: "Send CueBoard image to chat",
|
61
|
+
onClick: $,
|
62
|
+
renderAs: "primary",
|
63
|
+
Icon: y
|
64
|
+
}
|
65
|
+
)
|
66
|
+
]
|
67
|
+
}
|
68
|
+
) : null;
|
69
|
+
}, _ = b(S);
|
70
|
+
export {
|
71
|
+
_ as default
|
72
|
+
};
|
73
|
+
//# sourceMappingURL=homework-controls.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"homework-controls.js","sources":["../../../../src/features/cue-canvas/bottombar/homework-controls.tsx"],"sourcesContent":["import type { IHomeWorkControllerProps } from './bottombar-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useState } from 'react';\n\nimport CheckIcon from '../../../assets/line-icons/icons/check';\nimport ShareIcon from '../../../assets/line-icons/icons/share';\nimport Button from '../../ui/buttons/button/button';\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport { dataURIToBlob } from '../cue-canvas-helpers';\nimport { useCueCanvasActions } from '../hooks/use-cue-canvas-actions';\n\nconst HomeworkController: FC<IHomeWorkControllerProps> = props => {\n const { width, onSendImageToChat, onMarkAsResolved } = props;\n const { homeworkId, activeInstance, setHomeworkId } = useCueCanvasActions();\n const [isBusy, setIsBusy] = useState(false);\n\n const onSuccess = useCallback(() => {\n activeInstance?.clearCanvas();\n setHomeworkId(undefined);\n setIsBusy(false);\n }, [activeInstance, setHomeworkId]);\n\n const getBoardSnapshot = useCallback(async () => {\n if (!activeInstance) return;\n\n const snapshot = await activeInstance?.getCanvasAsImage();\n\n if (!snapshot) {\n return;\n }\n\n const blobdata = dataURIToBlob(snapshot);\n\n return [blobdata];\n }, [activeInstance]);\n\n const handleSendImageToChat = useCallback(async () => {\n const snapshot = await getBoardSnapshot();\n\n if (!homeworkId || !onSendImageToChat || !snapshot) return;\n\n onSendImageToChat?.(homeworkId, snapshot, onSuccess);\n }, [getBoardSnapshot, homeworkId, onSendImageToChat, onSuccess]);\n\n const handleMarkAsResolved = useCallback(() => {\n if (!homeworkId) return;\n setIsBusy(true);\n onMarkAsResolved?.(homeworkId, onSuccess);\n }, [homeworkId, onMarkAsResolved, onSuccess]);\n\n if (!homeworkId) return null;\n\n if (isBusy) {\n return (\n <FlexView\n $gapX={1}\n $gutterX={0.5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $width={width}\n $background=\"YELLOW_1\"\n >\n <Text $renderAs=\"body3\" $color=\"BLACK\">\n Resolving....\n </Text>\n </FlexView>\n );\n }\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $gapX={1}\n $gutterX={0.5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $width={width}\n $background=\"YELLOW_1\"\n >\n <Button\n label=\"Mark as reolved\"\n onClick={handleMarkAsResolved}\n renderAs={'primary'}\n Icon={CheckIcon}\n busy={isBusy}\n />\n <Separator width={16} />\n <Button\n label=\"Send CueBoard image to chat\"\n onClick={handleSendImageToChat}\n renderAs={'primary'}\n Icon={ShareIcon}\n />\n </FlexView>\n );\n};\n\nexport default memo(HomeworkController);\n"],"names":["HomeworkController","props","width","onSendImageToChat","onMarkAsResolved","homeworkId","activeInstance","setHomeworkId","useCueCanvasActions","isBusy","setIsBusy","useState","onSuccess","useCallback","getBoardSnapshot","snapshot","dataURIToBlob","handleSendImageToChat","handleMarkAsResolved","jsx","FlexView","Text","jsxs","Button","CheckIcon","Separator","ShareIcon","homeworkControls","memo"],"mappings":";;;;;;;;;;AAcA,MAAMA,IAAmD,CAASC,MAAA;AAChE,QAAM,EAAE,OAAAC,GAAO,mBAAAC,GAAmB,kBAAAC,EAAA,IAAqBH,GACjD,EAAE,YAAAI,GAAY,gBAAAC,GAAgB,eAAAC,MAAkBC,EAAoB,GACpE,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GAEpCC,IAAYC,EAAY,MAAM;AAClC,IAAAP,KAAA,QAAAA,EAAgB,eAChBC,EAAc,MAAS,GACvBG,EAAU,EAAK;AAAA,EAAA,GACd,CAACJ,GAAgBC,CAAa,CAAC,GAE5BO,IAAmBD,EAAY,YAAY;AAC/C,QAAI,CAACP,EAAgB;AAEf,UAAAS,IAAW,OAAMT,KAAA,gBAAAA,EAAgB;AAEvC,WAAKS,IAME,CAFUC,EAAcD,CAAQ,CAEvB,IALd;AAAA,EAKc,GACf,CAACT,CAAc,CAAC,GAEbW,IAAwBJ,EAAY,YAAY;AAC9C,UAAAE,IAAW,MAAMD;AAEvB,IAAI,CAACT,KAAc,CAACF,KAAqB,CAACY,KAEtBZ,KAAA,QAAAA,EAAAE,GAAYU,GAAUH;AAAA,KACzC,CAACE,GAAkBT,GAAYF,GAAmBS,CAAS,CAAC,GAEzDM,IAAuBL,EAAY,MAAM;AAC7C,IAAKR,MACLK,EAAU,EAAI,GACdN,KAAA,QAAAA,EAAmBC,GAAYO;AAAA,EAC9B,GAAA,CAACP,GAAYD,GAAkBQ,CAAS,CAAC;AAExC,SAACP,IAEDI,IAEA,gBAAAU;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,MACP,UAAU;AAAA,MACV,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,QAAQlB;AAAA,MACR,aAAY;AAAA,MAEZ,4BAACmB,GAAK,EAAA,WAAU,SAAQ,QAAO,SAAQ,UAEvC,iBAAA;AAAA,IAAA;AAAA,EAAA,IAMJ,gBAAAC;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,gBAAe;AAAA,MACf,OAAO;AAAA,MACP,UAAU;AAAA,MACV,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,QAAQlB;AAAA,MACR,aAAY;AAAA,MAEZ,UAAA;AAAA,QAAA,gBAAAiB;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,OAAM;AAAA,YACN,SAASL;AAAA,YACT,UAAU;AAAA,YACV,MAAMM;AAAA,YACN,MAAMf;AAAA,UAAA;AAAA,QACR;AAAA,QACA,gBAAAU,EAACM,GAAU,EAAA,OAAO,GAAI,CAAA;AAAA,QACtB,gBAAAN;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,OAAM;AAAA,YACN,SAASN;AAAA,YACT,UAAU;AAAA,YACV,MAAMS;AAAA,UAAA;AAAA,QACR;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IA1CoB;AA6C1B,GAEeC,IAAAC,EAAK5B,CAAkB;"}
|
@@ -1,17 +1,20 @@
|
|
1
|
-
import { createContext as
|
2
|
-
import { CANVAS_COLORS as
|
3
|
-
const
|
1
|
+
import { createContext as o } from "react";
|
2
|
+
import { CANVAS_COLORS as e } from "./constants/constants.js";
|
3
|
+
const v = o({
|
4
4
|
activeInstance: void 0,
|
5
5
|
setActiveInstance: () => {
|
6
6
|
},
|
7
7
|
activeTool: "pen",
|
8
8
|
setActiveTool: () => {
|
9
9
|
},
|
10
|
-
activeColor: Object.keys(
|
10
|
+
activeColor: Object.keys(e)[0],
|
11
11
|
setActiveColor: () => {
|
12
|
+
},
|
13
|
+
homeworkId: void 0,
|
14
|
+
setHomeworkId: () => {
|
12
15
|
}
|
13
16
|
});
|
14
17
|
export {
|
15
|
-
|
18
|
+
v as default
|
16
19
|
};
|
17
20
|
//# sourceMappingURL=cue-canvas-context.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cue-canvas-context.js","sources":["../../../src/features/cue-canvas/cue-canvas-context.tsx"],"sourcesContent":["import type { TPolyContextValue } from './types/context';\nimport type { TCueCanvasColors } from './types/cue-canvas';\n\nimport { createContext } from 'react';\n\nimport { CANVAS_COLORS } from './constants/constants';\n\nconst PolyContext = createContext<TPolyContextValue>({\n activeInstance: undefined,\n setActiveInstance: () => undefined,\n activeTool: 'pen',\n setActiveTool: () => undefined,\n activeColor: Object.keys(CANVAS_COLORS)[0] as TCueCanvasColors,\n setActiveColor: () => undefined,\n});\n\nexport default PolyContext;\n"],"names":["PolyContext","createContext","CANVAS_COLORS"],"mappings":";;AAOA,MAAMA,IAAcC,EAAiC;AAAA,EACnD,gBAAgB;AAAA,EAChB,mBAAmB,MAAM;AAAA;AAAA,EACzB,YAAY;AAAA,EACZ,eAAe,MAAM;AAAA;AAAA,EACrB,aAAa,OAAO,KAAKC,CAAa,EAAE,CAAC;AAAA,EACzC,gBAAgB,MAAM;AAAA;
|
1
|
+
{"version":3,"file":"cue-canvas-context.js","sources":["../../../src/features/cue-canvas/cue-canvas-context.tsx"],"sourcesContent":["import type { TPolyContextValue } from './types/context';\nimport type { TCueCanvasColors } from './types/cue-canvas';\n\nimport { createContext } from 'react';\n\nimport { CANVAS_COLORS } from './constants/constants';\n\nconst PolyContext = createContext<TPolyContextValue>({\n activeInstance: undefined,\n setActiveInstance: () => undefined,\n activeTool: 'pen',\n setActiveTool: () => undefined,\n activeColor: Object.keys(CANVAS_COLORS)[0] as TCueCanvasColors,\n setActiveColor: () => undefined,\n homeworkId: undefined,\n setHomeworkId: () => undefined,\n});\n\nexport default PolyContext;\n"],"names":["PolyContext","createContext","CANVAS_COLORS"],"mappings":";;AAOA,MAAMA,IAAcC,EAAiC;AAAA,EACnD,gBAAgB;AAAA,EAChB,mBAAmB,MAAM;AAAA;AAAA,EACzB,YAAY;AAAA,EACZ,eAAe,MAAM;AAAA;AAAA,EACrB,aAAa,OAAO,KAAKC,CAAa,EAAE,CAAC;AAAA,EACzC,gBAAgB,MAAM;AAAA;AAAA,EACtB,YAAY;AAAA,EACZ,eAAe,MAAM;AAAA;AACvB,CAAC;"}
|
@@ -1,20 +1,21 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var s = (
|
1
|
+
var u = Object.defineProperty;
|
2
|
+
var g = (l, t, e) => t in l ? u(l, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[t] = e;
|
3
|
+
var s = (l, t, e) => g(l, typeof t != "symbol" ? t + "" : t, e);
|
4
4
|
import v from "../../node_modules/lodash.debounce/index.js";
|
5
|
-
import { removeTileButton as f, removeMask as
|
6
|
-
class
|
5
|
+
import { removeTileButton as f, removeMask as y, checkTextOrEquationTool as C, getReverseMap as m, getToolAndSubtool as T } from "./cue-canvas-helpers.js";
|
6
|
+
class k {
|
7
7
|
constructor({
|
8
8
|
onPublish: t,
|
9
9
|
onSubscribe: e,
|
10
10
|
onUpdateActiveTool: a,
|
11
|
-
onUpdateHeight:
|
11
|
+
onUpdateHeight: i,
|
12
12
|
uploadImageToS3: o,
|
13
|
-
height:
|
14
|
-
userId:
|
15
|
-
canvasId:
|
13
|
+
height: n,
|
14
|
+
userId: h,
|
15
|
+
canvasId: r,
|
16
16
|
userType: c,
|
17
|
-
renderAs: p
|
17
|
+
renderAs: p,
|
18
|
+
updateCanvasConfig: d
|
18
19
|
}) {
|
19
20
|
s(this, "polycanvas");
|
20
21
|
s(this, "publish");
|
@@ -28,22 +29,21 @@ class b {
|
|
28
29
|
s(this, "fileInput", null);
|
29
30
|
s(this, "debouncedViewportChange");
|
30
31
|
s(this, "uploadImageToS3");
|
31
|
-
s(this, "
|
32
|
+
s(this, "updateCanvasConfigChange");
|
33
|
+
s(this, "publishToChannel", (t) => {
|
32
34
|
this.publish && this.publish({
|
33
35
|
eventName: "cue_canvas_changed",
|
34
36
|
eventPayload: {
|
35
37
|
data: t,
|
36
38
|
height: this.height,
|
37
39
|
userId: this.userId,
|
38
|
-
responseId: this.canvasId
|
39
|
-
gridName: e,
|
40
|
-
dimension: a
|
40
|
+
responseId: this.canvasId
|
41
41
|
}
|
42
42
|
});
|
43
43
|
});
|
44
44
|
s(this, "onChange", (t) => {
|
45
45
|
const a = Object.fromEntries(t.entries());
|
46
|
-
|
46
|
+
C(a) && this.onUpdateActiveTool("move"), this.publishToChannel(a);
|
47
47
|
});
|
48
48
|
s(this, "undo", () => {
|
49
49
|
if (!this.polycanvas)
|
@@ -51,7 +51,7 @@ class b {
|
|
51
51
|
const t = this.polycanvas.undo();
|
52
52
|
if (!t)
|
53
53
|
return;
|
54
|
-
const e =
|
54
|
+
const e = m(t);
|
55
55
|
this.onChange(e);
|
56
56
|
});
|
57
57
|
s(this, "redo", () => {
|
@@ -73,6 +73,7 @@ class b {
|
|
73
73
|
const t = this.polycanvas.getViewport();
|
74
74
|
this.polycanvas.setViewport(t.x, t.y, t.zoom * 0.9);
|
75
75
|
});
|
76
|
+
s(this, "getCanvasAsImage", async () => this.polycanvas ? await this.polycanvas.image(3e3, 3e3, "png") : void 0);
|
76
77
|
s(this, "downloadCanvasAsImage", async () => {
|
77
78
|
if (!this.polycanvas) return;
|
78
79
|
const t = await this.polycanvas.image(3e3, 3e3, "png");
|
@@ -80,96 +81,93 @@ class b {
|
|
80
81
|
const e = document.createElement("a");
|
81
82
|
e.href = t, e.download = `canvas-drawing-${Date.now()}.png`, e.click();
|
82
83
|
});
|
83
|
-
s(this, "uploadFileToCanvas", async (t) => new Promise((e, a) => {
|
84
|
-
this.uploadImageToS3 ? e(this.uploadImageToS3(t)) : a(new Error("Upload function not provided"));
|
85
|
-
}));
|
86
84
|
s(this, "onViewPortChange", (t) => {
|
87
|
-
|
88
|
-
const e = t;
|
89
|
-
this.publishToChannel({}, void 0, e);
|
85
|
+
this.updateCanvasConfigChange && this.updateCanvasConfigChange({ dimesion: t });
|
90
86
|
});
|
91
87
|
s(this, "openFileUpload", () => {
|
92
|
-
this.fileInput || (this.fileInput = document.createElement("input"), this.fileInput.type = "file", this.fileInput.accept = "image/*", this.fileInput.style.display = "none", this.fileInput.onchange = this.
|
88
|
+
this.fileInput || (this.fileInput = document.createElement("input"), this.fileInput.type = "file", this.fileInput.accept = "image/*", this.fileInput.style.display = "none", this.fileInput.onchange = this.onSelectImage, document.body.appendChild(this.fileInput)), this.fileInput.click();
|
93
89
|
});
|
94
|
-
s(this, "addImageToCanvas",
|
95
|
-
|
96
|
-
const e =
|
97
|
-
if (!a || !this.polycanvas || !this.uploadImageToS3) return;
|
98
|
-
const n = await this.uploadImageToS3(a), o = this.polycanvas.getViewport(), i = {
|
90
|
+
s(this, "addImageToCanvas", (t) => {
|
91
|
+
if (!this.polycanvas) return;
|
92
|
+
const e = this.polycanvas.getViewport(), a = {
|
99
93
|
name: "image",
|
100
|
-
href:
|
101
|
-
x:
|
102
|
-
y:
|
103
|
-
|
104
|
-
|
94
|
+
href: t,
|
95
|
+
x: e.x + 24,
|
96
|
+
y: e.y + 24,
|
97
|
+
width: 500
|
98
|
+
}, i = this.polycanvas.add({
|
99
|
+
...a
|
105
100
|
});
|
106
101
|
this.publishToChannel({
|
107
|
-
[
|
108
|
-
})
|
102
|
+
[i]: [void 0, { ...a, status: "locked" }]
|
103
|
+
});
|
109
104
|
});
|
110
|
-
s(this, "
|
111
|
-
|
112
|
-
|
113
|
-
|
105
|
+
s(this, "onSelectImage", async (t) => {
|
106
|
+
var o;
|
107
|
+
const e = t.target, a = (o = e.files) == null ? void 0 : o[0];
|
108
|
+
if (!a || !this.polycanvas || !this.uploadImageToS3) return;
|
109
|
+
const i = await this.uploadImageToS3(a);
|
110
|
+
i !== "error" && (this.addImageToCanvas(i), e.value = "");
|
114
111
|
});
|
115
112
|
s(this, "updateCanvas", ({ data: t, userId: e }) => {
|
116
113
|
const a = this.userType === "TEACHER" || e === this.userId;
|
117
|
-
Object.entries(t).forEach(([
|
118
|
-
var
|
119
|
-
!o[0] && o[1] ? (
|
114
|
+
Object.entries(t).forEach(([i, o]) => {
|
115
|
+
var n, h, r;
|
116
|
+
!o[0] && o[1] ? ("name" in o[1] && o[1].name === "image" && (o[1].status = this.userType === "STUDENT" ? "locked" : void 0), (n = this.polycanvas) == null || n.add({ ...o[1], cannotEdit: !a }, i)) : o[0] && !o[1] ? (h = this.polycanvas) == null || h.delete(i) : o[0] && o[1] && ((r = this.polycanvas) == null || r.update(i, { ...o[1] }));
|
120
117
|
});
|
121
118
|
});
|
122
119
|
s(this, "toggleTiles", (t) => {
|
123
120
|
var e;
|
124
121
|
(e = this.polycanvas) == null || e.toggleSidebar(t);
|
125
122
|
});
|
123
|
+
s(this, "setViewPort", ({ x: t, y: e, zoom: a }) => {
|
124
|
+
this.polycanvas && this.polycanvas.setViewport(t, e, a);
|
125
|
+
});
|
126
126
|
s(this, "resetViewPort", () => {
|
127
127
|
this.polycanvas && this.polycanvas.resetViewport();
|
128
128
|
});
|
129
129
|
s(this, "changeGrid", (t) => {
|
130
130
|
this.polycanvas && (this.polycanvas.setOptions({
|
131
131
|
grid: t
|
132
|
-
}), this.
|
132
|
+
}), this.updateCanvasConfigChange && this.updateCanvasConfigChange({ gridName: t }));
|
133
133
|
});
|
134
134
|
s(this, "lockSelectedTiles", () => {
|
135
|
-
var a,
|
136
|
-
const { tiles: t } = ((a = this.polycanvas) == null ? void 0 : a.serialize()) || {}, e = ((
|
135
|
+
var a, i;
|
136
|
+
const { tiles: t } = ((a = this.polycanvas) == null ? void 0 : a.serialize()) || {}, e = ((i = this.polycanvas) == null ? void 0 : i.getSelection()) || [];
|
137
137
|
if (e.length > 0 && t) {
|
138
138
|
const o = {};
|
139
|
-
e.forEach((
|
140
|
-
var
|
141
|
-
if (!((
|
142
|
-
const
|
143
|
-
(c = this.polycanvas) == null || c.update(
|
139
|
+
e.forEach((n) => {
|
140
|
+
var r, c, p;
|
141
|
+
if (!((r = t[n]) != null && r.name)) return;
|
142
|
+
const h = { ...t[n], status: "locked" };
|
143
|
+
(c = this.polycanvas) == null || c.update(n, h), (p = t[n]) != null && p.name && (o[n] = [t[n], h]);
|
144
144
|
}), this.publishToChannel(o);
|
145
145
|
}
|
146
146
|
});
|
147
147
|
s(this, "unlockAllTiles", () => {
|
148
148
|
if (!this.polycanvas) return;
|
149
149
|
const { tiles: t } = this.polycanvas.serialize(), e = {};
|
150
|
-
t && Object.entries(t).length > 0 && (Object.entries(t).forEach(([a,
|
151
|
-
var
|
152
|
-
if (
|
153
|
-
const o = { ...
|
154
|
-
(
|
150
|
+
t && Object.entries(t).length > 0 && (Object.entries(t).forEach(([a, i]) => {
|
151
|
+
var n;
|
152
|
+
if (i.status !== "locked") return;
|
153
|
+
const o = { ...i, status: void 0 };
|
154
|
+
(n = this.polycanvas) == null || n.update(a, o), e[a] = [i, o];
|
155
155
|
}), this.publishToChannel(e));
|
156
156
|
});
|
157
157
|
s(this, "replaceCanvas", (t) => {
|
158
158
|
if (!this.polycanvas) return;
|
159
159
|
const { data: e, gridName: a } = t;
|
160
|
-
this.polycanvas.clear(), a && this.
|
161
|
-
|
162
|
-
}), Object.entries(e).forEach(([n, o]) => {
|
163
|
-
var i;
|
160
|
+
this.polycanvas.clear(), a && this.changeGrid(a), Object.entries(e).forEach(([i, o]) => {
|
161
|
+
var n;
|
164
162
|
if (!o[0] && o[1]) {
|
165
|
-
(
|
163
|
+
(n = this.polycanvas) == null || n.add({ ...o[1] }, i);
|
166
164
|
return;
|
167
165
|
}
|
168
|
-
}), this.publishToChannel(e
|
166
|
+
}), this.publishToChannel(e);
|
169
167
|
});
|
170
168
|
s(this, "setTool", (t) => {
|
171
169
|
if (this.polycanvas) {
|
172
|
-
const [e, a] =
|
170
|
+
const [e, a] = T(t);
|
173
171
|
switch (e) {
|
174
172
|
case "clearAll":
|
175
173
|
this.clearCanvas();
|
@@ -222,10 +220,10 @@ class b {
|
|
222
220
|
*/
|
223
221
|
s(this, "update", (t) => {
|
224
222
|
if (Array.isArray(t)) {
|
225
|
-
const e = t.map((i) => i.height).filter(Boolean), a = Math.max(...e)
|
226
|
-
this.
|
223
|
+
const e = t.map((i) => i.height).filter(Boolean), a = Math.max(...e);
|
224
|
+
a > this.height && this.updateHeight(a), t.forEach((i) => this.updateCanvas(i));
|
227
225
|
} else
|
228
|
-
|
226
|
+
t.height > this.height && this.updateHeight(t.height), this.updateCanvas(t);
|
229
227
|
});
|
230
228
|
s(this, "setColor", (t) => {
|
231
229
|
this.polycanvas && this.polycanvas.setColor(t);
|
@@ -237,9 +235,9 @@ class b {
|
|
237
235
|
s(this, "destroy", () => {
|
238
236
|
this.polycanvas && (this.polycanvas.off("change", this.onChange), this.polycanvas.destroy(), this.debouncedViewportChange.cancel(), this.renderAs === "whiteboard" && this.userType === "TEACHER" && this.polycanvas.off("viewport", this.debouncedViewportChange), this.polycanvas = void 0, this.fileInput && this.fileInput.parentNode && (this.fileInput.parentNode.removeChild(this.fileInput), this.fileInput = null));
|
239
237
|
});
|
240
|
-
this.onUpdateHeight =
|
238
|
+
this.onUpdateHeight = i, this.onUpdateActiveTool = a, this.height = n, this.uploadImageToS3 = o, this.userId = h, this.canvasId = r, this.publish = t, this.userType = c, this.renderAs = p, this.debouncedViewportChange = v(this.onViewPortChange, 300), this.updateCanvasConfigChange = d, e == null || e(this.canvasId, this.update);
|
241
239
|
}
|
242
|
-
async create({ canvasElementRef: t, canvasConfig: e, canvasSetting: a, initialData:
|
240
|
+
async create({ canvasElementRef: t, canvasConfig: e, canvasSetting: a, initialData: i }) {
|
243
241
|
if (!t.current)
|
244
242
|
throw new Error("PolyCanvas: Div Element Not found for canvas");
|
245
243
|
this.polycanvas = await window.Polypad.create(t.current, {
|
@@ -247,11 +245,11 @@ class b {
|
|
247
245
|
options: e
|
248
246
|
},
|
249
247
|
...a,
|
250
|
-
imageUpload: this.renderAs === "whiteboard" && this.userType === "TEACHER" ? this.
|
251
|
-
}), this.renderAs === "whiteboard" && this.userType === "TEACHER" && (this.polycanvas.toggleSidebar(!1), f(t), this.polycanvas.on("viewport", this.debouncedViewportChange)),
|
248
|
+
imageUpload: this.renderAs === "whiteboard" && this.userType === "TEACHER" && this.uploadImageToS3 ? this.uploadImageToS3 : void 0
|
249
|
+
}), this.renderAs === "whiteboard" && this.userType === "TEACHER" && (this.polycanvas.toggleSidebar(!1), this.polycanvas.bindKeyboardEvents({}), f(t), this.polycanvas.on("viewport", this.debouncedViewportChange)), y(t), this.polycanvas.on("change", this.onChange), i && this.update(i);
|
252
250
|
}
|
253
251
|
}
|
254
252
|
export {
|
255
|
-
|
253
|
+
k as CueCanvasCore
|
256
254
|
};
|
257
255
|
//# sourceMappingURL=cue-canvas-core.js.map
|