@omnia/velcron 8.0.100-vnext → 8.0.101-vnext

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/velcron",
3
3
  "license": "MIT",
4
- "version": "8.0.100-vnext",
4
+ "version": "8.0.101-vnext",
5
5
  "description": "Provide Omnia Velcron Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -2,13 +2,37 @@ import { VelcronPropertyEditor } from "@omnia/fx-models";
2
2
  import { VelcronEditorBuilderBase } from "./VelcronEditorBuilderBase";
3
3
  export declare class VelcronContentEditorBuilder extends VelcronEditorBuilderBase {
4
4
  private mainEditor;
5
+ private mainPropertyEditor;
6
+ private mainTypographyEditor;
5
7
  private captionEditor;
8
+ private captionTypographyEditor;
9
+ private captionPropertyEditor;
10
+ private titleEditor;
11
+ private titlePropertyEditor;
12
+ private titleTypographyEditor;
13
+ private summaryEditor;
14
+ private summaryPropertyEditor;
15
+ private summaryTypographyEditor;
6
16
  constructor(builder: any);
7
17
  main: {
8
- add: () => VelcronContentEditorBuilder;
18
+ addContentEditor: () => VelcronContentEditorBuilder;
19
+ addPropertyMappingEditor: (title?: string) => VelcronContentEditorBuilder;
20
+ addTypographyEditor: (title?: string, type?: "text" | "title") => VelcronContentEditorBuilder;
9
21
  };
10
22
  caption: {
11
- add: () => VelcronContentEditorBuilder;
23
+ addContentEditor: () => VelcronContentEditorBuilder;
24
+ addPropertyMappingEditor: (title?: string) => VelcronContentEditorBuilder;
25
+ addTypographyEditor: (title?: string, type?: "text" | "title") => VelcronContentEditorBuilder;
26
+ };
27
+ title: {
28
+ addContentEditor: () => VelcronContentEditorBuilder;
29
+ addPropertyMappingEditor: (title?: string) => VelcronContentEditorBuilder;
30
+ addTypographyEditor: (title?: string, type?: "text" | "title") => VelcronContentEditorBuilder;
31
+ };
32
+ summary: {
33
+ addContentEditor: () => VelcronContentEditorBuilder;
34
+ addPropertyMappingEditor: (title?: string) => VelcronContentEditorBuilder;
35
+ addTypographyEditor: (title?: string, type?: "text" | "title") => VelcronContentEditorBuilder;
12
36
  };
13
37
  protected internalBuild(): VelcronPropertyEditor<any>[];
14
38
  }
@@ -6,26 +6,156 @@ class VelcronContentEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEdit
6
6
  constructor(builder) {
7
7
  super(builder);
8
8
  this.mainEditor = null;
9
+ this.mainPropertyEditor = null;
10
+ this.mainTypographyEditor = null;
9
11
  this.captionEditor = null;
12
+ this.captionTypographyEditor = null;
13
+ this.captionPropertyEditor = null;
14
+ this.titleEditor = null;
15
+ this.titlePropertyEditor = null;
16
+ this.titleTypographyEditor = null;
17
+ this.summaryEditor = null;
18
+ this.summaryPropertyEditor = null;
19
+ this.summaryTypographyEditor = null;
10
20
  this.main = {
11
- add: () => {
21
+ addContentEditor: () => {
12
22
  if (!this.mainEditor) {
13
23
  this.mainEditor = {
14
24
  name: "Body",
15
25
  type: "markdown",
16
- stateMapping: "content.main"
26
+ stateMapping: "content.main.text"
27
+ };
28
+ }
29
+ return this;
30
+ },
31
+ addPropertyMappingEditor: (title) => {
32
+ if (!this.mainPropertyEditor) {
33
+ this.mainPropertyEditor = {
34
+ name: title ? title : "Main",
35
+ type: "text",
36
+ stateMapping: "content.main.text",
37
+ propertyMapping: true
38
+ };
39
+ }
40
+ return this;
41
+ },
42
+ addTypographyEditor: (title, type) => {
43
+ if (!this.mainTypographyEditor) {
44
+ this.mainTypographyEditor = {
45
+ name: title ? title : "Main formatting",
46
+ type: "typography",
47
+ stateMapping: "content.main.text",
48
+ settings: {
49
+ type: type ? type : "text"
50
+ }
17
51
  };
18
52
  }
19
53
  return this;
20
54
  }
21
55
  };
22
56
  this.caption = {
23
- add: () => {
57
+ addContentEditor: () => {
24
58
  if (!this.captionEditor) {
25
59
  this.captionEditor = {
26
60
  name: "Caption",
27
61
  type: "text",
28
- stateMapping: "content.caption"
62
+ stateMapping: "content.caption.text"
63
+ };
64
+ }
65
+ return this;
66
+ },
67
+ addPropertyMappingEditor: (title) => {
68
+ if (!this.captionPropertyEditor) {
69
+ this.captionPropertyEditor = {
70
+ name: title ? title : "Caption",
71
+ type: "text",
72
+ stateMapping: "content.caption.text",
73
+ propertyMapping: true
74
+ };
75
+ }
76
+ return this;
77
+ },
78
+ addTypographyEditor: (title, type) => {
79
+ if (!this.captionTypographyEditor) {
80
+ this.captionTypographyEditor = {
81
+ name: title ? title : "Caption formatting",
82
+ type: "typography",
83
+ stateMapping: "content.caption.text",
84
+ settings: {
85
+ type: type ? type : "text"
86
+ }
87
+ };
88
+ }
89
+ return this;
90
+ }
91
+ };
92
+ this.title = {
93
+ addContentEditor: () => {
94
+ if (!this.titleEditor) {
95
+ this.titleEditor = {
96
+ name: "Title",
97
+ type: "text",
98
+ stateMapping: "content.title.text"
99
+ };
100
+ }
101
+ return this;
102
+ },
103
+ addPropertyMappingEditor: (title) => {
104
+ if (!this.titlePropertyEditor) {
105
+ this.titlePropertyEditor = {
106
+ name: title ? title : "Title",
107
+ type: "text",
108
+ stateMapping: "content.title.text",
109
+ propertyMapping: true
110
+ };
111
+ }
112
+ return this;
113
+ },
114
+ addTypographyEditor: (title, type) => {
115
+ if (!this.titleTypographyEditor) {
116
+ this.titleTypographyEditor = {
117
+ name: title ? title : "Title formatting",
118
+ type: "typography",
119
+ stateMapping: "content.title.text",
120
+ settings: {
121
+ type: type ? type : "title"
122
+ }
123
+ };
124
+ }
125
+ return this;
126
+ }
127
+ };
128
+ this.summary = {
129
+ addContentEditor: () => {
130
+ if (!this.summaryEditor) {
131
+ this.summaryEditor = {
132
+ name: "Summary",
133
+ type: "text",
134
+ stateMapping: "content.summary.text"
135
+ };
136
+ }
137
+ return this;
138
+ },
139
+ addPropertyMappingEditor: (title) => {
140
+ if (!this.summaryPropertyEditor) {
141
+ this.summaryPropertyEditor = {
142
+ name: title ? title : "Summary",
143
+ type: "text",
144
+ stateMapping: "content.summary.text",
145
+ propertyMapping: true
146
+ };
147
+ }
148
+ return this;
149
+ },
150
+ addTypographyEditor: (title, type) => {
151
+ if (!this.summaryTypographyEditor) {
152
+ this.summaryTypographyEditor = {
153
+ name: title ? title : "Summary formatting",
154
+ type: "typography",
155
+ stateMapping: "content.summary.text",
156
+ settings: {
157
+ type: type ? type : "text"
158
+ }
29
159
  };
30
160
  }
31
161
  return this;
@@ -37,9 +167,39 @@ class VelcronContentEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEdit
37
167
  if (this.mainEditor) {
38
168
  result.push(this.mainEditor);
39
169
  }
170
+ if (this.mainPropertyEditor) {
171
+ result.push(this.mainPropertyEditor);
172
+ }
173
+ if (this.mainTypographyEditor) {
174
+ result.push(this.mainTypographyEditor);
175
+ }
176
+ if (this.titleEditor) {
177
+ result.push(this.titleEditor);
178
+ }
179
+ if (this.titlePropertyEditor) {
180
+ result.push(this.titlePropertyEditor);
181
+ }
182
+ if (this.titleTypographyEditor) {
183
+ result.push(this.titleTypographyEditor);
184
+ }
185
+ if (this.summaryEditor) {
186
+ result.push(this.summaryEditor);
187
+ }
188
+ if (this.summaryPropertyEditor) {
189
+ result.push(this.summaryPropertyEditor);
190
+ }
191
+ if (this.summaryTypographyEditor) {
192
+ result.push(this.summaryTypographyEditor);
193
+ }
40
194
  if (this.captionEditor) {
41
195
  result.push(this.captionEditor);
42
196
  }
197
+ if (this.captionTypographyEditor) {
198
+ result.push(this.captionTypographyEditor);
199
+ }
200
+ if (this.captionPropertyEditor) {
201
+ result.push(this.captionPropertyEditor);
202
+ }
43
203
  return result;
44
204
  }
45
205
  }
@@ -12,7 +12,7 @@ class VelcronPropertyMappingEditorBuilder extends VelcronEditorBuilderBase_1.Vel
12
12
  this.editor = {
13
13
  name: "Properties",
14
14
  type: "enterprise-property",
15
- stateMapping: "propertyItems",
15
+ stateMapping: "properties.mappings",
16
16
  propertyMapping: true,
17
17
  multiple: true,
18
18
  };
@@ -39,16 +39,6 @@ class VelcronContentStateBuilder extends VelcronStateBuilderBase_1.VelcronStateB
39
39
  if (!hasContent) {
40
40
  return null;
41
41
  }
42
- // resultValue["main"] = this.mainContent;
43
- // hasContent = true;
44
- // }
45
- // if(this.captionContent){
46
- // resultValue["caption"] = this.captionContent;
47
- // hasContent = true;
48
- // }
49
- // if(!hasContent){
50
- // return null;
51
- // }
52
42
  return {
53
43
  content: resultValue
54
44
  };
@@ -11,15 +11,15 @@ class VelcronPropertyMappingStateBuilder extends VelcronStateBuilderBase_1.Velcr
11
11
  this.propertyItemsValue = items;
12
12
  return this;
13
13
  },
14
- bind: "$propertyItems",
15
- foreach: "propertyItems"
14
+ bind: "$properties.mappings",
15
+ foreach: "properties.mappings"
16
16
  };
17
17
  }
18
18
  internalBuild() {
19
19
  const resultValue = {};
20
20
  let hasContent = false;
21
21
  if (this.propertyItemsValue) {
22
- resultValue["mappings"] = this.propertyItemsValue;
22
+ resultValue.mappings = this.propertyItemsValue;
23
23
  hasContent = true;
24
24
  }
25
25
  if (!hasContent) {
@@ -27,7 +27,7 @@ class VelcronPropertyMappingStateBuilder extends VelcronStateBuilderBase_1.Velcr
27
27
  }
28
28
  return {
29
29
  properties: {
30
- mappings: resultValue
30
+ ...resultValue
31
31
  }
32
32
  };
33
33
  }
@@ -2,28 +2,29 @@ import { TypographySize, TypographyType, VelcronTextState, VelcronTypographyStat
2
2
  import { VelcronStateBuilderStrategy } from "./VelcronStateBuilderBase";
3
3
  export declare class VelcronTextContentBuilder<TBaseBuilder> extends VelcronStateBuilderStrategy {
4
4
  private _textState;
5
- private baseBind;
5
+ private bindingContextValue;
6
6
  private _typographyState;
7
7
  private baseBuilder;
8
8
  constructor(baseBuilder: TBaseBuilder, bind: string);
9
9
  get typographyState(): VelcronTypographyState;
10
10
  get textState(): VelcronTextState;
11
+ get bindingContext(): string;
11
12
  text: {
12
13
  add: (value: string) => VelcronTextContentBuilder<TBaseBuilder>;
13
- bind: string;
14
+ bind: () => string;
14
15
  };
15
16
  typography: {
16
17
  type: {
17
18
  add: (type: TypographyType) => VelcronTextContentBuilder<TBaseBuilder>;
18
- bind: string;
19
+ bind: () => string;
19
20
  };
20
21
  size: {
21
22
  add: (size: TypographySize) => VelcronTextContentBuilder<TBaseBuilder>;
22
- bind: string;
23
+ bind: () => string;
23
24
  };
24
25
  toned: {
25
26
  add: (toned: boolean) => VelcronTextContentBuilder<TBaseBuilder>;
26
- bind: string;
27
+ bind: () => string;
27
28
  };
28
29
  };
29
30
  done(): TBaseBuilder;
@@ -14,7 +14,7 @@ class VelcronTextContentBuilder extends VelcronStateBuilderBase_1.VelcronStateBu
14
14
  constructor(baseBuilder, bind) {
15
15
  super();
16
16
  this._textState = undefined;
17
- this.baseBind = undefined;
17
+ this.bindingContextValue = undefined;
18
18
  this._typographyState = undefined;
19
19
  // :VelcronTextContentBuilder<TBaseBuilder>
20
20
  this.text = {
@@ -22,7 +22,7 @@ class VelcronTextContentBuilder extends VelcronStateBuilderBase_1.VelcronStateBu
22
22
  this.textState.text = value;
23
23
  return this;
24
24
  },
25
- bind: `{{ ${this.baseBind}.text }}`
25
+ bind: () => { return `{{ ${this.bindingContextValue}.text }}`; }
26
26
  };
27
27
  this.typography = {
28
28
  type: {
@@ -30,25 +30,25 @@ class VelcronTextContentBuilder extends VelcronStateBuilderBase_1.VelcronStateBu
30
30
  this.typographyState.type = type;
31
31
  return this;
32
32
  },
33
- bind: `{{ ${this.baseBind}.typography.type }}`
33
+ bind: () => { return `{{ ${this.bindingContextValue}.typography.type }}`; }
34
34
  },
35
35
  size: {
36
36
  add: (size) => {
37
37
  this.typographyState.size = size;
38
38
  return this;
39
39
  },
40
- bind: `{{ ${this.baseBind}.typography.size }}`
40
+ bind: () => { return `{{ ${this.bindingContextValue}.typography.size }}`; }
41
41
  },
42
42
  toned: {
43
43
  add: (toned) => {
44
44
  this.typographyState.toned = toned;
45
45
  return this;
46
46
  },
47
- bind: `{{ ${this.baseBind}.typography.toned }}`
47
+ bind: () => { return `{{ ${this.bindingContextValue}.typography.toned }}`; }
48
48
  }
49
49
  };
50
50
  this.baseBuilder = baseBuilder;
51
- this.baseBind = bind;
51
+ this.bindingContextValue = bind;
52
52
  }
53
53
  get typographyState() {
54
54
  if (!this._typographyState) {
@@ -62,6 +62,9 @@ class VelcronTextContentBuilder extends VelcronStateBuilderBase_1.VelcronStateBu
62
62
  }
63
63
  return this._textState;
64
64
  }
65
+ get bindingContext() {
66
+ return this.bindingContextValue;
67
+ }
65
68
  // typography(type?: TypographyType,size?:TypographySize,toned?:boolean):VelcronTextContentBuilder<TBaseBuilder>{
66
69
  // this.textState.typography = {
67
70
  // type:type,