croco-html 4.3.11 → 4.4.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.
@@ -7,3 +7,4 @@ export * from './main-editor-block/components/defined-custom-editor-block/define
7
7
  export * from './text-editor/text-editor.component';
8
8
  export * from './visual-editor/visual-editor.component';
9
9
  export * from './custom-widget-editor/custom-widget-editor.component';
10
+ export * from './visual-editor/components/custom-widget-icon/custom-widget-icon.component';
@@ -1,9 +1,19 @@
1
- import { EventEmitter } from '@angular/core';
1
+ import { ComponentRef, EventEmitter, OnInit, ViewContainerRef } from '@angular/core';
2
2
  import { HtmlBodyTag } from '../../../../../models';
3
+ import { CrocoHtmlOptions } from '../../../../../options';
3
4
  import * as i0 from "@angular/core";
4
- export declare class DefinedCustomEditorBlockComponent {
5
+ export declare class DefinedCustomEditorBlockComponent implements OnInit {
6
+ private readonly _options;
7
+ viewContainerRef: ViewContainerRef;
8
+ useDynamicComponent: boolean;
9
+ dynamicContainerRef: ComponentRef<any>;
5
10
  tag: HtmlBodyTag;
6
11
  onTagUpdated: EventEmitter<HtmlBodyTag>;
12
+ constructor(_options: CrocoHtmlOptions);
13
+ getCustomComponent(): import("@angular/core").Type<any>;
14
+ _tagName: string;
15
+ _shortTagName: string;
16
+ ngOnInit(): void;
7
17
  static ɵfac: i0.ɵɵFactoryDeclaration<DefinedCustomEditorBlockComponent, never>;
8
18
  static ɵcmp: i0.ɵɵComponentDeclaration<DefinedCustomEditorBlockComponent, "croco-html-defined-custom-editor-block", never, { "tag": { "alias": "tag"; "required": true; }; }, { "onTagUpdated": "onTagUpdated"; }, never, never, true, never>;
9
19
  }
@@ -0,0 +1,17 @@
1
+ import { ComponentRef, OnInit, ViewContainerRef } from '@angular/core';
2
+ import { CrocoHtmlOptions } from '../../../../../options';
3
+ import * as i0 from "@angular/core";
4
+ export declare class CustomWidgetIconComponent implements OnInit {
5
+ private readonly _options;
6
+ viewContainerRef: ViewContainerRef;
7
+ useDynamicComponent: boolean;
8
+ dynamicContainerRef: ComponentRef<any>;
9
+ set tagName(tagName: string);
10
+ constructor(_options: CrocoHtmlOptions);
11
+ getIconComponent(): import("@angular/core").Type<any>;
12
+ _tagName: string;
13
+ _shortTagName: string;
14
+ ngOnInit(): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<CustomWidgetIconComponent, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<CustomWidgetIconComponent, "croco-html-custom-widget-icon", never, { "tagName": { "alias": "tagName"; "required": true; }; }, {}, never, never, true, never>;
17
+ }
@@ -59,9 +59,10 @@ export declare class VisualEditorComponent implements OnInit, AfterViewInit {
59
59
  recalculateHtml(): void;
60
60
  recalculateBodyTags(): void;
61
61
  selectTag(data: TagItem): void;
62
+ isDefinedCustomWidget(tagName: string): boolean;
62
63
  customWidgetsClickHandler(): void;
63
64
  ngOnInit(): void;
64
- setTagButton(type: string): SpriteIdsType;
65
+ setTagButton(tagName: string): SpriteIdsType;
65
66
  setAlignButton(type: string): SpriteIdsType;
66
67
  static ɵfac: i0.ɵɵFactoryDeclaration<VisualEditorComponent, never>;
67
68
  static ɵcmp: i0.ɵɵComponentDeclaration<VisualEditorComponent, "croco-visual-editor", never, { "showMarkUp": { "alias": "showMarkUp"; "required": false; }; "useHtmlRaw": { "alias": "useHtmlRaw"; "required": false; }; "html": { "alias": "html"; "required": false; }; }, { "html": "html"; "onHtmlChanged": "onHtmlChanged"; "rendered": "rendered"; }, never, never, true, never>;
@@ -5,12 +5,12 @@ import * as i0 from "@angular/core";
5
5
  export declare class XmlTagCustomWidgetComponent implements OnInit, OnDestroy {
6
6
  private readonly _options;
7
7
  viewContainerRef: ViewContainerRef;
8
+ useDynamicComponent: boolean;
9
+ dynamicContainerRef: ComponentRef<any>;
8
10
  set tagData(value: CustomWidgetTagData);
9
11
  get tagData(): CustomWidgetTagData;
10
12
  _tagData: CustomWidgetTagData;
11
13
  tooltipData: string;
12
- useDynamicComponent: boolean;
13
- dynamicContainerRef: ComponentRef<any>;
14
14
  constructor(_options: CrocoHtmlOptions);
15
15
  ngOnInit(): void;
16
16
  ngOnDestroy(): void;
@@ -58,12 +58,13 @@ import * as i56 from "./components/add-files-btn/add-files-btn.component";
58
58
  import * as i57 from "./components/editor/html-raw-editor/html-raw-editor.component";
59
59
  import * as i58 from "./components/editor/custom-widget-editor/custom-widget-editor.component";
60
60
  import * as i59 from "./components/editor/main-editor-block/components/defined-custom-editor-block/defined-custom-editor-block.component";
61
- import * as i60 from "./pipes/TagToSpanPipe";
62
- import * as i61 from "./pipes/to-preview.pipe";
63
- import * as i62 from "./pipes/ToHtmlBodyTagsPipe";
64
- import * as i63 from "./pipes/ToPreviewHtmlPipe";
61
+ import * as i60 from "./components/editor/visual-editor/components/custom-widget-icon/custom-widget-icon.component";
62
+ import * as i61 from "./pipes/TagToSpanPipe";
63
+ import * as i62 from "./pipes/to-preview.pipe";
64
+ import * as i63 from "./pipes/ToHtmlBodyTagsPipe";
65
+ import * as i64 from "./pipes/ToPreviewHtmlPipe";
65
66
  export declare class CrocoHtmlModule {
66
67
  static ɵfac: i0.ɵɵFactoryDeclaration<CrocoHtmlModule, never>;
67
- static ɵmod: i0.ɵɵNgModuleDeclaration<CrocoHtmlModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i2.ReactiveFormsModule, typeof i3.NgSelectModule, typeof i4.MatBadgeModule, typeof i5.MatTableModule, typeof i6.MatExpansionModule, typeof i7.MatFormFieldModule, typeof i8.MatSnackBarModule, typeof i9.MatProgressBarModule, typeof i10.MatProgressSpinnerModule, typeof i11.MatTabsModule, typeof i12.MatMenuModule, typeof i13.MatCardModule, typeof i14.MatSelectModule, typeof i15.MatTooltipModule, typeof i16.MatCheckboxModule, typeof i17.MatChipsModule, typeof i18.MatListModule, typeof i19.MatButtonModule, typeof i20.MatInputModule, typeof i21.MatDialogModule, typeof i22.MatPaginatorModule, typeof i23.MatDatepickerModule, typeof i24.MatGridListModule, typeof i25.MatSlideToggleModule, typeof i26.MatTreeModule, typeof i27.MatNativeDateModule, typeof i28.MatAutocompleteModule, typeof i29.MatSidenavModule, typeof i30.MatIconModule, typeof i31.DragDropModule, typeof i32.MatButtonToggleModule, typeof i33.ErrorBannerComponent, typeof i34.VkVideoPlayerComponent, typeof i35.YoutubeVideoPlayerComponent, typeof i36.DownloadFileButtonEditorComponent, typeof i37.XmlTagDownloadFileButtonComponent, typeof i38.UploadFilesBtnComponent, typeof i39.HtmlViewComponent, typeof i40.XmlTagViewComponent, typeof i41.XmlTagHtmlViewComponent, typeof i42.XmlTagTextViewComponent, typeof i43.XmlTagHeaderTextViewComponent, typeof i44.XmlTagHeaderInnerTextViewComponent, typeof i45.XmlTagExternalVideoComponent, typeof i46.HtmlRawViewComponent, typeof i47.FileImageTagViewComponent, typeof i48.XmlTagCustomWidgetComponent, typeof i39.HtmlViewComponent, typeof i49.DefinedCustomTagViewComponent, typeof i50.MainEditorComponent, typeof i51.FileIdSelectComponent, typeof i52.TextEditorComponent, typeof i53.ImageEditorComponent, typeof i54.MainEditorBlockComponent, typeof i55.VisualEditorComponent, typeof i56.AddFilesBtnComponent, typeof i57.HtmlRawEditorComponent, typeof i58.CustomWidgetEditorComponent, typeof i59.DefinedCustomEditorBlockComponent, typeof i60.TagToSpanPipe, typeof i61.ToPreviewPipe, typeof i62.ToHtmlBodyTagsPipe, typeof i63.ToPreviewHtmlPipe], [typeof i38.UploadFilesBtnComponent, typeof i39.HtmlViewComponent, typeof i40.XmlTagViewComponent, typeof i41.XmlTagHtmlViewComponent, typeof i42.XmlTagTextViewComponent, typeof i43.XmlTagHeaderTextViewComponent, typeof i44.XmlTagHeaderInnerTextViewComponent, typeof i45.XmlTagExternalVideoComponent, typeof i46.HtmlRawViewComponent, typeof i47.FileImageTagViewComponent, typeof i48.XmlTagCustomWidgetComponent, typeof i39.HtmlViewComponent, typeof i49.DefinedCustomTagViewComponent, typeof i50.MainEditorComponent, typeof i51.FileIdSelectComponent, typeof i52.TextEditorComponent, typeof i53.ImageEditorComponent, typeof i54.MainEditorBlockComponent, typeof i55.VisualEditorComponent, typeof i56.AddFilesBtnComponent, typeof i57.HtmlRawEditorComponent, typeof i58.CustomWidgetEditorComponent, typeof i59.DefinedCustomEditorBlockComponent, typeof i60.TagToSpanPipe, typeof i61.ToPreviewPipe, typeof i62.ToHtmlBodyTagsPipe, typeof i63.ToPreviewHtmlPipe]>;
68
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CrocoHtmlModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i2.ReactiveFormsModule, typeof i3.NgSelectModule, typeof i4.MatBadgeModule, typeof i5.MatTableModule, typeof i6.MatExpansionModule, typeof i7.MatFormFieldModule, typeof i8.MatSnackBarModule, typeof i9.MatProgressBarModule, typeof i10.MatProgressSpinnerModule, typeof i11.MatTabsModule, typeof i12.MatMenuModule, typeof i13.MatCardModule, typeof i14.MatSelectModule, typeof i15.MatTooltipModule, typeof i16.MatCheckboxModule, typeof i17.MatChipsModule, typeof i18.MatListModule, typeof i19.MatButtonModule, typeof i20.MatInputModule, typeof i21.MatDialogModule, typeof i22.MatPaginatorModule, typeof i23.MatDatepickerModule, typeof i24.MatGridListModule, typeof i25.MatSlideToggleModule, typeof i26.MatTreeModule, typeof i27.MatNativeDateModule, typeof i28.MatAutocompleteModule, typeof i29.MatSidenavModule, typeof i30.MatIconModule, typeof i31.DragDropModule, typeof i32.MatButtonToggleModule, typeof i33.ErrorBannerComponent, typeof i34.VkVideoPlayerComponent, typeof i35.YoutubeVideoPlayerComponent, typeof i36.DownloadFileButtonEditorComponent, typeof i37.XmlTagDownloadFileButtonComponent, typeof i38.UploadFilesBtnComponent, typeof i39.HtmlViewComponent, typeof i40.XmlTagViewComponent, typeof i41.XmlTagHtmlViewComponent, typeof i42.XmlTagTextViewComponent, typeof i43.XmlTagHeaderTextViewComponent, typeof i44.XmlTagHeaderInnerTextViewComponent, typeof i45.XmlTagExternalVideoComponent, typeof i46.HtmlRawViewComponent, typeof i47.FileImageTagViewComponent, typeof i48.XmlTagCustomWidgetComponent, typeof i39.HtmlViewComponent, typeof i49.DefinedCustomTagViewComponent, typeof i50.MainEditorComponent, typeof i51.FileIdSelectComponent, typeof i52.TextEditorComponent, typeof i53.ImageEditorComponent, typeof i54.MainEditorBlockComponent, typeof i55.VisualEditorComponent, typeof i56.AddFilesBtnComponent, typeof i57.HtmlRawEditorComponent, typeof i58.CustomWidgetEditorComponent, typeof i59.DefinedCustomEditorBlockComponent, typeof i60.CustomWidgetIconComponent, typeof i61.TagToSpanPipe, typeof i62.ToPreviewPipe, typeof i63.ToHtmlBodyTagsPipe, typeof i64.ToPreviewHtmlPipe], [typeof i38.UploadFilesBtnComponent, typeof i39.HtmlViewComponent, typeof i40.XmlTagViewComponent, typeof i41.XmlTagHtmlViewComponent, typeof i42.XmlTagTextViewComponent, typeof i43.XmlTagHeaderTextViewComponent, typeof i44.XmlTagHeaderInnerTextViewComponent, typeof i45.XmlTagExternalVideoComponent, typeof i46.HtmlRawViewComponent, typeof i47.FileImageTagViewComponent, typeof i48.XmlTagCustomWidgetComponent, typeof i39.HtmlViewComponent, typeof i49.DefinedCustomTagViewComponent, typeof i50.MainEditorComponent, typeof i51.FileIdSelectComponent, typeof i52.TextEditorComponent, typeof i53.ImageEditorComponent, typeof i54.MainEditorBlockComponent, typeof i55.VisualEditorComponent, typeof i56.AddFilesBtnComponent, typeof i57.HtmlRawEditorComponent, typeof i58.CustomWidgetEditorComponent, typeof i59.DefinedCustomEditorBlockComponent, typeof i60.CustomWidgetIconComponent, typeof i61.TagToSpanPipe, typeof i62.ToPreviewPipe, typeof i63.ToHtmlBodyTagsPipe, typeof i64.ToPreviewHtmlPipe]>;
68
69
  static ɵinj: i0.ɵɵInjectorDeclaration<CrocoHtmlModule>;
69
70
  }
package/lib/index.d.ts CHANGED
@@ -1,21 +1,23 @@
1
- import { DefinedCustomEditorBlockComponent, DefinedCustomTagViewComponent, ImageEditorComponent } from "./components";
1
+ import { CustomWidgetIconComponent, DefinedCustomEditorBlockComponent, DefinedCustomTagViewComponent, ImageEditorComponent } from "./components";
2
2
  import { MainEditorBlockComponent } from "./components";
3
3
  import { MainEditorComponent } from "./components";
4
+ import { TextEditorComponent } from "./components";
4
5
  import { FileIdSelectComponent } from "./components";
5
- import { XmlTagHeaderInnerTextViewComponent } from "./components";
6
- import { XmlTagHtmlViewComponent } from "./components";
6
+ import { XmlTagTextViewComponent } from "./components";
7
7
  import { XmlTagViewComponent } from "./components";
8
+ import { CustomWidgetEditorComponent } from "./components";
8
9
  import { VisualEditorComponent } from './components';
9
10
  import { AddFilesBtnComponent } from './components';
10
11
  import { XmlTagExternalVideoComponent } from "./components";
11
12
  import { HtmlRawEditorComponent } from "./components";
12
- import { MatCardModule } from '@angular/material/card';
13
+ import { MatTabsModule } from '@angular/material/tabs';
13
14
  import { TagToSpanPipe, ToHtmlBodyTagsPipe, ToPreviewHtmlPipe, ToPreviewPipe } from "./pipes";
14
15
  import { FileImageTagViewComponent, UploadFilesBtnComponent } from "./components";
15
16
  import { HtmlRawViewComponent } from "./components";
17
+ import { HtmlViewComponent } from "./components";
16
18
  import { XmlTagCustomWidgetComponent } from "./components";
17
- export declare const EditorComponents: (typeof AddFilesBtnComponent | typeof HtmlRawEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof DefinedCustomEditorBlockComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof MainEditorComponent)[];
18
- export declare const XmlComponents: (typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagHtmlViewComponent | typeof FileImageTagViewComponent | typeof HtmlRawViewComponent | typeof XmlTagCustomWidgetComponent | typeof DefinedCustomTagViewComponent | typeof XmlTagViewComponent)[];
19
- export declare const CrocoPipes: (typeof ToPreviewPipe | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
20
- export declare const CrocoHtmlDeclarations: (typeof UploadFilesBtnComponent | typeof AddFilesBtnComponent | typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagHtmlViewComponent | typeof FileImageTagViewComponent | typeof HtmlRawViewComponent | typeof XmlTagCustomWidgetComponent | typeof DefinedCustomTagViewComponent | typeof XmlTagViewComponent | typeof HtmlRawEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof DefinedCustomEditorBlockComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof ToPreviewPipe | typeof MainEditorComponent | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
21
- export declare const MaterialModules: (typeof MatCardModule)[];
19
+ export declare const EditorComponents: (typeof VisualEditorComponent | typeof MainEditorComponent | typeof AddFilesBtnComponent | typeof MainEditorBlockComponent | typeof CustomWidgetIconComponent | typeof TextEditorComponent | typeof ImageEditorComponent | typeof HtmlRawEditorComponent | typeof CustomWidgetEditorComponent | typeof DefinedCustomEditorBlockComponent | typeof FileIdSelectComponent)[];
20
+ export declare const XmlComponents: (typeof HtmlViewComponent | typeof XmlTagTextViewComponent | typeof HtmlRawViewComponent | typeof FileImageTagViewComponent | typeof XmlTagExternalVideoComponent | typeof XmlTagCustomWidgetComponent | typeof DefinedCustomTagViewComponent | typeof XmlTagViewComponent)[];
21
+ export declare const CrocoPipes: (typeof ToPreviewHtmlPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewPipe | typeof TagToSpanPipe)[];
22
+ export declare const CrocoHtmlDeclarations: (typeof ToPreviewHtmlPipe | typeof ToHtmlBodyTagsPipe | typeof VisualEditorComponent | typeof HtmlViewComponent | typeof MainEditorComponent | typeof ToPreviewPipe | typeof AddFilesBtnComponent | typeof MainEditorBlockComponent | typeof CustomWidgetIconComponent | typeof TextEditorComponent | typeof ImageEditorComponent | typeof HtmlRawEditorComponent | typeof CustomWidgetEditorComponent | typeof DefinedCustomEditorBlockComponent | typeof FileIdSelectComponent | typeof XmlTagTextViewComponent | typeof HtmlRawViewComponent | typeof FileImageTagViewComponent | typeof XmlTagExternalVideoComponent | typeof XmlTagCustomWidgetComponent | typeof DefinedCustomTagViewComponent | typeof XmlTagViewComponent | typeof TagToSpanPipe | typeof UploadFilesBtnComponent)[];
23
+ export declare const MaterialModules: (typeof MatTabsModule)[];
@@ -25,12 +25,32 @@ export interface CrocoHtmlOptions {
25
25
  definedCustomTags: {
26
26
  [id: string]: IMarkUpTagService;
27
27
  };
28
+ /**
29
+ * Рендеры для кастомных тегов.
30
+ */
31
+ definedCustomTagViewRenderers: {
32
+ [id: string]: ICustomTagViewRender;
33
+ };
28
34
  /**
29
35
  * Обработчик нажатия на кнопку кастомных виджетов
30
36
  * @returns
31
37
  */
32
38
  customWidgetClickHandler: (editor: VisualEditorComponent) => void;
33
39
  }
40
+ export interface ICustomTagViewRender {
41
+ /**
42
+ * Компонент для визуального редактора croco-html-custom-widget-editor
43
+ */
44
+ editorComponent?: Type<any>;
45
+ /**
46
+ * Иконка в визуальном редакторе croco-html-custom-widget-icon
47
+ */
48
+ iconComponent?: Type<any>;
49
+ /**
50
+ * Компонент для отрисовки на интерфейсе croco-html-defined-custom-tag-view
51
+ */
52
+ viewComponent?: Type<any>;
53
+ }
34
54
  export interface CrocoHtmlImageOptions {
35
55
  /**
36
56
  * Формат сслыки для показа изображений из публичных файлов.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "croco-html",
3
- "version": "4.3.11",
3
+ "version": "4.4.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.2.14",
6
6
  "@angular/core": "^19.2.14",