@omnia/velcron 6.100.8-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/README.md +6 -0
- package/actions/ActionResults.d.ts +4 -0
- package/actions/ActionResults.js +14 -0
- package/actions/Alert.d.ts +2 -0
- package/actions/Alert.js +12 -0
- package/actions/Array.d.ts +3 -0
- package/actions/Array.js +22 -0
- package/actions/Debounce.d.ts +2 -0
- package/actions/Debounce.js +43 -0
- package/actions/Delay.d.ts +2 -0
- package/actions/Delay.js +14 -0
- package/actions/Emit.d.ts +2 -0
- package/actions/Emit.js +25 -0
- package/actions/Http.d.ts +2 -0
- package/actions/Http.js +32 -0
- package/actions/IActionHandler.d.ts +5 -0
- package/actions/IActionHandler.js +2 -0
- package/actions/Log.d.ts +2 -0
- package/actions/Log.js +10 -0
- package/actions/MsGraph.d.ts +2 -0
- package/actions/MsGraph.js +16 -0
- package/actions/MsSharePoint.d.ts +2 -0
- package/actions/MsSharePoint.js +17 -0
- package/actions/index.d.ts +11 -0
- package/actions/index.js +14 -0
- package/index.d.ts +6 -0
- package/index.js +9 -0
- package/internal-do-not-import-from-here/shared/models/Bring.d.ts +23 -0
- package/internal-do-not-import-from-here/shared/models/Bring.js +2 -0
- package/internal-do-not-import-from-here/shared/models/Broadcasting.d.ts +25 -0
- package/internal-do-not-import-from-here/shared/models/Broadcasting.js +12 -0
- package/internal-do-not-import-from-here/shared/models/Future.d.ts +44 -0
- package/internal-do-not-import-from-here/shared/models/Future.js +122 -0
- package/internal-do-not-import-from-here/shared/models/Guid.d.ts +17 -0
- package/internal-do-not-import-from-here/shared/models/Guid.js +51 -0
- package/internal-do-not-import-from-here/shared/models/OmniaSharedBootstrapData.d.ts +32 -0
- package/internal-do-not-import-from-here/shared/models/OmniaSharedBootstrapData.js +2 -0
- package/internal-do-not-import-from-here/shared/models/Realtime.d.ts +40 -0
- package/internal-do-not-import-from-here/shared/models/Realtime.js +40 -0
- package/internal-do-not-import-from-here/shared/models/SharedConstants.d.ts +5 -0
- package/internal-do-not-import-from-here/shared/models/SharedConstants.js +9 -0
- package/internal-do-not-import-from-here/shared/models/StringExtensions.d.ts +6 -0
- package/internal-do-not-import-from-here/shared/models/StringExtensions.js +3 -0
- package/internal-do-not-import-from-here/shared/models/Tenant.d.ts +4 -0
- package/internal-do-not-import-from-here/shared/models/Tenant.js +2 -0
- package/internal-do-not-import-from-here/shared/models/Tokens.d.ts +14 -0
- package/internal-do-not-import-from-here/shared/models/Tokens.js +2 -0
- package/internal-do-not-import-from-here/shared/models/Topic.d.ts +10 -0
- package/internal-do-not-import-from-here/shared/models/Topic.js +2 -0
- package/internal-do-not-import-from-here/shared/models/WorkerProxyFuncs.d.ts +8 -0
- package/internal-do-not-import-from-here/shared/models/WorkerProxyFuncs.js +14 -0
- package/internal-do-not-import-from-here/shared/models/Workers.d.ts +29 -0
- package/internal-do-not-import-from-here/shared/models/Workers.js +8 -0
- package/internal-do-not-import-from-here/shared/models/index.d.ts +14 -0
- package/internal-do-not-import-from-here/shared/models/index.js +18 -0
- package/internal-do-not-import-from-here/shared/models/theming/BlueprintDefinition.d.ts +27 -0
- package/internal-do-not-import-from-here/shared/models/theming/BlueprintDefinition.js +2 -0
- package/internal-do-not-import-from-here/shared/models/theming/OmniaThemes.d.ts +5 -0
- package/internal-do-not-import-from-here/shared/models/theming/OmniaThemes.js +18 -0
- package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.d.ts +61 -0
- package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.js +24 -0
- package/internal-do-not-import-from-here/shared/models/theming/ThemeMethods.d.ts +11 -0
- package/internal-do-not-import-from-here/shared/models/theming/ThemeMethods.js +143 -0
- package/internal-do-not-import-from-here/shared/models/theming/TypographyDefinition.d.ts +29 -0
- package/internal-do-not-import-from-here/shared/models/theming/TypographyDefinition.js +11 -0
- package/internal-do-not-import-from-here/shared/models/theming/index.d.ts +4 -0
- package/internal-do-not-import-from-here/shared/models/theming/index.js +7 -0
- package/models/ActionHooks.d.ts +12 -0
- package/models/ActionHooks.js +2 -0
- package/models/Enums.d.ts +53 -0
- package/models/Enums.js +65 -0
- package/models/VelcronDefinitions.d.ts +265 -0
- package/models/VelcronDefinitions.js +8 -0
- package/models/VelcronDescriptors.d.ts +35 -0
- package/models/VelcronDescriptors.js +2 -0
- package/models/VelcronEvents.d.ts +16 -0
- package/models/VelcronEvents.js +2 -0
- package/models/VelcronTypes.d.ts +10 -0
- package/models/VelcronTypes.js +2 -0
- package/models/VelcronUnitProvider.d.ts +5 -0
- package/models/VelcronUnitProvider.js +2 -0
- package/models/ViewModelAndContext.d.ts +4 -0
- package/models/ViewModelAndContext.js +2 -0
- package/models/index.d.ts +8 -0
- package/models/index.js +11 -0
- package/package.json +27 -0
- package/parser/TextValue.d.ts +4 -0
- package/parser/TextValue.js +9 -0
- package/parser/VelcronActions.d.ts +42 -0
- package/parser/VelcronActions.js +460 -0
- package/parser/VelcronConstants.d.ts +30 -0
- package/parser/VelcronConstants.js +33 -0
- package/parser/VelcronData.d.ts +39 -0
- package/parser/VelcronData.js +634 -0
- package/parser/VelcronLogger.d.ts +6 -0
- package/parser/VelcronLogger.js +18 -0
- package/parser/VelcronRenderers.d.ts +41 -0
- package/parser/VelcronRenderers.js +125 -0
- package/parser/VelcronStyles.d.ts +12 -0
- package/parser/VelcronStyles.js +159 -0
- package/parser/index.d.ts +7 -0
- package/parser/index.js +10 -0
- package/stores/ReactivitySystem.d.ts +5 -0
- package/stores/ReactivitySystem.js +12 -0
- package/stores/VelcronStore.d.ts +12 -0
- package/stores/VelcronStore.js +23 -0
- package/stores/VelcronTheming.d.ts +19 -0
- package/stores/VelcronTheming.js +49 -0
- package/stores/index.d.ts +3 -0
- package/stores/index.js +6 -0
- package/utilities/ColorUtility.d.ts +1 -0
- package/utilities/ColorUtility.js +45 -0
- package/utilities/index.d.ts +1 -0
- package/utilities/index.js +4 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useThemeMethods = void 0;
|
|
4
|
+
const ThemeDefinitionV2_1 = require("./ThemeDefinitionV2");
|
|
5
|
+
const TypographyDefinition_1 = require("./TypographyDefinition");
|
|
6
|
+
const useThemeMethods = (themedefinition) => {
|
|
7
|
+
const colorSchema = (colorSchemaType) => {
|
|
8
|
+
if (colorSchemaType === ThemeDefinitionV2_1.ColorSchemaTypes.primary) {
|
|
9
|
+
return themedefinition.primary;
|
|
10
|
+
}
|
|
11
|
+
else if (colorSchemaType === ThemeDefinitionV2_1.ColorSchemaTypes.secondary) {
|
|
12
|
+
return themedefinition.secondary;
|
|
13
|
+
}
|
|
14
|
+
else if (colorSchemaType === ThemeDefinitionV2_1.ColorSchemaTypes.accent1) {
|
|
15
|
+
return themedefinition.accent1;
|
|
16
|
+
}
|
|
17
|
+
else if (colorSchemaType === ThemeDefinitionV2_1.ColorSchemaTypes.accent2) {
|
|
18
|
+
return themedefinition.accent2;
|
|
19
|
+
}
|
|
20
|
+
else if (colorSchemaType === ThemeDefinitionV2_1.ColorSchemaTypes.accent3) {
|
|
21
|
+
return themedefinition.accent3;
|
|
22
|
+
}
|
|
23
|
+
else if (colorSchemaType === ThemeDefinitionV2_1.ColorSchemaTypes.background) {
|
|
24
|
+
return themedefinition.background;
|
|
25
|
+
}
|
|
26
|
+
else if (colorSchemaType === ThemeDefinitionV2_1.ColorSchemaTypes.neutral) {
|
|
27
|
+
return themedefinition.neutral;
|
|
28
|
+
}
|
|
29
|
+
else if (colorSchemaType === ThemeDefinitionV2_1.ColorSchemaTypes.error) {
|
|
30
|
+
return themedefinition.error;
|
|
31
|
+
}
|
|
32
|
+
return themedefinition.background;
|
|
33
|
+
};
|
|
34
|
+
const typography = (typographyType) => {
|
|
35
|
+
if (typographyType === TypographyDefinition_1.TypographyTypes.h1) {
|
|
36
|
+
return themedefinition.typography.h1;
|
|
37
|
+
}
|
|
38
|
+
else if (typographyType === TypographyDefinition_1.TypographyTypes.h2) {
|
|
39
|
+
return themedefinition.typography.h2;
|
|
40
|
+
}
|
|
41
|
+
else if (typographyType === TypographyDefinition_1.TypographyTypes.h3) {
|
|
42
|
+
return themedefinition.typography.h3;
|
|
43
|
+
}
|
|
44
|
+
else if (typographyType === TypographyDefinition_1.TypographyTypes.caption) {
|
|
45
|
+
return themedefinition.typography.caption;
|
|
46
|
+
}
|
|
47
|
+
else if (typographyType === TypographyDefinition_1.TypographyTypes.link) {
|
|
48
|
+
return themedefinition.typography.link;
|
|
49
|
+
}
|
|
50
|
+
else if (typographyType === TypographyDefinition_1.TypographyTypes.text) {
|
|
51
|
+
return themedefinition.typography.text;
|
|
52
|
+
}
|
|
53
|
+
return themedefinition.typography.text;
|
|
54
|
+
};
|
|
55
|
+
const color = (colorSchemaType, colorType) => {
|
|
56
|
+
const mappedColorSchema = colorSchema(colorSchemaType);
|
|
57
|
+
if (colorType === ThemeDefinitionV2_1.ColorTypes.base) {
|
|
58
|
+
return mappedColorSchema.base.color;
|
|
59
|
+
}
|
|
60
|
+
else if (colorType === ThemeDefinitionV2_1.ColorTypes.baseTone) {
|
|
61
|
+
return mappedColorSchema.base.colorToned;
|
|
62
|
+
}
|
|
63
|
+
else if (colorType === ThemeDefinitionV2_1.ColorTypes.onBase) {
|
|
64
|
+
return mappedColorSchema.onBase.color;
|
|
65
|
+
}
|
|
66
|
+
else if (colorType === ThemeDefinitionV2_1.ColorTypes.onBaseTone) {
|
|
67
|
+
return mappedColorSchema.onBase.colorToned;
|
|
68
|
+
}
|
|
69
|
+
else if (colorType === ThemeDefinitionV2_1.ColorTypes.container) {
|
|
70
|
+
return mappedColorSchema.container.color;
|
|
71
|
+
}
|
|
72
|
+
else if (colorType === ThemeDefinitionV2_1.ColorTypes.containerTone) {
|
|
73
|
+
return mappedColorSchema.container.colorToned;
|
|
74
|
+
}
|
|
75
|
+
else if (colorType === ThemeDefinitionV2_1.ColorTypes.onContainer) {
|
|
76
|
+
return mappedColorSchema.onContainer.color;
|
|
77
|
+
}
|
|
78
|
+
else if (colorType === ThemeDefinitionV2_1.ColorTypes.onContainerTone) {
|
|
79
|
+
return mappedColorSchema.onContainer.colorToned;
|
|
80
|
+
}
|
|
81
|
+
return colorType;
|
|
82
|
+
};
|
|
83
|
+
const colorDefinition = (colorSchemaType, colorType) => {
|
|
84
|
+
const mappedColorSchema = colorSchema(colorSchemaType);
|
|
85
|
+
if (colorType === ThemeDefinitionV2_1.ColorTypes.base
|
|
86
|
+
|| colorType === ThemeDefinitionV2_1.ColorTypes.baseTone) {
|
|
87
|
+
return mappedColorSchema.base;
|
|
88
|
+
}
|
|
89
|
+
else if (colorType === ThemeDefinitionV2_1.ColorTypes.onBase
|
|
90
|
+
||
|
|
91
|
+
colorType === ThemeDefinitionV2_1.ColorTypes.onBaseTone) {
|
|
92
|
+
return mappedColorSchema.onBase;
|
|
93
|
+
}
|
|
94
|
+
else if (colorType === ThemeDefinitionV2_1.ColorTypes.container
|
|
95
|
+
||
|
|
96
|
+
colorType === ThemeDefinitionV2_1.ColorTypes.containerTone) {
|
|
97
|
+
return mappedColorSchema.container;
|
|
98
|
+
}
|
|
99
|
+
else if (colorType === ThemeDefinitionV2_1.ColorTypes.onContainer
|
|
100
|
+
||
|
|
101
|
+
colorType === ThemeDefinitionV2_1.ColorTypes.onContainerTone) {
|
|
102
|
+
return mappedColorSchema.onContainer;
|
|
103
|
+
}
|
|
104
|
+
return mappedColorSchema.base;
|
|
105
|
+
};
|
|
106
|
+
const complementaryColorType = (colorType) => {
|
|
107
|
+
if (colorType === ThemeDefinitionV2_1.ColorTypes.base
|
|
108
|
+
|| colorType === ThemeDefinitionV2_1.ColorTypes.baseTone) {
|
|
109
|
+
return ThemeDefinitionV2_1.ColorTypes.onBase;
|
|
110
|
+
}
|
|
111
|
+
else if (colorType === ThemeDefinitionV2_1.ColorTypes.onBase
|
|
112
|
+
|| colorType === ThemeDefinitionV2_1.ColorTypes.onBaseTone) {
|
|
113
|
+
return ThemeDefinitionV2_1.ColorTypes.base;
|
|
114
|
+
}
|
|
115
|
+
else if (colorType === ThemeDefinitionV2_1.ColorTypes.container
|
|
116
|
+
|| colorType === ThemeDefinitionV2_1.ColorTypes.containerTone) {
|
|
117
|
+
return ThemeDefinitionV2_1.ColorTypes.onContainer;
|
|
118
|
+
}
|
|
119
|
+
else if (colorType === ThemeDefinitionV2_1.ColorTypes.onContainer
|
|
120
|
+
|| colorType === ThemeDefinitionV2_1.ColorTypes.onContainerTone) {
|
|
121
|
+
return ThemeDefinitionV2_1.ColorTypes.container;
|
|
122
|
+
}
|
|
123
|
+
return colorType;
|
|
124
|
+
};
|
|
125
|
+
const complementaryColor = (colorSchemaType, colorType) => {
|
|
126
|
+
const matchingColorType = complementaryColorType(colorType);
|
|
127
|
+
return color(colorSchemaType, matchingColorType);
|
|
128
|
+
};
|
|
129
|
+
const complementaryColorDefinition = (colorSchemaType, colorType) => {
|
|
130
|
+
const matchingColorType = complementaryColorType(colorType);
|
|
131
|
+
return colorDefinition(colorSchemaType, matchingColorType);
|
|
132
|
+
};
|
|
133
|
+
return {
|
|
134
|
+
colorSchema,
|
|
135
|
+
typography,
|
|
136
|
+
color,
|
|
137
|
+
colorDefinition,
|
|
138
|
+
complementaryColorType,
|
|
139
|
+
complementaryColor,
|
|
140
|
+
complementaryColorDefinition
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
exports.useThemeMethods = useThemeMethods;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Guid } from "../Guid";
|
|
2
|
+
export interface TypographyDefinition {
|
|
3
|
+
id: Guid;
|
|
4
|
+
h1: TypographyType;
|
|
5
|
+
h2: TypographyType;
|
|
6
|
+
h3: TypographyType;
|
|
7
|
+
text: TypographyType;
|
|
8
|
+
caption: TypographyType;
|
|
9
|
+
link: TypographyType;
|
|
10
|
+
}
|
|
11
|
+
export interface TypographyType {
|
|
12
|
+
decoration?: string;
|
|
13
|
+
large: TypographyTypeBreakPoint;
|
|
14
|
+
medium?: TypographyTypeBreakPoint;
|
|
15
|
+
small?: TypographyTypeBreakPoint;
|
|
16
|
+
}
|
|
17
|
+
export interface TypographyTypeBreakPoint {
|
|
18
|
+
weight: number;
|
|
19
|
+
size: number;
|
|
20
|
+
lineHeight: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const TypographyTypes: {
|
|
23
|
+
h1: string;
|
|
24
|
+
h2: string;
|
|
25
|
+
h3: string;
|
|
26
|
+
text: string;
|
|
27
|
+
caption: string;
|
|
28
|
+
link: string;
|
|
29
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./ThemeDefinitionV2"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./TypographyDefinition"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./OmniaThemes"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./ThemeMethods"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface VelcronActionHooks<TBefore = any, TAfter = any> {
|
|
2
|
+
beforeHandler?: (args: TBefore) => TBefore;
|
|
3
|
+
afterHandler?: (args: TBefore) => TAfter;
|
|
4
|
+
}
|
|
5
|
+
export interface HttpGetBeforeActionHookArgs {
|
|
6
|
+
url: string;
|
|
7
|
+
requestInit: RequestInit;
|
|
8
|
+
}
|
|
9
|
+
export interface HttpGetAfterActionHookArgs {
|
|
10
|
+
json: string;
|
|
11
|
+
response: Response;
|
|
12
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare enum AssignOperators {
|
|
2
|
+
equals = "=",
|
|
3
|
+
plusEquals = "+=",
|
|
4
|
+
equalsPlus = "=+",
|
|
5
|
+
equalsQuestion = "=?",
|
|
6
|
+
plusPlus = "++",
|
|
7
|
+
minusMinus = "--",
|
|
8
|
+
equalsExclamation = "=!"
|
|
9
|
+
}
|
|
10
|
+
export declare enum VelcronActionTypes {
|
|
11
|
+
getOrSetValue = 0,
|
|
12
|
+
promise = 1,
|
|
13
|
+
condition = 2,
|
|
14
|
+
returnsValue = 3
|
|
15
|
+
}
|
|
16
|
+
export declare enum VelcronIconTypes {
|
|
17
|
+
fontAwesome = "fa"
|
|
18
|
+
}
|
|
19
|
+
export declare enum VelcronHorizontalAlignments {
|
|
20
|
+
left = "left",
|
|
21
|
+
center = "center",
|
|
22
|
+
right = "right"
|
|
23
|
+
}
|
|
24
|
+
export declare enum VerticalAlignments {
|
|
25
|
+
top = "top",
|
|
26
|
+
center = "center",
|
|
27
|
+
bottom = "bottom"
|
|
28
|
+
}
|
|
29
|
+
export declare enum VelcronDescriptorTypes {
|
|
30
|
+
component = 0,
|
|
31
|
+
subComponent = 1,
|
|
32
|
+
appData = 2,
|
|
33
|
+
dataMember = 3
|
|
34
|
+
}
|
|
35
|
+
export declare enum VelcronComponentPropertyEditors {
|
|
36
|
+
text = 0,
|
|
37
|
+
colorSchemaPicker = 1,
|
|
38
|
+
slider = 2,
|
|
39
|
+
colorPicker = 3,
|
|
40
|
+
typographyPicker = 4,
|
|
41
|
+
ratioPicker = 5,
|
|
42
|
+
booleanPicker = 6
|
|
43
|
+
}
|
|
44
|
+
export declare enum VelcronDataTypes {
|
|
45
|
+
unknown = "unknown",
|
|
46
|
+
object = "object",
|
|
47
|
+
text = "text",
|
|
48
|
+
number = "number",
|
|
49
|
+
boolean = "boolean",
|
|
50
|
+
array = "array",
|
|
51
|
+
componentArray = "componentArray",
|
|
52
|
+
bind = "bind"
|
|
53
|
+
}
|
package/models/Enums.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VelcronDataTypes = exports.VelcronComponentPropertyEditors = exports.VelcronDescriptorTypes = exports.VerticalAlignments = exports.VelcronHorizontalAlignments = exports.VelcronIconTypes = exports.VelcronActionTypes = exports.AssignOperators = void 0;
|
|
4
|
+
var AssignOperators;
|
|
5
|
+
(function (AssignOperators) {
|
|
6
|
+
AssignOperators["equals"] = "=";
|
|
7
|
+
AssignOperators["plusEquals"] = "+=";
|
|
8
|
+
AssignOperators["equalsPlus"] = "=+";
|
|
9
|
+
AssignOperators["equalsQuestion"] = "=?";
|
|
10
|
+
AssignOperators["plusPlus"] = "++";
|
|
11
|
+
AssignOperators["minusMinus"] = "--";
|
|
12
|
+
AssignOperators["equalsExclamation"] = "=!";
|
|
13
|
+
})(AssignOperators = exports.AssignOperators || (exports.AssignOperators = {}));
|
|
14
|
+
var VelcronActionTypes;
|
|
15
|
+
(function (VelcronActionTypes) {
|
|
16
|
+
VelcronActionTypes[VelcronActionTypes["getOrSetValue"] = 0] = "getOrSetValue";
|
|
17
|
+
VelcronActionTypes[VelcronActionTypes["promise"] = 1] = "promise";
|
|
18
|
+
VelcronActionTypes[VelcronActionTypes["condition"] = 2] = "condition";
|
|
19
|
+
VelcronActionTypes[VelcronActionTypes["returnsValue"] = 3] = "returnsValue";
|
|
20
|
+
})(VelcronActionTypes = exports.VelcronActionTypes || (exports.VelcronActionTypes = {}));
|
|
21
|
+
var VelcronIconTypes;
|
|
22
|
+
(function (VelcronIconTypes) {
|
|
23
|
+
VelcronIconTypes["fontAwesome"] = "fa";
|
|
24
|
+
})(VelcronIconTypes = exports.VelcronIconTypes || (exports.VelcronIconTypes = {}));
|
|
25
|
+
var VelcronHorizontalAlignments;
|
|
26
|
+
(function (VelcronHorizontalAlignments) {
|
|
27
|
+
VelcronHorizontalAlignments["left"] = "left";
|
|
28
|
+
VelcronHorizontalAlignments["center"] = "center";
|
|
29
|
+
VelcronHorizontalAlignments["right"] = "right";
|
|
30
|
+
})(VelcronHorizontalAlignments = exports.VelcronHorizontalAlignments || (exports.VelcronHorizontalAlignments = {}));
|
|
31
|
+
var VerticalAlignments;
|
|
32
|
+
(function (VerticalAlignments) {
|
|
33
|
+
VerticalAlignments["top"] = "top";
|
|
34
|
+
VerticalAlignments["center"] = "center";
|
|
35
|
+
VerticalAlignments["bottom"] = "bottom";
|
|
36
|
+
})(VerticalAlignments = exports.VerticalAlignments || (exports.VerticalAlignments = {}));
|
|
37
|
+
var VelcronDescriptorTypes;
|
|
38
|
+
(function (VelcronDescriptorTypes) {
|
|
39
|
+
VelcronDescriptorTypes[VelcronDescriptorTypes["component"] = 0] = "component";
|
|
40
|
+
VelcronDescriptorTypes[VelcronDescriptorTypes["subComponent"] = 1] = "subComponent";
|
|
41
|
+
VelcronDescriptorTypes[VelcronDescriptorTypes["appData"] = 2] = "appData";
|
|
42
|
+
VelcronDescriptorTypes[VelcronDescriptorTypes["dataMember"] = 3] = "dataMember";
|
|
43
|
+
})(VelcronDescriptorTypes = exports.VelcronDescriptorTypes || (exports.VelcronDescriptorTypes = {}));
|
|
44
|
+
var VelcronComponentPropertyEditors;
|
|
45
|
+
(function (VelcronComponentPropertyEditors) {
|
|
46
|
+
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["text"] = 0] = "text";
|
|
47
|
+
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["colorSchemaPicker"] = 1] = "colorSchemaPicker";
|
|
48
|
+
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["slider"] = 2] = "slider";
|
|
49
|
+
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["colorPicker"] = 3] = "colorPicker";
|
|
50
|
+
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["typographyPicker"] = 4] = "typographyPicker";
|
|
51
|
+
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["ratioPicker"] = 5] = "ratioPicker";
|
|
52
|
+
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["booleanPicker"] = 6] = "booleanPicker";
|
|
53
|
+
})(VelcronComponentPropertyEditors = exports.VelcronComponentPropertyEditors || (exports.VelcronComponentPropertyEditors = {}));
|
|
54
|
+
var VelcronDataTypes;
|
|
55
|
+
(function (VelcronDataTypes) {
|
|
56
|
+
//Unknown = null
|
|
57
|
+
VelcronDataTypes["unknown"] = "unknown";
|
|
58
|
+
VelcronDataTypes["object"] = "object";
|
|
59
|
+
VelcronDataTypes["text"] = "text";
|
|
60
|
+
VelcronDataTypes["number"] = "number";
|
|
61
|
+
VelcronDataTypes["boolean"] = "boolean";
|
|
62
|
+
VelcronDataTypes["array"] = "array";
|
|
63
|
+
VelcronDataTypes["componentArray"] = "componentArray";
|
|
64
|
+
VelcronDataTypes["bind"] = "bind";
|
|
65
|
+
})(VelcronDataTypes = exports.VelcronDataTypes || (exports.VelcronDataTypes = {}));
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { VelcronComponentDescriptor } from "./VelcronDescriptors";
|
|
2
|
+
import { VelcronEvent, VelcronOnChangedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnLoadEvent, VelcronOnPressEvent } from "./VelcronEvents";
|
|
3
|
+
import { VelcroncomponentArrayType, VelcronPrimitiveType } from "./VelcronTypes";
|
|
4
|
+
import { AssignOperators, VelcronHorizontalAlignments, VelcronIconTypes, VelcronActionTypes, VerticalAlignments } from "./Enums";
|
|
5
|
+
import { ColorSchema, useVelcronThemingStore } from "..";
|
|
6
|
+
export interface ResolvedComponentRenderer {
|
|
7
|
+
component: unknown;
|
|
8
|
+
definition: VelcronDefinition;
|
|
9
|
+
customComponent?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface BuiltInComponentRenderers {
|
|
12
|
+
"View": unknown;
|
|
13
|
+
"Card": unknown;
|
|
14
|
+
"Text": unknown;
|
|
15
|
+
"Image": unknown;
|
|
16
|
+
"Button": unknown;
|
|
17
|
+
"TextInput": unknown;
|
|
18
|
+
"ProgressCircle": unknown;
|
|
19
|
+
"WebView": unknown;
|
|
20
|
+
"CustomComponent": unknown;
|
|
21
|
+
"Dialog": unknown;
|
|
22
|
+
"Icon": unknown;
|
|
23
|
+
"Chip": unknown;
|
|
24
|
+
"Slot": unknown;
|
|
25
|
+
}
|
|
26
|
+
export interface ColorSchemaReference {
|
|
27
|
+
name: string;
|
|
28
|
+
schema: string;
|
|
29
|
+
}
|
|
30
|
+
export type DynamicState = object;
|
|
31
|
+
export interface OnItemRenderedHookResult {
|
|
32
|
+
cssClass: string;
|
|
33
|
+
containerRenderer?: VelcronContainerRenderer;
|
|
34
|
+
}
|
|
35
|
+
export interface VelcronRenderContext {
|
|
36
|
+
id?: string;
|
|
37
|
+
rootContext: DynamicState;
|
|
38
|
+
currentContext: DynamicState;
|
|
39
|
+
theming?: ReturnType<typeof useVelcronThemingStore>;
|
|
40
|
+
colorSchemaType?: string;
|
|
41
|
+
colorSchema?: ColorSchema;
|
|
42
|
+
actions?: {
|
|
43
|
+
[name: string]: [];
|
|
44
|
+
};
|
|
45
|
+
components?: Array<VelcronCustomComponentDefinition>;
|
|
46
|
+
properties?: {
|
|
47
|
+
[name: string]: VelcronPrimitiveType | VelcroncomponentArrayType;
|
|
48
|
+
};
|
|
49
|
+
computed?: {
|
|
50
|
+
[name: string]: [];
|
|
51
|
+
};
|
|
52
|
+
parent?: VelcronRenderContext;
|
|
53
|
+
hooks?: VelcronRenderContextHooks;
|
|
54
|
+
eventHandlers?: VelcronRenderContextEventHandlers;
|
|
55
|
+
}
|
|
56
|
+
export interface VelcronRenderContextEventHandlers {
|
|
57
|
+
receiving?: {
|
|
58
|
+
[name: string]: (...args: any[]) => void;
|
|
59
|
+
};
|
|
60
|
+
emitting?: <T>(emitter: (i: T) => T) => T;
|
|
61
|
+
}
|
|
62
|
+
export interface VelcronRenderContextHooks {
|
|
63
|
+
dialogVisibilityChanged?: ((visible: boolean) => void);
|
|
64
|
+
onItemSelected?: ((item: VelcronDefinition) => void);
|
|
65
|
+
onItemRendered?: ((item: VelcronDefinition) => OnItemRenderedHookResult);
|
|
66
|
+
}
|
|
67
|
+
export interface VelcronContainerRenderer {
|
|
68
|
+
definition: VelcronDefinition;
|
|
69
|
+
renderContext: VelcronRenderContext;
|
|
70
|
+
component: JSX.Element;
|
|
71
|
+
}
|
|
72
|
+
export interface VelcronAction extends VelcronRenderContext {
|
|
73
|
+
type: VelcronActionTypes;
|
|
74
|
+
}
|
|
75
|
+
export interface VelcronActionGetOrSetValue extends VelcronAction {
|
|
76
|
+
value?: unknown;
|
|
77
|
+
path: string;
|
|
78
|
+
id: string;
|
|
79
|
+
assignOperator?: AssignOperators;
|
|
80
|
+
}
|
|
81
|
+
export interface VelcronActionWithAutoAwait extends VelcronActionGetOrSetValue {
|
|
82
|
+
nowait: boolean;
|
|
83
|
+
action: string;
|
|
84
|
+
}
|
|
85
|
+
export interface VelcronActionWithCondition extends VelcronActionWithAutoAwait {
|
|
86
|
+
condition: string;
|
|
87
|
+
trueAction: VelcronAction;
|
|
88
|
+
falseAction: VelcronAction;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Velcron definition base
|
|
92
|
+
*/
|
|
93
|
+
export interface VelcronDefinitionBase {
|
|
94
|
+
/**
|
|
95
|
+
* The component type
|
|
96
|
+
*/
|
|
97
|
+
type: string;
|
|
98
|
+
/**
|
|
99
|
+
* Custom friendly name of the definition
|
|
100
|
+
*/
|
|
101
|
+
name?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Used for render cache if not specified we auto set it.
|
|
104
|
+
*/
|
|
105
|
+
key?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface VelcronCustomThemeSettings {
|
|
108
|
+
colorSchema?: string;
|
|
109
|
+
color?: string;
|
|
110
|
+
opacity?: number;
|
|
111
|
+
}
|
|
112
|
+
export interface VelcronDefinition extends VelcronDefinitionBase {
|
|
113
|
+
body?: Array<VelcronDefinition>;
|
|
114
|
+
style?: VelcronStyling;
|
|
115
|
+
foreach?: string;
|
|
116
|
+
if?: string;
|
|
117
|
+
events?: VelcronEvent;
|
|
118
|
+
}
|
|
119
|
+
export interface VelcronStyling {
|
|
120
|
+
margin?: number;
|
|
121
|
+
marginTop?: number;
|
|
122
|
+
marginRight?: number;
|
|
123
|
+
marginBottom?: number;
|
|
124
|
+
marginLeft?: number;
|
|
125
|
+
padding?: number;
|
|
126
|
+
paddingTop?: number;
|
|
127
|
+
paddingRight?: number;
|
|
128
|
+
paddingBottom?: number;
|
|
129
|
+
paddingLeft?: number;
|
|
130
|
+
height?: number | string;
|
|
131
|
+
width?: number | string;
|
|
132
|
+
}
|
|
133
|
+
export interface VelcronCardStyling extends VelcronStyling {
|
|
134
|
+
elevation: number;
|
|
135
|
+
}
|
|
136
|
+
export interface VelcronSpacing {
|
|
137
|
+
top: number;
|
|
138
|
+
right: number;
|
|
139
|
+
bottom: number;
|
|
140
|
+
left: number;
|
|
141
|
+
}
|
|
142
|
+
export interface VelcronIcon {
|
|
143
|
+
type: VelcronIconTypes;
|
|
144
|
+
name: string;
|
|
145
|
+
}
|
|
146
|
+
export interface VelcronAppDefinition<TState extends DynamicState = DynamicState> extends VelcronDefinitionBase {
|
|
147
|
+
type: "Velcron";
|
|
148
|
+
body?: Array<VelcronDefinition>;
|
|
149
|
+
events?: VelcronOnLoadEvent & VelcronOnPressEvent;
|
|
150
|
+
actions?: {
|
|
151
|
+
[name: string]: [];
|
|
152
|
+
};
|
|
153
|
+
components?: Array<VelcronCustomComponentDefinition>;
|
|
154
|
+
state?: TState;
|
|
155
|
+
computed?: {
|
|
156
|
+
[name: string]: [];
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
export interface VelcronComponentDefinition extends VelcronDefinition {
|
|
160
|
+
type: string;
|
|
161
|
+
events: VelcronOnPressEvent;
|
|
162
|
+
}
|
|
163
|
+
/*** Built-in Components *********************************************************************/
|
|
164
|
+
export interface VelcronViewDefinition extends VelcronDefinition, VelcronCustomThemeSettings {
|
|
165
|
+
type: "View";
|
|
166
|
+
events?: VelcronOnPressEvent;
|
|
167
|
+
column?: boolean;
|
|
168
|
+
body: Array<VelcronDefinition>;
|
|
169
|
+
columnStyle?: object;
|
|
170
|
+
horizontalAlignment?: VelcronHorizontalAlignments;
|
|
171
|
+
verticalAlignment?: VerticalAlignments;
|
|
172
|
+
grow?: number;
|
|
173
|
+
border?: VelcronBorder;
|
|
174
|
+
borderRadius?: VelcronDimensions;
|
|
175
|
+
width: string;
|
|
176
|
+
}
|
|
177
|
+
export interface VelcronCardDefinition extends VelcronDefinition, VelcronCustomThemeSettings {
|
|
178
|
+
type: "Card";
|
|
179
|
+
style?: VelcronCardStyling;
|
|
180
|
+
footer?: Array<VelcronDefinition>;
|
|
181
|
+
events?: VelcronOnPressEvent;
|
|
182
|
+
}
|
|
183
|
+
export interface VelcronTextDefinition extends VelcronDefinition {
|
|
184
|
+
type: "Text";
|
|
185
|
+
text: string;
|
|
186
|
+
color?: string;
|
|
187
|
+
lineClamp: number;
|
|
188
|
+
noWrap: boolean;
|
|
189
|
+
typography?: string;
|
|
190
|
+
events?: VelcronOnPressEvent;
|
|
191
|
+
}
|
|
192
|
+
export declare enum VelcronImageRatios {
|
|
193
|
+
square = 1,
|
|
194
|
+
landscape = 2
|
|
195
|
+
}
|
|
196
|
+
export interface VelcronImageDefinition extends VelcronDefinition {
|
|
197
|
+
type: "Image";
|
|
198
|
+
source: string;
|
|
199
|
+
ratio: VelcronImageRatios;
|
|
200
|
+
borderRadius?: VelcronDimensions;
|
|
201
|
+
events?: VelcronOnPressEvent;
|
|
202
|
+
}
|
|
203
|
+
export interface VelcronButtonDefinition extends VelcronDefinition {
|
|
204
|
+
type: "Button";
|
|
205
|
+
text: string;
|
|
206
|
+
color: string;
|
|
207
|
+
icon?: VelcronIcon;
|
|
208
|
+
disabled?: boolean;
|
|
209
|
+
events?: VelcronOnPressEvent;
|
|
210
|
+
}
|
|
211
|
+
export interface VelcronTextInputDefinition extends VelcronDefinition {
|
|
212
|
+
type: "TextInput";
|
|
213
|
+
label?: string;
|
|
214
|
+
bind: string;
|
|
215
|
+
initialValue?: string;
|
|
216
|
+
events: VelcronOnChangedEvent;
|
|
217
|
+
}
|
|
218
|
+
export interface VelcronProgressCircleDefinition extends VelcronDefinition {
|
|
219
|
+
type: "ProgressCircle";
|
|
220
|
+
events?: VelcronOnPressEvent;
|
|
221
|
+
}
|
|
222
|
+
export interface VelcronWebViewDefinition extends VelcronDefinition {
|
|
223
|
+
type: "WebView";
|
|
224
|
+
source: string;
|
|
225
|
+
}
|
|
226
|
+
export interface VelcronDialogDefinition extends VelcronDefinition {
|
|
227
|
+
type: "Dialog";
|
|
228
|
+
title: string;
|
|
229
|
+
visible: string;
|
|
230
|
+
events?: VelcronOnCloseRequestedEvent & VelcronOnClosedEvent;
|
|
231
|
+
}
|
|
232
|
+
export interface VelcronIconDefinition extends VelcronDefinition, VelcronCustomThemeSettings {
|
|
233
|
+
type: "Icon";
|
|
234
|
+
icon: string;
|
|
235
|
+
background?: boolean;
|
|
236
|
+
size?: number;
|
|
237
|
+
events?: VelcronOnPressEvent;
|
|
238
|
+
}
|
|
239
|
+
export interface VelcronDimensions {
|
|
240
|
+
top: number;
|
|
241
|
+
right: number;
|
|
242
|
+
bottom: number;
|
|
243
|
+
left: number;
|
|
244
|
+
}
|
|
245
|
+
export interface VelcronBorder extends VelcronDimensions {
|
|
246
|
+
color: string;
|
|
247
|
+
}
|
|
248
|
+
export interface VelcronChipDefinition extends VelcronDefinition, VelcronCustomThemeSettings {
|
|
249
|
+
type: "Chip";
|
|
250
|
+
text: string;
|
|
251
|
+
icon?: VelcronIcon;
|
|
252
|
+
disabled?: boolean;
|
|
253
|
+
events?: VelcronOnPressEvent;
|
|
254
|
+
}
|
|
255
|
+
export interface VelcronSlotDefinition extends VelcronDefinition, VelcronCustomThemeSettings {
|
|
256
|
+
type: "Slot";
|
|
257
|
+
bind: string;
|
|
258
|
+
value: VelcroncomponentArrayType;
|
|
259
|
+
}
|
|
260
|
+
/*** Custom Components ***********************************************************************/
|
|
261
|
+
export type VelcronCustomComponentDefinition = VelcronComponentDescriptor & VelcronComponentDefinition;
|
|
262
|
+
export type VelcronRenderProps<TDefinition> = {
|
|
263
|
+
definition: TDefinition;
|
|
264
|
+
renderContext: VelcronRenderContext;
|
|
265
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VelcronImageRatios = void 0;
|
|
4
|
+
var VelcronImageRatios;
|
|
5
|
+
(function (VelcronImageRatios) {
|
|
6
|
+
VelcronImageRatios[VelcronImageRatios["square"] = 1] = "square";
|
|
7
|
+
VelcronImageRatios[VelcronImageRatios["landscape"] = 2] = "landscape";
|
|
8
|
+
})(VelcronImageRatios = exports.VelcronImageRatios || (exports.VelcronImageRatios = {}));
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { VelcronComponentPropertyEditors, VelcronDescriptorTypes, VelcronDataTypes } from "./Enums";
|
|
2
|
+
import { VelcroncomponentArrayType, VelcronPrimitiveType } from "./VelcronTypes";
|
|
3
|
+
export interface VelcronDescriptor {
|
|
4
|
+
descriptorType: VelcronDescriptorTypes;
|
|
5
|
+
icon: string;
|
|
6
|
+
}
|
|
7
|
+
export interface VelcronComponentDescriptor extends VelcronDescriptor {
|
|
8
|
+
descriptorType: VelcronDescriptorTypes.component;
|
|
9
|
+
type: string;
|
|
10
|
+
icon: string;
|
|
11
|
+
properties?: Array<VelcronComponentPropertyDescriptor | VelcronComponentArrayPropertyDescriptor>;
|
|
12
|
+
events?: Array<VelcronComponentEventDescriptor>;
|
|
13
|
+
}
|
|
14
|
+
export interface VelcronSubComponentDescriptor extends VelcronDescriptor {
|
|
15
|
+
descriptorType: VelcronDescriptorTypes.subComponent;
|
|
16
|
+
type: string;
|
|
17
|
+
icon: string;
|
|
18
|
+
properties?: Array<VelcronComponentPropertyDescriptor | VelcronComponentArrayPropertyDescriptor>;
|
|
19
|
+
events?: Array<VelcronComponentEventDescriptor>;
|
|
20
|
+
}
|
|
21
|
+
export interface VelcronComponentPropertyDescriptor {
|
|
22
|
+
name: string;
|
|
23
|
+
type: VelcronDataTypes;
|
|
24
|
+
editor?: VelcronComponentPropertyEditors;
|
|
25
|
+
required?: boolean;
|
|
26
|
+
defaultValue?: VelcronPrimitiveType | VelcroncomponentArrayType;
|
|
27
|
+
disableRemovePropertyOnEmptyOrFalse?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface VelcronComponentArrayPropertyDescriptor extends VelcronComponentPropertyDescriptor {
|
|
30
|
+
type: VelcronDataTypes.componentArray;
|
|
31
|
+
subComponent: VelcronSubComponentDescriptor;
|
|
32
|
+
}
|
|
33
|
+
export interface VelcronComponentEventDescriptor {
|
|
34
|
+
name: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type VelcronOnPressEvent = {
|
|
2
|
+
onPress?: Array<string>;
|
|
3
|
+
};
|
|
4
|
+
export type VelcronOnLoadEvent = {
|
|
5
|
+
onLoaded?: Array<string>;
|
|
6
|
+
};
|
|
7
|
+
export type VelcronOnChangedEvent = {
|
|
8
|
+
onChanged?: Array<string>;
|
|
9
|
+
};
|
|
10
|
+
export type VelcronOnCloseRequestedEvent = {
|
|
11
|
+
onCloseRequested?: Array<string>;
|
|
12
|
+
};
|
|
13
|
+
export type VelcronOnClosedEvent = {
|
|
14
|
+
onClosed?: Array<string>;
|
|
15
|
+
};
|
|
16
|
+
export type VelcronEvent = {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VelcronDefinition } from "./VelcronDefinitions";
|
|
2
|
+
export type VelcronPrimitiveType = string | number | boolean;
|
|
3
|
+
export type VelcronArrayType<T> = Array<T>;
|
|
4
|
+
export type VelcronObjectType<T extends Object> = T;
|
|
5
|
+
export type VelcroncomponentArrayType = Array<VelcronDefinition>;
|
|
6
|
+
export interface DeferredPromise<T> {
|
|
7
|
+
promise: Promise<T>;
|
|
8
|
+
resolve: (val: T) => void;
|
|
9
|
+
reject: () => void;
|
|
10
|
+
}
|