@dataclouder/ngx-lessons 0.1.16 → 0.1.17

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/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { ISimpleAgent, IConversationSettings, IConversationFlow, SimpleAgentTask
4
4
  import { MenuItem } from 'primeng/api';
5
5
  import { EntityCommunicationService, FiltersConfig, IFilterQueryResponse, IExtensionable, ILearnable, IAuditable, IManageable, IReactable, EntityBaseListComponent, ICustomFilter, PColumn, OnActionEvent, EntityBaseFormComponent, UiStateService, MobileService, PaginationBase, ListFilterBarOptions } from '@dataclouder/ngx-core';
6
6
  import * as _angular_forms from '@angular/forms';
7
- import { FormBuilder, FormControl, FormArray, UntypedFormControl, UntypedFormArray, FormGroup } from '@angular/forms';
7
+ import { FormBuilder, FormControl, FormArray, UntypedFormControl, FormGroup, UntypedFormArray } from '@angular/forms';
8
8
  import { DynamicDialogRef } from 'primeng/dynamicdialog';
9
9
  import { TTSGenerated } from '@dataclouder/ngx-ai-services';
10
10
  import { IAssetable, StorageImageSettings, AspectType, ResolutionType } from '@dataclouder/ngx-cloud-storage';
@@ -81,9 +81,9 @@ type LessonCompSettingsForm = {
81
81
  };
82
82
  interface ComponentBuildData {
83
83
  str: string;
84
- obj: LessonComponentConfiguration;
84
+ obj: IDynamicContentComponent;
85
85
  }
86
- declare abstract class ComponentBuilder {
86
+ declare abstract class ComponentBuilder implements OnInit {
87
87
  inputs: Record<string, any>;
88
88
  id: string;
89
89
  abstract componentName: string;
@@ -97,8 +97,18 @@ declare abstract class ComponentBuilder {
97
97
  hint: FormControl<string>;
98
98
  explanation: FormControl<string>;
99
99
  }>;
100
+ ngOnInit(): void;
101
+ protected populateForm(): void;
100
102
  get questionType(): LessonComponentEnum;
101
- protected getCode(): LessonComponentConfiguration;
103
+ protected getFormValue(): Partial<{
104
+ response: string;
105
+ responses: string;
106
+ options: any;
107
+ text: string;
108
+ hint: string;
109
+ explanation: string;
110
+ }>;
111
+ protected getCode(): IDynamicContentComponent;
102
112
  showCode(): void;
103
113
  getComponentData(): ComponentBuildData;
104
114
  copyToClipboard(): Promise<void>;
@@ -150,13 +160,13 @@ declare class TranslationSwitcherComponent implements OnInit {
150
160
  static ɵcmp: i0.ɵɵComponentDeclaration<TranslationSwitcherComponent, "app-translation-switcher", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
151
161
  }
152
162
 
153
- declare class SpeakerBuilderComponent extends ComponentBuilder {
163
+ declare class SpeakerBuilderComponent extends ComponentBuilder implements OnInit {
154
164
  componentName: string;
165
+ form: FormGroup;
155
166
  tts: i0.WritableSignal<TTSGenerated>;
156
167
  handleTtsGenerated(event: TTSGenerated): void;
157
- protected getCode(): LessonComponentConfiguration<LessonCompSettings & {
158
- voice: string;
159
- }>;
168
+ ngOnInit(): void;
169
+ protected getFormValue(): any;
160
170
  static ɵfac: i0.ɵɵFactoryDeclaration<SpeakerBuilderComponent, never>;
161
171
  static ɵcmp: i0.ɵɵComponentDeclaration<SpeakerBuilderComponent, "app-speaker-builder", never, {}, {}, never, never, true, never>;
162
172
  }
@@ -165,9 +175,10 @@ declare class SpeakerComponent implements OnInit {
165
175
  ngOnInit(): void;
166
176
  config: SpeakerCompConfiguration;
167
177
  tts: TTSGenerated | undefined;
178
+ text: string;
168
179
  speach(): void;
169
180
  static ɵfac: i0.ɵɵFactoryDeclaration<SpeakerComponent, never>;
170
- static ɵcmp: i0.ɵɵComponentDeclaration<SpeakerComponent, "app-speaker", never, { "config": { "alias": "config"; "required": false; }; "tts": { "alias": "tts"; "required": false; }; }, {}, never, never, true, never>;
181
+ static ɵcmp: i0.ɵɵComponentDeclaration<SpeakerComponent, "app-speaker", never, { "config": { "alias": "config"; "required": false; }; "tts": { "alias": "tts"; "required": false; }; "text": { "alias": "text"; "required": false; }; }, {}, never, never, true, never>;
171
182
  }
172
183
 
173
184
  declare class SelectorBuilderComponent extends ComponentBuilder implements OnInit {
@@ -213,25 +224,25 @@ declare class DefaultLessonsService extends EntityCommunicationService<ILesson>
213
224
 
214
225
  type LessonComponentsType = 'selector' | 'speaker' | 'text-writer' | 'verb-summary' | 'word-summary';
215
226
  declare enum LessonComponentEnum {
216
- Selector = "selector",
217
- Speaker = "speaker",
218
- TextWriter = "textWriter",
219
- VerbSummary = "verbSummary",
220
- WordSummary = "wordSummary",
221
- TranslationSwitcher = "translationSwitcher",
222
- PlayWord = "playWord"
227
+ Selector = "Selector",
228
+ Speaker = "Speaker",
229
+ TextWriter = "TextWriter",
230
+ VerbSummary = "VerbSummary",
231
+ WordSummary = "WordSummary",
232
+ TranslationSwitcher = "TranslationSwitcher",
233
+ PlayWord = "PlayWord"
223
234
  }
224
235
  declare const LessonComponentBuilders: {
225
- selector: typeof SelectorBuilderComponent;
226
- speaker: typeof SpeakerBuilderComponent;
227
- textWriter: typeof TextWriterBuiderComponent;
228
- translationSwitcher: typeof TranslationSwitcherBuilderComponent;
236
+ Selector: typeof SelectorBuilderComponent;
237
+ Speaker: typeof SpeakerBuilderComponent;
238
+ TextWriter: typeof TextWriterBuiderComponent;
239
+ TranslationSwitcher: typeof TranslationSwitcherBuilderComponent;
229
240
  };
230
241
  declare const LessonComponents: {
231
- selector: typeof SelectorComponent;
232
- speaker: typeof SpeakerComponent;
233
- textWriter: typeof TextWriterComponent;
234
- translationSwitcher: typeof TranslationSwitcherComponent;
242
+ Selector: typeof SelectorComponent;
243
+ Speaker: typeof SpeakerComponent;
244
+ TextWriter: typeof TextWriterComponent;
245
+ TranslationSwitcher: typeof TranslationSwitcherComponent;
235
246
  };
236
247
  declare function getLessonComponentClass(type: LessonComponentsType): any;
237
248
  interface LessonCompSettings {
@@ -280,11 +291,11 @@ interface ImgStorageData extends StorageFile {
280
291
  type LessonImage = ImgStorageData & {
281
292
  type: string;
282
293
  };
283
- interface DynamicContentComponent {
284
- id: string;
285
- component: LessonComponentEnum;
294
+ interface IDynamicContentComponent {
295
+ id?: string;
296
+ component: string;
286
297
  inputs: Record<string, any>;
287
- config: LessonComponentConfiguration<any>;
298
+ config?: LessonComponentConfiguration<any>;
288
299
  }
289
300
  type StorageType = StorageFile & {
290
301
  type: string;
@@ -316,7 +327,7 @@ interface ILesson {
316
327
  tags: string[];
317
328
  media: Media;
318
329
  format: 'html' | 'markdown';
319
- dynamicComponents: Record<string, DynamicContentComponent>;
330
+ dynamicComponents: Record<string, IDynamicContentComponent>;
320
331
  baseLang: string;
321
332
  targetLang: string;
322
333
  extensions?: IExtensionable;
@@ -346,7 +357,7 @@ interface LessonPrompts {
346
357
  declare function provideLessonsService(serviceImplementation: Type<DefaultLessonsService>): Provider[];
347
358
 
348
359
  declare class DCLessonListComponent extends EntityBaseListComponent<ILesson> {
349
- userService: UserService;
360
+ userService: UserService<any>;
350
361
  customFilters: ICustomFilter[];
351
362
  protected entityCommunicationService: DefaultLessonsService;
352
363
  columns: PColumn[];
@@ -401,7 +412,7 @@ declare class DCLessonEditorComponent extends EntityBaseFormComponent<ILesson> {
401
412
  private ngxVertexService;
402
413
  private dynamicComponentsBuilderService;
403
414
  isLoadingLesson: i0.WritableSignal<boolean>;
404
- readonly dynamicComponentsArray: i0.Signal<DynamicContentComponent[]>;
415
+ readonly dynamicComponentsArray: i0.Signal<IDynamicContentComponent[]>;
405
416
  components: {
406
417
  [key: string]: ComponentRef<LessonComponentInterface>;
407
418
  };
@@ -426,7 +437,7 @@ declare class DCLessonEditorComponent extends EntityBaseFormComponent<ILesson> {
426
437
  onNewDynamicComponent(result: ComponentBuildData): void;
427
438
  showComponentDetails(data: any): void;
428
439
  generateBanner(): Promise<void>;
429
- editComponent(comp: any): void;
440
+ editComponent(comp: IDynamicContentComponent): void;
430
441
  onAssetUpdate(event: {
431
442
  assets: Partial<IAssetable>;
432
443
  }): void;
@@ -442,7 +453,7 @@ declare enum EventCard {
442
453
  Clone = "clone"
443
454
  }
444
455
  declare class DcLessonCardComponent implements OnInit {
445
- userService: UserService;
456
+ userService: UserService<any>;
446
457
  lesson: ILessonWithTaken | ILesson | any;
447
458
  showOptions: boolean;
448
459
  cardHeight: string;
@@ -468,7 +479,7 @@ declare class LessonRendererService {
468
479
  mainForm: FormGroup<{
469
480
  [key: string]: FormControl<any>;
470
481
  }>;
471
- renderLesson(lessonData: ILesson, viewContainerRef: ViewContainerRef, dynamicLessonElement: HTMLElement, renderer: Renderer2): {
482
+ buildAndRenderDynamicComponents(lessonData: ILesson, viewContainerRef: ViewContainerRef, dynamicLessonElement: HTMLElement, renderer: Renderer2): {
472
483
  [key: string]: ComponentRef<LessonComponentInterface>;
473
484
  };
474
485
  clearLessonRendering(dynamicLessonElement: HTMLElement): void;
@@ -491,7 +502,7 @@ declare class LessonRendererService {
491
502
 
492
503
  declare class LessonConversationService {
493
504
  lessonsService: DefaultLessonsService;
494
- userService: UserService;
505
+ userService: UserService<any>;
495
506
  conversationSettings: i0.WritableSignal<IConversationSettings>;
496
507
  conversationFlow: i0.WritableSignal<IConversationFlow>;
497
508
  evalAgentTask: i0.WritableSignal<SimpleAgentTask>;
@@ -688,7 +699,7 @@ declare class CourseFormComponent extends EntityBaseFormComponent<ICourse> imple
688
699
  declare class CourseListComponent extends PaginationBase implements OnInit {
689
700
  private toastService;
690
701
  private courseService;
691
- userService: UserService;
702
+ userService: UserService<any>;
692
703
  private cdr;
693
704
  viewType: 'table' | 'card';
694
705
  readonly onlyView: i0.InputSignal<boolean>;
@@ -708,4 +719,4 @@ declare class CourseListComponent extends PaginationBase implements OnInit {
708
719
  }
709
720
 
710
721
  export { ComponentBuilder, ComponentWithForm, CourseDetailComponent, CourseFormComponent, CourseListComponent, CourseService, CoursesAdminComponent, CoursesComponent, CoursesService, DCLessonEditorComponent, DCLessonFormComponent, DCLessonListComponent, DCLessonRendererComponent, DcLessonCardComponent, DefaultDynamicComponentBuilders, DefaultDynamicComponents, DefaultLessonsService, DynamicComponentsRegisterService, FlagLanguagePipe, LESSONS_TOKEN, LangCodeDescription, LangCodeDescriptionEs, LessonComponentBuilders, LessonComponentEnum, LessonComponents, LessonConversationService, LessonDynamicComponent, LessonRendererService, LessonsV2Component, NOTION_SERVICE_TOKEN, NotionAbstractService, NotionExportType, SelectorBuilderComponent, SelectorComponent, TextWriterBuiderComponent, TextWriterComponent, TranslationSwitcherBuilderComponent, TranslationSwitcherComponent, getLanguageSimpleAgent, getLessonComponentClass, provideLessonsService, provideNotionService };
711
- export type { AudioStorage, ComponentBuildData, ContentMetadata, DynamicComponentData, DynamicComponentMap, DynamicContentComponent, ILesson, ILessonExtra, ILessonTaken, ILessonWithTaken, ILessonsSettings, ImgStorageData, InputCompoennt, LessonCompSettings, LessonCompSettingsForm, LessonComponentConfiguration, LessonComponentInterface, LessonComponentsType, LessonImage, LessonPrompts, Media, NotionDBResponse, NotionPageResponse, SpeakerCompConfiguration, StorageFile, TextContent };
722
+ export type { AudioStorage, ComponentBuildData, ContentMetadata, DynamicComponentData, DynamicComponentMap, IDynamicContentComponent, ILesson, ILessonExtra, ILessonTaken, ILessonWithTaken, ILessonsSettings, ImgStorageData, InputCompoennt, LessonCompSettings, LessonCompSettingsForm, LessonComponentConfiguration, LessonComponentInterface, LessonComponentsType, LessonImage, LessonPrompts, Media, NotionDBResponse, NotionPageResponse, SpeakerCompConfiguration, StorageFile, TextContent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataclouder/ngx-lessons",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.0.0",
6
6
  "@angular/core": ">=18.0.0",