croco-html 3.2.0 → 3.3.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.
- package/esm2022/lib/components/editor/html-editor-settings-modal/html-editor-settings-modal.component.mjs +4 -4
- package/esm2022/lib/components/editor/main-editor/main-editor.component.mjs +22 -13
- package/esm2022/lib/components/file-id-select/file-id-select.component.mjs +4 -4
- package/esm2022/lib/components/upload-files-btn/upload-files-btn.component.mjs +2 -2
- package/esm2022/lib/options/index.mjs +1 -1
- package/esm2022/lib/services/CrocoHtmlFileOptionsService.mjs +32 -0
- package/esm2022/lib/services/index.mjs +2 -1
- package/fesm2022/croco-html.mjs +24 -16
- package/fesm2022/croco-html.mjs.map +1 -1
- package/lib/components/editor/html-editor-settings-modal/html-editor-settings-modal.component.d.ts +4 -4
- package/lib/components/editor/main-editor/main-editor.component.d.ts +6 -4
- package/lib/components/file-id-select/file-id-select.component.d.ts +1 -1
- package/lib/components/upload-files-btn/upload-files-btn.component.d.ts +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/options/index.d.ts +4 -0
- package/lib/services/{croco-html-file-options.service.d.ts → CrocoHtmlFileOptionsService.d.ts} +0 -1
- package/lib/services/index.d.ts +1 -0
- package/package.json +1 -1
- package/esm2022/lib/services/croco-html-file-options.service.mjs +0 -32
package/lib/components/editor/html-editor-settings-modal/html-editor-settings-modal.component.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { FormBuilder, FormGroup } from "@angular/forms";
|
|
3
3
|
import { MatDialogRef } from "@angular/material/dialog";
|
|
4
|
-
import { CrocoHtmlFileOptionsService } from "../../../services/
|
|
4
|
+
import { CrocoHtmlFileOptionsService } from "../../../services/CrocoHtmlFileOptionsService";
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class HtmlEditorSettingsModalComponent implements OnInit {
|
|
7
|
-
private fb;
|
|
8
|
-
dialogRef: MatDialogRef<HtmlEditorSettingsModalComponent>;
|
|
9
|
-
private _htmlSettingsService;
|
|
7
|
+
private readonly fb;
|
|
8
|
+
readonly dialogRef: MatDialogRef<HtmlEditorSettingsModalComponent>;
|
|
9
|
+
private readonly _htmlSettingsService;
|
|
10
10
|
form: FormGroup;
|
|
11
11
|
constructor(fb: FormBuilder, dialogRef: MatDialogRef<HtmlEditorSettingsModalComponent>, _htmlSettingsService: CrocoHtmlFileOptionsService);
|
|
12
12
|
ngOnInit(): void;
|
|
@@ -3,21 +3,23 @@ import { MatSnackBar } from '@angular/material/snack-bar';
|
|
|
3
3
|
import { ClipboardService } from 'ngx-clipboard';
|
|
4
4
|
import { VisualEditorComponent } from '../visual-editor/visual-editor.component';
|
|
5
5
|
import { MatDialog } from "@angular/material/dialog";
|
|
6
|
-
import {
|
|
6
|
+
import { CrocoHtmlOptions } from "../../../options";
|
|
7
|
+
import { CrocoHtmlFileOptionsService } from "../../../services/CrocoHtmlFileOptionsService";
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
export declare class MainEditorComponent implements OnInit, AfterContentChecked, AfterViewInit {
|
|
9
10
|
private readonly _clipboardService;
|
|
10
11
|
private readonly _snackBar;
|
|
11
12
|
private readonly _cdref;
|
|
12
13
|
private readonly _dialog;
|
|
13
|
-
private _htmlSettingsService;
|
|
14
|
+
private readonly _htmlSettingsService;
|
|
14
15
|
visualEditorRendered: boolean;
|
|
15
16
|
visualEditor: VisualEditorComponent;
|
|
16
17
|
showMarkUp: boolean;
|
|
17
18
|
useHtmlRaw: boolean;
|
|
18
19
|
html: string;
|
|
19
20
|
onHtmlChanged: EventEmitter<string>;
|
|
20
|
-
|
|
21
|
+
showSettingsButton: boolean;
|
|
22
|
+
constructor(_clipboardService: ClipboardService, _snackBar: MatSnackBar, _cdref: ChangeDetectorRef, _dialog: MatDialog, _htmlSettingsService: CrocoHtmlFileOptionsService, options: CrocoHtmlOptions);
|
|
21
23
|
ngAfterViewInit(): void;
|
|
22
24
|
ngAfterContentChecked(): void;
|
|
23
25
|
visualEditorRenderedHandler(): void;
|
|
@@ -26,7 +28,7 @@ export declare class MainEditorComponent implements OnInit, AfterContentChecked,
|
|
|
26
28
|
recalculateBodyTags(): void;
|
|
27
29
|
copyMarkUp(): void;
|
|
28
30
|
ngOnInit(): void;
|
|
29
|
-
|
|
31
|
+
openSettingsModal(): void;
|
|
30
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<MainEditorComponent, never>;
|
|
31
33
|
static ɵcmp: i0.ɵɵComponentDeclaration<MainEditorComponent, "croco-html-main-editor", never, { "showMarkUp": { "alias": "showMarkUp"; "required": false; }; "useHtmlRaw": { "alias": "useHtmlRaw"; "required": false; }; "html": { "alias": "html"; "required": false; }; }, { "html": "html"; "onHtmlChanged": "onHtmlChanged"; }, never, never, true, never>;
|
|
32
34
|
}
|
|
@@ -2,7 +2,7 @@ import { EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
|
|
2
2
|
import { PublicFilesQueryService } from '../../services/PublicFilesQueryService';
|
|
3
3
|
import { CrocoHtmlEditorFileOptions, CrocoHtmlOptions } from '../../options';
|
|
4
4
|
import { PrivateFilesQueryService } from "../../services/PrivateFilesQueryService";
|
|
5
|
-
import { CrocoHtmlFileOptionsService } from "../../services/
|
|
5
|
+
import { CrocoHtmlFileOptionsService } from "../../services/CrocoHtmlFileOptionsService";
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export interface SearchQuestionsFormData {
|
|
8
8
|
q: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import { PublicFilesUploadResponse, PublicFileUploadService } from '../../services/PublicFileUploadService';
|
|
3
3
|
import { PrivateFilesCreatedResult, PrivateFileUploadService } from "../../services/PrivateFileUploadService";
|
|
4
|
-
import { CrocoHtmlFileOptionsService } from "../../services/
|
|
4
|
+
import { CrocoHtmlFileOptionsService } from "../../services/CrocoHtmlFileOptionsService";
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export interface FilePostingStarted {
|
|
7
7
|
filesCount: number;
|
package/lib/index.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ import { FileImageTagViewComponent, UploadFilesBtnComponent } from "./components
|
|
|
18
18
|
import { HtmlRawViewComponent } from "./components";
|
|
19
19
|
import { HtmlViewComponent } from "./components";
|
|
20
20
|
import { XmlTagCustomWidgetComponent } from "./components";
|
|
21
|
-
export declare const EditorComponents: (typeof
|
|
21
|
+
export declare const EditorComponents: (typeof VisualEditorComponent | typeof MainEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof AddFilesBtnComponent | typeof MainEditorBlockComponent | typeof HtmlRawEditorComponent | typeof TextEditorComponent | typeof CustomWidgetEditorComponent)[];
|
|
22
22
|
export declare const XmlComponents: (typeof HtmlViewComponent | typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof FileImageTagViewComponent | typeof HtmlRawViewComponent | typeof XmlTagCustomWidgetComponent | typeof XmlTagViewComponent)[];
|
|
23
23
|
export declare const CrocoPipes: (typeof RichTextToHtmlPipe | typeof ToPreviewPipe | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
|
|
24
|
-
export declare const CrocoHtmlDeclarations: (typeof
|
|
24
|
+
export declare const CrocoHtmlDeclarations: (typeof VisualEditorComponent | typeof HtmlViewComponent | typeof MainEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof UploadFilesBtnComponent | typeof AddFilesBtnComponent | typeof MainEditorBlockComponent | typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof RichTextToHtmlPipe | typeof XmlTagRichTextViewComponent | typeof XmlTagTableViewComponent | typeof FileImageTagViewComponent | typeof HtmlRawViewComponent | typeof XmlTagCustomWidgetComponent | typeof XmlTagViewComponent | typeof HtmlRawEditorComponent | typeof TextEditorComponent | typeof CustomWidgetEditorComponent | typeof ToPreviewPipe | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
|
|
25
25
|
export declare const MaterialModules: (typeof MatTabsModule)[];
|
package/lib/options/index.d.ts
CHANGED
|
@@ -21,6 +21,10 @@ export interface CrocoHtmlOptions {
|
|
|
21
21
|
* Использовать кнопку для отрисовки кастомных виджетов
|
|
22
22
|
*/
|
|
23
23
|
useCustomWidgetsButton: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Показывать кнопку для запуска настроек
|
|
26
|
+
*/
|
|
27
|
+
showSettingsButton: boolean;
|
|
24
28
|
/**
|
|
25
29
|
* Обработчик нажатия на кнопку кастомных виджетов
|
|
26
30
|
* @returns
|
package/lib/services/{croco-html-file-options.service.d.ts → CrocoHtmlFileOptionsService.d.ts}
RENAMED
|
@@ -3,7 +3,6 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
export declare class CrocoHtmlFileOptionsService {
|
|
4
4
|
private readonly localStorageToken;
|
|
5
5
|
private readonly defaultOptions;
|
|
6
|
-
constructor();
|
|
7
6
|
set(data: CrocoHtmlEditorFileOptions): void;
|
|
8
7
|
get(): CrocoHtmlEditorFileOptions;
|
|
9
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<CrocoHtmlFileOptionsService, never>;
|
package/lib/services/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export class CrocoHtmlFileOptionsService {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.localStorageToken = 'crocoHtmlEditorFileOptions';
|
|
6
|
-
this.defaultOptions = {
|
|
7
|
-
applicationId: null,
|
|
8
|
-
usePrivateFiles: false,
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
set(data) {
|
|
12
|
-
localStorage.setItem(this.localStorageToken, JSON.stringify(data));
|
|
13
|
-
}
|
|
14
|
-
get() {
|
|
15
|
-
try {
|
|
16
|
-
const data = localStorage.getItem(this.localStorageToken);
|
|
17
|
-
return data ? JSON.parse(data) : this.defaultOptions;
|
|
18
|
-
}
|
|
19
|
-
catch (e) {
|
|
20
|
-
return this.defaultOptions;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CrocoHtmlFileOptionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
24
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CrocoHtmlFileOptionsService, providedIn: 'root' }); }
|
|
25
|
-
}
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CrocoHtmlFileOptionsService, decorators: [{
|
|
27
|
-
type: Injectable,
|
|
28
|
-
args: [{
|
|
29
|
-
providedIn: 'root'
|
|
30
|
-
}]
|
|
31
|
-
}], ctorParameters: () => [] });
|
|
32
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JvY28taHRtbC1maWxlLW9wdGlvbnMuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Nyb2NvLWh0bWwvc3JjL2xpYi9zZXJ2aWNlcy9jcm9jby1odG1sLWZpbGUtb3B0aW9ucy5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7O0FBTTNDLE1BQU0sT0FBTywyQkFBMkI7SUFPdEM7UUFOaUIsc0JBQWlCLEdBQUcsNEJBQTRCLENBQUE7UUFDaEQsbUJB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