croco-html 4.0.2 → 4.1.1

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 (89) hide show
  1. package/fesm2022/croco-html.mjs +738 -701
  2. package/fesm2022/croco-html.mjs.map +1 -1
  3. package/index.d.ts +3 -954
  4. package/lib/components/add-files-btn/add-files-btn.component.d.ts +20 -0
  5. package/lib/components/editor/button-editor/button-editor.component.d.ts +13 -0
  6. package/lib/components/editor/custom-widget-editor/custom-widget-editor.component.d.ts +13 -0
  7. package/lib/components/editor/download-file-button-editor/download-file-button-editor.component.d.ts +13 -0
  8. package/lib/components/editor/external-video-editor/embedded-video/code-video.component.d.ts +14 -0
  9. package/lib/components/editor/external-video-editor/external-video-editor.component.d.ts +17 -0
  10. package/lib/components/editor/external-video-editor/vk-video-player/vk-video-player.component.d.ts +10 -0
  11. package/lib/components/editor/external-video-editor/youtube-video-player/youtube-video-player.component.d.ts +10 -0
  12. package/lib/components/editor/html-editor-settings-modal/html-editor-settings-modal.component.d.ts +17 -0
  13. package/lib/components/editor/html-raw-editor/html-raw-editor.component.d.ts +15 -0
  14. package/lib/components/editor/image-editor/image-editor.component.d.ts +34 -0
  15. package/lib/components/editor/index.d.ts +8 -0
  16. package/lib/components/editor/main-editor/main-editor.component.d.ts +34 -0
  17. package/lib/components/editor/main-editor-block/main-editor-block.component.d.ts +14 -0
  18. package/lib/components/editor/text-editor/text-editor.component.d.ts +10 -0
  19. package/lib/components/editor/visual-editor/DefaultAligments.d.ts +5 -0
  20. package/lib/components/editor/visual-editor/DefaultTags.d.ts +6 -0
  21. package/lib/components/editor/visual-editor/visual-editor.component.d.ts +69 -0
  22. package/lib/components/error-banner/error-banner.component.d.ts +6 -0
  23. package/lib/components/file-id-select/file-id-select.component.d.ts +38 -0
  24. package/lib/components/html-view/html-view.component.d.ts +6 -0
  25. package/lib/components/index.d.ts +6 -0
  26. package/lib/components/upload-files-btn/upload-files-btn.component.d.ts +26 -0
  27. package/lib/components/xml-tags/file-image-tag-view/file-image-tag-view.component.d.ts +22 -0
  28. package/lib/components/xml-tags/html-raw-view/html-raw-view.component.d.ts +12 -0
  29. package/lib/components/xml-tags/index.d.ts +10 -0
  30. package/lib/components/xml-tags/xml-tag-custom-button/xml-tag-button.component.d.ts +14 -0
  31. package/lib/components/xml-tags/xml-tag-custom-widget/xml-tag-custom-widget.component.d.ts +19 -0
  32. package/lib/components/xml-tags/xml-tag-download-file-button/xml-tag-download-file-button.component.d.ts +14 -0
  33. package/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.d.ts +11 -0
  34. package/lib/components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component.d.ts +7 -0
  35. package/lib/components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component.d.ts +7 -0
  36. package/lib/components/xml-tags/xml-tag-html-view/xml-tag-html-view.component.d.ts +7 -0
  37. package/lib/components/xml-tags/xml-tag-table-view/xml-tag-table-view.component.d.ts +7 -0
  38. package/lib/components/xml-tags/xml-tag-text-view/xml-tag-text-view.component.d.ts +7 -0
  39. package/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.d.ts +8 -0
  40. package/lib/consts/index.d.ts +1 -0
  41. package/lib/croco-html.module.d.ts +68 -0
  42. package/lib/extensions/AngularMaterialTableMethods.d.ts +7 -0
  43. package/lib/extensions/BodyTagsExtensions.d.ts +14 -0
  44. package/lib/extensions/BootstrapTableMethods.d.ts +9 -0
  45. package/lib/extensions/HtmlExtractionMethods.d.ts +28 -0
  46. package/lib/extensions/HtmlRawTagDataConsts.d.ts +10 -0
  47. package/lib/extensions/ImageMethods.d.ts +23 -0
  48. package/lib/extensions/InterfaceBlock.d.ts +10 -0
  49. package/lib/extensions/TableBuilder.d.ts +5 -0
  50. package/lib/extensions/TableMethods.d.ts +60 -0
  51. package/lib/extensions/Tags.d.ts +16 -0
  52. package/lib/extensions/TextMethods.d.ts +11 -0
  53. package/lib/extensions/TextSimpleMethods.d.ts +19 -0
  54. package/lib/extensions/VideoMethods.d.ts +26 -0
  55. package/lib/extensions/XmlExtensions.d.ts +5 -0
  56. package/lib/extensions/index.d.ts +10 -0
  57. package/lib/index.d.ts +24 -0
  58. package/lib/models/image-models.d.ts +19 -0
  59. package/lib/models/index.d.ts +2 -0
  60. package/lib/models/models.d.ts +18 -0
  61. package/lib/options/index.d.ts +46 -0
  62. package/lib/pipes/TagToSpanPipe.d.ts +7 -0
  63. package/lib/pipes/ToHtmlBodyTagsPipe.d.ts +11 -0
  64. package/lib/pipes/ToPreviewHtmlPipe.d.ts +11 -0
  65. package/lib/pipes/index.d.ts +4 -0
  66. package/lib/pipes/sprite-icon-path.pipe.d.ts +8 -0
  67. package/lib/pipes/to-preview.pipe.d.ts +11 -0
  68. package/lib/services/CrocoHtmlFileOptionsService.d.ts +10 -0
  69. package/lib/services/HtmlViewController.d.ts +11 -0
  70. package/lib/services/PrivateFileUploadService.d.ts +26 -0
  71. package/lib/services/PrivateFilesQueryService.d.ts +21 -0
  72. package/lib/services/PublicFileUploadService.d.ts +26 -0
  73. package/lib/services/PublicFilesQueryService.d.ts +12 -0
  74. package/lib/services/blob-create.service.d.ts +10 -0
  75. package/lib/services/file-models.d.ts +38 -0
  76. package/lib/services/index.d.ts +3 -0
  77. package/lib/services/screen-width.service.d.ts +10 -0
  78. package/lib/tag-services/ButtonTagService.d.ts +27 -0
  79. package/lib/tag-services/CustomWidgetTagService.d.ts +33 -0
  80. package/lib/tag-services/DownloadButtonTagService.d.ts +25 -0
  81. package/lib/tag-services/ExternalVideoTagService.d.ts +12 -0
  82. package/lib/tag-services/FileImageTagService.d.ts +12 -0
  83. package/lib/tag-services/HtmlRawTagService.d.ts +12 -0
  84. package/lib/tag-services/IMarkUpTagService.d.ts +35 -0
  85. package/lib/tag-services/TextTagHtmlMarkupTagService.d.ts +21 -0
  86. package/lib/tag-services/index.d.ts +8 -0
  87. package/package.json +1 -1
  88. package/public-api.d.ts +8 -0
  89. package/sprites-ids.type.d.ts +1 -0
@@ -0,0 +1,12 @@
1
+ import { HttpClient } from "@angular/common/http";
2
+ import { Observable } from "rxjs";
3
+ import { FileSimpleModel, GetListResult, SearchFilesRequest } from "./file-models";
4
+ import * as i0 from "@angular/core";
5
+ export declare class PublicFilesQueryService {
6
+ private readonly _httpClient;
7
+ private readonly _baseControllerUrl;
8
+ constructor(_httpClient: HttpClient, baseUrl: string);
9
+ search(model: SearchFilesRequest): Observable<GetListResult<FileSimpleModel>>;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<PublicFilesQueryService, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<PublicFilesQueryService>;
12
+ }
@@ -0,0 +1,10 @@
1
+ import { HttpClient } from "@angular/common/http";
2
+ import { Observable } from "rxjs";
3
+ import * as i0 from "@angular/core";
4
+ export declare class BlobCreateService {
5
+ private readonly _http;
6
+ constructor(_http: HttpClient);
7
+ getBlob(link: string): Observable<Blob>;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<BlobCreateService, never>;
9
+ static ɵprov: i0.ɵɵInjectableDeclaration<BlobCreateService>;
10
+ }
@@ -0,0 +1,38 @@
1
+ export interface GetListResult<T> {
2
+ totalCount: number;
3
+ list: Array<T>;
4
+ }
5
+ export interface FileRelationModel {
6
+ entityTypeFullName: string;
7
+ entityKey: string;
8
+ relationName: string;
9
+ relationValue: string;
10
+ relationCustomData: string;
11
+ }
12
+ export interface SearchFilesRequest {
13
+ q: string;
14
+ fileName: string;
15
+ applicationId: string;
16
+ fileTypes: Array<FileType>;
17
+ count: number | null;
18
+ offSet: number;
19
+ }
20
+ export declare enum FileType {
21
+ Undefined = "Undefined",
22
+ Unknown = "Unknown",
23
+ Image = "Image",
24
+ Audio = "Audio",
25
+ Video = "Video",
26
+ Document = "Document",
27
+ Archive = "Archive"
28
+ }
29
+ export interface GetListSearchModel {
30
+ count: number | null;
31
+ offSet: number;
32
+ }
33
+ export interface FileSimpleModel {
34
+ fileId: number;
35
+ fileName: string;
36
+ type: FileType;
37
+ downloadUrl: string;
38
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./HtmlViewController";
2
+ export * from "./CrocoHtmlFileOptionsService";
3
+ export * from "./file-models";
@@ -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
+ }
@@ -0,0 +1,27 @@
1
+ import { InterfaceBlock } from "../extensions/InterfaceBlock";
2
+ import { HtmlBodyTag } from "../models";
3
+ import { CrocoHtmlOptions } from "../options";
4
+ import { IMarkUpTagService, IVisualEditorProps } from "./IMarkUpTagService";
5
+ export declare class ButtonTagDataConsts {
6
+ static readonly TagName = "button";
7
+ static readonly TextAttrName = "text";
8
+ static readonly TypeAttrName = "type";
9
+ static readonly ClickAttrName = "click";
10
+ }
11
+ export interface ButtonTag {
12
+ type: string;
13
+ data: ButtonTagData;
14
+ }
15
+ export interface ButtonTagData {
16
+ text: string;
17
+ type: string;
18
+ click: string;
19
+ }
20
+ export declare class ButtonTagService implements IMarkUpTagService {
21
+ tagName: string;
22
+ shortDescription: string;
23
+ bodyTagToHtmlStringConverter(bodyTag: HtmlBodyTag): string;
24
+ extractBlockFromHtmlElement(elem: HTMLElement, options: CrocoHtmlOptions): InterfaceBlock;
25
+ toBodyTag(data: InterfaceBlock): HtmlBodyTag;
26
+ getDefaultValue(props: IVisualEditorProps): HtmlBodyTag;
27
+ }
@@ -0,0 +1,33 @@
1
+ import { InterfaceBlock } from "../extensions/InterfaceBlock";
2
+ import { HtmlBodyTag } from "../models";
3
+ import { CrocoHtmlOptions } from "../options";
4
+ import { IMarkUpTagService, IVisualEditorProps } from "./IMarkUpTagService";
5
+ export declare class CustomWidgetTagDataConsts {
6
+ static readonly TagName = "custom-widget";
7
+ static readonly TypeAttrName = "type";
8
+ static readonly DataIdAttrName = "data-id";
9
+ static readonly WidgetIdAttrName = "widget-id";
10
+ }
11
+ export interface CustomWidgetTag {
12
+ type: string;
13
+ data: CustomWidgetTagData;
14
+ }
15
+ export interface CustomWidgetTagData {
16
+ type: string;
17
+ dataId: string;
18
+ widgetId: string;
19
+ }
20
+ export declare class CustomWidgetTagService implements IMarkUpTagService {
21
+ tagName: string;
22
+ shortDescription: string;
23
+ bodyTagToHtmlStringConverter(bodyTag: HtmlBodyTag): string;
24
+ extractBlockFromHtmlElement(elem: HTMLElement, options: CrocoHtmlOptions): InterfaceBlock;
25
+ toBodyTag(data: InterfaceBlock): HtmlBodyTag;
26
+ getDefaultValue(props: IVisualEditorProps): HtmlBodyTag;
27
+ static ExtractCustomWidgetTagData(attributes: any): CustomWidgetTagData;
28
+ static ExtractCustomWidgetAttributes(customWidgetTagData: CustomWidgetTagData): {
29
+ type: string;
30
+ "data-id": string;
31
+ "widget-id": string;
32
+ };
33
+ }
@@ -0,0 +1,25 @@
1
+ import { InterfaceBlock } from "../extensions/InterfaceBlock";
2
+ import { HtmlBodyTag } from "../models";
3
+ import { CrocoHtmlOptions } from "../options";
4
+ import { IMarkUpTagService, IVisualEditorProps } from "./IMarkUpTagService";
5
+ export declare class DownloadButtonTagDataConsts {
6
+ static readonly TagName = "download-file-button";
7
+ static readonly TitleAttrName = "title";
8
+ static readonly LinkAttrName = "link";
9
+ }
10
+ export interface DownloadButtonTag {
11
+ type: string;
12
+ data: DownloadButtonTagData;
13
+ }
14
+ export interface DownloadButtonTagData {
15
+ title: string;
16
+ link: string;
17
+ }
18
+ export declare class DownloadButtonTagService implements IMarkUpTagService {
19
+ tagName: string;
20
+ shortDescription: string;
21
+ bodyTagToHtmlStringConverter(bodyTag: HtmlBodyTag): string;
22
+ extractBlockFromHtmlElement(elem: HTMLElement, options: CrocoHtmlOptions): InterfaceBlock;
23
+ toBodyTag(data: InterfaceBlock): HtmlBodyTag;
24
+ getDefaultValue(props: IVisualEditorProps): HtmlBodyTag;
25
+ }
@@ -0,0 +1,12 @@
1
+ import { InterfaceBlock } from "../extensions/InterfaceBlock";
2
+ import { HtmlBodyTag } from "../models";
3
+ import { CrocoHtmlOptions } from "../options";
4
+ import { IMarkUpTagService, IVisualEditorProps } from "./IMarkUpTagService";
5
+ export declare class ExternalVideoTagService implements IMarkUpTagService {
6
+ tagName: string;
7
+ shortDescription: string;
8
+ bodyTagToHtmlStringConverter(bodyTag: HtmlBodyTag): string;
9
+ extractBlockFromHtmlElement(elem: HTMLElement, options: CrocoHtmlOptions): InterfaceBlock;
10
+ toBodyTag(data: InterfaceBlock): HtmlBodyTag;
11
+ getDefaultValue(props: IVisualEditorProps): HtmlBodyTag;
12
+ }
@@ -0,0 +1,12 @@
1
+ import { InterfaceBlock } from "../extensions/InterfaceBlock";
2
+ import { HtmlBodyTag } from "../models";
3
+ import { CrocoHtmlOptions } from "../options";
4
+ import { IMarkUpTagService } from "../tag-services/IMarkUpTagService";
5
+ export declare class FileImageTagService implements IMarkUpTagService {
6
+ tagName: string;
7
+ shortDescription: string;
8
+ bodyTagToHtmlStringConverter(bodyTag: HtmlBodyTag): string;
9
+ extractBlockFromHtmlElement(elem: HTMLElement, options: CrocoHtmlOptions): InterfaceBlock;
10
+ toBodyTag(data: InterfaceBlock): HtmlBodyTag;
11
+ getDefaultValue(): HtmlBodyTag;
12
+ }
@@ -0,0 +1,12 @@
1
+ import { InterfaceBlock } from "../extensions/InterfaceBlock";
2
+ import { HtmlBodyTag } from "../models";
3
+ import { CrocoHtmlOptions } from "../options";
4
+ import { IMarkUpTagService, IVisualEditorProps } from "./IMarkUpTagService";
5
+ export declare class HtmlRawTagService implements IMarkUpTagService {
6
+ tagName: string;
7
+ shortDescription: string;
8
+ bodyTagToHtmlStringConverter(bodyTag: HtmlBodyTag): string;
9
+ extractBlockFromHtmlElement(elem: HTMLElement, options: CrocoHtmlOptions): InterfaceBlock;
10
+ toBodyTag(data: InterfaceBlock): HtmlBodyTag;
11
+ getDefaultValue(props: IVisualEditorProps): HtmlBodyTag;
12
+ }
@@ -0,0 +1,35 @@
1
+ import { InterfaceBlock } from "../extensions/InterfaceBlock";
2
+ import { HtmlBodyTag } from "../models";
3
+ import { CrocoHtmlOptions } from "../options";
4
+ export interface IVisualEditorProps {
5
+ selectedVideoPlayer: string;
6
+ htmlRaw: string;
7
+ }
8
+ export interface IMarkUpTagService {
9
+ /**
10
+ * Название тега
11
+ */
12
+ tagName: string;
13
+ /**
14
+ * Описание тега
15
+ */
16
+ shortDescription: string;
17
+ /**
18
+ * Функция для конвертации из модели редактора в Html строку разметки
19
+ * @param bodyTag тег
20
+ * @returns
21
+ */
22
+ bodyTagToHtmlStringConverter: (bodyTag: HtmlBodyTag) => string;
23
+ extractBlockFromHtmlElement: (elem: HTMLElement, options: CrocoHtmlOptions) => InterfaceBlock;
24
+ /**
25
+ * Конвертация блока интерфейса в модель тега для редактора
26
+ * @param data
27
+ * @returns
28
+ */
29
+ toBodyTag: (data: InterfaceBlock) => HtmlBodyTag;
30
+ /**
31
+ * Получить значение по умолчанию
32
+ * @returns
33
+ */
34
+ getDefaultValue: (props: IVisualEditorProps) => HtmlBodyTag;
35
+ }
@@ -0,0 +1,21 @@
1
+ import { InterfaceBlock } from "../extensions/InterfaceBlock";
2
+ import { HtmlBodyTag } from "../models";
3
+ import { CrocoHtmlOptions } from "../options";
4
+ import { IMarkUpTagService, IVisualEditorProps } from "../tag-services/IMarkUpTagService";
5
+ export declare enum TextAlignment {
6
+ Left = "left",
7
+ Center = "center",
8
+ Right = "right"
9
+ }
10
+ export declare class TextTagDataConsts {
11
+ static readonly HAlign = "h-align";
12
+ }
13
+ export declare class TextTagHtmlMarkupTagService implements IMarkUpTagService {
14
+ constructor(tagName: string, shortDescription: string);
15
+ tagName: string;
16
+ shortDescription: string;
17
+ bodyTagToHtmlStringConverter(bodyTag: HtmlBodyTag): string;
18
+ extractBlockFromHtmlElement(elem: HTMLElement, options: CrocoHtmlOptions): InterfaceBlock;
19
+ toBodyTag(data: InterfaceBlock): HtmlBodyTag;
20
+ getDefaultValue(props: IVisualEditorProps): HtmlBodyTag;
21
+ }
@@ -0,0 +1,8 @@
1
+ export * from "./IMarkUpTagService";
2
+ export * from "./FileImageTagService";
3
+ export * from "./TextTagHtmlMarkupTagService";
4
+ export * from "./ExternalVideoTagService";
5
+ export * from "./HtmlRawTagService";
6
+ export * from "./DownloadButtonTagService";
7
+ export * from "./ButtonTagService";
8
+ export * from "./CustomWidgetTagService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "croco-html",
3
- "version": "4.0.2",
3
+ "version": "4.1.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.2.14",
6
6
  "@angular/core": "^19.2.14",
@@ -0,0 +1,8 @@
1
+ export * from './lib/components';
2
+ export * from './lib/pipes';
3
+ export * from './lib/extensions';
4
+ export * from './lib/croco-html.module';
5
+ export * from './lib/models';
6
+ export * from './lib/consts';
7
+ export * from './lib/services';
8
+ export * from './lib/options';
@@ -0,0 +1 @@
1
+ export type SpriteIdsType = 'align-center' | 'align-left' | 'align-right' | 'move-icon' | 'source-code-tab' | 'tag-button-button' | 'tag-button-custom-widget' | 'tag-button-download-file-button' | 'tag-button-external-video' | 'tag-button-file-image' | 'tag-button-html-raw' | 'tag-button-text' | 'viewer-tab' | 'visual-editor-tab';