@dataclouder/ngx-lessons 0.0.34 → 0.0.35
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/fesm2022/dataclouder-ngx-lessons.mjs +323 -224
- package/fesm2022/dataclouder-ngx-lessons.mjs.map +1 -1
- package/lib/components/dc-lessons/dc-lesson-card/dc-lesson-card.component.d.ts +2 -1
- package/lib/components/dc-lessons/dc-lesson-editor/dc-lesson-editor.component.d.ts +9 -0
- package/lib/components/dc-lessons/dc-lesson-metadata-editor/dc-lesson-metadata-editor.component.d.ts +4 -7
- package/lib/components/lesson-mini-components/components/lessons.clases.d.ts +18 -0
- package/lib/models/prompts.d.ts +6 -0
- package/lib/models/simple-agents.d.ts +1 -1
- package/lib/services/default-lessons.service.d.ts +3 -1
- package/lib/services/lesson-utils.service.d.ts +1 -0
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ declare enum EventCard {
|
|
|
12
12
|
export declare class DcLessonCardComponent implements OnInit {
|
|
13
13
|
lesson: ILessonWithTaken | ILesson | any;
|
|
14
14
|
showOptions: boolean;
|
|
15
|
+
cardHeight: string;
|
|
15
16
|
onAction: EventEmitter<OnActionEvent>;
|
|
16
17
|
coverUrl: string;
|
|
17
18
|
eventType: typeof EventCard;
|
|
@@ -19,6 +20,6 @@ export declare class DcLessonCardComponent implements OnInit {
|
|
|
19
20
|
ngOnInit(): void;
|
|
20
21
|
eventCard(eventType: EventCard): void;
|
|
21
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<DcLessonCardComponent, never>;
|
|
22
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DcLessonCardComponent, "dc-lesson-card", never, { "lesson": { "alias": "lesson"; "required": false; }; "showOptions": { "alias": "showOptions"; "required": false; }; }, { "onAction": "onAction"; }, never, never, true, never>;
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DcLessonCardComponent, "dc-lesson-card", never, { "lesson": { "alias": "lesson"; "required": false; }; "showOptions": { "alias": "showOptions"; "required": false; }; "cardHeight": { "alias": "cardHeight"; "required": false; }; }, { "onAction": "onAction"; }, never, never, true, never>;
|
|
23
24
|
}
|
|
24
25
|
export {};
|
|
@@ -6,6 +6,11 @@ import { ComponentBuildData } from '../../lesson-mini-components/components/Comp
|
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare class DCLessonEditorComponent {
|
|
8
8
|
#private;
|
|
9
|
+
private defaultLessonsService;
|
|
10
|
+
private promptService;
|
|
11
|
+
private agentChatService;
|
|
12
|
+
private ngxVertexService;
|
|
13
|
+
private cdr;
|
|
9
14
|
target: ViewContainerRef;
|
|
10
15
|
dhtml: ElementRef;
|
|
11
16
|
readonly lessonId: import("@angular/core").Signal<string>;
|
|
@@ -52,6 +57,10 @@ export declare class DCLessonEditorComponent {
|
|
|
52
57
|
*/
|
|
53
58
|
improveNotionWithAI(): Promise<void>;
|
|
54
59
|
showComponentDetails(data: any): void;
|
|
60
|
+
generateBanner(): Promise<void>;
|
|
61
|
+
promptsVisible: boolean;
|
|
62
|
+
prompts: any;
|
|
63
|
+
showPrompts(): void;
|
|
55
64
|
static ɵfac: i0.ɵɵFactoryDeclaration<DCLessonEditorComponent, never>;
|
|
56
65
|
static ɵcmp: i0.ɵɵComponentDeclaration<DCLessonEditorComponent, "dc-lesson-editor", never, {}, {}, never, never, true, never>;
|
|
57
66
|
}
|
package/lib/components/dc-lessons/dc-lesson-metadata-editor/dc-lesson-metadata-editor.component.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter, WritableSignal } from '@angular/core';
|
|
2
|
-
import { ILesson } from '../../lesson-mini-components/components/lessons.clases';
|
|
2
|
+
import { ILesson, ContentMetadata } from '../../lesson-mini-components/components/lessons.clases';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class DCLessonMetadataEditorComponent {
|
|
5
5
|
#private;
|
|
@@ -8,11 +8,8 @@ export declare class DCLessonMetadataEditorComponent {
|
|
|
8
8
|
saveRequest: EventEmitter<void>;
|
|
9
9
|
importNotionRequest: EventEmitter<void>;
|
|
10
10
|
improveNotionRequest: EventEmitter<void>;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
value: any;
|
|
14
|
-
}>;
|
|
15
|
-
onPropertyChange<K extends keyof ILesson>(property: K, value: ILesson[K]): void;
|
|
11
|
+
onRootPropertyChange(property: keyof ILesson, value: any): void;
|
|
12
|
+
onMetadataPropertyChange(property: keyof ContentMetadata, value: any): void;
|
|
16
13
|
emitSaveRequest(): void;
|
|
17
14
|
emitImportNotionRequest(): void;
|
|
18
15
|
emitImproveNotionRequest(): void;
|
|
@@ -34,5 +31,5 @@ export declare class DCLessonMetadataEditorComponent {
|
|
|
34
31
|
*/
|
|
35
32
|
triggerGenerateDescriptionAI(): Promise<void>;
|
|
36
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<DCLessonMetadataEditorComponent, never>;
|
|
37
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DCLessonMetadataEditorComponent, "dc-lesson-metadata-editor", never, { "lesson": { "alias": "lesson"; "required": true; }; "isLoadingLesson": { "alias": "isLoadingLesson"; "required": true; }; }, { "saveRequest": "saveRequest"; "importNotionRequest": "importNotionRequest"; "improveNotionRequest": "improveNotionRequest";
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DCLessonMetadataEditorComponent, "dc-lesson-metadata-editor", never, { "lesson": { "alias": "lesson"; "required": true; }; "isLoadingLesson": { "alias": "isLoadingLesson"; "required": true; }; }, { "saveRequest": "saveRequest"; "importNotionRequest": "importNotionRequest"; "improveNotionRequest": "improveNotionRequest"; }, never, never, true, never>;
|
|
38
35
|
}
|
|
@@ -90,9 +90,19 @@ export interface Media {
|
|
|
90
90
|
export interface ILessonExtra {
|
|
91
91
|
notionPageId?: string;
|
|
92
92
|
}
|
|
93
|
+
export interface ContentMetadata {
|
|
94
|
+
title: string;
|
|
95
|
+
description: string;
|
|
96
|
+
isPublished: boolean;
|
|
97
|
+
tags: string[];
|
|
98
|
+
banner: StorageType;
|
|
99
|
+
prompt: string;
|
|
100
|
+
generatedByAI: boolean;
|
|
101
|
+
}
|
|
93
102
|
export interface ILesson {
|
|
94
103
|
_id: any;
|
|
95
104
|
id: string;
|
|
105
|
+
metadata?: ContentMetadata;
|
|
96
106
|
title: string;
|
|
97
107
|
description: string;
|
|
98
108
|
isPublished: boolean;
|
|
@@ -101,10 +111,12 @@ export interface ILesson {
|
|
|
101
111
|
authorEmail: string;
|
|
102
112
|
tags: string[];
|
|
103
113
|
media: Media;
|
|
114
|
+
banner?: StorageType;
|
|
104
115
|
components: Array<LessonComponentConfiguration<any>>;
|
|
105
116
|
dynamicComponents: Record<string, DynamicContentComponent>;
|
|
106
117
|
baseLang: string;
|
|
107
118
|
targetLang: string;
|
|
119
|
+
appExtension: Record<string, any>;
|
|
108
120
|
generatedByAI: boolean;
|
|
109
121
|
prompt: string;
|
|
110
122
|
level: number;
|
|
@@ -120,6 +132,11 @@ export interface ILessonTaken {
|
|
|
120
132
|
status: string;
|
|
121
133
|
lastAccess: Date;
|
|
122
134
|
}
|
|
135
|
+
export interface LessonPrompts {
|
|
136
|
+
description: (lesson: ILesson) => string;
|
|
137
|
+
banner: (lesson: ILesson) => string;
|
|
138
|
+
content: (lesson: ILesson) => string;
|
|
139
|
+
}
|
|
123
140
|
export declare abstract class LessonsAbstractService {
|
|
124
141
|
abstract getLessons(paginator?: any): Promise<any>;
|
|
125
142
|
abstract getLesson(id: string): Promise<any>;
|
|
@@ -131,6 +148,7 @@ export declare abstract class LessonsAbstractService {
|
|
|
131
148
|
abstract extractTextFromHtml(html: string): string;
|
|
132
149
|
abstract postImproveMDWithAI(lessonId: string, markdownText: string): Promise<any>;
|
|
133
150
|
abstract saveTakenLesson(lesson: ILessonTaken): Promise<any>;
|
|
151
|
+
abstract getPrompts(): LessonPrompts;
|
|
134
152
|
}
|
|
135
153
|
export declare function provideLessonsService(serviceImplementation: Type<LessonsAbstractService>): Provider[];
|
|
136
154
|
export declare const LangCodeDescription: {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const PROMPTS: {
|
|
2
|
+
generateLesson: string;
|
|
3
|
+
GetImageSuggestion: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const getImageSuggestion: (language: string, lessonTopic: string) => string;
|
|
6
|
+
export declare const getPromptGenerateLesson: (baseLang: string, targetLang: string, lessonTopic: string, aditionalPrompt: string) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ISimpleAgent } from '@dataclouder/ngx-agent-cards';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const getLanguageSimpleAgent: (langBase: string, langTarget: string) => ISimpleAgent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILesson, ILessonTaken, LessonsAbstractService } from '../components/lesson-mini-components/components/lessons.clases';
|
|
1
|
+
import { ILesson, ILessonTaken, LessonPrompts, LessonsAbstractService } from '../components/lesson-mini-components/components/lessons.clases';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class DefaultLessonsService implements LessonsAbstractService {
|
|
4
4
|
saveTakenLesson(lesson: ILessonTaken): Promise<any>;
|
|
@@ -13,6 +13,8 @@ export declare class DefaultLessonsService implements LessonsAbstractService {
|
|
|
13
13
|
postGenerateByAI(id: string): Promise<any>;
|
|
14
14
|
postImproveMDWithAI(lessonId: string, markdownText: string): Promise<any>;
|
|
15
15
|
extractTextFromHtml(html: string): string;
|
|
16
|
+
generateBanner(prompt: string, lessonId: string): Promise<any>;
|
|
17
|
+
getPrompts(): LessonPrompts;
|
|
16
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<DefaultLessonsService, never>;
|
|
17
19
|
static ɵprov: i0.ɵɵInjectableDeclaration<DefaultLessonsService>;
|
|
18
20
|
}
|
|
@@ -18,6 +18,7 @@ export declare class LessonUtilsService {
|
|
|
18
18
|
*/
|
|
19
19
|
uploadCover(lessonSignal: WritableSignal<ILesson | undefined>, imageUploaded: any): void;
|
|
20
20
|
/**
|
|
21
|
+
* @deprecated Use create new method.
|
|
21
22
|
* Generates lesson content using AI. Assumes the lesson is already saved.
|
|
22
23
|
* @param lessonId The ID of the lesson to generate content for.
|
|
23
24
|
* @returns The updated lesson object after AI generation, or null on failure.
|