@omnia/fx-models 8.0.135-dev → 8.0.137-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.
@@ -0,0 +1,5 @@
1
+ import { EventHook } from "../models";
2
+ /**
3
+ * Utility for creating event hooks on the fly
4
+ */
5
+ export declare function createEventHook<T = any>(): EventHook<T>;
@@ -0,0 +1 @@
1
+ export * from "./CreateEventHook";
@@ -10,3 +10,4 @@ export * from "./services";
10
10
  export * from "./utils";
11
11
  export * from "./factory";
12
12
  export * from "./messaging";
13
+ export * from "./events";
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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;
@@ -19,3 +19,4 @@ export * from "./hub";
19
19
  export * from "./velcron";
20
20
  export * from "./DependencyInjection";
21
21
  export * from "./Messaging";
22
+ export * from "./EventHook";
@@ -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);
@@ -1,4 +1,4 @@
1
- import { Guid } from "../Guid";
1
+ import { GuidValue } from "../Guid";
2
2
  import { BoxDimensions, ComponentBlueprints, SpacingBlueprints, TypographyBlueprints } from "./Blueprints";
3
3
  export interface ColorTypeResult<resultType> {
4
4
  base: resultType;
@@ -42,7 +42,7 @@ export interface ColorSchemas extends ColorSchemasReference {
42
42
  notification: ColorSchema;
43
43
  }
44
44
  export interface BlueprintsReference {
45
- id: Guid;
45
+ id: GuidValue;
46
46
  }
47
47
  export interface ColorSchemasReference {
48
48
  primary: BlueprintsReference;
@@ -58,7 +58,7 @@ export interface ColorSchemasReference {
58
58
  notification: BlueprintsReference;
59
59
  }
60
60
  export interface ThemeDefinitionReference {
61
- id: Guid;
61
+ id: GuidValue;
62
62
  name?: string;
63
63
  colors: ColorSchemasReference;
64
64
  typography: BlueprintsReference;
@@ -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: GuidValue;
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,8 +1,8 @@
1
- import { Guid } from "../Guid";
1
+ import { GuidValue } from "../Guid";
2
2
  export interface TypographyBlueprint {
3
3
  name: string;
4
4
  font?: {
5
- id: Guid;
5
+ id: GuidValue;
6
6
  family: string;
7
7
  cdn?: string;
8
8
  };
@@ -1,5 +1,5 @@
1
1
  import { DynamicState } from "../DynamicState";
2
- import { VelcronEvent, VelcronOnEditModeEvent, VelcronOnLoadEvent, VelcronOnSaveEvent } from "./VelcronEvents";
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 & VelcronOnSaveEvent;
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 VelcronOnSaveEvent = {
8
- onSaved?: Array<string>;
7
+ export type VelcronOnSavingEvent = {
8
+ onSaving?: Array<string>;
9
9
  };
10
10
  export type VelcronOnEditModeEvent = {
11
11
  onEditMode?: Array<string>;
@@ -1,9 +1,10 @@
1
1
  import { SetupFactoryContext } from "../factory";
2
2
  import { http } from "../http";
3
+ import { InstanceLifetimes } from "../models";
3
4
  interface SetupServiceContext extends SetupFactoryContext {
4
5
  http: typeof http;
5
6
  }
6
7
  export declare function defineService<TActions extends {
7
8
  [key: string]: Function;
8
- }, TArgs extends any[]>(setup: (ctx: SetupServiceContext) => TActions): () => TActions;
9
+ }, TArgs extends any[]>(setup: (ctx: SetupServiceContext) => TActions, lifeTime?: InstanceLifetimes): () => TActions;
9
10
  export {};
@@ -2,4 +2,3 @@ export * from "./DefineService";
2
2
  export * from "./ActivityService";
3
3
  export * from "./RealtimeService";
4
4
  export * from "./ActivitySubscriptionService";
5
- export * from "./ThemingService";
@@ -1,4 +1,4 @@
1
- import { VelcronOnUpdatedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnPressEvent, VelcronSpacing, VelcronStyling, VelcronCustomComponentDefinition, VelcronAppDefinition, VelcronRendererResolverReference } from "internal/fx/shared/models";
1
+ import { VelcronOnUpdatedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnPressEvent, VelcronSpacing, VelcronStyling, VelcronCustomComponentDefinition, VelcronAppDefinition, VelcronRendererResolverReference, EventHook, Future } from "internal/fx/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?: VelcronRenderContextEventHandlers;
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);
@@ -41,7 +41,7 @@ export declare const OAlertTypesName = "OAlertTypes";
41
41
  export declare const OButtonPresetDefinitions: readonly ["create", "remove", "delete", "ok", "cancel", "save", "close", "settings", "icon-add", "icon-comment", "icon-delete", "icon-edit", "icon-drag-handle", "icon-copy", "icon-code", "icon-close", "icon-back", "icon-more", "icon-navigate", "icon-settings", "load-more", "retry", "remove", "approve", "copy-to-clipboard", "details", "next", "previous", "select", "view-more", "send-request"];
42
42
  export type OOxideButtonPresets = typeof OButtonPresetDefinitions[number];
43
43
  export declare const OButtonPresetsName = "OOxideButtonPresets";
44
- export declare const OButtonVariantDefinitions: readonly ["default", "prominent", "toolbar", "opacity", "dial", "slim", "menu"];
44
+ export declare const OButtonVariantDefinitions: readonly ["prominent", "default", "toolbar", "opacity", "dial", "slim", "menu"];
45
45
  export type OButtonVariants = typeof OButtonVariantDefinitions[number];
46
46
  export declare const OButtonVariantsName = "OButtonVariants";
47
47
  /**Button Group */
@@ -31,7 +31,7 @@ exports.OAlertTypesName = "OAlertTypes";
31
31
  /**Button */
32
32
  exports.OButtonPresetDefinitions = ["create", "remove", "delete", "ok", "cancel", "save", "close", "settings", "icon-add", "icon-comment", "icon-delete", "icon-edit", "icon-drag-handle", "icon-copy", "icon-code", "icon-close", "icon-back", "icon-more", "icon-navigate", "icon-settings", "load-more", "retry", "remove", "approve", "copy-to-clipboard", "details", "next", "previous", "select", "view-more", "send-request"];
33
33
  exports.OButtonPresetsName = "OOxideButtonPresets";
34
- exports.OButtonVariantDefinitions = ["default", "prominent", "toolbar", "opacity", "dial", "slim", "menu"];
34
+ exports.OButtonVariantDefinitions = ["prominent", "default", "toolbar", "opacity", "dial", "slim", "menu"];
35
35
  exports.OButtonVariantsName = "OButtonVariants";
36
36
  /**Button Group */
37
37
  exports.OButtonGroupTypeDefinitions = ["default", "dial", "settings"];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/fx-models",
3
3
  "license": "MIT",
4
- "version": "8.0.135-dev",
4
+ "version": "8.0.137-dev",
5
5
  "description": "Provide Omnia Fx Models Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,11 +1,5 @@
1
- import { BorderStylingDefinition, ButtonBlueprint, ChromeBlueprint, ChromeBlueprints, ColorSchema, ComponentBlueprints, FillDefinition, Guid, SpacingBlueprints, SpacingDefinition, TabsBlueprint, ThemeDefinitionV2, TypographyBlueprints } from "@omnia/fx-models";
1
+ import { BorderStylingDefinition, ButtonBlueprint, ChromeBlueprint, ChromeBlueprints, ColorSchema, ComponentBlueprints, FillDefinition, ITemplateRegistration, SpacingBlueprints, SpacingDefinition, TabsBlueprint, ThemeDefinitionV2, TypographyBlueprints } from "@omnia/fx-models";
2
2
  import { ApiPath } from "../Extends";
3
- export interface ITemplateRegistration<TTemplateType = any> {
4
- id: Guid;
5
- template: TTemplateType;
6
- hidden?: boolean;
7
- custom?: boolean;
8
- }
9
3
  export interface IThemeRegistrationApiHandler {
10
4
  getAllThemeRegistrations(): ITemplateRegistration<ThemeDefinitionV2>[];
11
5
  registerTheme(definitions: ITemplateRegistration<ThemeDefinitionV2> | ITemplateRegistration<ThemeDefinitionV2>[]): any;
@@ -1,8 +0,0 @@
1
- import { ButtonBlueprint, Guid, ITemplateRegistration } from "@omnia/fx-models";
2
- export declare const useThemingService: () => {
3
- buttonBlueprints: () => {
4
- upsert: (blueprint: ITemplateRegistration<ButtonBlueprint>) => Promise<void>;
5
- delete: (id: Guid) => Promise<void>;
6
- getAll: () => Promise<ITemplateRegistration<ButtonBlueprint>[]>;
7
- };
8
- };