croco-html 2.15.0 → 2.17.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/add-files-btn/add-files-btn.component.mjs +4 -3
- package/esm2022/lib/components/editor/image-editor/image-editor.component.mjs +44 -8
- package/esm2022/lib/components/editor/visual-editor/visual-editor.component.mjs +4 -1
- package/esm2022/lib/components/file-id-select/file-id-select.component.mjs +3 -3
- package/esm2022/lib/components/xml-tags/file-image-tag-view/file-image-tag-view.component.mjs +3 -3
- package/esm2022/lib/extensions/BodyTagsExtensions.mjs +9 -5
- package/esm2022/lib/extensions/HtmlRawTagDataConsts.mjs +4 -1
- package/esm2022/lib/extensions/ImageMethods.mjs +41 -1
- package/esm2022/lib/services/screen-width.service.mjs +24 -0
- package/fesm2022/croco-html.mjs +278 -177
- package/fesm2022/croco-html.mjs.map +1 -1
- package/lib/components/editor/image-editor/image-editor.component.d.ts +13 -3
- package/lib/extensions/HtmlRawTagDataConsts.d.ts +3 -0
- package/lib/extensions/ImageMethods.d.ts +13 -0
- package/lib/index.d.ts +6 -6
- package/lib/services/screen-width.service.d.ts +10 -0
- package/package.json +1 -1
|
@@ -1,20 +1,30 @@
|
|
|
1
|
-
import { EventEmitter, OnInit } from '@angular/core';
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { IMediaRequest } from '../../../extensions';
|
|
2
3
|
import { HtmlBodyTag } from '../../../models/models';
|
|
3
4
|
import { CrocoHtmlOptions } from '../../../extensions/HtmlExtractionMethods';
|
|
5
|
+
import { ScreenWidthService } from "../../../services/screen-width.service";
|
|
4
6
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class ImageEditorComponent implements OnInit {
|
|
7
|
+
export declare class ImageEditorComponent implements OnInit, OnDestroy {
|
|
6
8
|
private readonly _options;
|
|
7
9
|
hasImageError: boolean;
|
|
8
10
|
searchOrEdit: string;
|
|
11
|
+
requests: IMediaRequest[];
|
|
12
|
+
imageMaxHeight: any;
|
|
13
|
+
isShowMediaRequest: boolean;
|
|
14
|
+
private unsubscribe;
|
|
9
15
|
tag: HtmlBodyTag;
|
|
10
16
|
onErrorHandler(): void;
|
|
11
17
|
onTagUpdated: EventEmitter<HtmlBodyTag>;
|
|
12
|
-
constructor(_options: CrocoHtmlOptions);
|
|
18
|
+
constructor(_options: CrocoHtmlOptions, screenWidth: ScreenWidthService);
|
|
13
19
|
getSrc(): string;
|
|
14
20
|
hasFileId(): boolean;
|
|
15
21
|
onFileIdChanged(fileId: number): void;
|
|
16
22
|
removeImageError(): void;
|
|
17
23
|
ngOnInit(): void;
|
|
24
|
+
requestChanged(): void;
|
|
25
|
+
addNewMediaRequest(): void;
|
|
26
|
+
deleteMediaRequest(index: number): void;
|
|
27
|
+
ngOnDestroy(): void;
|
|
18
28
|
static ɵfac: i0.ɵɵFactoryDeclaration<ImageEditorComponent, never>;
|
|
19
29
|
static ɵcmp: i0.ɵɵComponentDeclaration<ImageEditorComponent, "croco-html-image-editor", never, { "tag": { "alias": "tag"; "required": false; }; }, { "onTagUpdated": "onTagUpdated"; }, never, never, true, never>;
|
|
20
30
|
}
|
|
@@ -2,6 +2,10 @@ import { CrocoHtmlOptions } from "./HtmlExtractionMethods";
|
|
|
2
2
|
export declare class FileImageTagDataConsts {
|
|
3
3
|
static TagName: string;
|
|
4
4
|
static FileIdAttrName: string;
|
|
5
|
+
static ScreenMediaRequest: string;
|
|
6
|
+
static DefaultValueForFileImage: string;
|
|
7
|
+
static ScreenWidth: string;
|
|
8
|
+
static MaxImageHeight: string;
|
|
5
9
|
}
|
|
6
10
|
export interface FileImageTag {
|
|
7
11
|
type: string;
|
|
@@ -10,10 +14,19 @@ export interface FileImageTag {
|
|
|
10
14
|
export interface FileImageTagData {
|
|
11
15
|
src: string;
|
|
12
16
|
fileId: number;
|
|
17
|
+
screenMediaRequest: string;
|
|
18
|
+
}
|
|
19
|
+
export interface IMediaRequest {
|
|
20
|
+
screenWidth: number;
|
|
21
|
+
maxImageHeight: number;
|
|
13
22
|
}
|
|
14
23
|
export declare class ImageMethods {
|
|
15
24
|
static buildUrl(fileId: number, sizeType: string, options: CrocoHtmlOptions): string;
|
|
16
25
|
static buildSmallUrl(fileId: number, options: CrocoHtmlOptions): string;
|
|
17
26
|
static buildMediumUrl(fileId: number, options: CrocoHtmlOptions): string;
|
|
18
27
|
static ExtractImage(elem: HTMLElement, options: CrocoHtmlOptions): FileImageTag;
|
|
28
|
+
static mediaRequestStringToArrayParser: (data: string) => IMediaRequest[];
|
|
29
|
+
static createMediaRequestValue(arr: string[], attribute: string): number;
|
|
30
|
+
static mediaRequestsArrayToStringParser: (data: IMediaRequest[]) => string;
|
|
31
|
+
static screenSizeChanged: (screenSize: number, requests: IMediaRequest[]) => any;
|
|
19
32
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import { ImageEditorComponent } from "./components/editor/image-editor/image-edi
|
|
|
2
2
|
import { MainEditorBlockComponent } from "./components/editor/main-editor-block/main-editor-block.component";
|
|
3
3
|
import { MainEditorComponent } from "./components/editor/main-editor/main-editor.component";
|
|
4
4
|
import { FileIdSelectComponent } from "./components/file-id-select/file-id-select.component";
|
|
5
|
-
import {
|
|
5
|
+
import { XmlTagHeaderInnerTextViewComponent } from "./components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component";
|
|
6
|
+
import { XmlTagHtmlViewComponent } from "./components/xml-tags/xml-tag-html-view/xml-tag-html-view.component";
|
|
6
7
|
import { XmlTagRichTextViewComponent } from "./components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component";
|
|
7
8
|
import { XmlTagTableViewComponent } from "./components/xml-tags/xml-tag-table-view/xml-tag-table-view.component";
|
|
8
9
|
import { XmlTagViewComponent } from "./components/xml-tags/xml-tag-view/xml-tag-view.component";
|
|
@@ -14,9 +15,8 @@ import { MatFormFieldModule } from '@angular/material/form-field';
|
|
|
14
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
|
-
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const CrocoHtmlDeclarations: (typeof XmlTagExternalVideoComponent | typeof UploadFilesBtnComponent | typeof HtmlViewComponent | typeof XmlTagTableViewComponent | typeof XmlTagViewComponent | typeof XmlTagRichTextViewComponent | typeof XmlTagHeaderTextViewComponent | typeof HtmlRawViewComponent | typeof FileImageTagViewComponent | typeof MainEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof AddFilesBtnComponent | typeof HtmlRawEditorComponent | typeof RichTextToHtmlPipe | typeof TagToSpanPipe | typeof ToPreviewPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
|
|
18
|
+
export declare const EditorComponents: (typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof AddFilesBtnComponent | typeof HtmlRawEditorComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof MainEditorComponent)[];
|
|
19
|
+
export declare const XmlComponents: (typeof FileImageTagViewComponent | typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagHtmlViewComponent | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof HtmlRawViewComponent | typeof XmlTagViewComponent)[];
|
|
20
|
+
export declare const CrocoPipes: (typeof RichTextToHtmlPipe | typeof ToPreviewPipe | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
|
|
21
|
+
export declare const CrocoHtmlDeclarations: (typeof FileImageTagViewComponent | typeof FileIdSelectComponent | typeof XmlTagExternalVideoComponent | typeof ImageEditorComponent | typeof UploadFilesBtnComponent | typeof AddFilesBtnComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagHtmlViewComponent | typeof RichTextToHtmlPipe | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof HtmlRawViewComponent | typeof XmlTagViewComponent | typeof HtmlRawEditorComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof ToPreviewPipe | typeof MainEditorComponent | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
|
|
22
22
|
export declare const MaterialModules: (typeof MatFormFieldModule)[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class ScreenWidthService {
|
|
4
|
+
private screenWidth;
|
|
5
|
+
constructor();
|
|
6
|
+
private onResize;
|
|
7
|
+
getScreenWidth(): Observable<number>;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ScreenWidthService, never>;
|
|
9
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ScreenWidthService>;
|
|
10
|
+
}
|