@omnia/velcron 8.0.163-dev → 8.0.165-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.
@@ -129,10 +129,11 @@ export interface BackgroundDefinition {
129
129
  fill?: FillDefinitionValue;
130
130
  border?: BorderStylingDefinition;
131
131
  elevation?: number;
132
- media?: BackgroundMedia;
132
+ media?: BackgroundMediaDefinition;
133
133
  }
134
- export interface BackgroundMedia {
135
- type: "image" | "video";
134
+ export type BackgroundMedia = "image" | "video";
135
+ export interface BackgroundMediaDefinition {
136
+ type: BackgroundMedia;
136
137
  src: string;
137
138
  }
138
139
  export interface FillDefinition {
@@ -60,15 +60,16 @@ export interface VelcronComponentDefinition extends VelcronDefinition {
60
60
  icon?: any;
61
61
  }
62
62
  export type VelcronCustomComponentDefinition = VelcronComponentDefinition;
63
- export type BuiltInPropertyEditorType = "text" | "slider" | "switch" | "alignment" | "color" | "markdown" | "icon" | "image" | "typography" | "spacing" | "color-schema-type" | "container" | "reference";
63
+ export type BuiltInPropertyEditorType = "text" | "slider" | "switch" | "alignment" | "color" | "markdown" | "icon" | "image" | "typography" | "spacing" | "color-schema-type" | "blueprint" | "background" | "grid" | "reference";
64
+ export type EditorLocation = "inline " | "pane" | "toolbar";
64
65
  export interface VelcronEditor<TSettings = any> {
65
66
  name?: string;
66
67
  icon?: IFontAwesomeIcon;
67
68
  category?: string;
68
- locations?: ("inline" | "pane" | "menu")[];
69
+ locations?: (EditorLocation)[];
69
70
  type: BuiltInPropertyEditorType | string;
70
71
  settings?: TSettings;
71
- stateMapping?: string;
72
+ state?: string;
72
73
  propertyMapping?: boolean;
73
74
  multiple?: boolean;
74
75
  component?: unknown;
package/models/Enums.d.ts CHANGED
@@ -16,22 +16,9 @@ export declare enum VelcronActionTypes {
16
16
  export declare enum VelcronIconTypes {
17
17
  fontAwesome = "fa"
18
18
  }
19
- export declare enum VelcronViewDirections {
20
- row = "row",
21
- column = "column",
22
- rowReverse = "row-reverse",
23
- columnRevers = "column-reverse"
24
- }
25
- export declare enum VelcronHorizontalAlignments {
26
- left = "left",
27
- center = "center",
28
- right = "right"
29
- }
30
- export declare enum VelcronVerticalAlignments {
31
- top = "top",
32
- center = "center",
33
- bottom = "bottom"
34
- }
19
+ export type VelcronViewDirections = "row" | "column" | "row-reverse" | "column-reverse";
20
+ export type VelcronHorizontalAlignments = "left" | "center" | "right";
21
+ export type VelcronVerticalAlignments = "top" | "center" | "bottom";
35
22
  export declare enum VelcronDataTypes {
36
23
  unknown = "unknown",
37
24
  object = "object",
package/models/Enums.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VelcronDataTypes = exports.VelcronVerticalAlignments = exports.VelcronHorizontalAlignments = exports.VelcronViewDirections = exports.VelcronIconTypes = exports.VelcronActionTypes = exports.AssignOperators = void 0;
3
+ exports.VelcronDataTypes = exports.VelcronIconTypes = exports.VelcronActionTypes = exports.AssignOperators = void 0;
4
4
  var AssignOperators;
5
5
  (function (AssignOperators) {
6
6
  AssignOperators["equals"] = "=";
@@ -22,25 +22,6 @@ var VelcronIconTypes;
22
22
  (function (VelcronIconTypes) {
23
23
  VelcronIconTypes["fontAwesome"] = "fa";
24
24
  })(VelcronIconTypes || (exports.VelcronIconTypes = VelcronIconTypes = {}));
25
- var VelcronViewDirections;
26
- (function (VelcronViewDirections) {
27
- VelcronViewDirections["row"] = "row";
28
- VelcronViewDirections["column"] = "column";
29
- VelcronViewDirections["rowReverse"] = "row-reverse";
30
- VelcronViewDirections["columnRevers"] = "column-reverse";
31
- })(VelcronViewDirections || (exports.VelcronViewDirections = VelcronViewDirections = {}));
32
- var VelcronHorizontalAlignments;
33
- (function (VelcronHorizontalAlignments) {
34
- VelcronHorizontalAlignments["left"] = "left";
35
- VelcronHorizontalAlignments["center"] = "center";
36
- VelcronHorizontalAlignments["right"] = "right";
37
- })(VelcronHorizontalAlignments || (exports.VelcronHorizontalAlignments = VelcronHorizontalAlignments = {}));
38
- var VelcronVerticalAlignments;
39
- (function (VelcronVerticalAlignments) {
40
- VelcronVerticalAlignments["top"] = "top";
41
- VelcronVerticalAlignments["center"] = "center";
42
- VelcronVerticalAlignments["bottom"] = "bottom";
43
- })(VelcronVerticalAlignments || (exports.VelcronVerticalAlignments = VelcronVerticalAlignments = {}));
44
25
  var VelcronDataTypes;
45
26
  (function (VelcronDataTypes) {
46
27
  //Unknown = null
@@ -51,5 +32,6 @@ var VelcronDataTypes;
51
32
  VelcronDataTypes["boolean"] = "boolean";
52
33
  VelcronDataTypes["array"] = "array";
53
34
  VelcronDataTypes["componentArray"] = "componentArray";
35
+ //Depricated????
54
36
  VelcronDataTypes["bind"] = "bind";
55
37
  })(VelcronDataTypes || (exports.VelcronDataTypes = VelcronDataTypes = {}));
@@ -1,4 +1,4 @@
1
- import { VelcronOnUpdatedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnPressEvent, VelcronSpacing, VelcronStyling, VelcronCustomComponentDefinition, VelcronAppDefinition, VelcronRendererResolverReference, EventHook, Future, TextBlueprint, VelcronBindableProp, ContainerBlueprint, BackgroundDefinition, VelcronEditor } from "@omnia/velcron/internal-do-not-import-from-here/shared/models";
1
+ import { VelcronOnUpdatedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnPressEvent, VelcronSpacing, VelcronStyling, VelcronCustomComponentDefinition, VelcronAppDefinition, VelcronRendererResolverReference, EventHook, Future, TextBlueprint, VelcronBindableProp, VelcronEditor, ContainerBlueprint, BackgroundDefinition, ContainerVariant } from "@omnia/velcron/internal-do-not-import-from-here/shared/models";
2
2
  import { VelcroncomponentArrayType, VelcronPrimitiveType } from "./VelcronTypes";
3
3
  import { AssignOperators, VelcronHorizontalAlignments, VelcronIconTypes, VelcronActionTypes, VelcronVerticalAlignments } from "./Enums";
4
4
  import { DynamicState, VelcronDefinition, useVelcronThemingStore } from "..";
@@ -85,11 +85,11 @@ export interface VelcronRenderContextEventHandlersInstance extends VelcronRender
85
85
  }
86
86
  export interface VelcronRenderContextHooks {
87
87
  dialogVisibilityChanged?: ((visible: boolean) => void);
88
- onItemSelected?: ((item: VelcronDefinition) => void);
88
+ onItemSelected?: ((item: VelcronDefinition, renderContext: VelcronRenderContext) => void);
89
89
  wrapperStyleExtensions?: ((item: VelcronDefinition, renderContext: VelcronRenderContext) => string);
90
- renderExtensions?: <TNodeType>(item: VelcronDefinition) => TNodeType;
90
+ renderExtensions?: <TNodeType>(item: VelcronDefinition, renderContext: VelcronRenderContext) => TNodeType;
91
91
  appStyleExtension?: (() => string);
92
- onItemCreatedProps?: ((item: VelcronDefinition) => object);
92
+ onItemCreatedProps?: ((item: VelcronDefinition, renderContext: VelcronRenderContext) => object);
93
93
  }
94
94
  export interface VelcronContainerRenderer {
95
95
  definition: VelcronDefinition;
@@ -161,7 +161,7 @@ export interface VelcronFlexRowDefinition extends VelcronDefinition, VelcronColo
161
161
  events?: VelcronOnPressEvent;
162
162
  direction?: VelcronBindableProp<"row" | "row-reverse">;
163
163
  absolute?: VelcronSpacing;
164
- blueprint?: ContainerBlueprint;
164
+ blueprint?: ContainerBlueprint | ContainerVariant;
165
165
  background?: BackgroundDefinition;
166
166
  hideOverflow?: boolean;
167
167
  wrap?: boolean;
@@ -194,7 +194,6 @@ export interface VelcronTextDefinition extends VelcronDefinition, VelcronColorSt
194
194
  type: "text";
195
195
  value?: VelcronBindableProp;
196
196
  placeholder?: VelcronBindableProp;
197
- editLabel?: VelcronBindableProp;
198
197
  lineClamp?: VelcronBindableProp<number>;
199
198
  noWrap?: VelcronBindableProp<boolean>;
200
199
  wordBreak?: VelcronBindableProp<"none">;
@@ -23,6 +23,12 @@ export interface VelcronTextEditorSettings {
23
23
  type: TypographyType;
24
24
  placeholder: string;
25
25
  }
26
+ export interface VelcronBlueprintEditorSettings {
27
+ type: "container" | "";
28
+ }
29
+ export interface VelcronBackgroundEditorSettings {
30
+ type: "image" | "video";
31
+ }
26
32
  export interface VelcronSliderPropertyEditor extends VelcronEditor<VelcronSliderPropertyEditorSettings> {
27
33
  type: "slider";
28
34
  }
@@ -35,9 +41,6 @@ export interface VelcronEnterprisePropertyEditor extends VelcronEditor<any> {
35
41
  export interface VelcronTypographyPropertyEditor extends VelcronEditor<VelcronTypographyEditorSettings> {
36
42
  type: "typography";
37
43
  }
38
- export interface VelcronContainerPropertyEditor extends VelcronEditor<any> {
39
- type: "container";
40
- }
41
44
  export interface VelcronSwitchPropertyEditor extends VelcronEditor<any> {
42
45
  type: "switch";
43
46
  }
@@ -65,3 +68,12 @@ export interface VelcronSpacingPropertyEditor extends VelcronEditor<VelcronSpaci
65
68
  export interface VelcronReferencePropertyEditor extends VelcronEditor<any> {
66
69
  type: "reference";
67
70
  }
71
+ export interface VelcronBlueprintEditor extends VelcronEditor<VelcronBlueprintEditorSettings> {
72
+ type: "blueprint";
73
+ }
74
+ export interface VelcronBackgroundEditor extends VelcronEditor<VelcronBackgroundEditorSettings> {
75
+ type: "background";
76
+ }
77
+ export interface VelcronGridEditor extends VelcronEditor<any> {
78
+ type: "grid";
79
+ }
@@ -1,14 +1,25 @@
1
- import { TextBlueprint, TypographySize, TypographyType, VelcronSpacing } from "@omnia/velcron/internal-do-not-import-from-here/shared/models";
1
+ import { BackgroundDefinition, ContainerBlueprint, ContainerVariant, TextBlueprint, TypographySize, TypographyType, VelcronSpacing } from "@omnia/velcron/internal-do-not-import-from-here/shared/models";
2
2
  import { VelcronImageRatios } from "./VelcronDefinitions";
3
3
  export interface VelcronState {
4
4
  images?: VelcronImagesState;
5
- styling?: VelcronStylingState;
5
+ container?: {
6
+ colorSchemaType?: string;
7
+ spacing?: VelcronSpacing;
8
+ blueprint?: ContainerBlueprint | ContainerVariant;
9
+ background?: BackgroundDefinition;
10
+ };
11
+ grid?: VelcronGridState;
6
12
  colorSchemas?: VelcronColorSchemasState;
7
13
  content?: VelcronContentState;
8
14
  header?: VelcronHeaderState;
9
15
  properties?: VelcronPropertiesState;
10
16
  spacing?: VelcronSpacingState;
11
17
  }
18
+ export interface VelcronGridState {
19
+ columnWidth?: number;
20
+ columns?: Array<object>;
21
+ gap?: string | number;
22
+ }
12
23
  export interface VelcronSpacingState {
13
24
  container?: VelcronSpacing;
14
25
  }
@@ -79,60 +90,28 @@ export declare const VelcronImagesStateBinding: {
79
90
  height: string;
80
91
  };
81
92
  };
82
- export declare const VelcronHeaderStateBinding: {
83
- title: {
84
- text: string;
85
- placeholder: string;
86
- blueprint: import("@omnia/velcron/internal-do-not-import-from-here/shared/models").VelcronBindableProp<TextBlueprint>;
87
- };
88
- icon: string;
89
- };
90
- export declare const VelcronContentStateBinding: {
91
- title: {
92
- text: string;
93
- placeholder: string;
94
- blueprint: import("@omnia/velcron/internal-do-not-import-from-here/shared/models").VelcronBindableProp<TextBlueprint>;
95
- };
96
- main: {
97
- text: string;
98
- placeholder: string;
99
- blueprint: import("@omnia/velcron/internal-do-not-import-from-here/shared/models").VelcronBindableProp<TextBlueprint>;
100
- };
101
- caption: {
102
- text: string;
103
- placeholder: string;
104
- blueprint: import("@omnia/velcron/internal-do-not-import-from-here/shared/models").VelcronBindableProp<TextBlueprint>;
105
- };
106
- summary: {
107
- text: string;
108
- placeholder: string;
109
- blueprint: import("@omnia/velcron/internal-do-not-import-from-here/shared/models").VelcronBindableProp<TextBlueprint>;
110
- };
111
- };
112
- export declare const VelcronColorSchemasStateBinding: {
113
- main: {
114
- value: string;
115
- type: string;
116
- filled: string;
117
- };
118
- };
119
- export declare const VelcronSpacingStateBinding: {
120
- container: {
121
- value: string;
122
- top: string;
123
- right: string;
124
- bottom: string;
125
- left: string;
93
+ export declare const VelcronStateMapping: {
94
+ grid: {
95
+ columns: string;
126
96
  };
127
97
  };
128
98
  export declare const VelcronStateBinding: {
129
99
  colorSchemas: {
130
- main: {
100
+ main_depricated: {
131
101
  value: string;
132
102
  type: string;
133
103
  filled: string;
134
104
  };
135
105
  };
106
+ container: {
107
+ colorSchemaType: string;
108
+ spacing: string;
109
+ blueprint: string;
110
+ background: {
111
+ value: string;
112
+ media: string;
113
+ };
114
+ };
136
115
  images: {
137
116
  main: {
138
117
  editor: string;
@@ -181,6 +160,12 @@ export declare const VelcronStateBinding: {
181
160
  blueprint: import("@omnia/velcron/internal-do-not-import-from-here/shared/models").VelcronBindableProp<TextBlueprint>;
182
161
  };
183
162
  };
163
+ grid: {
164
+ value: string;
165
+ columnWidth: string;
166
+ columns: string;
167
+ gap: string;
168
+ };
184
169
  header: {
185
170
  title: {
186
171
  text: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VelcronStateBinding = exports.VelcronSpacingStateBinding = exports.VelcronColorSchemasStateBinding = exports.VelcronContentStateBinding = exports.VelcronHeaderStateBinding = exports.VelcronImagesStateBinding = void 0;
3
+ exports.VelcronStateBinding = exports.VelcronStateMapping = exports.VelcronImagesStateBinding = void 0;
4
4
  const models_1 = require("@omnia/velcron/internal-do-not-import-from-here/shared/models");
5
5
  exports.VelcronImagesStateBinding = {
6
6
  main: {
@@ -28,15 +28,7 @@ exports.VelcronImagesStateBinding = {
28
28
  height: "{{images.alt2.height}}",
29
29
  },
30
30
  };
31
- exports.VelcronHeaderStateBinding = {
32
- title: {
33
- text: (0, models_1.velcronBind)("header.title.text"),
34
- placeholder: (0, models_1.velcronBind)("header.title.placeholder"),
35
- blueprint: (0, models_1.velcronBind)("content.title.blueprint")
36
- },
37
- icon: (0, models_1.velcronBind)("header.icon")
38
- };
39
- exports.VelcronContentStateBinding = {
31
+ const VelcronContentStateBinding = {
40
32
  title: {
41
33
  text: (0, models_1.velcronBind)("content.title.text"),
42
34
  placeholder: (0, models_1.velcronBind)("content.title.placeholder"),
@@ -58,34 +50,53 @@ exports.VelcronContentStateBinding = {
58
50
  blueprint: (0, models_1.velcronBind)("content.summary.blueprint")
59
51
  },
60
52
  };
61
- exports.VelcronColorSchemasStateBinding = {
62
- main: {
63
- value: (0, models_1.velcronBind)("colorSchemas.main"),
64
- type: (0, models_1.velcronBind)("colorSchemas.main.type"),
65
- filled: (0, models_1.velcronBind)("colorSchemas.main.filled")
66
- }
67
- };
68
- exports.VelcronSpacingStateBinding = {
69
- container: {
70
- value: (0, models_1.velcronBind)("spacing.chrome"),
71
- top: (0, models_1.velcronBind)("{{spacing.chrome.top}}"),
72
- right: (0, models_1.velcronBind)("{{spacing.chrome.right}}"),
73
- bottom: (0, models_1.velcronBind)("{{spacing.chrome.bottom}}"),
74
- left: (0, models_1.velcronBind)("{{spacing.chrome.left}}"),
75
- }
53
+ exports.VelcronStateMapping = {
54
+ grid: {
55
+ columns: "grid.columns",
56
+ },
76
57
  };
77
- // export interface VelcronSpacingState {
78
- // chrome?: VelcronDimensionState
79
- // }
80
- // export interface VelcronDimensionState {
81
- // margin?: VelcronSpacing;
82
- // padding?: VelcronSpacing;
83
- // }
84
58
  exports.VelcronStateBinding = {
85
- colorSchemas: exports.VelcronColorSchemasStateBinding,
59
+ colorSchemas: {
60
+ main_depricated: {
61
+ value: (0, models_1.velcronBind)("colorSchemas.main"),
62
+ type: (0, models_1.velcronBind)("colorSchemas.main.type"),
63
+ filled: (0, models_1.velcronBind)("colorSchemas.main.filled")
64
+ }
65
+ },
66
+ container: {
67
+ colorSchemaType: (0, models_1.velcronBind)("$state.container.colorSchemaType"),
68
+ spacing: (0, models_1.velcronBind)("$state.container.spacing"),
69
+ blueprint: (0, models_1.velcronBind)("$state.container.blueprint"),
70
+ background: {
71
+ value: (0, models_1.velcronBind)("$state.container.background"),
72
+ media: (0, models_1.velcronBind)("$state.container.background.media")
73
+ }
74
+ },
86
75
  images: exports.VelcronImagesStateBinding,
87
- content: exports.VelcronContentStateBinding,
88
- header: exports.VelcronHeaderStateBinding,
89
- spacing: exports.VelcronSpacingStateBinding
76
+ content: VelcronContentStateBinding,
77
+ grid: {
78
+ value: (0, models_1.velcronBind)("$state.grid"),
79
+ columnWidth: (0, models_1.velcronBind)("$state.grid.columnWidth"),
80
+ columns: (0, models_1.velcronBind)("$state.grid.columns"),
81
+ gap: (0, models_1.velcronBind)("$state.grid.gap"),
82
+ //rows:velcronBind("grid.rows"),
83
+ },
84
+ header: {
85
+ title: {
86
+ text: (0, models_1.velcronBind)("$state.header.title.text"),
87
+ placeholder: (0, models_1.velcronBind)("$state.header.title.placeholder"),
88
+ blueprint: (0, models_1.velcronBind)("$state.content.title.blueprint")
89
+ },
90
+ icon: (0, models_1.velcronBind)("$state.header.icon")
91
+ },
92
+ spacing: {
93
+ container: {
94
+ value: (0, models_1.velcronBind)("$state.spacing.chrome"),
95
+ top: (0, models_1.velcronBind)("{{spacing.chrome.top}}"),
96
+ right: (0, models_1.velcronBind)("{{spacing.chrome.right}}"),
97
+ bottom: (0, models_1.velcronBind)("{{spacing.chrome.bottom}}"),
98
+ left: (0, models_1.velcronBind)("{{spacing.chrome.left}}"),
99
+ }
100
+ }
90
101
  //properties?:VelcronPropertiesState,
91
102
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/velcron",
3
3
  "license": "MIT",
4
- "version": "8.0.163-dev",
4
+ "version": "8.0.165-dev",
5
5
  "description": "Provide Omnia Velcron Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,4 +1,4 @@
1
- import { VelcronRenderContext } from "../models";
1
+ import { VelcronRenderContext, VelcronDataTypes } from "../models";
2
2
  import { VelcronAppDefinition, VelcronBindableProp, VelcronDefinition } from "..";
3
3
  export interface ParseResult<T> {
4
4
  is: boolean;
@@ -26,6 +26,7 @@ export declare class VelcronData {
26
26
  static isUndefined(value: any): boolean;
27
27
  static isArray(obj: any): obj is ExtendArray;
28
28
  static isObject(value: any): value is object;
29
+ static getDataType(value: any): VelcronDataTypes;
29
30
  static extendObject(obj: any): any;
30
31
  static propertyPathExists(obj: object, path: string): boolean;
31
32
  static getOrSetObjectByPath<T>(object: Object, path: string, value?: any): T | null;
@@ -464,6 +464,22 @@ class VelcronData {
464
464
  !Array.isArray(value) &&
465
465
  value !== null;
466
466
  }
467
+ static getDataType(value) {
468
+ if (value === null)
469
+ return models_1.VelcronDataTypes.unknown;
470
+ else if (Array.isArray(value))
471
+ return models_1.VelcronDataTypes.array;
472
+ else if (VelcronData.isObject(value))
473
+ return models_1.VelcronDataTypes.object;
474
+ else if (VelcronData.isString(value))
475
+ return models_1.VelcronDataTypes.text;
476
+ else if (VelcronData.isNumber(value))
477
+ return models_1.VelcronDataTypes.number;
478
+ else if (VelcronData.isBoolean(value))
479
+ return models_1.VelcronDataTypes.boolean;
480
+ else
481
+ return models_1.VelcronDataTypes.unknown;
482
+ }
467
483
  static extendObject(obj) {
468
484
  //Give objects some powerups
469
485
  if (VelcronData.isUndefined(obj)) {
@@ -157,16 +157,16 @@ class VelcronStyles {
157
157
  }
158
158
  else if (definition.type === VelcronConstants_1.VelcronConstants.components.row) {
159
159
  const flexDefinition = definition;
160
+ const spacing = renderCtx.theming.get.spacing();
160
161
  let alignX = null;
161
162
  let alignY = null;
162
- const gapX = flexDefinition.gapX ? flexDefinition.gapX : flexDefinition.gapY;
163
- const gapY = flexDefinition.gapY ? flexDefinition.gapY : flexDefinition.gapX;
163
+ const gapX = flexDefinition.gapX || flexDefinition?.gapX?.toString() === "0" ? (0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.gapX), spacing) : (0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.gapY), spacing);
164
+ const gapY = flexDefinition.gapY || flexDefinition?.gapY?.toString() === "0" ? (0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.gapY), spacing) : gapX;
164
165
  const width = VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.width);
165
166
  const minWidth = VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.minWidth);
166
167
  const height = VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.height);
167
168
  const minHeight = VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.minHeight);
168
169
  if (flexDefinition.absolute) {
169
- const spacing = renderCtx.theming.get.spacing();
170
170
  styleBase["position"] = "absolute";
171
171
  /**Use margin to position the element since flex does not support absolute positioning */
172
172
  styleBase["marginTop"] = this.unitProvider.formatDimension((0, __1.getSpacingValueFromBlueprint)(VelcronData_1.VelcronData.dataBind(renderCtx, flexDefinition.absolute.top), spacing));
@@ -200,8 +200,8 @@ class VelcronStyles {
200
200
  styleBase["flexWrap"] = flexDefinition.wrap ? "wrap" : null;
201
201
  styleBase["justifyContent"] = alignX;
202
202
  styleBase["alignItems"] = alignY;
203
- styleBase["rowGap"] = gapY;
204
- styleBase["columnGap"] = gapX;
203
+ styleBase["rowGap"] = this.unitProvider.formatDimension(gapY);
204
+ styleBase["columnGap"] = this.unitProvider.formatDimension(gapX);
205
205
  styleBase["flexBasis"] = flexDefinition.height ? this.unitProvider.formatDimension(height) : undefined;
206
206
  styleBase["width"] = this.unitProvider.formatDimension(width);
207
207
  styleBase["maxWidth"] = this.unitProvider.formatDimension(width);
@@ -8,7 +8,7 @@ export declare const useVelcronColorSchemaStore: (newStateWithName?: string) =>
8
8
  onContainer: ColorDefinition;
9
9
  isContainer: boolean;
10
10
  name: string;
11
- colorSchemaType: "primary" | "secondary" | ColorSchemaTypes | "accent1" | "accent2" | "accent3" | "neutral" | "warning" | "notification" | "background" | "error" | "info" | "dynamic";
11
+ colorSchemaType: "background" | "primary" | "secondary" | ColorSchemaTypes | "accent1" | "accent2" | "accent3" | "neutral" | "warning" | "notification" | "error" | "info" | "dynamic";
12
12
  id: import("@omnia/fx-models").GuidValue;
13
13
  };
14
14
  get: {
@@ -3,6 +3,7 @@ export declare class VelcronEditorBuilder {
3
3
  private editors;
4
4
  private formatStateMapping;
5
5
  add(): {
6
+ blueprintEditor: (name: string, stateMapping: string, type: "container") => VelcronEditorBuilder;
6
7
  spacingEditor: (name: string, stateMapping: string, individualSelection?: boolean) => VelcronEditorBuilder;
7
8
  imageEditor: (name: string, stateMapping: string) => VelcronEditorBuilder;
8
9
  colorSchemaEditor: (name: string, stateMapping: string) => VelcronEditorBuilder;
@@ -10,6 +11,8 @@ export declare class VelcronEditorBuilder {
10
11
  textEditor: (name: string, stateMapping: string, typographyType: TypographyType, placeholder?: string) => VelcronEditorBuilder;
11
12
  blockHeaderEditor: () => VelcronEditorBuilder;
12
13
  typographyEditor: (stateMapping: string, settings: VelcronTypographyEditorSettings) => VelcronEditorBuilder;
14
+ backgroundEditor: (name: string, stateMapping: string, type: "image" | "video") => VelcronEditorBuilder;
15
+ gridEditor: (name: string, stateMapping: string) => VelcronEditorBuilder;
13
16
  };
14
17
  build(): VelcronEditor<any>[];
15
18
  }
@@ -1,20 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VelcronEditorBuilder = void 0;
4
+ const parser_1 = require("../parser");
4
5
  class VelcronEditorBuilder {
5
6
  constructor() {
6
7
  this.editors = [];
7
8
  }
8
9
  formatStateMapping(stateMapping) {
9
- return stateMapping.replace("{{", "").replace("}}", "");
10
+ return stateMapping
11
+ .replace(parser_1.VelcronConstants.properties.tokenStart, "")
12
+ .replace(parser_1.VelcronConstants.properties.tokenEnd, "")
13
+ .replace(parser_1.VelcronConstants.state.bindToken, "")
14
+ .replace(parser_1.VelcronConstants.state.stateRootToken + ".", "")
15
+ .trim();
10
16
  }
11
17
  add() {
12
18
  return {
19
+ blueprintEditor: (name, stateMapping, type) => {
20
+ this.editors.push({
21
+ name: name,
22
+ type: "blueprint",
23
+ state: this.formatStateMapping(stateMapping),
24
+ settings: {
25
+ type: type
26
+ }
27
+ });
28
+ return this;
29
+ },
13
30
  spacingEditor: (name, stateMapping, individualSelection) => {
14
31
  this.editors.push({
15
32
  name: name,
16
33
  type: "spacing",
17
- stateMapping: this.formatStateMapping(stateMapping),
34
+ state: this.formatStateMapping(stateMapping),
18
35
  settings: {
19
36
  individualSelection: individualSelection
20
37
  }
@@ -25,7 +42,7 @@ class VelcronEditorBuilder {
25
42
  this.editors.push({
26
43
  name: name,
27
44
  type: "image",
28
- stateMapping: this.formatStateMapping(stateMapping),
45
+ state: this.formatStateMapping(stateMapping),
29
46
  });
30
47
  return this;
31
48
  },
@@ -33,7 +50,7 @@ class VelcronEditorBuilder {
33
50
  this.editors.push({
34
51
  name: name,
35
52
  type: "color-schema-type",
36
- stateMapping: this.formatStateMapping(stateMapping),
53
+ state: this.formatStateMapping(stateMapping),
37
54
  });
38
55
  return this;
39
56
  },
@@ -41,7 +58,7 @@ class VelcronEditorBuilder {
41
58
  this.editors.push({
42
59
  name: name,
43
60
  type: "markdown",
44
- stateMapping: this.formatStateMapping(stateMapping),
61
+ state: this.formatStateMapping(stateMapping),
45
62
  settings: {
46
63
  placeholder: placeholder
47
64
  }
@@ -52,7 +69,7 @@ class VelcronEditorBuilder {
52
69
  this.editors.push({
53
70
  name: name,
54
71
  type: "text",
55
- stateMapping: this.formatStateMapping(stateMapping),
72
+ state: this.formatStateMapping(stateMapping),
56
73
  settings: {
57
74
  type: typographyType,
58
75
  placeholder: placeholder
@@ -75,12 +92,31 @@ class VelcronEditorBuilder {
75
92
  this.editors.push({
76
93
  name: "Typography",
77
94
  type: "typography",
78
- stateMapping: stateMapping,
95
+ state: stateMapping,
79
96
  settings: settings ? settings : {
80
97
  type: "text"
81
98
  }
82
99
  });
83
100
  return this;
101
+ },
102
+ backgroundEditor: (name, stateMapping, type) => {
103
+ this.editors.push({
104
+ name: name,
105
+ type: "background",
106
+ state: this.formatStateMapping(stateMapping),
107
+ settings: {
108
+ type: type
109
+ }
110
+ });
111
+ return this;
112
+ },
113
+ gridEditor: (name, stateMapping) => {
114
+ this.editors.push({
115
+ name: name,
116
+ type: "grid",
117
+ state: this.formatStateMapping(stateMapping),
118
+ });
119
+ return this;
84
120
  }
85
121
  };
86
122
  }
@@ -23,7 +23,7 @@ class VelcronContentEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEdit
23
23
  this.mainEditor = {
24
24
  name: "Body",
25
25
  type: "markdown",
26
- stateMapping: "content.main.text"
26
+ state: "content.main.text"
27
27
  };
28
28
  }
29
29
  return this;
@@ -33,7 +33,7 @@ class VelcronContentEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEdit
33
33
  this.mainPropertyEditor = {
34
34
  name: title ? title : "Main",
35
35
  type: "text",
36
- stateMapping: "content.main.text",
36
+ state: "content.main.text",
37
37
  propertyMapping: true
38
38
  };
39
39
  }
@@ -44,7 +44,7 @@ class VelcronContentEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEdit
44
44
  this.mainTypographyEditor = {
45
45
  name: title ? title : "Main formatting",
46
46
  type: "typography",
47
- stateMapping: "content.main.text",
47
+ state: "content.main.text",
48
48
  settings: {
49
49
  type: type ? type : "text"
50
50
  }
@@ -59,7 +59,7 @@ class VelcronContentEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEdit
59
59
  this.captionEditor = {
60
60
  name: "Caption",
61
61
  type: "text",
62
- stateMapping: "content.caption.text"
62
+ state: "content.caption.text"
63
63
  };
64
64
  }
65
65
  return this;
@@ -69,7 +69,7 @@ class VelcronContentEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEdit
69
69
  this.captionPropertyEditor = {
70
70
  name: title ? title : "Caption",
71
71
  type: "text",
72
- stateMapping: "content.caption.text",
72
+ state: "content.caption.text",
73
73
  propertyMapping: true
74
74
  };
75
75
  }
@@ -80,7 +80,7 @@ class VelcronContentEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEdit
80
80
  this.captionTypographyEditor = {
81
81
  name: title ? title : "Caption formatting",
82
82
  type: "typography",
83
- stateMapping: "content.caption.text",
83
+ state: "content.caption.text",
84
84
  settings: {
85
85
  type: type ? type : "text"
86
86
  }
@@ -95,7 +95,7 @@ class VelcronContentEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEdit
95
95
  this.titleEditor = {
96
96
  name: "Title",
97
97
  type: "text",
98
- stateMapping: "content.title.text"
98
+ state: "content.title.text"
99
99
  };
100
100
  }
101
101
  return this;
@@ -105,7 +105,7 @@ class VelcronContentEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEdit
105
105
  this.titlePropertyEditor = {
106
106
  name: title ? title : "Title",
107
107
  type: "text",
108
- stateMapping: "content.title.text",
108
+ state: "content.title.text",
109
109
  propertyMapping: true
110
110
  };
111
111
  }
@@ -116,7 +116,7 @@ class VelcronContentEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEdit
116
116
  this.titleTypographyEditor = {
117
117
  name: title ? title : "Title formatting",
118
118
  type: "typography",
119
- stateMapping: "content.title.text",
119
+ state: "content.title.text",
120
120
  settings: {
121
121
  type: type ? type : "title"
122
122
  }
@@ -131,7 +131,7 @@ class VelcronContentEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEdit
131
131
  this.summaryEditor = {
132
132
  name: "Summary",
133
133
  type: "text",
134
- stateMapping: "content.summary.text"
134
+ state: "content.summary.text"
135
135
  };
136
136
  }
137
137
  return this;
@@ -141,7 +141,7 @@ class VelcronContentEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEdit
141
141
  this.summaryPropertyEditor = {
142
142
  name: title ? title : "Summary",
143
143
  type: "text",
144
- stateMapping: "content.summary.text",
144
+ state: "content.summary.text",
145
145
  propertyMapping: true
146
146
  };
147
147
  }
@@ -152,7 +152,7 @@ class VelcronContentEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEdit
152
152
  this.summaryTypographyEditor = {
153
153
  name: title ? title : "Summary formatting",
154
154
  type: "typography",
155
- stateMapping: "content.summary.text",
155
+ state: "content.summary.text",
156
156
  settings: {
157
157
  type: type ? type : "text"
158
158
  }
@@ -12,7 +12,7 @@ class VelcronImageEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEditor
12
12
  this.mainEditor = {
13
13
  name: "Select Main Image",
14
14
  type: "image",
15
- stateMapping: "main-image"
15
+ state: "main-image"
16
16
  };
17
17
  }
18
18
  return this.builder;
@@ -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: "properties.mappings",
15
+ state: "properties.mappings",
16
16
  propertyMapping: true,
17
17
  multiple: true,
18
18
  };