@learnpack/learnpack 5.0.240 → 5.0.244
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/lib/commands/publish.d.ts +1 -1
- package/lib/commands/publish.js +19 -14
- package/lib/commands/serve.js +91 -98
- package/lib/creatorDist/assets/{index-DJn8b8wj.js → index-BWHp9KF3.js} +3043 -3038
- package/lib/creatorDist/index.html +1 -1
- package/lib/models/creator.d.ts +1 -0
- package/lib/utils/api.d.ts +1 -0
- package/lib/utils/creatorSocket.d.ts +1 -1
- package/lib/utils/creatorSocket.js +10 -3
- package/lib/utils/rigoActions.d.ts +5 -0
- package/lib/utils/rigoActions.js +11 -1
- package/package.json +1 -1
- package/src/commands/publish.ts +26 -24
- package/src/commands/serve.ts +164 -137
- package/src/creator/src/App.tsx +3 -1
- package/src/creator/src/components/NotificationListener.tsx +1 -1
- package/src/creator/src/components/syllabus/SyllabusEditor.tsx +11 -13
- package/src/creator/src/utils/store.ts +4 -1
- package/src/creatorDist/assets/{index-DJn8b8wj.js → index-BWHp9KF3.js} +3043 -3038
- package/src/creatorDist/index.html +1 -1
- package/src/models/creator.ts +1 -0
- package/src/ui/_app/app.js +189 -189
- package/src/ui/app.tar.gz +0 -0
- package/src/utils/api.ts +1 -0
- package/src/utils/creatorSocket.ts +22 -16
- package/src/utils/rigoActions.ts +22 -0
@@ -13,7 +13,6 @@ import {
|
|
13
13
|
// reWriteTitle,
|
14
14
|
useConsumableCall,
|
15
15
|
isValidRigoToken,
|
16
|
-
fixTitleLength,
|
17
16
|
} from "../../utils/lib"
|
18
17
|
|
19
18
|
import Loader from "../Loader"
|
@@ -96,25 +95,23 @@ const SyllabusEditor: React.FC = () => {
|
|
96
95
|
return
|
97
96
|
}
|
98
97
|
|
99
|
-
let
|
100
|
-
let
|
101
|
-
let isAvailable = await isSlugAvailable(slug)
|
98
|
+
let newSlug = syllabus.courseInfo.slug
|
99
|
+
let isAvailable = await isSlugAvailable(syllabus.courseInfo.slug)
|
102
100
|
|
103
101
|
while (!isAvailable) {
|
104
|
-
if (
|
105
|
-
|
102
|
+
if (newSlug.length > 50) {
|
103
|
+
newSlug = newSlug.slice(0, 44)
|
106
104
|
}
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
isAvailable = await isSlugAvailable(slug)
|
105
|
+
newSlug = newSlug + "-" + randomUUID()
|
106
|
+
newSlug = newSlug.slice(0, 50)
|
107
|
+
isAvailable = await isSlugAvailable(newSlug)
|
111
108
|
}
|
112
109
|
|
113
110
|
push({
|
114
111
|
...syllabus,
|
115
112
|
courseInfo: {
|
116
113
|
...syllabus.courseInfo,
|
117
|
-
|
114
|
+
slug: newSlug,
|
118
115
|
},
|
119
116
|
})
|
120
117
|
}
|
@@ -230,6 +227,8 @@ const SyllabusEditor: React.FC = () => {
|
|
230
227
|
|
231
228
|
if (!syllabus) return null
|
232
229
|
|
230
|
+
console.log(syllabus.courseInfo)
|
231
|
+
|
233
232
|
return isGenerating ? (
|
234
233
|
<>
|
235
234
|
<Loader
|
@@ -253,8 +252,7 @@ It may take a moment..."
|
|
253
252
|
lessons: lessons,
|
254
253
|
courseInfo: {
|
255
254
|
...syllabus.courseInfo,
|
256
|
-
title:
|
257
|
-
fixTitleLength(res.parsed.title) || syllabus.courseInfo.title,
|
255
|
+
title: res.parsed.title || syllabus.courseInfo.title,
|
258
256
|
description:
|
259
257
|
res.parsed.description || syllabus.courseInfo.description,
|
260
258
|
language:
|
@@ -11,6 +11,7 @@ export type FormState = {
|
|
11
11
|
hasContentIndex: boolean
|
12
12
|
contentIndex: string
|
13
13
|
purpose: string
|
14
|
+
slug: string
|
14
15
|
language?: string
|
15
16
|
isCompleted: boolean
|
16
17
|
variables: string[]
|
@@ -85,6 +86,7 @@ const useStore = create<Store>()(
|
|
85
86
|
formState: {
|
86
87
|
description: "",
|
87
88
|
duration: 0,
|
89
|
+
slug: "",
|
88
90
|
hasContentIndex: false,
|
89
91
|
contentIndex: "",
|
90
92
|
purpose: "",
|
@@ -119,6 +121,7 @@ const useStore = create<Store>()(
|
|
119
121
|
resetFormState: () =>
|
120
122
|
set({
|
121
123
|
formState: {
|
124
|
+
slug: "",
|
122
125
|
currentStep: "description",
|
123
126
|
description: "",
|
124
127
|
duration: 0,
|
@@ -169,7 +172,7 @@ const useStore = create<Store>()(
|
|
169
172
|
formState: {
|
170
173
|
description: "",
|
171
174
|
duration: 0,
|
172
|
-
|
175
|
+
slug: "",
|
173
176
|
language: "en",
|
174
177
|
technologies: [],
|
175
178
|
hasContentIndex: false,
|