@learnpack/learnpack 5.0.75 → 5.0.79
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.
- package/README.md +13 -13
- package/lib/creatorDist/assets/{index-CKBeex0S.js → index-WzdhAujs.js} +43 -43
- package/lib/creatorDist/index.html +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/src/creator/src/App.tsx +1 -1
- package/src/creator/src/components/Message.tsx +1 -1
- package/src/creator/src/components/syllabus/SyllabusEditor.tsx +17 -5
- package/src/creator/src/utils/lib.ts +8 -3
- package/src/creatorDist/assets/{index-CKBeex0S.js → index-WzdhAujs.js} +43 -43
- package/src/creatorDist/index.html +1 -1
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.
|
24
|
+
@learnpack/learnpack/5.0.79 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.
|
83
|
+
_See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.79/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.
|
98
|
+
_See code: [src\commands\breakToken.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.79/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.
|
113
|
+
_See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.79/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.
|
131
|
+
_See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.79/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.
|
163
|
+
_See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.79/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.
|
181
|
+
_See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.79/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.
|
199
|
+
_See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.79/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.
|
331
|
+
_See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.79/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.
|
348
|
+
_See code: [src\commands\serve.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.79/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.
|
370
|
+
_See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.79/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.
|
387
|
+
_See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.79/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.
|
401
|
+
_See code: [src\commands\translate.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.79/src\commands\translate.ts)_
|
402
402
|
<!-- commandsstop -->
|
403
403
|
|
404
404
|
> > > > > > > 0cb3e56d84c197f9d008836bb573eade212b7e57
|
@@ -22472,11 +22472,11 @@ const dV = (i) => {
|
|
22472
22472
|
t = await KT(i)
|
22473
22473
|
return { rigobot: { ...e }, ...t }
|
22474
22474
|
},
|
22475
|
-
pV = async (i) => {
|
22476
|
-
const
|
22477
|
-
if ((console.log("USER",
|
22478
|
-
const
|
22479
|
-
return
|
22475
|
+
pV = async (i, e) => {
|
22476
|
+
const t = await KT(i)
|
22477
|
+
if ((console.log("USER", t), !t)) return !1
|
22478
|
+
const n = await YT(i)
|
22479
|
+
return n ? (e(n.key), !0) : !1
|
22480
22480
|
}
|
22481
22481
|
function gV(i) {
|
22482
22482
|
const e = /!\[([^\]]*)]\(([^)]+)\)/g,
|
@@ -73861,7 +73861,7 @@ function NY() {
|
|
73861
73861
|
? ve.jsx(zT, {
|
73862
73862
|
text: "Learnpack is setting up your tutorial. It may take a moment...",
|
73863
73863
|
icon: ve.jsx("img", {
|
73864
|
-
src: "rigo-float.gif",
|
73864
|
+
src: "/rigo-float.gif",
|
73865
73865
|
alt: "rigo",
|
73866
73866
|
className: "w-20 h-20",
|
73867
73867
|
}),
|
@@ -81144,7 +81144,7 @@ const dte = (i, e) =>
|
|
81144
81144
|
r
|
81145
81145
|
? ve.jsx(yte, {
|
81146
81146
|
text: "Thinking...",
|
81147
|
-
svg: ve.jsx("img", { src: "rigo-float.gif" }),
|
81147
|
+
svg: ve.jsx("img", { src: "/rigo-float.gif" }),
|
81148
81148
|
})
|
81149
81149
|
: ve.jsxs("div", {
|
81150
81150
|
className: `flex items-start space-x-2 p-3 rounded-md border ${
|
@@ -81457,50 +81457,56 @@ const Dte = () => {
|
|
81457
81457
|
syllabus: h,
|
81458
81458
|
setSyllabus: d,
|
81459
81459
|
auth: p,
|
81460
|
+
setAuth: g,
|
81460
81461
|
} = Ca(
|
81461
|
-
qT((
|
81462
|
-
syllabus:
|
81463
|
-
setSyllabus:
|
81464
|
-
auth:
|
81462
|
+
qT((v) => ({
|
81463
|
+
syllabus: v.syllabus,
|
81464
|
+
setSyllabus: v.setSyllabus,
|
81465
|
+
auth: v.auth,
|
81466
|
+
setAuth: v.setAuth,
|
81465
81467
|
}))
|
81466
81468
|
),
|
81467
|
-
|
81469
|
+
b = async (v) => {
|
81468
81470
|
l(!0),
|
81469
81471
|
e([
|
81470
81472
|
...i,
|
81471
|
-
{ type: "user", content:
|
81473
|
+
{ type: "user", content: v },
|
81472
81474
|
{ type: "assistant", content: "" },
|
81473
81475
|
]),
|
81474
81476
|
(u.current = h.lessons)
|
81475
|
-
const
|
81477
|
+
const D = await r9({
|
81476
81478
|
courseInfo: JSON.stringify(h),
|
81477
81479
|
prevInteractions:
|
81478
|
-
i.map((
|
81480
|
+
i.map((A) => `${A.type}: ${A.content}`).join(`
|
81479
81481
|
`) +
|
81480
81482
|
`
|
81481
|
-
USER: ${
|
81483
|
+
USER: ${v}`,
|
81482
81484
|
}),
|
81483
|
-
|
81485
|
+
w = D.parsed.listOfSteps.map((A) => a9(A))
|
81484
81486
|
d({
|
81485
81487
|
...h,
|
81486
|
-
lessons:
|
81488
|
+
lessons: w,
|
81487
81489
|
courseInfo: {
|
81488
81490
|
...h.courseInfo,
|
81489
|
-
title:
|
81491
|
+
title: D.parsed.title || h.courseInfo.title,
|
81490
81492
|
},
|
81491
81493
|
}),
|
81492
|
-
e((
|
81493
|
-
const
|
81494
|
-
return (
|
81494
|
+
e((A) => {
|
81495
|
+
const T = [...A]
|
81496
|
+
return (T[T.length - 1].content = D.parsed.aiMessage), T
|
81495
81497
|
}),
|
81496
81498
|
l(!1)
|
81497
81499
|
},
|
81498
|
-
|
81500
|
+
x = async () => {
|
81499
81501
|
if (!p.bcToken || !p.rigoToken) {
|
81500
81502
|
a(!0)
|
81501
81503
|
return
|
81502
81504
|
}
|
81503
|
-
|
81505
|
+
let v = p.rigoToken
|
81506
|
+
const D = (M) => {
|
81507
|
+
g({ ...p, rigoToken: M }), (v = M)
|
81508
|
+
}
|
81509
|
+
if (!(await pV(p.bcToken, D))) {
|
81504
81510
|
a(!0)
|
81505
81511
|
return
|
81506
81512
|
}
|
@@ -81509,25 +81515,19 @@ USER: ${x}`,
|
|
81509
81515
|
return
|
81510
81516
|
}
|
81511
81517
|
n(!0)
|
81512
|
-
const
|
81513
|
-
|
81514
|
-
BY(
|
81515
|
-
p.rigoToken,
|
81516
|
-
h.lessons,
|
81517
|
-
JSON.stringify(h.courseInfo),
|
81518
|
-
R,
|
81519
|
-
D + "/exercises"
|
81520
|
-
)
|
81518
|
+
const T = "courses/" + vg(h.courseInfo.title || pT()),
|
81519
|
+
U = h.lessons.map((M) =>
|
81520
|
+
BY(v, h.lessons, JSON.stringify(h.courseInfo), M, T + "/exercises")
|
81521
81521
|
),
|
81522
|
-
|
81523
|
-
let
|
81524
|
-
for (const
|
81522
|
+
C = await Promise.all(U)
|
81523
|
+
let R = []
|
81524
|
+
for (const M of C) R = [...R, ...gV(M)]
|
81525
81525
|
Pl.emit("course-generation", { message: "📷 Generating images..." })
|
81526
|
-
const
|
81527
|
-
await Promise.all(
|
81528
|
-
const
|
81526
|
+
const F = R.map(async (M) => IY(T, M.url, M.alt, v))
|
81527
|
+
await Promise.all(F)
|
81528
|
+
const I = LY(h.courseInfo)
|
81529
81529
|
await s9(
|
81530
|
-
JSON.stringify(
|
81530
|
+
JSON.stringify(I),
|
81531
81531
|
"courses/" + vg(h.courseInfo.title || pT()) + "/learn.json"
|
81532
81532
|
),
|
81533
81533
|
n(!1),
|
@@ -81539,7 +81539,7 @@ USER: ${x}`,
|
|
81539
81539
|
? ve.jsx(zT, {
|
81540
81540
|
listeningTo: "course-generation",
|
81541
81541
|
icon: ve.jsx("img", {
|
81542
|
-
src: "rigo-float.gif",
|
81542
|
+
src: "creator/rigo-float.gif",
|
81543
81543
|
alt: "rigo",
|
81544
81544
|
className: "w-20 h-20",
|
81545
81545
|
}),
|
@@ -81558,12 +81558,12 @@ It may take a moment...`,
|
|
81558
81558
|
},
|
81559
81559
|
}),
|
81560
81560
|
ve.jsx(PY, {}),
|
81561
|
-
ve.jsx(vte, { messages: i, sendPrompt:
|
81561
|
+
ve.jsx(vte, { messages: i, sendPrompt: b, handleSubmit: x }),
|
81562
81562
|
ve.jsx("div", {
|
81563
81563
|
className: "w-full p-8 space-y-6",
|
81564
81564
|
children: ve.jsx(mte, {
|
81565
81565
|
prevLessons: u.current,
|
81566
|
-
handleSubmit:
|
81566
|
+
handleSubmit: x,
|
81567
81567
|
messages: i,
|
81568
81568
|
isThinking: o,
|
81569
81569
|
}),
|
@@ -10,7 +10,7 @@
|
|
10
10
|
/>
|
11
11
|
|
12
12
|
<title>Learnpack Creator: Craft tutorials in seconds!</title>
|
13
|
-
<script type="module" crossorigin src="/creator/assets/index-
|
13
|
+
<script type="module" crossorigin src="/creator/assets/index-WzdhAujs.js"></script>
|
14
14
|
<link rel="stylesheet" crossorigin href="/creator/assets/index-BJ2JJzVC.css">
|
15
15
|
</head>
|
16
16
|
<body>
|
package/oclif.manifest.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":"5.0.
|
1
|
+
{"version":"5.0.79","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.
|
4
|
+
"version": "5.0.79",
|
5
5
|
"author": "Alejandro Sanchez @alesanchezr",
|
6
6
|
"contributors": [
|
7
7
|
{
|
package/src/creator/src/App.tsx
CHANGED
@@ -16,7 +16,7 @@ export const Message: React.FC<TMessage> = ({ type, content }) => {
|
|
16
16
|
|
17
17
|
console.log("user", user)
|
18
18
|
return isLoading ? (
|
19
|
-
<RigoLoader text="Thinking..." svg={<img src="rigo-float.gif" />} />
|
19
|
+
<RigoLoader text="Thinking..." svg={<img src="/rigo-float.gif" />} />
|
20
20
|
) : (
|
21
21
|
<div
|
22
22
|
className={`flex items-start space-x-2 p-3 rounded-md border ${
|
@@ -44,11 +44,12 @@ const SyllabusEditor: React.FC = () => {
|
|
44
44
|
const [isThinking, setIsThinking] = useState(false)
|
45
45
|
|
46
46
|
const prevLessons = useRef<Lesson[]>([])
|
47
|
-
const { syllabus, setSyllabus, auth } = useStore(
|
47
|
+
const { syllabus, setSyllabus, auth, setAuth } = useStore(
|
48
48
|
useShallow((state) => ({
|
49
49
|
syllabus: state.syllabus,
|
50
50
|
setSyllabus: state.setSyllabus,
|
51
51
|
auth: state.auth,
|
52
|
+
setAuth: state.setAuth,
|
52
53
|
}))
|
53
54
|
)
|
54
55
|
|
@@ -93,7 +94,16 @@ const SyllabusEditor: React.FC = () => {
|
|
93
94
|
setShowLoginModal(true)
|
94
95
|
return
|
95
96
|
}
|
96
|
-
|
97
|
+
|
98
|
+
let tokenToUse = auth.rigoToken
|
99
|
+
const onValidRigoToken = (rigotoken: string) => {
|
100
|
+
setAuth({
|
101
|
+
...auth,
|
102
|
+
rigoToken: rigotoken,
|
103
|
+
})
|
104
|
+
tokenToUse = rigotoken
|
105
|
+
}
|
106
|
+
const isValid = await validateTokens(auth.bcToken, onValidRigoToken)
|
97
107
|
if (!isValid) {
|
98
108
|
setShowLoginModal(true)
|
99
109
|
return
|
@@ -109,7 +119,7 @@ const SyllabusEditor: React.FC = () => {
|
|
109
119
|
"courses/" + slugify(syllabus.courseInfo.title || randomUUID())
|
110
120
|
const lessonsPromises = syllabus.lessons.map((lesson) =>
|
111
121
|
processExercise(
|
112
|
-
|
122
|
+
tokenToUse,
|
113
123
|
syllabus.lessons,
|
114
124
|
JSON.stringify(syllabus.courseInfo),
|
115
125
|
lesson,
|
@@ -130,7 +140,7 @@ const SyllabusEditor: React.FC = () => {
|
|
130
140
|
|
131
141
|
const imagePromises = imagesArray.map(
|
132
142
|
async (image: { alt: string; url: string }) => {
|
133
|
-
return processImage(tutorialDir, image.url, image.alt,
|
143
|
+
return processImage(tutorialDir, image.url, image.alt, tokenToUse)
|
134
144
|
}
|
135
145
|
)
|
136
146
|
await Promise.all(imagePromises)
|
@@ -152,7 +162,9 @@ const SyllabusEditor: React.FC = () => {
|
|
152
162
|
return isGenerating ? (
|
153
163
|
<Loader
|
154
164
|
listeningTo="course-generation"
|
155
|
-
icon={
|
165
|
+
icon={
|
166
|
+
<img src={"creator/rigo-float.gif"} alt="rigo" className="w-20 h-20" />
|
167
|
+
}
|
156
168
|
initialBuffer="🚀 Starting course generation..."
|
157
169
|
text="Learnpack is setting up your tutorial.
|
158
170
|
It may take a moment..."
|
@@ -206,7 +206,10 @@ export const loginWithToken = async (token: string) => {
|
|
206
206
|
return returns
|
207
207
|
}
|
208
208
|
|
209
|
-
export const validateTokens = async (
|
209
|
+
export const validateTokens = async (
|
210
|
+
breathecodeToken: string,
|
211
|
+
onValidRigoToken: (token: string) => void
|
212
|
+
) => {
|
210
213
|
const user = await validateUser(breathecodeToken)
|
211
214
|
console.log("USER", user)
|
212
215
|
if (!user) {
|
@@ -214,8 +217,10 @@ export const validateTokens = async (breathecodeToken: string) => {
|
|
214
217
|
}
|
215
218
|
|
216
219
|
const rigobotJson = await getRigobotJSON(breathecodeToken)
|
217
|
-
|
218
|
-
|
220
|
+
if (!rigobotJson) {
|
221
|
+
return false
|
222
|
+
}
|
223
|
+
onValidRigoToken(rigobotJson.key)
|
219
224
|
return true
|
220
225
|
}
|
221
226
|
|
@@ -22472,11 +22472,11 @@ const dV = (i) => {
|
|
22472
22472
|
t = await KT(i)
|
22473
22473
|
return { rigobot: { ...e }, ...t }
|
22474
22474
|
},
|
22475
|
-
pV = async (i) => {
|
22476
|
-
const
|
22477
|
-
if ((console.log("USER",
|
22478
|
-
const
|
22479
|
-
return
|
22475
|
+
pV = async (i, e) => {
|
22476
|
+
const t = await KT(i)
|
22477
|
+
if ((console.log("USER", t), !t)) return !1
|
22478
|
+
const n = await YT(i)
|
22479
|
+
return n ? (e(n.key), !0) : !1
|
22480
22480
|
}
|
22481
22481
|
function gV(i) {
|
22482
22482
|
const e = /!\[([^\]]*)]\(([^)]+)\)/g,
|
@@ -73861,7 +73861,7 @@ function NY() {
|
|
73861
73861
|
? ve.jsx(zT, {
|
73862
73862
|
text: "Learnpack is setting up your tutorial. It may take a moment...",
|
73863
73863
|
icon: ve.jsx("img", {
|
73864
|
-
src: "rigo-float.gif",
|
73864
|
+
src: "/rigo-float.gif",
|
73865
73865
|
alt: "rigo",
|
73866
73866
|
className: "w-20 h-20",
|
73867
73867
|
}),
|
@@ -81144,7 +81144,7 @@ const dte = (i, e) =>
|
|
81144
81144
|
r
|
81145
81145
|
? ve.jsx(yte, {
|
81146
81146
|
text: "Thinking...",
|
81147
|
-
svg: ve.jsx("img", { src: "rigo-float.gif" }),
|
81147
|
+
svg: ve.jsx("img", { src: "/rigo-float.gif" }),
|
81148
81148
|
})
|
81149
81149
|
: ve.jsxs("div", {
|
81150
81150
|
className: `flex items-start space-x-2 p-3 rounded-md border ${
|
@@ -81457,50 +81457,56 @@ const Dte = () => {
|
|
81457
81457
|
syllabus: h,
|
81458
81458
|
setSyllabus: d,
|
81459
81459
|
auth: p,
|
81460
|
+
setAuth: g,
|
81460
81461
|
} = Ca(
|
81461
|
-
qT((
|
81462
|
-
syllabus:
|
81463
|
-
setSyllabus:
|
81464
|
-
auth:
|
81462
|
+
qT((v) => ({
|
81463
|
+
syllabus: v.syllabus,
|
81464
|
+
setSyllabus: v.setSyllabus,
|
81465
|
+
auth: v.auth,
|
81466
|
+
setAuth: v.setAuth,
|
81465
81467
|
}))
|
81466
81468
|
),
|
81467
|
-
|
81469
|
+
b = async (v) => {
|
81468
81470
|
l(!0),
|
81469
81471
|
e([
|
81470
81472
|
...i,
|
81471
|
-
{ type: "user", content:
|
81473
|
+
{ type: "user", content: v },
|
81472
81474
|
{ type: "assistant", content: "" },
|
81473
81475
|
]),
|
81474
81476
|
(u.current = h.lessons)
|
81475
|
-
const
|
81477
|
+
const D = await r9({
|
81476
81478
|
courseInfo: JSON.stringify(h),
|
81477
81479
|
prevInteractions:
|
81478
|
-
i.map((
|
81480
|
+
i.map((A) => `${A.type}: ${A.content}`).join(`
|
81479
81481
|
`) +
|
81480
81482
|
`
|
81481
|
-
USER: ${
|
81483
|
+
USER: ${v}`,
|
81482
81484
|
}),
|
81483
|
-
|
81485
|
+
w = D.parsed.listOfSteps.map((A) => a9(A))
|
81484
81486
|
d({
|
81485
81487
|
...h,
|
81486
|
-
lessons:
|
81488
|
+
lessons: w,
|
81487
81489
|
courseInfo: {
|
81488
81490
|
...h.courseInfo,
|
81489
|
-
title:
|
81491
|
+
title: D.parsed.title || h.courseInfo.title,
|
81490
81492
|
},
|
81491
81493
|
}),
|
81492
|
-
e((
|
81493
|
-
const
|
81494
|
-
return (
|
81494
|
+
e((A) => {
|
81495
|
+
const T = [...A]
|
81496
|
+
return (T[T.length - 1].content = D.parsed.aiMessage), T
|
81495
81497
|
}),
|
81496
81498
|
l(!1)
|
81497
81499
|
},
|
81498
|
-
|
81500
|
+
x = async () => {
|
81499
81501
|
if (!p.bcToken || !p.rigoToken) {
|
81500
81502
|
a(!0)
|
81501
81503
|
return
|
81502
81504
|
}
|
81503
|
-
|
81505
|
+
let v = p.rigoToken
|
81506
|
+
const D = (M) => {
|
81507
|
+
g({ ...p, rigoToken: M }), (v = M)
|
81508
|
+
}
|
81509
|
+
if (!(await pV(p.bcToken, D))) {
|
81504
81510
|
a(!0)
|
81505
81511
|
return
|
81506
81512
|
}
|
@@ -81509,25 +81515,19 @@ USER: ${x}`,
|
|
81509
81515
|
return
|
81510
81516
|
}
|
81511
81517
|
n(!0)
|
81512
|
-
const
|
81513
|
-
|
81514
|
-
BY(
|
81515
|
-
p.rigoToken,
|
81516
|
-
h.lessons,
|
81517
|
-
JSON.stringify(h.courseInfo),
|
81518
|
-
R,
|
81519
|
-
D + "/exercises"
|
81520
|
-
)
|
81518
|
+
const T = "courses/" + vg(h.courseInfo.title || pT()),
|
81519
|
+
U = h.lessons.map((M) =>
|
81520
|
+
BY(v, h.lessons, JSON.stringify(h.courseInfo), M, T + "/exercises")
|
81521
81521
|
),
|
81522
|
-
|
81523
|
-
let
|
81524
|
-
for (const
|
81522
|
+
C = await Promise.all(U)
|
81523
|
+
let R = []
|
81524
|
+
for (const M of C) R = [...R, ...gV(M)]
|
81525
81525
|
Pl.emit("course-generation", { message: "📷 Generating images..." })
|
81526
|
-
const
|
81527
|
-
await Promise.all(
|
81528
|
-
const
|
81526
|
+
const F = R.map(async (M) => IY(T, M.url, M.alt, v))
|
81527
|
+
await Promise.all(F)
|
81528
|
+
const I = LY(h.courseInfo)
|
81529
81529
|
await s9(
|
81530
|
-
JSON.stringify(
|
81530
|
+
JSON.stringify(I),
|
81531
81531
|
"courses/" + vg(h.courseInfo.title || pT()) + "/learn.json"
|
81532
81532
|
),
|
81533
81533
|
n(!1),
|
@@ -81539,7 +81539,7 @@ USER: ${x}`,
|
|
81539
81539
|
? ve.jsx(zT, {
|
81540
81540
|
listeningTo: "course-generation",
|
81541
81541
|
icon: ve.jsx("img", {
|
81542
|
-
src: "rigo-float.gif",
|
81542
|
+
src: "creator/rigo-float.gif",
|
81543
81543
|
alt: "rigo",
|
81544
81544
|
className: "w-20 h-20",
|
81545
81545
|
}),
|
@@ -81558,12 +81558,12 @@ It may take a moment...`,
|
|
81558
81558
|
},
|
81559
81559
|
}),
|
81560
81560
|
ve.jsx(PY, {}),
|
81561
|
-
ve.jsx(vte, { messages: i, sendPrompt:
|
81561
|
+
ve.jsx(vte, { messages: i, sendPrompt: b, handleSubmit: x }),
|
81562
81562
|
ve.jsx("div", {
|
81563
81563
|
className: "w-full p-8 space-y-6",
|
81564
81564
|
children: ve.jsx(mte, {
|
81565
81565
|
prevLessons: u.current,
|
81566
|
-
handleSubmit:
|
81566
|
+
handleSubmit: x,
|
81567
81567
|
messages: i,
|
81568
81568
|
isThinking: o,
|
81569
81569
|
}),
|
@@ -10,7 +10,7 @@
|
|
10
10
|
/>
|
11
11
|
|
12
12
|
<title>Learnpack Creator: Craft tutorials in seconds!</title>
|
13
|
-
<script type="module" crossorigin src="/creator/assets/index-
|
13
|
+
<script type="module" crossorigin src="/creator/assets/index-WzdhAujs.js"></script>
|
14
14
|
<link rel="stylesheet" crossorigin href="/creator/assets/index-BJ2JJzVC.css">
|
15
15
|
</head>
|
16
16
|
<body>
|