@dataclouder/ngx-lessons 0.1.16 → 0.1.19

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 {
@@ -193,6 +204,7 @@ declare class SelectorComponent extends ComponentWithForm implements LessonCompo
193
204
  }
194
205
 
195
206
  declare class DefaultLessonsService extends EntityCommunicationService<ILesson> {
207
+ getFixedQuery(): Record<string, any>;
196
208
  constructor();
197
209
  private endpoints;
198
210
  getLessons(filters?: FiltersConfig): Promise<IFilterQueryResponse<ILesson>>;
@@ -213,25 +225,25 @@ declare class DefaultLessonsService extends EntityCommunicationService<ILesson>
213
225
 
214
226
  type LessonComponentsType = 'selector' | 'speaker' | 'text-writer' | 'verb-summary' | 'word-summary';
215
227
  declare enum LessonComponentEnum {
216
- Selector = "selector",
217
- Speaker = "speaker",
218
- TextWriter = "textWriter",
219
- VerbSummary = "verbSummary",
220
- WordSummary = "wordSummary",
221
- TranslationSwitcher = "translationSwitcher",
222
- PlayWord = "playWord"
228
+ Selector = "Selector",
229
+ Speaker = "Speaker",
230
+ TextWriter = "TextWriter",
231
+ VerbSummary = "VerbSummary",
232
+ WordSummary = "WordSummary",
233
+ TranslationSwitcher = "TranslationSwitcher",
234
+ PlayWord = "PlayWord"
223
235
  }
224
236
  declare const LessonComponentBuilders: {
225
- selector: typeof SelectorBuilderComponent;
226
- speaker: typeof SpeakerBuilderComponent;
227
- textWriter: typeof TextWriterBuiderComponent;
228
- translationSwitcher: typeof TranslationSwitcherBuilderComponent;
237
+ Selector: typeof SelectorBuilderComponent;
238
+ Speaker: typeof SpeakerBuilderComponent;
239
+ TextWriter: typeof TextWriterBuiderComponent;
240
+ TranslationSwitcher: typeof TranslationSwitcherBuilderComponent;
229
241
  };
230
242
  declare const LessonComponents: {
231
- selector: typeof SelectorComponent;
232
- speaker: typeof SpeakerComponent;
233
- textWriter: typeof TextWriterComponent;
234
- translationSwitcher: typeof TranslationSwitcherComponent;
243
+ Selector: typeof SelectorComponent;
244
+ Speaker: typeof SpeakerComponent;
245
+ TextWriter: typeof TextWriterComponent;
246
+ TranslationSwitcher: typeof TranslationSwitcherComponent;
235
247
  };
236
248
  declare function getLessonComponentClass(type: LessonComponentsType): any;
237
249
  interface LessonCompSettings {
@@ -280,11 +292,11 @@ interface ImgStorageData extends StorageFile {
280
292
  type LessonImage = ImgStorageData & {
281
293
  type: string;
282
294
  };
283
- interface DynamicContentComponent {
284
- id: string;
285
- component: LessonComponentEnum;
295
+ interface IDynamicContentComponent {
296
+ id?: string;
297
+ component: string;
286
298
  inputs: Record<string, any>;
287
- config: LessonComponentConfiguration<any>;
299
+ config?: LessonComponentConfiguration<any>;
288
300
  }
289
301
  type StorageType = StorageFile & {
290
302
  type: string;
@@ -316,7 +328,7 @@ interface ILesson {
316
328
  tags: string[];
317
329
  media: Media;
318
330
  format: 'html' | 'markdown';
319
- dynamicComponents: Record<string, DynamicContentComponent>;
331
+ dynamicComponents: Record<string, IDynamicContentComponent>;
320
332
  baseLang: string;
321
333
  targetLang: string;
322
334
  extensions?: IExtensionable;
@@ -346,8 +358,9 @@ interface LessonPrompts {
346
358
  declare function provideLessonsService(serviceImplementation: Type<DefaultLessonsService>): Provider[];
347
359
 
348
360
  declare class DCLessonListComponent extends EntityBaseListComponent<ILesson> {
349
- userService: UserService;
361
+ userService: UserService<any>;
350
362
  customFilters: ICustomFilter[];
363
+ persistenceKey: string;
351
364
  protected entityCommunicationService: DefaultLessonsService;
352
365
  columns: PColumn[];
353
366
  constructor();
@@ -356,7 +369,7 @@ declare class DCLessonListComponent extends EntityBaseListComponent<ILesson> {
356
369
  applyFilterBarEvent(filterEvent: OnActionEvent): void;
357
370
  protected loadData(): Promise<void>;
358
371
  static ɵfac: i0.ɵɵFactoryDeclaration<DCLessonListComponent, never>;
359
- static ɵcmp: i0.ɵɵComponentDeclaration<DCLessonListComponent, "dc-lesson-list", never, { "customFilters": { "alias": "customFilters"; "required": false; }; }, {}, never, never, true, never>;
372
+ static ɵcmp: i0.ɵɵComponentDeclaration<DCLessonListComponent, "dc-lesson-list", never, { "customFilters": { "alias": "customFilters"; "required": false; }; "persistenceKey": { "alias": "persistenceKey"; "required": false; }; }, {}, never, never, true, never>;
360
373
  }
361
374
 
362
375
  declare class DCLessonFormComponent {
@@ -373,10 +386,6 @@ declare class DCLessonEditorComponent extends EntityBaseFormComponent<ILesson> {
373
386
  description: _angular_forms.FormControl<string>;
374
387
  format: _angular_forms.FormControl<string>;
375
388
  lang: _angular_forms.FormControl<string>;
376
- characterCard: _angular_forms.FormControl<any>;
377
- conversationSettings: _angular_forms.FormControl<any>;
378
- metaApp: _angular_forms.FormControl<any>;
379
- conversationFlow: _angular_forms.FormControl<any>;
380
389
  textCoded: _angular_forms.FormControl<string>;
381
390
  manageable: _angular_forms.FormGroup<any>;
382
391
  learnable: _angular_forms.FormGroup<{
@@ -400,8 +409,9 @@ declare class DCLessonEditorComponent extends EntityBaseFormComponent<ILesson> {
400
409
  private promptService;
401
410
  private ngxVertexService;
402
411
  private dynamicComponentsBuilderService;
412
+ private formUtil;
403
413
  isLoadingLesson: i0.WritableSignal<boolean>;
404
- readonly dynamicComponentsArray: i0.Signal<DynamicContentComponent[]>;
414
+ readonly dynamicComponentsArray: i0.Signal<IDynamicContentComponent[]>;
405
415
  components: {
406
416
  [key: string]: ComponentRef<LessonComponentInterface>;
407
417
  };
@@ -426,7 +436,7 @@ declare class DCLessonEditorComponent extends EntityBaseFormComponent<ILesson> {
426
436
  onNewDynamicComponent(result: ComponentBuildData): void;
427
437
  showComponentDetails(data: any): void;
428
438
  generateBanner(): Promise<void>;
429
- editComponent(comp: any): void;
439
+ editComponent(comp: IDynamicContentComponent): void;
430
440
  onAssetUpdate(event: {
431
441
  assets: Partial<IAssetable>;
432
442
  }): void;
@@ -442,7 +452,7 @@ declare enum EventCard {
442
452
  Clone = "clone"
443
453
  }
444
454
  declare class DcLessonCardComponent implements OnInit {
445
- userService: UserService;
455
+ userService: UserService<any>;
446
456
  lesson: ILessonWithTaken | ILesson | any;
447
457
  showOptions: boolean;
448
458
  cardHeight: string;
@@ -468,7 +478,7 @@ declare class LessonRendererService {
468
478
  mainForm: FormGroup<{
469
479
  [key: string]: FormControl<any>;
470
480
  }>;
471
- renderLesson(lessonData: ILesson, viewContainerRef: ViewContainerRef, dynamicLessonElement: HTMLElement, renderer: Renderer2): {
481
+ buildAndRenderDynamicComponents(lessonData: ILesson, viewContainerRef: ViewContainerRef, dynamicLessonElement: HTMLElement, renderer: Renderer2): {
472
482
  [key: string]: ComponentRef<LessonComponentInterface>;
473
483
  };
474
484
  clearLessonRendering(dynamicLessonElement: HTMLElement): void;
@@ -491,7 +501,7 @@ declare class LessonRendererService {
491
501
 
492
502
  declare class LessonConversationService {
493
503
  lessonsService: DefaultLessonsService;
494
- userService: UserService;
504
+ userService: UserService<any>;
495
505
  conversationSettings: i0.WritableSignal<IConversationSettings>;
496
506
  conversationFlow: i0.WritableSignal<IConversationFlow>;
497
507
  evalAgentTask: i0.WritableSignal<SimpleAgentTask>;
@@ -688,7 +698,7 @@ declare class CourseFormComponent extends EntityBaseFormComponent<ICourse> imple
688
698
  declare class CourseListComponent extends PaginationBase implements OnInit {
689
699
  private toastService;
690
700
  private courseService;
691
- userService: UserService;
701
+ userService: UserService<any>;
692
702
  private cdr;
693
703
  viewType: 'table' | 'card';
694
704
  readonly onlyView: i0.InputSignal<boolean>;
@@ -708,4 +718,4 @@ declare class CourseListComponent extends PaginationBase implements OnInit {
708
718
  }
709
719
 
710
720
  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 };
721
+ 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.19",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.0.0",
6
6
  "@angular/core": ">=18.0.0",