@omnia/velcron 8.0.135-dev → 8.0.136-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/events/CreateEventHook.d.ts +5 -0
- package/events/CreateEventHook.js +29 -0
- package/events/index.d.ts +1 -0
- package/events/index.js +4 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/internal-do-not-import-from-here/shared/models/EventHook.d.ts +10 -0
- package/internal-do-not-import-from-here/shared/models/EventHook.js +2 -0
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActorActivity.d.ts +8 -0
- package/internal-do-not-import-from-here/shared/models/index.d.ts +1 -0
- package/internal-do-not-import-from-here/shared/models/index.js +1 -0
- package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.d.ts +6 -0
- 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 +2 -2
- package/models/VelcronDefinitions.d.ts +5 -2
- package/package.json +1 -1
- package/parser/VelcronActions.js +1 -2
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createVelcronEventHook = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Utility for creating event hooks on the fly
|
|
6
|
+
*/
|
|
7
|
+
function createVelcronEventHook() {
|
|
8
|
+
const fns = [];
|
|
9
|
+
function off(fn) {
|
|
10
|
+
const index = fns.indexOf(fn);
|
|
11
|
+
if (index !== -1)
|
|
12
|
+
fns.splice(index, 1);
|
|
13
|
+
}
|
|
14
|
+
function on(fn) {
|
|
15
|
+
fns.push(fn);
|
|
16
|
+
return {
|
|
17
|
+
off: () => off(fn),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function trigger(param) {
|
|
21
|
+
fns.forEach(fn => fn(param));
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
on,
|
|
25
|
+
off,
|
|
26
|
+
trigger,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
exports.createVelcronEventHook = createVelcronEventHook;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./CreateEventHook";
|
package/events/index.js
ADDED
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -8,3 +8,4 @@ tslib_1.__exportStar(require("./stores"), exports);
|
|
|
8
8
|
tslib_1.__exportStar(require("@omnia/velcron/internal-do-not-import-from-here/shared/models"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./rules"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./templatebuilder"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./events"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type EventHookOn<T = any> = (fn: (param: T) => void) => {
|
|
2
|
+
off: () => void;
|
|
3
|
+
};
|
|
4
|
+
export type EventHookOff<T = any> = (fn: (param: T) => void) => void;
|
|
5
|
+
export type EventHookTrigger<T = any> = (param: T) => void;
|
|
6
|
+
export interface EventHook<T = any> {
|
|
7
|
+
on: EventHookOn<T>;
|
|
8
|
+
off: EventHookOff<T>;
|
|
9
|
+
trigger: EventHookTrigger<T>;
|
|
10
|
+
}
|
|
@@ -14,6 +14,14 @@ export declare enum ActorActivityCategory {
|
|
|
14
14
|
snoozed = 3,
|
|
15
15
|
bookmarked = 4
|
|
16
16
|
}
|
|
17
|
+
export interface ActivitySettings {
|
|
18
|
+
category: ActorActivityCategory;
|
|
19
|
+
social: ActivitySocialSettings;
|
|
20
|
+
}
|
|
21
|
+
export interface ActivitySocialSettings {
|
|
22
|
+
comments: boolean;
|
|
23
|
+
reactions: boolean;
|
|
24
|
+
}
|
|
17
25
|
export interface ActorActivityBase {
|
|
18
26
|
activityId: ActivityId;
|
|
19
27
|
status: ActorActivityStatus;
|
|
@@ -23,3 +23,4 @@ tslib_1.__exportStar(require("./hub"), exports);
|
|
|
23
23
|
tslib_1.__exportStar(require("./velcron"), exports);
|
|
24
24
|
tslib_1.__exportStar(require("./DependencyInjection"), exports);
|
|
25
25
|
tslib_1.__exportStar(require("./Messaging"), exports);
|
|
26
|
+
tslib_1.__exportStar(require("./EventHook"), exports);
|
|
@@ -71,6 +71,12 @@ export interface ThemeDefinitionV2 extends ThemeDefinitionReference {
|
|
|
71
71
|
spacing: SpacingBlueprints;
|
|
72
72
|
components: ComponentBlueprints;
|
|
73
73
|
}
|
|
74
|
+
export interface ITemplateRegistration<TTemplateType = any> {
|
|
75
|
+
id: Guid;
|
|
76
|
+
template: TTemplateType;
|
|
77
|
+
hidden?: boolean;
|
|
78
|
+
custom?: boolean;
|
|
79
|
+
}
|
|
74
80
|
export type ColorSchemaType = keyof typeof ColorSchemaTypes;
|
|
75
81
|
export declare enum ColorSchemaTypes {
|
|
76
82
|
primary = "primary",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DynamicState } from "../DynamicState";
|
|
2
|
-
import { VelcronEvent, VelcronOnEditModeEvent, VelcronOnLoadEvent,
|
|
2
|
+
import { VelcronEvent, VelcronOnEditModeEvent, VelcronOnLoadEvent, VelcronOnSavingEvent } 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 & VelcronOnSavingEvent;
|
|
77
77
|
actions?: {
|
|
78
78
|
[name: string]: Array<string>;
|
|
79
79
|
};
|
|
@@ -4,8 +4,8 @@ export type VelcronOnPressEvent = {
|
|
|
4
4
|
export type VelcronOnLoadEvent = {
|
|
5
5
|
onLoaded?: Array<string>;
|
|
6
6
|
};
|
|
7
|
-
export type
|
|
8
|
-
|
|
7
|
+
export type VelcronOnSavingEvent = {
|
|
8
|
+
onSaving?: Array<string>;
|
|
9
9
|
};
|
|
10
10
|
export type VelcronOnEditModeEvent = {
|
|
11
11
|
onEditMode?: Array<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VelcronOnUpdatedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnPressEvent, VelcronSpacing, VelcronStyling, VelcronCustomComponentDefinition, VelcronAppDefinition, VelcronRendererResolverReference } from "@omnia/velcron/internal-do-not-import-from-here/shared/models";
|
|
1
|
+
import { VelcronOnUpdatedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnPressEvent, VelcronSpacing, VelcronStyling, VelcronCustomComponentDefinition, VelcronAppDefinition, VelcronRendererResolverReference, EventHook, Future } 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
4
|
import { DynamicState, VelcronDefinition, useVelcronThemingStore } from "..";
|
|
@@ -61,7 +61,7 @@ export interface VelcronRenderContext {
|
|
|
61
61
|
};
|
|
62
62
|
parent?: VelcronRenderContext;
|
|
63
63
|
hooks?: VelcronRenderContextHooks;
|
|
64
|
-
eventHandlers?:
|
|
64
|
+
eventHandlers?: VelcronRenderContextEventHandlersInstance;
|
|
65
65
|
editMode?: boolean;
|
|
66
66
|
disposers: Array<() => void>;
|
|
67
67
|
}
|
|
@@ -71,6 +71,9 @@ export interface VelcronRenderContextEventHandlers {
|
|
|
71
71
|
};
|
|
72
72
|
emitting?: <T>(emitter: (i: T) => T) => T;
|
|
73
73
|
}
|
|
74
|
+
export interface VelcronRenderContextEventHandlersInstance extends VelcronRenderContextEventHandlers {
|
|
75
|
+
emitOnSaved: EventHook<Future<void>>;
|
|
76
|
+
}
|
|
74
77
|
export interface VelcronRenderContextHooks {
|
|
75
78
|
dialogVisibilityChanged?: ((visible: boolean) => void);
|
|
76
79
|
onItemSelected?: ((item: VelcronDefinition) => void);
|
package/package.json
CHANGED
package/parser/VelcronActions.js
CHANGED
|
@@ -263,8 +263,7 @@ class VelcronActions {
|
|
|
263
263
|
const params = VelcronActions.extractParameterValues(val, awAction);
|
|
264
264
|
let promise = null;
|
|
265
265
|
const actionName = awAction.action.substring(0, awAction.action.indexOf("(")).trim().toLowerCase();
|
|
266
|
-
|
|
267
|
-
if (!VelcronActions._actionHandlers) {
|
|
266
|
+
if (!VelcronActions.registeredBuiltInHandlers) {
|
|
268
267
|
Object.keys(builtInHandlers).forEach((key) => {
|
|
269
268
|
const handler = builtInHandlers[key];
|
|
270
269
|
if (handler && handler.name && VelcronActions._actionHandlers) {
|