croco-html 3.0.7 → 3.1.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.
@@ -47,15 +47,16 @@ export declare class VisualEditorComponent implements OnInit, AfterViewInit {
47
47
  rendered: EventEmitter<boolean>;
48
48
  bodyTags: HtmlBodyTag[];
49
49
  saveBodyTags: HtmlBodyTag[];
50
+ useCustomWidgetsButton: boolean;
50
51
  constructor(_cdref: ChangeDetectorRef, _options: CrocoHtmlOptions);
51
52
  ngAfterViewInit(): void;
52
53
  ngAfterContentChecked(): void;
53
- addTag(): void;
54
+ addTagClickHandler(): void;
54
55
  startAddingText(tag?: string): void;
55
56
  resetTextStyle(): void;
56
57
  addTextTags(): void;
57
58
  postFilesStartedEventHandler(model: FilePostingStarted): void;
58
- addTagCustom(tag: HtmlBodyTag): void;
59
+ addTag(tag: HtmlBodyTag): void;
59
60
  filesTagsReadyHandler(tags: HtmlBodyTag[]): void;
60
61
  drop(event: CdkDragDrop<object[]>): void;
61
62
  onTagSavedHandler(tag: HtmlBodyTag): void;
@@ -63,6 +64,7 @@ export declare class VisualEditorComponent implements OnInit, AfterViewInit {
63
64
  recalculateHtml(): void;
64
65
  recalculateBodyTags(): void;
65
66
  selectTag(data: TagItem): void;
67
+ customWidgetsClickHandler(): void;
66
68
  ngOnInit(): void;
67
69
  setTagButton(type: string): SpriteIdsType;
68
70
  setAlignButton(type: string): SpriteIdsType;
@@ -17,7 +17,7 @@ export declare class ImageMethods {
17
17
  static ExtractImage(elem: HTMLElement, options: CrocoHtmlOptions): FileImageTag;
18
18
  static mediaRequestStringToArrayParser: (data: string) => IMediaRequest[];
19
19
  static createMediaRequestValue(arr: string[], attribute: string): number | null;
20
- static mediaRequestsArrayToStringParser(data: IMediaRequest[]): string;
20
+ static mediaRequestsArrayToString(data: IMediaRequest[]): string;
21
21
  static mediaRequestToString(data: IMediaRequest): string;
22
22
  static getImageRestrictionsByScreenSize(screenSize: number, requests: IMediaRequest[]): ImageRestrictions;
23
23
  }
package/lib/index.d.ts CHANGED
@@ -18,8 +18,8 @@ import { RichTextToHtmlPipe, TagToSpanPipe, ToHtmlBodyTagsPipe, ToPreviewHtmlPip
18
18
  import { FileImageTagViewComponent, UploadFilesBtnComponent } from "./components";
19
19
  import { HtmlRawViewComponent } from "./components";
20
20
  import { XmlTagCustomWidgetComponent } from "./components";
21
- export declare const EditorComponents: (typeof AddFilesBtnComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof HtmlRawEditorComponent | typeof TextEditorComponent | typeof CustomWidgetEditorComponent | typeof MainEditorComponent)[];
22
- export declare const XmlComponents: (typeof XmlTagCustomWidgetComponent | typeof FileImageTagViewComponent | typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagHtmlViewComponent | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof HtmlRawViewComponent | typeof XmlTagViewComponent)[];
23
- export declare const CrocoPipes: (typeof ToPreviewHtmlPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewPipe | typeof RichTextToHtmlPipe | typeof TagToSpanPipe)[];
24
- export declare const CrocoHtmlDeclarations: (typeof ToPreviewHtmlPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewPipe | typeof AddFilesBtnComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof XmlTagCustomWidgetComponent | typeof FileImageTagViewComponent | typeof UploadFilesBtnComponent | typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagHtmlViewComponent | typeof RichTextToHtmlPipe | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof HtmlRawViewComponent | typeof XmlTagViewComponent | typeof HtmlRawEditorComponent | typeof TextEditorComponent | typeof CustomWidgetEditorComponent | typeof MainEditorComponent | typeof TagToSpanPipe)[];
21
+ export declare const EditorComponents: (typeof AddFilesBtnComponent | typeof HtmlRawEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof TextEditorComponent | typeof CustomWidgetEditorComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof MainEditorComponent)[];
22
+ export declare const XmlComponents: (typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagHtmlViewComponent | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof FileImageTagViewComponent | typeof HtmlRawViewComponent | typeof XmlTagCustomWidgetComponent | typeof XmlTagViewComponent)[];
23
+ export declare const CrocoPipes: (typeof RichTextToHtmlPipe | typeof ToPreviewPipe | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
24
+ 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 XmlTagCustomWidgetComponent | typeof XmlTagViewComponent | typeof HtmlRawEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof TextEditorComponent | typeof CustomWidgetEditorComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof ToPreviewPipe | typeof MainEditorComponent | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
25
25
  export declare const MaterialModules: (typeof MatFormFieldModule)[];
@@ -1,6 +1,7 @@
1
1
  export interface TagItem {
2
2
  tag: string;
3
3
  displayValue: string;
4
+ isCustom: boolean;
4
5
  }
5
6
  export interface HtmlBodyTag {
6
7
  tagDescription: TagItem;
@@ -1,5 +1,6 @@
1
1
  import { Type } from "@angular/core";
2
2
  import { IMediaRequest } from "../models";
3
+ import { VisualEditorComponent } from "../components";
3
4
  export interface CrocoHtmlOptions {
4
5
  /**
5
6
  * Формат сслыки для показа изображений из публичных файлов.
@@ -16,6 +17,15 @@ export interface CrocoHtmlOptions {
16
17
  * Компонент для рендера кастомных виджетов
17
18
  */
18
19
  customWidgetRendererComponent?: Type<any>;
20
+ /**
21
+ * Использовать кнопку для отрисовки кастомных виджетов
22
+ */
23
+ useCustomWidgetsButton: boolean;
24
+ /**
25
+ * Обработчик нажатия на кнопку кастомных виджетов
26
+ * @returns
27
+ */
28
+ customWidgetClickHandler: (editor: VisualEditorComponent) => void;
19
29
  }
20
30
  /**
21
31
  * Опции для работы с файлами в редакторе разметки
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "croco-html",
3
- "version": "3.0.7",
3
+ "version": "3.1.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.2.13",
6
6
  "@angular/core": "^18.2.13",