croco-html 4.1.0 → 4.1.1
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/croco-html.mjs +435 -357
- package/fesm2022/croco-html.mjs.map +1 -1
- package/lib/components/editor/text-editor/text-editor.component.d.ts +2 -4
- package/lib/components/editor/visual-editor/DefaultAligments.d.ts +2 -6
- package/lib/components/editor/visual-editor/visual-editor.component.d.ts +3 -6
- package/lib/extensions/TextSimpleMethods.d.ts +0 -3
- package/lib/index.d.ts +7 -7
- package/lib/tag-services/ButtonTagService.d.ts +2 -1
- package/lib/tag-services/CustomWidgetTagService.d.ts +2 -1
- package/lib/tag-services/DownloadButtonTagService.d.ts +2 -1
- package/lib/tag-services/ExternalVideoTagService.d.ts +2 -1
- package/lib/tag-services/FileImageTagService.d.ts +1 -0
- package/lib/tag-services/HtmlRawTagService.d.ts +2 -1
- package/lib/tag-services/IMarkUpTagService.d.ts +9 -0
- package/lib/tag-services/TextTagHtmlMarkupTagService.d.ts +10 -1
- package/package.json +1 -1
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { EventEmitter
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import { HtmlBodyTag } from '../../../models/models';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class TextEditorComponent
|
|
4
|
+
export declare class TextEditorComponent {
|
|
5
5
|
tag: HtmlBodyTag;
|
|
6
6
|
onTagUpdated: EventEmitter<HtmlBodyTag>;
|
|
7
|
-
constructor();
|
|
8
|
-
ngOnInit(): void;
|
|
9
7
|
getInnerHtml(): string;
|
|
10
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<TextEditorComponent, never>;
|
|
11
9
|
static ɵcmp: i0.ɵɵComponentDeclaration<TextEditorComponent, "croco-html-text-editor", never, { "tag": { "alias": "tag"; "required": false; }; }, { "onTagUpdated": "onTagUpdated"; }, never, never, true, never>;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Left = "left",
|
|
3
|
-
Center = "center",
|
|
4
|
-
Right = "right"
|
|
5
|
-
}
|
|
1
|
+
import { TextAlignment } from "../../../tag-services";
|
|
6
2
|
export declare const AlignmentsData: {
|
|
7
|
-
value:
|
|
3
|
+
value: TextAlignment;
|
|
8
4
|
text: string;
|
|
9
5
|
}[];
|
|
@@ -3,14 +3,11 @@ import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnInit } fr
|
|
|
3
3
|
import { ExternalVideoSupportedTypes } from '../../../extensions';
|
|
4
4
|
import { ExternalVideoTagDataConsts } from '../../../extensions';
|
|
5
5
|
import { TagItem, HtmlBodyTag } from '../../../models/models';
|
|
6
|
-
import { EAlignments } from "./DefaultAligments";
|
|
7
6
|
import { CrocoHtmlOptions } from '../../../options';
|
|
8
7
|
import { HtmlRawTagDataConsts } from "../../../extensions/HtmlRawTagDataConsts";
|
|
9
8
|
import { SpriteIdsType } from "../../../../sprites-ids.type";
|
|
9
|
+
import { TextAlignment } from '../../../tag-services';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
|
-
export declare const defaultLinkYouTube = "https://www.youtube.com/embed/4CtSAnJDfsI?si=scyBNJa0Hs2t5aLE";
|
|
12
|
-
export declare const defaultLinkVk = "https://vk.com/video_ext.php?oid=-22822305&id=456241864&hd=2";
|
|
13
|
-
export declare const defaultLinkForDownload = "https://storage.yandexcloud.net/mega-academy/presentation.pdf";
|
|
14
11
|
export declare class VisualEditorComponent implements OnInit, AfterViewInit {
|
|
15
12
|
private readonly _cdref;
|
|
16
13
|
private readonly _options;
|
|
@@ -19,11 +16,11 @@ export declare class VisualEditorComponent implements OnInit, AfterViewInit {
|
|
|
19
16
|
loadingText: string;
|
|
20
17
|
text: string;
|
|
21
18
|
htmlRaw: string;
|
|
22
|
-
alignment:
|
|
19
|
+
alignment: TextAlignment;
|
|
23
20
|
textTag: string;
|
|
24
21
|
textTagOptions: TagItem[];
|
|
25
22
|
alignmentOptions: {
|
|
26
|
-
value:
|
|
23
|
+
value: TextAlignment;
|
|
27
24
|
text: string;
|
|
28
25
|
}[];
|
|
29
26
|
showMarkUp: boolean;
|
package/lib/index.d.ts
CHANGED
|
@@ -3,22 +3,22 @@ import { MainEditorBlockComponent } from "./components";
|
|
|
3
3
|
import { MainEditorComponent } from "./components";
|
|
4
4
|
import { TextEditorComponent } from "./components";
|
|
5
5
|
import { FileIdSelectComponent } from "./components";
|
|
6
|
-
import { XmlTagHeaderInnerTextViewComponent } from "./components";
|
|
7
|
-
import { XmlTagHtmlViewComponent } from "./components";
|
|
8
6
|
import { XmlTagTableViewComponent } from "./components";
|
|
7
|
+
import { XmlTagTextViewComponent } from "./components";
|
|
9
8
|
import { XmlTagViewComponent } from "./components";
|
|
10
9
|
import { CustomWidgetEditorComponent } from "./components";
|
|
11
10
|
import { VisualEditorComponent } from './components';
|
|
12
11
|
import { AddFilesBtnComponent } from './components';
|
|
13
12
|
import { XmlTagExternalVideoComponent } from "./components";
|
|
14
13
|
import { HtmlRawEditorComponent } from "./components";
|
|
15
|
-
import {
|
|
14
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
16
15
|
import { TagToSpanPipe, ToHtmlBodyTagsPipe, ToPreviewHtmlPipe, ToPreviewPipe } from "./pipes";
|
|
17
16
|
import { FileImageTagViewComponent, UploadFilesBtnComponent } from "./components";
|
|
18
17
|
import { HtmlRawViewComponent } from "./components";
|
|
18
|
+
import { HtmlViewComponent } from "./components";
|
|
19
19
|
import { XmlTagCustomWidgetComponent } from "./components";
|
|
20
|
-
export declare const EditorComponents: (typeof
|
|
21
|
-
export declare const XmlComponents: (typeof
|
|
20
|
+
export declare const EditorComponents: (typeof CustomWidgetEditorComponent | typeof AddFilesBtnComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof MainEditorComponent | typeof TextEditorComponent | typeof ImageEditorComponent | typeof HtmlRawEditorComponent | typeof FileIdSelectComponent)[];
|
|
21
|
+
export declare const XmlComponents: (typeof XmlTagCustomWidgetComponent | typeof HtmlViewComponent | typeof XmlTagTextViewComponent | typeof XmlTagExternalVideoComponent | typeof XmlTagTableViewComponent | typeof FileImageTagViewComponent | typeof HtmlRawViewComponent | typeof XmlTagViewComponent)[];
|
|
22
22
|
export declare const CrocoPipes: (typeof ToPreviewPipe | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
|
|
23
|
-
export declare const CrocoHtmlDeclarations: (typeof
|
|
24
|
-
export declare const MaterialModules: (typeof
|
|
23
|
+
export declare const CrocoHtmlDeclarations: (typeof XmlTagCustomWidgetComponent | typeof CustomWidgetEditorComponent | typeof AddFilesBtnComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof HtmlViewComponent | typeof MainEditorComponent | typeof XmlTagTextViewComponent | typeof TextEditorComponent | typeof ImageEditorComponent | typeof HtmlRawEditorComponent | typeof UploadFilesBtnComponent | typeof XmlTagExternalVideoComponent | typeof XmlTagTableViewComponent | typeof FileImageTagViewComponent | typeof HtmlRawViewComponent | typeof XmlTagViewComponent | typeof FileIdSelectComponent | typeof ToPreviewPipe | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
|
|
24
|
+
export declare const MaterialModules: (typeof MatFormFieldModule)[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InterfaceBlock } from "../extensions/InterfaceBlock";
|
|
2
2
|
import { HtmlBodyTag } from "../models";
|
|
3
3
|
import { CrocoHtmlOptions } from "../options";
|
|
4
|
-
import { IMarkUpTagService } from "./IMarkUpTagService";
|
|
4
|
+
import { IMarkUpTagService, IVisualEditorProps } from "./IMarkUpTagService";
|
|
5
5
|
export declare class ButtonTagDataConsts {
|
|
6
6
|
static readonly TagName = "button";
|
|
7
7
|
static readonly TextAttrName = "text";
|
|
@@ -23,4 +23,5 @@ export declare class ButtonTagService implements IMarkUpTagService {
|
|
|
23
23
|
bodyTagToHtmlStringConverter(bodyTag: HtmlBodyTag): string;
|
|
24
24
|
extractBlockFromHtmlElement(elem: HTMLElement, options: CrocoHtmlOptions): InterfaceBlock;
|
|
25
25
|
toBodyTag(data: InterfaceBlock): HtmlBodyTag;
|
|
26
|
+
getDefaultValue(props: IVisualEditorProps): HtmlBodyTag;
|
|
26
27
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InterfaceBlock } from "../extensions/InterfaceBlock";
|
|
2
2
|
import { HtmlBodyTag } from "../models";
|
|
3
3
|
import { CrocoHtmlOptions } from "../options";
|
|
4
|
-
import { IMarkUpTagService } from "./IMarkUpTagService";
|
|
4
|
+
import { IMarkUpTagService, IVisualEditorProps } from "./IMarkUpTagService";
|
|
5
5
|
export declare class CustomWidgetTagDataConsts {
|
|
6
6
|
static readonly TagName = "custom-widget";
|
|
7
7
|
static readonly TypeAttrName = "type";
|
|
@@ -23,6 +23,7 @@ export declare class CustomWidgetTagService implements IMarkUpTagService {
|
|
|
23
23
|
bodyTagToHtmlStringConverter(bodyTag: HtmlBodyTag): string;
|
|
24
24
|
extractBlockFromHtmlElement(elem: HTMLElement, options: CrocoHtmlOptions): InterfaceBlock;
|
|
25
25
|
toBodyTag(data: InterfaceBlock): HtmlBodyTag;
|
|
26
|
+
getDefaultValue(props: IVisualEditorProps): HtmlBodyTag;
|
|
26
27
|
static ExtractCustomWidgetTagData(attributes: any): CustomWidgetTagData;
|
|
27
28
|
static ExtractCustomWidgetAttributes(customWidgetTagData: CustomWidgetTagData): {
|
|
28
29
|
type: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InterfaceBlock } from "../extensions/InterfaceBlock";
|
|
2
2
|
import { HtmlBodyTag } from "../models";
|
|
3
3
|
import { CrocoHtmlOptions } from "../options";
|
|
4
|
-
import { IMarkUpTagService } from "./IMarkUpTagService";
|
|
4
|
+
import { IMarkUpTagService, IVisualEditorProps } from "./IMarkUpTagService";
|
|
5
5
|
export declare class DownloadButtonTagDataConsts {
|
|
6
6
|
static readonly TagName = "download-file-button";
|
|
7
7
|
static readonly TitleAttrName = "title";
|
|
@@ -21,4 +21,5 @@ export declare class DownloadButtonTagService implements IMarkUpTagService {
|
|
|
21
21
|
bodyTagToHtmlStringConverter(bodyTag: HtmlBodyTag): string;
|
|
22
22
|
extractBlockFromHtmlElement(elem: HTMLElement, options: CrocoHtmlOptions): InterfaceBlock;
|
|
23
23
|
toBodyTag(data: InterfaceBlock): HtmlBodyTag;
|
|
24
|
+
getDefaultValue(props: IVisualEditorProps): HtmlBodyTag;
|
|
24
25
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { InterfaceBlock } from "../extensions/InterfaceBlock";
|
|
2
2
|
import { HtmlBodyTag } from "../models";
|
|
3
3
|
import { CrocoHtmlOptions } from "../options";
|
|
4
|
-
import { IMarkUpTagService } from "./IMarkUpTagService";
|
|
4
|
+
import { IMarkUpTagService, IVisualEditorProps } from "./IMarkUpTagService";
|
|
5
5
|
export declare class ExternalVideoTagService implements IMarkUpTagService {
|
|
6
6
|
tagName: string;
|
|
7
7
|
shortDescription: string;
|
|
8
8
|
bodyTagToHtmlStringConverter(bodyTag: HtmlBodyTag): string;
|
|
9
9
|
extractBlockFromHtmlElement(elem: HTMLElement, options: CrocoHtmlOptions): InterfaceBlock;
|
|
10
10
|
toBodyTag(data: InterfaceBlock): HtmlBodyTag;
|
|
11
|
+
getDefaultValue(props: IVisualEditorProps): HtmlBodyTag;
|
|
11
12
|
}
|
|
@@ -8,4 +8,5 @@ export declare class FileImageTagService implements IMarkUpTagService {
|
|
|
8
8
|
bodyTagToHtmlStringConverter(bodyTag: HtmlBodyTag): string;
|
|
9
9
|
extractBlockFromHtmlElement(elem: HTMLElement, options: CrocoHtmlOptions): InterfaceBlock;
|
|
10
10
|
toBodyTag(data: InterfaceBlock): HtmlBodyTag;
|
|
11
|
+
getDefaultValue(): HtmlBodyTag;
|
|
11
12
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { InterfaceBlock } from "../extensions/InterfaceBlock";
|
|
2
2
|
import { HtmlBodyTag } from "../models";
|
|
3
3
|
import { CrocoHtmlOptions } from "../options";
|
|
4
|
-
import { IMarkUpTagService } from "./IMarkUpTagService";
|
|
4
|
+
import { IMarkUpTagService, IVisualEditorProps } from "./IMarkUpTagService";
|
|
5
5
|
export declare class HtmlRawTagService implements IMarkUpTagService {
|
|
6
6
|
tagName: string;
|
|
7
7
|
shortDescription: string;
|
|
8
8
|
bodyTagToHtmlStringConverter(bodyTag: HtmlBodyTag): string;
|
|
9
9
|
extractBlockFromHtmlElement(elem: HTMLElement, options: CrocoHtmlOptions): InterfaceBlock;
|
|
10
10
|
toBodyTag(data: InterfaceBlock): HtmlBodyTag;
|
|
11
|
+
getDefaultValue(props: IVisualEditorProps): HtmlBodyTag;
|
|
11
12
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { InterfaceBlock } from "../extensions/InterfaceBlock";
|
|
2
2
|
import { HtmlBodyTag } from "../models";
|
|
3
3
|
import { CrocoHtmlOptions } from "../options";
|
|
4
|
+
export interface IVisualEditorProps {
|
|
5
|
+
selectedVideoPlayer: string;
|
|
6
|
+
htmlRaw: string;
|
|
7
|
+
}
|
|
4
8
|
export interface IMarkUpTagService {
|
|
5
9
|
/**
|
|
6
10
|
* Название тега
|
|
@@ -23,4 +27,9 @@ export interface IMarkUpTagService {
|
|
|
23
27
|
* @returns
|
|
24
28
|
*/
|
|
25
29
|
toBodyTag: (data: InterfaceBlock) => HtmlBodyTag;
|
|
30
|
+
/**
|
|
31
|
+
* Получить значение по умолчанию
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
getDefaultValue: (props: IVisualEditorProps) => HtmlBodyTag;
|
|
26
35
|
}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { InterfaceBlock } from "../extensions/InterfaceBlock";
|
|
2
2
|
import { HtmlBodyTag } from "../models";
|
|
3
3
|
import { CrocoHtmlOptions } from "../options";
|
|
4
|
-
import { IMarkUpTagService } from "../tag-services/IMarkUpTagService";
|
|
4
|
+
import { IMarkUpTagService, IVisualEditorProps } from "../tag-services/IMarkUpTagService";
|
|
5
|
+
export declare enum TextAlignment {
|
|
6
|
+
Left = "left",
|
|
7
|
+
Center = "center",
|
|
8
|
+
Right = "right"
|
|
9
|
+
}
|
|
10
|
+
export declare class TextTagDataConsts {
|
|
11
|
+
static readonly HAlign = "h-align";
|
|
12
|
+
}
|
|
5
13
|
export declare class TextTagHtmlMarkupTagService implements IMarkUpTagService {
|
|
6
14
|
constructor(tagName: string, shortDescription: string);
|
|
7
15
|
tagName: string;
|
|
@@ -9,4 +17,5 @@ export declare class TextTagHtmlMarkupTagService implements IMarkUpTagService {
|
|
|
9
17
|
bodyTagToHtmlStringConverter(bodyTag: HtmlBodyTag): string;
|
|
10
18
|
extractBlockFromHtmlElement(elem: HTMLElement, options: CrocoHtmlOptions): InterfaceBlock;
|
|
11
19
|
toBodyTag(data: InterfaceBlock): HtmlBodyTag;
|
|
20
|
+
getDefaultValue(props: IVisualEditorProps): HtmlBodyTag;
|
|
12
21
|
}
|