@omnia/velcron 8.0.293-dev → 8.0.295-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.
- package/actions/Array.js +3 -3
- package/actions/Debounce.js +2 -2
- package/actions/Delay.js +2 -2
- package/actions/Http.js +1 -1
- package/actions/MsGraph.js +2 -2
- package/actions/MsSharePoint.js +2 -2
- package/internal-do-not-import-from-here/shared/models/theming/Blueprints.d.ts +10 -6
- package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.d.ts +3 -1
- package/internal-do-not-import-from-here/shared/models/theming/ThemingBase.d.ts +14 -0
- package/internal-do-not-import-from-here/shared/models/theming/ThemingBase.js +12 -0
- package/internal-do-not-import-from-here/shared/models/theming/ThemingDefinitionV3.d.ts +44 -0
- package/internal-do-not-import-from-here/shared/models/theming/ThemingDefinitionV3.js +6 -0
- package/internal-do-not-import-from-here/shared/models/theming/Typography.d.ts +28 -2
- package/internal-do-not-import-from-here/shared/models/theming/Typography.js +6 -1
- package/internal-do-not-import-from-here/shared/models/theming/index.d.ts +2 -0
- package/internal-do-not-import-from-here/shared/models/theming/index.js +2 -0
- package/models/VelcronDefinitions.d.ts +34 -2
- package/models/VelcronTypes.d.ts +7 -0
- package/package.json +1 -1
- package/parser/VelcronActions.d.ts +0 -2
- package/parser/VelcronActions.js +1 -27
- package/parser/VelcronData.d.ts +2 -1
- package/parser/VelcronData.js +165 -56
- package/parser/VelcronDataBinder.d.ts +13 -0
- package/parser/VelcronDataBinder.js +154 -0
- package/parser/VelcronRenderers.js +1 -1
- package/parser/VelcronStyles.d.ts +1 -1
- package/parser/VelcronStyles.js +165 -174
- package/parser/index.d.ts +1 -0
- package/parser/index.js +1 -0
- package/stores/VelcronTheming.d.ts +4 -4
- package/stores/VelcronTheming.js +2 -2
package/actions/Array.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.arrayTake = exports.arrayAppend = void 0;
|
|
4
|
-
const
|
|
4
|
+
const parser_1 = require("../parser");
|
|
5
5
|
const ActionResults_1 = require("./ActionResults");
|
|
6
6
|
exports.arrayAppend = {
|
|
7
7
|
name: "@array.append",
|
|
8
8
|
action: (action, arrayToAppend) => {
|
|
9
9
|
const path = action.path.replace("=", "").trim();
|
|
10
|
-
const existingArray =
|
|
10
|
+
const existingArray = parser_1.VelcronData.getOrSet(action, path);
|
|
11
11
|
if (!Array.isArray(existingArray)) {
|
|
12
12
|
const arr = existingArray;
|
|
13
13
|
arr.push(...arr);
|
|
@@ -21,7 +21,7 @@ exports.arrayAppend = {
|
|
|
21
21
|
exports.arrayTake = {
|
|
22
22
|
name: "@array.take",
|
|
23
23
|
action: (action, arr, takeTemplate) => {
|
|
24
|
-
takeTemplate =
|
|
24
|
+
takeTemplate = parser_1.VelcronDataBinder.bind(action, takeTemplate);
|
|
25
25
|
const take = parseInt(takeTemplate);
|
|
26
26
|
arr = arr.slice(0, take);
|
|
27
27
|
action.promise.resolve(arr);
|
package/actions/Debounce.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.debounce = void 0;
|
|
4
|
-
const VelcronData_1 = require("../parser/VelcronData");
|
|
5
4
|
const ActionResults_1 = require("./ActionResults");
|
|
5
|
+
const parser_1 = require("../parser");
|
|
6
6
|
const debounces = {};
|
|
7
7
|
exports.debounce = {
|
|
8
8
|
name: "@debounce",
|
|
9
9
|
action: (action, value) => {
|
|
10
10
|
//TODO Try catch
|
|
11
|
-
value =
|
|
11
|
+
value = parser_1.VelcronDataBinder.bind(action, value);
|
|
12
12
|
const bounceDelayTime = parseInt(value);
|
|
13
13
|
if (!debounces[action.id]) {
|
|
14
14
|
debounces[action.id] = debounceInternal(() => { action.promise.resolve(null); }, bounceDelayTime);
|
package/actions/Delay.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.delay = void 0;
|
|
4
|
-
const
|
|
4
|
+
const parser_1 = require("../parser");
|
|
5
5
|
exports.delay = {
|
|
6
6
|
name: "@delay",
|
|
7
7
|
action: (action, value) => {
|
|
8
|
-
value =
|
|
8
|
+
value = parser_1.VelcronDataBinder.bind(action, value);
|
|
9
9
|
const delayTime = parseInt(value);
|
|
10
10
|
setTimeout(action.promise.resolve.bind(null, null), delayTime);
|
|
11
11
|
// return new Promise(function (resolve) {
|
package/actions/Http.js
CHANGED
|
@@ -5,7 +5,7 @@ const parser_1 = require("../parser");
|
|
|
5
5
|
exports.httpGet = {
|
|
6
6
|
name: "@http.get",
|
|
7
7
|
action: (action, incomingUrl) => {
|
|
8
|
-
incomingUrl = parser_1.
|
|
8
|
+
incomingUrl = parser_1.VelcronDataBinder.bind(action, incomingUrl);
|
|
9
9
|
let requestInitLocal = { "method": "GET" };
|
|
10
10
|
const hookResult = parser_1.VelcronActions.tryTriggerBeforeActionHook("http.get", { url: incomingUrl, requestInit: requestInitLocal });
|
|
11
11
|
incomingUrl = hookResult?.url ?? incomingUrl;
|
package/actions/MsGraph.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.msGraphGet = void 0;
|
|
4
|
-
const
|
|
4
|
+
const parser_1 = require("../parser");
|
|
5
5
|
exports.msGraphGet = {
|
|
6
6
|
name: "@msgraph.get",
|
|
7
7
|
action: async (action, value) => {
|
|
8
8
|
//TODO Make it typed!
|
|
9
9
|
const client = await window.omniaScriptApi.m365.graphClient;
|
|
10
|
-
value =
|
|
10
|
+
value = parser_1.VelcronDataBinder.bind(action, value);
|
|
11
11
|
const res = await client.get(value);
|
|
12
12
|
action.promise.resolve(res.data);
|
|
13
13
|
}
|
package/actions/MsSharePoint.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.msSp = void 0;
|
|
4
|
-
const
|
|
4
|
+
const parser_1 = require("../parser");
|
|
5
5
|
//TODO This should be pluggable from sharepoint package
|
|
6
6
|
exports.msSp = {
|
|
7
7
|
name: "@mssp.get",
|
|
8
8
|
action: async (action, value) => {
|
|
9
9
|
//TODO Make it typed!
|
|
10
10
|
const client = await window.omniaScriptApi.spfx.sharepointClient;
|
|
11
|
-
value =
|
|
11
|
+
value = parser_1.VelcronDataBinder.bind(action, value);
|
|
12
12
|
const res = await client.get(value);
|
|
13
13
|
action.promise.resolve(res.data);
|
|
14
14
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { BackgroundDefinition, BlueprintsReference, ColorSchemaType, ColorValue, FillDefinitionValue } from "./ThemeDefinitionV2";
|
|
2
2
|
import { SpacingDefinition, Spacing } from "./Spacing";
|
|
3
3
|
import { TypographyFontDefinition, TypographyValue } from "./Typography";
|
|
4
|
+
import { TypographyBlueprint } from "./Typography";
|
|
5
|
+
import { ThemingBase } from "./ThemingBase";
|
|
6
|
+
import { VelcronAppDefinition, VelcronRendererResolverReference } from "../velcron";
|
|
7
|
+
import { guid } from "../Guid";
|
|
4
8
|
export interface BoxDimensions extends Spacing {
|
|
5
9
|
}
|
|
6
|
-
import { TypographyBlueprint } from "./Typography";
|
|
7
|
-
import { guid, VelcronAppDefinition, VelcronRendererResolverReference } from "@omnia/fx-models";
|
|
8
10
|
export interface Blueprints {
|
|
9
11
|
name?: string;
|
|
10
12
|
}
|
|
@@ -26,13 +28,13 @@ export interface ContainerBlueprint extends Blueprints, BlueprintsReference {
|
|
|
26
28
|
name?: string;
|
|
27
29
|
background?: BackgroundDefinition;
|
|
28
30
|
}
|
|
29
|
-
export interface TypographyBlueprints extends
|
|
31
|
+
export interface TypographyBlueprints extends ThemingBase {
|
|
30
32
|
primary: TypographyBlueprint;
|
|
31
33
|
}
|
|
32
34
|
export interface IFontBlueprints extends Blueprints, BlueprintsReference {
|
|
33
35
|
fonts: Array<TypographyFontDefinition>;
|
|
34
36
|
}
|
|
35
|
-
export interface SpacingBlueprints extends
|
|
37
|
+
export interface SpacingBlueprints extends ThemingBase {
|
|
36
38
|
primary: SpacingBlueprint;
|
|
37
39
|
}
|
|
38
40
|
export interface ChromeBlueprint {
|
|
@@ -47,7 +49,7 @@ export interface ChromeBlueprint {
|
|
|
47
49
|
spacing?: Spacing;
|
|
48
50
|
};
|
|
49
51
|
}
|
|
50
|
-
export interface ComponentBlueprints extends
|
|
52
|
+
export interface ComponentBlueprints extends ThemingBase {
|
|
51
53
|
buttons?: ButtonBlueprints;
|
|
52
54
|
tabs?: TabsBlueprints;
|
|
53
55
|
blocks?: ChromeBlueprints;
|
|
@@ -81,7 +83,7 @@ export interface IconBlueprints extends Blueprints {
|
|
|
81
83
|
l?: IconBlueprint;
|
|
82
84
|
xl?: IconBlueprint;
|
|
83
85
|
}
|
|
84
|
-
export type ButtonTypes = "primary" | "basic" | "accent1" | "warn" | "link" | "variant1" | "variant2" | "variant3" | "variant4";
|
|
86
|
+
export type ButtonTypes = "primary" | "basic" | "accent1" | "warn" | "link" | "close" | "variant1" | "variant2" | "variant3" | "variant4";
|
|
85
87
|
export type ButtonBlueprintType = "text" | "icon";
|
|
86
88
|
export interface ButtonBlueprintVariant {
|
|
87
89
|
type: ButtonTypes;
|
|
@@ -102,6 +104,7 @@ export interface ButtonBlueprints extends Blueprints {
|
|
|
102
104
|
accent1?: ButtonBlueprint;
|
|
103
105
|
warn?: ButtonBlueprint;
|
|
104
106
|
link?: ButtonBlueprint;
|
|
107
|
+
close?: ButtonBlueprint;
|
|
105
108
|
variant1?: ButtonBlueprint;
|
|
106
109
|
variant2?: ButtonBlueprint;
|
|
107
110
|
variant3?: ButtonBlueprint;
|
|
@@ -113,6 +116,7 @@ export interface ButtonBlueprints extends Blueprints {
|
|
|
113
116
|
accent1?: ButtonBlueprint;
|
|
114
117
|
warn?: ButtonBlueprint;
|
|
115
118
|
link?: ButtonBlueprint;
|
|
119
|
+
close?: ButtonBlueprint;
|
|
116
120
|
variant1?: ButtonBlueprint;
|
|
117
121
|
variant2?: ButtonBlueprint;
|
|
118
122
|
variant3?: ButtonBlueprint;
|
|
@@ -70,12 +70,14 @@ export interface ThemeDefinitionReference {
|
|
|
70
70
|
components: BlueprintsReference;
|
|
71
71
|
}
|
|
72
72
|
export interface ThemeDefinitionV2 extends ThemeDefinitionReference {
|
|
73
|
+
id: guid;
|
|
74
|
+
name?: string;
|
|
73
75
|
colors: ColorSchemas;
|
|
74
76
|
typography: TypographyBlueprints;
|
|
75
77
|
spacing: SpacingBlueprints;
|
|
76
78
|
components: ComponentBlueprints;
|
|
77
79
|
}
|
|
78
|
-
export interface
|
|
80
|
+
export interface ThemeSelection {
|
|
79
81
|
adminThemeId?: guid;
|
|
80
82
|
defaultThemeId?: guid;
|
|
81
83
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { guid } from "../Guid";
|
|
2
|
+
export interface ThemingBase {
|
|
3
|
+
id: guid;
|
|
4
|
+
type?: ThemingTypes;
|
|
5
|
+
name?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare enum ThemingTypes {
|
|
8
|
+
Theme = 0,
|
|
9
|
+
ColorSchema = 1,
|
|
10
|
+
Typography = 2,
|
|
11
|
+
Spacing = 3,
|
|
12
|
+
Blueprints = 4,
|
|
13
|
+
Fonts = 5
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThemingTypes = void 0;
|
|
4
|
+
var ThemingTypes;
|
|
5
|
+
(function (ThemingTypes) {
|
|
6
|
+
ThemingTypes[ThemingTypes["Theme"] = 0] = "Theme";
|
|
7
|
+
ThemingTypes[ThemingTypes["ColorSchema"] = 1] = "ColorSchema";
|
|
8
|
+
ThemingTypes[ThemingTypes["Typography"] = 2] = "Typography";
|
|
9
|
+
ThemingTypes[ThemingTypes["Spacing"] = 3] = "Spacing";
|
|
10
|
+
ThemingTypes[ThemingTypes["Blueprints"] = 4] = "Blueprints";
|
|
11
|
+
ThemingTypes[ThemingTypes["Fonts"] = 5] = "Fonts";
|
|
12
|
+
})(ThemingTypes || (exports.ThemingTypes = ThemingTypes = {}));
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { guid } from "../Guid";
|
|
2
|
+
import { Id } from "../Id";
|
|
3
|
+
import { ComponentBlueprints, SpacingBlueprints, TypographyBlueprints } from "./Blueprints";
|
|
4
|
+
import { ColorDefinition, ColorSchemas } from "./ThemeDefinitionV2";
|
|
5
|
+
import { ThemingBase } from "./ThemingBase";
|
|
6
|
+
export type ColorSchemaId = Id<guid, "ColorSchemaId">;
|
|
7
|
+
export declare function ColorSchemaId(id: guid): ColorSchemaId;
|
|
8
|
+
export type ThemeDefinitionId = Id<guid, "ThemeDefinitionId">;
|
|
9
|
+
export declare function ThemeDefinitionId(id: guid): ThemeDefinitionId;
|
|
10
|
+
export interface ColorSchemasReferenceV2 {
|
|
11
|
+
primaryId: ColorSchemaId;
|
|
12
|
+
secondaryId: ColorSchemaId;
|
|
13
|
+
accent1Id: ColorSchemaId;
|
|
14
|
+
accent2Id: ColorSchemaId;
|
|
15
|
+
accent3Id: ColorSchemaId;
|
|
16
|
+
accent4Id: ColorSchemaId;
|
|
17
|
+
accent5Id: ColorSchemaId;
|
|
18
|
+
neutralId: ColorSchemaId;
|
|
19
|
+
backgroundId: ColorSchemaId;
|
|
20
|
+
errorId: ColorSchemaId;
|
|
21
|
+
infoId: ColorSchemaId;
|
|
22
|
+
warningId: ColorSchemaId;
|
|
23
|
+
successId: ColorSchemaId;
|
|
24
|
+
notificationId: ColorSchemaId;
|
|
25
|
+
}
|
|
26
|
+
export interface ThemeDefinitionV3 extends ThemingBase {
|
|
27
|
+
name?: string;
|
|
28
|
+
colors?: ColorSchemasReferenceV2;
|
|
29
|
+
typographyId?: ThemeDefinitionId;
|
|
30
|
+
spacingId?: ThemeDefinitionId;
|
|
31
|
+
componentsId?: ThemeDefinitionId;
|
|
32
|
+
}
|
|
33
|
+
export interface ColorSchemaV3 extends ThemingBase {
|
|
34
|
+
base: ColorDefinition;
|
|
35
|
+
onBase: ColorDefinition;
|
|
36
|
+
container: ColorDefinition;
|
|
37
|
+
onContainer: ColorDefinition;
|
|
38
|
+
}
|
|
39
|
+
export interface ResolvedThemeDefinition extends ThemingBase {
|
|
40
|
+
colors?: ColorSchemas;
|
|
41
|
+
typography?: TypographyBlueprints;
|
|
42
|
+
spacing?: SpacingBlueprints;
|
|
43
|
+
components?: ComponentBlueprints;
|
|
44
|
+
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { guid } from "../Guid";
|
|
2
2
|
import { FillDefinition } from "./ThemeDefinitionV2";
|
|
3
|
+
import { ThemingBase } from "./ThemingBase";
|
|
4
|
+
export interface TypographyFontDefinitionV2 extends ThemingBase {
|
|
5
|
+
family: string;
|
|
6
|
+
cdn?: string;
|
|
7
|
+
manifestId?: guid;
|
|
8
|
+
}
|
|
3
9
|
export interface TypographyBlueprint {
|
|
4
10
|
name: string;
|
|
5
11
|
font?: TypographyFontRef;
|
|
@@ -17,6 +23,7 @@ export interface TypographyBlueprint {
|
|
|
17
23
|
font?: TypographyFontRef;
|
|
18
24
|
};
|
|
19
25
|
text: {
|
|
26
|
+
xl?: TypographyDefinition;
|
|
20
27
|
l: TypographyDefinition;
|
|
21
28
|
m: TypographyDefinition;
|
|
22
29
|
s: TypographyDefinition;
|
|
@@ -24,12 +31,26 @@ export interface TypographyBlueprint {
|
|
|
24
31
|
font?: TypographyFontRef;
|
|
25
32
|
};
|
|
26
33
|
navigation: {
|
|
34
|
+
xl?: TypographyDefinition;
|
|
27
35
|
l: TypographyDefinition;
|
|
28
36
|
m: TypographyDefinition;
|
|
37
|
+
s?: TypographyDefinition;
|
|
38
|
+
xs?: TypographyDefinition;
|
|
29
39
|
font?: TypographyFontRef;
|
|
30
40
|
};
|
|
31
41
|
link: {
|
|
42
|
+
xl?: TypographyDefinition;
|
|
43
|
+
l?: TypographyDefinition;
|
|
32
44
|
m: TypographyDefinition;
|
|
45
|
+
s?: TypographyDefinition;
|
|
46
|
+
xs?: TypographyDefinition;
|
|
47
|
+
font?: TypographyFontRef;
|
|
48
|
+
};
|
|
49
|
+
variants?: {
|
|
50
|
+
variant1?: TypographyDefinition;
|
|
51
|
+
variant2?: TypographyDefinition;
|
|
52
|
+
variant3?: TypographyDefinition;
|
|
53
|
+
variant4?: TypographyDefinition;
|
|
33
54
|
font?: TypographyFontRef;
|
|
34
55
|
};
|
|
35
56
|
}
|
|
@@ -61,7 +82,8 @@ export type TypographyType = keyof typeof TypographyTypes;
|
|
|
61
82
|
export declare enum TypographyTypes {
|
|
62
83
|
title = "title",
|
|
63
84
|
text = "text",
|
|
64
|
-
navigation = "navigation"
|
|
85
|
+
navigation = "navigation",
|
|
86
|
+
variants = "variants"
|
|
65
87
|
}
|
|
66
88
|
export interface ThemedTypographyValue {
|
|
67
89
|
type: TypographyType;
|
|
@@ -74,7 +96,11 @@ export declare enum TypographySizes {
|
|
|
74
96
|
l = "l",
|
|
75
97
|
m = "m",
|
|
76
98
|
s = "s",
|
|
77
|
-
xs = "xs"
|
|
99
|
+
xs = "xs",
|
|
100
|
+
variant1 = "variant1",
|
|
101
|
+
variant2 = "variant2",
|
|
102
|
+
variant3 = "variant3",
|
|
103
|
+
variant4 = "variant4"
|
|
78
104
|
}
|
|
79
105
|
/**this reflect TypographySizes for member check*/
|
|
80
106
|
export declare const AvailableTypographySizes: string[];
|
|
@@ -6,6 +6,7 @@ var TypographyTypes;
|
|
|
6
6
|
TypographyTypes["title"] = "title";
|
|
7
7
|
TypographyTypes["text"] = "text";
|
|
8
8
|
TypographyTypes["navigation"] = "navigation";
|
|
9
|
+
TypographyTypes["variants"] = "variants";
|
|
9
10
|
})(TypographyTypes || (exports.TypographyTypes = TypographyTypes = {}));
|
|
10
11
|
var TypographySizes;
|
|
11
12
|
(function (TypographySizes) {
|
|
@@ -14,6 +15,10 @@ var TypographySizes;
|
|
|
14
15
|
TypographySizes["m"] = "m";
|
|
15
16
|
TypographySizes["s"] = "s";
|
|
16
17
|
TypographySizes["xs"] = "xs";
|
|
18
|
+
TypographySizes["variant1"] = "variant1";
|
|
19
|
+
TypographySizes["variant2"] = "variant2";
|
|
20
|
+
TypographySizes["variant3"] = "variant3";
|
|
21
|
+
TypographySizes["variant4"] = "variant4";
|
|
17
22
|
})(TypographySizes || (exports.TypographySizes = TypographySizes = {}));
|
|
18
23
|
/**this reflect TypographySizes for member check*/
|
|
19
|
-
exports.AvailableTypographySizes = ["xl", "l", "m", "s", "xs"];
|
|
24
|
+
exports.AvailableTypographySizes = ["xl", "l", "m", "s", "xs", "variant1", "variant2", "variant3", "variant4"];
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./ThemingBase"), exports);
|
|
4
5
|
tslib_1.__exportStar(require("./ThemeDefinitionV2"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./ThemingDefinitionV3"), exports);
|
|
5
7
|
tslib_1.__exportStar(require("./Typography"), exports);
|
|
6
8
|
//export * from "./OmniaThemes";
|
|
7
9
|
tslib_1.__exportStar(require("./UseThemeMethods"), exports);
|
|
@@ -4,6 +4,7 @@ import { AssignOperators, VelcronHorizontalAlignments, VelcronIconTypes, Velcron
|
|
|
4
4
|
import { DynamicState, VelcronDefinition, VelcronEffects, useVelcronThemingStore } from "..";
|
|
5
5
|
import { guid, PropertyConfiguration, PropertyValue, PropertyDefinition, PropertySetupBase } from "@omnia/fx/models";
|
|
6
6
|
import { useVelcronColorSchemaStore } from "../stores/VelcronColorSchema";
|
|
7
|
+
import { Properties } from "csstype";
|
|
7
8
|
export interface ResolvedComponentRenderer {
|
|
8
9
|
component: unknown;
|
|
9
10
|
definition: VelcronDefinition;
|
|
@@ -33,8 +34,6 @@ export interface BuiltInComponentRenderers {
|
|
|
33
34
|
"checkbox": unknown;
|
|
34
35
|
"reference": unknown;
|
|
35
36
|
"radio": unknown;
|
|
36
|
-
"rive": unknown;
|
|
37
|
-
"lottie": unknown;
|
|
38
37
|
"slide-panel": unknown;
|
|
39
38
|
"editor": unknown;
|
|
40
39
|
"link": unknown;
|
|
@@ -50,10 +49,32 @@ export interface OnItemRenderedHookResult {
|
|
|
50
49
|
export interface VelcronDisplay {
|
|
51
50
|
size: VelcronDisplaySizes;
|
|
52
51
|
}
|
|
52
|
+
export type VelcronDisplaySizeOptions = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
53
53
|
export interface VelcronDisplaySizes {
|
|
54
|
+
current: VelcronDisplaySizeOptions;
|
|
55
|
+
xs: boolean;
|
|
54
56
|
sm: boolean;
|
|
55
57
|
md: boolean;
|
|
56
58
|
lg: boolean;
|
|
59
|
+
xl: boolean;
|
|
60
|
+
xxl: boolean;
|
|
61
|
+
smAndDown: boolean;
|
|
62
|
+
smAndUp: boolean;
|
|
63
|
+
mdAndDown: boolean;
|
|
64
|
+
mdAndUp: boolean;
|
|
65
|
+
lgAndDown: boolean;
|
|
66
|
+
lgAndUp: boolean;
|
|
67
|
+
xlAndDown: boolean;
|
|
68
|
+
xlAndUp: boolean;
|
|
69
|
+
breakpoints: {
|
|
70
|
+
xs: number;
|
|
71
|
+
sm: number;
|
|
72
|
+
md: number;
|
|
73
|
+
lg: number;
|
|
74
|
+
xl: number;
|
|
75
|
+
xxl: number;
|
|
76
|
+
};
|
|
77
|
+
setSize(sizeName: VelcronDisplaySizeOptions): any;
|
|
57
78
|
}
|
|
58
79
|
export interface VelcronRenderContext {
|
|
59
80
|
id?: string;
|
|
@@ -236,6 +257,7 @@ export interface VelcronTextDefinition extends VelcronDefinition, VelcronColorSt
|
|
|
236
257
|
lineClamp?: VelcronBindableProp<number>;
|
|
237
258
|
noWrap?: VelcronBindableProp<boolean>;
|
|
238
259
|
wordBreak?: VelcronBindableProp<"none">;
|
|
260
|
+
align?: VelcronHorizontalAlignments;
|
|
239
261
|
events?: VelcronOnPressEvent & VelcronOnUpdatedEvent;
|
|
240
262
|
blueprint?: VelcronBindableProp<TextBlueprint>;
|
|
241
263
|
}
|
|
@@ -327,6 +349,14 @@ export interface VelcronSlidePanelSlidesOptions {
|
|
|
327
349
|
foreach: string;
|
|
328
350
|
definition: VelcronDefinition;
|
|
329
351
|
}
|
|
352
|
+
export interface VelcronSlidePanelStyles {
|
|
353
|
+
container?: Properties;
|
|
354
|
+
wrapper?: Properties;
|
|
355
|
+
slides?: Properties;
|
|
356
|
+
previousSlide?: Properties;
|
|
357
|
+
nextSlide?: Properties;
|
|
358
|
+
activeSlide?: Properties;
|
|
359
|
+
}
|
|
330
360
|
export interface VelcronSlidePanelDefinition extends VelcronDefinition {
|
|
331
361
|
type: "slide-panel";
|
|
332
362
|
slidesPerView?: VelcronBindableProp<number>;
|
|
@@ -335,10 +365,12 @@ export interface VelcronSlidePanelDefinition extends VelcronDefinition {
|
|
|
335
365
|
navigation?: VelcronBindableProp<boolean>;
|
|
336
366
|
scrollbar?: VelcronBindableProp<boolean>;
|
|
337
367
|
autoplay?: VelcronBindableProp<boolean>;
|
|
368
|
+
centeredSlides?: VelcronBindableProp<boolean>;
|
|
338
369
|
loop?: VelcronBindableProp<boolean>;
|
|
339
370
|
style?: VelcronCardStyling;
|
|
340
371
|
events?: VelcronOnPressEvent;
|
|
341
372
|
slides?: VelcronSlidePanelSlidesOptions;
|
|
373
|
+
styles?: VelcronSlidePanelStyles;
|
|
342
374
|
}
|
|
343
375
|
export interface VelcronEditorRendererDefinition extends VelcronDefinition {
|
|
344
376
|
type: "editor";
|
package/models/VelcronTypes.d.ts
CHANGED
|
@@ -3,3 +3,10 @@ export type VelcronPrimitiveType = string | number | boolean;
|
|
|
3
3
|
export type VelcronArrayType<T> = Array<T>;
|
|
4
4
|
export type VelcronObjectType<T extends Object> = T;
|
|
5
5
|
export type VelcronComponentArrayType = Array<VelcronDefinition>;
|
|
6
|
+
export type VelcronSwitchExpression = {
|
|
7
|
+
switch: string;
|
|
8
|
+
cases: {
|
|
9
|
+
[key: string]: string;
|
|
10
|
+
};
|
|
11
|
+
default?: string;
|
|
12
|
+
};
|
package/package.json
CHANGED
|
@@ -23,8 +23,6 @@ export declare class VelcronActions {
|
|
|
23
23
|
static valueIsAction(value: string): boolean;
|
|
24
24
|
static executeActions(arr: any, x: any, customActionContext?: VelcronCustomActionExecutionContext): void;
|
|
25
25
|
static executeAction(awAction: VelcronActionWithAutoAwait, callback: (continueExecution: boolean) => void): void;
|
|
26
|
-
static dataBindComputed(renderContext: VelcronRenderContext, template: string): string;
|
|
27
|
-
static parseAndExecuteComputed(renderContext: VelcronRenderContext, template: string): string;
|
|
28
26
|
static registerActionHook<TBefore, TAfter>(actionName: string, handler: VelcronActionHooks<TBefore, TAfter>): void;
|
|
29
27
|
static tryTriggerBeforeActionHook<T>(actionName: string, args: T): T;
|
|
30
28
|
static tryTriggerAfterActionHook<T>(actionName: string, args: T): T;
|
package/parser/VelcronActions.js
CHANGED
|
@@ -379,32 +379,6 @@ class VelcronActions {
|
|
|
379
379
|
callback(true);
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
static dataBindComputed(renderContext, template) {
|
|
383
|
-
if (typeof template === typeof undefined || template === null) {
|
|
384
|
-
return;
|
|
385
|
-
}
|
|
386
|
-
let text = VelcronActions.parseAndExecuteComputed(renderContext, template);
|
|
387
|
-
text = VelcronData_1.VelcronData.dataBind(renderContext, text);
|
|
388
|
-
return text;
|
|
389
|
-
}
|
|
390
|
-
static parseAndExecuteComputed(renderContext, template) {
|
|
391
|
-
VelcronData_1.VelcronData.getTokens(template, false).forEach(token => {
|
|
392
|
-
const paramValues = [];
|
|
393
|
-
VelcronActions.parseFunction(renderContext.computed, token, renderContext, paramValues, (acName, params) => {
|
|
394
|
-
const funcContent = renderContext.computed[acName];
|
|
395
|
-
Object.keys(params).forEach((key) => {
|
|
396
|
-
params[key] = "currentCtx";
|
|
397
|
-
});
|
|
398
|
-
const toReplace = VelcronConstants_1.VelcronConstants.properties.tokenStart + token + VelcronConstants_1.VelcronConstants.properties.tokenEnd;
|
|
399
|
-
funcContent.forEach((c) => {
|
|
400
|
-
//const toEval = `return ${c}`;
|
|
401
|
-
const result = VelcronData_1.VelcronData.evauluateJs(c, renderContext, params);
|
|
402
|
-
template = template.replace(toReplace, result);
|
|
403
|
-
});
|
|
404
|
-
});
|
|
405
|
-
});
|
|
406
|
-
return template;
|
|
407
|
-
}
|
|
408
382
|
static registerActionHook(actionName, handler) {
|
|
409
383
|
VelcronActions.actionHooks ??= {};
|
|
410
384
|
VelcronActions.actionHooks[actionName] = handler;
|
|
@@ -462,7 +436,7 @@ class VelcronActions {
|
|
|
462
436
|
template = template.substring(1);
|
|
463
437
|
if (template.indexOf("'") > -1) {
|
|
464
438
|
const subVal = template.substring(0, template.indexOf("'"));
|
|
465
|
-
params.push({ dataType: 0, value: VelcronData_1.VelcronData.
|
|
439
|
+
params.push({ dataType: 0, value: VelcronData_1.VelcronData.bindInternal(action, subVal) });
|
|
466
440
|
template = template.substring(subVal.length + 2);
|
|
467
441
|
}
|
|
468
442
|
else {
|
package/parser/VelcronData.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ export interface ParseResult<T> {
|
|
|
5
5
|
value: T;
|
|
6
6
|
}
|
|
7
7
|
export declare class VelcronData {
|
|
8
|
-
static
|
|
8
|
+
static bindInternal: (<T = string>(renderContext: VelcronRenderContext, bindTo: VelcronBindableProp<any>) => T) | null;
|
|
9
|
+
static getContextTokenValue<T>(renderContext: VelcronRenderContext, token: string): T | undefined;
|
|
9
10
|
static isBindable<T = string>(bindable: VelcronBindableProp<T>): boolean;
|
|
10
11
|
static getBindPath(text: string, removeStateToken?: boolean): string;
|
|
11
12
|
static addCtxToVariableNames(template: string, skipIfNameStartsWith?: string, skipIfNameMatches?: Array<string>, overridePrefixWhenNameMatches?: {
|