@omnia/velcron 8.0.124-dev → 8.0.127-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/internal-do-not-import-from-here/shared/models/HttpCommon.d.ts +14 -0
- package/internal-do-not-import-from-here/shared/models/HttpCommon.js +7 -0
- package/internal-do-not-import-from-here/shared/models/OmniaSharedBootstrapData.d.ts +2 -1
- package/internal-do-not-import-from-here/shared/models/hub/activities/Activity.d.ts +14 -6
- package/internal-do-not-import-from-here/shared/models/hub/activities/Activity.js +7 -1
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityFeed.d.ts +10 -9
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivitySubscription.d.ts +16 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivitySubscription.js +5 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActorActivity.d.ts +40 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActorActivity.js +17 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/index.d.ts +2 -2
- package/internal-do-not-import-from-here/shared/models/hub/activities/index.js +2 -2
- package/internal-do-not-import-from-here/shared/models/hub/actors/Actor.d.ts +21 -0
- package/internal-do-not-import-from-here/shared/models/hub/actors/Actor.js +10 -0
- package/internal-do-not-import-from-here/shared/models/hub/actors/ExternalActorId.d.ts +2 -0
- package/internal-do-not-import-from-here/shared/models/hub/actors/index.d.ts +2 -0
- package/internal-do-not-import-from-here/shared/models/hub/actors/index.js +5 -0
- package/internal-do-not-import-from-here/shared/models/hub/index.d.ts +3 -1
- package/internal-do-not-import-from-here/shared/models/hub/index.js +3 -1
- package/internal-do-not-import-from-here/shared/models/hub/social/HubComment.d.ts +3 -3
- package/internal-do-not-import-from-here/shared/models/hub/social/HubReaction.d.ts +2 -2
- package/internal-do-not-import-from-here/shared/models/hub/targeting/ExternalIdentityProperty.d.ts +10 -0
- package/internal-do-not-import-from-here/shared/models/hub/targeting/ExternalIdentityProperty.js +19 -0
- package/internal-do-not-import-from-here/shared/models/hub/targeting/HubSource.d.ts +3 -0
- package/internal-do-not-import-from-here/shared/models/hub/targeting/HubSource.js +7 -0
- package/internal-do-not-import-from-here/shared/models/hub/targeting/index.d.ts +1 -0
- package/internal-do-not-import-from-here/shared/models/hub/targeting/index.js +4 -0
- package/internal-do-not-import-from-here/shared/models/theming/Blueprints.d.ts +122 -0
- package/internal-do-not-import-from-here/shared/models/theming/{ChromeDefinition.d.ts → Chrome.d.ts} +6 -6
- package/internal-do-not-import-from-here/shared/models/theming/SharedBlueprintMethods.d.ts +1 -1
- package/internal-do-not-import-from-here/shared/models/theming/SharedBlueprintMethods.js +6 -6
- package/internal-do-not-import-from-here/shared/models/theming/Spacing.d.ts +22 -0
- package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.d.ts +4 -4
- package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.js +1 -0
- package/internal-do-not-import-from-here/shared/models/theming/{TypographyDefinition.d.ts → Typography.d.ts} +19 -19
- package/internal-do-not-import-from-here/shared/models/theming/UseThemeMethods.d.ts +2 -2
- package/internal-do-not-import-from-here/shared/models/theming/index.d.ts +4 -4
- package/internal-do-not-import-from-here/shared/models/theming/index.js +4 -4
- package/internal-do-not-import-from-here/shared/models/velcron/VelcronDefinition.d.ts +2 -2
- package/internal-do-not-import-from-here/shared/models/velcron/VelcronEvents.d.ts +3 -0
- package/internal-do-not-import-from-here/shared/models/velcron/VelcronReference.d.ts +20 -0
- package/internal-do-not-import-from-here/shared/models/velcron/VelcronReference.js +5 -0
- package/internal-do-not-import-from-here/shared/models/velcron/index.d.ts +1 -0
- package/internal-do-not-import-from-here/shared/models/velcron/index.js +1 -0
- package/models/VelcronDefinitions.d.ts +27 -7
- package/package.json +1 -1
- package/parser/VelcronActions.d.ts +4 -2
- package/parser/VelcronActions.js +11 -5
- package/parser/VelcronConstants.d.ts +2 -0
- package/parser/VelcronConstants.js +3 -1
- package/parser/VelcronRenderers.d.ts +5 -1
- package/parser/VelcronRenderers.js +18 -1
- package/rules/IsEditMode.js +1 -1
- package/stores/VelcronColorSchema.d.ts +7 -7
- package/stores/VelcronTheming.d.ts +2 -2
- package/stores/VelcronTheming.js +2 -2
- package/internal-do-not-import-from-here/shared/models/hub/ExternalIdentityId.d.ts +0 -2
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivitySender.d.ts +0 -15
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivitySender.js +0 -5
- package/internal-do-not-import-from-here/shared/models/hub/activities/IdentityActivity.d.ts +0 -40
- package/internal-do-not-import-from-here/shared/models/hub/activities/IdentityActivity.js +0 -39
- package/internal-do-not-import-from-here/shared/models/theming/ComponentDefinitions.d.ts +0 -93
- package/internal-do-not-import-from-here/shared/models/theming/SpacingSetting.d.ts +0 -30
- /package/internal-do-not-import-from-here/shared/models/hub/{ExternalIdentityId.js → actors/ExternalActorId.js} +0 -0
- /package/internal-do-not-import-from-here/shared/models/theming/{ComponentDefinitions.js → Blueprints.js} +0 -0
- /package/internal-do-not-import-from-here/shared/models/theming/{ChromeDefinition.js → Chrome.js} +0 -0
- /package/internal-do-not-import-from-here/shared/models/theming/{SpacingSetting.js → Spacing.js} +0 -0
- /package/internal-do-not-import-from-here/shared/models/theming/{TypographyDefinition.js → Typography.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Guid } from "../Guid";
|
|
2
|
-
import {
|
|
2
|
+
import { Blueprints, BoxDimensions } from "./Blueprints";
|
|
3
3
|
export interface ColorTypeResult<resultType> {
|
|
4
4
|
base: resultType;
|
|
5
5
|
baseTone: resultType;
|
|
@@ -44,7 +44,7 @@ export interface ThemeDefinitionV2 {
|
|
|
44
44
|
name: string;
|
|
45
45
|
dark: boolean;
|
|
46
46
|
colors: ColorSchemas;
|
|
47
|
-
blueprints:
|
|
47
|
+
blueprints: Blueprints[];
|
|
48
48
|
}
|
|
49
49
|
export type ColorSchemaType = keyof typeof ColorSchemaTypes;
|
|
50
50
|
export declare enum ColorSchemaTypes {
|
|
@@ -56,7 +56,8 @@ export declare enum ColorSchemaTypes {
|
|
|
56
56
|
neutral = "neutral",
|
|
57
57
|
background = "background",
|
|
58
58
|
error = "error",
|
|
59
|
-
info = "info"
|
|
59
|
+
info = "info",
|
|
60
|
+
dynamic = "dynamic"
|
|
60
61
|
}
|
|
61
62
|
export type ColorType = keyof typeof ColorTypes;
|
|
62
63
|
export declare enum ColorTypes {
|
|
@@ -81,7 +82,6 @@ export interface ColorGradientValue {
|
|
|
81
82
|
}
|
|
82
83
|
/**Background */
|
|
83
84
|
export interface BackgroundDefinition {
|
|
84
|
-
filled?: boolean;
|
|
85
85
|
fill?: FillDefinition;
|
|
86
86
|
border?: BorderStylingDefinition;
|
|
87
87
|
elevation?: number;
|
|
@@ -12,6 +12,7 @@ var ColorSchemaTypes;
|
|
|
12
12
|
ColorSchemaTypes["background"] = "background";
|
|
13
13
|
ColorSchemaTypes["error"] = "error";
|
|
14
14
|
ColorSchemaTypes["info"] = "info";
|
|
15
|
+
ColorSchemaTypes["dynamic"] = "dynamic";
|
|
15
16
|
})(ColorSchemaTypes || (exports.ColorSchemaTypes = ColorSchemaTypes = {}));
|
|
16
17
|
var ColorTypes;
|
|
17
18
|
(function (ColorTypes) {
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { Guid } from "../Guid";
|
|
2
|
-
export interface
|
|
3
|
-
id: Guid;
|
|
2
|
+
export interface TypographyBlueprint {
|
|
4
3
|
name: string;
|
|
5
4
|
font?: {
|
|
5
|
+
id: Guid;
|
|
6
6
|
family: string;
|
|
7
7
|
cdn?: string;
|
|
8
8
|
};
|
|
9
9
|
title: {
|
|
10
|
-
xl:
|
|
11
|
-
l:
|
|
12
|
-
m:
|
|
13
|
-
s:
|
|
14
|
-
xs:
|
|
10
|
+
xl: TypographyDefinition;
|
|
11
|
+
l: TypographyDefinition;
|
|
12
|
+
m: TypographyDefinition;
|
|
13
|
+
s: TypographyDefinition;
|
|
14
|
+
xs: TypographyDefinition;
|
|
15
15
|
};
|
|
16
16
|
text: {
|
|
17
|
-
l:
|
|
18
|
-
m:
|
|
19
|
-
s:
|
|
20
|
-
xs:
|
|
17
|
+
l: TypographyDefinition;
|
|
18
|
+
m: TypographyDefinition;
|
|
19
|
+
s: TypographyDefinition;
|
|
20
|
+
xs: TypographyDefinition;
|
|
21
21
|
};
|
|
22
22
|
navigation: {
|
|
23
|
-
l:
|
|
24
|
-
m:
|
|
23
|
+
l: TypographyDefinition;
|
|
24
|
+
m: TypographyDefinition;
|
|
25
25
|
};
|
|
26
26
|
link: {
|
|
27
|
-
m:
|
|
27
|
+
m: TypographyDefinition;
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
export interface
|
|
30
|
+
export interface TypographyDefinition {
|
|
31
31
|
decoration?: string;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
lg: TypographyTypeBreakPoint;
|
|
33
|
+
md?: TypographyTypeBreakPoint;
|
|
34
|
+
sm?: TypographyTypeBreakPoint;
|
|
35
35
|
}
|
|
36
36
|
export interface TypographyTypeBreakPoint {
|
|
37
37
|
weight: number;
|
|
@@ -48,7 +48,7 @@ export interface ThemedTypographyValue {
|
|
|
48
48
|
type: TypographyType;
|
|
49
49
|
size: TypographySize;
|
|
50
50
|
}
|
|
51
|
-
export type TypographyValue =
|
|
51
|
+
export type TypographyValue = TypographyDefinition | ThemedTypographyValue;
|
|
52
52
|
export type TypographySize = keyof typeof TypographySizes;
|
|
53
53
|
export declare enum TypographySizes {
|
|
54
54
|
xl = "xl",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ColorDefinition, ColorSchema, ColorSchemaType, ColorSchemaTypes, ColorType, ColorTypes } from "./ThemeDefinitionV2";
|
|
2
|
-
import {
|
|
2
|
+
import { Blueprints, BlueprintType } from "./Blueprints";
|
|
3
3
|
export declare function useThemeMethods(getThemeDefinition: () => any): {
|
|
4
4
|
colorSchema: (colorSchemaType: ColorSchemaTypes | ColorSchemaType) => ColorSchema;
|
|
5
|
-
bluePrintbyType: <TType extends
|
|
5
|
+
bluePrintbyType: <TType extends Blueprints>(type: BlueprintType) => TType;
|
|
6
6
|
color: (colorSchemaType: ColorSchemaTypes | ColorSchemaType, colorType: ColorTypes | ColorType) => string;
|
|
7
7
|
colorDefinition: (colorSchemaType: ColorSchemaTypes | ColorSchemaType, colorType: ColorTypes | ColorType) => ColorDefinition;
|
|
8
8
|
complementaryColorType: (colorType: ColorTypes | ColorType) => ColorTypes;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from "./ThemeDefinitionV2";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./Typography";
|
|
3
3
|
export * from "./UseThemeMethods";
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./SpacingSetting";
|
|
4
|
+
export * from "./Spacing";
|
|
6
5
|
export * from "./SharedBlueprintMethods";
|
|
7
6
|
export * from "./SharedColorMethods";
|
|
8
|
-
export * from "./
|
|
7
|
+
export * from "./Chrome";
|
|
8
|
+
export * from "./Blueprints";
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./ThemeDefinitionV2"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./
|
|
5
|
+
tslib_1.__exportStar(require("./Typography"), exports);
|
|
6
6
|
//export * from "./OmniaThemes";
|
|
7
7
|
tslib_1.__exportStar(require("./UseThemeMethods"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./
|
|
9
|
-
tslib_1.__exportStar(require("./SpacingSetting"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./Spacing"), exports);
|
|
10
9
|
tslib_1.__exportStar(require("./SharedBlueprintMethods"), exports);
|
|
11
10
|
tslib_1.__exportStar(require("./SharedColorMethods"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./
|
|
11
|
+
tslib_1.__exportStar(require("./Chrome"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./Blueprints"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DynamicState } from "../DynamicState";
|
|
2
|
-
import { VelcronEvent, VelcronOnEditModeEvent, VelcronOnLoadEvent } from "./VelcronEvents";
|
|
2
|
+
import { VelcronEvent, VelcronOnEditModeEvent, VelcronOnLoadEvent, VelcronOnSaveEvent } from "./VelcronEvents";
|
|
3
3
|
/**
|
|
4
4
|
* Velcron definition base
|
|
5
5
|
*/
|
|
@@ -73,7 +73,7 @@ export interface VelcronAppDefinition<TState extends DynamicState = DynamicState
|
|
|
73
73
|
version?: string;
|
|
74
74
|
name?: string;
|
|
75
75
|
body?: Array<VelcronDefinition>;
|
|
76
|
-
events?: VelcronOnLoadEvent & VelcronOnEditModeEvent;
|
|
76
|
+
events?: VelcronOnLoadEvent & VelcronOnEditModeEvent & VelcronOnSaveEvent;
|
|
77
77
|
actions?: {
|
|
78
78
|
[name: string]: Array<string>;
|
|
79
79
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GuidValue } from "../Guid";
|
|
2
|
+
import { StronglyTypedId } from "../StronglyTypedId";
|
|
3
|
+
import { VelcronAppDefinition } from "./VelcronDefinition";
|
|
4
|
+
export type VelcronRendererId = StronglyTypedId<string, "VelcronRendererId">;
|
|
5
|
+
export declare function VelcronRendererId(id: GuidValue): VelcronRendererId;
|
|
6
|
+
export interface VelcronRendererResolverReference {
|
|
7
|
+
id: VelcronRendererId;
|
|
8
|
+
resolver: string;
|
|
9
|
+
version: string;
|
|
10
|
+
}
|
|
11
|
+
export interface VelcronRendererReference {
|
|
12
|
+
id: VelcronRendererId;
|
|
13
|
+
version: string;
|
|
14
|
+
}
|
|
15
|
+
export interface VelcronRendererWithJson extends VelcronRendererReference {
|
|
16
|
+
definition: string;
|
|
17
|
+
}
|
|
18
|
+
export interface VelcronRenderer extends VelcronRendererReference {
|
|
19
|
+
definition: VelcronAppDefinition;
|
|
20
|
+
}
|
|
@@ -3,3 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./VelcronDefinition"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./VelcronEvents"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./VelcronReference"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { VelcronOnUpdatedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnPressEvent, VelcronSpacing, VelcronStyling, VelcronCustomComponentDefinition, VelcronAppDefinition } from "@omnia/velcron/internal-do-not-import-from-here/shared/models";
|
|
1
|
+
import { VelcronOnUpdatedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnPressEvent, VelcronSpacing, VelcronStyling, VelcronCustomComponentDefinition, VelcronAppDefinition, VelcronRendererResolverReference } from "@omnia/velcron/internal-do-not-import-from-here/shared/models";
|
|
2
2
|
import { VelcroncomponentArrayType, VelcronPrimitiveType } from "./VelcronTypes";
|
|
3
3
|
import { AssignOperators, VelcronHorizontalAlignments, VelcronIconTypes, VelcronActionTypes, VelcronVerticalAlignments } from "./Enums";
|
|
4
|
-
import {
|
|
4
|
+
import { DynamicState, VelcronDefinition, useVelcronThemingStore } from "..";
|
|
5
5
|
import { GuidValue, PropertyConfiguration, PropertyValue, PropertyDefinition, PropertySetupBase } from "@omnia/fx/models";
|
|
6
6
|
import { useVelcronColorSchemaStore } from "../stores/VelcronColorSchema";
|
|
7
7
|
export interface ResolvedComponentRenderer {
|
|
@@ -32,6 +32,8 @@ export interface BuiltInComponentRenderers {
|
|
|
32
32
|
"checkbox": unknown;
|
|
33
33
|
"reference": unknown;
|
|
34
34
|
"radio": unknown;
|
|
35
|
+
"rive": unknown;
|
|
36
|
+
"lottie": unknown;
|
|
35
37
|
}
|
|
36
38
|
export interface ColorSchemaReference {
|
|
37
39
|
name: string;
|
|
@@ -74,7 +76,6 @@ export interface VelcronRenderContextHooks {
|
|
|
74
76
|
onItemSelected?: ((item: VelcronDefinition) => void);
|
|
75
77
|
onItemRendered?: ((item: VelcronDefinition) => OnItemRenderedHookResult);
|
|
76
78
|
onItemCreatedProps?: ((item: VelcronDefinition) => object);
|
|
77
|
-
onLoadReference?: ((reference: ActivityRendererReference) => Promise<VelcronDefinition>);
|
|
78
79
|
}
|
|
79
80
|
export interface VelcronContainerRenderer {
|
|
80
81
|
definition: VelcronDefinition;
|
|
@@ -178,7 +179,7 @@ export declare enum VelcronImageRatios {
|
|
|
178
179
|
square = "square",
|
|
179
180
|
landscape = "landscape"
|
|
180
181
|
}
|
|
181
|
-
export interface VelcronImageDefinition extends
|
|
182
|
+
export interface VelcronImageDefinition extends VelcronDefinitionWithEditMode {
|
|
182
183
|
type: "image";
|
|
183
184
|
url?: VelcronBindableProp<string>;
|
|
184
185
|
bind?: VelcronBindableProp<string>;
|
|
@@ -236,6 +237,24 @@ export interface VelcronMarkdownDefinition extends VelcronDefinitionWithEditMode
|
|
|
236
237
|
type: "markdown";
|
|
237
238
|
events: VelcronOnUpdatedEvent;
|
|
238
239
|
}
|
|
240
|
+
export interface VelcronRiveDefinition extends VelcronDefinition {
|
|
241
|
+
type: "rive";
|
|
242
|
+
url: VelcronBindableProp;
|
|
243
|
+
loop?: VelcronBindableProp<boolean>;
|
|
244
|
+
autoplay?: VelcronBindableProp<boolean>;
|
|
245
|
+
count?: VelcronBindableProp<number>;
|
|
246
|
+
direction?: VelcronBindableProp<"normal" | "reverse">;
|
|
247
|
+
hover?: VelcronBindableProp<boolean>;
|
|
248
|
+
}
|
|
249
|
+
export interface VelcronLottieDefinition extends VelcronDefinition {
|
|
250
|
+
type: "lottie";
|
|
251
|
+
url: VelcronBindableProp;
|
|
252
|
+
loop?: VelcronBindableProp<boolean>;
|
|
253
|
+
autoplay?: VelcronBindableProp<boolean>;
|
|
254
|
+
count?: VelcronBindableProp<number>;
|
|
255
|
+
direction?: VelcronBindableProp<"normal" | "reverse">;
|
|
256
|
+
hover?: VelcronBindableProp<boolean>;
|
|
257
|
+
}
|
|
239
258
|
export interface VelcronDimensions {
|
|
240
259
|
top: number | string;
|
|
241
260
|
right: number | string;
|
|
@@ -259,11 +278,12 @@ export interface VelcronSlotDefinition extends VelcronDefinition {
|
|
|
259
278
|
type: "slot";
|
|
260
279
|
bind: VelcronBindableProp<string>;
|
|
261
280
|
}
|
|
262
|
-
export interface
|
|
281
|
+
export interface VelcronReferenceDefinition extends VelcronDefinition {
|
|
263
282
|
type: "reference";
|
|
264
|
-
to:
|
|
283
|
+
to: VelcronRendererResolverReference;
|
|
284
|
+
state: string;
|
|
265
285
|
}
|
|
266
|
-
export interface VelcronPropertyDefinition extends
|
|
286
|
+
export interface VelcronPropertyDefinition extends VelcronDefinitionWithEditMode {
|
|
267
287
|
type: "property";
|
|
268
288
|
bind: VelcronBindableProp<string>;
|
|
269
289
|
}
|
package/package.json
CHANGED
|
@@ -3,11 +3,13 @@ import { IActionHandler } from "../actions";
|
|
|
3
3
|
export declare class VelcronActions {
|
|
4
4
|
static _actionHandlers: {
|
|
5
5
|
[name: string]: IActionHandler;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
static actionHooks: {
|
|
8
8
|
[name: string]: VelcronActionHooks;
|
|
9
9
|
};
|
|
10
|
-
static
|
|
10
|
+
private static registeredBuiltInHandlers;
|
|
11
|
+
static registerAction(handler: IActionHandler): void;
|
|
12
|
+
static unregisterAction(name: string): void;
|
|
11
13
|
static parseAndExecuteActions(templates: Array<string>, renderContext: VelcronRenderContext, customActionContext?: VelcronCustomActionExecutionContext): void;
|
|
12
14
|
static parseFunction(target: {
|
|
13
15
|
[name: string]: Array<string>;
|
package/parser/VelcronActions.js
CHANGED
|
@@ -9,8 +9,8 @@ const builtInHandlers = tslib_1.__importStar(require("../actions"));
|
|
|
9
9
|
const ActionResults_1 = require("../actions/ActionResults");
|
|
10
10
|
const VelcronLogger_1 = require("./VelcronLogger");
|
|
11
11
|
class VelcronActions {
|
|
12
|
-
static registerAction(
|
|
13
|
-
name = name.toLowerCase();
|
|
12
|
+
static registerAction(handler) {
|
|
13
|
+
const name = handler.name.toLowerCase();
|
|
14
14
|
if (this._actionHandlers && this._actionHandlers[name]) {
|
|
15
15
|
VelcronLogger_1.VelcronLogger.logActionError(`The action handler with name ${name} is already registered`);
|
|
16
16
|
}
|
|
@@ -18,6 +18,11 @@ class VelcronActions {
|
|
|
18
18
|
this._actionHandlers[name] = handler;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
static unregisterAction(name) {
|
|
22
|
+
if (this._actionHandlers && this._actionHandlers[name]) {
|
|
23
|
+
delete this._actionHandlers[name];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
21
26
|
static parseAndExecuteActions(templates, renderContext, customActionContext) {
|
|
22
27
|
if (!templates) {
|
|
23
28
|
VelcronLogger_1.VelcronLogger.logActionError("The event template is empty");
|
|
@@ -257,13 +262,13 @@ class VelcronActions {
|
|
|
257
262
|
const actionName = awAction.action.substring(0, awAction.action.indexOf("(")).trim().toLowerCase();
|
|
258
263
|
//promise = VelcronActions.runHandler(awAction, actionName, params);
|
|
259
264
|
if (!VelcronActions._actionHandlers) {
|
|
260
|
-
VelcronActions._actionHandlers = {};
|
|
261
265
|
Object.keys(builtInHandlers).forEach((key) => {
|
|
262
266
|
const handler = builtInHandlers[key];
|
|
263
267
|
if (handler && handler.name && VelcronActions._actionHandlers) {
|
|
264
|
-
VelcronActions.
|
|
268
|
+
VelcronActions.registerAction(handler);
|
|
265
269
|
}
|
|
266
270
|
});
|
|
271
|
+
VelcronActions.registeredBuiltInHandlers = true;
|
|
267
272
|
}
|
|
268
273
|
const paramValues = [];
|
|
269
274
|
params.forEach(param => paramValues.push(param.value));
|
|
@@ -452,8 +457,9 @@ class VelcronActions {
|
|
|
452
457
|
}
|
|
453
458
|
}
|
|
454
459
|
exports.VelcronActions = VelcronActions;
|
|
455
|
-
VelcronActions._actionHandlers =
|
|
460
|
+
VelcronActions._actionHandlers = {};
|
|
456
461
|
VelcronActions.actionHooks = {};
|
|
462
|
+
VelcronActions.registeredBuiltInHandlers = false;
|
|
457
463
|
var VelcronActionParameterDataType;
|
|
458
464
|
(function (VelcronActionParameterDataType) {
|
|
459
465
|
VelcronActionParameterDataType[VelcronActionParameterDataType["text"] = 0] = "text";
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { BuiltInComponentRenderers, ResolvedComponentRenderer, VelcronRenderContext } from "../models";
|
|
2
|
-
import { DynamicState, VelcronDefinition } from "..";
|
|
2
|
+
import { DynamicState, VelcronDefinition, VelcronRendererResolverReference } from "..";
|
|
3
3
|
export declare class VelcronRenderers {
|
|
4
4
|
private static components;
|
|
5
|
+
private static referenceResolvers;
|
|
5
6
|
static registerComponent(type: string, component: any): void;
|
|
6
7
|
static hasComponents(): boolean;
|
|
7
8
|
static hasComponent(type: string): any;
|
|
8
9
|
static registerComponents(components: BuiltInComponentRenderers): void;
|
|
9
10
|
static getComponent(definition: VelcronDefinition, renderContext: VelcronRenderContext): ResolvedComponentRenderer;
|
|
11
|
+
static registerReferenceResolver(resolverName: string, resolverFunction: (reference: VelcronRendererResolverReference) => Promise<VelcronDefinition>): void;
|
|
12
|
+
static getReferenceResolver(resolverName: string): (reference: VelcronRendererResolverReference) => Promise<VelcronDefinition>;
|
|
13
|
+
static hasReferenceResolver(resolverName: string): boolean;
|
|
10
14
|
static definitionContainsCustomColorSchema(definition: VelcronDefinition): boolean;
|
|
11
15
|
static createNewRendererContext(currentRenderCtx: VelcronRenderContext, definition: VelcronDefinition, newViewModel?: DynamicState): VelcronRenderContext;
|
|
12
16
|
static ensureRenderContext(rendererInfo: ResolvedComponentRenderer, definition: VelcronDefinition, currentRenderCtx: VelcronRenderContext, newViewModel?: DynamicState): VelcronRenderContext;
|
|
@@ -55,10 +55,26 @@ class VelcronRenderers {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
58
|
-
|
|
58
|
+
result = {
|
|
59
|
+
component: this.components["text"],
|
|
60
|
+
definition: {
|
|
61
|
+
"type": "Text",
|
|
62
|
+
"text": `Error: Velcron cant find component with name: ${definition.type}`
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
//throw "Cant find component";
|
|
59
66
|
}
|
|
60
67
|
return result;
|
|
61
68
|
}
|
|
69
|
+
static registerReferenceResolver(resolverName, resolverFunction) {
|
|
70
|
+
this.referenceResolvers[resolverName] = resolverFunction;
|
|
71
|
+
}
|
|
72
|
+
static getReferenceResolver(resolverName) {
|
|
73
|
+
return this.referenceResolvers[resolverName];
|
|
74
|
+
}
|
|
75
|
+
static hasReferenceResolver(resolverName) {
|
|
76
|
+
return this.referenceResolvers[resolverName] ? true : false;
|
|
77
|
+
}
|
|
62
78
|
static definitionContainsCustomColorSchema(definition) {
|
|
63
79
|
return definition.colorSchemaType && definition.colorSchemaType !== "";
|
|
64
80
|
}
|
|
@@ -124,3 +140,4 @@ class VelcronRenderers {
|
|
|
124
140
|
}
|
|
125
141
|
exports.VelcronRenderers = VelcronRenderers;
|
|
126
142
|
VelcronRenderers.components = {};
|
|
143
|
+
VelcronRenderers.referenceResolvers = {};
|
package/rules/IsEditMode.js
CHANGED
|
@@ -26,7 +26,7 @@ function isEditMode(definition, renderContext) {
|
|
|
26
26
|
return false;
|
|
27
27
|
}
|
|
28
28
|
let result = false;
|
|
29
|
-
if (definition.edit) {
|
|
29
|
+
if ("edit" in definition && definition.edit !== undefined) {
|
|
30
30
|
result = parser_1.VelcronData.evaluateBoolean(definition.edit, renderContext);
|
|
31
31
|
}
|
|
32
32
|
else if (renderContext.editMode) {
|
|
@@ -8,21 +8,21 @@ export declare const useVelcronColorSchemaStore: (newStateWithName?: string) =>
|
|
|
8
8
|
onContainer: ColorDefinition;
|
|
9
9
|
isContainer: boolean;
|
|
10
10
|
name: string;
|
|
11
|
-
colorSchemaType: "info" | "error" | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background" |
|
|
11
|
+
colorSchemaType: "info" | "error" | ColorSchemaTypes | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background" | "dynamic";
|
|
12
12
|
themeStore: {
|
|
13
13
|
state: {
|
|
14
14
|
currentTheme: import("@omnia/fx-models").ThemeDefinitionV2;
|
|
15
15
|
};
|
|
16
16
|
get: {
|
|
17
|
-
componentBlueprints: (blueprintType: import("@omnia/fx-models").VelcronBlueprintDefintionTypes) => import("@omnia/fx-models").
|
|
18
|
-
colorSchema: (colorSchemaType: "info" | "error" | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background" |
|
|
17
|
+
componentBlueprints: (blueprintType: import("@omnia/fx-models").VelcronBlueprintDefintionTypes) => import("@omnia/fx-models").ComponentBlueprints;
|
|
18
|
+
colorSchema: (colorSchemaType: "info" | "error" | ColorSchemaTypes | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background" | "dynamic") => ColorSchema;
|
|
19
19
|
spacing: () => import("@omnia/fx-models").SpacingDefinition;
|
|
20
20
|
typography: (typographyType: "title" | "text" | "navigation" | import("@omnia/fx-models").TypographyTypes, size: "xs" | "s" | "m" | "l" | "xl" | import("@omnia/fx-models").TypographySizes) => any;
|
|
21
|
-
color: (colorSchemaType: "info" | "error" | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background" |
|
|
22
|
-
colorDefinition: (colorSchemaType: "info" | "error" | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background" |
|
|
21
|
+
color: (colorSchemaType: "info" | "error" | ColorSchemaTypes | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background" | "dynamic", colorType: "base" | "onBase" | "container" | "onContainer" | import("@omnia/fx-models").ColorTypes) => string;
|
|
22
|
+
colorDefinition: (colorSchemaType: "info" | "error" | ColorSchemaTypes | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background" | "dynamic", colorType: "base" | "onBase" | "container" | "onContainer" | import("@omnia/fx-models").ColorTypes) => ColorDefinition;
|
|
23
23
|
complementaryColorType: (colorType: "base" | "onBase" | "container" | "onContainer" | import("@omnia/fx-models").ColorTypes) => import("@omnia/fx-models").ColorTypes;
|
|
24
|
-
complementaryColor: (colorSchemaType: "info" | "error" | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background" |
|
|
25
|
-
complementaryColorDefinition: (colorSchemaType: "info" | "error" | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background" |
|
|
24
|
+
complementaryColor: (colorSchemaType: "info" | "error" | ColorSchemaTypes | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background" | "dynamic", colorType: "base" | "onBase" | "container" | "onContainer" | import("@omnia/fx-models").ColorTypes) => string;
|
|
25
|
+
complementaryColorDefinition: (colorSchemaType: "info" | "error" | ColorSchemaTypes | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background" | "dynamic", colorType: "base" | "onBase" | "container" | "onContainer" | import("@omnia/fx-models").ColorTypes) => ColorDefinition;
|
|
26
26
|
currentTheme: () => import("@omnia/fx-models").ThemeDefinitionV2;
|
|
27
27
|
};
|
|
28
28
|
actions: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ColorSchemaType, ColorSchemaTypes, ColorType, ColorTypes,
|
|
1
|
+
import { ColorSchemaType, ColorSchemaTypes, ColorType, ColorTypes, ComponentBlueprints, SpacingDefinition, ThemeDefinitionV2, TypographySize, TypographySizes, TypographyType, TypographyTypes, VelcronBlueprintDefintionTypes } from "..";
|
|
2
2
|
export declare const useVelcronThemingStore: (newStateWithName?: string) => {
|
|
3
3
|
state: {
|
|
4
4
|
currentTheme: ThemeDefinitionV2;
|
|
5
5
|
};
|
|
6
6
|
get: {
|
|
7
|
-
componentBlueprints: (blueprintType: VelcronBlueprintDefintionTypes) =>
|
|
7
|
+
componentBlueprints: (blueprintType: VelcronBlueprintDefintionTypes) => ComponentBlueprints;
|
|
8
8
|
colorSchema: (colorSchemaType: ColorSchemaTypes | ColorSchemaType) => import("..").ColorSchema;
|
|
9
9
|
spacing: () => SpacingDefinition;
|
|
10
10
|
typography: (typographyType: TypographyTypes | TypographyType, size: TypographySizes | TypographySize) => any;
|
package/stores/VelcronTheming.js
CHANGED
|
@@ -20,10 +20,10 @@ exports.useVelcronThemingStore = (0, _1.defineVelcronStore)("VelcronTheming", {
|
|
|
20
20
|
return (0, __1.useThemeMethods)(() => state.currentTheme).colorSchema(colorSchemaType);
|
|
21
21
|
},
|
|
22
22
|
spacing: () => {
|
|
23
|
-
return (0, __1.useThemeMethods)(() => state.currentTheme).bluePrintbyType("spacing").
|
|
23
|
+
return (0, __1.useThemeMethods)(() => state.currentTheme).bluePrintbyType("spacing").primary.inner;
|
|
24
24
|
},
|
|
25
25
|
typography: (typographyType, size) => {
|
|
26
|
-
const typography = (0, __1.useThemeMethods)(() => state.currentTheme).bluePrintbyType("typography").
|
|
26
|
+
const typography = (0, __1.useThemeMethods)(() => state.currentTheme).bluePrintbyType("typography").primary;
|
|
27
27
|
if (typographyType === __1.TypographyTypes.text) {
|
|
28
28
|
return typography.text[size];
|
|
29
29
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { StronglyTypedId } from "../../StronglyTypedId";
|
|
2
|
-
export type ActivitySenderId = StronglyTypedId<number, "ActivitySenderId">;
|
|
3
|
-
export declare function ActivitySenderId(id: number): ActivitySenderId;
|
|
4
|
-
export interface ActivitySenderWithBag<TBag> extends ActivitySender {
|
|
5
|
-
bag: TBag;
|
|
6
|
-
}
|
|
7
|
-
export interface ActivitySender extends ActivitySenderBase {
|
|
8
|
-
id: ActivitySenderId;
|
|
9
|
-
imageUrl: string;
|
|
10
|
-
}
|
|
11
|
-
export interface ActivitySenderBase {
|
|
12
|
-
name: Record<string, string>;
|
|
13
|
-
description: Record<string, string>;
|
|
14
|
-
externalId: string;
|
|
15
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { DynamicState } from "../../DynamicState";
|
|
2
|
-
import { Activity, ActivityId } from "./Activity";
|
|
3
|
-
import { ChannelId } from "./ActivityChannel";
|
|
4
|
-
import { ActivitySender, ActivitySenderId } from "./ActivitySender";
|
|
5
|
-
export declare enum IdentityActivityStatus {
|
|
6
|
-
new = 0,
|
|
7
|
-
read = 1,
|
|
8
|
-
completed = 2
|
|
9
|
-
}
|
|
10
|
-
export declare enum IdentityActivityCategory {
|
|
11
|
-
none = 0,
|
|
12
|
-
important = 1,
|
|
13
|
-
todo = 2,
|
|
14
|
-
snoozed = 3,
|
|
15
|
-
bookmarked = 4
|
|
16
|
-
}
|
|
17
|
-
export interface IdentityActivityBase {
|
|
18
|
-
activityId: ActivityId;
|
|
19
|
-
status: IdentityActivityStatus;
|
|
20
|
-
category: IdentityActivityCategory;
|
|
21
|
-
}
|
|
22
|
-
export interface IdentityActivity<TRenderState extends DynamicState, TState extends DynamicState> extends IdentityActivityBase {
|
|
23
|
-
activity: Activity<TRenderState>;
|
|
24
|
-
state?: TState;
|
|
25
|
-
}
|
|
26
|
-
export interface IdentityActivityWithJson extends IdentityActivityBase {
|
|
27
|
-
stateJson: string;
|
|
28
|
-
}
|
|
29
|
-
export interface NewActivitiesBySenderBase {
|
|
30
|
-
count: number;
|
|
31
|
-
senderId: ActivitySenderId;
|
|
32
|
-
}
|
|
33
|
-
export interface NewActivitiesBySender extends NewActivitiesBySenderBase {
|
|
34
|
-
sender: ActivitySender;
|
|
35
|
-
channelId: ChannelId;
|
|
36
|
-
}
|
|
37
|
-
export interface ActivityCategoryCount {
|
|
38
|
-
category: IdentityActivityCategory;
|
|
39
|
-
count: number;
|
|
40
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IdentityActivityCategory = exports.IdentityActivityStatus = void 0;
|
|
4
|
-
var IdentityActivityStatus;
|
|
5
|
-
(function (IdentityActivityStatus) {
|
|
6
|
-
IdentityActivityStatus[IdentityActivityStatus["new"] = 0] = "new";
|
|
7
|
-
IdentityActivityStatus[IdentityActivityStatus["read"] = 1] = "read";
|
|
8
|
-
IdentityActivityStatus[IdentityActivityStatus["completed"] = 2] = "completed";
|
|
9
|
-
})(IdentityActivityStatus || (exports.IdentityActivityStatus = IdentityActivityStatus = {}));
|
|
10
|
-
var IdentityActivityCategory;
|
|
11
|
-
(function (IdentityActivityCategory) {
|
|
12
|
-
IdentityActivityCategory[IdentityActivityCategory["none"] = 0] = "none";
|
|
13
|
-
IdentityActivityCategory[IdentityActivityCategory["important"] = 1] = "important";
|
|
14
|
-
IdentityActivityCategory[IdentityActivityCategory["todo"] = 2] = "todo";
|
|
15
|
-
IdentityActivityCategory[IdentityActivityCategory["snoozed"] = 3] = "snoozed";
|
|
16
|
-
IdentityActivityCategory[IdentityActivityCategory["bookmarked"] = 4] = "bookmarked";
|
|
17
|
-
})(IdentityActivityCategory || (exports.IdentityActivityCategory = IdentityActivityCategory = {}));
|
|
18
|
-
// Usage
|
|
19
|
-
// const activity1: IdentityActivity<SomeRenderState> = {
|
|
20
|
-
// activity: {
|
|
21
|
-
// // Initialize your Activity here
|
|
22
|
-
// },
|
|
23
|
-
// state: {
|
|
24
|
-
// // Initialize your State here
|
|
25
|
-
// },
|
|
26
|
-
// };
|
|
27
|
-
// const activity2: IdentityActivity<SomeRenderState, SomeState> = {
|
|
28
|
-
// activity: {
|
|
29
|
-
// // Initialize your Activity here
|
|
30
|
-
// },
|
|
31
|
-
// state: {
|
|
32
|
-
// // Initialize your State here
|
|
33
|
-
// },
|
|
34
|
-
// };
|
|
35
|
-
// const activity3: IdentityActivityWithJson = {
|
|
36
|
-
// activityId: 22,
|
|
37
|
-
// status: IdentityActivityStatus.unRead,
|
|
38
|
-
// stateJson: "someJson",
|
|
39
|
-
// };
|