@learnpack/learnpack 5.0.168 → 5.0.176

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.
Files changed (36) hide show
  1. package/README.md +13 -13
  2. package/lib/commands/serve.js +42 -2
  3. package/{src/creatorDist/assets/index-C_YTggyk.css → lib/creatorDist/assets/index-CrWESWmj.css} +43 -11
  4. package/lib/creatorDist/assets/index-T7usmMYO.js +32991 -0
  5. package/lib/creatorDist/index.html +2 -2
  6. package/lib/utils/api.d.ts +1 -1
  7. package/lib/utils/api.js +2 -1
  8. package/lib/utils/readDocuments.d.ts +0 -0
  9. package/lib/utils/readDocuments.js +1 -0
  10. package/oclif.manifest.json +1 -1
  11. package/package.json +3 -1
  12. package/src/commands/serve.ts +56 -2
  13. package/src/creator/src/App.tsx +51 -34
  14. package/src/creator/src/components/ConsumablesManager.tsx +1 -0
  15. package/src/creator/src/components/FileUploader.tsx +64 -52
  16. package/src/creator/src/components/Login.tsx +172 -82
  17. package/src/creator/src/components/ResumeCourseModal.tsx +38 -0
  18. package/src/creator/src/components/StepWizard.tsx +12 -10
  19. package/src/creator/src/components/TurnstileChallenge.tsx +2 -7
  20. package/src/creator/src/components/syllabus/ContentIndex.tsx +1 -0
  21. package/src/creator/src/components/syllabus/SyllabusEditor.tsx +63 -29
  22. package/src/creator/src/utils/constants.ts +2 -1
  23. package/src/creator/src/utils/lib.ts +55 -0
  24. package/src/creator/src/utils/rigo.ts +12 -5
  25. package/src/creator/src/utils/store.ts +22 -1
  26. package/{lib/creatorDist/assets/index-C_YTggyk.css → src/creatorDist/assets/index-CrWESWmj.css} +43 -11
  27. package/src/creatorDist/assets/index-T7usmMYO.js +32991 -0
  28. package/src/creatorDist/index.html +2 -2
  29. package/src/ui/_app/app.js +286 -286
  30. package/src/ui/app.tar.gz +0 -0
  31. package/src/utils/api.ts +2 -1
  32. package/src/utils/readDocuments.ts +0 -0
  33. package/lib/creatorDist/assets/index-4XkqESUr.js +0 -83719
  34. package/lib/creatorDist/assets/pdf.worker-DSVOJ9H9.js +0 -56037
  35. package/src/creatorDist/assets/index-4XkqESUr.js +0 -83719
  36. package/src/creatorDist/assets/pdf.worker-DSVOJ9H9.js +0 -56037
package/README.md CHANGED
@@ -21,7 +21,7 @@ $ npm install -g @learnpack/learnpack
21
21
  $ learnpack COMMAND
22
22
  running command...
23
23
  $ learnpack (-v|--version|version)
24
- @learnpack/learnpack/5.0.168 win32-x64 node-v22.15.0
24
+ @learnpack/learnpack/5.0.176 win32-x64 node-v22.15.0
25
25
  $ learnpack --help [COMMAND]
26
26
  USAGE
27
27
  $ learnpack COMMAND
@@ -80,7 +80,7 @@ DESCRIPTION
80
80
  12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)
81
81
  ```
82
82
 
83
- _See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.168/src\commands\audit.ts)_
83
+ _See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.176/src\commands\audit.ts)_
84
84
 
85
85
  ## `learnpack breakToken`
86
86
 
@@ -95,7 +95,7 @@ OPTIONS
95
95
  -y, --yes Skip all prompts and initialize an empty project
96
96
  ```
97
97
 
98
- _See code: [src\commands\breakToken.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.168/src\commands\breakToken.ts)_
98
+ _See code: [src\commands\breakToken.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.176/src\commands\breakToken.ts)_
99
99
 
100
100
  ## `learnpack clean`
101
101
 
@@ -110,7 +110,7 @@ DESCRIPTION
110
110
  Extra documentation goes here
111
111
  ```
112
112
 
113
- _See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.168/src\commands\clean.ts)_
113
+ _See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.176/src\commands\clean.ts)_
114
114
 
115
115
  ## `learnpack download [PACKAGE]`
116
116
 
@@ -128,7 +128,7 @@ DESCRIPTION
128
128
  Extra documentation goes here
129
129
  ```
130
130
 
131
- _See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.168/src\commands\download.ts)_
131
+ _See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.176/src\commands\download.ts)_
132
132
 
133
133
  ## `learnpack help [COMMAND]`
134
134
 
@@ -160,7 +160,7 @@ OPTIONS
160
160
  -y, --yes Skip all prompts and initialize an empty project
161
161
  ```
162
162
 
163
- _See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.168/src\commands\init.ts)_
163
+ _See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.176/src\commands\init.ts)_
164
164
 
165
165
  ## `learnpack login [PACKAGE]`
166
166
 
@@ -178,7 +178,7 @@ DESCRIPTION
178
178
  Extra documentation goes here
179
179
  ```
180
180
 
181
- _See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.168/src\commands\login.ts)_
181
+ _See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.176/src\commands\login.ts)_
182
182
 
183
183
  ## `learnpack logout [PACKAGE]`
184
184
 
@@ -196,7 +196,7 @@ DESCRIPTION
196
196
  Extra documentation goes here
197
197
  ```
198
198
 
199
- _See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.168/src\commands\logout.ts)_
199
+ _See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.176/src\commands\logout.ts)_
200
200
 
201
201
  ## `learnpack plugins`
202
202
 
@@ -328,7 +328,7 @@ OPTIONS
328
328
  -s, --strict strict mode
329
329
  ```
330
330
 
331
- _See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.168/src\commands\publish.ts)_
331
+ _See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.176/src\commands\publish.ts)_
332
332
 
333
333
  ## `learnpack serve`
334
334
 
@@ -345,7 +345,7 @@ OPTIONS
345
345
  -y, --yes Skip all prompts and initialize an empty project
346
346
  ```
347
347
 
348
- _See code: [src\commands\serve.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.168/src\commands\serve.ts)_
348
+ _See code: [src\commands\serve.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.176/src\commands\serve.ts)_
349
349
 
350
350
  ## `learnpack start`
351
351
 
@@ -367,7 +367,7 @@ OPTIONS
367
367
  -y, --yes Skip all prompts and initialize an empty project
368
368
  ```
369
369
 
370
- _See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.168/src\commands\start.ts)_
370
+ _See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.176/src\commands\start.ts)_
371
371
 
372
372
  ## `learnpack test [EXERCISESLUG]`
373
373
 
@@ -384,7 +384,7 @@ OPTIONS
384
384
  -y, --yes Skip all prompts and initialize an empty project
385
385
  ```
386
386
 
387
- _See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.168/src\commands\test.ts)_
387
+ _See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.176/src\commands\test.ts)_
388
388
 
389
389
  ## `learnpack translate`
390
390
 
@@ -398,7 +398,7 @@ OPTIONS
398
398
  -y, --yes Skip all prompts and initialize an empty project
399
399
  ```
400
400
 
401
- _See code: [src\commands\translate.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.168/src\commands\translate.ts)_
401
+ _See code: [src\commands\translate.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.176/src\commands\translate.ts)_
402
402
  <!-- commandsstop -->
403
403
 
404
404
  > > > > > > > 0cb3e56d84c197f9d008836bb573eade212b7e57
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.processImage = exports.createLearnJson = void 0;
4
4
  exports.processExercise = processExercise;
5
5
  const command_1 = require("@oclif/command");
6
- // import multer from "multer"
7
- // import * as ytdl from "ytdl-core"
6
+ // import { readDocument } from "../utils/readDocuments"
8
7
  const youtube_transcript_1 = require("youtube-transcript");
9
8
  const express = require("express");
10
9
  const cors = require("cors");
@@ -349,6 +348,47 @@ class ServeCommand extends SessionCommand_1.default {
349
348
  return res.status(500).json({ error: error.message });
350
349
  }
351
350
  });
351
+ app.post("/read-document", upload.single("file"), async (req, res) => {
352
+ console.log("READING A DOCUMENT");
353
+ // const rigoToken = req.header("x-rigo-token")
354
+ // if (!rigoToken) {
355
+ // return res.status(400).json({ error: "Rigo token is required" })
356
+ // }
357
+ try {
358
+ // eslint-disable-next-line
359
+ // @ts-ignore
360
+ if (!req.file) {
361
+ return res.status(400).json({ error: "Missing file" });
362
+ }
363
+ const resultId = `${Date.now()}-${Math.floor(Math.random() * 1e6)}`;
364
+ const webhookUrl = `https://9cw5zmww-3000.use2.devtunnels.ms/document/results/result_id/${resultId}/`;
365
+ // Construir form-data para enviar al servidor proxy
366
+ const formData = new FormData();
367
+ // eslint-disable-next-line
368
+ // @ts-ignore
369
+ formData.append("file", req.file.buffer, {
370
+ // eslint-disable-next-line
371
+ // @ts-ignore
372
+ filename: req.file.originalname,
373
+ // eslint-disable-next-line
374
+ // @ts-ignore
375
+ contentType: req.file.mimetype,
376
+ });
377
+ formData.append("webhook_callback_url", webhookUrl);
378
+ // Hacer POST al servidor externo
379
+ const response = await axios_1.default.post(`${api_1.RIGOBOT_HOST}/v1/learnpack/documents/pdf/read`, formData, {
380
+ headers: Object.assign(Object.assign({}, formData.getHeaders()), { Authorization: `Token ` }),
381
+ maxBodyLength: Infinity,
382
+ });
383
+ console.log("RESPONSE FROM RIGOBOT", response);
384
+ // Responder con el UUID generado
385
+ return res.json({ resultId });
386
+ }
387
+ catch (error) {
388
+ console.error("❌ Error in /read-document:", error);
389
+ return res.status(500).json({ error: error.message });
390
+ }
391
+ });
352
392
  app.get("/check-preview-image/:slug", async (req, res) => {
353
393
  const { slug } = req.params;
354
394
  const file = bucket.file(`courses/${slug}/preview.png`);
@@ -58,8 +58,6 @@
58
58
  --color-red-500: oklch(63.7% 0.237 25.331);
59
59
  --color-red-600: oklch(57.7% 0.245 27.325);
60
60
  --color-red-700: oklch(50.5% 0.213 27.518);
61
- --color-sky-500: oklch(68.5% 0.169 237.323);
62
- --color-sky-600: oklch(58.8% 0.158 241.966);
63
61
  --color-blue-50: oklch(97% 0.014 254.604);
64
62
  --color-blue-100: oklch(93.2% 0.032 255.585);
65
63
  --color-blue-200: oklch(88.2% 0.059 254.128);
@@ -510,6 +508,9 @@
510
508
  .mb-2 {
511
509
  margin-bottom: calc(var(--spacing) * 2);
512
510
  }
511
+ .mb-3 {
512
+ margin-bottom: calc(var(--spacing) * 3);
513
+ }
513
514
  .mb-4 {
514
515
  margin-bottom: calc(var(--spacing) * 4);
515
516
  }
@@ -537,6 +538,9 @@
537
538
  .h-2 {
538
539
  height: calc(var(--spacing) * 2);
539
540
  }
541
+ .h-4 {
542
+ height: calc(var(--spacing) * 4);
543
+ }
540
544
  .h-5 {
541
545
  height: calc(var(--spacing) * 5);
542
546
  }
@@ -588,6 +592,9 @@
588
592
  .w-2 {
589
593
  width: calc(var(--spacing) * 2);
590
594
  }
595
+ .w-4 {
596
+ width: calc(var(--spacing) * 4);
597
+ }
591
598
  .w-4\/5 {
592
599
  width: 80%;
593
600
  }
@@ -715,6 +722,9 @@
715
722
  .gap-3 {
716
723
  gap: calc(var(--spacing) * 3);
717
724
  }
725
+ .gap-4 {
726
+ gap: calc(var(--spacing) * 4);
727
+ }
718
728
  :where(.space-y-2 > :not(:last-child)) {
719
729
  --tw-space-y-reverse: 0;
720
730
  margin-block-start: calc(
@@ -810,12 +820,12 @@
810
820
  .border-gray-300 {
811
821
  border-color: var(--color-gray-300);
812
822
  }
813
- .border-sky-500 {
814
- border-color: var(--color-sky-500);
815
- }
816
823
  .border-transparent {
817
824
  border-color: #0000;
818
825
  }
826
+ .border-t-transparent {
827
+ border-top-color: #0000;
828
+ }
819
829
  .bg-black\/50 {
820
830
  background-color: #00000080;
821
831
  }
@@ -828,6 +838,18 @@
828
838
  );
829
839
  }
830
840
  }
841
+ .bg-black\/60 {
842
+ background-color: #0009;
843
+ }
844
+ @supports (color: color-mix(in lab, red, red)) {
845
+ .bg-black\/60 {
846
+ background-color: color-mix(
847
+ in oklab,
848
+ var(--color-black) 60%,
849
+ transparent
850
+ );
851
+ }
852
+ }
831
853
  .bg-blue-50 {
832
854
  background-color: var(--color-blue-50);
833
855
  }
@@ -837,6 +859,9 @@
837
859
  .bg-blue-400 {
838
860
  background-color: var(--color-blue-400);
839
861
  }
862
+ .bg-blue-500 {
863
+ background-color: var(--color-blue-500);
864
+ }
840
865
  .bg-blue-600 {
841
866
  background-color: var(--color-blue-600);
842
867
  }
@@ -855,9 +880,6 @@
855
880
  .bg-red-50 {
856
881
  background-color: var(--color-red-50);
857
882
  }
858
- .bg-sky-500 {
859
- background-color: var(--color-sky-500);
860
- }
861
883
  .bg-white {
862
884
  background-color: var(--color-white);
863
885
  }
@@ -966,6 +988,10 @@
966
988
  font-size: var(--text-sm);
967
989
  line-height: var(--tw-leading, var(--text-sm--line-height));
968
990
  }
991
+ .text-xl {
992
+ font-size: var(--text-xl);
993
+ line-height: var(--tw-leading, var(--text-xl--line-height));
994
+ }
969
995
  .text-xs {
970
996
  font-size: var(--text-xs);
971
997
  line-height: var(--tw-leading, var(--text-xs--line-height));
@@ -1001,6 +1027,9 @@
1001
1027
  .text-blue-600 {
1002
1028
  color: var(--color-blue-600);
1003
1029
  }
1030
+ .text-blue-700 {
1031
+ color: var(--color-blue-700);
1032
+ }
1004
1033
  .text-blue-900 {
1005
1034
  color: var(--color-blue-900);
1006
1035
  }
@@ -1025,9 +1054,6 @@
1025
1054
  .text-red-600 {
1026
1055
  color: var(--color-red-600);
1027
1056
  }
1028
- .text-sky-600 {
1029
- color: var(--color-sky-600);
1030
- }
1031
1057
  .text-white {
1032
1058
  color: var(--color-white);
1033
1059
  }
@@ -1061,6 +1087,12 @@
1061
1087
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
1062
1088
  var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1063
1089
  }
1090
+ .shadow-xl {
1091
+ --tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, #0000001a),
1092
+ 0 8px 10px -6px var(--tw-shadow-color, #0000001a);
1093
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
1094
+ var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1095
+ }
1064
1096
  .transition {
1065
1097
  transition-property: color, background-color, border-color, outline-color,
1066
1098
  text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via,