@learnpack/learnpack 5.0.108 → 5.0.112

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.
@@ -85,6 +85,7 @@ function App() {
85
85
  courseInfo: {
86
86
  ...formState,
87
87
  title: res.parsed.title,
88
+ description: res.parsed.description,
88
89
  },
89
90
  })
90
91
  navigate("/creator/syllabus")
@@ -193,8 +194,7 @@ function App() {
193
194
  ),
194
195
  },
195
196
  {
196
- title:
197
- "Any materials to get this course started?",
197
+ title: "Any materials to get this course started?",
198
198
  slug: "contentIndex",
199
199
  isCompleted: false,
200
200
  content: (
@@ -260,9 +260,6 @@ function App() {
260
260
  />
261
261
  ) : (
262
262
  <>
263
- {/* <div className="flex flex-col gap-4">
264
- <h1 className="text-2xl font-bold">{formState.sources?.length}</h1>
265
- </div> */}
266
263
  <StepWizard
267
264
  formState={formState}
268
265
  steps={buildSteps()}
@@ -1,5 +1,5 @@
1
- import { useState, useRef } from "react"
2
- import { SVGS } from "../assets/svgs"
1
+ // import { useState, useRef } from "react"
2
+ // import { SVGS } from "../assets/svgs"
3
3
 
4
4
  export interface Lesson {
5
5
  id: string
@@ -17,23 +17,23 @@ interface LessonItemProps {
17
17
  onRemove: () => void
18
18
  }
19
19
 
20
- function cleanFloatString(input: string): string {
21
- const num = parseFloat(input)
22
- const isInteger = Number.isInteger(num)
20
+ // function cleanFloatString(input: string): string {
21
+ // const num = parseFloat(input)
22
+ // const isInteger = Number.isInteger(num)
23
23
 
24
- return isInteger
25
- ? Math.floor(num).toString().padStart(2, "0")
26
- : num.toString()
27
- }
24
+ // return isInteger
25
+ // ? Math.floor(num).toString().padStart(2, "0")
26
+ // : num.toString()
27
+ // }
28
28
 
29
29
  export const LessonItem: React.FC<LessonItemProps> = ({
30
30
  lesson,
31
- onChange,
32
- onRemove,
31
+ // onChange,
32
+ // onRemove,
33
33
  isNew,
34
34
  }) => {
35
- const inputRef = useRef<HTMLInputElement>(null)
36
- const [isEditing, setIsEditing] = useState(false)
35
+ // const inputRef = useRef<HTMLInputElement>(null)
36
+ // const [isEditing, setIsEditing] = useState(false)
37
37
 
38
38
  return (
39
39
  <div
@@ -42,12 +42,12 @@ export const LessonItem: React.FC<LessonItemProps> = ({
42
42
  }`}
43
43
  >
44
44
  {isNew && <span className="red-ball"></span>}
45
- <span className="index-circle">{cleanFloatString(lesson.id)}</span>
46
- <span className="text-gray-500 text-sm">
45
+ {/* <span className="index-circle">{cleanFloatString(lesson.id)}</span> */}
46
+ {/* <span className="text-gray-500 text-sm">
47
47
  {lesson.type[0] + lesson.type.slice(1).toLowerCase()} ●
48
- </span>
48
+ </span> */}
49
49
 
50
- {isEditing ? (
50
+ {/* {isEditing ? (
51
51
  <input
52
52
  defaultValue={lesson.title}
53
53
  ref={inputRef}
@@ -61,13 +61,14 @@ export const LessonItem: React.FC<LessonItemProps> = ({
61
61
  />
62
62
  ) : (
63
63
  <span className="flex-1 text-sm text-gray-800">{lesson.title}</span>
64
- )}
64
+ )} */}
65
+ <span className="flex-1 text-sm text-gray-800">{lesson.title}</span>
65
66
 
66
67
  <span className="text-sm text-gray-600 bg-blue-100 px-2 py-1 rounded-full">
67
68
  {lesson.duration} min
68
69
  </span>
69
70
 
70
- <button
71
+ {/* <button
71
72
  onClick={() => {
72
73
  setIsEditing(!isEditing)
73
74
  if (inputRef.current) {
@@ -83,7 +84,7 @@ export const LessonItem: React.FC<LessonItemProps> = ({
83
84
  className="text-red-500 hover:text-red-700 cursor-pointer"
84
85
  >
85
86
  {SVGS.trash}
86
- </button>
87
+ </button> */}
87
88
  </div>
88
89
  )
89
90
  }
@@ -136,7 +136,7 @@ export default function Login({ onFinish }: { onFinish: () => void }) {
136
136
  <div className="bg-blue-50 text-sm p-2 rounded text-left">
137
137
  <p className="text-gray-700 m-0">You don't have an account?</p>
138
138
  <a
139
- href="https://4geeks.com/checkout?plan=4geeks-creator"
139
+ href="https://4geeks.com/checkout?plan=learnpack-creator"
140
140
  target="_blank"
141
141
  className="text-blue-600 font-medium"
142
142
  >
@@ -10,7 +10,7 @@ import { eventBus } from "../utils/eventBus"
10
10
  function proxify(link: string) {
11
11
  // Validar que el enlace no sea vacío
12
12
  if (!link) {
13
- throw new Error("El enlace es requerido")
13
+ return "https://placehold.co/100x100"
14
14
  }
15
15
 
16
16
  const encodedUrl = btoa(link)
@@ -34,10 +34,10 @@ const PreviewGenerator: React.FC = () => {
34
34
  html2canvas(previewElement, {
35
35
  useCORS: true,
36
36
  }).then(async (canvas) => {
37
- // const anchor = document.createElement("a")
38
- // anchor.href = canvas.toDataURL("image/png")
39
- // anchor.download = "preview.png"
40
- // anchor.click()
37
+ // const anchor = document.createElement("a")
38
+ // anchor.href = canvas.toDataURL("image/png")
39
+ // anchor.download = "preview.png"
40
+ // anchor.click()
41
41
 
42
42
  const imageUrl = canvas.toDataURL("image/png")
43
43
 
@@ -59,7 +59,7 @@ const PreviewGenerator: React.FC = () => {
59
59
  <div
60
60
  id="preview"
61
61
  style={{
62
- width: "1000px",
62
+ width: "1200px",
63
63
  height: "630px",
64
64
  background: "white",
65
65
  }}
@@ -5,7 +5,7 @@ import { SVGS } from "../../assets/svgs"
5
5
  import { TMessage } from "../Message"
6
6
  import Loader from "../Loader"
7
7
  import { motion, AnimatePresence } from "framer-motion"
8
- import { randomUUID } from "../../utils/creatorUtils"
8
+ // import { randomUUID } from "../../utils/creatorUtils"
9
9
  import toast from "react-hot-toast"
10
10
 
11
11
  const ContentIndexHeader = ({
@@ -127,22 +127,22 @@ export const ContentIndex = ({
127
127
  })
128
128
  }
129
129
 
130
- const addLessonAfter = (index: number, id: string) => {
131
- const newLesson: Lesson = {
132
- id: (parseFloat(id) + 0.1).toFixed(1),
133
- title: "Hello World",
134
- uid: randomUUID(),
135
- type: "READ",
136
- duration: 2,
137
- description: "Hello World",
138
- }
139
- const updated = [...syllabus.lessons]
140
- updated.splice(index + 1, 0, newLesson)
141
- push({
142
- ...syllabus,
143
- lessons: updated,
144
- })
145
- }
130
+ // const addLessonAfter = (index: number, id: string) => {
131
+ // const newLesson: Lesson = {
132
+ // id: (parseFloat(id) + 0.1).toFixed(1),
133
+ // title: "Hello World",
134
+ // uid: randomUUID(),
135
+ // type: "READ",
136
+ // duration: 2,
137
+ // description: "Hello World",
138
+ // }
139
+ // const updated = [...syllabus.lessons]
140
+ // updated.splice(index + 1, 0, newLesson)
141
+ // push({
142
+ // ...syllabus,
143
+ // lessons: updated,
144
+ // })
145
+ // }
146
146
 
147
147
  useEffect(() => {
148
148
  const container = containerRef.current
@@ -205,7 +205,7 @@ export const ContentIndex = ({
205
205
  )
206
206
  )}
207
207
  />
208
- <div className="relative h-6">
208
+ {/* <div className="relative h-6">
209
209
  <div className="absolute left-1/2 -translate-x-1/2 -top-3">
210
210
  <button
211
211
  onClick={() => addLessonAfter(index, lesson.id)}
@@ -214,7 +214,7 @@ export const ContentIndex = ({
214
214
  +
215
215
  </button>
216
216
  </div>
217
- </div>
217
+ </div> */}
218
218
  </div>
219
219
  ))}
220
220
  {syllabus.lessons.length > 0 && (
@@ -199,12 +199,12 @@ const SyllabusEditor: React.FC = () => {
199
199
  window.location.href = `/preview/${slugify(
200
200
  syllabus.courseInfo.title
201
201
  )}?token=${auth.bcToken}`
202
- setIsGenerating(false)
202
+ // setIsGenerating(false)
203
203
  }
204
204
 
205
205
  if (!syllabus) return null
206
206
 
207
- console.log(auth.user)
207
+ // console.log(auth.user)
208
208
 
209
209
  return isGenerating ? (
210
210
  <>
@@ -17,11 +17,14 @@ export const slugify = (text: string) => {
17
17
  }
18
18
 
19
19
  export const createLearnJson = (courseInfo: FormState) => {
20
+ console.log("courseInfo to create learn json", courseInfo)
21
+
20
22
  const learnJson = {
21
23
  slug: slugify(courseInfo.title as string),
22
24
  title: {
23
25
  us: courseInfo.title,
24
26
  },
27
+ technologies: courseInfo.technologies || [],
25
28
  difficulty: "beginner",
26
29
  description: {
27
30
  us: courseInfo.description,
@@ -14,6 +14,7 @@ export type FormState = {
14
14
  variables: string[]
15
15
  currentStep: string
16
16
  title?: string
17
+ technologies?: string[]
17
18
  }
18
19
 
19
20
  type Auth = {