@dataclouder/ngx-lessons 0.0.26
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/README.md +28 -0
- package/fesm2022/dataclouder-ngx-lessons.mjs +1194 -0
- package/fesm2022/dataclouder-ngx-lessons.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/dc-lessons/dc-lesson-card/dc-lesson-card.component.d.ts +26 -0
- package/lib/components/dc-lessons/dc-lesson-editor/dc-lesson-editor.component.d.ts +59 -0
- package/lib/components/dc-lessons/dc-lesson-renderer/dc-lesson-renderer.component.d.ts +42 -0
- package/lib/components/dc-lessons/lesson-form/lesson-form.component.d.ts +5 -0
- package/lib/components/dc-lessons/lesson-list/dc-lesson-list.component.d.ts +45 -0
- package/lib/components/lesson-mini-components/components/ComponentBuilder.d.ts +26 -0
- package/lib/components/lesson-mini-components/components/ComponentWithForm.d.ts +12 -0
- package/lib/components/lesson-mini-components/components/lesson-dynamic.component.d.ts +7 -0
- package/lib/components/lesson-mini-components/components/lessons.clases.d.ts +166 -0
- package/lib/components/lesson-mini-components/components/selector/selector-builder/selector-builder.component.d.ts +19 -0
- package/lib/components/lesson-mini-components/components/selector/selector.component.d.ts +12 -0
- package/lib/components/lesson-mini-components/components/text-writer/text-writer-buider/text-writer-buider.component.d.ts +14 -0
- package/lib/components/lesson-mini-components/components/text-writer/text-writer.component.d.ts +16 -0
- package/lib/components/lesson-mini-components/components/translationSwitcher/translationSwitcher.component.d.ts +11 -0
- package/lib/components/lesson-mini-components/components/translationSwitcher/translationSwitcherBuilder/translationSwitcherBuilder.component.d.ts +13 -0
- package/lib/models/lessons.pipes.d.ts +12 -0
- package/lib/models/notion.models.d.ts +41 -0
- package/package.json +37 -0
- package/public-api.d.ts +17 -0
- package/src/lib/components/dc-lessons/dc-lesson-card/dc-lesson-card.component.html +44 -0
- package/src/lib/components/dc-lessons/dc-lesson-card/dc-lesson-card.component.scss +235 -0
- package/src/lib/components/dc-lessons/dc-lesson-card/dc-lesson-card.component.ts +83 -0
- package/src/lib/components/dc-lessons/dc-lesson-editor/dc-lesson-editor.component.css +90 -0
- package/src/lib/components/dc-lessons/dc-lesson-editor/dc-lesson-editor.component.html +105 -0
- package/src/lib/components/dc-lessons/dc-lesson-editor/dc-lesson-editor.component.scss +0 -0
- package/src/lib/components/dc-lessons/dc-lesson-editor/dc-lesson-editor.component.ts +318 -0
- package/src/lib/components/dc-lessons/dc-lesson-renderer/dc-lesson-renderer.component.html +27 -0
- package/src/lib/components/dc-lessons/dc-lesson-renderer/dc-lesson-renderer.component.scss +3 -0
- package/src/lib/components/dc-lessons/dc-lesson-renderer/dc-lesson-renderer.component.ts +271 -0
- package/src/lib/components/dc-lessons/lesson-form/lesson-form.component.html +5 -0
- package/src/lib/components/dc-lessons/lesson-form/lesson-form.component.scss +3 -0
- package/src/lib/components/dc-lessons/lesson-form/lesson-form.component.ts +14 -0
- package/src/lib/components/dc-lessons/lesson-list/dc-lesson-list.component.html +26 -0
- package/src/lib/components/dc-lessons/lesson-list/dc-lesson-list.component.scss +17 -0
- package/src/lib/components/dc-lessons/lesson-list/dc-lesson-list.component.ts +159 -0
- package/src/lib/components/dc-lessons/lessons.component.ts +10 -0
- package/src/lib/components/lesson-mini-components/components/ComponentBuilder.ts +74 -0
- package/src/lib/components/lesson-mini-components/components/ComponentWithForm.ts +25 -0
- package/src/lib/components/lesson-mini-components/components/lesson-dynamic.component.ts +13 -0
- package/src/lib/components/lesson-mini-components/components/lessons.clases.ts +254 -0
- package/src/lib/components/lesson-mini-components/components/selector/selector-builder/selector-builder.component.html +58 -0
- package/src/lib/components/lesson-mini-components/components/selector/selector-builder/selector-builder.component.scss +15 -0
- package/src/lib/components/lesson-mini-components/components/selector/selector-builder/selector-builder.component.spec.ts +25 -0
- package/src/lib/components/lesson-mini-components/components/selector/selector-builder/selector-builder.component.ts +70 -0
- package/src/lib/components/lesson-mini-components/components/selector/selector.component.html +2 -0
- package/src/lib/components/lesson-mini-components/components/selector/selector.component.scss +12 -0
- package/src/lib/components/lesson-mini-components/components/selector/selector.component.spec.ts +25 -0
- package/src/lib/components/lesson-mini-components/components/selector/selector.component.ts +47 -0
- package/src/lib/components/lesson-mini-components/components/speaker/speaker-builder/speaker-builder.component.html +35 -0
- package/src/lib/components/lesson-mini-components/components/speaker/speaker-builder/speaker-builder.component.scss +0 -0
- package/src/lib/components/lesson-mini-components/components/speaker/speaker-builder/speaker-builder.component.spec.ts +25 -0
- package/src/lib/components/lesson-mini-components/components/speaker/speaker-builder/speaker-builder.component.ts +27 -0
- package/src/lib/components/lesson-mini-components/components/speaker/speaker.component.html +7 -0
- package/src/lib/components/lesson-mini-components/components/speaker/speaker.component.scss +3 -0
- package/src/lib/components/lesson-mini-components/components/speaker/speaker.component.spec.ts +25 -0
- package/src/lib/components/lesson-mini-components/components/speaker/speaker.component.ts +29 -0
- package/src/lib/components/lesson-mini-components/components/text-writer/text-writer-buider/text-writer-buider.component.html +24 -0
- package/src/lib/components/lesson-mini-components/components/text-writer/text-writer-buider/text-writer-buider.component.scss +15 -0
- package/src/lib/components/lesson-mini-components/components/text-writer/text-writer-buider/text-writer-buider.component.spec.ts +25 -0
- package/src/lib/components/lesson-mini-components/components/text-writer/text-writer-buider/text-writer-buider.component.ts +29 -0
- package/src/lib/components/lesson-mini-components/components/text-writer/text-writer.component.html +4 -0
- package/src/lib/components/lesson-mini-components/components/text-writer/text-writer.component.scss +8 -0
- package/src/lib/components/lesson-mini-components/components/text-writer/text-writer.component.spec.ts +25 -0
- package/src/lib/components/lesson-mini-components/components/text-writer/text-writer.component.ts +61 -0
- package/src/lib/components/lesson-mini-components/components/translationSwitcher/translationSwitcher.component.css +3 -0
- package/src/lib/components/lesson-mini-components/components/translationSwitcher/translationSwitcher.component.html +9 -0
- package/src/lib/components/lesson-mini-components/components/translationSwitcher/translationSwitcher.component.ts +32 -0
- package/src/lib/components/lesson-mini-components/components/translationSwitcher/translationSwitcherBuilder/translationSwitcherBuilder.component.css +3 -0
- package/src/lib/components/lesson-mini-components/components/translationSwitcher/translationSwitcherBuilder/translationSwitcherBuilder.component.html +28 -0
- package/src/lib/components/lesson-mini-components/components/translationSwitcher/translationSwitcherBuilder/translationSwitcherBuilder.component.ts +30 -0
- package/src/lib/components/lesson-mini-components/components/verb-summary/verb-summary-builder/verb-summary-builder.component.html +18 -0
- package/src/lib/components/lesson-mini-components/components/verb-summary/verb-summary-builder/verb-summary-builder.component.scss +3 -0
- package/src/lib/components/lesson-mini-components/components/verb-summary/verb-summary-builder/verb-summary-builder.component.spec.ts +25 -0
- package/src/lib/components/lesson-mini-components/components/verb-summary/verb-summary-builder/verb-summary-builder.component.ts +25 -0
- package/src/lib/components/lesson-mini-components/components/verb-summary/verb-summary.component.html +15 -0
- package/src/lib/components/lesson-mini-components/components/verb-summary/verb-summary.component.scss +27 -0
- package/src/lib/components/lesson-mini-components/components/verb-summary/verb-summary.component.spec.ts +25 -0
- package/src/lib/components/lesson-mini-components/components/verb-summary/verb-summary.component.ts +46 -0
- package/src/lib/components/lesson-mini-components/components/word-summary/word-summary-builder/word-summary-builder.component.html +19 -0
- package/src/lib/components/lesson-mini-components/components/word-summary/word-summary-builder/word-summary-builder.component.scss +0 -0
- package/src/lib/components/lesson-mini-components/components/word-summary/word-summary-builder/word-summary-builder.component.ts +27 -0
- package/src/lib/components/lesson-mini-components/components/word-summary/word-summary.component.html +14 -0
- package/src/lib/components/lesson-mini-components/components/word-summary/word-summary.component.scss +22 -0
- package/src/lib/components/lesson-mini-components/components/word-summary/word-summary.component.ts +51 -0
- package/src/lib/models/lessons.pipes.ts +38 -0
- package/src/lib/models/models.ts +92 -0
- package/src/lib/models/notion.models.ts +43 -0
- package/src/public-api.ts +25 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { UntypedFormControl } from '@angular/forms';
|
|
2
|
+
import { InjectionToken, Type } from '@angular/core';
|
|
3
|
+
import { Provider } from '@angular/core';
|
|
4
|
+
import { SelectorBuilderComponent } from './selector/selector-builder/selector-builder.component';
|
|
5
|
+
import { SelectorComponent } from './selector/selector.component';
|
|
6
|
+
import { TextWriterBuiderComponent } from './text-writer/text-writer-buider/text-writer-buider.component';
|
|
7
|
+
import { TextWriterComponent } from './text-writer/text-writer.component';
|
|
8
|
+
import { TranslationSwitcherBuilderComponent } from './translationSwitcher/translationSwitcherBuilder/translationSwitcherBuilder.component';
|
|
9
|
+
import { TranslationSwitcherComponent } from './translationSwitcher/translationSwitcher.component';
|
|
10
|
+
export type LessonComponentsType = 'selector' | 'speaker' | 'text-writer' | 'verb-summary' | 'word-summary';
|
|
11
|
+
export declare enum LessonComponentEnum {
|
|
12
|
+
Selector = "selector",
|
|
13
|
+
Speaker = "speaker",
|
|
14
|
+
TextWriter = "textWriter",
|
|
15
|
+
VerbSummary = "verbSummary",
|
|
16
|
+
WordSummary = "wordSummary",
|
|
17
|
+
TranslationSwitcher = "translationSwitcher"
|
|
18
|
+
}
|
|
19
|
+
export declare const LessonComponentBuilders: {
|
|
20
|
+
selector: typeof SelectorBuilderComponent;
|
|
21
|
+
textWriter: typeof TextWriterBuiderComponent;
|
|
22
|
+
translationSwitcher: typeof TranslationSwitcherBuilderComponent;
|
|
23
|
+
};
|
|
24
|
+
export declare const LessonComponents: {
|
|
25
|
+
selector: typeof SelectorComponent;
|
|
26
|
+
textWriter: typeof TextWriterComponent;
|
|
27
|
+
translationSwitcher: typeof TranslationSwitcherComponent;
|
|
28
|
+
};
|
|
29
|
+
export declare function getLessonComponentClass(type: LessonComponentsType): any;
|
|
30
|
+
export interface LessonCompSettings {
|
|
31
|
+
response?: string;
|
|
32
|
+
responses?: string;
|
|
33
|
+
options?: string[];
|
|
34
|
+
text?: string;
|
|
35
|
+
hint?: string;
|
|
36
|
+
explanation?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface LessonComponentConfiguration {
|
|
39
|
+
id: string;
|
|
40
|
+
component: LessonComponentEnum;
|
|
41
|
+
settings: LessonCompSettings;
|
|
42
|
+
}
|
|
43
|
+
export interface StorageFile {
|
|
44
|
+
bucket: string;
|
|
45
|
+
url: string;
|
|
46
|
+
path: string;
|
|
47
|
+
}
|
|
48
|
+
export interface AudioStorage extends StorageFile {
|
|
49
|
+
text?: string;
|
|
50
|
+
voiceType?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface SpeakerCompConfiguration extends LessonComponentConfiguration {
|
|
53
|
+
audio: AudioStorage;
|
|
54
|
+
settings: LessonCompSettings & {
|
|
55
|
+
voice: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export interface LessonComponentInterface {
|
|
59
|
+
config: LessonComponentConfiguration;
|
|
60
|
+
control?: UntypedFormControl;
|
|
61
|
+
validate?(): boolean | null;
|
|
62
|
+
evaluate?(): boolean | null;
|
|
63
|
+
}
|
|
64
|
+
export declare const LESSONS_TOKEN: InjectionToken<LessonsAbstractService>;
|
|
65
|
+
export interface StorageFile {
|
|
66
|
+
bucket: string;
|
|
67
|
+
url: string;
|
|
68
|
+
path: string;
|
|
69
|
+
}
|
|
70
|
+
export interface ImgStorageData extends StorageFile {
|
|
71
|
+
fullPath: string;
|
|
72
|
+
resolutions: any;
|
|
73
|
+
resolution: string;
|
|
74
|
+
}
|
|
75
|
+
export type LessonImage = ImgStorageData & {
|
|
76
|
+
type: string;
|
|
77
|
+
};
|
|
78
|
+
export interface LessonComponentConfiguration {
|
|
79
|
+
id: string;
|
|
80
|
+
component: LessonComponentEnum;
|
|
81
|
+
settings: LessonCompSettings;
|
|
82
|
+
}
|
|
83
|
+
type StorageType = StorageFile & {
|
|
84
|
+
type: string;
|
|
85
|
+
};
|
|
86
|
+
export interface Media {
|
|
87
|
+
audios?: StorageType[];
|
|
88
|
+
images?: StorageType[];
|
|
89
|
+
}
|
|
90
|
+
export interface ILessonExtra {
|
|
91
|
+
notionPageId?: string;
|
|
92
|
+
}
|
|
93
|
+
export interface ILesson {
|
|
94
|
+
_id: any;
|
|
95
|
+
id: string;
|
|
96
|
+
title: string;
|
|
97
|
+
description: string;
|
|
98
|
+
isPublished: boolean;
|
|
99
|
+
textCoded: string;
|
|
100
|
+
authorId: string;
|
|
101
|
+
authorEmail: string;
|
|
102
|
+
tags: string[];
|
|
103
|
+
media: Media;
|
|
104
|
+
components: Array<LessonComponentConfiguration>;
|
|
105
|
+
baseLang: string;
|
|
106
|
+
targetLang: string;
|
|
107
|
+
generatedByAI: boolean;
|
|
108
|
+
prompt: string;
|
|
109
|
+
level: number;
|
|
110
|
+
extras: ILessonExtra;
|
|
111
|
+
}
|
|
112
|
+
export interface ILessonWithTaken extends ILesson {
|
|
113
|
+
taken: any;
|
|
114
|
+
}
|
|
115
|
+
export declare abstract class LessonsAbstractService {
|
|
116
|
+
abstract getLessons(paginator?: any): Promise<any>;
|
|
117
|
+
abstract getLesson(id: string): Promise<any>;
|
|
118
|
+
abstract postLesson(lesson: ILesson): Promise<any>;
|
|
119
|
+
abstract updateLesson(lesson: ILesson): Promise<any>;
|
|
120
|
+
abstract deleteLesson(id: string): Promise<any>;
|
|
121
|
+
abstract generateLesson(lesson: ILesson): Promise<any>;
|
|
122
|
+
abstract postGenerateByAI(id: string): Promise<any>;
|
|
123
|
+
abstract extractTextFromHtml(html: string): string;
|
|
124
|
+
}
|
|
125
|
+
export declare function provideLessonsService(serviceImplementation: Type<LessonsAbstractService>): Provider[];
|
|
126
|
+
export interface LessonComponentConfiguration {
|
|
127
|
+
id: string;
|
|
128
|
+
component: LessonComponentEnum;
|
|
129
|
+
settings: LessonCompSettings;
|
|
130
|
+
}
|
|
131
|
+
export interface StorageFile {
|
|
132
|
+
bucket: string;
|
|
133
|
+
url: string;
|
|
134
|
+
path: string;
|
|
135
|
+
}
|
|
136
|
+
export interface AudioStorage extends StorageFile {
|
|
137
|
+
text?: string;
|
|
138
|
+
voiceType?: string;
|
|
139
|
+
}
|
|
140
|
+
export interface SpeakerCompConfiguration extends LessonComponentConfiguration {
|
|
141
|
+
audio: AudioStorage;
|
|
142
|
+
settings: LessonCompSettings & {
|
|
143
|
+
voice: string;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
export interface LessonComponentInterface {
|
|
147
|
+
config: LessonComponentConfiguration;
|
|
148
|
+
control?: UntypedFormControl;
|
|
149
|
+
validate?(): boolean | null;
|
|
150
|
+
evaluate?(): boolean | null;
|
|
151
|
+
}
|
|
152
|
+
export declare const LangCodeDescription: {
|
|
153
|
+
es: string;
|
|
154
|
+
en: string;
|
|
155
|
+
it: string;
|
|
156
|
+
pt: string;
|
|
157
|
+
fr: string;
|
|
158
|
+
};
|
|
159
|
+
export declare const LangCodeDescriptionEs: {
|
|
160
|
+
es: string;
|
|
161
|
+
en: string;
|
|
162
|
+
it: string;
|
|
163
|
+
pt: string;
|
|
164
|
+
fr: string;
|
|
165
|
+
};
|
|
166
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { UntypedFormArray, FormBuilder } from '@angular/forms';
|
|
3
|
+
import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
|
4
|
+
import { ComponentBuilder } from '../../ComponentBuilder';
|
|
5
|
+
import { LessonComponentConfiguration } from '../../lessons.clases';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class SelectorBuilderComponent extends ComponentBuilder implements OnInit {
|
|
8
|
+
protected formBuilder: FormBuilder;
|
|
9
|
+
protected ref: DynamicDialogRef;
|
|
10
|
+
constructor(formBuilder: FormBuilder, ref: DynamicDialogRef);
|
|
11
|
+
sampleConfig: LessonComponentConfiguration;
|
|
12
|
+
ngOnInit(): void;
|
|
13
|
+
isRendered: any;
|
|
14
|
+
pushControlToFormArray(controlName: string): void;
|
|
15
|
+
deleteFormArrayByIndex(controlName: string, index: number): void;
|
|
16
|
+
get optionsForm(): UntypedFormArray;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectorBuilderComponent, never>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectorBuilderComponent, "app-selector-builder", never, {}, {}, never, never, true, never>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentWithForm } from '../ComponentWithForm';
|
|
2
|
+
import { LessonComponentConfiguration, LessonComponentInterface } from '../lessons.clases';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class SelectorComponent extends ComponentWithForm implements LessonComponentInterface {
|
|
5
|
+
isFilled: boolean;
|
|
6
|
+
constructor();
|
|
7
|
+
config: LessonComponentConfiguration;
|
|
8
|
+
evaluate(): any;
|
|
9
|
+
validate(): boolean;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectorComponent, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectorComponent, "app-selector", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { UntypedFormBuilder } from '@angular/forms';
|
|
3
|
+
import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
|
4
|
+
import { ComponentBuilder } from '../../ComponentBuilder';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class TextWriterBuiderComponent extends ComponentBuilder implements OnInit {
|
|
7
|
+
protected formBuilder: UntypedFormBuilder;
|
|
8
|
+
protected ref: DynamicDialogRef;
|
|
9
|
+
constructor(formBuilder: UntypedFormBuilder, ref: DynamicDialogRef);
|
|
10
|
+
formGroup: import("@angular/forms").UntypedFormGroup;
|
|
11
|
+
ngOnInit(): void;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextWriterBuiderComponent, never>;
|
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextWriterBuiderComponent, "app-text-writer-buider", never, {}, {}, never, never, true, never>;
|
|
14
|
+
}
|
package/lib/components/lesson-mini-components/components/text-writer/text-writer.component.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { ComponentWithForm } from '../ComponentWithForm';
|
|
3
|
+
import { LessonComponentConfiguration, LessonComponentInterface } from '../lessons.clases';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class TextWriterComponent extends ComponentWithForm implements OnInit, LessonComponentInterface {
|
|
6
|
+
config: LessonComponentConfiguration;
|
|
7
|
+
constructor();
|
|
8
|
+
size: number;
|
|
9
|
+
hint: string;
|
|
10
|
+
ngOnInit(): void;
|
|
11
|
+
private getSize;
|
|
12
|
+
evaluate(): any;
|
|
13
|
+
validate(): boolean;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextWriterComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextWriterComponent, "app-text-writer", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { SpeakerCompConfiguration } from '../lessons.clases';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class TranslationSwitcherComponent implements OnInit {
|
|
5
|
+
config: SpeakerCompConfiguration;
|
|
6
|
+
visibleText: string;
|
|
7
|
+
ngOnInit(): void;
|
|
8
|
+
switchTranslation(): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TranslationSwitcherComponent, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TranslationSwitcherComponent, "app-translation-switcher", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { FormBuilder } from '@angular/forms';
|
|
3
|
+
import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
|
4
|
+
import { ComponentBuilder } from '../../ComponentBuilder';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class TranslationSwitcherBuilderComponent extends ComponentBuilder implements OnInit {
|
|
7
|
+
protected formBuilder: FormBuilder;
|
|
8
|
+
protected ref: DynamicDialogRef;
|
|
9
|
+
constructor(formBuilder: FormBuilder, ref: DynamicDialogRef);
|
|
10
|
+
ngOnInit(): void;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TranslationSwitcherBuilderComponent, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TranslationSwitcherBuilderComponent, "app-translation-switcher-builder", never, {}, {}, never, never, true, never>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class LangDescTranslationPipe implements PipeTransform {
|
|
4
|
+
transform(value: string, lang: string): boolean;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LangDescTranslationPipe, never>;
|
|
6
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<LangDescTranslationPipe, "langDesc", true>;
|
|
7
|
+
}
|
|
8
|
+
export declare class FlagLanguagePipe implements PipeTransform {
|
|
9
|
+
transform(lang: string): string;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FlagLanguagePipe, never>;
|
|
11
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<FlagLanguagePipe, "flagEmoji", true>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { InjectionToken, Provider, Type } from '@angular/core';
|
|
2
|
+
export type NotionDBResponse = {
|
|
3
|
+
success: boolean;
|
|
4
|
+
databases: {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
url: string;
|
|
8
|
+
created_time: string;
|
|
9
|
+
}[];
|
|
10
|
+
error?: string;
|
|
11
|
+
count: number;
|
|
12
|
+
};
|
|
13
|
+
export type NotionPageResponse = {
|
|
14
|
+
success: boolean;
|
|
15
|
+
pages: {
|
|
16
|
+
id: string;
|
|
17
|
+
title: string;
|
|
18
|
+
url: string;
|
|
19
|
+
created_time: string;
|
|
20
|
+
}[];
|
|
21
|
+
error?: string;
|
|
22
|
+
count: number;
|
|
23
|
+
};
|
|
24
|
+
export declare const NOTION_SERVICE_TOKEN: InjectionToken<NotionAbstractService>;
|
|
25
|
+
export declare abstract class NotionAbstractService {
|
|
26
|
+
abstract getDBAvailible(): Promise<NotionDBResponse>;
|
|
27
|
+
abstract getPagesAvailable(): Promise<NotionPageResponse>;
|
|
28
|
+
abstract createNotionPage(card: any): Promise<{
|
|
29
|
+
success: boolean;
|
|
30
|
+
error: string;
|
|
31
|
+
page: any;
|
|
32
|
+
}>;
|
|
33
|
+
abstract getPageInSpecificFormat(pageId: string, format: NotionExportType): Promise<any>;
|
|
34
|
+
}
|
|
35
|
+
export declare function provideNotionService(serviceImplementation: Type<NotionAbstractService>): Provider[];
|
|
36
|
+
export declare enum NotionExportType {
|
|
37
|
+
HTML = "html",
|
|
38
|
+
MARKDOWN = "markdown",
|
|
39
|
+
PLAIN_TEXT = "plain_text",
|
|
40
|
+
SIMPLE_BLOCKS = "simple_blocks"
|
|
41
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dataclouder/ngx-lessons",
|
|
3
|
+
"version": "0.0.26",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": ">=18.0.0",
|
|
6
|
+
"@angular/core": ">=18.0.0",
|
|
7
|
+
"@angular/cdk": ">=18.0.0",
|
|
8
|
+
"@dataclouder/ngx-core": ">=0.0.1",
|
|
9
|
+
"@dataclouder/ngx-cloud-storage": ">=0.0.1"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"tslib": "^2.3.0"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"peerDependenciesMeta": {
|
|
18
|
+
"@dataclouder/ngx-core": {
|
|
19
|
+
"optional": true
|
|
20
|
+
},
|
|
21
|
+
"@dataclouder/ngx-cloud-storage": {
|
|
22
|
+
"optional": true
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"module": "fesm2022/dataclouder-ngx-lessons.mjs",
|
|
27
|
+
"typings": "index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
"./package.json": {
|
|
30
|
+
"default": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./index.d.ts",
|
|
34
|
+
"default": "./fesm2022/dataclouder-ngx-lessons.mjs"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './lib/models/lessons.pipes';
|
|
2
|
+
export * from './lib/models/notion.models';
|
|
3
|
+
export * from './lib/components/dc-lessons/lesson-list/dc-lesson-list.component';
|
|
4
|
+
export * from './lib/components/dc-lessons/lesson-form/lesson-form.component';
|
|
5
|
+
export * from './lib/components/dc-lessons/dc-lesson-editor/dc-lesson-editor.component';
|
|
6
|
+
export * from './lib/components/dc-lessons/dc-lesson-card/dc-lesson-card.component';
|
|
7
|
+
export * from './lib/components/dc-lessons/dc-lesson-renderer/dc-lesson-renderer.component';
|
|
8
|
+
export * from './lib/components/lesson-mini-components/components/ComponentWithForm';
|
|
9
|
+
export * from './lib/components/lesson-mini-components/components/lesson-dynamic.component';
|
|
10
|
+
export * from './lib/components/lesson-mini-components/components/lessons.clases';
|
|
11
|
+
export * from './lib/components/lesson-mini-components/components/ComponentBuilder';
|
|
12
|
+
export * from './lib/components/lesson-mini-components/components/text-writer/text-writer-buider/text-writer-buider.component';
|
|
13
|
+
export * from './lib/components/lesson-mini-components/components/text-writer/text-writer.component';
|
|
14
|
+
export * from './lib/components/lesson-mini-components/components/selector/selector-builder/selector-builder.component';
|
|
15
|
+
export * from './lib/components/lesson-mini-components/components/selector/selector.component';
|
|
16
|
+
export * from './lib/components/lesson-mini-components/components/translationSwitcher/translationSwitcher.component';
|
|
17
|
+
export * from './lib/components/lesson-mini-components/components/translationSwitcher/translationSwitcherBuilder/translationSwitcherBuilder.component';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<div class="card-container">
|
|
2
|
+
<p-speeddial
|
|
3
|
+
class="dial-button"
|
|
4
|
+
[model]="items"
|
|
5
|
+
[radius]="70"
|
|
6
|
+
type="quarter-circle"
|
|
7
|
+
direction="down-left"
|
|
8
|
+
[buttonProps]="{ severity: 'primary', rounded: true, outlined: true, raised: true }" />
|
|
9
|
+
|
|
10
|
+
<div class="blog-card">
|
|
11
|
+
<div class="meta">
|
|
12
|
+
<div class="photo" [style.backgroundImage]="'url(' + coverUrl + ')'"></div>
|
|
13
|
+
<ul class="details">
|
|
14
|
+
<li class="author">
|
|
15
|
+
<a>{{ lesson.authorEmail }}</a>
|
|
16
|
+
</li>
|
|
17
|
+
<li class="date">{{ lesson.createdDate | date : 'dd/MM/yyyy' }}</li>
|
|
18
|
+
<li class="tags">
|
|
19
|
+
<ul>
|
|
20
|
+
<li *ngFor="let tag of lesson.tags">
|
|
21
|
+
<a>{{ tag }}</a>
|
|
22
|
+
</li>
|
|
23
|
+
</ul>
|
|
24
|
+
</li>
|
|
25
|
+
</ul>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="description">
|
|
29
|
+
<h1>{{ lesson.title }}</h1>
|
|
30
|
+
<p>{{ lesson.description }}</p>
|
|
31
|
+
<div class="card-footer">
|
|
32
|
+
<div class="status-tags">
|
|
33
|
+
<span class="level-tag">Nivel {{ lesson.level }}</span>
|
|
34
|
+
<span *ngIf="lesson.taken?.status == 'passed'" class="status-tag success">Tomada</span>
|
|
35
|
+
<span *ngIf="lesson.taken?.status == 'failed'" class="status-tag danger">Fallida</span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="actions">
|
|
39
|
+
<p-button label="Tomar lección" (onClick)="eventCard(eventType.Take)" severity="primary"> </p-button>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
.card-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.dial-button{
|
|
6
|
+
position: absolute; top: 10px; right: 20px;
|
|
7
|
+
z-index: 10;
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.blog-card {
|
|
12
|
+
position: relative;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
background: #fff;
|
|
16
|
+
border-radius: 12px;
|
|
17
|
+
background: rgba(255, 255, 255, 0.1);
|
|
18
|
+
border-radius: 12px;
|
|
19
|
+
|
|
20
|
+
box-shadow: 0 0 20px var(--primary-color);
|
|
21
|
+
margin: 1rem;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
transition: all 0.3s ease;
|
|
24
|
+
|
|
25
|
+
&:hover {
|
|
26
|
+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
|
|
27
|
+
transform: translateY(-2px);
|
|
28
|
+
|
|
29
|
+
&:before {
|
|
30
|
+
opacity: 1;
|
|
31
|
+
box-shadow: 0 0 15px var(--blue-color);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.meta {
|
|
36
|
+
position: relative;
|
|
37
|
+
flex: 1;
|
|
38
|
+
max-width: 300px;
|
|
39
|
+
|
|
40
|
+
.photo {
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 0;
|
|
43
|
+
right: 0;
|
|
44
|
+
bottom: 0;
|
|
45
|
+
left: 0;
|
|
46
|
+
background-size: cover;
|
|
47
|
+
background-position: center;
|
|
48
|
+
|
|
49
|
+
&::before {
|
|
50
|
+
content: "";
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: 0;
|
|
53
|
+
right: 0;
|
|
54
|
+
bottom: 0;
|
|
55
|
+
left: 0;
|
|
56
|
+
background: rgba(0, 0, 0, 0.3);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.details {
|
|
61
|
+
position: relative;
|
|
62
|
+
z-index: 1;
|
|
63
|
+
list-style: none;
|
|
64
|
+
padding: 1rem;
|
|
65
|
+
color: #fff;
|
|
66
|
+
|
|
67
|
+
li {
|
|
68
|
+
margin-bottom: 0.5rem;
|
|
69
|
+
|
|
70
|
+
&.author a {
|
|
71
|
+
color: #fff;
|
|
72
|
+
font-weight: bold;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&.date {
|
|
76
|
+
font-size: 0.9rem;
|
|
77
|
+
opacity: 0.8;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&.tags ul {
|
|
81
|
+
list-style: none;
|
|
82
|
+
padding: 0;
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-wrap: wrap;
|
|
85
|
+
gap: 0.5rem;
|
|
86
|
+
|
|
87
|
+
li a {
|
|
88
|
+
color: #fff;
|
|
89
|
+
font-size: 0.8rem;
|
|
90
|
+
opacity: 0.8;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.description {
|
|
98
|
+
flex: 2;
|
|
99
|
+
padding: 1.5rem;
|
|
100
|
+
background: #fff;
|
|
101
|
+
|
|
102
|
+
h1 {
|
|
103
|
+
margin: 0 0 1rem;
|
|
104
|
+
font-size: 1.5rem;
|
|
105
|
+
color: #333;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
p {
|
|
109
|
+
color: #666;
|
|
110
|
+
line-height: 1.5;
|
|
111
|
+
margin-bottom: 1rem;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.card-footer {
|
|
115
|
+
display: flex;
|
|
116
|
+
justify-content: space-between;
|
|
117
|
+
align-items: center;
|
|
118
|
+
margin-top: 1rem;
|
|
119
|
+
|
|
120
|
+
.status-tags {
|
|
121
|
+
display: flex;
|
|
122
|
+
gap: 0.5rem;
|
|
123
|
+
|
|
124
|
+
.level-tag {
|
|
125
|
+
background: #e0e7ff;
|
|
126
|
+
color: #4338ca;
|
|
127
|
+
padding: 0.3rem 0.8rem;
|
|
128
|
+
border-radius: 4px;
|
|
129
|
+
font-size: 0.9rem;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.status-tag {
|
|
133
|
+
padding: 0.3rem 0.8rem;
|
|
134
|
+
border-radius: 4px;
|
|
135
|
+
font-size: 0.9rem;
|
|
136
|
+
|
|
137
|
+
&.success {
|
|
138
|
+
background: #dcfce7;
|
|
139
|
+
color: #166534;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&.danger {
|
|
143
|
+
background: #fee2e2;
|
|
144
|
+
color: #991b1b;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.actions {
|
|
150
|
+
display: flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
gap: 1rem;
|
|
153
|
+
|
|
154
|
+
.admin-actions {
|
|
155
|
+
display: flex;
|
|
156
|
+
gap: 0.5rem;
|
|
157
|
+
|
|
158
|
+
.icon-button {
|
|
159
|
+
background: none;
|
|
160
|
+
border: none;
|
|
161
|
+
padding: 0.5rem;
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
border-radius: 4px;
|
|
164
|
+
transition: background 0.2s;
|
|
165
|
+
|
|
166
|
+
&.edit {
|
|
167
|
+
color: #4338ca;
|
|
168
|
+
&:hover { background: #e0e7ff; }
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&.delete {
|
|
172
|
+
color: #dc2626;
|
|
173
|
+
&:hover { background: #fee2e2; }
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.take-lesson {
|
|
179
|
+
background: #4338ca;
|
|
180
|
+
color: white;
|
|
181
|
+
border: none;
|
|
182
|
+
padding: 0.5rem 1rem;
|
|
183
|
+
border-radius: 4px;
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
transition: background 0.2s;
|
|
186
|
+
|
|
187
|
+
&:hover {
|
|
188
|
+
background: #3730a3;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@media (max-width: 768px) {
|
|
197
|
+
.blog-card {
|
|
198
|
+
flex-direction: column;
|
|
199
|
+
|
|
200
|
+
.meta {
|
|
201
|
+
max-width: 100%;
|
|
202
|
+
min-height: 200px;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
span[class^="p-"] {
|
|
208
|
+
position: absolute;
|
|
209
|
+
top: 10px;
|
|
210
|
+
right: 10px;
|
|
211
|
+
cursor: pointer;
|
|
212
|
+
z-index: 30;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.blog-card.glow-effect {
|
|
216
|
+
&:before {
|
|
217
|
+
content: '';
|
|
218
|
+
position: absolute;
|
|
219
|
+
top: -5px;
|
|
220
|
+
left: -5px;
|
|
221
|
+
right: -5px;
|
|
222
|
+
bottom: -5px;
|
|
223
|
+
border-radius: 12px;
|
|
224
|
+
background: rgba(255, 255, 255, 0.1);
|
|
225
|
+
z-index: -2;
|
|
226
|
+
transition: all 0.3s ease;
|
|
227
|
+
opacity: 0.5;
|
|
228
|
+
box-shadow: 0 0 45px rgba(0, 123, 255, 0.689);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&:hover:before {
|
|
232
|
+
opacity: 1;
|
|
233
|
+
box-shadow: 0 0 60px rgba(0, 123, 255, 0.8);
|
|
234
|
+
}
|
|
235
|
+
}
|