croco-html 2.14.0 → 2.16.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.
@@ -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
  }
@@ -1,3 +1,6 @@
1
1
  export declare class HtmlRawTagDataConsts {
2
2
  static TagName: string;
3
+ static ScreenWidth: string;
4
+ static MaxImageHeight: string;
5
+ static MediaRequest: string;
3
6
  }
@@ -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,7 @@ 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 { XmlTagHeaderInnerTextViewComponent } from "./components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component";
5
+ import { XmlTagHeaderTextViewComponent } from "./components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component";
6
6
  import { XmlTagHtmlViewComponent } from "./components/xml-tags/xml-tag-html-view/xml-tag-html-view.component";
7
7
  import { XmlTagRichTextViewComponent } from "./components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component";
8
8
  import { XmlTagTableViewComponent } from "./components/xml-tags/xml-tag-table-view/xml-tag-table-view.component";
@@ -11,12 +11,12 @@ import { VisualEditorComponent } from './components/editor/visual-editor/visual-
11
11
  import { AddFilesBtnComponent } from './components/add-files-btn/add-files-btn.component';
12
12
  import { XmlTagExternalVideoComponent } from "./components/xml-tags/xml-tag-external-video/xml-tag-external-video.component";
13
13
  import { HtmlRawEditorComponent } from "./components/editor/html-raw-editor/html-raw-editor.component";
14
- import { MatButtonModule } from '@angular/material/button';
14
+ import { MatBadgeModule } from '@angular/material/badge';
15
15
  import { RichTextToHtmlPipe, TagToSpanPipe, ToHtmlBodyTagsPipe, ToPreviewHtmlPipe, ToPreviewPipe } from "./pipes";
16
16
  import { FileImageTagViewComponent, UploadFilesBtnComponent } from "./components";
17
17
  import { HtmlRawViewComponent } from "./components/xml-tags/html-raw-view/html-raw-view.component";
18
- export declare const EditorComponents: (typeof AddFilesBtnComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof HtmlRawEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof MainEditorComponent)[];
19
- export declare const XmlComponents: (typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagHtmlViewComponent | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof FileImageTagViewComponent | 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 UploadFilesBtnComponent | typeof AddFilesBtnComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagHtmlViewComponent | typeof RichTextToHtmlPipe | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof FileImageTagViewComponent | typeof HtmlRawViewComponent | typeof XmlTagViewComponent | typeof HtmlRawEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof ToPreviewPipe | typeof MainEditorComponent | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
22
- export declare const MaterialModules: (typeof MatButtonModule)[];
18
+ export declare const EditorComponents: (typeof FileIdSelectComponent | typeof AddFilesBtnComponent | typeof ImageEditorComponent | typeof MainEditorComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof HtmlRawEditorComponent)[];
19
+ export declare const XmlComponents: (typeof XmlTagExternalVideoComponent | typeof XmlTagTableViewComponent | typeof XmlTagViewComponent | typeof XmlTagRichTextViewComponent | typeof XmlTagHtmlViewComponent | typeof XmlTagHeaderTextViewComponent | typeof HtmlRawViewComponent | typeof FileImageTagViewComponent)[];
20
+ export declare const CrocoPipes: (typeof RichTextToHtmlPipe | typeof TagToSpanPipe | typeof ToPreviewPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
21
+ export declare const CrocoHtmlDeclarations: (typeof FileIdSelectComponent | typeof UploadFilesBtnComponent | typeof AddFilesBtnComponent | typeof XmlTagExternalVideoComponent | typeof ImageEditorComponent | typeof MainEditorComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof HtmlRawEditorComponent | typeof XmlTagTableViewComponent | typeof XmlTagViewComponent | typeof XmlTagRichTextViewComponent | typeof XmlTagHtmlViewComponent | typeof XmlTagHeaderTextViewComponent | typeof HtmlRawViewComponent | typeof FileImageTagViewComponent | typeof RichTextToHtmlPipe | typeof TagToSpanPipe | typeof ToPreviewPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
22
+ export declare const MaterialModules: (typeof MatBadgeModule)[];
@@ -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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "croco-html",
3
- "version": "2.14.0",
3
+ "version": "2.16.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.4",
6
6
  "@angular/core": "^17.3.4",