@learnpack/learnpack 5.0.196 → 5.0.202
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/README.md +13 -13
- package/lib/commands/serve.d.ts +5 -28
- package/lib/commands/serve.js +45 -20
- package/lib/creatorDist/assets/index-C_HbkVCg.js +38491 -0
- package/lib/creatorDist/index.html +1 -1
- package/lib/models/creator.d.ts +30 -0
- package/lib/models/creator.js +2 -0
- package/lib/utils/creatorUtilities.js +3 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/src/commands/serve.ts +59 -59
- package/src/creator/package-lock.json +97 -1
- package/src/creator/package.json +3 -0
- package/src/creator/src/App.tsx +91 -32
- package/src/creator/src/components/FileCard.tsx +2 -2
- package/src/creator/src/components/FileUploader.tsx +6 -5
- package/src/creator/src/components/LinkUploader.tsx +3 -1
- package/src/creator/src/components/Login.tsx +33 -27
- package/src/creator/src/components/PurposeSelector.tsx +32 -25
- package/src/creator/src/components/StepWizard.tsx +8 -4
- package/src/creator/src/components/Uploader.tsx +8 -5
- package/src/creator/src/components/syllabus/ContentIndex.tsx +17 -11
- package/src/creator/src/components/syllabus/Sidebar.tsx +7 -7
- package/src/creator/src/components/syllabus/SyllabusEditor.tsx +79 -76
- package/src/creator/src/i18n.ts +28 -0
- package/src/creator/src/locales/en.json +110 -0
- package/src/creator/src/locales/es.json +110 -0
- package/src/creator/src/main.tsx +1 -0
- package/src/creator/src/utils/creatorUtils.ts +7 -3
- package/src/creator/src/utils/lib.ts +17 -1
- package/src/creator/src/utils/store.ts +37 -10
- package/src/creatorDist/assets/index-C_HbkVCg.js +38491 -0
- package/src/creatorDist/index.html +1 -1
- package/src/models/creator.ts +32 -0
- package/src/ui/_app/app.css +1 -1
- package/src/ui/_app/app.js +55 -55
- package/src/ui/app.tar.gz +0 -0
- package/src/utils/creatorUtilities.ts +4 -4
- package/lib/creatorDist/assets/index-CXaPa6wN.js +0 -35382
- package/src/creatorDist/assets/index-CXaPa6wN.js +0 -35382
@@ -0,0 +1,110 @@
|
|
1
|
+
{
|
2
|
+
"contentIndexHeader": {
|
3
|
+
"firstMessage": "He creado una estructura detallada para tu curso: {{title}}",
|
4
|
+
"secondMessage": "He actualizado la estructura según tu feedback."
|
5
|
+
},
|
6
|
+
"stepWizard": {
|
7
|
+
"requiredFields": "Por favor, completa todos los campos requeridos.",
|
8
|
+
"subtitle": "Configurando tu tutorial",
|
9
|
+
"back": "Atrás",
|
10
|
+
"next": "Siguiente",
|
11
|
+
"finish": "Finalizar 🚀",
|
12
|
+
"description": "¿Qué quieres aprender?",
|
13
|
+
"descriptionPlaceholder": "Describe tu curso",
|
14
|
+
"duration": "¿Cuál es la duración estimada para este tutorial?",
|
15
|
+
"durationCard": {
|
16
|
+
"30": "Alrededor de 30 minutos",
|
17
|
+
"60": "Alrededor de 1 hora",
|
18
|
+
"120": "Alrededor de 2 horas"
|
19
|
+
},
|
20
|
+
"purpose": "¿Cómo te gustaría usar learnpack?",
|
21
|
+
"verifyHuman": "Por favor, verifica que eres un humano",
|
22
|
+
"humanSuccess": "¡Eres un humano! 👌🏻",
|
23
|
+
"hasContentIndex": "¿Hay algún material para empezar este curso?",
|
24
|
+
"hasContentIndexCard": {
|
25
|
+
"no": "❌ No, ayúdame a crear uno",
|
26
|
+
"yes": "✅ Sí"
|
27
|
+
},
|
28
|
+
"contentIndex": "¿Hay algún material para empezar este curso?",
|
29
|
+
"contentIndexHelpText": "Puede ser solo texto, pegar una URL o incluso subir un documento."
|
30
|
+
},
|
31
|
+
"purposeSelector": {
|
32
|
+
"learnpack-lesson-writer": {
|
33
|
+
"label": "Entender un nuevo tema",
|
34
|
+
"description": "Aprender sobre un nuevo concepto (ej. ISO 27001 o decaimiento exponencial)."
|
35
|
+
},
|
36
|
+
"homework-and-exam-preparation-aid": {
|
37
|
+
"label": "Practicar para un examen o tarea",
|
38
|
+
"description": "Resolver problemas matemáticos o preguntas de certificación."
|
39
|
+
},
|
40
|
+
"skill-building-facilitator": {
|
41
|
+
"label": "Construir habilidades reales",
|
42
|
+
"description": "Aplicar conceptos a proyectos, ciencia de datos o auditorías de seguridad."
|
43
|
+
},
|
44
|
+
"certification-preparation-specialist": {
|
45
|
+
"label": "Prepararse para una certificación",
|
46
|
+
"description": "Prepararse para exámenes como ISO 27001 Lead Auditor."
|
47
|
+
}
|
48
|
+
},
|
49
|
+
"uploader": {
|
50
|
+
"text": {
|
51
|
+
"description": "Escribir o pegar una tabla de contenido",
|
52
|
+
"placeholder": "Agrega tu texto aquí...",
|
53
|
+
"finish": "Finalizar"
|
54
|
+
},
|
55
|
+
"files": {
|
56
|
+
"description": "Subir archivos",
|
57
|
+
"descriptionLong": "Subir un archivo PDF o DOCX o arrastralo aquí",
|
58
|
+
"processing": "Procesando...",
|
59
|
+
"drop": "Arrastra el archivo aquí",
|
60
|
+
"finish": "🚀 Finalizar"
|
61
|
+
},
|
62
|
+
"youtube": {
|
63
|
+
"description": "Compartir un enlace de Youtube",
|
64
|
+
"placeholder": "Pega tu enlace aquí…"
|
65
|
+
}
|
66
|
+
},
|
67
|
+
"loader": {
|
68
|
+
"text": "Learnpack está configurando tu tutorial. Puede que tarde un momento..."
|
69
|
+
},
|
70
|
+
"sidebar": {
|
71
|
+
"chatWithMe": "Chatea conmigo para actualizar el contenido del curso"
|
72
|
+
},
|
73
|
+
"contentIndex": {
|
74
|
+
"subText": {
|
75
|
+
"first": "Incluye una mezcla de lectura, ejercicios de codificación y cuestionarios. Dále un vistazo y dímelo si coincide con tus expectativas o si hay algún cambio que te gustaría hacer.",
|
76
|
+
"second": "Basado en tu entrada, aquí está el nuevo plan de estudios, los cambios se resaltan en amarillo"
|
77
|
+
},
|
78
|
+
"revertChanges": "Revertir cambios",
|
79
|
+
"changesReverted": "Cambios revertidos!",
|
80
|
+
"readyToCreate": "Estoy listo. ¡Crea el curso por mí!",
|
81
|
+
"creatingCourseAs": "Creando el curso como {{name}}",
|
82
|
+
"loginAsSomeoneElse": "Iniciar sesión como alguien más"
|
83
|
+
},
|
84
|
+
"login": {
|
85
|
+
"creatingAccount": "Creando cuenta…",
|
86
|
+
"loggedInSuccessfully": "Inicio de sesión exitoso",
|
87
|
+
"invalidCredentials": "Credenciales inválidas",
|
88
|
+
"pleaseFillAllFields": "Por favor, completa todos los campos",
|
89
|
+
"loggingIn": "Iniciando sesión…",
|
90
|
+
"accountCreated": "Cuenta creada! Revisa tu correo.",
|
91
|
+
"registrationFailed": "Registro fallido. Intenta de nuevo.",
|
92
|
+
"createYourAccount": "Crear tu cuenta",
|
93
|
+
"firstName": "Nombre",
|
94
|
+
"lastName": "Apellido",
|
95
|
+
"alreadyHaveAnAccount": "¿Ya tienes una cuenta?",
|
96
|
+
"logInHere": "Iniciar sesión aquí",
|
97
|
+
"youNeedToHaveAnAccount": "Necesitas tener una cuenta en 4Geeks con un plan de creador para crear un tutorial.",
|
98
|
+
"loginWithGithub": "INICIAR SESIÓN CON GITHUB",
|
99
|
+
"loginWithGoogle": "INICIAR SESIÓN CON GOOGLE",
|
100
|
+
"or": "o",
|
101
|
+
"password": "Contraseña",
|
102
|
+
"logIn": "Iniciar sesión",
|
103
|
+
"skip": "Saltar",
|
104
|
+
"forgotPassword": "¿Olvidaste tu contraseña?",
|
105
|
+
"recoverItHere": "Recuperarla aquí",
|
106
|
+
"loginWithEmail": "Iniciar sesión con Email",
|
107
|
+
"youDontHaveAnAccount": "¿No tienes una cuenta?",
|
108
|
+
"registerHere": "Regístrate aquí."
|
109
|
+
}
|
110
|
+
}
|
package/src/creator/src/main.tsx
CHANGED
@@ -5,6 +5,7 @@ import "./index.css"
|
|
5
5
|
import App from "./App.tsx"
|
6
6
|
import SyllabusEditor from "./components/syllabus/SyllabusEditor.tsx"
|
7
7
|
import { Toaster } from "react-hot-toast"
|
8
|
+
import "./i18n"
|
8
9
|
createRoot(document.getElementById("root")!).render(
|
9
10
|
<StrictMode>
|
10
11
|
<Toaster />
|
@@ -3,11 +3,15 @@ import { generateImage, getFilenameFromUrl, uploadImageToBucket } from "./lib"
|
|
3
3
|
|
4
4
|
export const slugify = (text: string) => {
|
5
5
|
return text
|
6
|
+
.toString()
|
7
|
+
.normalize("NFD")
|
8
|
+
.replace(/[\u0300-\u036F]/g, "")
|
6
9
|
.toLowerCase()
|
7
|
-
.
|
8
|
-
.replace(
|
10
|
+
.trim()
|
11
|
+
.replace(/\s+/g, "-")
|
12
|
+
.replace(/[<>:"/\\|?*]/g, "")
|
13
|
+
.replace(/-+/g, "-")
|
9
14
|
}
|
10
|
-
|
11
15
|
export const randomUUID = () => {
|
12
16
|
return Math.random().toString(36).substring(2, 15)
|
13
17
|
}
|
@@ -102,7 +102,6 @@ export async function useConsumableCall(
|
|
102
102
|
const response = await axios.put(url, {}, { headers })
|
103
103
|
|
104
104
|
if (response.status >= 200 && response.status < 300) {
|
105
|
-
console.log(response.data)
|
106
105
|
console.log(`Successfully consumed ${consumableSlug}`)
|
107
106
|
return true
|
108
107
|
} else {
|
@@ -417,3 +416,20 @@ export async function registerUserWithFormData(
|
|
417
416
|
}
|
418
417
|
}
|
419
418
|
}
|
419
|
+
|
420
|
+
export const isValidRigoToken = async (rigobotToken: string) => {
|
421
|
+
const rigoUrl = `${RIGOBOT_HOST}/v1/auth/token/${rigobotToken}`
|
422
|
+
const rigoResp = await fetch(rigoUrl)
|
423
|
+
if (!rigoResp.ok) {
|
424
|
+
return false
|
425
|
+
}
|
426
|
+
|
427
|
+
return true
|
428
|
+
}
|
429
|
+
|
430
|
+
export const fixTitleLength = (title: string) => {
|
431
|
+
const MAX_LENGTH = 49
|
432
|
+
let fixed = title.slice(0, MAX_LENGTH)
|
433
|
+
fixed = fixed.replace(/^[^a-zA-Z0-9]+|[^a-zA-Z0-9]+$/g, "")
|
434
|
+
return fixed
|
435
|
+
}
|
@@ -8,11 +8,10 @@ import { TMessage } from "../components/Message"
|
|
8
8
|
export type FormState = {
|
9
9
|
description: string
|
10
10
|
duration: number
|
11
|
-
targetAudience: string
|
12
11
|
hasContentIndex: boolean
|
13
12
|
contentIndex: string
|
14
13
|
purpose: string
|
15
|
-
|
14
|
+
language?: string
|
16
15
|
isCompleted: boolean
|
17
16
|
variables: string[]
|
18
17
|
currentStep: string
|
@@ -30,17 +29,13 @@ type Auth = {
|
|
30
29
|
export type Syllabus = {
|
31
30
|
lessons: Lesson[]
|
32
31
|
courseInfo: FormState
|
33
|
-
messages: TMessage[]
|
32
|
+
// messages: TMessage[]
|
34
33
|
}
|
35
34
|
|
36
35
|
type Consumables = {
|
37
36
|
[key: string]: number
|
38
37
|
}
|
39
38
|
|
40
|
-
export type UploadedFile = {
|
41
|
-
name: string
|
42
|
-
text: string
|
43
|
-
}
|
44
39
|
type Store = {
|
45
40
|
auth: Auth
|
46
41
|
formState: FormState
|
@@ -52,11 +47,13 @@ type Store = {
|
|
52
47
|
setPlanToRedirect: (planToRedirect: string) => void
|
53
48
|
uploadedFiles: ParsedFile[]
|
54
49
|
setUploadedFiles: (uploadedFiles: ParsedFile[]) => void
|
55
|
-
|
50
|
+
messages: TMessage[]
|
51
|
+
setMessages: (messages: TMessage[]) => void
|
56
52
|
cleanHistory: () => void
|
57
53
|
history: Syllabus[]
|
58
54
|
undo: () => void
|
59
55
|
push: (syllabus: Syllabus) => void
|
56
|
+
cleanAll: () => void
|
60
57
|
// setSyllabus: (syllabus: Partial<Syllabus>) => void
|
61
58
|
consumables: Consumables
|
62
59
|
setConsumables: (consumables: Partial<Consumables>) => void
|
@@ -79,10 +76,11 @@ const useStore = create<Store>()(
|
|
79
76
|
formState: {
|
80
77
|
description: "",
|
81
78
|
duration: 0,
|
82
|
-
targetAudience: "",
|
83
79
|
hasContentIndex: false,
|
84
80
|
contentIndex: "",
|
85
81
|
purpose: "",
|
82
|
+
language: "en",
|
83
|
+
technologies: [],
|
86
84
|
// sources: [],
|
87
85
|
isCompleted: false,
|
88
86
|
currentStep: "description",
|
@@ -94,6 +92,8 @@ const useStore = create<Store>()(
|
|
94
92
|
"verifyHuman",
|
95
93
|
],
|
96
94
|
},
|
95
|
+
messages: [],
|
96
|
+
setMessages: (messages: TMessage[]) => set({ messages }),
|
97
97
|
setFormState: (formState: Partial<FormState>) =>
|
98
98
|
set((state) => ({ formState: { ...state.formState, ...formState } })),
|
99
99
|
resetFormState: () =>
|
@@ -102,7 +102,8 @@ const useStore = create<Store>()(
|
|
102
102
|
currentStep: "description",
|
103
103
|
description: "",
|
104
104
|
duration: 0,
|
105
|
-
|
105
|
+
language: "en",
|
106
|
+
technologies: [],
|
106
107
|
hasContentIndex: false,
|
107
108
|
contentIndex: "",
|
108
109
|
purpose: "",
|
@@ -139,6 +140,32 @@ const useStore = create<Store>()(
|
|
139
140
|
cleanHistory: () => {
|
140
141
|
set(() => ({ history: [] }))
|
141
142
|
},
|
143
|
+
cleanAll: () => {
|
144
|
+
set({
|
145
|
+
uploadedFiles: [],
|
146
|
+
messages: [],
|
147
|
+
history: [],
|
148
|
+
formState: {
|
149
|
+
description: "",
|
150
|
+
duration: 0,
|
151
|
+
|
152
|
+
language: "en",
|
153
|
+
technologies: [],
|
154
|
+
hasContentIndex: false,
|
155
|
+
contentIndex: "",
|
156
|
+
purpose: "",
|
157
|
+
isCompleted: false,
|
158
|
+
variables: [
|
159
|
+
"description",
|
160
|
+
"duration",
|
161
|
+
"purpose",
|
162
|
+
"hasContentIndex",
|
163
|
+
"verifyHuman",
|
164
|
+
],
|
165
|
+
currentStep: "description",
|
166
|
+
},
|
167
|
+
})
|
168
|
+
},
|
142
169
|
consumables: {},
|
143
170
|
setConsumables: (consumables: Partial<Consumables>) =>
|
144
171
|
set((state) => {
|