@omnia/velcron 8.0.87-vnext → 8.0.90-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/index.d.ts +1 -0
- package/index.js +1 -0
- package/models/VelcronPropertyEditorDefinitions.d.ts +35 -9
- package/models/VelcronPropertyEditorDefinitions.js +2 -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
- package/templatebuilder/editor/VelcronColorSchemaEditor.d.ts +9 -0
- package/templatebuilder/editor/VelcronColorSchemaEditor.js +28 -0
- package/templatebuilder/editor/VelcronContentEditor.d.ts +14 -0
- package/templatebuilder/editor/VelcronContentEditor.js +46 -0
- package/templatebuilder/editor/VelcronEditorBuilder.d.ts +13 -0
- package/templatebuilder/editor/VelcronEditorBuilder.js +40 -0
- package/templatebuilder/editor/VelcronEditorBuilderBase.d.ts +9 -0
- package/templatebuilder/editor/VelcronEditorBuilderBase.js +16 -0
- package/templatebuilder/editor/VelcronImageEditor.d.ts +11 -0
- package/templatebuilder/editor/VelcronImageEditor.js +30 -0
- package/templatebuilder/index.d.ts +1 -0
- package/templatebuilder/index.js +4 -0
- package/templatebuilder/state/VelcronColorSchemaBuilder.d.ts +11 -0
- package/templatebuilder/state/VelcronColorSchemaBuilder.js +20 -0
- package/templatebuilder/state/VelcronContentStateBuilder.d.ts +17 -0
- package/templatebuilder/state/VelcronContentStateBuilder.js +39 -0
- package/templatebuilder/state/VelcronImageStateBuilder.d.ts +20 -0
- package/templatebuilder/state/VelcronImageStateBuilder.js +43 -0
- package/templatebuilder/state/VelcronStateBuilder.d.ts +12 -0
- package/templatebuilder/state/VelcronStateBuilder.js +34 -0
- package/templatebuilder/state/VelcronStateBuilderBase.d.ts +8 -0
- package/templatebuilder/state/VelcronStateBuilderBase.js +15 -0
- package/templatebuilder/useVelcronTemplateBuilder.d.ts +6 -0
- package/templatebuilder/useVelcronTemplateBuilder.js +13 -0
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -7,3 +7,4 @@ tslib_1.__exportStar(require("./actions"), exports);
|
|
|
7
7
|
tslib_1.__exportStar(require("./stores"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("@omnia/velcron/internal-do-not-import-from-here/shared/models"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./rules"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./templatebuilder"), exports);
|
|
@@ -1,13 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VelcronImageRatios } from "@omnia/fx-models";
|
|
2
|
+
export interface ResolvedPropertyEditor {
|
|
3
|
+
editor: VelcronPropertyEditor;
|
|
4
|
+
}
|
|
2
5
|
export interface VelcronPropertyEditor<TSettings = any> {
|
|
3
6
|
name?: string;
|
|
7
|
+
category?: string;
|
|
4
8
|
type: BuiltInPropertyEditorType | string;
|
|
5
9
|
settings?: TSettings;
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
stateMapping?: string;
|
|
11
|
+
propertyMapping?: string;
|
|
8
12
|
component?: unknown;
|
|
9
13
|
}
|
|
10
|
-
export
|
|
14
|
+
export interface BuiltInPropertyEditors {
|
|
15
|
+
text: unknown;
|
|
16
|
+
slider: unknown;
|
|
17
|
+
switch: unknown;
|
|
18
|
+
alignment: unknown;
|
|
19
|
+
color: unknown;
|
|
20
|
+
markdown: unknown;
|
|
21
|
+
icon: unknown;
|
|
22
|
+
image: unknown;
|
|
23
|
+
typography: unknown;
|
|
24
|
+
"color-schema-type": unknown;
|
|
25
|
+
}
|
|
26
|
+
export type BuiltInPropertyEditorType = "text" | "slider" | "switch" | "alignment" | "color" | "markdown" | "icon" | "image" | "typography" | "color-schema-type";
|
|
11
27
|
export declare enum BuiltInPropertyEditorTypes {
|
|
12
28
|
text = "text",
|
|
13
29
|
slider = "slider",
|
|
@@ -16,7 +32,9 @@ export declare enum BuiltInPropertyEditorTypes {
|
|
|
16
32
|
color = "color",
|
|
17
33
|
markdown = "markdown",
|
|
18
34
|
icon = "icon",
|
|
19
|
-
image = "image"
|
|
35
|
+
image = "image",
|
|
36
|
+
typography = "typography",
|
|
37
|
+
"color-schema-type" = "color-schema-type"
|
|
20
38
|
}
|
|
21
39
|
export interface VelcronSliderPropertyEditorSettings {
|
|
22
40
|
min: number;
|
|
@@ -29,6 +47,9 @@ export interface VelcronSliderPropertyEditor extends VelcronPropertyEditor<Velcr
|
|
|
29
47
|
export interface VelcronTextPropertyEditor extends VelcronPropertyEditor<any> {
|
|
30
48
|
type: "text";
|
|
31
49
|
}
|
|
50
|
+
export interface VelcronTypographyPropertyEditor extends VelcronPropertyEditor<any> {
|
|
51
|
+
type: "typography";
|
|
52
|
+
}
|
|
32
53
|
export interface VelcronSwitchPropertyEditor extends VelcronPropertyEditor<any> {
|
|
33
54
|
type: "switch";
|
|
34
55
|
}
|
|
@@ -38,6 +59,9 @@ export interface VelcronAlignmentPropertyEditor extends VelcronPropertyEditor<an
|
|
|
38
59
|
export interface VelcronColorPropertyEditor extends VelcronPropertyEditor<any> {
|
|
39
60
|
type: "color";
|
|
40
61
|
}
|
|
62
|
+
export interface VelcronColorSchemaPropertyEditor extends VelcronPropertyEditor<any> {
|
|
63
|
+
type: "color-schema-type";
|
|
64
|
+
}
|
|
41
65
|
export interface VelcronIconPropertyEditor extends VelcronPropertyEditor<any> {
|
|
42
66
|
type: "icon";
|
|
43
67
|
}
|
|
@@ -48,10 +72,12 @@ export interface VelcronImagePropertyEditor extends VelcronPropertyEditor<any> {
|
|
|
48
72
|
type: "image";
|
|
49
73
|
}
|
|
50
74
|
export interface VelcronContentState {
|
|
51
|
-
|
|
52
|
-
|
|
75
|
+
content: {
|
|
76
|
+
caption?: string;
|
|
77
|
+
main?: string;
|
|
78
|
+
};
|
|
53
79
|
}
|
|
54
80
|
export interface VelcronImageState {
|
|
55
|
-
url
|
|
56
|
-
ratio
|
|
81
|
+
url?: string;
|
|
82
|
+
ratio?: VelcronImageRatios;
|
|
57
83
|
}
|
|
@@ -11,4 +11,6 @@ var BuiltInPropertyEditorTypes;
|
|
|
11
11
|
BuiltInPropertyEditorTypes["markdown"] = "markdown";
|
|
12
12
|
BuiltInPropertyEditorTypes["icon"] = "icon";
|
|
13
13
|
BuiltInPropertyEditorTypes["image"] = "image";
|
|
14
|
+
BuiltInPropertyEditorTypes["typography"] = "typography";
|
|
15
|
+
BuiltInPropertyEditorTypes["color-schema-type"] = "color-schema-type";
|
|
14
16
|
})(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);
|
|
@@ -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 VelcronColorSchemaEditorBuilder extends VelcronEditorBuilderBase {
|
|
5
|
+
private editor;
|
|
6
|
+
constructor(builder: any);
|
|
7
|
+
add(): VelcronEditorBuilder;
|
|
8
|
+
protected internalBuild(): VelcronPropertyEditor<any>[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VelcronColorSchemaEditorBuilder = void 0;
|
|
4
|
+
const VelcronEditorBuilderBase_1 = require("./VelcronEditorBuilderBase");
|
|
5
|
+
class VelcronColorSchemaEditorBuilder 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: "Color Schema",
|
|
14
|
+
type: "color-schema-type",
|
|
15
|
+
stateMapping: "colorSchemaType"
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return this.builder;
|
|
19
|
+
}
|
|
20
|
+
internalBuild() {
|
|
21
|
+
const result = [];
|
|
22
|
+
if (this.editor) {
|
|
23
|
+
result.push(this.editor);
|
|
24
|
+
}
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.VelcronColorSchemaEditorBuilder = VelcronColorSchemaEditorBuilder;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { VelcronPropertyEditor } from "@omnia/fx-models";
|
|
2
|
+
import { VelcronEditorBuilderBase } from "./VelcronEditorBuilderBase";
|
|
3
|
+
export declare class VelcronContentEditorBuilder extends VelcronEditorBuilderBase {
|
|
4
|
+
private mainEditor;
|
|
5
|
+
private captionEditor;
|
|
6
|
+
constructor(builder: any);
|
|
7
|
+
main: {
|
|
8
|
+
add: () => VelcronContentEditorBuilder;
|
|
9
|
+
};
|
|
10
|
+
caption: {
|
|
11
|
+
add: () => VelcronContentEditorBuilder;
|
|
12
|
+
};
|
|
13
|
+
protected internalBuild(): VelcronPropertyEditor<any>[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VelcronContentEditorBuilder = void 0;
|
|
4
|
+
const VelcronEditorBuilderBase_1 = require("./VelcronEditorBuilderBase");
|
|
5
|
+
class VelcronContentEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEditorBuilderBase {
|
|
6
|
+
constructor(builder) {
|
|
7
|
+
super(builder);
|
|
8
|
+
this.mainEditor = null;
|
|
9
|
+
this.captionEditor = null;
|
|
10
|
+
this.main = {
|
|
11
|
+
add: () => {
|
|
12
|
+
if (!this.mainEditor) {
|
|
13
|
+
this.mainEditor = {
|
|
14
|
+
name: "Body",
|
|
15
|
+
type: "markdown",
|
|
16
|
+
stateMapping: "content.main"
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
this.caption = {
|
|
23
|
+
add: () => {
|
|
24
|
+
if (!this.captionEditor) {
|
|
25
|
+
this.captionEditor = {
|
|
26
|
+
name: "Caption",
|
|
27
|
+
type: "text",
|
|
28
|
+
stateMapping: "content.caption"
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
internalBuild() {
|
|
36
|
+
const result = [];
|
|
37
|
+
if (this.mainEditor) {
|
|
38
|
+
result.push(this.mainEditor);
|
|
39
|
+
}
|
|
40
|
+
if (this.captionEditor) {
|
|
41
|
+
result.push(this.captionEditor);
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.VelcronContentEditorBuilder = VelcronContentEditorBuilder;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VelcronPropertyEditor } from "@omnia/fx-models";
|
|
2
|
+
import { VelcronContentEditorBuilder } from "./VelcronContentEditor";
|
|
3
|
+
import { VelcronColorSchemaEditorBuilder } from "./VelcronColorSchemaEditor";
|
|
4
|
+
import { VelcronImageEditorBuilder } from "./VelcronImageEditor";
|
|
5
|
+
export declare class VelcronEditorBuilder {
|
|
6
|
+
private contentEditorBuilder;
|
|
7
|
+
private colorSchemaEditorBuilder;
|
|
8
|
+
private imageEditorBuilder;
|
|
9
|
+
content(): VelcronContentEditorBuilder;
|
|
10
|
+
colorSchemaType(): VelcronColorSchemaEditorBuilder;
|
|
11
|
+
image(): VelcronImageEditorBuilder;
|
|
12
|
+
build(): VelcronPropertyEditor<any>[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VelcronEditorBuilder = void 0;
|
|
4
|
+
const VelcronContentEditor_1 = require("./VelcronContentEditor");
|
|
5
|
+
const VelcronColorSchemaEditor_1 = require("./VelcronColorSchemaEditor");
|
|
6
|
+
const VelcronImageEditor_1 = require("./VelcronImageEditor");
|
|
7
|
+
class VelcronEditorBuilder {
|
|
8
|
+
content() {
|
|
9
|
+
if (!this.contentEditorBuilder) {
|
|
10
|
+
this.contentEditorBuilder = new VelcronContentEditor_1.VelcronContentEditorBuilder(this);
|
|
11
|
+
}
|
|
12
|
+
return this.contentEditorBuilder;
|
|
13
|
+
}
|
|
14
|
+
colorSchemaType() {
|
|
15
|
+
if (!this.colorSchemaEditorBuilder) {
|
|
16
|
+
this.colorSchemaEditorBuilder = new VelcronColorSchemaEditor_1.VelcronColorSchemaEditorBuilder(this);
|
|
17
|
+
}
|
|
18
|
+
return this.colorSchemaEditorBuilder;
|
|
19
|
+
}
|
|
20
|
+
image() {
|
|
21
|
+
if (!this.imageEditorBuilder) {
|
|
22
|
+
this.imageEditorBuilder = new VelcronImageEditor_1.VelcronImageEditorBuilder(this);
|
|
23
|
+
}
|
|
24
|
+
return this.imageEditorBuilder;
|
|
25
|
+
}
|
|
26
|
+
build() {
|
|
27
|
+
const result = [];
|
|
28
|
+
if (this.colorSchemaEditorBuilder) {
|
|
29
|
+
result.push(...this.colorSchemaEditorBuilder.internalBuild());
|
|
30
|
+
}
|
|
31
|
+
if (this.contentEditorBuilder) {
|
|
32
|
+
result.push(...this.contentEditorBuilder.internalBuild());
|
|
33
|
+
}
|
|
34
|
+
if (this.imageEditorBuilder) {
|
|
35
|
+
result.push(...this.imageEditorBuilder.internalBuild());
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.VelcronEditorBuilder = VelcronEditorBuilder;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VelcronPropertyEditor } from "../../models";
|
|
2
|
+
import { VelcronEditorBuilder } from "./VelcronEditorBuilder";
|
|
3
|
+
export declare abstract class VelcronEditorBuilderBase {
|
|
4
|
+
protected builder: VelcronEditorBuilder;
|
|
5
|
+
constructor(builder: VelcronEditorBuilder);
|
|
6
|
+
done(): VelcronEditorBuilder;
|
|
7
|
+
build(): VelcronPropertyEditor<any>[];
|
|
8
|
+
protected abstract internalBuild(): Array<VelcronPropertyEditor>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VelcronEditorBuilderBase = void 0;
|
|
4
|
+
class VelcronEditorBuilderBase {
|
|
5
|
+
constructor(builder) {
|
|
6
|
+
this.builder = null;
|
|
7
|
+
this.builder = builder;
|
|
8
|
+
}
|
|
9
|
+
done() {
|
|
10
|
+
return this.builder;
|
|
11
|
+
}
|
|
12
|
+
build() {
|
|
13
|
+
return this.builder.build();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.VelcronEditorBuilderBase = VelcronEditorBuilderBase;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VelcronPropertyEditor } from "@omnia/fx-models";
|
|
2
|
+
import { VelcronEditorBuilder } from "./VelcronEditorBuilder";
|
|
3
|
+
import { VelcronEditorBuilderBase } from "./VelcronEditorBuilderBase";
|
|
4
|
+
export declare class VelcronImageEditorBuilder extends VelcronEditorBuilderBase {
|
|
5
|
+
private mainEditor;
|
|
6
|
+
constructor(builder: any);
|
|
7
|
+
main: {
|
|
8
|
+
add: () => VelcronEditorBuilder;
|
|
9
|
+
};
|
|
10
|
+
protected internalBuild(): VelcronPropertyEditor<any>[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VelcronImageEditorBuilder = void 0;
|
|
4
|
+
const VelcronEditorBuilderBase_1 = require("./VelcronEditorBuilderBase");
|
|
5
|
+
class VelcronImageEditorBuilder extends VelcronEditorBuilderBase_1.VelcronEditorBuilderBase {
|
|
6
|
+
constructor(builder) {
|
|
7
|
+
super(builder);
|
|
8
|
+
this.mainEditor = null;
|
|
9
|
+
this.main = {
|
|
10
|
+
add: () => {
|
|
11
|
+
if (!this.mainEditor) {
|
|
12
|
+
this.mainEditor = {
|
|
13
|
+
name: "Select Main Image",
|
|
14
|
+
type: "image",
|
|
15
|
+
stateMapping: "main-image"
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return this.builder;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
internalBuild() {
|
|
23
|
+
const result = [];
|
|
24
|
+
if (this.mainEditor) {
|
|
25
|
+
result.push(this.mainEditor);
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.VelcronImageEditorBuilder = VelcronImageEditorBuilder;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./useVelcronTemplateBuilder";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ColorSchemaType } from "@omnia/fx-models";
|
|
2
|
+
import { VelcronStateBuilderBase } from "./VelcronStateBuilderBase";
|
|
3
|
+
export declare class VelcronColorSchemaStateBuilder extends VelcronStateBuilderBase {
|
|
4
|
+
private colorSchema;
|
|
5
|
+
constructor(stateBuilder: any);
|
|
6
|
+
add(colorSchema?: ColorSchemaType): VelcronColorSchemaStateBuilder;
|
|
7
|
+
bind: string;
|
|
8
|
+
protected internalBuild(): {
|
|
9
|
+
colorSchemaType: ColorSchemaType;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VelcronColorSchemaStateBuilder = void 0;
|
|
4
|
+
const VelcronStateBuilderBase_1 = require("./VelcronStateBuilderBase");
|
|
5
|
+
class VelcronColorSchemaStateBuilder extends VelcronStateBuilderBase_1.VelcronStateBuilderBase {
|
|
6
|
+
constructor(stateBuilder) {
|
|
7
|
+
super(stateBuilder);
|
|
8
|
+
this.bind = "${colorSchemaType}";
|
|
9
|
+
}
|
|
10
|
+
add(colorSchema) {
|
|
11
|
+
this.colorSchema = colorSchema;
|
|
12
|
+
return this;
|
|
13
|
+
}
|
|
14
|
+
internalBuild() {
|
|
15
|
+
return {
|
|
16
|
+
colorSchemaType: this.colorSchema
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.VelcronColorSchemaStateBuilder = VelcronColorSchemaStateBuilder;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VelcronStateBuilderBase } from "./VelcronStateBuilderBase";
|
|
2
|
+
export declare class VelcronContentStateBuilder extends VelcronStateBuilderBase {
|
|
3
|
+
private mainContent;
|
|
4
|
+
private captionContent;
|
|
5
|
+
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
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VelcronContentStateBuilder = void 0;
|
|
4
|
+
const VelcronStateBuilderBase_1 = require("./VelcronStateBuilderBase");
|
|
5
|
+
class VelcronContentStateBuilder extends VelcronStateBuilderBase_1.VelcronStateBuilderBase {
|
|
6
|
+
constructor(stateBuilder) {
|
|
7
|
+
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
|
+
};
|
|
22
|
+
}
|
|
23
|
+
internalBuild() {
|
|
24
|
+
const resultValue = {};
|
|
25
|
+
let hasContent = false;
|
|
26
|
+
if (this.mainContent) {
|
|
27
|
+
resultValue["main"] = this.mainContent;
|
|
28
|
+
hasContent = true;
|
|
29
|
+
}
|
|
30
|
+
if (this.captionContent) {
|
|
31
|
+
resultValue["caption"] = this.captionContent;
|
|
32
|
+
hasContent = true;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
content: resultValue
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.VelcronContentStateBuilder = VelcronContentStateBuilder;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { VelcronImageRatios } from "../../models";
|
|
2
|
+
import { VelcronStateBuilderBase } from "./VelcronStateBuilderBase";
|
|
3
|
+
export declare class VelcronImageStateBuilder extends VelcronStateBuilderBase {
|
|
4
|
+
private mainImageUrl;
|
|
5
|
+
private mainImageRatio;
|
|
6
|
+
constructor(stateBuilder: any);
|
|
7
|
+
main: {
|
|
8
|
+
url: {
|
|
9
|
+
add: (url: string) => VelcronImageStateBuilder;
|
|
10
|
+
bind: string;
|
|
11
|
+
};
|
|
12
|
+
ratio: {
|
|
13
|
+
add: (ratio: VelcronImageRatios) => VelcronImageStateBuilder;
|
|
14
|
+
bind: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
protected internalBuild(): {
|
|
18
|
+
"main-image": {};
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VelcronImageStateBuilder = void 0;
|
|
4
|
+
const VelcronStateBuilderBase_1 = require("./VelcronStateBuilderBase");
|
|
5
|
+
class VelcronImageStateBuilder extends VelcronStateBuilderBase_1.VelcronStateBuilderBase {
|
|
6
|
+
constructor(stateBuilder) {
|
|
7
|
+
super(stateBuilder);
|
|
8
|
+
this.main = {
|
|
9
|
+
url: {
|
|
10
|
+
add: (url) => {
|
|
11
|
+
this.mainImageUrl = url;
|
|
12
|
+
return this;
|
|
13
|
+
},
|
|
14
|
+
bind: "${main-image.url}"
|
|
15
|
+
},
|
|
16
|
+
ratio: {
|
|
17
|
+
add: (ratio) => {
|
|
18
|
+
this.mainImageRatio = ratio;
|
|
19
|
+
return this;
|
|
20
|
+
},
|
|
21
|
+
bind: "${main-image.ratio}"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
internalBuild() {
|
|
26
|
+
if (!this.mainImageUrl) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const resultValue = {};
|
|
30
|
+
if (this.mainImageRatio) {
|
|
31
|
+
resultValue["ratio"] = this.mainImageRatio;
|
|
32
|
+
}
|
|
33
|
+
if (this.mainImageUrl) {
|
|
34
|
+
resultValue["url"] = this.mainImageUrl;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
"main-image": {
|
|
38
|
+
...resultValue
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.VelcronImageStateBuilder = VelcronImageStateBuilder;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VelcronColorSchemaStateBuilder } from "./VelcronColorSchemaBuilder";
|
|
2
|
+
import { VelcronContentStateBuilder } from "./VelcronContentStateBuilder";
|
|
3
|
+
import { VelcronImageStateBuilder } from "./VelcronImageStateBuilder";
|
|
4
|
+
export declare class VelcronStateBuilder {
|
|
5
|
+
private contentStateBuilder;
|
|
6
|
+
private imageStateBuilder;
|
|
7
|
+
private colorSchemaStateBuilder;
|
|
8
|
+
content(): VelcronContentStateBuilder;
|
|
9
|
+
image(): VelcronImageStateBuilder;
|
|
10
|
+
colorSchemaType(): VelcronColorSchemaStateBuilder;
|
|
11
|
+
build(): any;
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VelcronStateBuilder = void 0;
|
|
4
|
+
const VelcronColorSchemaBuilder_1 = require("./VelcronColorSchemaBuilder");
|
|
5
|
+
const VelcronContentStateBuilder_1 = require("./VelcronContentStateBuilder");
|
|
6
|
+
const VelcronImageStateBuilder_1 = require("./VelcronImageStateBuilder");
|
|
7
|
+
class VelcronStateBuilder {
|
|
8
|
+
content() {
|
|
9
|
+
if (!this.contentStateBuilder) {
|
|
10
|
+
this.contentStateBuilder = new VelcronContentStateBuilder_1.VelcronContentStateBuilder(this);
|
|
11
|
+
}
|
|
12
|
+
return this.contentStateBuilder;
|
|
13
|
+
}
|
|
14
|
+
image() {
|
|
15
|
+
if (!this.imageStateBuilder) {
|
|
16
|
+
this.imageStateBuilder = new VelcronImageStateBuilder_1.VelcronImageStateBuilder(this);
|
|
17
|
+
}
|
|
18
|
+
return this.imageStateBuilder;
|
|
19
|
+
}
|
|
20
|
+
colorSchemaType() {
|
|
21
|
+
if (!this.colorSchemaStateBuilder) {
|
|
22
|
+
this.colorSchemaStateBuilder = new VelcronColorSchemaBuilder_1.VelcronColorSchemaStateBuilder(this);
|
|
23
|
+
}
|
|
24
|
+
return this.colorSchemaStateBuilder;
|
|
25
|
+
}
|
|
26
|
+
build() {
|
|
27
|
+
return {
|
|
28
|
+
...this?.contentStateBuilder?.internalBuild(),
|
|
29
|
+
...this?.imageStateBuilder?.internalBuild(),
|
|
30
|
+
...this?.colorSchemaStateBuilder?.internalBuild(),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.VelcronStateBuilder = VelcronStateBuilder;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { VelcronStateBuilder } from "./VelcronStateBuilder";
|
|
2
|
+
export declare abstract class VelcronStateBuilderBase {
|
|
3
|
+
protected stateBuilder: VelcronStateBuilder;
|
|
4
|
+
constructor(stateBulder: VelcronStateBuilder);
|
|
5
|
+
done(): VelcronStateBuilder;
|
|
6
|
+
build(): any;
|
|
7
|
+
protected abstract internalBuild(): any;
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VelcronStateBuilderBase = void 0;
|
|
4
|
+
class VelcronStateBuilderBase {
|
|
5
|
+
constructor(stateBulder) {
|
|
6
|
+
this.stateBuilder = stateBulder;
|
|
7
|
+
}
|
|
8
|
+
done() {
|
|
9
|
+
return this.stateBuilder;
|
|
10
|
+
}
|
|
11
|
+
build() {
|
|
12
|
+
return this.stateBuilder.build();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.VelcronStateBuilderBase = VelcronStateBuilderBase;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import { VelcronContentState, VelcronImagePropertyEditor, VelcronImageRatios, VelcronImageState, VelcronMarkdownPropertyEditor, VelcronTextPropertyEditor} from "@omnia/fx-models";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useVelcronTemplateBuilder = void 0;
|
|
5
|
+
const VelcronEditorBuilder_1 = require("./editor/VelcronEditorBuilder");
|
|
6
|
+
const VelcronStateBuilder_1 = require("./state/VelcronStateBuilder");
|
|
7
|
+
function useVelcronTemplateBuilder() {
|
|
8
|
+
return {
|
|
9
|
+
state: new VelcronStateBuilder_1.VelcronStateBuilder(),
|
|
10
|
+
editor: new VelcronEditorBuilder_1.VelcronEditorBuilder()
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
exports.useVelcronTemplateBuilder = useVelcronTemplateBuilder;
|