@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
@@ -7,12 +7,13 @@ type TInteractiveCreationInputs = {
7
7
  prevInteractions: string
8
8
  }
9
9
 
10
- export const interactiveCreation = async (
11
- inputs: TInteractiveCreationInputs
10
+ export const publicInteractiveCreation = async (
11
+ inputs: TInteractiveCreationInputs,
12
+ publicToken: string
12
13
  ): Promise<any | null> => {
13
14
  try {
14
15
  const response = await axios.post(
15
- `${RIGOBOT_HOST}/v1/prompting/public/completion/390/`,
16
+ `${RIGOBOT_HOST}/v1/prompting/public/completion/39/`,
16
17
  {
17
18
  inputs: inputs,
18
19
  include_purpose_objective: false,
@@ -21,6 +22,7 @@ export const interactiveCreation = async (
21
22
  {
22
23
  headers: {
23
24
  "Content-Type": "application/json",
25
+ Authorization: `Bearer ${publicToken}`,
24
26
  },
25
27
  }
26
28
  )
@@ -28,6 +30,7 @@ export const interactiveCreation = async (
28
30
  return response.data
29
31
  } catch (error: unknown) {
30
32
  const err = error as AxiosError
33
+ console.log("error", err)
31
34
 
32
35
  if (err.response?.status === 403) {
33
36
  toast.error("You've reached the limit. Please log in to continue.")
@@ -54,9 +57,13 @@ export const isHuman = async (token: string) => {
54
57
  }
55
58
  )
56
59
 
57
- return response.status === 200
60
+ return {
61
+ human: response.status === 200,
62
+ message: response.data.message,
63
+ token: response.data.public_access_token,
64
+ }
58
65
  } catch (error) {
59
66
  console.error(error)
60
- return false
67
+ return { human: false, message: error, token: null }
61
68
  }
62
69
  }
@@ -23,6 +23,7 @@ type Auth = {
23
23
  rigoToken: string
24
24
  userId: string
25
25
  user: any
26
+ publicToken: string
26
27
  }
27
28
  export type Syllabus = {
28
29
  lessons: Lesson[]
@@ -41,6 +42,8 @@ export type UploadedFile = {
41
42
  type Store = {
42
43
  auth: Auth
43
44
  formState: FormState
45
+ setFormState: (formState: Partial<FormState>) => void
46
+ resetFormState: () => void
44
47
  setAuth: (auth: Auth) => void
45
48
  // syllabus: Syllabus
46
49
  planToRedirect: string
@@ -53,7 +56,6 @@ type Store = {
53
56
  undo: () => void
54
57
  push: (syllabus: Syllabus) => void
55
58
  // setSyllabus: (syllabus: Partial<Syllabus>) => void
56
- setFormState: (formState: Partial<FormState>) => void
57
59
  consumables: Consumables
58
60
  setConsumables: (consumables: Partial<Consumables>) => void
59
61
  mode: "student" | "teacher"
@@ -68,6 +70,7 @@ const useStore = create<Store>()(
68
70
  rigoToken: "",
69
71
  userId: "",
70
72
  user: null,
73
+ publicToken: "",
71
74
  },
72
75
  planToRedirect: "learnpack-creator",
73
76
  setPlanToRedirect: (planToRedirect: string) => set({ planToRedirect }),
@@ -89,6 +92,24 @@ const useStore = create<Store>()(
89
92
  },
90
93
  setFormState: (formState: Partial<FormState>) =>
91
94
  set((state) => ({ formState: { ...state.formState, ...formState } })),
95
+ resetFormState: () =>
96
+ set({
97
+ formState: {
98
+ currentStep: "description",
99
+ description: "",
100
+ duration: 0,
101
+ targetAudience: "",
102
+ hasContentIndex: false,
103
+ contentIndex: "",
104
+ isCompleted: false,
105
+ variables: [
106
+ "description",
107
+ "duration",
108
+ "hasContentIndex",
109
+ "verifyHuman",
110
+ ],
111
+ },
112
+ }),
92
113
 
93
114
  setUploadedFiles: (uploadedFiles) =>
94
115
  set(() => ({
@@ -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,