@omnia/velcron 8.0.92-vnext → 8.0.93-dev

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.
Files changed (155) hide show
  1. package/actions/Alert.js +1 -1
  2. package/actions/Array.js +9 -2
  3. package/actions/Clone.d.ts +2 -0
  4. package/actions/Clone.js +11 -0
  5. package/actions/Date.d.ts +3 -0
  6. package/actions/Date.js +29 -0
  7. package/actions/Http.js +23 -6
  8. package/actions/IActionHandler.d.ts +1 -0
  9. package/actions/Timer.d.ts +4 -0
  10. package/actions/Timer.js +80 -0
  11. package/actions/index.d.ts +3 -0
  12. package/actions/index.js +3 -0
  13. package/internal-do-not-import-from-here/shared/models/Broadcasting.js +1 -1
  14. package/internal-do-not-import-from-here/shared/models/DynamicState.d.ts +1 -0
  15. package/internal-do-not-import-from-here/shared/models/Equals.js +33 -3
  16. package/internal-do-not-import-from-here/shared/models/Future.d.ts +17 -1
  17. package/internal-do-not-import-from-here/shared/models/Future.js +26 -5
  18. package/internal-do-not-import-from-here/shared/models/Guid.d.ts +1 -0
  19. package/internal-do-not-import-from-here/shared/models/Guid.js +13 -6
  20. package/internal-do-not-import-from-here/shared/models/HttpCommon.d.ts +27 -0
  21. package/internal-do-not-import-from-here/shared/models/OmniaSharedBootstrapData.d.ts +7 -1
  22. package/internal-do-not-import-from-here/shared/models/Realtime.d.ts +1 -13
  23. package/internal-do-not-import-from-here/shared/models/Realtime.js +1 -22
  24. package/internal-do-not-import-from-here/shared/models/StronglyTypedId.d.ts +3 -0
  25. package/internal-do-not-import-from-here/shared/models/StronglyTypedId.js +2 -0
  26. package/internal-do-not-import-from-here/shared/models/Tokens.d.ts +1 -0
  27. package/internal-do-not-import-from-here/shared/models/WorkerProxyFuncs.d.ts +7 -1
  28. package/internal-do-not-import-from-here/shared/models/WorkerProxyFuncs.js +5 -1
  29. package/internal-do-not-import-from-here/shared/models/Workers.js +1 -1
  30. package/internal-do-not-import-from-here/shared/models/hub/ExternalIdentityId.d.ts +2 -0
  31. package/internal-do-not-import-from-here/shared/models/hub/ExternalIdentityId.js +2 -0
  32. package/internal-do-not-import-from-here/shared/models/hub/TempSocialReactions.d.ts +13 -0
  33. package/internal-do-not-import-from-here/shared/models/hub/TempSocialReactions.js +20 -0
  34. package/internal-do-not-import-from-here/shared/models/hub/activities/Activity.d.ts +67 -0
  35. package/internal-do-not-import-from-here/shared/models/hub/activities/Activity.js +7 -0
  36. package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityChannel.d.ts +7 -0
  37. package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityChannel.js +5 -0
  38. package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityDefinition.d.ts +14 -0
  39. package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityDefinition.js +15 -0
  40. package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityFeed.d.ts +30 -0
  41. package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityFeed.js +2 -0
  42. package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityRenderer.d.ts +15 -0
  43. package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityRenderer.js +5 -0
  44. package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityRendererLoadingReferences.d.ts +8 -0
  45. package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityRendererLoadingReferences.js +2 -0
  46. package/internal-do-not-import-from-here/shared/models/hub/activities/ActivitySender.d.ts +15 -0
  47. package/internal-do-not-import-from-here/shared/models/hub/activities/ActivitySender.js +5 -0
  48. package/internal-do-not-import-from-here/shared/models/hub/activities/IdentityActivity.d.ts +40 -0
  49. package/internal-do-not-import-from-here/shared/models/hub/activities/IdentityActivity.js +39 -0
  50. package/internal-do-not-import-from-here/shared/models/hub/activities/index.d.ts +8 -0
  51. package/internal-do-not-import-from-here/shared/models/hub/activities/index.js +11 -0
  52. package/internal-do-not-import-from-here/shared/models/hub/fileupload/FileOwnerId.d.ts +3 -0
  53. package/internal-do-not-import-from-here/shared/models/hub/fileupload/FileOwnerId.js +5 -0
  54. package/internal-do-not-import-from-here/shared/models/hub/fileupload/TemporaryFileId.d.ts +4 -0
  55. package/internal-do-not-import-from-here/shared/models/hub/fileupload/TemporaryFileId.js +5 -0
  56. package/internal-do-not-import-from-here/shared/models/hub/fileupload/index.d.ts +2 -0
  57. package/internal-do-not-import-from-here/shared/models/hub/fileupload/index.js +5 -0
  58. package/internal-do-not-import-from-here/shared/models/hub/index.d.ts +5 -0
  59. package/internal-do-not-import-from-here/shared/models/hub/index.js +8 -0
  60. package/internal-do-not-import-from-here/shared/models/hub/social/HubComment.d.ts +10 -0
  61. package/internal-do-not-import-from-here/shared/models/hub/social/HubComment.js +2 -0
  62. package/internal-do-not-import-from-here/shared/models/hub/social/HubReaction.d.ts +5 -0
  63. package/internal-do-not-import-from-here/shared/models/hub/social/HubReaction.js +2 -0
  64. package/internal-do-not-import-from-here/shared/models/hub/social/index.d.ts +2 -0
  65. package/internal-do-not-import-from-here/shared/models/hub/social/index.js +5 -0
  66. package/internal-do-not-import-from-here/shared/models/index.d.ts +5 -1
  67. package/internal-do-not-import-from-here/shared/models/index.js +5 -1
  68. package/internal-do-not-import-from-here/shared/models/theming/BlueprintDefinition.d.ts +44 -46
  69. package/internal-do-not-import-from-here/shared/models/theming/BlueprintDefinition.js +7 -13
  70. package/internal-do-not-import-from-here/shared/models/theming/ChromeDefinition.d.ts +25 -0
  71. package/internal-do-not-import-from-here/shared/models/theming/ChromeDefinition.js +2 -0
  72. package/internal-do-not-import-from-here/shared/models/theming/SharedBlueprintMethods.d.ts +2 -2
  73. package/internal-do-not-import-from-here/shared/models/theming/SharedBlueprintMethods.js +8 -7
  74. package/internal-do-not-import-from-here/shared/models/theming/SpacingSetting.d.ts +5 -4
  75. package/internal-do-not-import-from-here/shared/models/theming/SpacingSetting.js +1 -1
  76. package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.d.ts +22 -13
  77. package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.js +8 -10
  78. package/internal-do-not-import-from-here/shared/models/theming/TypographyDefinition.d.ts +5 -0
  79. package/internal-do-not-import-from-here/shared/models/theming/TypographyDefinition.js +2 -2
  80. package/internal-do-not-import-from-here/shared/models/theming/UseThemeMethods.d.ts +3 -5
  81. package/internal-do-not-import-from-here/shared/models/theming/UseThemeMethods.js +4 -30
  82. package/internal-do-not-import-from-here/shared/models/theming/index.d.ts +1 -1
  83. package/internal-do-not-import-from-here/shared/models/theming/index.js +2 -1
  84. package/internal-do-not-import-from-here/shared/models/velcron/VelcronDefinition.d.ts +87 -0
  85. package/internal-do-not-import-from-here/shared/models/velcron/VelcronDefinition.js +2 -0
  86. package/internal-do-not-import-from-here/shared/models/velcron/VelcronEvents.js +2 -0
  87. package/internal-do-not-import-from-here/shared/models/velcron/index.d.ts +2 -0
  88. package/internal-do-not-import-from-here/shared/models/velcron/index.js +5 -0
  89. package/models/ActionHooks.d.ts +12 -0
  90. package/models/ActionHooks.js +2 -0
  91. package/models/Enums.js +7 -7
  92. package/models/VelcronDefinitions.d.ts +79 -88
  93. package/models/VelcronDefinitions.js +1 -1
  94. package/models/VelcronPropertyEditorDefinitions.d.ts +268 -19
  95. package/models/VelcronPropertyEditorDefinitions.js +114 -2
  96. package/models/VelcronTypes.d.ts +1 -1
  97. package/models/ViewModelAndContext.d.ts +1 -1
  98. package/models/index.d.ts +1 -1
  99. package/models/index.js +1 -1
  100. package/package.json +1 -1
  101. package/parser/VelcronActions.d.ts +8 -2
  102. package/parser/VelcronActions.js +23 -3
  103. package/parser/VelcronConstants.d.ts +13 -4
  104. package/parser/VelcronConstants.js +14 -5
  105. package/parser/VelcronData.d.ts +3 -2
  106. package/parser/VelcronData.js +21 -13
  107. package/parser/VelcronPropertyEditors.js +1 -1
  108. package/parser/VelcronRenderers.d.ts +2 -1
  109. package/parser/VelcronRenderers.js +22 -21
  110. package/parser/VelcronStyles.d.ts +2 -1
  111. package/parser/VelcronStyles.js +168 -65
  112. package/stores/ReactivitySystem.d.ts +2 -2
  113. package/stores/ReactivitySystem.js +1 -1
  114. package/stores/VelcronColorSchema.d.ts +9 -8
  115. package/stores/VelcronTheming.d.ts +4 -3
  116. package/stores/VelcronTheming.js +15 -3
  117. package/stores/index.d.ts +0 -1
  118. package/stores/index.js +1 -1
  119. package/templatebuilder/editor/VelcronContentEditor.d.ts +26 -2
  120. package/templatebuilder/editor/VelcronContentEditor.js +164 -4
  121. package/templatebuilder/editor/VelcronEditorBuilder.d.ts +3 -0
  122. package/templatebuilder/editor/VelcronEditorBuilder.js +10 -0
  123. package/templatebuilder/editor/VelcronEditorBuilder2.d.ts +15 -0
  124. package/templatebuilder/editor/VelcronEditorBuilder2.js +106 -0
  125. package/templatebuilder/editor/VelcronEditorBuilderBase.d.ts +1 -1
  126. package/templatebuilder/editor/VelcronPropertyMappingEditorBuilder.d.ts +9 -0
  127. package/templatebuilder/editor/VelcronPropertyMappingEditorBuilder.js +30 -0
  128. package/templatebuilder/index.d.ts +1 -0
  129. package/templatebuilder/index.js +1 -0
  130. package/templatebuilder/state/VelcronBlockHeaderStateBuilder.d.ts +0 -0
  131. package/templatebuilder/state/VelcronBlockHeaderStateBuilder.js +38 -0
  132. package/templatebuilder/state/VelcronColorSchemaBuilder.d.ts +10 -5
  133. package/templatebuilder/state/VelcronColorSchemaBuilder.js +18 -6
  134. package/templatebuilder/state/VelcronContentStateBuilder.d.ts +7 -13
  135. package/templatebuilder/state/VelcronContentStateBuilder.js +26 -18
  136. package/templatebuilder/state/VelcronImageStateBuilder.d.ts +2 -4
  137. package/templatebuilder/state/VelcronImageStateBuilder.js +10 -4
  138. package/templatebuilder/state/VelcronPropertyMappingStateBuilder.d.ts +12 -0
  139. package/templatebuilder/state/VelcronPropertyMappingStateBuilder.js +35 -0
  140. package/templatebuilder/state/VelcronStateBuilder.d.ts +5 -1
  141. package/templatebuilder/state/VelcronStateBuilder.js +8 -0
  142. package/templatebuilder/state/VelcronStateBuilderBase.d.ts +7 -3
  143. package/templatebuilder/state/VelcronStateBuilderBase.js +8 -4
  144. package/templatebuilder/state/VelcronTextContentBuilder.d.ts +32 -0
  145. package/templatebuilder/state/VelcronTextContentBuilder.js +110 -0
  146. package/templatebuilder/useVelcronEditorBuilder.d.ts +2 -0
  147. package/templatebuilder/useVelcronEditorBuilder.js +9 -0
  148. package/internal-do-not-import-from-here/shared/models/Bring.d.ts +0 -23
  149. package/internal-do-not-import-from-here/shared/models/theming/OmniaThemes.d.ts +0 -5
  150. package/internal-do-not-import-from-here/shared/models/theming/OmniaThemes.js +0 -18
  151. package/stores/VelcronBlueprint.d.ts +0 -39
  152. package/stores/VelcronBlueprint.js +0 -55
  153. /package/internal-do-not-import-from-here/shared/models/{Bring.js → DynamicState.js} +0 -0
  154. /package/{models/VelcronEvents.js → internal-do-not-import-from-here/shared/models/HttpCommon.js} +0 -0
  155. /package/{models → internal-do-not-import-from-here/shared/models/velcron}/VelcronEvents.d.ts +0 -0
@@ -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
  }
@@ -2,12 +2,15 @@ import { VelcronPropertyEditor } from "@omnia/fx-models";
2
2
  import { VelcronContentEditorBuilder } from "./VelcronContentEditor";
3
3
  import { VelcronColorSchemaEditorBuilder } from "./VelcronColorSchemaEditor";
4
4
  import { VelcronImageEditorBuilder } from "./VelcronImageEditor";
5
+ import { VelcronPropertyMappingEditorBuilder } from "./VelcronPropertyMappingEditorBuilder";
5
6
  export declare class VelcronEditorBuilder {
6
7
  private contentEditorBuilder;
7
8
  private colorSchemaEditorBuilder;
8
9
  private imageEditorBuilder;
10
+ private propertyMappingBuilder;
9
11
  content(): VelcronContentEditorBuilder;
10
12
  colorSchemaType(): VelcronColorSchemaEditorBuilder;
11
13
  image(): VelcronImageEditorBuilder;
14
+ properties(): VelcronPropertyMappingEditorBuilder;
12
15
  build(): VelcronPropertyEditor<any>[];
13
16
  }
@@ -4,6 +4,7 @@ exports.VelcronEditorBuilder = void 0;
4
4
  const VelcronContentEditor_1 = require("./VelcronContentEditor");
5
5
  const VelcronColorSchemaEditor_1 = require("./VelcronColorSchemaEditor");
6
6
  const VelcronImageEditor_1 = require("./VelcronImageEditor");
7
+ const VelcronPropertyMappingEditorBuilder_1 = require("./VelcronPropertyMappingEditorBuilder");
7
8
  class VelcronEditorBuilder {
8
9
  content() {
9
10
  if (!this.contentEditorBuilder) {
@@ -23,6 +24,12 @@ class VelcronEditorBuilder {
23
24
  }
24
25
  return this.imageEditorBuilder;
25
26
  }
27
+ properties() {
28
+ if (!this.propertyMappingBuilder) {
29
+ this.propertyMappingBuilder = new VelcronPropertyMappingEditorBuilder_1.VelcronPropertyMappingEditorBuilder(this);
30
+ }
31
+ return this.propertyMappingBuilder;
32
+ }
26
33
  build() {
27
34
  const result = [];
28
35
  if (this.colorSchemaEditorBuilder) {
@@ -34,6 +41,9 @@ class VelcronEditorBuilder {
34
41
  if (this.imageEditorBuilder) {
35
42
  result.push(...this.imageEditorBuilder.internalBuild());
36
43
  }
44
+ if (this.propertyMappingBuilder) {
45
+ result.push(...this.propertyMappingBuilder.internalBuild());
46
+ }
37
47
  return result;
38
48
  }
39
49
  }
@@ -0,0 +1,15 @@
1
+ import { TypographyType, VelcronPropertyEditor, VelcronTypographyEditorSettings } from "@omnia/fx-models";
2
+ export declare class VelcronEditorBuilder2 {
3
+ private editors;
4
+ private formatStateMapping;
5
+ add(): {
6
+ spacingEditor: (name: string, stateMapping: string, individualSelection?: boolean) => VelcronEditorBuilder2;
7
+ imageEditor: (name: string, stateMapping: string) => VelcronEditorBuilder2;
8
+ colorSchemaEditor: (name: string, stateMapping: string) => VelcronEditorBuilder2;
9
+ markdownEditor: (name: string, stateMapping: string, placeholder?: string) => VelcronEditorBuilder2;
10
+ textEditor: (name: string, stateMapping: string, typographyType: TypographyType, placeholder?: string) => VelcronEditorBuilder2;
11
+ blockHeaderEditor: () => VelcronEditorBuilder2;
12
+ typographyEditor: (stateMapping: string, settings: VelcronTypographyEditorSettings) => VelcronEditorBuilder2;
13
+ };
14
+ build(): VelcronPropertyEditor<any>[];
15
+ }
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VelcronEditorBuilder2 = void 0;
4
+ const fx_models_1 = require("@omnia/fx-models");
5
+ class VelcronEditorBuilder2 {
6
+ constructor() {
7
+ this.editors = [];
8
+ }
9
+ formatStateMapping(stateMapping) {
10
+ return stateMapping.replace("{{", "").replace("}}", "");
11
+ }
12
+ add() {
13
+ return {
14
+ spacingEditor: (name, stateMapping, individualSelection) => {
15
+ this.editors.push({
16
+ name: name,
17
+ type: "spacing",
18
+ stateMapping: this.formatStateMapping(stateMapping),
19
+ settings: {
20
+ individualSelection: individualSelection
21
+ }
22
+ });
23
+ return this;
24
+ },
25
+ imageEditor: (name, stateMapping) => {
26
+ this.editors.push({
27
+ name: name,
28
+ type: "image",
29
+ stateMapping: this.formatStateMapping(stateMapping),
30
+ });
31
+ return this;
32
+ },
33
+ colorSchemaEditor: (name, stateMapping) => {
34
+ this.editors.push({
35
+ name: name,
36
+ type: "color-schema-type",
37
+ stateMapping: this.formatStateMapping(stateMapping),
38
+ });
39
+ return this;
40
+ },
41
+ markdownEditor: (name, stateMapping, placeholder) => {
42
+ this.editors.push({
43
+ name: name,
44
+ type: "markdown",
45
+ stateMapping: this.formatStateMapping(stateMapping),
46
+ settings: {
47
+ placeholder: placeholder
48
+ }
49
+ });
50
+ return this;
51
+ },
52
+ textEditor: (name, stateMapping, typographyType, placeholder) => {
53
+ this.editors.push({
54
+ name: name,
55
+ type: "text",
56
+ stateMapping: this.formatStateMapping(stateMapping),
57
+ settings: {
58
+ type: typographyType,
59
+ placeholder: placeholder
60
+ }
61
+ });
62
+ return this;
63
+ },
64
+ blockHeaderEditor: () => {
65
+ this.editors.push({
66
+ name: "Typography",
67
+ type: "typography",
68
+ stateMapping: fx_models_1.VelcronHeaderStateBinding.title.typography.editor,
69
+ settings: {
70
+ type: "title"
71
+ }
72
+ });
73
+ return this;
74
+ },
75
+ typographyEditor: (stateMapping, settings) => {
76
+ this.editors.push({
77
+ name: "Typography",
78
+ type: "typography",
79
+ stateMapping: stateMapping,
80
+ settings: settings ? settings : {
81
+ type: "text"
82
+ }
83
+ });
84
+ return this;
85
+ }
86
+ };
87
+ }
88
+ build() {
89
+ // const result = [] as Array<VelcronPropertyEditor>;
90
+ // if(this.colorSchemaEditorBuilder){
91
+ // result.push(...this.colorSchemaEditorBuilder.internalBuild());
92
+ // }
93
+ // if(this.contentEditorBuilder){
94
+ // result.push(...this.contentEditorBuilder.internalBuild());
95
+ // }
96
+ // if(this.imageEditorBuilder){
97
+ // result.push(...this.imageEditorBuilder.internalBuild());
98
+ // }
99
+ // if(this.propertyMappingBuilder){
100
+ // result.push(...this.propertyMappingBuilder.internalBuild());
101
+ // }
102
+ return this.editors;
103
+ // return result;
104
+ }
105
+ }
106
+ exports.VelcronEditorBuilder2 = VelcronEditorBuilder2;
@@ -1,4 +1,4 @@
1
- import { VelcronPropertyEditor } from "../../models";
1
+ import { VelcronPropertyEditor } from "@omnia/fx-models";
2
2
  import { VelcronEditorBuilder } from "./VelcronEditorBuilder";
3
3
  export declare abstract class VelcronEditorBuilderBase {
4
4
  protected builder: VelcronEditorBuilder;
@@ -0,0 +1,9 @@
1
+ import { VelcronPropertyEditor } from "@omnia/fx-models";
2
+ import { VelcronEditorBuilder } from "./VelcronEditorBuilder";
3
+ import { VelcronEditorBuilderBase } from "./VelcronEditorBuilderBase";
4
+ export declare class VelcronPropertyMappingEditorBuilder extends VelcronEditorBuilderBase {
5
+ private editor;
6
+ constructor(builder: any);
7
+ add(): VelcronEditorBuilder;
8
+ protected internalBuild(): VelcronPropertyEditor<any>[];
9
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VelcronPropertyMappingEditorBuilder = void 0;
4
+ const VelcronEditorBuilderBase_1 = require("./VelcronEditorBuilderBase");
5
+ class VelcronPropertyMappingEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEditorBuilderBase {
6
+ constructor(builder) {
7
+ super(builder);
8
+ this.editor = null;
9
+ }
10
+ add() {
11
+ if (!this.editor) {
12
+ this.editor = {
13
+ name: "Properties",
14
+ type: "enterprise-property",
15
+ stateMapping: "properties.mappings",
16
+ propertyMapping: true,
17
+ multiple: true,
18
+ };
19
+ }
20
+ return this.builder;
21
+ }
22
+ internalBuild() {
23
+ const result = [];
24
+ if (this.editor) {
25
+ result.push(this.editor);
26
+ }
27
+ return result;
28
+ }
29
+ }
30
+ exports.VelcronPropertyMappingEditorBuilder = VelcronPropertyMappingEditorBuilder;
@@ -1 +1,2 @@
1
1
  export * from "./useVelcronTemplateBuilder";
2
+ export * from "./useVelcronEditorBuilder";
@@ -2,3 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./useVelcronTemplateBuilder"), exports);
5
+ tslib_1.__exportStar(require("./useVelcronEditorBuilder"), exports);
@@ -0,0 +1,38 @@
1
+ // import { VelcronStateBuilderBase } from "./VelcronStateBuilderBase";
2
+ // import { VelcronTextContentBuilder } from "./VelcronTextContentBuilder";
3
+ // export class VelcronBlockHeaderStateBuilder extends VelcronStateBuilderBase {
4
+ // title = new VelcronTextContentBuilder<VelcronBlockHeaderStateBuilder>(this,"content.title");
5
+ // constructor(stateBuilder) {
6
+ // super(stateBuilder);
7
+ // }
8
+ // protected internalBuild() {
9
+ // const resultValue = {} as VelcronContentState;
10
+ // let hasContent = false;
11
+ // const mainContent = (this.main as any).internalBuild();
12
+ // const captionContent = (this.caption as any).internalBuild();
13
+ // const titleContent = (this.title as any).internalBuild();
14
+ // const summaryContent = (this.summary as any).internalBuild();
15
+ // if(mainContent){
16
+ // hasContent = true;
17
+ // resultValue.main = mainContent;
18
+ // }
19
+ // if(captionContent){
20
+ // hasContent = true;
21
+ // resultValue.caption = captionContent;
22
+ // }
23
+ // if(titleContent){
24
+ // hasContent = true;
25
+ // resultValue.title = titleContent;
26
+ // }
27
+ // if(summaryContent){
28
+ // hasContent = true;
29
+ // resultValue.summary = summaryContent;
30
+ // }
31
+ // if(!hasContent){
32
+ // return null;
33
+ // }
34
+ // return <VelcronState>{
35
+ // content: resultValue
36
+ // };
37
+ // }
38
+ // }
@@ -1,11 +1,16 @@
1
- import { ColorSchemaType } from "@omnia/fx-models";
1
+ import { ColorSchemaType, VelcronState } from "@omnia/fx-models";
2
2
  import { VelcronStateBuilderBase } from "./VelcronStateBuilderBase";
3
3
  export declare class VelcronColorSchemaStateBuilder extends VelcronStateBuilderBase {
4
4
  private colorSchema;
5
+ private filledValue;
5
6
  constructor(stateBuilder: any);
6
- add(colorSchema?: ColorSchemaType): VelcronColorSchemaStateBuilder;
7
- bind: string;
8
- protected internalBuild(): {
9
- colorSchemaType: "info" | "error" | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background";
7
+ type: {
8
+ add(colorSchema?: ColorSchemaType): VelcronColorSchemaStateBuilder;
9
+ bind: string;
10
10
  };
11
+ filled: {
12
+ add(filled: boolean): VelcronColorSchemaStateBuilder;
13
+ bind: any;
14
+ };
15
+ protected internalBuild(): VelcronState;
11
16
  }
@@ -5,15 +5,27 @@ const VelcronStateBuilderBase_1 = require("./VelcronStateBuilderBase");
5
5
  class VelcronColorSchemaStateBuilder extends VelcronStateBuilderBase_1.VelcronStateBuilderBase {
6
6
  constructor(stateBuilder) {
7
7
  super(stateBuilder);
8
- this.bind = "{{colorSchemaType}}";
9
- }
10
- add(colorSchema) {
11
- this.colorSchema = colorSchema;
12
- return this;
8
+ this.type = {
9
+ add(colorSchema) {
10
+ this.colorSchema = colorSchema;
11
+ return this;
12
+ },
13
+ bind: "{{colorSchemaType.type}}"
14
+ };
15
+ this.filled = {
16
+ add(filled) {
17
+ this.filledValue = filled;
18
+ return this;
19
+ },
20
+ bind: "{{colorSchemaType.filled}}"
21
+ };
13
22
  }
14
23
  internalBuild() {
15
24
  return {
16
- colorSchemaType: this.colorSchema
25
+ colorSchema: {
26
+ type: this.colorSchema,
27
+ filled: this.filledValue
28
+ }
17
29
  };
18
30
  }
19
31
  }
@@ -1,17 +1,11 @@
1
+ import { VelcronState } from "@omnia/fx-models";
1
2
  import { VelcronStateBuilderBase } from "./VelcronStateBuilderBase";
3
+ import { VelcronTextContentBuilder } from "./VelcronTextContentBuilder";
2
4
  export declare class VelcronContentStateBuilder extends VelcronStateBuilderBase {
3
- private mainContent;
4
- private captionContent;
5
+ main: VelcronTextContentBuilder<VelcronContentStateBuilder>;
6
+ caption: VelcronTextContentBuilder<VelcronContentStateBuilder>;
7
+ title: VelcronTextContentBuilder<VelcronContentStateBuilder>;
8
+ summary: VelcronTextContentBuilder<VelcronContentStateBuilder>;
5
9
  constructor(stateBuilder: any);
6
- main: {
7
- add: (value?: string) => VelcronContentStateBuilder;
8
- bind: string;
9
- };
10
- caption: {
11
- add: (value?: string) => VelcronContentStateBuilder;
12
- bind: string;
13
- };
14
- protected internalBuild(): {
15
- content: {};
16
- };
10
+ protected internalBuild(): VelcronState;
17
11
  }
@@ -2,34 +2,42 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VelcronContentStateBuilder = void 0;
4
4
  const VelcronStateBuilderBase_1 = require("./VelcronStateBuilderBase");
5
+ const VelcronTextContentBuilder_1 = require("./VelcronTextContentBuilder");
6
+ // title?: VelcronTextState;
7
+ // summary?: VelcronTextState;
5
8
  class VelcronContentStateBuilder extends VelcronStateBuilderBase_1.VelcronStateBuilderBase {
6
9
  constructor(stateBuilder) {
7
10
  super(stateBuilder);
8
- this.main = {
9
- add: (value) => {
10
- this.mainContent = value;
11
- return this;
12
- },
13
- bind: "$state.content.main"
14
- };
15
- this.caption = {
16
- add: (value) => {
17
- this.captionContent = value;
18
- return this;
19
- },
20
- bind: "{{content.caption}}"
21
- };
11
+ this.main = new VelcronTextContentBuilder_1.VelcronTextContentBuilder(this, "content.main");
12
+ this.caption = new VelcronTextContentBuilder_1.VelcronTextContentBuilder(this, "content.caption");
13
+ this.title = new VelcronTextContentBuilder_1.VelcronTextContentBuilder(this, "content.title");
14
+ this.summary = new VelcronTextContentBuilder_1.VelcronTextContentBuilder(this, "content.summary");
22
15
  }
23
16
  internalBuild() {
24
17
  const resultValue = {};
25
18
  let hasContent = false;
26
- if (this.mainContent) {
27
- resultValue["main"] = this.mainContent;
19
+ const mainContent = this.main.internalBuild();
20
+ const captionContent = this.caption.internalBuild();
21
+ const titleContent = this.title.internalBuild();
22
+ const summaryContent = this.summary.internalBuild();
23
+ if (mainContent) {
24
+ hasContent = true;
25
+ resultValue.main = mainContent;
26
+ }
27
+ if (captionContent) {
28
28
  hasContent = true;
29
+ resultValue.caption = captionContent;
29
30
  }
30
- if (this.captionContent) {
31
- resultValue["caption"] = this.captionContent;
31
+ if (titleContent) {
32
32
  hasContent = true;
33
+ resultValue.title = titleContent;
34
+ }
35
+ if (summaryContent) {
36
+ hasContent = true;
37
+ resultValue.summary = summaryContent;
38
+ }
39
+ if (!hasContent) {
40
+ return null;
33
41
  }
34
42
  return {
35
43
  content: resultValue
@@ -1,4 +1,4 @@
1
- import { VelcronImageRatios } from "../../models";
1
+ import { VelcronImageRatios, VelcronState } from "@omnia/fx-models";
2
2
  import { VelcronStateBuilderBase } from "./VelcronStateBuilderBase";
3
3
  export declare class VelcronImageStateBuilder extends VelcronStateBuilderBase {
4
4
  private mainImageUrl;
@@ -14,7 +14,5 @@ export declare class VelcronImageStateBuilder extends VelcronStateBuilderBase {
14
14
  bind: string;
15
15
  };
16
16
  };
17
- protected internalBuild(): {
18
- "main-image": {};
19
- };
17
+ protected internalBuild(): VelcronState;
20
18
  }
@@ -11,14 +11,14 @@ class VelcronImageStateBuilder extends VelcronStateBuilderBase_1.VelcronStateBui
11
11
  this.mainImageUrl = url;
12
12
  return this;
13
13
  },
14
- bind: "{{main-image.url}}"
14
+ bind: "{{images.main.url}}"
15
15
  },
16
16
  ratio: {
17
17
  add: (ratio) => {
18
18
  this.mainImageRatio = ratio;
19
19
  return this;
20
20
  },
21
- bind: "{{main-image.ratio}}"
21
+ bind: "{{images.main.ratio}}"
22
22
  }
23
23
  };
24
24
  }
@@ -26,16 +26,22 @@ class VelcronImageStateBuilder extends VelcronStateBuilderBase_1.VelcronStateBui
26
26
  if (!this.mainImageUrl) {
27
27
  return null;
28
28
  }
29
+ let hasContent = false;
29
30
  const resultValue = {};
30
31
  if (this.mainImageRatio) {
31
32
  resultValue["ratio"] = this.mainImageRatio;
33
+ hasContent = true;
32
34
  }
33
35
  if (this.mainImageUrl) {
34
36
  resultValue["url"] = this.mainImageUrl;
37
+ hasContent = true;
38
+ }
39
+ if (!hasContent) {
40
+ return null;
35
41
  }
36
42
  return {
37
- "main-image": {
38
- ...resultValue
43
+ images: {
44
+ main: resultValue
39
45
  }
40
46
  };
41
47
  }