@omnia/velcron 8.0.97-vnext → 8.0.98-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 +9 -2
- package/actions/Clone.d.ts +2 -0
- package/actions/Clone.js +11 -0
- package/actions/Date.d.ts +1 -1
- package/actions/Date.js +2 -4
- package/actions/Http.js +23 -6
- package/actions/index.d.ts +1 -0
- package/actions/index.js +1 -0
- package/internal-do-not-import-from-here/shared/models/Broadcasting.js +1 -1
- package/internal-do-not-import-from-here/shared/models/DynamicState.d.ts +1 -0
- package/internal-do-not-import-from-here/shared/models/Equals.js +33 -3
- package/internal-do-not-import-from-here/shared/models/Future.d.ts +17 -1
- package/internal-do-not-import-from-here/shared/models/Future.js +26 -5
- package/internal-do-not-import-from-here/shared/models/Guid.d.ts +1 -0
- package/internal-do-not-import-from-here/shared/models/Guid.js +13 -6
- package/internal-do-not-import-from-here/shared/models/HttpCommon.d.ts +27 -0
- package/internal-do-not-import-from-here/shared/models/OmniaSharedBootstrapData.d.ts +7 -1
- package/internal-do-not-import-from-here/shared/models/Realtime.d.ts +1 -13
- package/internal-do-not-import-from-here/shared/models/Realtime.js +1 -22
- package/internal-do-not-import-from-here/shared/models/StronglyTypedId.d.ts +3 -0
- package/internal-do-not-import-from-here/shared/models/StronglyTypedId.js +2 -0
- package/internal-do-not-import-from-here/shared/models/Tokens.d.ts +1 -0
- package/internal-do-not-import-from-here/shared/models/WorkerProxyFuncs.d.ts +7 -1
- package/internal-do-not-import-from-here/shared/models/WorkerProxyFuncs.js +5 -1
- package/internal-do-not-import-from-here/shared/models/Workers.js +1 -1
- package/internal-do-not-import-from-here/shared/models/hub/ExternalIdentityId.d.ts +2 -0
- package/internal-do-not-import-from-here/shared/models/hub/ExternalIdentityId.js +2 -0
- package/internal-do-not-import-from-here/shared/models/hub/TempSocialReactions.d.ts +13 -0
- package/internal-do-not-import-from-here/shared/models/hub/TempSocialReactions.js +20 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/Activity.d.ts +67 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/Activity.js +7 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityChannel.d.ts +7 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityChannel.js +5 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityDefinition.d.ts +14 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityDefinition.js +15 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityFeed.d.ts +30 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityFeed.js +2 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityRenderer.d.ts +15 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityRenderer.js +5 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityRendererLoadingReferences.d.ts +8 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityRendererLoadingReferences.js +2 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivitySender.d.ts +15 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivitySender.js +5 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/IdentityActivity.d.ts +40 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/IdentityActivity.js +39 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/index.d.ts +8 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/index.js +11 -0
- package/internal-do-not-import-from-here/shared/models/hub/fileupload/FileOwnerId.d.ts +3 -0
- package/internal-do-not-import-from-here/shared/models/hub/fileupload/FileOwnerId.js +5 -0
- package/internal-do-not-import-from-here/shared/models/hub/fileupload/TemporaryFileId.d.ts +4 -0
- package/internal-do-not-import-from-here/shared/models/hub/fileupload/TemporaryFileId.js +5 -0
- package/internal-do-not-import-from-here/shared/models/hub/fileupload/index.d.ts +2 -0
- package/internal-do-not-import-from-here/shared/models/hub/fileupload/index.js +5 -0
- package/internal-do-not-import-from-here/shared/models/hub/index.d.ts +5 -0
- package/internal-do-not-import-from-here/shared/models/hub/index.js +8 -0
- package/internal-do-not-import-from-here/shared/models/hub/social/HubComment.d.ts +10 -0
- package/internal-do-not-import-from-here/shared/models/hub/social/HubComment.js +2 -0
- package/internal-do-not-import-from-here/shared/models/hub/social/HubReaction.d.ts +5 -0
- package/internal-do-not-import-from-here/shared/models/hub/social/HubReaction.js +2 -0
- package/internal-do-not-import-from-here/shared/models/hub/social/index.d.ts +2 -0
- package/internal-do-not-import-from-here/shared/models/hub/social/index.js +5 -0
- package/internal-do-not-import-from-here/shared/models/index.d.ts +5 -1
- package/internal-do-not-import-from-here/shared/models/index.js +5 -1
- package/internal-do-not-import-from-here/shared/models/theming/BlueprintDefinition.d.ts +44 -46
- package/internal-do-not-import-from-here/shared/models/theming/BlueprintDefinition.js +7 -13
- package/internal-do-not-import-from-here/shared/models/theming/ChromeDefinition.d.ts +25 -0
- package/internal-do-not-import-from-here/shared/models/theming/ChromeDefinition.js +2 -0
- package/internal-do-not-import-from-here/shared/models/theming/SharedBlueprintMethods.d.ts +2 -2
- package/internal-do-not-import-from-here/shared/models/theming/SharedBlueprintMethods.js +8 -7
- package/internal-do-not-import-from-here/shared/models/theming/SpacingSetting.d.ts +5 -4
- package/internal-do-not-import-from-here/shared/models/theming/SpacingSetting.js +1 -1
- package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.d.ts +22 -13
- package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.js +8 -10
- package/internal-do-not-import-from-here/shared/models/theming/TypographyDefinition.d.ts +5 -0
- package/internal-do-not-import-from-here/shared/models/theming/TypographyDefinition.js +2 -2
- package/internal-do-not-import-from-here/shared/models/theming/UseThemeMethods.d.ts +3 -5
- package/internal-do-not-import-from-here/shared/models/theming/UseThemeMethods.js +4 -30
- package/internal-do-not-import-from-here/shared/models/theming/index.d.ts +1 -1
- package/internal-do-not-import-from-here/shared/models/theming/index.js +2 -1
- package/internal-do-not-import-from-here/shared/models/velcron/VelcronDefinition.d.ts +87 -0
- package/internal-do-not-import-from-here/shared/models/velcron/VelcronDefinition.js +2 -0
- package/internal-do-not-import-from-here/shared/models/velcron/VelcronEvents.js +2 -0
- package/internal-do-not-import-from-here/shared/models/velcron/index.d.ts +2 -0
- package/internal-do-not-import-from-here/shared/models/velcron/index.js +5 -0
- package/models/ActionHooks.d.ts +12 -0
- package/models/ActionHooks.js +2 -0
- package/models/Enums.js +7 -7
- package/models/VelcronDefinitions.d.ts +76 -86
- package/models/VelcronDefinitions.js +1 -1
- package/models/VelcronPropertyEditorDefinitions.d.ts +259 -19
- package/models/VelcronPropertyEditorDefinitions.js +114 -2
- package/models/VelcronTypes.d.ts +1 -1
- package/models/ViewModelAndContext.d.ts +1 -1
- package/models/index.d.ts +1 -1
- package/models/index.js +1 -1
- package/package.json +1 -1
- package/parser/VelcronActions.d.ts +7 -1
- package/parser/VelcronActions.js +20 -3
- package/parser/VelcronConstants.d.ts +6 -1
- package/parser/VelcronConstants.js +7 -2
- package/parser/VelcronData.d.ts +3 -2
- package/parser/VelcronData.js +13 -12
- package/parser/VelcronPropertyEditors.js +1 -1
- package/parser/VelcronRenderers.d.ts +2 -1
- package/parser/VelcronRenderers.js +20 -20
- package/parser/VelcronStyles.d.ts +2 -1
- package/parser/VelcronStyles.js +168 -65
- package/stores/ReactivitySystem.d.ts +2 -2
- package/stores/ReactivitySystem.js +1 -1
- package/stores/VelcronColorSchema.d.ts +9 -8
- package/stores/VelcronTheming.d.ts +4 -3
- package/stores/VelcronTheming.js +15 -3
- package/stores/index.d.ts +0 -1
- package/stores/index.js +1 -1
- package/templatebuilder/editor/VelcronContentEditor.d.ts +26 -2
- package/templatebuilder/editor/VelcronContentEditor.js +164 -4
- package/templatebuilder/editor/VelcronEditorBuilder2.d.ts +15 -0
- package/templatebuilder/editor/VelcronEditorBuilder2.js +106 -0
- package/templatebuilder/editor/VelcronEditorBuilderBase.d.ts +1 -1
- package/templatebuilder/editor/VelcronPropertyMappingEditorBuilder.js +1 -1
- package/templatebuilder/index.d.ts +1 -0
- package/templatebuilder/index.js +1 -0
- package/templatebuilder/state/VelcronBlockHeaderStateBuilder.d.ts +0 -0
- package/templatebuilder/state/VelcronBlockHeaderStateBuilder.js +38 -0
- package/templatebuilder/state/VelcronColorSchemaBuilder.d.ts +10 -5
- package/templatebuilder/state/VelcronColorSchemaBuilder.js +18 -6
- package/templatebuilder/state/VelcronContentStateBuilder.d.ts +7 -13
- package/templatebuilder/state/VelcronContentStateBuilder.js +26 -18
- package/templatebuilder/state/VelcronImageStateBuilder.d.ts +2 -4
- package/templatebuilder/state/VelcronImageStateBuilder.js +10 -4
- package/templatebuilder/state/VelcronPropertyMappingStateBuilder.d.ts +3 -2
- package/templatebuilder/state/VelcronPropertyMappingStateBuilder.js +12 -5
- package/templatebuilder/state/VelcronStateBuilder.d.ts +2 -1
- package/templatebuilder/state/VelcronStateBuilderBase.d.ts +7 -3
- package/templatebuilder/state/VelcronStateBuilderBase.js +8 -4
- package/templatebuilder/state/VelcronTextContentBuilder.d.ts +32 -0
- package/templatebuilder/state/VelcronTextContentBuilder.js +110 -0
- package/templatebuilder/useVelcronEditorBuilder.d.ts +2 -0
- package/templatebuilder/useVelcronEditorBuilder.js +9 -0
- package/internal-do-not-import-from-here/shared/models/Bring.d.ts +0 -23
- package/internal-do-not-import-from-here/shared/models/theming/OmniaThemes.d.ts +0 -5
- package/internal-do-not-import-from-here/shared/models/theming/OmniaThemes.js +0 -18
- package/stores/VelcronBlueprint.d.ts +0 -39
- package/stores/VelcronBlueprint.js +0 -55
- /package/internal-do-not-import-from-here/shared/models/{Bring.js → DynamicState.js} +0 -0
- /package/{models/VelcronEvents.js → internal-do-not-import-from-here/shared/models/HttpCommon.js} +0 -0
- /package/{models → internal-do-not-import-from-here/shared/models/velcron}/VelcronEvents.d.ts +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BuiltInPropertyEditorTypes = void 0;
|
|
3
|
+
exports.VelcronStateBinding = exports.VelcronSpacingStateBinding = exports.VelcronColorSchemasStateBinding = exports.VelcronContentStateBinding = exports.VelcronHeaderStateBinding = exports.VelcronImagesStateBinding = exports.BuiltInPropertyEditorTypes = void 0;
|
|
4
|
+
// export type BuiltInPropertyEditorType = "text" | "slider" | "switch" | "alignment" | "color" | "markdown" | "icon" | "image" | "typography" | "color-schema-type" | "spacing" ;
|
|
4
5
|
var BuiltInPropertyEditorTypes;
|
|
5
6
|
(function (BuiltInPropertyEditorTypes) {
|
|
6
7
|
BuiltInPropertyEditorTypes["text"] = "text";
|
|
@@ -12,5 +13,116 @@ var BuiltInPropertyEditorTypes;
|
|
|
12
13
|
BuiltInPropertyEditorTypes["icon"] = "icon";
|
|
13
14
|
BuiltInPropertyEditorTypes["image"] = "image";
|
|
14
15
|
BuiltInPropertyEditorTypes["typography"] = "typography";
|
|
16
|
+
BuiltInPropertyEditorTypes["spacing"] = "spacing";
|
|
15
17
|
BuiltInPropertyEditorTypes["color-schema-type"] = "color-schema-type";
|
|
16
|
-
})(BuiltInPropertyEditorTypes
|
|
18
|
+
})(BuiltInPropertyEditorTypes || (exports.BuiltInPropertyEditorTypes = BuiltInPropertyEditorTypes = {}));
|
|
19
|
+
exports.VelcronImagesStateBinding = {
|
|
20
|
+
main: {
|
|
21
|
+
editor: "{{images.main.url}}",
|
|
22
|
+
url: "{{images.main.url}}",
|
|
23
|
+
ratio: "{{images.main.ratio}}",
|
|
24
|
+
caption: "{{images.main.caption}}",
|
|
25
|
+
width: "{{images.main.width}}",
|
|
26
|
+
height: "{{images.main.height}}",
|
|
27
|
+
},
|
|
28
|
+
alt1: {
|
|
29
|
+
editor: "{{images.alt1.url}}",
|
|
30
|
+
url: "{{images.alt1.url}}",
|
|
31
|
+
ratio: "{{images.alt1.ratio}}",
|
|
32
|
+
caption: "{{images.alt1.caption}}",
|
|
33
|
+
width: "{{images.alt1.width}}",
|
|
34
|
+
height: "{{images.alt1.height}}",
|
|
35
|
+
},
|
|
36
|
+
alt2: {
|
|
37
|
+
editor: "{{images.alt2.url}}",
|
|
38
|
+
url: "{{images.alt2.url}}",
|
|
39
|
+
ratio: "{{images.alt2.ratio}}",
|
|
40
|
+
caption: "{{images.alt2.caption}}",
|
|
41
|
+
width: "{{images.alt2.width}}",
|
|
42
|
+
height: "{{images.alt2.height}}",
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
exports.VelcronHeaderStateBinding = {
|
|
46
|
+
title: {
|
|
47
|
+
text: "{{header.title.text}}",
|
|
48
|
+
placeholder: "{{header.title.placeholder}}",
|
|
49
|
+
typography: {
|
|
50
|
+
editor: "header.title.typography",
|
|
51
|
+
type: "{{header.title.typography.type}}",
|
|
52
|
+
size: "{{header.title.typography.size}}",
|
|
53
|
+
toned: "{{header.title.typography.toned}}",
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
icon: "{{header.icon}}"
|
|
57
|
+
};
|
|
58
|
+
exports.VelcronContentStateBinding = {
|
|
59
|
+
title: {
|
|
60
|
+
text: "{{content.title.text}}",
|
|
61
|
+
placeholder: "{{content.title.placeholder}}",
|
|
62
|
+
typography: {
|
|
63
|
+
editor: "content.title.typography",
|
|
64
|
+
type: "{{content.title.typography.type}}",
|
|
65
|
+
size: "{{content.title.typography.size}}",
|
|
66
|
+
toned: "{{content.title.typography.toned}}",
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
main: {
|
|
70
|
+
text: "{{content.main.text}}",
|
|
71
|
+
placeholder: "{{content.main.placeholder}}",
|
|
72
|
+
typography: {
|
|
73
|
+
editor: "content.main.typography",
|
|
74
|
+
type: "{{content.main.typography.type}}",
|
|
75
|
+
size: "{{content.main.typography.size}}",
|
|
76
|
+
toned: "{{content.main.typography.toned}}",
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
caption: {
|
|
80
|
+
text: "{{content.caption.text}}",
|
|
81
|
+
placeholder: "{{content.caption.placeholder}}",
|
|
82
|
+
typography: {
|
|
83
|
+
editor: "content.caption.typography",
|
|
84
|
+
type: "{{content.caption.typography.type}}",
|
|
85
|
+
size: "{{content.caption.typography.size}}",
|
|
86
|
+
toned: "{{content.caption.typography.toned}}",
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
summary: {
|
|
90
|
+
text: "{{content.summary.text}}",
|
|
91
|
+
placeholder: "{{content.summary.placeholder}}",
|
|
92
|
+
typography: {
|
|
93
|
+
editor: "content.summary.typography",
|
|
94
|
+
type: "{{content.summary.typography.type}}",
|
|
95
|
+
size: "{{content.summary.typography.size}}",
|
|
96
|
+
toned: "{{content.summary.typography.toned}}",
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
exports.VelcronColorSchemasStateBinding = {
|
|
101
|
+
main: {
|
|
102
|
+
type: "{{colorSchemas.main.type}}",
|
|
103
|
+
filled: "{{colorSchemas.main.filled}}"
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
exports.VelcronSpacingStateBinding = {
|
|
107
|
+
chrome: {
|
|
108
|
+
"top": "{{spacing.chrome.top}}",
|
|
109
|
+
"right": "{{spacing.chrome.right}}",
|
|
110
|
+
"bottom": "{{spacing.chrome.bottom}}",
|
|
111
|
+
"left": "{{spacing.chrome.left}}",
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
// export interface VelcronSpacingState {
|
|
115
|
+
// chrome?: VelcronDimensionState
|
|
116
|
+
// }
|
|
117
|
+
// export interface VelcronDimensionState {
|
|
118
|
+
// margin?: VelcronSpacing;
|
|
119
|
+
// padding?: VelcronSpacing;
|
|
120
|
+
// }
|
|
121
|
+
exports.VelcronStateBinding = {
|
|
122
|
+
colorSchemas: exports.VelcronColorSchemasStateBinding,
|
|
123
|
+
images: exports.VelcronImagesStateBinding,
|
|
124
|
+
content: exports.VelcronContentStateBinding,
|
|
125
|
+
header: exports.VelcronHeaderStateBinding,
|
|
126
|
+
spacing: exports.VelcronSpacingStateBinding
|
|
127
|
+
//properties?:VelcronPropertiesState,
|
|
128
|
+
};
|
package/models/VelcronTypes.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VelcronDefinition } from "
|
|
1
|
+
import { VelcronDefinition } from "@omnia/fx-models";
|
|
2
2
|
export type VelcronPrimitiveType = string | number | boolean;
|
|
3
3
|
export type VelcronArrayType<T> = Array<T>;
|
|
4
4
|
export type VelcronObjectType<T extends Object> = T;
|
package/models/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./VelcronDefinitions";
|
|
2
2
|
export * from "./ViewModelAndContext";
|
|
3
|
-
export * from "./VelcronEvents";
|
|
4
3
|
export * from "./VelcronTypes";
|
|
5
4
|
export * from "./Enums";
|
|
6
5
|
export * from "./VelcronUnitProvider";
|
|
7
6
|
export * from "./VelcronPropertyEditorDefinitions";
|
|
7
|
+
export * from "./ActionHooks";
|
package/models/index.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./VelcronDefinitions"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./ViewModelAndContext"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./VelcronEvents"), exports);
|
|
7
6
|
tslib_1.__exportStar(require("./VelcronTypes"), exports);
|
|
8
7
|
tslib_1.__exportStar(require("./Enums"), exports);
|
|
9
8
|
tslib_1.__exportStar(require("./VelcronUnitProvider"), exports);
|
|
10
9
|
tslib_1.__exportStar(require("./VelcronPropertyEditorDefinitions"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./ActionHooks"), exports);
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { VelcronAction, VelcronActionWithAutoAwait, VelcronRenderContext, DeferredPromise } from "../models";
|
|
1
|
+
import { VelcronAction, VelcronActionWithAutoAwait, VelcronRenderContext, DeferredPromise, VelcronActionHooks } from "../models";
|
|
2
2
|
import { IActionHandler } from "../actions";
|
|
3
3
|
export declare class VelcronActions {
|
|
4
4
|
static _actionHandlers: {
|
|
5
5
|
[name: string]: IActionHandler;
|
|
6
6
|
} | null;
|
|
7
|
+
static actionHooks: {
|
|
8
|
+
[name: string]: VelcronActionHooks;
|
|
9
|
+
};
|
|
7
10
|
static registerAction(name: string, handler: IActionHandler): void;
|
|
8
11
|
static parseAndExecuteActions(templates: Array<string>, renderContext: VelcronRenderContext, customActionContext?: VelcronCustomActionExecutionContext): void;
|
|
9
12
|
static parseFunction(target: {
|
|
@@ -15,6 +18,9 @@ export declare class VelcronActions {
|
|
|
15
18
|
static executeAction(awAction: VelcronActionWithAutoAwait, callback: (continueExecution: boolean) => void): void;
|
|
16
19
|
static dataBindComputed(renderContext: VelcronRenderContext, template: string): string;
|
|
17
20
|
static parseAndExecuteComputed(renderContext: VelcronRenderContext, template: string): string;
|
|
21
|
+
static registerActionHook<TBefore, TAfter>(actionName: string, handler: VelcronActionHooks<TBefore, TAfter>): void;
|
|
22
|
+
static tryTriggerBeforeActionHook<T>(actionName: string, args: T): T;
|
|
23
|
+
static tryTriggerAfterActionHook<T>(actionName: string, args: T): T;
|
|
18
24
|
private static extractParameterValues;
|
|
19
25
|
}
|
|
20
26
|
interface VelcronActionParameterValue {
|
package/parser/VelcronActions.js
CHANGED
|
@@ -351,6 +351,22 @@ class VelcronActions {
|
|
|
351
351
|
});
|
|
352
352
|
return template;
|
|
353
353
|
}
|
|
354
|
+
static registerActionHook(actionName, handler) {
|
|
355
|
+
VelcronActions.actionHooks ?? (VelcronActions.actionHooks = {});
|
|
356
|
+
VelcronActions.actionHooks[actionName] = handler;
|
|
357
|
+
}
|
|
358
|
+
static tryTriggerBeforeActionHook(actionName, args) {
|
|
359
|
+
if (VelcronActions.actionHooks && VelcronActions.actionHooks[actionName] && VelcronActions.actionHooks[actionName].beforeHandler) {
|
|
360
|
+
return VelcronActions.actionHooks[actionName].beforeHandler(args);
|
|
361
|
+
}
|
|
362
|
+
return args;
|
|
363
|
+
}
|
|
364
|
+
static tryTriggerAfterActionHook(actionName, args) {
|
|
365
|
+
if (VelcronActions.actionHooks && VelcronActions.actionHooks[actionName] && VelcronActions.actionHooks[actionName].afterHandler) {
|
|
366
|
+
return VelcronActions.actionHooks[actionName].afterHandler(args);
|
|
367
|
+
}
|
|
368
|
+
return args;
|
|
369
|
+
}
|
|
354
370
|
static extractParameterValues(template, action) {
|
|
355
371
|
const params = [];
|
|
356
372
|
let hasMoreParams = true;
|
|
@@ -417,7 +433,7 @@ class VelcronActions {
|
|
|
417
433
|
}
|
|
418
434
|
else {
|
|
419
435
|
//Try get it from ViewModel
|
|
420
|
-
castedValue = VelcronData_1.VelcronData.
|
|
436
|
+
castedValue = VelcronData_1.VelcronData.getOrSet(action, castedValue);
|
|
421
437
|
}
|
|
422
438
|
}
|
|
423
439
|
params.push({ dataType: dataType, value: castedValue });
|
|
@@ -435,12 +451,13 @@ class VelcronActions {
|
|
|
435
451
|
return params;
|
|
436
452
|
}
|
|
437
453
|
}
|
|
438
|
-
VelcronActions._actionHandlers = null;
|
|
439
454
|
exports.VelcronActions = VelcronActions;
|
|
455
|
+
VelcronActions._actionHandlers = null;
|
|
456
|
+
VelcronActions.actionHooks = {};
|
|
440
457
|
var VelcronActionParameterDataType;
|
|
441
458
|
(function (VelcronActionParameterDataType) {
|
|
442
459
|
VelcronActionParameterDataType[VelcronActionParameterDataType["text"] = 0] = "text";
|
|
443
460
|
VelcronActionParameterDataType[VelcronActionParameterDataType["number"] = 1] = "number";
|
|
444
461
|
VelcronActionParameterDataType[VelcronActionParameterDataType["boolean"] = 2] = "boolean";
|
|
445
462
|
VelcronActionParameterDataType[VelcronActionParameterDataType["pointer"] = 3] = "pointer";
|
|
446
|
-
})(VelcronActionParameterDataType
|
|
463
|
+
})(VelcronActionParameterDataType || (exports.VelcronActionParameterDataType = VelcronActionParameterDataType = {}));
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export declare const VelcronConstants: {
|
|
2
2
|
components: {
|
|
3
3
|
velcron: string;
|
|
4
|
-
|
|
4
|
+
flex: string;
|
|
5
|
+
row: string;
|
|
6
|
+
column: string;
|
|
5
7
|
card: string;
|
|
6
8
|
text: string;
|
|
7
9
|
image: string;
|
|
10
|
+
video: string;
|
|
8
11
|
button: string;
|
|
9
12
|
"text-input": string;
|
|
10
13
|
"progress-circle": string;
|
|
@@ -16,6 +19,8 @@ export declare const VelcronConstants: {
|
|
|
16
19
|
markdown: string;
|
|
17
20
|
slot: string;
|
|
18
21
|
property: string;
|
|
22
|
+
checkbox: string;
|
|
23
|
+
reference: string;
|
|
19
24
|
};
|
|
20
25
|
events: {
|
|
21
26
|
idTokenStart: string;
|
|
@@ -4,10 +4,13 @@ exports.VelcronConstants = void 0;
|
|
|
4
4
|
exports.VelcronConstants = {
|
|
5
5
|
components: {
|
|
6
6
|
velcron: "velcron",
|
|
7
|
-
|
|
7
|
+
flex: "flex",
|
|
8
|
+
row: "row",
|
|
9
|
+
column: "column",
|
|
8
10
|
card: "card",
|
|
9
11
|
text: "text",
|
|
10
12
|
image: "image",
|
|
13
|
+
video: "video",
|
|
11
14
|
button: "button",
|
|
12
15
|
"text-input": "text-input",
|
|
13
16
|
"progress-circle": "progress-circle",
|
|
@@ -18,7 +21,9 @@ exports.VelcronConstants = {
|
|
|
18
21
|
chip: "chip",
|
|
19
22
|
markdown: "markdown",
|
|
20
23
|
slot: "slot",
|
|
21
|
-
property: "property"
|
|
24
|
+
property: "property",
|
|
25
|
+
checkbox: "checkbox",
|
|
26
|
+
reference: "reference"
|
|
22
27
|
},
|
|
23
28
|
events: {
|
|
24
29
|
idTokenStart: "$ev{",
|
package/parser/VelcronData.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VelcronRenderContext, DeferredPromise, VelcronBindableProp } from "../models";
|
|
2
|
+
import { VelcronAppDefinition, VelcronDefinition } from "..";
|
|
2
3
|
export interface ParseResult<T> {
|
|
3
4
|
is: boolean;
|
|
4
5
|
value: T;
|
|
@@ -25,7 +26,7 @@ export declare class VelcronData {
|
|
|
25
26
|
static isObject(value: any): boolean;
|
|
26
27
|
static extendObject(obj: any): any;
|
|
27
28
|
static getOrSetObjectByPath<T>(object: Object, path: string, value?: any): T | null;
|
|
28
|
-
static
|
|
29
|
+
static getOrSet<T>(renderContext: VelcronRenderContext, path: string, value?: any): T;
|
|
29
30
|
static getTokens(template: any, removeBrackets: boolean): string[];
|
|
30
31
|
static ensureEventId(event: string): string;
|
|
31
32
|
static ensureKeys(ui: VelcronDefinition | VelcronAppDefinition, generateNewKeys?: boolean): void;
|
package/parser/VelcronData.js
CHANGED
|
@@ -12,7 +12,7 @@ class VelcronData {
|
|
|
12
12
|
}
|
|
13
13
|
const tokens = this.getTokens(text, false);
|
|
14
14
|
tokens.forEach((token) => {
|
|
15
|
-
let data = this.
|
|
15
|
+
let data = this.getOrSet(renderContext, token.replace(/\s*{{\s*|\s*}}\s*/g, ""));
|
|
16
16
|
if (data instanceof TextValue_1.TextValue) {
|
|
17
17
|
data = data.value;
|
|
18
18
|
}
|
|
@@ -70,11 +70,11 @@ class VelcronData {
|
|
|
70
70
|
let propertiesToEval = {};
|
|
71
71
|
if (renderContext.properties) {
|
|
72
72
|
//Custom component properties evaluation
|
|
73
|
-
propertiesToEval = {};
|
|
74
|
-
Object.keys(renderContext.properties).forEach((key) => {
|
|
75
|
-
|
|
76
|
-
});
|
|
77
|
-
names.push(
|
|
73
|
+
// propertiesToEval = {};
|
|
74
|
+
// Object.keys(renderContext.properties).forEach((key) => {
|
|
75
|
+
// propertiesToEval[key] = VelcronConstants.properties.propsToken;
|
|
76
|
+
// });
|
|
77
|
+
names.push(VelcronConstants_1.VelcronConstants.properties.propsToken);
|
|
78
78
|
obj.push(renderContext.properties);
|
|
79
79
|
}
|
|
80
80
|
else if (overrideNamesMatching) {
|
|
@@ -84,7 +84,8 @@ class VelcronData {
|
|
|
84
84
|
"null",
|
|
85
85
|
"return"
|
|
86
86
|
];
|
|
87
|
-
|
|
87
|
+
const skipName = "$props";
|
|
88
|
+
template = VelcronData.addCtxToVariableNames(template, skipName, reservedWords, propertiesToEval);
|
|
88
89
|
names.push("rootCtx");
|
|
89
90
|
names.push("currentCtx");
|
|
90
91
|
obj.push(renderContext.rootContext);
|
|
@@ -223,7 +224,7 @@ class VelcronData {
|
|
|
223
224
|
}
|
|
224
225
|
else {
|
|
225
226
|
//Try get value from rootContext or currentContext
|
|
226
|
-
value = VelcronData.
|
|
227
|
+
value = VelcronData.getOrSet(renderContext, value);
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
230
|
}
|
|
@@ -243,7 +244,7 @@ class VelcronData {
|
|
|
243
244
|
runEvaluation = true;
|
|
244
245
|
}
|
|
245
246
|
}
|
|
246
|
-
const existingVal = VelcronData.
|
|
247
|
+
const existingVal = VelcronData.getOrSet(renderContext, path);
|
|
247
248
|
if (assignOperator === models_1.AssignOperators.equals || assignOperator === models_1.AssignOperators.equalsExclamation) {
|
|
248
249
|
//debugger;
|
|
249
250
|
if (typeof existingVal === "boolean" && typeof value !== "boolean") {
|
|
@@ -285,7 +286,7 @@ class VelcronData {
|
|
|
285
286
|
}
|
|
286
287
|
else {
|
|
287
288
|
//try get value from render context
|
|
288
|
-
const localVal = VelcronData.
|
|
289
|
+
const localVal = VelcronData.getOrSet(renderContext, value);
|
|
289
290
|
if (localVal !== undefined && localVal !== null) {
|
|
290
291
|
value = localVal;
|
|
291
292
|
}
|
|
@@ -494,7 +495,7 @@ class VelcronData {
|
|
|
494
495
|
}
|
|
495
496
|
return object;
|
|
496
497
|
}
|
|
497
|
-
static
|
|
498
|
+
static getOrSet(renderContext, path, value = undefined) {
|
|
498
499
|
let result;
|
|
499
500
|
if (VelcronData.isUndefined(path)) {
|
|
500
501
|
return result;
|
|
@@ -637,5 +638,5 @@ class VelcronData {
|
|
|
637
638
|
return { promise, reject, resolve };
|
|
638
639
|
}
|
|
639
640
|
}
|
|
640
|
-
VelcronData.variables = {};
|
|
641
641
|
exports.VelcronData = VelcronData;
|
|
642
|
+
VelcronData.variables = {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { BuiltInComponentRenderers,
|
|
1
|
+
import { BuiltInComponentRenderers, ResolvedComponentRenderer, VelcronRenderContext } from "../models";
|
|
2
|
+
import { DynamicState, VelcronDefinition } from "..";
|
|
2
3
|
export declare class VelcronRenderers {
|
|
3
4
|
private static components;
|
|
4
5
|
static registerComponent(type: string, component: any): void;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VelcronRenderers = void 0;
|
|
4
|
-
const VelcronLogger_1 = require("./VelcronLogger");
|
|
5
4
|
const VelcronData_1 = require("./VelcronData");
|
|
6
5
|
const __1 = require("..");
|
|
7
6
|
class VelcronRenderers {
|
|
@@ -74,8 +73,9 @@ class VelcronRenderers {
|
|
|
74
73
|
computed: currentRenderCtx.computed,
|
|
75
74
|
colors: currentRenderCtx.colors,
|
|
76
75
|
editMode: currentRenderCtx.editMode,
|
|
77
|
-
blueprints: currentRenderCtx.blueprints,
|
|
78
|
-
disposers: currentRenderCtx.disposers
|
|
76
|
+
//blueprints: currentRenderCtx.blueprints,
|
|
77
|
+
disposers: currentRenderCtx.disposers,
|
|
78
|
+
properties: currentRenderCtx.properties,
|
|
79
79
|
};
|
|
80
80
|
if (VelcronRenderers.definitionContainsCustomColorSchema(definition)) {
|
|
81
81
|
const colorSchemaStore = (0, __1.useVelcronColorSchemaStore)(definition.key.toString());
|
|
@@ -98,23 +98,23 @@ class VelcronRenderers {
|
|
|
98
98
|
if (customDef.properties) {
|
|
99
99
|
Object.keys(customDef.properties).forEach((propName) => {
|
|
100
100
|
const prop = customDef.properties ? customDef.properties[propName] : null;
|
|
101
|
-
if (!prop || (prop.required && !definition.hasOwnProperty(propName))) {
|
|
102
|
-
|
|
103
|
-
}
|
|
101
|
+
// if (!prop || (prop.required && !definition.hasOwnProperty(propName))) {
|
|
102
|
+
// VelcronLogger.logCustomComponentError(`Component of type ${customDef.type} requires property ${propName} but its missing`);
|
|
103
|
+
// }
|
|
104
104
|
result.properties = result.properties || {};
|
|
105
|
-
if (definition.hasOwnProperty(propName)) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
else if (prop.hasOwnProperty("defaultValue")) {
|
|
116
|
-
|
|
117
|
-
}
|
|
105
|
+
// if (definition.hasOwnProperty(propName)) {
|
|
106
|
+
// if (VelcronData.isString(definition[propName])) {
|
|
107
|
+
// //Properties can be databound so if its a string we try do databind
|
|
108
|
+
// //this is true for other values such as number / string also
|
|
109
|
+
// result.properties[propName] = VelcronData.dataBind(result, definition[propName]);
|
|
110
|
+
// }
|
|
111
|
+
// else {
|
|
112
|
+
// result.properties[propName] = definition[propName];
|
|
113
|
+
// }
|
|
114
|
+
// }
|
|
115
|
+
// else if (prop.hasOwnProperty("defaultValue")) {
|
|
116
|
+
// result.properties[propName] = prop.defaultValue;
|
|
117
|
+
// }
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -122,5 +122,5 @@ class VelcronRenderers {
|
|
|
122
122
|
return result;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
VelcronRenderers.components = {};
|
|
126
125
|
exports.VelcronRenderers = VelcronRenderers;
|
|
126
|
+
VelcronRenderers.components = {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { VelcronBorder, VelcronColorStyling,
|
|
1
|
+
import { VelcronBorder, VelcronColorStyling, VelcronDimensions, VelcronRenderContext } from "../models";
|
|
2
2
|
import { VelcronUnitProvider } from "../models/VelcronUnitProvider";
|
|
3
|
+
import { VelcronDefinition } from "..";
|
|
3
4
|
export declare class VelcronStyles {
|
|
4
5
|
static styleProvider: (baseStyles: object, definition: VelcronDefinition, renderCtx: VelcronRenderContext) => any;
|
|
5
6
|
static unitProvider: VelcronUnitProvider;
|