croco-html 2.12.0 → 2.13.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.
- package/esm2022/lib/components/add-files-btn/add-files-btn.component.mjs +5 -5
- package/esm2022/lib/components/editor/download-file-button-block/download-file-button-block.component.mjs +42 -0
- package/esm2022/lib/components/editor/external-video-block/external-video-block.component.mjs +24 -7
- package/esm2022/lib/components/editor/html-raw-editor/html-raw-editor.component.mjs +7 -6
- package/esm2022/lib/components/editor/image-editor/image-editor.component.mjs +9 -8
- package/esm2022/lib/components/editor/main-editor/main-editor.component.mjs +13 -12
- package/esm2022/lib/components/editor/main-editor-block/main-editor-block.component.mjs +18 -10
- package/esm2022/lib/components/editor/text-editor/text-editor.component.mjs +9 -8
- package/esm2022/lib/components/editor/visual-editor/visual-editor.component.mjs +15 -15
- package/esm2022/lib/components/file-id-select/file-id-select.component.mjs +7 -5
- package/esm2022/lib/components/html-view/html-view.component.mjs +5 -5
- package/esm2022/lib/components/upload-files-btn/upload-files-btn.component.mjs +4 -4
- package/esm2022/lib/components/xml-tags/file-image-tag-view/file-image-tag-view.component.mjs +3 -3
- package/esm2022/lib/components/xml-tags/html-raw-view/html-raw-view.component.mjs +3 -3
- package/esm2022/lib/components/xml-tags/xml-tag-download-file-button/xml-tag-download-file-button.component.mjs +52 -0
- package/esm2022/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.mjs +5 -5
- package/esm2022/lib/components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component.mjs +3 -3
- package/esm2022/lib/components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component.mjs +4 -4
- package/esm2022/lib/components/xml-tags/xml-tag-html-view/xml-tag-html-view.component.mjs +3 -3
- package/esm2022/lib/components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component.mjs +4 -4
- package/esm2022/lib/components/xml-tags/xml-tag-table-view/xml-tag-table-view.component.mjs +4 -4
- package/esm2022/lib/components/xml-tags/xml-tag-text-view/xml-tag-text-view.component.mjs +3 -3
- package/esm2022/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.mjs +20 -11
- package/esm2022/lib/croco-html.module.mjs +66 -73
- package/esm2022/lib/extensions/DownloadButtonMethods.mjs +2 -2
- package/esm2022/lib/index.mjs +1 -3
- package/esm2022/lib/pipes/RichTextToHtmlPipe.mjs +4 -3
- package/esm2022/lib/pipes/TagToSpanPipe.mjs +4 -3
- package/esm2022/lib/pipes/ToHtmlBodyTagsPipe.mjs +4 -3
- package/esm2022/lib/pipes/ToPreviewHtmlPipe.mjs +4 -3
- package/esm2022/lib/pipes/to-preview.pipe.mjs +4 -3
- package/esm2022/lib/services/blob-create.service.mjs +4 -4
- package/fesm2022/croco-html.mjs +391 -360
- package/fesm2022/croco-html.mjs.map +1 -1
- package/lib/components/add-files-btn/add-files-btn.component.d.ts +1 -1
- package/lib/components/editor/download-file-button-block/download-file-button-block.component.d.ts +13 -0
- package/lib/components/editor/external-video-block/external-video-block.component.d.ts +3 -1
- package/lib/components/editor/html-raw-editor/html-raw-editor.component.d.ts +1 -1
- package/lib/components/editor/image-editor/image-editor.component.d.ts +1 -1
- package/lib/components/editor/main-editor/main-editor.component.d.ts +1 -1
- package/lib/components/editor/main-editor-block/main-editor-block.component.d.ts +1 -1
- package/lib/components/editor/text-editor/text-editor.component.d.ts +1 -1
- package/lib/components/editor/visual-editor/visual-editor.component.d.ts +1 -1
- package/lib/components/file-id-select/file-id-select.component.d.ts +1 -1
- package/lib/components/html-view/html-view.component.d.ts +1 -1
- package/lib/components/upload-files-btn/upload-files-btn.component.d.ts +1 -1
- package/lib/components/xml-tags/file-image-tag-view/file-image-tag-view.component.d.ts +1 -1
- package/lib/components/xml-tags/html-raw-view/html-raw-view.component.d.ts +1 -1
- package/lib/components/xml-tags/{xml-tag-download-button/xml-tag-download-button.component.d.ts → xml-tag-download-file-button/xml-tag-download-file-button.component.d.ts} +3 -3
- package/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.d.ts +1 -1
- package/lib/components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component.d.ts +1 -1
- package/lib/components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component.d.ts +1 -1
- package/lib/components/xml-tags/xml-tag-html-view/xml-tag-html-view.component.d.ts +1 -1
- package/lib/components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component.d.ts +1 -1
- package/lib/components/xml-tags/xml-tag-table-view/xml-tag-table-view.component.d.ts +1 -1
- package/lib/components/xml-tags/xml-tag-text-view/xml-tag-text-view.component.d.ts +1 -1
- package/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.d.ts +1 -1
- package/lib/croco-html.module.d.ts +63 -65
- package/lib/index.d.ts +8 -8
- package/lib/pipes/RichTextToHtmlPipe.d.ts +1 -1
- package/lib/pipes/TagToSpanPipe.d.ts +1 -1
- package/lib/pipes/ToHtmlBodyTagsPipe.d.ts +1 -1
- package/lib/pipes/ToPreviewHtmlPipe.d.ts +1 -1
- package/lib/pipes/to-preview.pipe.d.ts +1 -1
- package/lib/services/blob-create.service.d.ts +2 -2
- package/package.json +1 -1
- package/esm2022/lib/components/editor/download-button-block/download-button-block.component.mjs +0 -40
- package/esm2022/lib/components/xml-tags/xml-tag-download-button/xml-tag-download-button.component.mjs +0 -54
- package/lib/components/editor/download-button-block/download-button-block.component.d.ts +0 -13
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Component, Input } from '@angular/core';
|
|
2
|
-
import { VkVideoPlayerComponent } from "../../editor/external-video-block/vk-video-player/vk-video-player.component";
|
|
3
|
-
import { YoutubeVideoPlayerComponent } from "../../editor/external-video-block/youtube-video-player/youtube-video-player.component";
|
|
4
|
-
import { MatButton } from "@angular/material/button";
|
|
5
|
-
import { MatIcon } from "@angular/material/icon";
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
import * as i1 from "../../../services/blob-create.service";
|
|
8
|
-
export class XmlTagDownloadButtonComponent {
|
|
9
|
-
set data(value) {
|
|
10
|
-
this.tagData = value.data;
|
|
11
|
-
}
|
|
12
|
-
;
|
|
13
|
-
set tagData(value) {
|
|
14
|
-
this._block = {
|
|
15
|
-
title: value.title,
|
|
16
|
-
link: value.link
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
;
|
|
20
|
-
constructor(_blobCreateService) {
|
|
21
|
-
this._blobCreateService = _blobCreateService;
|
|
22
|
-
this._block = {
|
|
23
|
-
title: '',
|
|
24
|
-
link: ''
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
downloadFile() {
|
|
28
|
-
this._blobCreateService.getBlob(this._block.link).subscribe(blob => {
|
|
29
|
-
const link = document.createElement('a');
|
|
30
|
-
const objectUrl = URL.createObjectURL(blob);
|
|
31
|
-
link.href = objectUrl;
|
|
32
|
-
const regex = /[^/]+$/;
|
|
33
|
-
link.download = this._block.link.match(regex)[0] || 'Без названия';
|
|
34
|
-
link.click();
|
|
35
|
-
URL.revokeObjectURL(objectUrl);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagDownloadButtonComponent, deps: [{ token: i1.BlobCreateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
39
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: XmlTagDownloadButtonComponent, isStandalone: true, selector: "croco-html-xml-tag-download-button", inputs: { data: "data", tagData: "tagData" }, ngImport: i0, template: "<span\n class=\"download-button\"\n (click)=\"downloadFile()\">\n <mat-icon> save</mat-icon>\n {{this._block.title}}\n</span>\n", styles: [".download-button{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;transition:.2s ease-in-out}.download-button mat-icon{margin-right:5px}.download-button:hover{opacity:.7}\n"], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
|
|
40
|
-
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagDownloadButtonComponent, decorators: [{
|
|
42
|
-
type: Component,
|
|
43
|
-
args: [{ selector: 'croco-html-xml-tag-download-button', standalone: true, imports: [
|
|
44
|
-
VkVideoPlayerComponent,
|
|
45
|
-
YoutubeVideoPlayerComponent,
|
|
46
|
-
MatButton,
|
|
47
|
-
MatIcon
|
|
48
|
-
], template: "<span\n class=\"download-button\"\n (click)=\"downloadFile()\">\n <mat-icon> save</mat-icon>\n {{this._block.title}}\n</span>\n", styles: [".download-button{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;transition:.2s ease-in-out}.download-button mat-icon{margin-right:5px}.download-button:hover{opacity:.7}\n"] }]
|
|
49
|
-
}], ctorParameters: () => [{ type: i1.BlobCreateService }], propDecorators: { data: [{
|
|
50
|
-
type: Input
|
|
51
|
-
}], tagData: [{
|
|
52
|
-
type: Input
|
|
53
|
-
}] } });
|
|
54
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoieG1sLXRhZy1kb3dubG9hZC1idXR0b24uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY3JvY28taHRtbC9zcmMvbGliL2NvbXBvbmVudHMveG1sLXRhZ3MveG1sLXRhZy1kb3dubG9hZC1idXR0b24veG1sLXRhZy1kb3dubG9hZC1idXR0b24uY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY3JvY28taHRtbC9zcmMvbGliL2NvbXBvbmVudHMveG1sLXRhZ3MveG1sLXRhZy1kb3dubG9hZC1idXR0b24veG1sLXRhZy1kb3dubG9hZC1idXR0b24uY29tcG9uZW50Lmh0b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iAgICApO1xuICB9XG59XG4iLCI8c3BhblxuICBjbGFzcz1cImRvd25sb2FkLWJ1dHRvblwiXG4gIChjbGljayk9XCJkb3dubG9hZEZpbGUoKVwiPlxuICA8bWF0LWljb24+IHNhdmU8L21hdC1pY29uPlxuICB7e3RoaXMuX2Jsb2NrLnRpdGxlfX1cbjwvc3Bhbj5cbiJdfQ==
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import { HtmlBodyTag } from "../../../models/models";
|
|
3
|
-
import { DownloadButtonTagData } from "../../../extensions/DownloadButtonMethods";
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class DownloadButtonBlockComponent {
|
|
6
|
-
tag: HtmlBodyTag;
|
|
7
|
-
onTagUpdated: EventEmitter<HtmlBodyTag>;
|
|
8
|
-
tagData: DownloadButtonTagData;
|
|
9
|
-
ngOnInit(): void;
|
|
10
|
-
linkChanged(): void;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DownloadButtonBlockComponent, never>;
|
|
12
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DownloadButtonBlockComponent, "croco-html-download-button-block", never, { "tag": { "alias": "tag"; "required": false; }; }, { "onTagUpdated": "onTagUpdated"; }, never, never, true, never>;
|
|
13
|
-
}
|