@omnia/velcron 8.0.86-vnext → 8.0.88-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.
@@ -1,13 +1,28 @@
1
- import { VelcronDataTypes, VelcronImageRatios } from "@omnia/fx-models";
1
+ import { VelcronImageRatios } from "@omnia/fx-models";
2
+ export interface ResolvedPropertyEditor {
3
+ editor: VelcronPropertyEditor;
4
+ }
5
+ export interface BuiltInPropertyEditors {
6
+ text: unknown;
7
+ slider: unknown;
8
+ switch: unknown;
9
+ alignment: unknown;
10
+ color: unknown;
11
+ markdown: unknown;
12
+ icon: unknown;
13
+ image: unknown;
14
+ typography: unknown;
15
+ }
2
16
  export interface VelcronPropertyEditor<TSettings = any> {
3
17
  name?: string;
18
+ category?: string;
4
19
  type: BuiltInPropertyEditorType | string;
5
20
  settings?: TSettings;
6
- mapToStateProperty: string;
7
- dataType?: VelcronDataTypes;
21
+ stateMapping?: string;
22
+ propertyMapping?: string;
8
23
  component?: unknown;
9
24
  }
10
- export type BuiltInPropertyEditorType = "text" | "slider" | "switch" | "alignment" | "color" | "markdown" | "icon" | "image";
25
+ export type BuiltInPropertyEditorType = "text" | "slider" | "switch" | "alignment" | "color" | "markdown" | "icon" | "image" | "typography";
11
26
  export declare enum BuiltInPropertyEditorTypes {
12
27
  text = "text",
13
28
  slider = "slider",
@@ -16,7 +31,8 @@ export declare enum BuiltInPropertyEditorTypes {
16
31
  color = "color",
17
32
  markdown = "markdown",
18
33
  icon = "icon",
19
- image = "image"
34
+ image = "image",
35
+ typography = "typography"
20
36
  }
21
37
  export interface VelcronSliderPropertyEditorSettings {
22
38
  min: number;
@@ -29,6 +45,9 @@ export interface VelcronSliderPropertyEditor extends VelcronPropertyEditor<Velcr
29
45
  export interface VelcronTextPropertyEditor extends VelcronPropertyEditor<any> {
30
46
  type: "text";
31
47
  }
48
+ export interface VelcronTypographyPropertyEditor extends VelcronPropertyEditor<any> {
49
+ type: "typography";
50
+ }
32
51
  export interface VelcronSwitchPropertyEditor extends VelcronPropertyEditor<any> {
33
52
  type: "switch";
34
53
  }
@@ -11,4 +11,5 @@ var BuiltInPropertyEditorTypes;
11
11
  BuiltInPropertyEditorTypes["markdown"] = "markdown";
12
12
  BuiltInPropertyEditorTypes["icon"] = "icon";
13
13
  BuiltInPropertyEditorTypes["image"] = "image";
14
+ BuiltInPropertyEditorTypes["typography"] = "typography";
14
15
  })(BuiltInPropertyEditorTypes = exports.BuiltInPropertyEditorTypes || (exports.BuiltInPropertyEditorTypes = {}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/velcron",
3
3
  "license": "MIT",
4
- "version": "8.0.86-vnext",
4
+ "version": "8.0.88-vnext",
5
5
  "description": "Provide Omnia Velcron Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,9 @@
1
+ import { BuiltInPropertyEditors, ResolvedPropertyEditor } from "../models";
2
+ export declare class VelcronPropertyEditors {
3
+ private static editors;
4
+ static registerEditor(type: string, editor: any): void;
5
+ static hasEditors(): boolean;
6
+ static hasEditor(type: string): any;
7
+ static registerEditors(editors: BuiltInPropertyEditors): void;
8
+ static getEditor(editor: string): ResolvedPropertyEditor;
9
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VelcronPropertyEditors = void 0;
4
+ class VelcronPropertyEditors {
5
+ static registerEditor(type, editor) {
6
+ type = type.toLowerCase();
7
+ if (!this.editors[type]) {
8
+ this.editors[type] = editor;
9
+ }
10
+ else {
11
+ throw `Velcron Property Editor of type ${type} is already registered`;
12
+ }
13
+ }
14
+ static hasEditors() {
15
+ return Object.keys(this.editors).length > 0;
16
+ }
17
+ static hasEditor(type) {
18
+ type = type.toLowerCase();
19
+ return this.editors[type];
20
+ }
21
+ static registerEditors(editors) {
22
+ Object.keys(editors).forEach((key) => {
23
+ this.registerEditor(key, editors[key]);
24
+ });
25
+ }
26
+ static getEditor(editor) {
27
+ let result;
28
+ if (this.editors[editor.toLowerCase()]) {
29
+ result = {
30
+ editor: this.editors[editor.toLowerCase()],
31
+ };
32
+ }
33
+ else {
34
+ throw "Cant find property editor";
35
+ }
36
+ return result;
37
+ }
38
+ }
39
+ VelcronPropertyEditors.editors = {};
40
+ exports.VelcronPropertyEditors = VelcronPropertyEditors;
package/parser/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export * from "./VelcronStyles";
5
5
  export * from "./VelcronLogger";
6
6
  export * from "./VelcronRenderers";
7
7
  export * from "./TextValue";
8
+ export * from "./VelcronPropertyEditors";
package/parser/index.js CHANGED
@@ -8,3 +8,4 @@ tslib_1.__exportStar(require("./VelcronStyles"), exports);
8
8
  tslib_1.__exportStar(require("./VelcronLogger"), exports);
9
9
  tslib_1.__exportStar(require("./VelcronRenderers"), exports);
10
10
  tslib_1.__exportStar(require("./TextValue"), exports);
11
+ tslib_1.__exportStar(require("./VelcronPropertyEditors"), exports);