croco-html 2.27.0 → 2.29.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.
Files changed (30) hide show
  1. package/esm2022/lib/components/editor/image-editor/image-editor.component.mjs +20 -3
  2. package/esm2022/lib/components/editor/visual-editor/visual-editor.component.mjs +1 -1
  3. package/esm2022/lib/components/file-id-select/file-id-select.component.mjs +1 -1
  4. package/esm2022/lib/components/xml-tags/file-image-tag-view/file-image-tag-view.component.mjs +19 -7
  5. package/esm2022/lib/extensions/BodyTagsExtensions.mjs +1 -1
  6. package/esm2022/lib/extensions/HtmlExtractionMethods.mjs +1 -1
  7. package/esm2022/lib/extensions/ImageMethods.mjs +8 -9
  8. package/esm2022/lib/extensions/TableMethods.mjs +1 -1
  9. package/esm2022/lib/options/index.mjs +2 -0
  10. package/esm2022/lib/pipes/ToHtmlBodyTagsPipe.mjs +1 -1
  11. package/esm2022/lib/pipes/ToPreviewHtmlPipe.mjs +1 -1
  12. package/esm2022/lib/pipes/to-preview.pipe.mjs +1 -1
  13. package/esm2022/public-api.mjs +2 -1
  14. package/fesm2022/croco-html.mjs +44 -17
  15. package/fesm2022/croco-html.mjs.map +1 -1
  16. package/lib/components/editor/image-editor/image-editor.component.d.ts +2 -2
  17. package/lib/components/editor/visual-editor/visual-editor.component.d.ts +1 -1
  18. package/lib/components/file-id-select/file-id-select.component.d.ts +1 -1
  19. package/lib/components/xml-tags/file-image-tag-view/file-image-tag-view.component.d.ts +5 -2
  20. package/lib/extensions/BodyTagsExtensions.d.ts +1 -1
  21. package/lib/extensions/HtmlExtractionMethods.d.ts +1 -3
  22. package/lib/extensions/ImageMethods.d.ts +2 -2
  23. package/lib/extensions/TableMethods.d.ts +1 -1
  24. package/lib/index.d.ts +6 -6
  25. package/lib/options/index.d.ts +5 -0
  26. package/lib/pipes/ToHtmlBodyTagsPipe.d.ts +1 -1
  27. package/lib/pipes/ToPreviewHtmlPipe.d.ts +1 -1
  28. package/lib/pipes/to-preview.pipe.d.ts +1 -1
  29. package/package.json +1 -1
  30. package/public-api.d.ts +1 -0
@@ -1,8 +1,8 @@
1
1
  import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
2
  import { IMediaRequest } from '../../../extensions';
3
3
  import { HtmlBodyTag } from '../../../models/models';
4
- import { CrocoHtmlOptions } from '../../../extensions/HtmlExtractionMethods';
5
4
  import { ScreenWidthService } from "../../../services/screen-width.service";
5
+ import { CrocoHtmlOptions } from '../../../options';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class ImageEditorComponent implements OnInit, OnDestroy {
8
8
  private readonly _options;
@@ -10,7 +10,7 @@ export declare class ImageEditorComponent implements OnInit, OnDestroy {
10
10
  hasImageError: boolean;
11
11
  searchOrEdit: string;
12
12
  requests: IMediaRequest[];
13
- imageMaxHeight: any;
13
+ imageMaxHeight: number;
14
14
  isShowMediaRequest: boolean;
15
15
  private unsubscribe;
16
16
  tag: HtmlBodyTag;
@@ -4,7 +4,7 @@ import { ExternalVideoTagDataConsts } from '../../../extensions';
4
4
  import { TagItem, HtmlBodyTag } from '../../../models/models';
5
5
  import { FilePostingStarted } from '../../upload-files-btn/upload-files-btn.component';
6
6
  import { EAlignments } from "./DefaultAligments";
7
- import { CrocoHtmlOptions } from '../../../extensions/HtmlExtractionMethods';
7
+ import { CrocoHtmlOptions } from '../../../options';
8
8
  import * as i0 from "@angular/core";
9
9
  export declare const defaultLinkYouTube = "https://www.youtube.com/embed/4CtSAnJDfsI?si=scyBNJa0Hs2t5aLE";
10
10
  export declare const defaultLinkVk = "https://vk.com/video_ext.php?oid=-22822305&id=456241864&hd=2";
@@ -1,6 +1,6 @@
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
+ import { CrocoHtmlOptions } from '../../options';
4
4
  import * as i0 from "@angular/core";
5
5
  export interface SearchQuestionsFormData {
6
6
  q: string;
@@ -2,15 +2,18 @@ import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { InterfaceBlock } from '../../../extensions/InterfaceBlock';
3
3
  import { IMediaRequest } from '../../../extensions';
4
4
  import { ScreenWidthService } from "../../../services/screen-width.service";
5
+ import { CrocoHtmlOptions } from '../../../options';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class FileImageTagViewComponent implements OnInit, OnDestroy {
7
8
  private readonly screenWidthService;
9
+ private readonly _options;
8
10
  set item(item: InterfaceBlock);
9
11
  imageSrc: string;
10
12
  requests: IMediaRequest[];
11
13
  private unsubscribe;
12
- imageMaxHeight: any;
13
- constructor(screenWidthService: ScreenWidthService);
14
+ imageMaxHeight: number;
15
+ constructor(screenWidthService: ScreenWidthService, _options: CrocoHtmlOptions);
16
+ getMediaRequests(screenMediaRequest: string): IMediaRequest[];
14
17
  ngOnInit(): void;
15
18
  ngOnDestroy(): void;
16
19
  static ɵfac: i0.ɵɵFactoryDeclaration<FileImageTagViewComponent, never>;
@@ -1,6 +1,6 @@
1
1
  import { HtmlBodyTag } from "../models/models";
2
- import { CrocoHtmlOptions } from "./HtmlExtractionMethods";
3
2
  import { InterfaceBlock } from "./InterfaceBlock";
3
+ import { CrocoHtmlOptions } from "../options";
4
4
  export declare class BodyTagsExtensions {
5
5
  static getDescription(tagName: string): string;
6
6
  static toHtml(bodyTags: HtmlBodyTag[]): string;
@@ -1,8 +1,6 @@
1
1
  import { InterfaceBlock } from "./InterfaceBlock";
2
2
  import { GenericTextTag } from "./TextSimpleMethods";
3
- export interface CrocoHtmlOptions {
4
- publicImageResizedUrlFormat: string;
5
- }
3
+ import { CrocoHtmlOptions } from "../options";
6
4
  export declare class HtmlExtractionMethods {
7
5
  static ExtractHeaderTag(elem: HTMLElement, tagName: string): GenericTextTag;
8
6
  static Extractors: {
@@ -1,4 +1,4 @@
1
- import { CrocoHtmlOptions } from "./HtmlExtractionMethods";
1
+ import { CrocoHtmlOptions } from "../options";
2
2
  export declare class FileImageTagDataConsts {
3
3
  static TagName: string;
4
4
  static FileIdAttrName: string;
@@ -30,5 +30,5 @@ export declare class ImageMethods {
30
30
  static mediaRequestStringToArrayParser: (data: string) => IMediaRequest[];
31
31
  static createMediaRequestValue(arr: string[], attribute: string): number;
32
32
  static mediaRequestsArrayToStringParser: (data: IMediaRequest[]) => string;
33
- static screenSizeChanged: (screenSize: number, requests: IMediaRequest[]) => void;
33
+ static getMaxImageHeightByScreenSize(screenSize: number, requests: IMediaRequest[]): number | null;
34
34
  }
@@ -1,4 +1,4 @@
1
- import { CrocoHtmlOptions } from './HtmlExtractionMethods';
1
+ import { CrocoHtmlOptions } from '../options';
2
2
  import { InterfaceBlock } from "./InterfaceBlock";
3
3
  export interface BaseApiResponse {
4
4
  isSucceeded: boolean;
package/lib/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { MainEditorBlockComponent } from "./components";
3
3
  import { MainEditorComponent } from "./components";
4
4
  import { FileIdSelectComponent } from "./components";
5
5
  import { XmlTagHeaderInnerTextViewComponent } from "./components";
6
+ import { XmlTagHtmlViewComponent } from "./components";
6
7
  import { XmlTagRichTextViewComponent } from "./components";
7
8
  import { XmlTagTableViewComponent } from "./components";
8
9
  import { XmlTagViewComponent } from "./components";
@@ -10,13 +11,12 @@ import { VisualEditorComponent } from './components';
10
11
  import { AddFilesBtnComponent } from './components';
11
12
  import { XmlTagExternalVideoComponent } from "./components";
12
13
  import { HtmlRawEditorComponent } from "./components";
13
- import { MatTabsModule } from '@angular/material/tabs';
14
+ 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";
17
- import { HtmlViewComponent } from "./components";
18
- export declare const EditorComponents: (typeof VisualEditorComponent | typeof MainEditorComponent | typeof AddFilesBtnComponent | typeof HtmlRawEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof MainEditorBlockComponent)[];
19
- export declare const XmlComponents: (typeof XmlTagViewComponent | typeof HtmlViewComponent | typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof FileImageTagViewComponent | typeof HtmlRawViewComponent)[];
18
+ export declare const EditorComponents: (typeof AddFilesBtnComponent | typeof HtmlRawEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof MainEditorComponent)[];
19
+ export declare const XmlComponents: (typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagHtmlViewComponent | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof FileImageTagViewComponent | typeof HtmlRawViewComponent | typeof XmlTagViewComponent)[];
20
20
  export declare const CrocoPipes: (typeof RichTextToHtmlPipe | typeof ToPreviewPipe | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
21
- export declare const CrocoHtmlDeclarations: (typeof VisualEditorComponent | typeof XmlTagViewComponent | typeof HtmlViewComponent | typeof MainEditorComponent | typeof UploadFilesBtnComponent | typeof AddFilesBtnComponent | typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof RichTextToHtmlPipe | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof FileImageTagViewComponent | typeof HtmlRawViewComponent | typeof HtmlRawEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof MainEditorBlockComponent | typeof ToPreviewPipe | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
22
- export declare const MaterialModules: (typeof MatTabsModule)[];
21
+ export declare const CrocoHtmlDeclarations: (typeof UploadFilesBtnComponent | typeof AddFilesBtnComponent | 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 MainEditorBlockComponent | typeof VisualEditorComponent | typeof ToPreviewPipe | typeof MainEditorComponent | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
22
+ export declare const MaterialModules: (typeof MatFormFieldModule)[];
@@ -0,0 +1,5 @@
1
+ import { IMediaRequest } from "../extensions";
2
+ export interface CrocoHtmlOptions {
3
+ publicImageResizedUrlFormat: string;
4
+ globalMediaRequests?: IMediaRequest[];
5
+ }
@@ -1,6 +1,6 @@
1
1
  import { PipeTransform } from '@angular/core';
2
2
  import { HtmlBodyTag } from '../models/models';
3
- import { CrocoHtmlOptions } from '../extensions/HtmlExtractionMethods';
3
+ import { CrocoHtmlOptions } from '../options';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class ToHtmlBodyTagsPipe implements PipeTransform {
6
6
  private readonly _options;
@@ -1,6 +1,6 @@
1
1
  import { PipeTransform } from '@angular/core';
2
- import { CrocoHtmlOptions } from '../extensions/HtmlExtractionMethods';
3
2
  import { InterfaceBlock } from "../extensions/InterfaceBlock";
3
+ import { CrocoHtmlOptions } from '../options';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class ToPreviewHtmlPipe implements PipeTransform {
6
6
  private readonly _options;
@@ -1,6 +1,6 @@
1
1
  import { PipeTransform } from '@angular/core';
2
- import { CrocoHtmlOptions } from '../extensions/HtmlExtractionMethods';
3
2
  import { InterfaceBlock } from "../extensions/InterfaceBlock";
3
+ import { CrocoHtmlOptions } from '../options';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class ToPreviewPipe implements PipeTransform {
6
6
  private readonly _options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "croco-html",
3
- "version": "2.27.0",
3
+ "version": "2.29.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.4",
6
6
  "@angular/core": "^17.3.4",
package/public-api.d.ts CHANGED
@@ -5,3 +5,4 @@ export * from './lib/croco-html.module';
5
5
  export * from './lib/models/models';
6
6
  export * from './lib/consts';
7
7
  export * from './lib/services';
8
+ export * from './lib/options';