croco-html 3.0.1 → 3.0.3

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 (28) hide show
  1. package/esm2022/lib/components/editor/button-editor/button-editor.component.mjs +1 -3
  2. package/esm2022/lib/components/editor/custom-widget-editor/custom-widget-editor.component.mjs +1 -1
  3. package/esm2022/lib/components/editor/download-file-button-editor/download-file-button-editor.component.mjs +1 -1
  4. package/esm2022/lib/components/editor/external-video-editor/embedded-video/code-video.component.mjs +23 -0
  5. package/esm2022/lib/components/editor/external-video-editor/external-video-editor.component.mjs +24 -6
  6. package/esm2022/lib/components/editor/external-video-editor/vk-video-player/vk-video-player.component.mjs +2 -2
  7. package/esm2022/lib/components/editor/external-video-editor/youtube-video-player/youtube-video-player.component.mjs +2 -2
  8. package/esm2022/lib/components/editor/main-editor/main-editor.component.mjs +3 -3
  9. package/esm2022/lib/components/editor/text-editor/text-editor.component.mjs +3 -3
  10. package/esm2022/lib/components/editor/visual-editor/DefaultTags.mjs +5 -13
  11. package/esm2022/lib/components/editor/visual-editor/visual-editor.component.mjs +19 -8
  12. package/esm2022/lib/components/xml-tags/html-raw-view/html-raw-view.component.mjs +8 -6
  13. package/esm2022/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.mjs +8 -5
  14. package/esm2022/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.mjs +3 -3
  15. package/esm2022/lib/extensions/HtmlExtractionMethods.mjs +3 -7
  16. package/esm2022/lib/extensions/HtmlRawTagDataConsts.mjs +11 -4
  17. package/esm2022/lib/extensions/VideoMethods.mjs +9 -2
  18. package/fesm2022/croco-html.mjs +109 -55
  19. package/fesm2022/croco-html.mjs.map +1 -1
  20. package/lib/components/editor/external-video-editor/embedded-video/code-video.component.d.ts +12 -0
  21. package/lib/components/editor/visual-editor/DefaultTags.d.ts +1 -2
  22. package/lib/components/editor/visual-editor/visual-editor.component.d.ts +3 -0
  23. package/lib/components/xml-tags/html-raw-view/html-raw-view.component.d.ts +3 -4
  24. package/lib/extensions/HtmlExtractionMethods.d.ts +1 -12
  25. package/lib/extensions/HtmlRawTagDataConsts.d.ts +10 -3
  26. package/lib/extensions/VideoMethods.d.ts +3 -0
  27. package/lib/index.d.ts +8 -8
  28. package/package.json +1 -1
@@ -0,0 +1,12 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import { DomSanitizer, SafeHtml } from "@angular/platform-browser";
3
+ import * as i0 from "@angular/core";
4
+ export declare class CodeVideoComponent implements OnChanges {
5
+ private readonly _sanitizer;
6
+ code: string;
7
+ safeHtml: SafeHtml;
8
+ constructor(_sanitizer: DomSanitizer);
9
+ ngOnChanges(changes: SimpleChanges): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<CodeVideoComponent, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<CodeVideoComponent, "code-video", never, { "code": { "alias": "code"; "required": false; }; }, {}, never, never, true, never>;
12
+ }
@@ -2,6 +2,5 @@ import { TagItem } from '../../../models/models';
2
2
  export declare class DefaultTags {
3
3
  static textTags: TagItem[];
4
4
  static tags: TagItem[];
5
- static htmlRawTag: TagItem;
6
- static getTags(useHtmlRaw: boolean): TagItem[];
5
+ static getTags(): TagItem[];
7
6
  }
@@ -5,6 +5,7 @@ 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
7
  import { CrocoHtmlOptions } from '../../../options';
8
+ import { HtmlRawTagDataConsts } from "../../../extensions/HtmlRawTagDataConsts";
8
9
  import * as i0 from "@angular/core";
9
10
  export declare const defaultLinkYouTube = "https://www.youtube.com/embed/4CtSAnJDfsI?si=scyBNJa0Hs2t5aLE";
10
11
  export declare const defaultLinkVk = "https://vk.com/video_ext.php?oid=-22822305&id=456241864&hd=2";
@@ -16,6 +17,7 @@ export declare class VisualEditorComponent implements OnInit, AfterViewInit {
16
17
  isLoading: boolean;
17
18
  loadingText: string;
18
19
  text: string;
20
+ htmlRaw: string;
19
21
  alignment: EAlignments;
20
22
  textTag: string;
21
23
  textTagOptions: TagItem[];
@@ -32,6 +34,7 @@ export declare class VisualEditorComponent implements OnInit, AfterViewInit {
32
34
  selectedValue: string;
33
35
  selectedVideoPlayer: string;
34
36
  protected readonly ExternalVideoTagDataConsts: typeof ExternalVideoTagDataConsts;
37
+ protected readonly HtmlRawTagDataConsts: typeof HtmlRawTagDataConsts;
35
38
  useHtmlRaw: boolean;
36
39
  html: string;
37
40
  isHtmlSet(): boolean;
@@ -1,13 +1,12 @@
1
- import { OnInit } from '@angular/core';
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
3
3
  import * as i0 from "@angular/core";
4
- export declare class HtmlRawViewComponent implements OnInit {
4
+ export declare class HtmlRawViewComponent implements OnChanges {
5
5
  private readonly _sanitizer;
6
6
  rawHtml: string;
7
7
  safeHtml: SafeHtml;
8
- isInitialized: boolean;
9
8
  constructor(_sanitizer: DomSanitizer);
10
- ngOnInit(): void;
9
+ ngOnChanges(changes: SimpleChanges): void;
11
10
  static ɵfac: i0.ɵɵFactoryDeclaration<HtmlRawViewComponent, never>;
12
11
  static ɵcmp: i0.ɵɵComponentDeclaration<HtmlRawViewComponent, "croco-html-raw-view", never, { "rawHtml": { "alias": "rawHtml"; "required": false; }; }, {}, never, never, true, never>;
13
12
  }
@@ -23,12 +23,7 @@ export declare class HtmlExtractionMethods {
23
23
  data: import("./TableMethods").TableData;
24
24
  validationResult: import("./TableMethods").BaseApiResponse;
25
25
  bootstrapHtml: string;
26
- }) | ((elem: HTMLElement, options: CrocoHtmlOptions) => import("./TextMethods").RichTextData) | ((elem: HTMLElement, options: CrocoHtmlOptions) => {
27
- type: string;
28
- data: {
29
- innerHTML: string;
30
- };
31
- }) | ((elem: HTMLElement, options: CrocoHtmlOptions) => GenericTextTag) | ((elem: HTMLElement, options: CrocoHtmlOptions) => import("./VideoMethods").ExternalVideoTag) | ((elem: HTMLElement, options: CrocoHtmlOptions) => import("./DownloadButtonMethods").DownloadButtonTag) | ((elem: HTMLElement, options: CrocoHtmlOptions) => import("./ButtonMethods").ButtonTag) | ((elem: HTMLElement, options: CrocoHtmlOptions) => import("./CustomWidgetMethods").CustomWidgetTag);
26
+ }) | ((elem: HTMLElement, options: CrocoHtmlOptions) => import("./TextMethods").RichTextData) | ((elem: HTMLElement, options: CrocoHtmlOptions) => GenericTextTag) | ((elem: HTMLElement, options: CrocoHtmlOptions) => import("./VideoMethods").ExternalVideoTag) | ((elem: HTMLElement, options: CrocoHtmlOptions) => import("./DownloadButtonMethods").DownloadButtonTag) | ((elem: HTMLElement, options: CrocoHtmlOptions) => import("./ButtonMethods").ButtonTag) | ((elem: HTMLElement, options: CrocoHtmlOptions) => import("./CustomWidgetMethods").CustomWidgetTag) | ((elem: HTMLElement, options: CrocoHtmlOptions) => import("./HtmlRawTagDataConsts").ExtractHtmlRawTag);
32
27
  TEXT: (elem: HTMLElement, options: CrocoHtmlOptions) => import("./TextSimpleMethods").SimpleTextTag;
33
28
  "FILE-IMAGE": (elem: HTMLElement, options: CrocoHtmlOptions) => import("./ImageMethods").FileImageTag;
34
29
  TABLE: (elem: HTMLElement, options: CrocoHtmlOptions) => {
@@ -52,12 +47,6 @@ export declare class HtmlExtractionMethods {
52
47
  bootstrapHtml: string;
53
48
  };
54
49
  "RICH-TEXT": (elem: HTMLElement, options: CrocoHtmlOptions) => import("./TextMethods").RichTextData;
55
- "HTML-RAW": (elem: HTMLElement, options: CrocoHtmlOptions) => {
56
- type: string;
57
- data: {
58
- innerHTML: string;
59
- };
60
- };
61
50
  H1: (elem: HTMLElement, options: CrocoHtmlOptions) => GenericTextTag;
62
51
  H2: (elem: HTMLElement, options: CrocoHtmlOptions) => GenericTextTag;
63
52
  H3: (elem: HTMLElement, options: CrocoHtmlOptions) => GenericTextTag;
@@ -1,6 +1,13 @@
1
1
  export declare class HtmlRawTagDataConsts {
2
2
  static TagName: string;
3
- static ScreenWidth: string;
4
- static MaxImageHeight: string;
5
- static MediaRequest: string;
3
+ }
4
+ export interface ExtractHtmlRawTag {
5
+ type: string;
6
+ data: ExtractHtmlRawTagData;
7
+ }
8
+ export interface ExtractHtmlRawTagData {
9
+ innerHTML: string;
10
+ }
11
+ export declare class ExtractHtmlRawTagMethods {
12
+ static ExtractHtmlRawTag(elem: HTMLElement): ExtractHtmlRawTag;
6
13
  }
@@ -2,10 +2,12 @@ export declare class ExternalVideoTagDataConsts {
2
2
  static TagName: string;
3
3
  static VideoTypeAttrName: string;
4
4
  static LinkAttrName: string;
5
+ static IframeAttrName: string;
5
6
  }
6
7
  export declare class ExternalVideoSupportedTypes {
7
8
  static Youtube: string;
8
9
  static VkVideo: string;
10
+ static Code: string;
9
11
  }
10
12
  export declare const ExternalVideoPlayers: {
11
13
  type: string;
@@ -18,6 +20,7 @@ export interface ExternalVideoTag {
18
20
  export interface ExternalVideoTagData {
19
21
  type: string;
20
22
  link: string;
23
+ innerHtml: string;
21
24
  }
22
25
  export declare class VideoMethods {
23
26
  static ExtractExternalVideoTag(elem: HTMLElement): ExternalVideoTag;
package/lib/index.d.ts CHANGED
@@ -2,8 +2,7 @@ import { ImageEditorComponent } from "./components";
2
2
  import { MainEditorBlockComponent } from "./components";
3
3
  import { MainEditorComponent } from "./components";
4
4
  import { FileIdSelectComponent } from "./components";
5
- import { XmlTagHeaderInnerTextViewComponent } from "./components";
6
- import { XmlTagHtmlViewComponent } from "./components";
5
+ import { XmlTagHeaderTextViewComponent } from "./components";
7
6
  import { XmlTagRichTextViewComponent } from "./components";
8
7
  import { XmlTagTableViewComponent } from "./components";
9
8
  import { XmlTagViewComponent } from "./components";
@@ -11,13 +10,14 @@ import { VisualEditorComponent } from './components';
11
10
  import { AddFilesBtnComponent } from './components';
12
11
  import { XmlTagExternalVideoComponent } from "./components";
13
12
  import { HtmlRawEditorComponent } from "./components";
14
- import { MatFormFieldModule } from '@angular/material/form-field';
13
+ import { MatTabsModule } from '@angular/material/tabs';
15
14
  import { RichTextToHtmlPipe, TagToSpanPipe, ToHtmlBodyTagsPipe, ToPreviewHtmlPipe, ToPreviewPipe } from "./pipes";
16
15
  import { FileImageTagViewComponent, UploadFilesBtnComponent } from "./components";
17
16
  import { HtmlRawViewComponent } from "./components";
17
+ import { HtmlViewComponent } from "./components";
18
18
  import { XmlTagCustomWidgetComponent } from "./components";
19
- export declare const EditorComponents: (typeof AddFilesBtnComponent | typeof HtmlRawEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof MainEditorComponent)[];
20
- export declare const XmlComponents: (typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagHtmlViewComponent | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof FileImageTagViewComponent | typeof HtmlRawViewComponent | typeof XmlTagCustomWidgetComponent | typeof XmlTagViewComponent)[];
21
- export declare const CrocoPipes: (typeof RichTextToHtmlPipe | typeof ToPreviewPipe | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
22
- 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 MainEditorBlockComponent | typeof VisualEditorComponent | typeof ToPreviewPipe | typeof MainEditorComponent | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
23
- export declare const MaterialModules: (typeof MatFormFieldModule)[];
19
+ export declare const EditorComponents: (typeof AddFilesBtnComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof MainEditorComponent | typeof HtmlRawEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent)[];
20
+ export declare const XmlComponents: (typeof XmlTagViewComponent | typeof HtmlViewComponent | typeof XmlTagExternalVideoComponent | typeof HtmlRawViewComponent | typeof XmlTagHeaderTextViewComponent | typeof FileImageTagViewComponent | typeof XmlTagCustomWidgetComponent | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent)[];
21
+ export declare const CrocoPipes: (typeof ToPreviewHtmlPipe | typeof ToPreviewPipe | typeof RichTextToHtmlPipe | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe)[];
22
+ export declare const CrocoHtmlDeclarations: (typeof ToPreviewHtmlPipe | typeof ToPreviewPipe | typeof AddFilesBtnComponent | typeof MainEditorBlockComponent | typeof VisualEditorComponent | typeof XmlTagViewComponent | typeof HtmlViewComponent | typeof MainEditorComponent | typeof XmlTagExternalVideoComponent | typeof HtmlRawViewComponent | typeof XmlTagHeaderTextViewComponent | typeof FileImageTagViewComponent | typeof XmlTagCustomWidgetComponent | typeof UploadFilesBtnComponent | typeof RichTextToHtmlPipe | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof HtmlRawEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe)[];
23
+ export declare const MaterialModules: (typeof MatTabsModule)[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "croco-html",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.2.13",
6
6
  "@angular/core": "^18.2.13",