croco-html 4.6.0 → 4.6.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.
- package/fesm2022/croco-html.mjs +115 -58
- package/fesm2022/croco-html.mjs.map +1 -1
- package/lib/components/html-view/html-view.component.d.ts +3 -1
- package/lib/components/xml-tags/defined-custom-tag-view/defined-custom-tag-view.component.d.ts +3 -1
- package/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.d.ts +3 -1
- package/lib/extensions/BootstrapTableMethods.d.ts +5 -5
- package/lib/extensions/TextSimpleMethods.d.ts +11 -3
- package/lib/index.d.ts +2 -2
- package/lib/services/HtmlPageDataController.d.ts +17 -0
- package/lib/services/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/assets/sprites/symbol/croco-html-svg-sprite.svg +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { HtmlPageDataController } from '../../services';
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
2
3
|
export declare class HtmlViewComponent {
|
|
3
4
|
html: string;
|
|
5
|
+
dataController: HtmlPageDataController;
|
|
4
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<HtmlViewComponent, never>;
|
|
5
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HtmlViewComponent, "croco-html-view", never, { "html": { "alias": "html"; "required": true; }; }, {}, never, never, true, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HtmlViewComponent, "croco-html-view", never, { "html": { "alias": "html"; "required": true; }; "dataController": { "alias": "dataController"; "required": false; }; }, {}, never, never, true, never>;
|
|
6
8
|
}
|
package/lib/components/xml-tags/defined-custom-tag-view/defined-custom-tag-view.component.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentRef, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
|
|
2
2
|
import { InterfaceBlock } from '../../../models/InterfaceBlock';
|
|
3
3
|
import { CrocoHtmlOptions } from '../../../options';
|
|
4
|
+
import { HtmlPageDataController } from '../../../services';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
export declare class DefinedCustomTagViewComponent implements OnInit, OnDestroy {
|
|
6
7
|
private readonly _options;
|
|
@@ -8,11 +9,12 @@ export declare class DefinedCustomTagViewComponent implements OnInit, OnDestroy
|
|
|
8
9
|
useDynamicComponent: boolean;
|
|
9
10
|
dynamicContainerRef: ComponentRef<any>;
|
|
10
11
|
set data(value: InterfaceBlock);
|
|
12
|
+
dataController: HtmlPageDataController;
|
|
11
13
|
_data: InterfaceBlock;
|
|
12
14
|
constructor(_options: CrocoHtmlOptions);
|
|
13
15
|
getCustomComponent(): import("@angular/core").Type<any>;
|
|
14
16
|
ngOnInit(): void;
|
|
15
17
|
ngOnDestroy(): void;
|
|
16
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<DefinedCustomTagViewComponent, never>;
|
|
17
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DefinedCustomTagViewComponent, "croco-html-defined-custom-tag-view", never, { "data": { "alias": "data"; "required": true; }; }, {}, never, never, true, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DefinedCustomTagViewComponent, "croco-html-defined-custom-tag-view", never, { "data": { "alias": "data"; "required": true; }; "dataController": { "alias": "dataController"; "required": true; }; }, {}, never, never, true, never>;
|
|
18
20
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { InterfaceBlock } from "../../../models/InterfaceBlock";
|
|
2
2
|
import { CrocoHtmlOptions } from '../../../options';
|
|
3
|
+
import { HtmlPageDataController } from '../../../services';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class XmlTagViewComponent {
|
|
5
6
|
private readonly _options;
|
|
6
7
|
data: InterfaceBlock[];
|
|
8
|
+
dataController: HtmlPageDataController;
|
|
7
9
|
constructor(_options: CrocoHtmlOptions);
|
|
8
10
|
isHeaderTextTag(item: InterfaceBlock): boolean;
|
|
9
11
|
isDefinedCustomTag(item: InterfaceBlock): boolean;
|
|
10
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<XmlTagViewComponent, never>;
|
|
11
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<XmlTagViewComponent, "croco-html-xml-tag-view", never, { "data": { "alias": "data"; "required":
|
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<XmlTagViewComponent, "croco-html-xml-tag-view", never, { "data": { "alias": "data"; "required": true; }; "dataController": { "alias": "dataController"; "required": true; }; }, {}, never, never, true, never>;
|
|
12
14
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { InterfaceBlock } from "../models/InterfaceBlock";
|
|
2
2
|
import { TableHeaderData, TableRowData } from './TableMethods';
|
|
3
3
|
export declare class BootstrapTableMethods {
|
|
4
|
-
static
|
|
5
|
-
static
|
|
6
|
-
static
|
|
7
|
-
static
|
|
8
|
-
static
|
|
4
|
+
static buildTable(header: TableHeaderData, rows: TableRowData[]): string;
|
|
5
|
+
static buildHeader(data: TableHeaderData): string;
|
|
6
|
+
static buildBody(rows: TableRowData[]): string;
|
|
7
|
+
static buildInnerTags(tags: InterfaceBlock[]): string;
|
|
8
|
+
static buildInnerTag(data: InterfaceBlock): string;
|
|
9
9
|
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { BaseApiResponse } from "../models";
|
|
2
|
+
import { TextAlignment } from "../tag-services";
|
|
2
3
|
export declare const TextTag = "text";
|
|
3
4
|
export interface GenericTextTag {
|
|
4
5
|
tagName: string;
|
|
5
6
|
data: SimpleTextTagData;
|
|
6
7
|
}
|
|
8
|
+
export interface IHorizontalAlignmentExtractionResult {
|
|
9
|
+
succeeded: boolean;
|
|
10
|
+
result: TextAlignment;
|
|
11
|
+
errorMessage: string;
|
|
12
|
+
}
|
|
7
13
|
export interface SimpleTextTagData {
|
|
8
14
|
textTagName: string;
|
|
9
15
|
text: string;
|
|
@@ -13,7 +19,9 @@ export interface SimpleTextTagData {
|
|
|
13
19
|
}
|
|
14
20
|
export declare class TextSimpleMethods {
|
|
15
21
|
static supportedTags: string[];
|
|
16
|
-
static
|
|
17
|
-
static
|
|
18
|
-
static
|
|
22
|
+
static extractTextTag(elem: HTMLElement): GenericTextTag;
|
|
23
|
+
static prepareText(s: string): string;
|
|
24
|
+
static extractHorizontalAlignment(elem: HTMLElement): IHorizontalAlignmentExtractionResult;
|
|
25
|
+
static validateTextHtml(html: string): BaseApiResponse;
|
|
26
|
+
static validateTag(element: Element): BaseApiResponse;
|
|
19
27
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ import { TagToSpanPipe, ToHtmlBodyTagsPipe, ToPreviewHtmlPipe, ToPreviewPipe } f
|
|
|
16
16
|
import { FileImageTagViewComponent, UploadFilesBtnComponent } from "./components";
|
|
17
17
|
import { HtmlRawViewComponent } from "./components";
|
|
18
18
|
import { XmlTagCustomWidgetComponent } from "./components";
|
|
19
|
-
export declare const EditorComponents: (typeof
|
|
19
|
+
export declare const EditorComponents: (typeof AddFilesBtnComponent | typeof HtmlRawEditorComponent | typeof FileIdSelectComponent | typeof ImageEditorComponent | typeof TextEditorComponent | typeof CustomWidgetEditorComponent | typeof DefinedCustomEditorBlockComponent | typeof MainEditorBlockComponent | typeof CustomWidgetIconComponent | typeof VisualEditorComponent | typeof MainEditorComponent)[];
|
|
20
20
|
export declare const XmlComponents: (typeof XmlTagExternalVideoComponent | typeof XmlTagHeaderInnerTextViewComponent | typeof XmlTagHtmlViewComponent | typeof FileImageTagViewComponent | typeof HtmlRawViewComponent | typeof XmlTagCustomWidgetComponent | typeof DefinedCustomTagViewComponent | typeof XmlTagViewComponent)[];
|
|
21
21
|
export declare const CrocoPipes: (typeof ToPreviewPipe | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
|
|
22
|
-
export declare const CrocoHtmlDeclarations: (typeof
|
|
22
|
+
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 TextEditorComponent | typeof CustomWidgetEditorComponent | typeof DefinedCustomEditorBlockComponent | typeof MainEditorBlockComponent | typeof CustomWidgetIconComponent | typeof VisualEditorComponent | typeof ToPreviewPipe | typeof MainEditorComponent | typeof TagToSpanPipe | typeof ToHtmlBodyTagsPipe | typeof ToPreviewHtmlPipe)[];
|
|
23
23
|
export declare const MaterialModules: (typeof MatCardModule)[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Сервис для прокидывания предрасчитанных данных для виджетов Html разметки.
|
|
3
|
+
* Используется для оптимизации Http запросов за данными.
|
|
4
|
+
*/
|
|
5
|
+
export declare class HtmlPageDataController {
|
|
6
|
+
data: object | null;
|
|
7
|
+
/**
|
|
8
|
+
* Получить данные.
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
get<T>(): T | null;
|
|
12
|
+
/**
|
|
13
|
+
* Установить данные.
|
|
14
|
+
* @param data
|
|
15
|
+
*/
|
|
16
|
+
set(data: object): void;
|
|
17
|
+
}
|
package/lib/services/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><symbol fill="none" viewBox="0 0 20 20" id="align-center" xmlns="http://www.w3.org/2000/svg"><path d="M5 14.688h10M3.125 11.562h13.75M5 8.438h10M3.125 5.312h13.75" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor"/></symbol><symbol fill="none" viewBox="0 0 20 20" id="align-left" xmlns="http://www.w3.org/2000/svg"><path d="M3.125 14.688h10m-10-3.126h13.75M3.125 8.438h10m-10-3.126h13.75" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor"/></symbol><symbol fill="currentColor" viewBox="0 0 20 20" id="align-right" xmlns="http://www.w3.org/2000/svg"><path d="M6.875 14.688h10m-13.75-3.126h13.75m-10-3.124h10M3.125 5.312h13.75" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor"/></symbol><symbol fill="none" viewBox="0 0
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><symbol fill="none" viewBox="0 0 20 20" id="align-center" xmlns="http://www.w3.org/2000/svg"><path d="M5 14.688h10M3.125 11.562h13.75M5 8.438h10M3.125 5.312h13.75" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor"/></symbol><symbol fill="none" viewBox="0 0 20 20" id="align-left" xmlns="http://www.w3.org/2000/svg"><path d="M3.125 14.688h10m-10-3.126h13.75M3.125 8.438h10m-10-3.126h13.75" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor"/></symbol><symbol fill="currentColor" viewBox="0 0 20 20" id="align-right" xmlns="http://www.w3.org/2000/svg"><path d="M6.875 14.688h10m-13.75-3.126h13.75m-10-3.124h10M3.125 5.312h13.75" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor"/></symbol><symbol fill="none" viewBox="0 0 24 24" id="move-icon" xmlns="http://www.w3.org/2000/svg"><path d="M14.652 19.098 12 21.75m0 0-2.652-2.652M12 21.75V15m-7.098-.348L2.25 12m0 0 2.652-2.652M2.25 12H9m10.098-2.652L21.75 12m0 0-2.652 2.652M21.75 12H15M9.348 4.902 12 2.25m0 0 2.652 2.652M12 2.25V9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol viewBox="0 0 30 24" id="source-code-tab" xmlns="http://www.w3.org/2000/svg"><path d="m13.075 23.976-2.86-.83a.563.563 0 0 1-.384-.698L16.229.407a.563.563 0 0 1 .699-.384l2.86.83c.3.084.468.398.384.698l-6.399 22.04a.562.562 0 0 1-.698.385Zm-5.344-5.26 2.039-2.175a.563.563 0 0 0-.038-.806L5.486 12l4.246-3.736a.559.559 0 0 0 .038-.806L7.73 5.282a.563.563 0 0 0-.796-.023L.179 11.587c-.239.22-.239.6 0 .82l6.755 6.333c.23.215.586.206.797-.024Zm15.337.028 6.755-6.332c.24-.22.24-.6 0-.82l-6.755-6.338a.568.568 0 0 0-.797.023l-2.039 2.175a.563.563 0 0 0 .038.807l4.247 3.74-4.247 3.736a.559.559 0 0 0-.038.806l2.04 2.175c.21.23.567.24.796.028Z"/></symbol><symbol fill="none" viewBox="0 0 20 20" id="tag-button-button" xmlns="http://www.w3.org/2000/svg"><path stroke="currentColor" d="M10 3.75v5.938m3.75-5.451a6.875 6.875 0 1 1-7.5 0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol fill="none" viewBox="0 0 20 20" id="tag-button-custom-widget" xmlns="http://www.w3.org/2000/svg"><path stroke="currentColor" d="M16.25 15v1.25m-2.5-3.75h2.5m-5 3.75h2.5v-5m-2.5 0v2.5m-6.875-2.5h3.75c.345 0 .625.28.625.625v3.75c0 .345-.28.625-.625.625h-3.75a.625.625 0 0 1-.625-.625v-3.75c0-.345.28-.625.625-.625Zm7.5-7.5h3.75c.345 0 .625.28.625.625v3.75c0 .345-.28.625-.625.625h-3.75a.625.625 0 0 1-.625-.625v-3.75c0-.345.28-.625.625-.625Zm-7.5 0h3.75c.345 0 .625.28.625.625v3.75c0 .345-.28.625-.625.625h-3.75a.625.625 0 0 1-.625-.625v-3.75c0-.345.28-.625.625-.625Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol fill="none" viewBox="0 0 24 24" id="tag-button-download-file-button" xmlns="http://www.w3.org/2000/svg"><path stroke="currentColor" clip-rule="evenodd" d="M4.424 9.417c-.924 0-1.674.75-1.674 1.674v8.485c0 .924.75 1.674 1.674 1.674h15.152c.924 0 1.674-.75 1.674-1.674V11.09c0-.925-.75-1.674-1.674-1.674h-3.637a.75.75 0 0 1 0-1.5h3.637a3.174 3.174 0 0 1 3.174 3.174v8.485a3.174 3.174 0 0 1-3.174 3.174H4.424a3.174 3.174 0 0 1-3.174-3.174V11.09a3.174 3.174 0 0 1 3.174-3.174h3.637a.75.75 0 1 1 0 1.5H4.424Z"/><path stroke="currentColor" clip-rule="evenodd" d="M12 1.25a.75.75 0 0 1 .75.75v13.94a.75.75 0 0 1-1.5 0V2a.75.75 0 0 1 .75-.75Z"/><path stroke="currentColor" clip-rule="evenodd" d="M7.833 12.985a.75.75 0 0 1 1.061 0L12 16.09l3.106-3.106a.75.75 0 0 1 1.06 1.06l-3.636 3.637a.75.75 0 0 1-1.06 0l-3.637-3.636a.75.75 0 0 1 0-1.061Z"/></symbol><symbol fill="none" viewBox="0 0 20 20" id="tag-button-external-video" xmlns="http://www.w3.org/2000/svg"><path stroke="currentColor" d="m14.375 8.75 4.375-2.5v7.5l-4.375-2.5m-12.5-6.563h10a2.5 2.5 0 0 1 2.5 2.5v7.5a.624.624 0 0 1-.625.626h-10a2.5 2.5 0 0 1-2.5-2.5v-7.5a.625.625 0 0 1 .625-.625Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol fill="none" viewBox="0 0 20 20" id="tag-button-file-image" xmlns="http://www.w3.org/2000/svg"><path d="m2.5 13.125 3.933-3.933a.625.625 0 0 1 .884 0l3.491 3.491a.626.626 0 0 0 .884 0l1.616-1.616a.626.626 0 0 1 .884 0l3.308 3.308M3.125 3.75h13.75c.345 0 .625.28.625.625v11.25c0 .345-.28.625-.625.625H3.125a.625.625 0 0 1-.625-.625V4.375c0-.345.28-.625.625-.625Zm10 4.063a.937.937 0 1 1-1.875 0 .937.937 0 0 1 1.875 0Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor"/></symbol><symbol fill="none" viewBox="0 0 20 20" id="tag-button-html-raw" xmlns="http://www.w3.org/2000/svg"><path d="M15 6.875 18.75 10 15 13.125M5 6.875 1.25 10 5 13.125m7.5-10-5 13.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol fill="none" viewBox="0 0 20 20" id="tag-button-text" xmlns="http://www.w3.org/2000/svg"><path d="M7.5 15.625h5M10 4.375v11.25m-6.25-8.75v-2.5h12.5v2.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol viewBox="0 0 32 30" id="viewer-tab" xmlns="http://www.w3.org/2000/svg"><path d="M31.808 14.189C28.797 8.31 22.83 4.333 16.003 4.333 9.175 4.333 3.208 8.311.197 14.19a1.8 1.8 0 0 0 0 1.622c3.011 5.878 8.978 9.856 15.806 9.856 6.827 0 12.794-3.978 15.805-9.856a1.8 1.8 0 0 0 0-1.622ZM16.003 23a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm0-13.333a5.294 5.294 0 0 0-1.406.21 2.661 2.661 0 0 1-3.717 3.717 5.323 5.323 0 1 0 5.123-3.927Z"/><path fill="none" d="M0 0h32v28.444H0z"/></symbol><symbol viewBox="0 0 32 26" id="visual-editor-tab" xmlns="http://www.w3.org/2000/svg"><path d="M12.75 13.285a.794.794 0 0 0 1.13 0l.565-.565a.794.794 0 0 0 0-1.13l-1.78-1.79 1.785-1.785a.794.794 0 0 0 0-1.13l-.565-.565a.794.794 0 0 0-1.13 0L9.84 9.235a.794.794 0 0 0 0 1.13l2.92 2.915-.01.005Zm4.8-.565.565.565a.794.794 0 0 0 1.13 0l2.915-2.915a.794.794 0 0 0 0-1.13l-2.915-2.915a.794.794 0 0 0-1.13 0l-.565.565a.794.794 0 0 0 0 1.13l1.79 1.78-1.785 1.785a.794.794 0 0 0 0 1.13l-.005.005ZM31.2 21H19.075c-.035.99-.735 1.6-1.635 1.6H14.4c-.935 0-1.65-.875-1.64-1.6H.8c-.44 0-.8.36-.8.8v.8c0 1.76 1.44 3.2 3.2 3.2h25.6c1.76 0 3.2-1.44 3.2-3.2v-.8c0-.44-.36-.8-.8-.8ZM28.8 2.6c0-1.32-1.08-2.4-2.4-2.4H5.6C4.28.2 3.2 1.28 3.2 2.6v16.8h25.6V2.6Zm-3.2 13.6H6.4V3.4h19.2v12.8Z"/><path fill="none" d="M0 0h32v25.6H0z"/></symbol></svg>
|