croco-html 2.1.1 → 2.2.0
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/esm2022/lib/components/editor/image-editor/image-editor.component.mjs +11 -6
- package/esm2022/lib/components/editor/visual-editor/visual-editor.component.mjs +11 -6
- package/esm2022/lib/components/file-id-select/file-id-select.component.mjs +11 -6
- package/esm2022/lib/consts/index.mjs +2 -0
- package/esm2022/lib/extensions/BodyTagsExtensions.mjs +1 -1
- package/esm2022/lib/extensions/HtmlExtractionMethods.mjs +1 -1
- package/esm2022/lib/extensions/ImageMethods.mjs +10 -13
- package/esm2022/lib/extensions/TableMethods.mjs +1 -1
- package/esm2022/lib/extensions/index.mjs +1 -3
- package/esm2022/lib/pipes/ToHtmlBodyTagsPipe.mjs +12 -5
- package/esm2022/lib/pipes/ToPreviewHtmlPipe.mjs +13 -6
- package/esm2022/lib/pipes/to-preview.pipe.mjs +12 -8
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/croco-html.mjs +64 -38
- package/fesm2022/croco-html.mjs.map +1 -1
- package/lib/components/editor/image-editor/image-editor.component.d.ts +3 -1
- package/lib/components/editor/visual-editor/visual-editor.component.d.ts +4 -2
- package/lib/components/file-id-select/file-id-select.component.d.ts +4 -2
- package/lib/consts/index.d.ts +1 -0
- package/lib/extensions/BodyTagsExtensions.d.ts +2 -2
- package/lib/extensions/HtmlExtractionMethods.d.ts +18 -19
- package/lib/extensions/ImageMethods.d.ts +5 -4
- package/lib/extensions/TableMethods.d.ts +3 -3
- package/lib/index.d.ts +5 -4
- package/lib/pipes/ToHtmlBodyTagsPipe.d.ts +3 -0
- package/lib/pipes/ToPreviewHtmlPipe.d.ts +4 -2
- package/lib/pipes/to-preview.pipe.d.ts +3 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
2
|
import { HtmlBodyTag } from '../../../models/models';
|
|
3
|
+
import { CrocoHtmlOptions } from '../../../extensions/HtmlExtractionMethods';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class ImageEditorComponent implements OnInit {
|
|
6
|
+
private readonly _options;
|
|
5
7
|
hasImageError: boolean;
|
|
6
8
|
searchOrEdit: string;
|
|
7
9
|
tag: HtmlBodyTag;
|
|
8
10
|
onErrorHandler(): void;
|
|
9
11
|
onTagUpdated: EventEmitter<HtmlBodyTag>;
|
|
10
|
-
constructor();
|
|
12
|
+
constructor(_options: CrocoHtmlOptions);
|
|
11
13
|
getSrc(): string;
|
|
12
14
|
hasFileId(): boolean;
|
|
13
15
|
onFileIdChanged(fileId: number): void;
|
|
@@ -3,9 +3,11 @@ import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnInit } fr
|
|
|
3
3
|
import { TagItem, HtmlBodyTag } from '../../../models/models';
|
|
4
4
|
import { FilePostingStarted } from '../../upload-files-btn/upload-files-btn.component';
|
|
5
5
|
import { EAlignments } from "./DefaultAligments";
|
|
6
|
+
import { CrocoHtmlOptions } from '../../../extensions/HtmlExtractionMethods';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
export declare class VisualEditorComponent implements OnInit, AfterViewInit {
|
|
8
|
-
private _cdref;
|
|
9
|
+
private readonly _cdref;
|
|
10
|
+
private readonly _options;
|
|
9
11
|
textArea: ElementRef;
|
|
10
12
|
isLoading: boolean;
|
|
11
13
|
loadingText: string;
|
|
@@ -30,7 +32,7 @@ export declare class VisualEditorComponent implements OnInit, AfterViewInit {
|
|
|
30
32
|
rendered: EventEmitter<boolean>;
|
|
31
33
|
bodyTags: HtmlBodyTag[];
|
|
32
34
|
saveBodyTags: HtmlBodyTag[];
|
|
33
|
-
constructor(_cdref: ChangeDetectorRef);
|
|
35
|
+
constructor(_cdref: ChangeDetectorRef, _options: CrocoHtmlOptions);
|
|
34
36
|
ngAfterViewInit(): void;
|
|
35
37
|
ngAfterContentChecked(): void;
|
|
36
38
|
addTag(): void;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { FileNameAndIdModel, FilesQueryService } from '../../services/files-query.service';
|
|
3
|
+
import { CrocoHtmlOptions } from '../../extensions/HtmlExtractionMethods';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export interface SearchQuestionsFormData {
|
|
5
6
|
q: string;
|
|
6
7
|
}
|
|
7
8
|
export declare class FileIdSelectComponent implements OnInit, OnChanges {
|
|
8
|
-
private _fileService;
|
|
9
|
+
private readonly _fileService;
|
|
10
|
+
private readonly _options;
|
|
9
11
|
q: string;
|
|
10
12
|
labelText: string;
|
|
11
13
|
fileId: number;
|
|
12
14
|
loading: boolean;
|
|
13
15
|
files: FileNameAndIdModel[];
|
|
14
16
|
onFileIdChanged: EventEmitter<number>;
|
|
15
|
-
constructor(_fileService: FilesQueryService);
|
|
17
|
+
constructor(_fileService: FilesQueryService, _options: CrocoHtmlOptions);
|
|
16
18
|
onModelChanged(fileId: number): void;
|
|
17
19
|
getSrc(fileId: number): string;
|
|
18
20
|
ngOnInit(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CrocoHtmlOptionsToken = "croco-html-options";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { HtmlBodyTag } from "../models/models";
|
|
2
|
-
import {
|
|
2
|
+
import { CrocoHtmlOptions } from "./HtmlExtractionMethods";
|
|
3
3
|
import { InterfaceBlock } from "./InterfaceBlock";
|
|
4
4
|
export declare class BodyTagsExtensions {
|
|
5
5
|
static getDescription(tagName: string): string;
|
|
6
6
|
static toHtml(bodyTags: HtmlBodyTag[]): string;
|
|
7
7
|
static imageTagToHtml(imageTag: HtmlBodyTag): string;
|
|
8
|
-
static getBodyTags(html: string, options:
|
|
8
|
+
static getBodyTags(html: string, options: CrocoHtmlOptions): HtmlBodyTag[];
|
|
9
9
|
static sanitizeInnerHtml(html: string): string;
|
|
10
10
|
static toBodyTag(data: InterfaceBlock): HtmlBodyTag;
|
|
11
11
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { InterfaceBlock } from "./InterfaceBlock";
|
|
2
2
|
import { GenericTextTag } from "./TextSimpleMethods";
|
|
3
|
-
export interface
|
|
4
|
-
|
|
5
|
-
domain: string;
|
|
3
|
+
export interface CrocoHtmlOptions {
|
|
4
|
+
publicImageResizedUrlFormat: string;
|
|
6
5
|
}
|
|
7
6
|
export declare class HtmlExtractionMethods {
|
|
8
7
|
static ExtractHeaderTag(elem: HTMLElement, tagName: string): GenericTextTag;
|
|
9
8
|
static Extractors: {
|
|
10
|
-
[x: string]: ((elem: HTMLElement, options:
|
|
9
|
+
[x: string]: ((elem: HTMLElement, options: CrocoHtmlOptions) => import("./ImageMethods").FileImageTag) | ((elem: HTMLElement, options: CrocoHtmlOptions) => {
|
|
11
10
|
type: string;
|
|
12
11
|
data: import("./TableMethods").TableData;
|
|
13
12
|
validationResult: import("./TableMethods").BaseApiResponse;
|
|
@@ -26,15 +25,15 @@ export declare class HtmlExtractionMethods {
|
|
|
26
25
|
data: import("./TableMethods").TableData;
|
|
27
26
|
validationResult: import("./TableMethods").BaseApiResponse;
|
|
28
27
|
bootstrapHtml: string;
|
|
29
|
-
}) | ((elem: HTMLElement, options:
|
|
28
|
+
}) | ((elem: HTMLElement, options: CrocoHtmlOptions) => import("./TextMethods").RichTextData) | ((elem: HTMLElement, options: CrocoHtmlOptions) => {
|
|
30
29
|
type: string;
|
|
31
30
|
data: {
|
|
32
31
|
innerHTML: string;
|
|
33
32
|
};
|
|
34
|
-
}) | ((elem: HTMLElement, options:
|
|
35
|
-
TEXT: (elem: HTMLElement, options:
|
|
36
|
-
"FILE-IMAGE": (elem: HTMLElement, options:
|
|
37
|
-
TABLE: (elem: HTMLElement, options:
|
|
33
|
+
}) | ((elem: HTMLElement, options: CrocoHtmlOptions) => GenericTextTag) | ((elem: HTMLElement, options: CrocoHtmlOptions) => import("./VideoMethods").ExternalVideoTag);
|
|
34
|
+
TEXT: (elem: HTMLElement, options: CrocoHtmlOptions) => import("./TextSimpleMethods").SimpleTextTag;
|
|
35
|
+
"FILE-IMAGE": (elem: HTMLElement, options: CrocoHtmlOptions) => import("./ImageMethods").FileImageTag;
|
|
36
|
+
TABLE: (elem: HTMLElement, options: CrocoHtmlOptions) => {
|
|
38
37
|
type: string;
|
|
39
38
|
data: import("./TableMethods").TableData;
|
|
40
39
|
validationResult: import("./TableMethods").BaseApiResponse;
|
|
@@ -54,20 +53,20 @@ export declare class HtmlExtractionMethods {
|
|
|
54
53
|
validationResult: import("./TableMethods").BaseApiResponse;
|
|
55
54
|
bootstrapHtml: string;
|
|
56
55
|
};
|
|
57
|
-
"RICH-TEXT": (elem: HTMLElement, options:
|
|
58
|
-
"HTML-RAW": (elem: HTMLElement, options:
|
|
56
|
+
"RICH-TEXT": (elem: HTMLElement, options: CrocoHtmlOptions) => import("./TextMethods").RichTextData;
|
|
57
|
+
"HTML-RAW": (elem: HTMLElement, options: CrocoHtmlOptions) => {
|
|
59
58
|
type: string;
|
|
60
59
|
data: {
|
|
61
60
|
innerHTML: string;
|
|
62
61
|
};
|
|
63
62
|
};
|
|
64
|
-
H1: (elem: HTMLElement, options:
|
|
65
|
-
H2: (elem: HTMLElement, options:
|
|
66
|
-
H3: (elem: HTMLElement, options:
|
|
67
|
-
H4: (elem: HTMLElement, options:
|
|
68
|
-
H5: (elem: HTMLElement, options:
|
|
69
|
-
H6: (elem: HTMLElement, options:
|
|
63
|
+
H1: (elem: HTMLElement, options: CrocoHtmlOptions) => GenericTextTag;
|
|
64
|
+
H2: (elem: HTMLElement, options: CrocoHtmlOptions) => GenericTextTag;
|
|
65
|
+
H3: (elem: HTMLElement, options: CrocoHtmlOptions) => GenericTextTag;
|
|
66
|
+
H4: (elem: HTMLElement, options: CrocoHtmlOptions) => GenericTextTag;
|
|
67
|
+
H5: (elem: HTMLElement, options: CrocoHtmlOptions) => GenericTextTag;
|
|
68
|
+
H6: (elem: HTMLElement, options: CrocoHtmlOptions) => GenericTextTag;
|
|
70
69
|
};
|
|
71
|
-
static transformHtmlElementToBlocks(element: HTMLElement, options:
|
|
72
|
-
static transformHtmlStringToBlocks(value: string, options:
|
|
70
|
+
static transformHtmlElementToBlocks(element: HTMLElement, options: CrocoHtmlOptions): InterfaceBlock[];
|
|
71
|
+
static transformHtmlStringToBlocks(value: string, options: CrocoHtmlOptions): InterfaceBlock[];
|
|
73
72
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CrocoHtmlOptions } from "./HtmlExtractionMethods";
|
|
2
2
|
export declare class FileImageTagDataConsts {
|
|
3
3
|
static TagName: string;
|
|
4
4
|
static FileIdAttrName: string;
|
|
@@ -12,7 +12,8 @@ export interface FileImageTagData {
|
|
|
12
12
|
fileId: number;
|
|
13
13
|
}
|
|
14
14
|
export declare class ImageMethods {
|
|
15
|
-
static buildUrl(fileId: number, options:
|
|
16
|
-
static buildSmallUrl(fileId: number, options:
|
|
17
|
-
static
|
|
15
|
+
static buildUrl(fileId: number, sizeType: string, options: CrocoHtmlOptions): string;
|
|
16
|
+
static buildSmallUrl(fileId: number, options: CrocoHtmlOptions): string;
|
|
17
|
+
static buildMediumUrl(fileId: number, options: CrocoHtmlOptions): string;
|
|
18
|
+
static ExtractImage(elem: HTMLElement, options: CrocoHtmlOptions): FileImageTag;
|
|
18
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CrocoHtmlOptions } from './HtmlExtractionMethods';
|
|
2
2
|
import { InterfaceBlock } from "./InterfaceBlock";
|
|
3
3
|
export interface BaseApiResponse {
|
|
4
4
|
isSucceeded: boolean;
|
|
@@ -33,7 +33,7 @@ export declare class TableTypes {
|
|
|
33
33
|
static readonly TableRowColumn = "table-row-column";
|
|
34
34
|
}
|
|
35
35
|
export declare class TableMethods {
|
|
36
|
-
static getTableFromHtmlTag(tableTag: HTMLTableElement, options:
|
|
36
|
+
static getTableFromHtmlTag(tableTag: HTMLTableElement, options: CrocoHtmlOptions): {
|
|
37
37
|
type: string;
|
|
38
38
|
data: TableData;
|
|
39
39
|
validationResult: BaseApiResponse;
|
|
@@ -55,5 +55,5 @@ export declare class TableMethods {
|
|
|
55
55
|
};
|
|
56
56
|
static checkTable(tableData: TableData): BaseApiResponse;
|
|
57
57
|
static getHeader(tableTag: HTMLTableElement): TableHeaderData;
|
|
58
|
-
static getTableRows(tableTag: HTMLTableElement, options:
|
|
58
|
+
static getTableRows(tableTag: HTMLTableElement, options: CrocoHtmlOptions): Array<TableRowData>;
|
|
59
59
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ImageEditorComponent } from "./components/editor/image-editor/image-editor.component";
|
|
1
2
|
import { MainEditorBlockComponent } from "./components/editor/main-editor-block/main-editor-block.component";
|
|
2
3
|
import { MainEditorComponent } from "./components/editor/main-editor/main-editor.component";
|
|
3
4
|
import { FileIdSelectComponent } from "./components/file-id-select/file-id-select.component";
|
|
@@ -11,11 +12,11 @@ import { AddFilesBtnComponent } from './components/add-files-btn/add-files-btn.c
|
|
|
11
12
|
import { XmlTagExternalVideoComponent } from "./components/xml-tags/xml-tag-external-video/xml-tag-external-video.component";
|
|
12
13
|
import { HtmlRawEditorComponent } from "./components/editor/html-raw-editor/html-raw-editor.component";
|
|
13
14
|
import { MatButtonModule } from '@angular/material/button';
|
|
14
|
-
import { RichTextToHtmlPipe, TagToSpanPipe, ToHtmlBodyTagsPipe, ToPreviewHtmlPipe } from "./pipes";
|
|
15
|
+
import { RichTextToHtmlPipe, TagToSpanPipe, ToHtmlBodyTagsPipe, ToPreviewHtmlPipe, ToPreviewPipe } from "./pipes";
|
|
15
16
|
import { FileImageTagViewComponent, UploadFilesBtnComponent } from "./components";
|
|
16
17
|
import { HtmlRawViewComponent } from "./components/xml-tags/html-raw-view/html-raw-view.component";
|
|
17
|
-
export declare const EditorComponents: (typeof
|
|
18
|
+
export declare const EditorComponents: (typeof AddFilesBtnComponent | typeof HtmlRawEditorComponent | typeof ImageEditorComponent | typeof VisualEditorComponent | typeof MainEditorComponent | typeof MainEditorBlockComponent | typeof FileIdSelectComponent)[];
|
|
18
19
|
export declare const XmlComponents: (typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagHtmlViewComponent | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof XmlTagViewComponent | typeof HtmlRawViewComponent | typeof FileImageTagViewComponent)[];
|
|
19
|
-
export declare const CrocoPipes: (typeof RichTextToHtmlPipe | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
|
|
20
|
-
export declare const CrocoHtmlDeclarations: (typeof
|
|
20
|
+
export declare const CrocoPipes: (typeof RichTextToHtmlPipe | typeof TagToSpanPipe | typeof ToPreviewPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
|
|
21
|
+
export declare const CrocoHtmlDeclarations: (typeof UploadFilesBtnComponent | typeof AddFilesBtnComponent | typeof HtmlRawEditorComponent | typeof ImageEditorComponent | typeof VisualEditorComponent | typeof MainEditorComponent | typeof MainEditorBlockComponent | typeof FileIdSelectComponent | typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagHtmlViewComponent | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof XmlTagViewComponent | typeof HtmlRawViewComponent | typeof FileImageTagViewComponent | typeof RichTextToHtmlPipe | typeof TagToSpanPipe | typeof ToPreviewPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
|
|
21
22
|
export declare const MaterialModules: (typeof MatButtonModule)[];
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { PipeTransform } from '@angular/core';
|
|
2
2
|
import { HtmlBodyTag } from '../models/models';
|
|
3
|
+
import { CrocoHtmlOptions } from '../extensions/HtmlExtractionMethods';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class ToHtmlBodyTagsPipe implements PipeTransform {
|
|
6
|
+
private readonly _options;
|
|
7
|
+
constructor(_options: CrocoHtmlOptions);
|
|
5
8
|
transform(value: string): HtmlBodyTag[];
|
|
6
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<ToHtmlBodyTagsPipe, never>;
|
|
7
10
|
static ɵpipe: i0.ɵɵPipeDeclaration<ToHtmlBodyTagsPipe, "tohtmlbodytags", false>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { CrocoHtmlOptions } from '../extensions/HtmlExtractionMethods';
|
|
3
3
|
import { InterfaceBlock } from "../extensions/InterfaceBlock";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class ToPreviewHtmlPipe implements PipeTransform {
|
|
6
|
-
|
|
6
|
+
private readonly _options;
|
|
7
|
+
constructor(_options: CrocoHtmlOptions);
|
|
8
|
+
transform(value: string): InterfaceBlock[];
|
|
7
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<ToPreviewHtmlPipe, never>;
|
|
8
10
|
static ɵpipe: i0.ɵɵPipeDeclaration<ToPreviewHtmlPipe, "topreviewhtml", false>;
|
|
9
11
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { CrocoHtmlOptions } from '../extensions/HtmlExtractionMethods';
|
|
2
3
|
import { InterfaceBlock } from "../extensions/InterfaceBlock";
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class ToPreviewPipe implements PipeTransform {
|
|
6
|
+
private readonly _options;
|
|
7
|
+
constructor(_options: CrocoHtmlOptions);
|
|
5
8
|
transform(value: string): InterfaceBlock[];
|
|
6
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<ToPreviewPipe, never>;
|
|
7
10
|
static ɵpipe: i0.ɵɵPipeDeclaration<ToPreviewPipe, "topreview", false>;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED