@node-projects/web-component-designer 0.0.256 → 0.0.258
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/dist/elements/item/IDesignItem.d.ts +4 -4
- package/dist/elements/services/htmlWriterService/AbstractHtmlWriterService.d.ts +5 -3
- package/dist/elements/services/htmlWriterService/AbstractHtmlWriterService.js +14 -5
- package/dist/elements/services/htmlWriterService/FormatingHtmlWriterService.d.ts +3 -1
- package/dist/elements/services/htmlWriterService/FormatingHtmlWriterService.js +11 -2
- package/dist/elements/services/htmlWriterService/HtmlWriterOptions.d.ts +7 -0
- package/dist/elements/services/htmlWriterService/HtmlWriterOptions.js +7 -0
- package/dist/elements/services/htmlWriterService/HtmlWriterService.d.ts +3 -2
- package/dist/elements/services/htmlWriterService/HtmlWriterService.js +9 -6
- package/dist/elements/services/htmlWriterService/IHtmlWriterOptions.d.ts +6 -6
- package/dist/elements/services/htmlWriterService/IHtmlWriterOptions.js +1 -7
- package/dist/elements/services/htmlWriterService/IHtmlWriterService.d.ts +3 -2
- package/dist/elements/services/htmlWriterService/LitTsElementWriterService.d.ts +4 -2
- package/dist/elements/services/htmlWriterService/LitTsElementWriterService.js +10 -1
- package/dist/elements/services/htmlWriterService/SimpleHtmlWriterService.d.ts +4 -2
- package/dist/elements/services/htmlWriterService/SimpleHtmlWriterService.js +11 -2
- package/dist/elements/services/propertiesService/services/AbstractPropertiesService.d.ts +1 -1
- package/dist/elements/services/propertiesService/services/AttributesPropertiesService.d.ts +1 -1
- package/dist/elements/services/propertiesService/services/CssCurrentPropertiesService.d.ts +1 -1
- package/dist/elements/widgets/designerView/DomConverter.js +3 -2
- package/package.json +1 -1
|
@@ -52,8 +52,8 @@ export interface IDesignItem {
|
|
|
52
52
|
getOrCreateDesignItem(node: Node): any;
|
|
53
53
|
openGroup(title: string): ChangeGroup;
|
|
54
54
|
styles(): Iterable<[name: string, value: string]>;
|
|
55
|
-
getStyle(name: string):
|
|
56
|
-
hasStyle(name: string):
|
|
55
|
+
getStyle(name: string): string;
|
|
56
|
+
hasStyle(name: string): boolean;
|
|
57
57
|
setStyle(name: string, value?: string | null, important?: boolean): any;
|
|
58
58
|
removeStyle(name: string): any;
|
|
59
59
|
updateStyleInSheetOrLocal(name: string, value?: string | null, important?: boolean): any;
|
|
@@ -61,8 +61,8 @@ export interface IDesignItem {
|
|
|
61
61
|
getStyleFromSheetOrLocalOrComputed(name: string, fallback?: string): any;
|
|
62
62
|
getAllStyles(): IStyleRule[];
|
|
63
63
|
attributes(): Iterable<[name: string, value: string]>;
|
|
64
|
-
getAttribute(name: string):
|
|
65
|
-
hasAttribute(name: string):
|
|
64
|
+
getAttribute(name: string): string;
|
|
65
|
+
hasAttribute(name: string): boolean;
|
|
66
66
|
setAttribute(name: string, value?: string | null): any;
|
|
67
67
|
removeAttribute(name: string): any;
|
|
68
68
|
hideAtDesignTime: boolean;
|
|
@@ -3,7 +3,9 @@ import { IHtmlWriterService } from './IHtmlWriterService.js';
|
|
|
3
3
|
import { IHtmlWriterOptions } from './IHtmlWriterOptions.js';
|
|
4
4
|
import { ITextWriter } from '../../helper/ITextWriter.js';
|
|
5
5
|
export declare abstract class AbstractHtmlWriterService implements IHtmlWriterService {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
options: IHtmlWriterOptions;
|
|
7
|
+
constructor(options?: IHtmlWriterOptions);
|
|
8
|
+
abstract write(indentedTextWriter: ITextWriter, designItems: IDesignItem[], rootContainerKeepInline: boolean, updatePositions?: boolean): any;
|
|
9
|
+
writeAttributes(indentedTextWriter: ITextWriter, designItem: IDesignItem): void;
|
|
10
|
+
writeStyles(indentedTextWriter: ITextWriter, designItem: IDesignItem): void;
|
|
9
11
|
}
|
|
@@ -2,7 +2,16 @@ import { DomConverter } from '../../widgets/designerView/DomConverter.js';
|
|
|
2
2
|
import { CssCombiner } from '../../helper/CssCombiner.js';
|
|
3
3
|
import { PropertiesHelper } from '../propertiesService/services/PropertiesHelper.js';
|
|
4
4
|
export class AbstractHtmlWriterService {
|
|
5
|
-
|
|
5
|
+
options;
|
|
6
|
+
constructor(options) {
|
|
7
|
+
this.options = options ?? {};
|
|
8
|
+
this.options.beautifyOutput ??= true;
|
|
9
|
+
this.options.compressCssToShorthandProperties ??= true;
|
|
10
|
+
this.options.writeDesignerProperties ??= true;
|
|
11
|
+
this.options.parseJsonInAttributes ??= true;
|
|
12
|
+
this.options.jsonWriteMode ??= 'min';
|
|
13
|
+
}
|
|
14
|
+
writeAttributes(indentedTextWriter, designItem) {
|
|
6
15
|
if (designItem.hasAttributes) {
|
|
7
16
|
for (const a of designItem.attributes()) {
|
|
8
17
|
indentedTextWriter.write(' ');
|
|
@@ -10,13 +19,13 @@ export class AbstractHtmlWriterService {
|
|
|
10
19
|
if (a[1] === "")
|
|
11
20
|
indentedTextWriter.write(a[0]);
|
|
12
21
|
else {
|
|
13
|
-
if (options.parseJsonInAttributes &&
|
|
22
|
+
if (this.options.parseJsonInAttributes &&
|
|
14
23
|
((a[1].startsWith('{') && !a[1].startsWith('{{') && a[1].endsWith('}')) ||
|
|
15
24
|
(a[1].startsWith('[') && !a[1].startsWith('[[') && a[1].endsWith(']')))) {
|
|
16
25
|
try {
|
|
17
26
|
let j = JSON.parse(a[1]);
|
|
18
27
|
let txt;
|
|
19
|
-
if (options.jsonWriteMode == 'beauty')
|
|
28
|
+
if (this.options.jsonWriteMode == 'beauty')
|
|
20
29
|
txt = JSON.stringify(j, null, 2);
|
|
21
30
|
else
|
|
22
31
|
txt = JSON.stringify(j);
|
|
@@ -45,11 +54,11 @@ export class AbstractHtmlWriterService {
|
|
|
45
54
|
}
|
|
46
55
|
}
|
|
47
56
|
}
|
|
48
|
-
writeStyles(indentedTextWriter, designItem
|
|
57
|
+
writeStyles(indentedTextWriter, designItem) {
|
|
49
58
|
if (designItem.hasStyles) {
|
|
50
59
|
indentedTextWriter.write(' style="');
|
|
51
60
|
let styles = designItem.styles();
|
|
52
|
-
if (options.compressCssToShorthandProperties)
|
|
61
|
+
if (this.options.compressCssToShorthandProperties)
|
|
53
62
|
styles = CssCombiner.combine(new Map(styles));
|
|
54
63
|
for (const s of styles) {
|
|
55
64
|
if (s[0]) {
|
|
@@ -7,6 +7,8 @@ declare enum ElementContainerType {
|
|
|
7
7
|
complex = 1
|
|
8
8
|
}
|
|
9
9
|
export declare class FormatingHtmlWriterService implements IHtmlWriterService {
|
|
10
|
+
options: IHtmlWriterOptions;
|
|
11
|
+
constructor(options?: IHtmlWriterOptions);
|
|
10
12
|
private writeAttributes;
|
|
11
13
|
private writeStyles;
|
|
12
14
|
private _writeTextNode;
|
|
@@ -16,6 +18,6 @@ export declare class FormatingHtmlWriterService implements IHtmlWriterService {
|
|
|
16
18
|
private _writeNewlineAndIntend;
|
|
17
19
|
private _writeInternal;
|
|
18
20
|
getContainerType(element: HTMLElement): ElementContainerType;
|
|
19
|
-
write(indentedTextWriter: IndentedTextWriter, designItems: IDesignItem[], rootContainerKeepInline: boolean
|
|
21
|
+
write(indentedTextWriter: IndentedTextWriter, designItems: IDesignItem[], rootContainerKeepInline: boolean): void;
|
|
20
22
|
}
|
|
21
23
|
export {};
|
|
@@ -10,6 +10,15 @@ var ElementContainerType;
|
|
|
10
10
|
})(ElementContainerType || (ElementContainerType = {}));
|
|
11
11
|
// const defaultDisplayNoneContainerDisplayType: ElementContainerType = ElementContainerType.complex;
|
|
12
12
|
export class FormatingHtmlWriterService {
|
|
13
|
+
options;
|
|
14
|
+
constructor(options) {
|
|
15
|
+
this.options = options ?? {};
|
|
16
|
+
this.options.beautifyOutput ??= true;
|
|
17
|
+
this.options.compressCssToShorthandProperties ??= true;
|
|
18
|
+
this.options.writeDesignerProperties ??= true;
|
|
19
|
+
this.options.parseJsonInAttributes ??= true;
|
|
20
|
+
this.options.jsonWriteMode ??= 'min';
|
|
21
|
+
}
|
|
13
22
|
writeAttributes(writeContext, designItem) {
|
|
14
23
|
if (designItem.hasAttributes) {
|
|
15
24
|
for (const a of designItem.attributes()) {
|
|
@@ -126,8 +135,8 @@ export class FormatingHtmlWriterService {
|
|
|
126
135
|
return ElementContainerType.block;
|
|
127
136
|
return ElementContainerType.complex;
|
|
128
137
|
}
|
|
129
|
-
write(indentedTextWriter, designItems, rootContainerKeepInline
|
|
130
|
-
const context = { indentedTextWriter, options, lastElementDisplayType: null, containerDisplayType: ElementContainerType.block };
|
|
138
|
+
write(indentedTextWriter, designItems, rootContainerKeepInline) {
|
|
139
|
+
const context = { indentedTextWriter, options: this.options, lastElementDisplayType: null, containerDisplayType: ElementContainerType.block };
|
|
131
140
|
this._writeDesignItemList(ElementDisplayType.inline, context, designItems);
|
|
132
141
|
}
|
|
133
142
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { IDesignItem } from '../../item/IDesignItem.js';
|
|
2
|
-
import { IHtmlWriterOptions } from './IHtmlWriterOptions.js';
|
|
3
2
|
import { IndentedTextWriter } from '../../helper/IndentedTextWriter.js';
|
|
4
3
|
import { AbstractHtmlWriterService } from './AbstractHtmlWriterService.js';
|
|
4
|
+
import { IHtmlWriterOptions } from './IHtmlWriterOptions.js';
|
|
5
5
|
export declare class HtmlWriterService extends AbstractHtmlWriterService {
|
|
6
|
+
constructor(options?: IHtmlWriterOptions);
|
|
6
7
|
private _conditionalyWriteIndent;
|
|
7
8
|
private _conditionalyWriteIndentBefore;
|
|
8
9
|
private _conditionalyWriteNewline;
|
|
9
|
-
write(indentedTextWriter: IndentedTextWriter, designItems: IDesignItem[], rootContainerKeepInline: boolean,
|
|
10
|
+
write(indentedTextWriter: IndentedTextWriter, designItems: IDesignItem[], rootContainerKeepInline: boolean, updatePositions?: boolean): void;
|
|
10
11
|
private internalWrite;
|
|
11
12
|
private writeTextNode;
|
|
12
13
|
}
|
|
@@ -3,6 +3,9 @@ import { NodeType } from '../../item/NodeType.js';
|
|
|
3
3
|
import { isEmptyTextNode, isInline, isInlineAfter } from '../../helper/ElementHelper.js';
|
|
4
4
|
import { AbstractHtmlWriterService } from './AbstractHtmlWriterService.js';
|
|
5
5
|
export class HtmlWriterService extends AbstractHtmlWriterService {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
6
9
|
_conditionalyWriteIndent(indentedTextWriter, designItem) {
|
|
7
10
|
if ((designItem.element instanceof HTMLElement && !isInlineAfter(designItem.element)) ||
|
|
8
11
|
(designItem.element.previousElementSibling instanceof HTMLElement && !isInline(designItem.element.previousElementSibling)) ||
|
|
@@ -22,12 +25,12 @@ export class HtmlWriterService extends AbstractHtmlWriterService {
|
|
|
22
25
|
(designItem.element instanceof SVGElement))
|
|
23
26
|
indentedTextWriter.writeNewline();
|
|
24
27
|
}
|
|
25
|
-
write(indentedTextWriter, designItems, rootContainerKeepInline,
|
|
28
|
+
write(indentedTextWriter, designItems, rootContainerKeepInline, updatePositions = false) {
|
|
26
29
|
for (const d of designItems) {
|
|
27
|
-
this.internalWrite(indentedTextWriter, d,
|
|
30
|
+
this.internalWrite(indentedTextWriter, d, updatePositions);
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
|
-
internalWrite(indentedTextWriter, designItem,
|
|
33
|
+
internalWrite(indentedTextWriter, designItem, updatePositions) {
|
|
31
34
|
let start = indentedTextWriter.position;
|
|
32
35
|
let end = indentedTextWriter.position;
|
|
33
36
|
if (designItem.nodeType == NodeType.TextNode) {
|
|
@@ -50,8 +53,8 @@ export class HtmlWriterService extends AbstractHtmlWriterService {
|
|
|
50
53
|
this._conditionalyWriteIndentBefore(indentedTextWriter, designItem);
|
|
51
54
|
start = indentedTextWriter.position;
|
|
52
55
|
indentedTextWriter.write('<' + designItem.name);
|
|
53
|
-
this.writeAttributes(indentedTextWriter, designItem
|
|
54
|
-
this.writeStyles(indentedTextWriter, designItem
|
|
56
|
+
this.writeAttributes(indentedTextWriter, designItem);
|
|
57
|
+
this.writeStyles(indentedTextWriter, designItem);
|
|
55
58
|
indentedTextWriter.write('>');
|
|
56
59
|
let contentSingleTextNode = false;
|
|
57
60
|
if (designItem.hasChildren) {
|
|
@@ -66,7 +69,7 @@ export class HtmlWriterService extends AbstractHtmlWriterService {
|
|
|
66
69
|
indentedTextWriter.levelRaise();
|
|
67
70
|
}
|
|
68
71
|
for (const c of children) {
|
|
69
|
-
this.internalWrite(indentedTextWriter, c,
|
|
72
|
+
this.internalWrite(indentedTextWriter, c, updatePositions);
|
|
70
73
|
let childSingleTextNode = c.childCount === 1 && c.firstChild.nodeType === NodeType.TextNode;
|
|
71
74
|
if (childSingleTextNode)
|
|
72
75
|
if (!indentedTextWriter.isLastCharNewline())
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
beautifyOutput
|
|
3
|
-
compressCssToShorthandProperties
|
|
4
|
-
writeDesignerProperties
|
|
5
|
-
parseJsonInAttributes
|
|
6
|
-
jsonWriteMode
|
|
1
|
+
export interface IHtmlWriterOptions {
|
|
2
|
+
beautifyOutput?: boolean;
|
|
3
|
+
compressCssToShorthandProperties?: boolean;
|
|
4
|
+
writeDesignerProperties?: boolean;
|
|
5
|
+
parseJsonInAttributes?: boolean;
|
|
6
|
+
jsonWriteMode?: 'min' | 'beauty';
|
|
7
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IDesignItem } from '../../item/IDesignItem.js';
|
|
2
|
-
import { IHtmlWriterOptions } from './IHtmlWriterOptions.js';
|
|
3
2
|
import { ITextWriter } from '../../helper/ITextWriter.js';
|
|
3
|
+
import { IHtmlWriterOptions } from './IHtmlWriterOptions.js';
|
|
4
4
|
export interface IHtmlWriterService {
|
|
5
|
-
|
|
5
|
+
options: IHtmlWriterOptions;
|
|
6
|
+
write(textWriter: ITextWriter, designItems: IDesignItem[], rootContainerKeepInline: boolean, updatePositions?: boolean): any;
|
|
6
7
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { IDesignItem } from '../../item/IDesignItem.js';
|
|
2
2
|
import { IHtmlWriterService } from './IHtmlWriterService.js';
|
|
3
|
-
import { IHtmlWriterOptions } from './IHtmlWriterOptions.js';
|
|
4
3
|
import { IndentedTextWriter } from '../../helper/IndentedTextWriter.js';
|
|
4
|
+
import { IHtmlWriterOptions } from './IHtmlWriterOptions.js';
|
|
5
5
|
export declare class LitTsElementWriterService implements IHtmlWriterService {
|
|
6
|
-
|
|
6
|
+
options: IHtmlWriterOptions;
|
|
7
|
+
constructor(options?: IHtmlWriterOptions);
|
|
8
|
+
write(indentedTextWriter: IndentedTextWriter, designItems: IDesignItem[], rootContainerKeepInline: boolean): void;
|
|
7
9
|
static head: string;
|
|
8
10
|
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
//needs InternalBindinsgStorrageService -> keeps bindings
|
|
2
2
|
export class LitTsElementWriterService {
|
|
3
|
-
|
|
3
|
+
options;
|
|
4
|
+
constructor(options) {
|
|
5
|
+
this.options = options ?? {};
|
|
6
|
+
this.options.beautifyOutput ??= true;
|
|
7
|
+
this.options.compressCssToShorthandProperties ??= true;
|
|
8
|
+
this.options.writeDesignerProperties ??= true;
|
|
9
|
+
this.options.parseJsonInAttributes ??= true;
|
|
10
|
+
this.options.jsonWriteMode ??= 'min';
|
|
11
|
+
}
|
|
12
|
+
write(indentedTextWriter, designItems, rootContainerKeepInline) {
|
|
4
13
|
throw new Error('Method not implemented.');
|
|
5
14
|
}
|
|
6
15
|
static head = `import { html, css, LitElement, CSSResultArray } from 'lit';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IDesignItem } from '../../item/IDesignItem.js';
|
|
2
2
|
import { IHtmlWriterService } from './IHtmlWriterService.js';
|
|
3
|
-
import { IHtmlWriterOptions } from './IHtmlWriterOptions.js';
|
|
4
3
|
import { IndentedTextWriter } from '../../helper/IndentedTextWriter.js';
|
|
5
4
|
import { ElementDisplayType } from '../../helper/ElementHelper.js';
|
|
5
|
+
import { IHtmlWriterOptions } from './IHtmlWriterOptions.js';
|
|
6
6
|
export declare enum ElementContainerType {
|
|
7
7
|
block = 0,
|
|
8
8
|
complex = 1
|
|
@@ -14,6 +14,8 @@ export interface IWriteContext {
|
|
|
14
14
|
containerDisplayType: ElementContainerType;
|
|
15
15
|
}
|
|
16
16
|
export declare class SimpleHtmlWriterService implements IHtmlWriterService {
|
|
17
|
+
options: IHtmlWriterOptions;
|
|
18
|
+
constructor(options?: IHtmlWriterOptions);
|
|
17
19
|
protected writeAttributes(writeContext: IWriteContext, designItem: IDesignItem): void;
|
|
18
20
|
protected writeStyles(writeContext: IWriteContext, designItem: IDesignItem): void;
|
|
19
21
|
private _writeTextNode;
|
|
@@ -21,5 +23,5 @@ export declare class SimpleHtmlWriterService implements IHtmlWriterService {
|
|
|
21
23
|
private _writeElementNode;
|
|
22
24
|
private _writeDesignItemList;
|
|
23
25
|
private _writeInternal;
|
|
24
|
-
write(indentedTextWriter: IndentedTextWriter, designItems: IDesignItem[], rootContainerKeepInline: boolean
|
|
26
|
+
write(indentedTextWriter: IndentedTextWriter, designItems: IDesignItem[], rootContainerKeepInline: boolean): void;
|
|
25
27
|
}
|
|
@@ -9,6 +9,15 @@ export var ElementContainerType;
|
|
|
9
9
|
ElementContainerType[ElementContainerType["complex"] = 1] = "complex";
|
|
10
10
|
})(ElementContainerType || (ElementContainerType = {}));
|
|
11
11
|
export class SimpleHtmlWriterService {
|
|
12
|
+
options;
|
|
13
|
+
constructor(options) {
|
|
14
|
+
this.options = options ?? {};
|
|
15
|
+
this.options.beautifyOutput ??= true;
|
|
16
|
+
this.options.compressCssToShorthandProperties ??= true;
|
|
17
|
+
this.options.writeDesignerProperties ??= true;
|
|
18
|
+
this.options.parseJsonInAttributes ??= true;
|
|
19
|
+
this.options.jsonWriteMode ??= 'min';
|
|
20
|
+
}
|
|
12
21
|
writeAttributes(writeContext, designItem) {
|
|
13
22
|
if (designItem.hasAttributes) {
|
|
14
23
|
for (const a of designItem.attributes()) {
|
|
@@ -82,8 +91,8 @@ export class SimpleHtmlWriterService {
|
|
|
82
91
|
else if (designItem.nodeType === NodeType.Element)
|
|
83
92
|
this._writeElementNode(writeContext, designItem);
|
|
84
93
|
}
|
|
85
|
-
write(indentedTextWriter, designItems, rootContainerKeepInline
|
|
86
|
-
const context = { indentedTextWriter, options, lastElementDisplayType: null, containerDisplayType: ElementContainerType.block };
|
|
94
|
+
write(indentedTextWriter, designItems, rootContainerKeepInline) {
|
|
95
|
+
const context = { indentedTextWriter, options: this.options, lastElementDisplayType: null, containerDisplayType: ElementContainerType.block };
|
|
87
96
|
this._writeDesignItemList(ElementDisplayType.inline, context, designItems);
|
|
88
97
|
}
|
|
89
98
|
}
|
|
@@ -15,7 +15,7 @@ export declare abstract class AbstractPropertiesService implements IPropertiesSe
|
|
|
15
15
|
getPropertyTarget(designItem: IDesignItem, property: IProperty): BindingTarget;
|
|
16
16
|
clearValue(designItems: IDesignItem[], property: IProperty): void;
|
|
17
17
|
isSet(designItems: IDesignItem[], property: IProperty): ValueType;
|
|
18
|
-
getValue(designItems: IDesignItem[], property: IProperty):
|
|
18
|
+
getValue(designItems: IDesignItem[], property: IProperty): string | boolean;
|
|
19
19
|
getBinding(designItems: IDesignItem[], property: IProperty): IBinding;
|
|
20
20
|
getUnsetValue(designItems: IDesignItem[], property: IProperty): any;
|
|
21
21
|
}
|
|
@@ -14,7 +14,7 @@ export declare class AttributesPropertiesService implements IPropertiesService {
|
|
|
14
14
|
getPropertyTarget(designItem: IDesignItem, property: IProperty): BindingTarget;
|
|
15
15
|
clearValue(designItems: IDesignItem[], property: IProperty): void;
|
|
16
16
|
isSet(designItems: IDesignItem[], property: IProperty): ValueType;
|
|
17
|
-
getValue(designItems: IDesignItem[], property: IProperty):
|
|
17
|
+
getValue(designItems: IDesignItem[], property: IProperty): string;
|
|
18
18
|
getBinding(designItems: IDesignItem[], property: IProperty): IBinding;
|
|
19
19
|
getUnsetValue(designItems: IDesignItem[], property: IProperty): any;
|
|
20
20
|
}
|
|
@@ -22,7 +22,7 @@ export declare class CssCurrentPropertiesService extends CommonPropertiesService
|
|
|
22
22
|
getValue(designItems: IDesignItem[], property: IProperty & {
|
|
23
23
|
styleRule: IStyleRule;
|
|
24
24
|
styleDeclaration: IStyleDeclaration;
|
|
25
|
-
}):
|
|
25
|
+
}): string | boolean;
|
|
26
26
|
getUnsetValue(designItems: IDesignItem[], property: IProperty & {
|
|
27
27
|
styleRule: IStyleRule;
|
|
28
28
|
styleDeclaration: IStyleDeclaration;
|
|
@@ -35,8 +35,9 @@ export class DomConverter {
|
|
|
35
35
|
}
|
|
36
36
|
static ConvertToString(designItems, beautifyOutput, updatePositions = false) {
|
|
37
37
|
let itw = beautifyOutput !== false ? new IndentedTextWriter() : new SimpleTextWriter();
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
//todo: check how we could support this beautify here, cause it's now a setting of the writer...
|
|
39
|
+
//let options: HtmlWriterOptions = { beautifyOutput: beautifyOutput !== false, writeDesignerProperties: true, compressCssToShorthandProperties: true, parseJsonInAttributes: true, jsonWriteMode: 'beauty' };
|
|
40
|
+
designItems[0].serviceContainer.htmlWriterService.write(itw, designItems, true, updatePositions);
|
|
40
41
|
return itw.getString();
|
|
41
42
|
}
|
|
42
43
|
}
|