@learnpack/learnpack 5.0.152 → 5.0.156

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.
@@ -75,11 +75,15 @@ const ContentSecondaryHeader = ({
75
75
 
76
76
  export const GenerateButton = ({
77
77
  handleSubmit,
78
+ openLogin,
78
79
  }: {
79
80
  handleSubmit: () => void
81
+ openLogin: () => void
80
82
  }) => {
81
83
  const history = useStore((state) => state.history)
82
84
  const undo = useStore((state) => state.undo)
85
+ const auth = useStore((state) => state.auth)
86
+ const setAuth = useStore((state) => state.setAuth)
83
87
  const prev = history[history.length - 2]
84
88
  return (
85
89
  <div className="flex flex-col space-y-2 sm:flex-row sm:space-y-0 sm:space-x-4 justify-end mt-6">
@@ -95,6 +99,33 @@ export const GenerateButton = ({
95
99
  Revert changes
96
100
  </button>
97
101
  )}
102
+ {auth.user && (
103
+ <div
104
+ // onClick={handleSubmit}
105
+ className="text-sm text-gray-500 bg-gray-200 rounded px-4 py-2 flex items-center justify-center flex-col"
106
+ >
107
+ <span>
108
+ Creating the course as <strong>{auth.user.first_name}</strong>
109
+ </span>
110
+ <span>
111
+ or{" "}
112
+ <button
113
+ className="text-sm text-gray-500 bg-gray-200 rounded hover:bg-gray-300 items-center justify-center cursor-pointer "
114
+ onClick={() => {
115
+ setAuth({
116
+ rigoToken: "",
117
+ bcToken: "",
118
+ userId: "",
119
+ user: null,
120
+ })
121
+ openLogin()
122
+ }}
123
+ >
124
+ <strong>login as someone else</strong>
125
+ </button>
126
+ </span>
127
+ </div>
128
+ )}
98
129
  <button
99
130
  onClick={handleSubmit}
100
131
  className="w-full sm:w-auto bg-blue-600 text-white rounded px-4 py-2 hover:bg-blue-700 flex items-center justify-center gap-2 cursor-pointer"
@@ -110,10 +141,12 @@ export const ContentIndex = ({
110
141
  handleSubmit,
111
142
  messages,
112
143
  isThinking,
144
+ openLogin,
113
145
  }: {
114
146
  handleSubmit: () => void
115
147
  messages: TMessage[]
116
148
  isThinking: boolean
149
+ openLogin: () => void
117
150
  }) => {
118
151
  const history = useStore((state) => state.history)
119
152
  const push = useStore((state) => state.push)
@@ -235,7 +268,10 @@ export const ContentIndex = ({
235
268
  </div>
236
269
  ))}
237
270
  {syllabus.lessons.length > 0 && (
238
- <GenerateButton handleSubmit={handleSubmit} />
271
+ <GenerateButton
272
+ handleSubmit={handleSubmit}
273
+ openLogin={openLogin}
274
+ />
239
275
  )}
240
276
  </>
241
277
  )}
@@ -127,14 +127,7 @@ export const Sidebar = ({
127
127
  }}
128
128
  />
129
129
  <div className="absolute bottom-2 right-2 flex gap-1 items-center">
130
- <div className="relative inline-block">
131
- <FileUploader
132
- onResult={(res) => {
133
- setUploadedFiles([...(uploadedFiles || []), ...res])
134
- }}
135
- />
136
- </div>
137
-
130
+ <FileUploader />
138
131
  <button
139
132
  className="cursor-pointer blue-on-hover flex items-center justify-center w-6 h-6"
140
133
  onClick={() => {
@@ -202,6 +202,9 @@ It may take a moment..."
202
202
  handleSubmit={handleSubmit}
203
203
  messages={messages}
204
204
  isThinking={isThinking}
205
+ openLogin={() => {
206
+ setShowLoginModal(true)
207
+ }}
205
208
  />
206
209
  </div>
207
210
  )
@@ -1,7 +1,8 @@
1
1
  import { create } from "zustand"
2
2
  import { persist } from "zustand/middleware"
3
3
  import { Lesson } from "../components/LessonItem"
4
- import { ParsedLink } from "../components/LinkUploader"
4
+ import { ParsedFile } from "../components/FileUploader"
5
+ // import { ParsedLink } from "../components/LinkUploader"
5
6
 
6
7
  export type FormState = {
7
8
  description: string
@@ -9,7 +10,7 @@ export type FormState = {
9
10
  targetAudience: string
10
11
  hasContentIndex: boolean
11
12
  contentIndex: string
12
- sources: ParsedLink[]
13
+ // sources: ParsedLink[]
13
14
  isCompleted: boolean
14
15
  variables: string[]
15
16
  currentStep: string
@@ -43,8 +44,8 @@ type Store = {
43
44
  // syllabus: Syllabus
44
45
  planToRedirect: string
45
46
  setPlanToRedirect: (planToRedirect: string) => void
46
- uploadedFiles: UploadedFile[]
47
- setUploadedFiles: (uploadedFiles: UploadedFile[]) => void
47
+ uploadedFiles: ParsedFile[]
48
+ setUploadedFiles: (uploadedFiles: ParsedFile[]) => void
48
49
 
49
50
  cleanHistory: () => void
50
51
  history: Syllabus[]
@@ -75,14 +76,14 @@ const useStore = create<Store>()(
75
76
  targetAudience: "",
76
77
  hasContentIndex: false,
77
78
  contentIndex: "",
78
- sources: [],
79
+ // sources: [],
79
80
  isCompleted: false,
80
81
  currentStep: "description",
81
82
  variables: [
82
83
  "description",
83
84
  "duration",
84
- // "targetAudience",
85
85
  "hasContentIndex",
86
+ "verifyHuman",
86
87
  ],
87
88
  },
88
89
  setFormState: (formState: Partial<FormState>) =>
@@ -437,6 +437,9 @@
437
437
  .z-1000 {
438
438
  z-index: 1000;
439
439
  }
440
+ .float-right {
441
+ float: right;
442
+ }
440
443
  .container {
441
444
  width: 100%;
442
445
  }
@@ -528,9 +531,6 @@
528
531
  .hidden {
529
532
  display: none;
530
533
  }
531
- .inline-block {
532
- display: inline-block;
533
- }
534
534
  .table {
535
535
  display: table;
536
536
  }
@@ -609,6 +609,9 @@
609
609
  .w-20 {
610
610
  width: calc(var(--spacing) * 20);
611
611
  }
612
+ .w-100 {
613
+ width: calc(var(--spacing) * 100);
614
+ }
612
615
  .w-\[100px\] {
613
616
  width: 100px;
614
617
  }
@@ -682,6 +685,9 @@
682
685
  .flex-row {
683
686
  flex-direction: row;
684
687
  }
688
+ .flex-wrap {
689
+ flex-wrap: wrap;
690
+ }
685
691
  .items-center {
686
692
  align-items: center;
687
693
  }
@@ -1153,6 +1159,9 @@
1153
1159
  .focus\:ring-blue-200:focus {
1154
1160
  --tw-ring-color: var(--color-blue-200);
1155
1161
  }
1162
+ .disabled\:cursor-not-allowed:disabled {
1163
+ cursor: not-allowed;
1164
+ }
1156
1165
  .disabled\:bg-gray-100:disabled {
1157
1166
  background-color: var(--color-gray-100);
1158
1167
  }