@learnpack/learnpack 5.0.315 → 5.0.317
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/lib/commands/serve.js +77 -26
- package/lib/creatorDist/assets/{index-D4SYZg0r.css → index-CjddKHB_.css} +12 -0
- package/lib/creatorDist/assets/{index-BI7U47zy.js → index-DRIj_L1d.js} +38341 -34249
- package/lib/creatorDist/index.html +2 -2
- package/package.json +1 -1
- package/src/commands/serve.ts +3267 -3204
- package/src/creator/components.json +18 -0
- package/src/creator/package-lock.json +470 -1
- package/src/creator/package.json +3 -0
- package/src/creator/src/assets/svgs.tsx +0 -1
- package/src/creator/src/components/FileCard.tsx +15 -3
- package/src/creator/src/components/FileUploader.tsx +41 -23
- package/src/creator/src/components/LessonItem.tsx +80 -49
- package/src/creator/src/components/LinkUploader.tsx +55 -8
- package/src/creator/src/components/Source.tsx +15 -6
- package/src/creator/src/components/syllabus/ContentIndex.tsx +19 -7
- package/src/creator/src/components/syllabus/Sidebar.tsx +56 -48
- package/src/creator/src/components/syllabus/SyllabusEditor.tsx +1 -1
- package/src/creator/src/components/ui/tooltip.tsx +31 -0
- package/src/creator/src/lib/utils.ts +6 -0
- package/src/creator/src/locales/en.json +24 -1
- package/src/creator/src/locales/es.json +24 -1
- package/src/creator/src/main.tsx +11 -7
- package/src/creator/src/utils/rigo.ts +85 -85
- package/src/creator/tsconfig.app.json +6 -0
- package/src/creator/vite.config.ts +10 -4
- package/src/creatorDist/assets/{index-D4SYZg0r.css → index-CjddKHB_.css} +12 -0
- package/src/creatorDist/assets/{index-BI7U47zy.js → index-DRIj_L1d.js} +38341 -34249
- package/src/creatorDist/index.html +2 -2
- package/src/ui/_app/app.css +1 -1
- package/src/ui/_app/app.js +2112 -2112
- package/src/ui/app.tar.gz +0 -0
|
@@ -68,7 +68,19 @@
|
|
|
68
68
|
},
|
|
69
69
|
"youtube": {
|
|
70
70
|
"description": "Compartir un enlace de Youtube",
|
|
71
|
-
"placeholder": "Pega tu enlace aquí…"
|
|
71
|
+
"placeholder": "Pega tu enlace de YouTube aquí…",
|
|
72
|
+
"invalidUrl": "Por favor ingresa una URL válida de YouTube",
|
|
73
|
+
"notAvailable": "Transcripción no disponible para este video.",
|
|
74
|
+
"tooManyRequests": "Demasiadas solicitudes. Por favor intenta de nuevo más tarde.",
|
|
75
|
+
"serviceUnavailable": "Servicio temporalmente no disponible. Por favor intenta de nuevo más tarde.",
|
|
76
|
+
"fetchError": "Error al obtener la transcripción",
|
|
77
|
+
"enterUrl": "Por favor ingresa una URL",
|
|
78
|
+
"notAvailableReasons": {
|
|
79
|
+
"title": "Por favor verifica lo siguiente:",
|
|
80
|
+
"captions": "El video tiene activados los subtítulos/captions.",
|
|
81
|
+
"privacy": "El video es público y no tiene restricciones.",
|
|
82
|
+
"region": "El video no está bloqueado por región."
|
|
83
|
+
}
|
|
72
84
|
}
|
|
73
85
|
},
|
|
74
86
|
"loader": {
|
|
@@ -135,5 +147,16 @@
|
|
|
135
147
|
"turnstileModal": {
|
|
136
148
|
"title": "Necesitamos verificar que eres un humano, espera un momento...",
|
|
137
149
|
"error": "Error al verificar que eres un humano, por favor intenta de nuevo, si el problema persiste, usa un navegador diferente."
|
|
150
|
+
},
|
|
151
|
+
"tooltips": {
|
|
152
|
+
"lockLesson": "Bloquear lección",
|
|
153
|
+
"unlockLesson": "Desbloquear lección",
|
|
154
|
+
"editLesson": "Editar lección",
|
|
155
|
+
"deleteLesson": "Eliminar lección",
|
|
156
|
+
"cannotEditLocked": "No se puede editar lección bloqueada",
|
|
157
|
+
"cannotDeleteLocked": "No se puede eliminar lección bloqueada",
|
|
158
|
+
"addLessonHere": "Agregar lección aquí",
|
|
159
|
+
"attachFiles": "Adjuntar archivos",
|
|
160
|
+
"send": "Enviar"
|
|
138
161
|
}
|
|
139
162
|
}
|
package/src/creator/src/main.tsx
CHANGED
|
@@ -6,14 +6,18 @@ import App from "./App.tsx"
|
|
|
6
6
|
import SyllabusEditor from "./components/syllabus/SyllabusEditor.tsx"
|
|
7
7
|
import { Toaster } from "react-hot-toast"
|
|
8
8
|
import "./i18n"
|
|
9
|
+
import { TooltipProvider } from "@/components/ui/tooltip"
|
|
10
|
+
|
|
9
11
|
createRoot(document.getElementById("root")!).render(
|
|
10
12
|
<StrictMode>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
<TooltipProvider>
|
|
14
|
+
<Toaster />
|
|
15
|
+
<BrowserRouter>
|
|
16
|
+
<Routes>
|
|
17
|
+
<Route path="/creator" element={<App />} />
|
|
18
|
+
<Route path="/creator/syllabus" element={<SyllabusEditor />} />
|
|
19
|
+
</Routes>
|
|
20
|
+
</BrowserRouter>
|
|
21
|
+
</TooltipProvider>
|
|
18
22
|
</StrictMode>
|
|
19
23
|
)
|
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
import toast from "react-hot-toast";
|
|
2
|
-
import { RIGOBOT_HOST, DEV_MODE } from "./constants";
|
|
3
|
-
import axios, { AxiosError } from "axios";
|
|
4
|
-
import { randomUUID } from "./creatorUtils";
|
|
5
|
-
|
|
6
|
-
type TInteractiveCreationInputs = {
|
|
7
|
-
courseInfo: string;
|
|
8
|
-
prevInteractions: string;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const publicInteractiveCreation = async (
|
|
12
|
-
inputs: TInteractiveCreationInputs,
|
|
13
|
-
token: string,
|
|
14
|
-
purposeSlug: string,
|
|
15
|
-
publicRequest: boolean = true
|
|
16
|
-
): Promise<any | null> => {
|
|
17
|
-
try {
|
|
18
|
-
const randomUID = randomUUID(15);
|
|
19
|
-
const webhookUrl = `${
|
|
20
|
-
DEV_MODE
|
|
21
|
-
? "https://1gm40gnb-3000.use2.devtunnels.ms"
|
|
22
|
-
: window.location.origin
|
|
23
|
-
// : "https://1gm40gnb-3000.use2.devtunnels.ms"
|
|
24
|
-
}/notifications/${randomUID}`;
|
|
25
|
-
|
|
26
|
-
console.log("WEBHOOK URL to send to Rigo", webhookUrl);
|
|
27
|
-
|
|
28
|
-
const response = await axios.post(
|
|
29
|
-
`${RIGOBOT_HOST}/v1/prompting${
|
|
30
|
-
publicRequest ? "/public" : ""
|
|
31
|
-
}/completion/${DEV_MODE ? "39" : "390"}/`,
|
|
32
|
-
{
|
|
33
|
-
inputs: inputs,
|
|
34
|
-
include_purpose_objective: true,
|
|
35
|
-
purpose_slug: purposeSlug,
|
|
36
|
-
webhook_url: webhookUrl,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
headers: {
|
|
40
|
-
"Content-Type": "application/json",
|
|
41
|
-
Authorization: `Token ${token}`,
|
|
42
|
-
},
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
return { res: response.data, notificationId: randomUID };
|
|
47
|
-
} catch (error: unknown) {
|
|
48
|
-
const err = error as AxiosError;
|
|
49
|
-
console.log("error trying to create course", err);
|
|
50
|
-
|
|
51
|
-
if (err.response?.status === 403) {
|
|
52
|
-
toast.error("You've reached the limit. Please log in to continue.");
|
|
53
|
-
} else {
|
|
54
|
-
toast.error("Something went wrong while generating the course.");
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const isHuman = async (token: string) => {
|
|
62
|
-
try {
|
|
63
|
-
const body = {
|
|
64
|
-
access_token: token,
|
|
65
|
-
};
|
|
66
|
-
const response = await axios.post(
|
|
67
|
-
`${RIGOBOT_HOST}/v1/auth/verify/humanity`,
|
|
68
|
-
body,
|
|
69
|
-
{
|
|
70
|
-
headers: {
|
|
71
|
-
"Content-Type": "application/json",
|
|
72
|
-
},
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
return {
|
|
77
|
-
human: response.status === 200,
|
|
78
|
-
message: response.data.message,
|
|
79
|
-
token: response.data.public_access_token,
|
|
80
|
-
};
|
|
81
|
-
} catch (error) {
|
|
82
|
-
console.error(error);
|
|
83
|
-
return { human: false, message: error, token: null };
|
|
84
|
-
}
|
|
85
|
-
};
|
|
1
|
+
import toast from "react-hot-toast";
|
|
2
|
+
import { RIGOBOT_HOST, DEV_MODE } from "./constants";
|
|
3
|
+
import axios, { AxiosError } from "axios";
|
|
4
|
+
import { randomUUID } from "./creatorUtils";
|
|
5
|
+
|
|
6
|
+
type TInteractiveCreationInputs = {
|
|
7
|
+
courseInfo: string;
|
|
8
|
+
prevInteractions: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const publicInteractiveCreation = async (
|
|
12
|
+
inputs: TInteractiveCreationInputs,
|
|
13
|
+
token: string,
|
|
14
|
+
purposeSlug: string,
|
|
15
|
+
publicRequest: boolean = true
|
|
16
|
+
): Promise<any | null> => {
|
|
17
|
+
try {
|
|
18
|
+
const randomUID = randomUUID(15);
|
|
19
|
+
const webhookUrl = `${
|
|
20
|
+
DEV_MODE
|
|
21
|
+
? "https://1gm40gnb-3000.use2.devtunnels.ms"
|
|
22
|
+
: window.location.origin
|
|
23
|
+
// : "https://1gm40gnb-3000.use2.devtunnels.ms"
|
|
24
|
+
}/notifications/${randomUID}`;
|
|
25
|
+
|
|
26
|
+
console.log("WEBHOOK URL to send to Rigo", webhookUrl);
|
|
27
|
+
|
|
28
|
+
const response = await axios.post(
|
|
29
|
+
`${RIGOBOT_HOST}/v1/prompting${
|
|
30
|
+
publicRequest ? "/public" : ""
|
|
31
|
+
}/completion/${DEV_MODE ? "39" : "390"}/`,
|
|
32
|
+
{
|
|
33
|
+
inputs: inputs,
|
|
34
|
+
include_purpose_objective: true,
|
|
35
|
+
purpose_slug: purposeSlug,
|
|
36
|
+
webhook_url: webhookUrl,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
headers: {
|
|
40
|
+
"Content-Type": "application/json",
|
|
41
|
+
Authorization: `Token ${token}`,
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
return { res: response.data, notificationId: randomUID };
|
|
47
|
+
} catch (error: unknown) {
|
|
48
|
+
const err = error as AxiosError;
|
|
49
|
+
console.log("error trying to create course", err);
|
|
50
|
+
|
|
51
|
+
if (err.response?.status === 403) {
|
|
52
|
+
toast.error("You've reached the limit. Please log in to continue.");
|
|
53
|
+
} else {
|
|
54
|
+
toast.error("Something went wrong while generating the course.");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const isHuman = async (token: string) => {
|
|
62
|
+
try {
|
|
63
|
+
const body = {
|
|
64
|
+
access_token: token,
|
|
65
|
+
};
|
|
66
|
+
const response = await axios.post(
|
|
67
|
+
`${RIGOBOT_HOST}/v1/auth/verify/humanity`,
|
|
68
|
+
body,
|
|
69
|
+
{
|
|
70
|
+
headers: {
|
|
71
|
+
"Content-Type": "application/json",
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
human: response.status === 200,
|
|
78
|
+
message: response.data.message,
|
|
79
|
+
token: response.data.public_access_token,
|
|
80
|
+
};
|
|
81
|
+
} catch (error) {
|
|
82
|
+
console.error(error);
|
|
83
|
+
return { human: false, message: error, token: null };
|
|
84
|
+
}
|
|
85
|
+
};
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { defineConfig } from "vite"
|
|
2
|
-
import react from "@vitejs/plugin-react-swc"
|
|
3
|
-
import tailwindcss from "@tailwindcss/vite"
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import react from "@vitejs/plugin-react-swc";
|
|
3
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
4
|
+
import path from "path";
|
|
4
5
|
|
|
5
6
|
// https://vite.dev/config/
|
|
6
7
|
export default defineConfig({
|
|
7
8
|
plugins: [react(), tailwindcss()],
|
|
8
9
|
base: "/creator/",
|
|
10
|
+
resolve: {
|
|
11
|
+
alias: {
|
|
12
|
+
"@": path.resolve(__dirname, "./src"),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
9
15
|
build: {
|
|
10
16
|
outDir: "../creatorDist",
|
|
11
17
|
emptyOutDir: true,
|
|
12
18
|
},
|
|
13
|
-
})
|
|
19
|
+
});
|
|
@@ -538,6 +538,9 @@
|
|
|
538
538
|
.hidden {
|
|
539
539
|
display: none;
|
|
540
540
|
}
|
|
541
|
+
.inline-flex {
|
|
542
|
+
display: inline-flex;
|
|
543
|
+
}
|
|
541
544
|
.table {
|
|
542
545
|
display: table;
|
|
543
546
|
}
|
|
@@ -695,6 +698,9 @@
|
|
|
695
698
|
.resize {
|
|
696
699
|
resize: both;
|
|
697
700
|
}
|
|
701
|
+
.list-disc {
|
|
702
|
+
list-style-type: disc;
|
|
703
|
+
}
|
|
698
704
|
.flex-col {
|
|
699
705
|
flex-direction: column;
|
|
700
706
|
}
|
|
@@ -959,6 +965,9 @@
|
|
|
959
965
|
.py-1 {
|
|
960
966
|
padding-block: calc(var(--spacing) * 1);
|
|
961
967
|
}
|
|
968
|
+
.py-1\.5 {
|
|
969
|
+
padding-block: calc(var(--spacing) * 1.5);
|
|
970
|
+
}
|
|
962
971
|
.py-2 {
|
|
963
972
|
padding-block: calc(var(--spacing) * 2);
|
|
964
973
|
}
|
|
@@ -974,6 +983,9 @@
|
|
|
974
983
|
.pb-32 {
|
|
975
984
|
padding-bottom: calc(var(--spacing) * 32);
|
|
976
985
|
}
|
|
986
|
+
.pl-5 {
|
|
987
|
+
padding-left: calc(var(--spacing) * 5);
|
|
988
|
+
}
|
|
977
989
|
.text-center {
|
|
978
990
|
text-align: center;
|
|
979
991
|
}
|