@dataclouder/ngx-lessons 0.0.29 → 0.0.31
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 +1205 -514
- package/fesm2022/dataclouder-ngx-lessons.mjs.map +1 -1
- package/lib/components/dc-lessons/dc-lesson-card/dc-lesson-card.component.d.ts +6 -8
- package/lib/components/dc-lessons/dc-lesson-component-adder/dc-lesson-component-adder.component.d.ts +11 -0
- package/lib/components/dc-lessons/dc-lesson-editor/dc-lesson-editor.component.d.ts +39 -38
- package/lib/components/dc-lessons/dc-lesson-metadata-editor/dc-lesson-metadata-editor.component.d.ts +22 -0
- package/lib/components/dc-lessons/dc-lesson-renderer/dc-lesson-renderer.component.d.ts +32 -37
- package/lib/components/dc-lessons/lesson-list/dc-lesson-list.component.d.ts +7 -17
- package/lib/components/lesson-mini-components/components/ComponentBuilder.d.ts +7 -2
- package/lib/components/lesson-mini-components/components/lessons.clases.d.ts +17 -42
- package/lib/components/lesson-mini-components/components/speaker/speaker-builder/speaker-builder.component.d.ts +13 -0
- package/lib/components/lesson-mini-components/components/speaker/speaker.component.d.ts +12 -0
- package/lib/services/lesson-ai.service.d.ts +18 -0
- package/lib/services/lesson-notion.service.d.ts +35 -0
- package/lib/services/lesson-utils.service.d.ts +34 -0
- package/package.json +3 -2
- package/src/lib/components/dc-lessons/dc-lesson-card/dc-lesson-card.component.html +40 -35
- package/src/lib/components/dc-lessons/dc-lesson-card/dc-lesson-card.component.scss +15 -2
- package/src/lib/components/dc-lessons/dc-lesson-card/dc-lesson-card.component.ts +16 -18
- package/src/lib/components/dc-lessons/dc-lesson-component-adder/dc-lesson-component-adder.component.css +1 -0
- package/src/lib/components/dc-lessons/dc-lesson-component-adder/dc-lesson-component-adder.component.html +46 -0
- package/src/lib/components/dc-lessons/dc-lesson-component-adder/dc-lesson-component-adder.component.ts +52 -0
- package/src/lib/components/dc-lessons/dc-lesson-editor/dc-lesson-editor.component.html +54 -92
- package/src/lib/components/dc-lessons/dc-lesson-editor/dc-lesson-editor.component.ts +268 -230
- package/src/lib/components/dc-lessons/dc-lesson-metadata-editor/dc-lesson-metadata-editor.component.css +1 -0
- package/src/lib/components/dc-lessons/dc-lesson-metadata-editor/dc-lesson-metadata-editor.component.html +72 -0
- package/src/lib/components/dc-lessons/dc-lesson-metadata-editor/dc-lesson-metadata-editor.component.ts +60 -0
- package/src/lib/components/dc-lessons/dc-lesson-renderer/dc-lesson-renderer.component.html +23 -27
- package/src/lib/components/dc-lessons/dc-lesson-renderer/dc-lesson-renderer.component.ts +247 -186
- package/src/lib/components/dc-lessons/lesson-form/lesson-form.component.ts +2 -2
- package/src/lib/components/dc-lessons/lesson-list/dc-lesson-list.component.html +3 -3
- package/src/lib/components/dc-lessons/lesson-list/dc-lesson-list.component.ts +28 -46
- package/src/lib/components/lesson-mini-components/components/ComponentBuilder.ts +23 -15
- package/src/lib/components/lesson-mini-components/components/lessons.clases.ts +32 -66
- package/src/lib/components/lesson-mini-components/components/selector/selector-builder/selector-builder.component.html +62 -58
- package/src/lib/components/lesson-mini-components/components/selector/selector-builder/selector-builder.component.ts +2 -2
- package/src/lib/components/lesson-mini-components/components/selector/selector.component.html +1 -2
- package/src/lib/components/lesson-mini-components/components/selector/selector.component.ts +2 -2
- package/src/lib/components/lesson-mini-components/components/speaker/speaker-builder/speaker-builder.component.html +5 -27
- package/src/lib/components/lesson-mini-components/components/speaker/speaker-builder/speaker-builder.component.ts +38 -25
- package/src/lib/components/lesson-mini-components/components/speaker/speaker.component.html +9 -7
- package/src/lib/components/lesson-mini-components/components/speaker/speaker.component.ts +30 -26
- package/src/lib/components/lesson-mini-components/components/translationSwitcher/translationSwitcher.component.ts +2 -2
- package/src/lib/components/lesson-mini-components/components/translationSwitcher/translationSwitcherBuilder/translationSwitcherBuilder.component.ts +2 -2
- package/src/lib/services/lesson-ai.service.ts +103 -0
- package/src/lib/services/lesson-notion.service.ts +161 -0
- package/src/lib/services/lesson-utils.service.ts +181 -0
- package/src/lib/components/lesson-mini-components/components/selector/selector-builder/selector-builder.component.spec.ts +0 -25
- package/src/lib/components/lesson-mini-components/components/speaker/speaker-builder/speaker-builder.component.spec.ts +0 -25
- package/src/lib/components/lesson-mini-components/components/speaker/speaker.component.spec.ts +0 -25
|
@@ -1,35 +1,40 @@
|
|
|
1
|
-
<div class="card-container">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
<div class="
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<div class="
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
</div>
|
|
1
|
+
<div class="card-container">
|
|
2
|
+
@if(showOptions){
|
|
3
|
+
<p-speeddial
|
|
4
|
+
class="dial-button"
|
|
5
|
+
[model]="items"
|
|
6
|
+
[radius]="70"
|
|
7
|
+
type="quarter-circle"
|
|
8
|
+
direction="down-left"
|
|
9
|
+
[buttonProps]="{ severity: 'primary', rounded: true, outlined: true, raised: true }" />
|
|
10
|
+
}
|
|
11
|
+
<p-card>
|
|
12
|
+
<div class="lesson-card">
|
|
13
|
+
<div class="photo">
|
|
14
|
+
<img [src]="coverUrl" alt="" />
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<span class="date">{{ lesson.createdDate | date : 'dd/MM/yyyy' }}</span>
|
|
18
|
+
|
|
19
|
+
<div class="description">
|
|
20
|
+
<h1>{{ lesson.title }}</h1>
|
|
21
|
+
<p>{{ lesson.description }}</p>
|
|
22
|
+
<div class="card-footer">
|
|
23
|
+
<div class="status-tags">
|
|
24
|
+
<span class="level-tag">Nivel {{ lesson.level }}</span>
|
|
25
|
+
@if (lesson.taken?.status == 'passed') {
|
|
26
|
+
<span class="status-tag success">Tomada</span>
|
|
27
|
+
}
|
|
28
|
+
@if (lesson.taken?.status == 'failed') {
|
|
29
|
+
<span class="status-tag danger">Fallida</span>
|
|
30
|
+
}
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="actions">
|
|
34
|
+
<p-button label="Tomar lección" (onClick)="eventCard(eventType.Select)" severity="primary"> </p-button>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</p-card>
|
|
40
|
+
</div>
|
|
@@ -31,14 +31,27 @@
|
|
|
31
31
|
object-fit: cover;
|
|
32
32
|
object-position: center;
|
|
33
33
|
}
|
|
34
|
+
|
|
35
|
+
/* Alternative: Add a dark overlay */
|
|
36
|
+
&::after {
|
|
37
|
+
content: '';
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 0;
|
|
40
|
+
left: 0;
|
|
41
|
+
width: 100%;
|
|
42
|
+
height: 100%;
|
|
43
|
+
background: linear-gradient(to bottom, rgb(0, 0, 0) 50%, var(--p-primary-color) 100%);
|
|
44
|
+
opacity: 0.4;
|
|
45
|
+
z-index: 2;
|
|
46
|
+
pointer-events: none; /* Allows clicks to pass through */
|
|
47
|
+
}
|
|
34
48
|
}
|
|
35
49
|
|
|
36
50
|
.description {
|
|
37
51
|
position: relative;
|
|
38
52
|
z-index: 2;
|
|
39
|
-
padding: 1.5rem;
|
|
40
53
|
color: white;
|
|
41
|
-
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.8) 100%);
|
|
54
|
+
// background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.8) 100%);
|
|
42
55
|
height: 100%;
|
|
43
56
|
display: flex;
|
|
44
57
|
flex-direction: column;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { DatePipe } from '@angular/common';
|
|
3
3
|
|
|
4
4
|
import { ButtonModule } from 'primeng/button';
|
|
5
5
|
import { PopoverModule } from 'primeng/popover';
|
|
@@ -9,11 +9,12 @@ import { MenuItem } from 'primeng/api';
|
|
|
9
9
|
import { CardModule } from 'primeng/card';
|
|
10
10
|
|
|
11
11
|
import { ILesson, ILessonWithTaken } from '../../lesson-mini-components/components/lessons.clases';
|
|
12
|
+
import { OnActionEvent } from '@dataclouder/ngx-core';
|
|
12
13
|
|
|
13
14
|
enum EventCard {
|
|
14
15
|
Edit = 'edit',
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
Delete = 'delete',
|
|
17
|
+
Select = 'select',
|
|
17
18
|
Qr = 'qr',
|
|
18
19
|
}
|
|
19
20
|
@Component({
|
|
@@ -21,16 +22,13 @@ enum EventCard {
|
|
|
21
22
|
templateUrl: './dc-lesson-card.component.html',
|
|
22
23
|
styleUrls: ['./dc-lesson-card.component.scss'],
|
|
23
24
|
standalone: true,
|
|
24
|
-
imports: [
|
|
25
|
+
imports: [DatePipe, ButtonModule, PopoverModule, SpeedDialModule, CardModule],
|
|
25
26
|
})
|
|
26
27
|
export class DcLessonCardComponent implements OnInit {
|
|
27
28
|
@Input() lesson: ILessonWithTaken | ILesson | any;
|
|
28
|
-
@Input()
|
|
29
|
-
|
|
30
|
-
@Output()
|
|
31
|
-
@Output() edit: EventEmitter<any> = new EventEmitter();
|
|
32
|
-
@Output() remove: EventEmitter<any> = new EventEmitter();
|
|
33
|
-
@Output() qr: EventEmitter<any> = new EventEmitter();
|
|
29
|
+
@Input() showOptions: boolean = true;
|
|
30
|
+
|
|
31
|
+
@Output() onAction: EventEmitter<OnActionEvent> = new EventEmitter();
|
|
34
32
|
|
|
35
33
|
public coverUrl: string = 'assets/background/default-background.webp';
|
|
36
34
|
public eventType = EventCard;
|
|
@@ -47,14 +45,14 @@ export class DcLessonCardComponent implements OnInit {
|
|
|
47
45
|
label: 'Eliminar',
|
|
48
46
|
icon: 'pi pi-trash',
|
|
49
47
|
command: () => {
|
|
50
|
-
this.eventCard(EventCard.
|
|
48
|
+
this.eventCard(EventCard.Delete);
|
|
51
49
|
},
|
|
52
50
|
},
|
|
53
51
|
{
|
|
54
52
|
label: 'Tomar lección',
|
|
55
53
|
icon: 'pi pi-play',
|
|
56
54
|
command: () => {
|
|
57
|
-
this.eventCard(EventCard.
|
|
55
|
+
this.eventCard(EventCard.Select);
|
|
58
56
|
},
|
|
59
57
|
},
|
|
60
58
|
];
|
|
@@ -68,16 +66,16 @@ export class DcLessonCardComponent implements OnInit {
|
|
|
68
66
|
public eventCard(eventType: EventCard) {
|
|
69
67
|
switch (eventType) {
|
|
70
68
|
case EventCard.Edit:
|
|
71
|
-
this.
|
|
69
|
+
this.onAction.emit({ action: 'edit', item: this.lesson });
|
|
72
70
|
break;
|
|
73
|
-
case EventCard.
|
|
74
|
-
this.
|
|
71
|
+
case EventCard.Delete:
|
|
72
|
+
this.onAction.emit({ action: 'delete', item: this.lesson });
|
|
75
73
|
break;
|
|
76
|
-
case EventCard.
|
|
77
|
-
this.
|
|
74
|
+
case EventCard.Select:
|
|
75
|
+
this.onAction.emit({ action: 'select', item: this.lesson });
|
|
78
76
|
break;
|
|
79
77
|
case EventCard.Qr:
|
|
80
|
-
this.
|
|
78
|
+
this.onAction.emit({ action: 'qr', item: this.lesson });
|
|
81
79
|
break;
|
|
82
80
|
}
|
|
83
81
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* Add any specific styles for the component adder here if needed */
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<span>Componentes: </span>
|
|
2
|
+
<div style="display: flex; gap: 10px; flex-wrap: wrap">
|
|
3
|
+
<p-button
|
|
4
|
+
severity="info"
|
|
5
|
+
(click)="openComponentBuilder(lessonComponentEnum.Selector)"
|
|
6
|
+
pTooltip="Agrega un selector con multiples opciones"
|
|
7
|
+
tooltipPosition="bottom">
|
|
8
|
+
Selector
|
|
9
|
+
</p-button>
|
|
10
|
+
<p-button
|
|
11
|
+
severity="info"
|
|
12
|
+
(click)="openComponentBuilder(lessonComponentEnum.Speaker)"
|
|
13
|
+
pTooltip="Para que una palabra o frase sea reproducible"
|
|
14
|
+
tooltipPosition="bottom">
|
|
15
|
+
Speaker
|
|
16
|
+
</p-button>
|
|
17
|
+
<p-button
|
|
18
|
+
severity="info"
|
|
19
|
+
(click)="openComponentBuilder(lessonComponentEnum.TextWriter)"
|
|
20
|
+
pTooltip="Escribe una respuesta en un cuadro de texto"
|
|
21
|
+
tooltipPosition="bottom">
|
|
22
|
+
Text
|
|
23
|
+
</p-button>
|
|
24
|
+
<p-button
|
|
25
|
+
severity="info"
|
|
26
|
+
(click)="openComponentBuilder(lessonComponentEnum.VerbSummary)"
|
|
27
|
+
pTooltip="Muestra la información de un verbo"
|
|
28
|
+
tooltipPosition="bottom">
|
|
29
|
+
Verb
|
|
30
|
+
</p-button>
|
|
31
|
+
<p-button
|
|
32
|
+
severity="info"
|
|
33
|
+
(click)="openComponentBuilder(lessonComponentEnum.WordSummary)"
|
|
34
|
+
pTooltip="Muestra la información de una palabra"
|
|
35
|
+
tooltipPosition="bottom">
|
|
36
|
+
Palabra
|
|
37
|
+
</p-button>
|
|
38
|
+
<p-button
|
|
39
|
+
severity="info"
|
|
40
|
+
(click)="openComponentBuilder(lessonComponentEnum.TranslationSwitcher)"
|
|
41
|
+
pTooltip="Muestra el texto pero al pica cambia de idioma"
|
|
42
|
+
tooltipPosition="bottom">
|
|
43
|
+
Traducción
|
|
44
|
+
</p-button>
|
|
45
|
+
<!-- Add other buttons here if needed, following the same pattern -->
|
|
46
|
+
</div>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Component, EventEmitter, Output, inject } from '@angular/core'; // Added inject
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
// PrimeNG
|
|
4
|
+
import { ButtonModule } from 'primeng/button';
|
|
5
|
+
import { TooltipModule } from 'primeng/tooltip';
|
|
6
|
+
import { DialogService, DynamicDialogRef } from 'primeng/dynamicdialog'; // Added DialogService, DynamicDialogRef
|
|
7
|
+
// Dataclouder
|
|
8
|
+
import { TOAST_ALERTS_TOKEN, ToastAlertsAbstractService } from '@dataclouder/ngx-core'; // Added Toast imports
|
|
9
|
+
// Project specific
|
|
10
|
+
import { LessonComponentEnum, LessonComponentBuilders } from '../../lesson-mini-components/components/lessons.clases'; // Added LessonComponentBuilders
|
|
11
|
+
|
|
12
|
+
@Component({
|
|
13
|
+
selector: 'dc-lesson-component-adder',
|
|
14
|
+
standalone: true,
|
|
15
|
+
imports: [CommonModule, ButtonModule, TooltipModule],
|
|
16
|
+
templateUrl: './dc-lesson-component-adder.component.html',
|
|
17
|
+
styleUrls: ['./dc-lesson-component-adder.component.css'],
|
|
18
|
+
providers: [DialogService], // Provide DialogService here
|
|
19
|
+
})
|
|
20
|
+
export class DCLessonComponentAdderComponent {
|
|
21
|
+
// Services
|
|
22
|
+
#dialogService = inject(DialogService);
|
|
23
|
+
#toastService = inject(TOAST_ALERTS_TOKEN);
|
|
24
|
+
|
|
25
|
+
@Output() componentAdded = new EventEmitter<any>(); // Changed Output name and type
|
|
26
|
+
|
|
27
|
+
// Expose enum to the template
|
|
28
|
+
public lessonComponentEnum = LessonComponentEnum;
|
|
29
|
+
|
|
30
|
+
// Moved logic from DCLessonEditorComponent
|
|
31
|
+
public openComponentBuilder(type: LessonComponentEnum): void {
|
|
32
|
+
const componentToBuild = LessonComponentBuilders[type];
|
|
33
|
+
if (!componentToBuild) {
|
|
34
|
+
console.error(`No component builder found for type: ${type}`);
|
|
35
|
+
this.#toastService.error({ title: 'Error', subtitle: `Componente desconocido: ${type}` });
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const dialogRef: DynamicDialogRef = this.#dialogService.open(componentToBuild, {
|
|
39
|
+
width: '80vw',
|
|
40
|
+
header: 'Agregar componente',
|
|
41
|
+
closable: true,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// Handle the result and emit the new event
|
|
45
|
+
dialogRef.onClose.subscribe((result) => {
|
|
46
|
+
if (result) {
|
|
47
|
+
console.log('Component builder closed:', result);
|
|
48
|
+
this.componentAdded.emit(result); // Emit the result when dialog closes successfully
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div style="position: relative; margin-bottom: 20px">
|
|
2
|
-
<div class="header-cover" [style.background-image]="
|
|
2
|
+
<div class="header-cover" [style.background-image]="coverBackground()"></div>
|
|
3
3
|
|
|
4
4
|
<dc-cropper-modal
|
|
5
5
|
style="position: absolute; top: 10px; left: 20px"
|
|
@@ -10,96 +10,58 @@
|
|
|
10
10
|
|
|
11
11
|
<br />
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Lección publicada
|
|
43
|
-
</label>
|
|
44
|
-
<br />
|
|
45
|
-
|
|
46
|
-
<input pInputText [(ngModel)]="lesson.level" type="number" placeholder="Level" />
|
|
47
|
-
</div>
|
|
48
|
-
|
|
49
|
-
<div>
|
|
50
|
-
{{ lesson.baseLang | flagEmoji }} -> {{ lesson.targetLang | flagEmoji }} Lección para hablantes de {{ lesson.baseLang | langDesc : 'es' }} que aprenden
|
|
51
|
-
{{ lesson.targetLang | langDesc : 'es' }}
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
<hr />
|
|
57
|
-
<span>Componentes: </span>
|
|
58
|
-
<div style="display: flex; gap: 10px">
|
|
59
|
-
<p-button severity="info" (click)="openComponentBuilder(lessonComponentEnum.Selector)" pTooltip="Agrega un selector con multiples opciones">
|
|
60
|
-
Selector
|
|
61
|
-
</p-button>
|
|
62
|
-
<p-button severity="info" (click)="openComponentBuilder(lessonComponentEnum.Speaker)" pTooltip="Para que una palabra o frase sea reproducible">
|
|
63
|
-
Speaker
|
|
64
|
-
</p-button>
|
|
65
|
-
<p-button severity="info" (click)="openComponentBuilder(lessonComponentEnum.TextWriter)" pTooltip="Escribe una respuesta en un cuadro de texto">
|
|
66
|
-
Text
|
|
67
|
-
</p-button>
|
|
68
|
-
<p-button severity="info" (click)="openComponentBuilder(lessonComponentEnum.VerbSummary)" pTooltip="Muestra la información de un verbo"> Text </p-button>
|
|
69
|
-
<p-button severity="info" (click)="openComponentBuilder(lessonComponentEnum.VerbSummary)" pTooltip="Muestra la información de un verbo"> Verb </p-button>
|
|
70
|
-
<p-button severity="info" (click)="openComponentBuilder(lessonComponentEnum.WordSummary)" pTooltip="Muestra la información de una palabra">
|
|
71
|
-
Palabra
|
|
72
|
-
</p-button>
|
|
73
|
-
<p-button severity="info" (click)="openComponentBuilder(lessonComponentEnum.TranslationSwitcher)" pTooltip="Muestra el texto pero al pica cambia de idioma">
|
|
74
|
-
Traducción
|
|
75
|
-
</p-button>
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<hr />
|
|
79
|
-
|
|
80
|
-
<p-splitter [style]="{ height: '80vh' }" styleClass="mb-8">
|
|
81
|
-
<ng-template pTemplate>
|
|
82
|
-
<ckeditor
|
|
83
|
-
(keydown.control.s)="saveLesson($event)"
|
|
84
|
-
(keydown.control.space)="togleRender($event)"
|
|
85
|
-
class="text-editor"
|
|
86
|
-
[editor]="editor"
|
|
87
|
-
[(ngModel)]="lesson.textCoded">
|
|
88
|
-
</ckeditor>
|
|
89
|
-
</ng-template>
|
|
90
|
-
|
|
91
|
-
<ng-template pTemplate>
|
|
92
|
-
@if (isRendered) {
|
|
93
|
-
<dc-lesson-renderer class="text-editor" [lesson]="lesson" [test]="true"></dc-lesson-renderer>
|
|
94
|
-
}
|
|
95
|
-
</ng-template>
|
|
96
|
-
</p-splitter>
|
|
97
|
-
|
|
98
|
-
<div class="float-button">
|
|
99
|
-
<p-speeddial [model]="items" [radius]="120" type="quarter-circle" direction="up-left" />
|
|
100
|
-
|
|
101
|
-
<p-button icon="pi pi-save" (click)="saveLesson()" severity="primary" [rounded]="true" [raised]="true" pTooltip="Guardar (Ctrl + S)"> </p-button>
|
|
102
|
-
</div>
|
|
13
|
+
<!-- Lesson Metadata Editor -->
|
|
14
|
+
<dc-lesson-metadata-editor
|
|
15
|
+
[lesson]="lesson"
|
|
16
|
+
[isLoadingLesson]="isLoadingLesson"
|
|
17
|
+
(saveRequest)="saveLesson()"
|
|
18
|
+
(importNotionRequest)="importFromNotion()"
|
|
19
|
+
(improveNotionRequest)="improveNotionWithAI()"
|
|
20
|
+
(generateAIRequest)="generateByAI()"
|
|
21
|
+
(propertyChange)="updateLessonProperty($event.property, $event.value)">
|
|
22
|
+
</dc-lesson-metadata-editor>
|
|
23
|
+
|
|
24
|
+
<hr />
|
|
25
|
+
|
|
26
|
+
<!-- Component Adder -->
|
|
27
|
+
<dc-lesson-component-adder (componentAdded)="onComponentAdded($event)"></dc-lesson-component-adder>
|
|
28
|
+
|
|
29
|
+
<!-- Display Added Components -->
|
|
30
|
+
<div class="added-components-list" style="margin-top: 15px; margin-bottom: 15px">
|
|
31
|
+
<h4>Componentes Agregados:</h4>
|
|
32
|
+
@if (dynamicComponentsArray().length > 0) {
|
|
33
|
+
<ul>
|
|
34
|
+
@for (comp of dynamicComponentsArray(); track comp.id) {
|
|
35
|
+
<li>ID: {{ comp.id }} - Tipo: {{ comp.component }}<button pButton icon="pi pi-info" (click)="showComponentDetails(comp)"></button></li>
|
|
36
|
+
}
|
|
37
|
+
</ul>
|
|
38
|
+
} @else {
|
|
39
|
+
<p>Aún no se han agregado componentes.</p>
|
|
40
|
+
}
|
|
41
|
+
</div>
|
|
103
42
|
|
|
104
|
-
|
|
43
|
+
<hr />
|
|
44
|
+
|
|
45
|
+
<!-- Text Editor and Renderer -->
|
|
46
|
+
<p-splitter [style]="{ height: '80vh' }" styleClass="mb-8">
|
|
47
|
+
<ng-template pTemplate>
|
|
48
|
+
<ckeditor
|
|
49
|
+
(keydown.control.s)="saveLesson($event)"
|
|
50
|
+
class="text-editor"
|
|
51
|
+
[editor]="editor"
|
|
52
|
+
[ngModel]="lesson()?.textCoded"
|
|
53
|
+
(ngModelChange)="updateLessonProperty('textCoded', $event)">
|
|
54
|
+
</ckeditor>
|
|
55
|
+
</ng-template>
|
|
56
|
+
|
|
57
|
+
<ng-template pTemplate>
|
|
58
|
+
<dc-lesson-renderer class="text-editor" [lessonInput]="lesson()" [test]="true"></dc-lesson-renderer>
|
|
59
|
+
</ng-template>
|
|
60
|
+
</p-splitter>
|
|
61
|
+
|
|
62
|
+
<div class="float-button">
|
|
63
|
+
<!-- Removed p-speeddial -->
|
|
64
|
+
<p-button icon="pi pi-save" (click)="saveLesson()" severity="primary" [rounded]="true" [raised]="true" pTooltip="Guardar (Ctrl + S)"> </p-button>
|
|
105
65
|
</div>
|
|
66
|
+
|
|
67
|
+
<hr />
|