@dataclouder/ngx-lessons 0.0.32 → 0.0.33

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.
@@ -1,7 +1,7 @@
1
1
  import { ComponentRef, ElementRef, ViewContainerRef } from '@angular/core';
2
2
  import BalloonEditor from '@ckeditor/ckeditor5-build-balloon-block';
3
3
  import { StorageImageSettings } from '@dataclouder/ngx-cloud-storage';
4
- import { LessonComponentEnum, ILesson, LessonComponentInterface, DynamicContentComponent } from '../../lesson-mini-components/components/lessons.clases';
4
+ import { LessonComponentEnum, ILesson, LessonComponentInterface } from '../../lesson-mini-components/components/lessons.clases';
5
5
  import { ComponentBuildData } from '../../lesson-mini-components/components/ComponentBuilder';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class DCLessonEditorComponent {
@@ -10,10 +10,9 @@ export declare class DCLessonEditorComponent {
10
10
  dhtml: ElementRef;
11
11
  readonly lessonId: import("@angular/core").Signal<string>;
12
12
  lesson: import("@angular/core").WritableSignal<ILesson>;
13
- isCropperVisible: import("@angular/core").WritableSignal<boolean>;
14
13
  isLoadingLesson: import("@angular/core").WritableSignal<boolean>;
15
14
  coverImageUrl: import("@angular/core").Signal<string>;
16
- readonly dynamicComponentsArray: import("@angular/core").Signal<DynamicContentComponent[]>;
15
+ readonly dynamicComponentsArray: import("@angular/core").Signal<import("@dataclouder/ngx-lessons").DynamicContentComponent[]>;
17
16
  components: {
18
17
  [key: string]: ComponentRef<LessonComponentInterface>;
19
18
  };
@@ -39,8 +38,13 @@ export declare class DCLessonEditorComponent {
39
38
  * @param result The configuration data returned from the component builder dialog. Expected format: { obj: LessonComponentConfiguration }
40
39
  */
41
40
  onComponentAdded(result: ComponentBuildData): void;
42
- openCropper(): void;
43
41
  generateByAI(): Promise<void>;
42
+ /**
43
+ * Replaces encoded JSON blocks (~...~) in HTML with their 'settings.text' value.
44
+ * @param htmlInput The HTML string containing encoded JSON.
45
+ * @returns The processed HTML string with text replacements.
46
+ */
47
+ private _extractTextFromEncodedJson;
44
48
  /**
45
49
  * Handles the image upload event, updates the lesson signal via the service, and saves.
46
50
  * @param event The image upload event data.
@@ -1,7 +1,7 @@
1
1
  import { ElementRef } from '@angular/core';
2
2
  import { FormGroup, FormControl } from '@angular/forms';
3
3
  import { ILesson } from '../../lesson-mini-components/components/lessons.clases';
4
- import { IAgentCard, IMiniAgentCard } from '@dataclouder/ngx-agent-cards';
4
+ import { IAgentCard, IConversationSettings, IMiniAgentCard } from '@dataclouder/ngx-agent-cards';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class DCLessonRendererComponent {
7
7
  lessonInput: import("@angular/core").InputSignal<ILesson>;
@@ -17,11 +17,13 @@ export declare class DCLessonRendererComponent {
17
17
  chatVisible: import("@angular/core").WritableSignal<boolean>;
18
18
  agentMasterLesson: import("@angular/core").WritableSignal<IAgentCard>;
19
19
  evaluatorAgentCard: import("@angular/core").WritableSignal<IMiniAgentCard>;
20
+ conversationSettings: import("@angular/core").WritableSignal<IConversationSettings>;
20
21
  imageCover: import("@angular/core").Signal<string>;
21
22
  private components;
22
23
  mainForm: FormGroup<{
23
24
  [key: string]: FormControl<any>;
24
25
  }>;
26
+ private previousTextCoded;
25
27
  constructor();
26
28
  private _clearLessonRendering;
27
29
  private _renderLesson;
@@ -122,6 +122,7 @@ export declare abstract class LessonsAbstractService {
122
122
  abstract generateLesson(lesson: ILesson): Promise<any>;
123
123
  abstract postGenerateByAI(id: string): Promise<any>;
124
124
  abstract extractTextFromHtml(html: string): string;
125
+ abstract postImproveMDWithAI(lessonId: string, markdownText: string): Promise<any>;
125
126
  }
126
127
  export declare function provideLessonsService(serviceImplementation: Type<LessonsAbstractService>): Provider[];
127
128
  export declare const LangCodeDescription: {
@@ -0,0 +1,2 @@
1
+ import { ISimpleAgent } from '@dataclouder/ngx-agent-cards';
2
+ export declare const BasicAgentCard: ISimpleAgent;
@@ -1,9 +1,16 @@
1
- import { IAgentCard, IMiniAgentCard } from '@dataclouder/ngx-agent-cards';
1
+ import { IAgentCard, IMiniAgentCard, IConversationSettings } from '@dataclouder/ngx-agent-cards';
2
2
  import { ILesson } from '../components/lesson-mini-components/components/lessons.clases';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class LessonAIService {
5
5
  private readonly lessonService;
6
- constructor();
6
+ private readonly userService;
7
+ /**
8
+ * Builds the scenario prompt string based on lesson content and user info.
9
+ * @param lessonText The extracted text content of the lesson.
10
+ * @param userInformationPrompt The formatted string containing user details.
11
+ * @returns The complete scenario prompt string.
12
+ */
13
+ private _buildScenarioPrompt;
7
14
  /**
8
15
  * Generates the necessary agent cards for a lesson chat session.
9
16
  * @param lesson The lesson data.
@@ -13,6 +20,12 @@ export declare class LessonAIService {
13
20
  masterAgent: IAgentCard;
14
21
  evaluatorAgent: IMiniAgentCard;
15
22
  } | null>;
23
+ /**
24
+ * Generates conversation settings for a lesson, using the lesson scenario as the initial prompt.
25
+ * @param lesson The lesson data.
26
+ * @returns An IConversationSettings object configured for the lesson scenario.
27
+ */
28
+ generateConversationSettingsForLesson(lesson: ILesson): Promise<IConversationSettings | null>;
16
29
  static ɵfac: i0.ɵɵFactoryDeclaration<LessonAIService, never>;
17
30
  static ɵprov: i0.ɵɵInjectableDeclaration<LessonAIService>;
18
31
  }
@@ -1,9 +1,10 @@
1
1
  import { WritableSignal } from '@angular/core';
2
2
  import { ILesson } from '../components/lesson-mini-components/components/lessons.clases';
3
+ import { LoadingBarService } from '@dataclouder/ngx-core';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class LessonUtilsService {
5
6
  #private;
6
- constructor();
7
+ loadingBarService: LoadingBarService;
7
8
  /**
8
9
  * Validates if audios need generation for the given lesson.
9
10
  * Currently logs a placeholder message.
@@ -22,6 +23,14 @@ export declare class LessonUtilsService {
22
23
  * @returns The updated lesson object after AI generation, or null on failure.
23
24
  */
24
25
  generateByAI(lessonId: string): Promise<ILesson | null>;
26
+ /**
27
+ * Improves the provided Markdown text using AI and updates the lesson.
28
+ * Assumes the lesson is already saved before calling this.
29
+ * @param lessonId The ID of the lesson to update.
30
+ * @param markdownText The Markdown text generated from the lesson's HTML content.
31
+ * @returns The updated lesson object after AI improvement, or null on failure.
32
+ */
33
+ improveMDWithAI(lesson: ILesson, markdownText: string): Promise<string | null>;
25
34
  /**
26
35
  * Cleans orphaned components from the lesson's dynamicComponents.
27
36
  * An orphaned component is one present in dynamicComponents but its ID is not found in the textCoded HTML.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataclouder/ngx-lessons",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.0.0",
6
6
  "@angular/core": ">=18.0.0",
package/public-api.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './lib/models/lessons.pipes';
2
2
  export * from './lib/models/notion.models';
3
+ export * from './lib/models/simple-agents';
3
4
  export * from './lib/components/dc-lessons/lesson-list/dc-lesson-list.component';
4
5
  export * from './lib/components/dc-lessons/lesson-form/lesson-form.component';
5
6
  export * from './lib/components/dc-lessons/dc-lesson-editor/dc-lesson-editor.component';