@learnpack/learnpack 5.0.70 → 5.0.71

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.
@@ -86,8 +86,6 @@
86
86
  --text-sm--line-height: calc(1.25 / 0.875);
87
87
  --text-lg: 1.125rem;
88
88
  --text-lg--line-height: calc(1.75 / 1.125);
89
- --text-xl: 1.25rem;
90
- --text-xl--line-height: calc(1.75 / 1.25);
91
89
  --text-4xl: 2.25rem;
92
90
  --text-4xl--line-height: calc(2.5 / 2.25);
93
91
  --font-weight-medium: 500;
@@ -521,8 +519,11 @@
521
519
  .h-40 {
522
520
  height: calc(var(--spacing) * 40);
523
521
  }
524
- .h-\[70\%\] {
525
- height: 70%;
522
+ .h-50 {
523
+ height: calc(var(--spacing) * 50);
524
+ }
525
+ .h-\[85\%\] {
526
+ height: 85%;
526
527
  }
527
528
  .h-full {
528
529
  height: 100%;
@@ -530,8 +531,8 @@
530
531
  .h-screen {
531
532
  height: 100vh;
532
533
  }
533
- .max-h-\[70vh\] {
534
- max-height: 70vh;
534
+ .max-h-\[80vh\] {
535
+ max-height: 80vh;
535
536
  }
536
537
  .max-h-\[300px\] {
537
538
  max-height: 300px;
@@ -829,10 +830,6 @@
829
830
  font-size: var(--text-sm);
830
831
  line-height: var(--tw-leading, var(--text-sm--line-height));
831
832
  }
832
- .text-xl {
833
- font-size: var(--text-xl);
834
- line-height: var(--tw-leading, var(--text-xl--line-height));
835
- }
836
833
  .text-\[10px\] {
837
834
  font-size: 10px;
838
835
  }
@@ -897,12 +894,6 @@
897
894
  .opacity-30 {
898
895
  opacity: 0.3;
899
896
  }
900
- .shadow {
901
- --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a),
902
- 0 1px 2px -1px var(--tw-shadow-color, #0000001a);
903
- box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
904
- var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
905
- }
906
897
  .shadow-md {
907
898
  --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, #0000001a),
908
899
  0 2px 4px -2px var(--tw-shadow-color, #0000001a);
@@ -10,8 +10,8 @@
10
10
  />
11
11
 
12
12
  <title>Learnpack Creator: Craft tutorials in seconds!</title>
13
- <script type="module" crossorigin src="/creator/assets/index-Chx6V3zd.js"></script>
14
- <link rel="stylesheet" crossorigin href="/creator/assets/index-Dqo9u2iR.css">
13
+ <script type="module" crossorigin src="/creator/assets/index-Dm2fdeOs.js"></script>
14
+ <link rel="stylesheet" crossorigin href="/creator/assets/index-k_eF99Sf.css">
15
15
  </head>
16
16
  <body>
17
17
  <div id="root"></div>
@@ -1 +1 @@
1
- {"version":"5.0.70","commands":{"audit":{"id":"audit","description":"learnpack audit is the command in charge of creating an auditory of the repository\n...\nlearnpack audit checks for the following information in a repository:\n 1. The configuration object has slug, repository and description. (Error)\n 2. The command learnpack clean has been run. (Error)\n 3. If a markdown or test file doesn't have any content. (Error)\n 4. The links are accessing to valid servers. (Error)\n 5. The relative images are working (If they have the shortest path to the image or if the images exists in the assets). (Error)\n 6. The external images are working (If they are pointing to a valid server). (Error)\n 7. The exercises directory names are valid. (Error)\n 8. If an exercise doesn't have a README file. (Error)\n 9. The exercises array (Of the config file) has content. (Error)\n 10. The exercses have the same translations. (Warning)\n 11. The .gitignore file exists. (Warning)\n 12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"strict":{"name":"strict","type":"boolean","char":"s","description":"strict mode","allowNo":false}},"args":[]},"breakToken":{"id":"breakToken","description":"Break the token","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"grading":{"name":"grading","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"clean":{"id":"clean","description":"Clean the configuration object\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]},"download":{"id":"download","description":"Describe the command here\n...\nExtra documentation goes here\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"init":{"id":"init","description":"Create a new learning package: Book, Tutorial or Exercise","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"grading":{"name":"grading","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"login":{"id":"login","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"logout":{"id":"logout","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"publish":{"id":"publish","description":"Builds the project by copying necessary files and directories into a zip file","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"strict":{"name":"strict","type":"boolean","char":"s","description":"strict mode","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"serve":{"id":"serve","description":"Runs a small server to build tutorials","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"port":{"name":"port","type":"option","char":"p","description":"server port"},"host":{"name":"host","type":"option","char":"h","description":"server host"},"debug":{"name":"debug","type":"boolean","char":"d","description":"debugger mode for more verbage","allowNo":false}},"args":[]},"start":{"id":"start","description":"Runs a small server with all the exercise instructions","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"port":{"name":"port","type":"option","char":"p","description":"server port"},"host":{"name":"host","type":"option","char":"h","description":"server host"},"disableGrading":{"name":"disableGrading","type":"boolean","char":"D","description":"disble grading functionality","allowNo":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Watch for file changes","allowNo":false},"editor":{"name":"editor","type":"option","char":"e","description":"[preview, extension]","options":["extension","preview"]},"version":{"name":"version","type":"option","char":"v","description":"E.g: 1.0.1"},"grading":{"name":"grading","type":"option","char":"g","description":"[isolated, incremental]","options":["isolated","incremental"]},"debug":{"name":"debug","type":"boolean","char":"d","description":"debugger mode for more verbage","allowNo":false}},"args":[]},"test":{"id":"test","description":"Test exercises","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false}},"args":[{"name":"exerciseSlug","description":"The name of the exercise to test","required":false,"hidden":false}]},"translate":{"id":"translate","description":"List all the lessons, the user is able of select many of them to translate to the given languages","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false}},"args":[]}}}
1
+ {"version":"5.0.71","commands":{"audit":{"id":"audit","description":"learnpack audit is the command in charge of creating an auditory of the repository\n...\nlearnpack audit checks for the following information in a repository:\n 1. The configuration object has slug, repository and description. (Error)\n 2. The command learnpack clean has been run. (Error)\n 3. If a markdown or test file doesn't have any content. (Error)\n 4. The links are accessing to valid servers. (Error)\n 5. The relative images are working (If they have the shortest path to the image or if the images exists in the assets). (Error)\n 6. The external images are working (If they are pointing to a valid server). (Error)\n 7. The exercises directory names are valid. (Error)\n 8. If an exercise doesn't have a README file. (Error)\n 9. The exercises array (Of the config file) has content. (Error)\n 10. The exercses have the same translations. (Warning)\n 11. The .gitignore file exists. (Warning)\n 12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"strict":{"name":"strict","type":"boolean","char":"s","description":"strict mode","allowNo":false}},"args":[]},"breakToken":{"id":"breakToken","description":"Break the token","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"grading":{"name":"grading","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"clean":{"id":"clean","description":"Clean the configuration object\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]},"download":{"id":"download","description":"Describe the command here\n...\nExtra documentation goes here\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"init":{"id":"init","description":"Create a new learning package: Book, Tutorial or Exercise","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"grading":{"name":"grading","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"login":{"id":"login","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"logout":{"id":"logout","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"publish":{"id":"publish","description":"Builds the project by copying necessary files and directories into a zip file","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"strict":{"name":"strict","type":"boolean","char":"s","description":"strict mode","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"serve":{"id":"serve","description":"Runs a small server to build tutorials","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"port":{"name":"port","type":"option","char":"p","description":"server port"},"host":{"name":"host","type":"option","char":"h","description":"server host"},"debug":{"name":"debug","type":"boolean","char":"d","description":"debugger mode for more verbage","allowNo":false}},"args":[]},"start":{"id":"start","description":"Runs a small server with all the exercise instructions","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"port":{"name":"port","type":"option","char":"p","description":"server port"},"host":{"name":"host","type":"option","char":"h","description":"server host"},"disableGrading":{"name":"disableGrading","type":"boolean","char":"D","description":"disble grading functionality","allowNo":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Watch for file changes","allowNo":false},"editor":{"name":"editor","type":"option","char":"e","description":"[preview, extension]","options":["extension","preview"]},"version":{"name":"version","type":"option","char":"v","description":"E.g: 1.0.1"},"grading":{"name":"grading","type":"option","char":"g","description":"[isolated, incremental]","options":["isolated","incremental"]},"debug":{"name":"debug","type":"boolean","char":"d","description":"debugger mode for more verbage","allowNo":false}},"args":[]},"test":{"id":"test","description":"Test exercises","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false}},"args":[{"name":"exerciseSlug","description":"The name of the exercise to test","required":false,"hidden":false}]},"translate":{"id":"translate","description":"List all the lessons, the user is able of select many of them to translate to the given languages","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false}},"args":[]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@learnpack/learnpack",
3
3
  "description": "Seamlessly build, sell and/or take interactive & auto-graded tutorials, start learning now or build a new tutorial to your audience.",
4
- "version": "5.0.70",
4
+ "version": "5.0.71",
5
5
  "author": "Alejandro Sanchez @alesanchezr",
6
6
  "contributors": [
7
7
  {
@@ -269,7 +269,7 @@ const handleAILogic = async (tutorialDir: string, packageInfo: PackageInfo) => {
269
269
 
270
270
  if (!sessionExists || !isValidBreathecodeToken || !isValidToken) {
271
271
  Console.info(
272
- "Almost there! First you need to login with 4Geeks.com to use AI Generation tool for creators. You can create a new account here: https://4geeks.com/creators"
272
+ "Almost there! First you need to login with 4Geeks.com to use AI Generation tool for creators. You can create a new account here: https://4geeks.com/checkout?plan=4geeks-creator"
273
273
  )
274
274
  try {
275
275
  sessionPayload = await SessionManager.login()
@@ -49,7 +49,6 @@ export default class ServeCommand extends SessionCommand {
49
49
  }
50
50
 
51
51
  const credentials = JSON.parse(crendsEnv)
52
-
53
52
  const bucketStorage = new Storage({
54
53
  credentials,
55
54
  })
@@ -126,14 +125,23 @@ export default class ServeCommand extends SessionCommand {
126
125
  stream.end(buffer)
127
126
  })
128
127
 
128
+ app.get("/create", (req, res) => {
129
+ console.log("GET /create")
130
+ res.redirect("/creator/")
131
+ })
132
+
129
133
  app.get("/", async (req, res) => {
130
- // The the ui/_app/index.html
131
134
  console.log("GET /")
132
135
 
133
- const file = path.resolve(__dirname, "../ui/_app/index.html")
134
- res.sendFile(file)
135
- })
136
+ const slug = req.query.slug
136
137
 
138
+ if (slug) {
139
+ const file = path.resolve(__dirname, "../ui/_app/index.html")
140
+ res.sendFile(file)
141
+ } else {
142
+ res.redirect("https://learnpack.co")
143
+ }
144
+ })
137
145
  app.get("/config", async (req, res) => {
138
146
  const courseSlug = req.query.slug
139
147
  const files = await listFilesWithPrefix(`courses/${courseSlug}`)
@@ -45,6 +45,7 @@ function App() {
45
45
  bcToken: token,
46
46
  userId: user.id,
47
47
  rigoToken: user.rigobot.key,
48
+ user: user,
48
49
  })
49
50
  setFormState({
50
51
  variables: [
@@ -265,7 +266,7 @@ function App() {
265
266
  {formState.isCompleted ? (
266
267
  <Loader
267
268
  text="Learnpack is setting up your tutorial. It may take a moment..."
268
- icon={<img src={"rigo-float.gif"} alt="rigo" className="w-20 h-20" />}
269
+ icon={<img src={"creator/rigo-float.gif"} alt="rigo" className="w-20 h-20" />}
269
270
  />
270
271
  ) : (
271
272
  <StepWizard
@@ -190,7 +190,7 @@ export const SVGS = {
190
190
  >
191
191
  <path
192
192
  d="M6.12812 3.64814L0.384343 0.0378137C0.213539 -0.0696296 0 0.0647108 0 0.279307V5.34833C0 5.47075 0.0733163 5.57892 0.18082 5.61498L2.90314 6.52715L5.01075 7.23331C5.25193 7.31415 5.25193 7.68577 5.01075 7.76646L2.90314 8.47262L0.18082 9.38509C0.0733163 9.42114 0 9.52931 0 9.65173V14.7206C0 14.9354 0.213539 15.0695 0.384343 14.9622L6.12812 11.3519L11.8719 7.7416C12.0427 7.6343 12.0427 7.36576 11.8719 7.25847L6.12812 3.64814Z"
193
- fill="#C7F3FD"
193
+ fill="var(--four-geeks-blue)"
194
194
  />
195
195
  </svg>
196
196
  ),
@@ -126,6 +126,7 @@ export default function Login({ onFinish }: { onFinish: () => void }) {
126
126
  bcToken: isLoggedId.token,
127
127
  userId: isLoggedId.user.id,
128
128
  rigoToken: isLoggedId.rigobot.key,
129
+ user: isLoggedId.user,
129
130
  })
130
131
  setIsLoading(false)
131
132
  onFinish()
@@ -163,6 +164,7 @@ export default function Login({ onFinish }: { onFinish: () => void }) {
163
164
  bcToken: token,
164
165
  userId: user.id,
165
166
  rigoToken: user.rigobot.key,
167
+ user: user,
166
168
  })
167
169
  onFinish()
168
170
  }
@@ -172,24 +174,6 @@ export default function Login({ onFinish }: { onFinish: () => void }) {
172
174
  return (
173
175
  <>
174
176
  <div className="max-w-sm mx-auto mt-10 bg-white p-8 rounded-xl shadow-md text-center">
175
- <div className="flex justify-between items-center mb-4">
176
- <h2 className="text-xl font-semibold">Login</h2>
177
- <div className="bg-blue-50 text-sm p-2 rounded text-left">
178
- <p className="text-gray-700 m-0">You don't have an account?</p>
179
- <a
180
- href="https://4geeks.com/pricing?plan=basic"
181
- className="text-blue-600 font-medium"
182
- >
183
- Register here.
184
- </a>
185
- </div>
186
- </div>
187
-
188
- <p className="text-gray-600 mb-6">
189
- Log in to 4Geeks to get performance statistics, access to our AI
190
- mentor, and many other benefits
191
- </p>
192
-
193
177
  <button
194
178
  onClick={redirectGithub}
195
179
  className="w-full border border-gray-300 py-2 rounded-md font-semibold flex items-center justify-center gap-2 mb-4 cursor-pointer"
@@ -251,6 +235,18 @@ export default function Login({ onFinish }: { onFinish: () => void }) {
251
235
  Login with Email
252
236
  </button>
253
237
  )}
238
+ <div className="flex justify-between items-center mt-4">
239
+ <div className="bg-blue-50 text-sm p-2 rounded text-left">
240
+ <p className="text-gray-700 m-0">You don't have an account?</p>
241
+ <a
242
+ href="https://4geeks.com/checkout?plan=4geeks-creator"
243
+ target="_blank"
244
+ className="text-blue-600 font-medium"
245
+ >
246
+ Register here.
247
+ </a>
248
+ </div>
249
+ </div>
254
250
  </div>
255
251
  </>
256
252
  )
@@ -1,6 +1,7 @@
1
1
  import { RigoLoader } from "./RigoLoader"
2
2
 
3
3
  import { SVGS } from "../assets/svgs"
4
+ import useStore from "../utils/store"
4
5
 
5
6
  export type TMessage = {
6
7
  type: "user" | "assistant"
@@ -8,9 +9,12 @@ export type TMessage = {
8
9
  }
9
10
 
10
11
  export const Message: React.FC<TMessage> = ({ type, content }) => {
12
+ const user = useStore((state) => state.auth.user)
11
13
  const isAI = type === "assistant"
12
14
 
13
15
  const isLoading = isAI && !content
16
+
17
+ console.log("user", user)
14
18
  return isLoading ? (
15
19
  <RigoLoader text="Thinking..." svg={<img src="rigo-float.gif" />} />
16
20
  ) : (
@@ -21,7 +25,13 @@ export const Message: React.FC<TMessage> = ({ type, content }) => {
21
25
  : "bg-blue-50 border-blue-200 text-blue-900"
22
26
  }`}
23
27
  >
24
- <span className="mt-1">{isAI ? SVGS.rigoSoftBlue : SVGS.user}</span>
28
+ {isAI ? (
29
+ <span className="mt-1">{SVGS.rigoSoftBlue}</span>
30
+ ) : user?.profile?.avatar_url ? (
31
+ <img src={user?.profile?.avatar_url} className="w-6 h-6 rounded-full" />
32
+ ) : (
33
+ <span className="mt-1">{SVGS.user}</span>
34
+ )}
25
35
  <p className="text-sm leading-relaxed">{content}</p>
26
36
  </div>
27
37
  )
@@ -0,0 +1,12 @@
1
+ import { useEffect } from "react"
2
+ import toast from "react-hot-toast"
3
+ export const Redirector = ({ to }: { to: string }) => {
4
+ useEffect(() => {
5
+ window.location.href = to
6
+ window.location.reload()
7
+ toast.success("Redirecting to " + to)
8
+ console.log("Redirecting to " + to)
9
+ }, [])
10
+
11
+ return <h1>Redirecting to {to}...</h1>
12
+ }
@@ -12,7 +12,7 @@ const ContentIndexHeader = ({
12
12
  syllabus: Syllabus
13
13
  }) => {
14
14
  return (
15
- <div>
15
+ <div className="mt-2">
16
16
  <h2 className="text-lg font-semibold">
17
17
  {messages.filter((m) => m.type === "assistant" && m.content.length > 0)
18
18
  .length === 0
@@ -139,7 +139,7 @@ export const ContentIndex = ({
139
139
  <ContentIndexHeader messages={messages} syllabus={syllabus} />
140
140
  <div
141
141
  ref={containerRef}
142
- className=" space-y-3 overflow-y-auto max-h-[70vh] pr-2 scrollbar-hide relative pb-5"
142
+ className=" space-y-3 overflow-y-auto max-h-[80vh] pr-2 scrollbar-hide relative pb-5"
143
143
  >
144
144
  {syllabus.lessons.map((lesson, index) => (
145
145
  <div key={lesson.id}>
@@ -176,24 +176,16 @@ export const ContentIndex = ({
176
176
 
177
177
  {showScrollHint && (
178
178
  <div className="pointer-events-none relative">
179
- <div className="absolute bottom-0 left-0 w-full h-20 bg-gradient-to-t from-white to-transparent z-10" />
179
+ <div className="absolute bottom-0 left-0 w-full h-50 bg-gradient-to-t from-white to-transparent z-10" />
180
180
  <div className="absolute bottom-3 left-0 w-full flex justify-center z-20">
181
181
  <button
182
182
  style={{ color: "#0084FF" }}
183
- onClick={() => scrollToBottom("continue")}
184
- className="px-4 py-1 bg-white text-sm rounded shadow hover:bg-blue-50 cursor-pointer pointer-events-auto font-bold flex items-center gap-2"
183
+ onClick={() => scrollToBottom("bottom")}
184
+ className="px-4 py-1 bg-white text-sm rounded hover:bg-blue-50 cursor-pointer pointer-events-auto font-bold flex items-center gap-2"
185
185
  >
186
186
  Continue scrolling
187
187
  {SVGS.downArrow}
188
188
  </button>
189
- <button
190
- style={{ color: "#0084FF" }}
191
- onClick={() => scrollToBottom("bottom")}
192
- className="px-4 py-1 bg-white text-sm rounded shadow hover:bg-blue-50 cursor-pointer pointer-events-auto font-bold flex items-center gap-2"
193
- >
194
- Scroll to bottom
195
- {SVGS.bottom}
196
- </button>
197
189
  </div>
198
190
  </div>
199
191
  )}
@@ -24,10 +24,10 @@ export const Sidebar = ({
24
24
  <>
25
25
  {!isOpen && (
26
26
  <button
27
- className="fixed top-2 left-2 z-50 lg:hidden bg-white p-1 rounded shadow-md cursor-pointer"
27
+ className="fixed top-2 left-2 z-50 lg:hidden bg-white p-1 rounded shadow-md cursor-pointer p-2"
28
28
  onClick={() => setIsOpen(true)}
29
29
  >
30
-
30
+ {SVGS.rigoSoftBlue}
31
31
  </button>
32
32
  )}
33
33
 
@@ -44,17 +44,8 @@ export const Sidebar = ({
44
44
 
45
45
  </button>
46
46
  )}
47
- {/* This should have the same width as the input area */}
48
- <div className="space-y-2 mb-6 ">
49
- <p className="w-full bg-white p-2 rounded">
50
- If you're satisfied, type "OK" in the chat.
51
- </p>
52
- <p className="w-full bg-white p-2 rounded">
53
- If not, use the chat to give more context.
54
- </p>
55
- </div>
56
47
 
57
- <div className="space-y-2 pb-32 h-[70%] overflow-y-auto scrollbar-hide">
48
+ <div className="space-y-2 pb-32 h-[85%] overflow-y-auto scrollbar-hide">
58
49
  {messages.map((message, index) => (
59
50
  <Message
60
51
  key={index}
@@ -23,7 +23,20 @@ import { ContentIndex } from "./ContentIndex"
23
23
  import { Sidebar } from "./Sidebar"
24
24
 
25
25
  const SyllabusEditor: React.FC = () => {
26
- const [messages, setMessages] = useState<TMessage[]>([])
26
+ const [messages, setMessages] = useState<TMessage[]>([
27
+ {
28
+ type: "assistant",
29
+ content: "If you're satisfied, type 'OK' in the chat.",
30
+ },
31
+ {
32
+ type: "assistant",
33
+ content: "If not, use the chat to give more context.",
34
+ },
35
+ {
36
+ type: "user",
37
+ content: "OK",
38
+ },
39
+ ])
27
40
  const [isGenerating, setIsGenerating] = useState(false)
28
41
  const prevLessons = useRef<Lesson[]>([])
29
42
  const { syllabus, setSyllabus, auth } = useStore(
@@ -105,7 +118,7 @@ const SyllabusEditor: React.FC = () => {
105
118
  return isGenerating ? (
106
119
  <Loader
107
120
  listeningTo="course-generation"
108
- icon={<img src={"rigo-float.gif"} alt="rigo" className="w-20 h-20" />}
121
+ icon={<img src={"creator/rigo-float.gif"} alt="rigo" className="w-20 h-20" />}
109
122
  initialBuffer="🚀 Starting course generation..."
110
123
  text="Learnpack is setting up your tutorial.
111
124
  It may take a moment..."
@@ -5,7 +5,6 @@ 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
-
9
8
  createRoot(document.getElementById("root")!).render(
10
9
  <StrictMode>
11
10
  <Toaster />
@@ -18,6 +18,7 @@ type Auth = {
18
18
  bcToken: string
19
19
  rigoToken: string
20
20
  userId: string
21
+ user: any
21
22
  }
22
23
  export type Syllabus = {
23
24
  lessons: Lesson[]
@@ -50,6 +51,7 @@ const useStore = create<Store>()(
50
51
  bcToken: "",
51
52
  rigoToken: "",
52
53
  userId: "",
54
+ user: null,
53
55
  },
54
56
  formState: {
55
57
  description: "",