@omnia/velcron 8.0.262-dev → 8.0.264-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.
@@ -1,6 +1,6 @@
1
1
  import { BackgroundDefinition, BlueprintsReference, ColorSchemaType, ColorValue, FillDefinitionValue } from "./ThemeDefinitionV2";
2
2
  import { SpacingDefinition, Spacing } from "./Spacing";
3
- import { TypographyValue } from "./Typography";
3
+ import { TypographyFontDefinition, TypographyValue } from "./Typography";
4
4
  export interface BoxDimensions extends Spacing {
5
5
  }
6
6
  import { TypographyBlueprint } from "./Typography";
@@ -29,6 +29,9 @@ export interface ContainerBlueprint extends Blueprints, BlueprintsReference {
29
29
  export interface TypographyBlueprints extends Blueprints, BlueprintsReference {
30
30
  primary: TypographyBlueprint;
31
31
  }
32
+ export interface IFontBlueprints extends Blueprints, BlueprintsReference {
33
+ fonts: Array<TypographyFontDefinition>;
34
+ }
32
35
  export interface SpacingBlueprints extends Blueprints, BlueprintsReference {
33
36
  primary: SpacingBlueprint;
34
37
  }
@@ -81,7 +81,7 @@ export interface ITemplateRegistration<TTemplateType = any> {
81
81
  hidden?: boolean;
82
82
  custom?: boolean;
83
83
  }
84
- export type TemplateRegistrationType = "button" | "fill" | "border" | "tabs" | "chrome" | "chromes" | "components" | "spacings" | "spacing" | "typography" | "icons" | "colorschema" | "theme";
84
+ export type TemplateRegistrationType = "button" | "fill" | "border" | "tabs" | "chrome" | "chromes" | "components" | "spacings" | "spacing" | "typography" | "icons" | "colorschema" | "theme" | "availablefonts";
85
85
  export interface ITemplateRegistration<TTemplateType = any, TType = TemplateRegistrationType> {
86
86
  type: TemplateRegistrationType;
87
87
  id: guid;
@@ -2,11 +2,7 @@ import { guid } from "../Guid";
2
2
  import { FillDefinition } from "./ThemeDefinitionV2";
3
3
  export interface TypographyBlueprint {
4
4
  name: string;
5
- font?: {
6
- id: guid;
7
- family: string;
8
- cdn?: string;
9
- };
5
+ font?: TypographyFontRef;
10
6
  fills?: {
11
7
  variant1?: FillDefinition;
12
8
  variant2?: FillDefinition;
@@ -18,39 +14,23 @@ export interface TypographyBlueprint {
18
14
  m: TypographyDefinition;
19
15
  s: TypographyDefinition;
20
16
  xs: TypographyDefinition;
21
- font?: {
22
- id: guid;
23
- family: string;
24
- cdn?: string;
25
- };
17
+ font?: TypographyFontRef;
26
18
  };
27
19
  text: {
28
20
  l: TypographyDefinition;
29
21
  m: TypographyDefinition;
30
22
  s: TypographyDefinition;
31
23
  xs: TypographyDefinition;
32
- font?: {
33
- id: guid;
34
- family: string;
35
- cdn?: string;
36
- };
24
+ font?: TypographyFontRef;
37
25
  };
38
26
  navigation: {
39
27
  l: TypographyDefinition;
40
28
  m: TypographyDefinition;
41
- font?: {
42
- id: guid;
43
- family: string;
44
- cdn?: string;
45
- };
29
+ font?: TypographyFontRef;
46
30
  };
47
31
  link: {
48
32
  m: TypographyDefinition;
49
- font?: {
50
- id: guid;
51
- family: string;
52
- cdn?: string;
53
- };
33
+ font?: TypographyFontRef;
54
34
  };
55
35
  }
56
36
  export interface TypographyDefinition {
@@ -58,12 +38,23 @@ export interface TypographyDefinition {
58
38
  lg: TypographyTypeBreakPoint;
59
39
  md?: TypographyTypeBreakPoint;
60
40
  sm?: TypographyTypeBreakPoint;
41
+ font?: TypographyFontRef;
61
42
  }
62
43
  export interface TypographyTypeBreakPoint {
63
44
  weight: number;
64
45
  size: number;
65
46
  lineHeight: number;
66
47
  }
48
+ export interface TypographyFontDefinition {
49
+ id?: guid;
50
+ name?: string;
51
+ family: string;
52
+ cdn?: string;
53
+ manifestId?: guid;
54
+ }
55
+ export interface TypographyFontRef {
56
+ family: string;
57
+ }
67
58
  export type TypographyType = keyof typeof TypographyTypes;
68
59
  export declare enum TypographyTypes {
69
60
  title = "title",
@@ -83,3 +74,5 @@ export declare enum TypographySizes {
83
74
  s = "s",
84
75
  xs = "xs"
85
76
  }
77
+ /**this reflect TypographySizes for member check*/
78
+ export declare const AvailableTypographySizes: string[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TypographySizes = exports.TypographyTypes = void 0;
3
+ exports.AvailableTypographySizes = exports.TypographySizes = exports.TypographyTypes = void 0;
4
4
  var TypographyTypes;
5
5
  (function (TypographyTypes) {
6
6
  TypographyTypes["title"] = "title";
@@ -15,3 +15,5 @@ var TypographySizes;
15
15
  TypographySizes["s"] = "s";
16
16
  TypographySizes["xs"] = "xs";
17
17
  })(TypographySizes || (exports.TypographySizes = TypographySizes = {}));
18
+ /**this reflect TypographySizes for member check*/
19
+ exports.AvailableTypographySizes = ["xl", "l", "m", "s", "xs"];
@@ -60,7 +60,7 @@ export interface VelcronComponentDefinition extends VelcronDefinition {
60
60
  icon?: any;
61
61
  }
62
62
  export type VelcronCustomComponentDefinition = VelcronComponentDefinition;
63
- export type BuiltInPropertyEditorType = "text" | "number" | "slider" | "switch" | "alignment" | "color" | "markdown" | "icon" | "image" | "typography" | "spacing" | "color-schema-type" | "blueprint" | "background" | "grid" | "reference" | "select";
63
+ export type BuiltInPropertyEditorType = "text" | "number" | "slider" | "switch" | "alignment" | "color" | "markdown" | "icon" | "image" | "typography" | "spacing" | "color-schema-type" | "blueprint" | "background" | "grid" | "reference" | "select" | "property-resolver";
64
64
  export type EditorLocation = "inline " | "pane" | "toolbar";
65
65
  export interface VelcronEditor<TSettings = any> {
66
66
  name?: string;
@@ -223,7 +223,6 @@ export declare enum VelcronImageRatios {
223
223
  }
224
224
  export interface VelcronImageDefinition extends VelcronDefinitionWithEditMode {
225
225
  type: "image";
226
- url?: VelcronBindableProp<string>;
227
226
  value?: VelcronBindableProp<string>;
228
227
  ratio?: VelcronImageRatios | string;
229
228
  width?: number | string;
@@ -371,6 +370,11 @@ export interface VelcronPropertyDefinitionValue {
371
370
  value: PropertyValue;
372
371
  configuration: PropertyConfiguration<PropertyDefinition<any, any, any, PropertySetupBase>>;
373
372
  }
373
+ export interface VelcronPropertyDefinitionValueResolver {
374
+ name: string;
375
+ provider: string;
376
+ path: string;
377
+ }
374
378
  export type VelcronRenderProps<TDefinition> = {
375
379
  definition: TDefinition;
376
380
  renderContext: VelcronRenderContext;
@@ -1,4 +1,4 @@
1
- import { BuiltInPropertyEditorType, TypographyType, VelcronEditor } from "@omnia/velcron/internal-do-not-import-from-here/shared/models";
1
+ import { BuiltInPropertyEditorType, guid, TypographyType, VelcronEditor } from "@omnia/velcron/internal-do-not-import-from-here/shared/models";
2
2
  export interface ResolvedPropertyEditor {
3
3
  editor: VelcronEditor;
4
4
  }
@@ -36,6 +36,12 @@ export interface VelcronNumberEditorSettings {
36
36
  max: number;
37
37
  step: number;
38
38
  }
39
+ export interface VelcronPropertyResolverEditorSettings {
40
+ properties: Array<{
41
+ name: string;
42
+ definitionId: guid;
43
+ }>;
44
+ }
39
45
  export interface VelcronBlueprintEditorSettings {
40
46
  type: "container" | "icon";
41
47
  }
@@ -96,3 +102,6 @@ export interface VelcronGridEditor extends VelcronEditor<any> {
96
102
  export interface VelcronSelectEditor extends VelcronEditor<VelcronSelectEditorSettings> {
97
103
  type: "select";
98
104
  }
105
+ export interface VelcronPropertyResolverEditor extends VelcronEditor<VelcronPropertyResolverEditorSettings> {
106
+ type: "property-resolver";
107
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/velcron",
3
3
  "license": "MIT",
4
- "version": "8.0.262-dev",
4
+ "version": "8.0.264-dev",
5
5
  "description": "Provide Omnia Velcron Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -398,6 +398,9 @@ class VelcronData {
398
398
  if (Array.isArray(evalResult)) {
399
399
  result = evalResult;
400
400
  }
401
+ else if (VelcronData.isObject(evalResult)) {
402
+ result = Object.entries(evalResult).map(([key, value]) => ({ key, value }));
403
+ }
401
404
  else {
402
405
  VelcronLogger_1.VelcronLogger.logDataError(`Cant evaluate ${template} to a Array`);
403
406
  }
@@ -15,6 +15,7 @@ export declare class VelcronEditorBuilder {
15
15
  sliderEditor: (name: string, stateMapping: string, settings: VelcronSliderPropertyEditorSettings) => VelcronEditorBuilder;
16
16
  gridEditor: (name: string, stateMapping: string) => VelcronEditorBuilder;
17
17
  widthEditor: (name: string, stateMapping: string) => VelcronEditorBuilder;
18
+ propertyResolverEditor: (name: string, stateMapping: string) => VelcronEditorBuilder;
18
19
  };
19
20
  build(): VelcronEditor<any>[];
20
21
  }
@@ -134,6 +134,14 @@ class VelcronEditorBuilder {
134
134
  state: this.formatStateMapping(stateMapping),
135
135
  });
136
136
  return this;
137
+ },
138
+ propertyResolverEditor: (name, stateMapping) => {
139
+ this.editors.push({
140
+ name: name,
141
+ type: "property-resolver",
142
+ state: this.formatStateMapping(stateMapping),
143
+ });
144
+ return this;
137
145
  }
138
146
  };
139
147
  }