@learnpack/learnpack 5.0.136 → 5.0.138
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-nI-XBrtB.js → index-CP499pZ0.js} +6135 -6126
- package/lib/creatorDist/assets/{index-1sKQbOKY.css → index-DNwoj0BB.css} +15 -9
- package/lib/creatorDist/index.html +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/src/creator/src/App.tsx +3 -1
- package/src/creator/src/components/StepWizard.tsx +6 -0
- package/src/creator/src/components/syllabus/ContentIndex.tsx +33 -20
- package/src/creatorDist/assets/{index-nI-XBrtB.js → index-CP499pZ0.js} +6135 -6126
- package/src/creatorDist/assets/{index-1sKQbOKY.css → index-DNwoj0BB.css} +15 -9
- package/src/creatorDist/index.html +2 -2
- package/src/ui/_app/app.css +1 -1
- package/src/ui/_app/app.js +286 -286
- package/src/ui/app.tar.gz +0 -0
@@ -90,10 +90,10 @@
|
|
90
90
|
--text-xs--line-height: calc(1 / 0.75);
|
91
91
|
--text-sm: 0.875rem;
|
92
92
|
--text-sm--line-height: calc(1.25 / 0.875);
|
93
|
-
--text-base: 1rem;
|
94
|
-
--text-base--line-height: 1.5;
|
95
93
|
--text-lg: 1.125rem;
|
96
94
|
--text-lg--line-height: calc(1.75 / 1.125);
|
95
|
+
--text-xl: 1.25rem;
|
96
|
+
--text-xl--line-height: calc(1.75 / 1.25);
|
97
97
|
--text-2xl: 1.5rem;
|
98
98
|
--text-2xl--line-height: calc(2 / 1.5);
|
99
99
|
--text-4xl: 2.25rem;
|
@@ -1169,13 +1169,9 @@
|
|
1169
1169
|
.sm\:p-4 {
|
1170
1170
|
padding: calc(var(--spacing) * 4);
|
1171
1171
|
}
|
1172
|
-
.sm\:text-
|
1173
|
-
font-size: var(--text-
|
1174
|
-
line-height: var(--tw-leading, var(--text-
|
1175
|
-
}
|
1176
|
-
.sm\:text-sm {
|
1177
|
-
font-size: var(--text-sm);
|
1178
|
-
line-height: var(--tw-leading, var(--text-sm--line-height));
|
1172
|
+
.sm\:text-lg {
|
1173
|
+
font-size: var(--text-lg);
|
1174
|
+
line-height: var(--tw-leading, var(--text-lg--line-height));
|
1179
1175
|
}
|
1180
1176
|
}
|
1181
1177
|
@media (min-width: 48rem) {
|
@@ -1189,6 +1185,10 @@
|
|
1189
1185
|
font-size: var(--text-lg);
|
1190
1186
|
line-height: var(--tw-leading, var(--text-lg--line-height));
|
1191
1187
|
}
|
1188
|
+
.md\:text-xl {
|
1189
|
+
font-size: var(--text-xl);
|
1190
|
+
line-height: var(--tw-leading, var(--text-xl--line-height));
|
1191
|
+
}
|
1192
1192
|
}
|
1193
1193
|
@media (min-width: 64rem) {
|
1194
1194
|
.lg\:relative {
|
@@ -1211,6 +1211,12 @@
|
|
1211
1211
|
padding: calc(var(--spacing) * 8);
|
1212
1212
|
}
|
1213
1213
|
}
|
1214
|
+
@media (min-width: 80rem) {
|
1215
|
+
.xl\:text-2xl {
|
1216
|
+
font-size: var(--text-2xl);
|
1217
|
+
line-height: var(--tw-leading, var(--text-2xl--line-height));
|
1218
|
+
}
|
1219
|
+
}
|
1214
1220
|
}
|
1215
1221
|
:root {
|
1216
1222
|
color-scheme: light dark;
|
@@ -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-
|
14
|
-
<link rel="stylesheet" crossorigin href="/creator/assets/index-
|
13
|
+
<script type="module" crossorigin src="/creator/assets/index-CP499pZ0.js"></script>
|
14
|
+
<link rel="stylesheet" crossorigin href="/creator/assets/index-DNwoj0BB.css">
|
15
15
|
</head>
|
16
16
|
<body>
|
17
17
|
<div id="root"></div>
|
package/oclif.manifest.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":"5.0.
|
1
|
+
{"version":"5.0.138","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.138",
|
5
5
|
"author": "Alejandro Sanchez @alesanchezr",
|
6
6
|
"contributors": [
|
7
7
|
{
|
package/src/creator/src/App.tsx
CHANGED
@@ -100,9 +100,11 @@ function App() {
|
|
100
100
|
{
|
101
101
|
title: "What do you want to learn?",
|
102
102
|
slug: "description",
|
103
|
-
isCompleted:
|
103
|
+
isCompleted: formState.description.length > 0,
|
104
|
+
required: true,
|
104
105
|
content: (
|
105
106
|
<textarea
|
107
|
+
required
|
106
108
|
placeholder="Describe your course"
|
107
109
|
className="w-full h-24 border-2 border-gray-300 rounded-md p-2 bg-white"
|
108
110
|
value={formState.description}
|
@@ -1,9 +1,11 @@
|
|
1
1
|
import React from "react"
|
2
2
|
import { SVGS } from "../assets/svgs"
|
3
|
+
import { toast } from "react-hot-toast"
|
3
4
|
|
4
5
|
export type Step = {
|
5
6
|
title: string
|
6
7
|
subtitle?: string
|
8
|
+
required?: boolean
|
7
9
|
helpText?: string
|
8
10
|
content: React.ReactNode
|
9
11
|
slug: string
|
@@ -29,6 +31,10 @@ const StepWizard: React.FC<Props> = ({
|
|
29
31
|
|
30
32
|
const goNext = () => {
|
31
33
|
const index = steps.findIndex((step) => step.slug === currentStep)
|
34
|
+
if (steps[index].required && !formState[steps[index].slug]) {
|
35
|
+
toast.error("Please fill out all required fields!")
|
36
|
+
return
|
37
|
+
}
|
32
38
|
if (index < totalSteps - 1)
|
33
39
|
setFormState({
|
34
40
|
...formState,
|
@@ -24,12 +24,6 @@ const ContentIndexHeader = ({
|
|
24
24
|
? `I've created a detailed structure for your course: ${syllabus.courseInfo.title}`
|
25
25
|
: "I've updated the structure based on your feedback."
|
26
26
|
|
27
|
-
const subText = isFirst
|
28
|
-
? `It includes a mix of reading, coding exercises, and quizzes. Give
|
29
|
-
it a look and let me know if it aligns with your expectations or if
|
30
|
-
there are any changes you'd like to make.`
|
31
|
-
: "Based on your input, here is the new syllabus, updates are highlighted in yellow"
|
32
|
-
|
33
27
|
return (
|
34
28
|
<div className="mt-2 ">
|
35
29
|
<AnimatePresence mode="wait">
|
@@ -39,27 +33,45 @@ const ContentIndexHeader = ({
|
|
39
33
|
animate={{ opacity: 1, y: 0 }}
|
40
34
|
exit={{ opacity: 0, y: 10 }}
|
41
35
|
transition={{ duration: 0.2 }}
|
42
|
-
className="text-
|
36
|
+
className="text-lg font-semibold sm:text-lg md:text-xl xl:text-2xl"
|
43
37
|
>
|
44
38
|
{headerText}
|
45
39
|
</motion.h2>
|
46
40
|
</AnimatePresence>
|
47
|
-
|
48
|
-
<AnimatePresence mode="wait">
|
49
|
-
<motion.p
|
50
|
-
key={subText}
|
51
|
-
initial={{ opacity: 0 }}
|
52
|
-
animate={{ opacity: 1 }}
|
53
|
-
exit={{ opacity: 0 }}
|
54
|
-
transition={{ duration: 0.2, delay: 0.1 }}
|
55
|
-
className="text-xs sm:text-sm text-gray-600 mt-1 mb-5"
|
56
|
-
>
|
57
|
-
{subText}
|
58
|
-
</motion.p>
|
59
|
-
</AnimatePresence>
|
60
41
|
</div>
|
61
42
|
)
|
62
43
|
}
|
44
|
+
const ContentSecondaryHeader = ({
|
45
|
+
messages,
|
46
|
+
}: // syllabus,
|
47
|
+
{
|
48
|
+
messages: TMessage[]
|
49
|
+
}) => {
|
50
|
+
const isFirst =
|
51
|
+
messages.filter((m) => m.type === "assistant" && m.content.length > 0)
|
52
|
+
.length === 2
|
53
|
+
|
54
|
+
const subText = isFirst
|
55
|
+
? `It includes a mix of reading, coding exercises, and quizzes. Give
|
56
|
+
it a look and let me know if it aligns with your expectations or if
|
57
|
+
there are any changes you'd like to make.`
|
58
|
+
: "Based on your input, here is the new syllabus, updates are highlighted in yellow"
|
59
|
+
|
60
|
+
return (
|
61
|
+
<AnimatePresence mode="wait">
|
62
|
+
<motion.p
|
63
|
+
key={subText}
|
64
|
+
initial={{ opacity: 0 }}
|
65
|
+
animate={{ opacity: 1 }}
|
66
|
+
exit={{ opacity: 0 }}
|
67
|
+
transition={{ duration: 0.2, delay: 0.1 }}
|
68
|
+
className="text-sm sm:text-md md:text-lg text-gray-600 mb-5"
|
69
|
+
>
|
70
|
+
{subText}
|
71
|
+
</motion.p>
|
72
|
+
</AnimatePresence>
|
73
|
+
)
|
74
|
+
}
|
63
75
|
|
64
76
|
export const GenerateButton = ({
|
65
77
|
handleSubmit,
|
@@ -190,6 +202,7 @@ export const ContentIndex = ({
|
|
190
202
|
<Loader text="Thinking..." minheight="min-h-[69vh]" />
|
191
203
|
) : (
|
192
204
|
<>
|
205
|
+
<ContentSecondaryHeader messages={messages} />
|
193
206
|
{syllabus.lessons.map((lesson, index) => (
|
194
207
|
<div key={lesson.uid + index}>
|
195
208
|
<LessonItem
|