@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.
- package/models/VelcronPropertyEditorDefinitions.d.ts +24 -5
- package/models/VelcronPropertyEditorDefinitions.js +1 -0
- package/package.json +1 -1
- package/parser/VelcronPropertyEditors.d.ts +9 -0
- package/parser/VelcronPropertyEditors.js +40 -0
- package/parser/index.d.ts +1 -0
- package/parser/index.js +1 -0
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
7
|
-
|
|
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
|
@@ -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
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);
|