@omnia/velcron 8.0.128-dev → 8.0.130-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,19 @@
1
+ export interface ActivationOptions {
2
+ lifetime?: InstanceLifetimes;
3
+ onStartup?: (type: any) => void;
4
+ createFactory?: (classType: any) => any;
5
+ onInstanceCreated?: (instance: any) => void;
6
+ onBeforeInstanceCreated?: () => void;
7
+ onDisposing?: (instance: any) => void;
8
+ }
9
+ export interface TypeDefinition extends ActivationOptions {
10
+ type: any;
11
+ }
12
+ export declare enum InstanceLifetimes {
13
+ Transient = 0,
14
+ Singleton = 1,
15
+ Scoped = 2
16
+ }
17
+ export interface IDisposable {
18
+ onDisposing: () => void;
19
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InstanceLifetimes = void 0;
4
+ var InstanceLifetimes;
5
+ (function (InstanceLifetimes) {
6
+ InstanceLifetimes[InstanceLifetimes["Transient"] = 0] = "Transient";
7
+ InstanceLifetimes[InstanceLifetimes["Singleton"] = 1] = "Singleton";
8
+ InstanceLifetimes[InstanceLifetimes["Scoped"] = 2] = "Scoped";
9
+ })(InstanceLifetimes || (exports.InstanceLifetimes = InstanceLifetimes = {}));
@@ -12,6 +12,7 @@ require("./Equals"); // ensure execute code in equals first
12
12
  * Class to create a guid
13
13
  */
14
14
  class Guid {
15
+ static { this._empty = new Guid("00000000-0000-0000-0000-000000000000"); }
15
16
  static newGuid() {
16
17
  return new Guid("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, c => {
17
18
  const r = Math.random() * 16 | 0;
@@ -57,7 +58,6 @@ class Guid {
57
58
  }
58
59
  }
59
60
  exports.Guid = Guid;
60
- Guid._empty = new Guid("00000000-0000-0000-0000-000000000000");
61
61
  // only add extension methods when running in browser, not in node.js
62
62
  if (globalThis.omnia) {
63
63
  Object.defineProperty(String.prototype["equals"], "guid", {
@@ -0,0 +1,23 @@
1
+ export interface TopicCreatedFunc<T> {
2
+ (created: IMessageBusTopicPublishSubscriber<T>): void;
3
+ }
4
+ export interface IMessageBusSubscriptionHandler {
5
+ /**
6
+ * Unsubscribe to the related subscription(s)
7
+ * and/or any subscriptions added using add method)
8
+ * */
9
+ unsubscribe(): any;
10
+ /**
11
+ * Adds another unsubscribe handler, all will be unsubscribed to if calling unsubscribe
12
+ * @param unSubscriptionHandler
13
+ */
14
+ add(unSubscriptionHandler: IMessageBusSubscriptionHandler): any;
15
+ }
16
+ export interface IMessageBusTopicSubscription<T> {
17
+ subscribe: (fn: (obj: T) => void) => IMessageBusSubscriptionHandler;
18
+ }
19
+ export interface IMessageBusTopicPublication<T> {
20
+ publish: (msg: T) => void;
21
+ }
22
+ export interface IMessageBusTopicPublishSubscriber<T> extends IMessageBusTopicSubscription<T>, IMessageBusTopicPublication<T> {
23
+ }
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HubSource = void 0;
4
4
  class HubSource {
5
+ static { this.Id = "eb4fde5f-4f3e-4c70-9893-3d9e048fda0c"; }
5
6
  }
6
7
  exports.HubSource = HubSource;
7
- HubSource.Id = "eb4fde5f-4f3e-4c70-9893-3d9e048fda0c";
@@ -17,3 +17,5 @@ export * from "./StronglyTypedId";
17
17
  export * from "./theming";
18
18
  export * from "./hub";
19
19
  export * from "./velcron";
20
+ export * from "./DependencyInjection";
21
+ export * from "./Messaging";
@@ -21,3 +21,5 @@ tslib_1.__exportStar(require("./StronglyTypedId"), exports);
21
21
  tslib_1.__exportStar(require("./theming"), exports);
22
22
  tslib_1.__exportStar(require("./hub"), exports);
23
23
  tslib_1.__exportStar(require("./velcron"), exports);
24
+ tslib_1.__exportStar(require("./DependencyInjection"), exports);
25
+ tslib_1.__exportStar(require("./Messaging"), exports);
@@ -1,10 +1,10 @@
1
- import { BackgroundDefinition, ColorValue, FillDefinition } from "./ThemeDefinitionV2";
2
- import { ChromeBlueprint } from "./Chrome";
1
+ import { BackgroundDefinition, ColorSchemaType, ColorValue, FillDefinition } from "./ThemeDefinitionV2";
3
2
  import { SpacingDefinition, Spacing } from "./Spacing";
4
3
  import { TypographyValue } from "./Typography";
5
4
  export interface BoxDimensions extends Spacing {
6
5
  }
7
6
  import { TypographyBlueprint } from "./Typography";
7
+ import { GuidValue, VelcronAppDefinition } from "@omnia/fx-models";
8
8
  export interface Blueprints {
9
9
  name?: string;
10
10
  }
@@ -22,6 +22,18 @@ export interface TypographyBlueprints extends Blueprints {
22
22
  export interface SpacingBlueprints extends Blueprints {
23
23
  primary: SpacingBlueprint;
24
24
  }
25
+ export interface ChromeBlueprint {
26
+ name?: string;
27
+ colorSchemaType?: ColorSchemaType;
28
+ header: {
29
+ definitionId: GuidValue;
30
+ definition?: VelcronAppDefinition;
31
+ };
32
+ styles: {
33
+ background?: BackgroundDefinition;
34
+ spacing?: Spacing;
35
+ };
36
+ }
25
37
  export type ButtonTypes = "primary" | "basic" | "accent1" | "warn" | "disabled" | "link";
26
38
  export interface ComponentBlueprints extends Blueprints {
27
39
  buttons?: {
@@ -48,6 +60,7 @@ export interface ComponentBlueprints extends Blueprints {
48
60
  variant2?: TabsBlueprint;
49
61
  variant3?: TabsBlueprint;
50
62
  };
63
+ blocks?: ChromeBlueprints;
51
64
  }
52
65
  export interface SpacingBlueprint {
53
66
  layout: SpacingDefinition;
@@ -1,5 +1,5 @@
1
1
  import { Guid } from "../Guid";
2
- import { BoxDimensions, ChromeBlueprints, ComponentBlueprints, SpacingBlueprints, TypographyBlueprints } from "./Blueprints";
2
+ import { BoxDimensions, ComponentBlueprints, SpacingBlueprints, TypographyBlueprints } from "./Blueprints";
3
3
  export interface ColorTypeResult<resultType> {
4
4
  base: resultType;
5
5
  baseTone: resultType;
@@ -38,6 +38,7 @@ export interface ColorSchemas {
38
38
  background: ColorSchema;
39
39
  error: ColorSchema;
40
40
  info: ColorSchema;
41
+ warning: ColorSchema;
41
42
  }
42
43
  export interface ThemeDefinitionV2 {
43
44
  id: Guid;
@@ -45,7 +46,6 @@ export interface ThemeDefinitionV2 {
45
46
  colors: ColorSchemas;
46
47
  typography: TypographyBlueprints;
47
48
  spacing: SpacingBlueprints;
48
- chrome: ChromeBlueprints;
49
49
  components: ComponentBlueprints;
50
50
  }
51
51
  export type ColorSchemaType = keyof typeof ColorSchemaTypes;
@@ -4,5 +4,4 @@ export * from "./UseThemeMethods";
4
4
  export * from "./Spacing";
5
5
  export * from "./SharedBlueprintMethods";
6
6
  export * from "./SharedColorMethods";
7
- export * from "./Chrome";
8
7
  export * from "./Blueprints";
@@ -8,5 +8,4 @@ tslib_1.__exportStar(require("./UseThemeMethods"), exports);
8
8
  tslib_1.__exportStar(require("./Spacing"), exports);
9
9
  tslib_1.__exportStar(require("./SharedBlueprintMethods"), exports);
10
10
  tslib_1.__exportStar(require("./SharedColorMethods"), exports);
11
- tslib_1.__exportStar(require("./Chrome"), exports);
12
11
  tslib_1.__exportStar(require("./Blueprints"), exports);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/velcron",
3
3
  "license": "MIT",
4
- "version": "8.0.128-dev",
4
+ "version": "8.0.130-dev",
5
5
  "description": "Provide Omnia Velcron Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -9,6 +9,9 @@ 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 { this._actionHandlers = {}; }
13
+ static { this.actionHooks = {}; }
14
+ static { this.registeredBuiltInHandlers = false; }
12
15
  static registerAction(handler) {
13
16
  const name = handler.name.toLowerCase();
14
17
  if (this._actionHandlers && this._actionHandlers[name]) {
@@ -357,7 +360,7 @@ class VelcronActions {
357
360
  return template;
358
361
  }
359
362
  static registerActionHook(actionName, handler) {
360
- VelcronActions.actionHooks ?? (VelcronActions.actionHooks = {});
363
+ VelcronActions.actionHooks ??= {};
361
364
  VelcronActions.actionHooks[actionName] = handler;
362
365
  }
363
366
  static tryTriggerBeforeActionHook(actionName, args) {
@@ -457,9 +460,6 @@ class VelcronActions {
457
460
  }
458
461
  }
459
462
  exports.VelcronActions = VelcronActions;
460
- VelcronActions._actionHandlers = {};
461
- VelcronActions.actionHooks = {};
462
- VelcronActions.registeredBuiltInHandlers = false;
463
463
  var VelcronActionParameterDataType;
464
464
  (function (VelcronActionParameterDataType) {
465
465
  VelcronActionParameterDataType[VelcronActionParameterDataType["text"] = 0] = "text";
@@ -94,6 +94,7 @@ class VelcronData {
94
94
  const evalResult = Function(...names, "\"use strict\";return " + template)(...obj);
95
95
  return evalResult;
96
96
  }
97
+ static { this.variables = {}; }
97
98
  static deleteVariables(id) {
98
99
  if (VelcronData.variables[id]) {
99
100
  delete VelcronData.variables[id];
@@ -639,4 +640,3 @@ class VelcronData {
639
640
  }
640
641
  }
641
642
  exports.VelcronData = VelcronData;
642
- VelcronData.variables = {};
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VelcronPropertyEditors = void 0;
4
4
  class VelcronPropertyEditors {
5
+ static { this.editors = {}; }
5
6
  static registerEditor(type, editor) {
6
7
  type = type.toLowerCase();
7
8
  if (!this.editors[type]) {
@@ -37,4 +38,3 @@ class VelcronPropertyEditors {
37
38
  }
38
39
  }
39
40
  exports.VelcronPropertyEditors = VelcronPropertyEditors;
40
- VelcronPropertyEditors.editors = {};
@@ -4,6 +4,8 @@ exports.VelcronRenderers = void 0;
4
4
  const VelcronData_1 = require("./VelcronData");
5
5
  const __1 = require("..");
6
6
  class VelcronRenderers {
7
+ static { this.components = {}; }
8
+ static { this.referenceResolvers = {}; }
7
9
  static registerComponent(type, component) {
8
10
  type = type.toLowerCase();
9
11
  if (!this.components[type]) {
@@ -139,5 +141,3 @@ class VelcronRenderers {
139
141
  }
140
142
  }
141
143
  exports.VelcronRenderers = VelcronRenderers;
142
- VelcronRenderers.components = {};
143
- VelcronRenderers.referenceResolvers = {};
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ReactivitySystem = void 0;
4
4
  class ReactivitySystem {
5
+ static { this.makeReactive = null; }
6
+ static { this.hasReactivityProvider = false; }
5
7
  static registerProvider(fn) {
6
8
  ReactivitySystem.makeReactive = fn;
7
9
  ReactivitySystem.hasReactivityProvider = true;
8
10
  }
9
11
  }
10
12
  exports.ReactivitySystem = ReactivitySystem;
11
- ReactivitySystem.makeReactive = null;
12
- ReactivitySystem.hasReactivityProvider = false;
@@ -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" | ColorSchemaTypes | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background" | "dynamic";
11
+ colorSchemaType: "info" | "error" | "primary" | "secondary" | ColorSchemaTypes | "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
17
  componentBlueprints: () => void;
18
- colorSchema: (colorSchemaType: "info" | "error" | ColorSchemaTypes | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background" | "dynamic") => ColorSchema;
18
+ colorSchema: (colorSchemaType: "info" | "error" | "primary" | "secondary" | ColorSchemaTypes | "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" | 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;
21
+ color: (colorSchemaType: "info" | "error" | "primary" | "secondary" | ColorSchemaTypes | "accent1" | "accent2" | "accent3" | "neutral" | "background" | "dynamic", colorType: "base" | "onBase" | "container" | "onContainer" | import("@omnia/fx-models").ColorTypes) => string;
22
+ colorDefinition: (colorSchemaType: "info" | "error" | "primary" | "secondary" | ColorSchemaTypes | "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" | 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;
24
+ complementaryColor: (colorSchemaType: "info" | "error" | "primary" | "secondary" | ColorSchemaTypes | "accent1" | "accent2" | "accent3" | "neutral" | "background" | "dynamic", colorType: "base" | "onBase" | "container" | "onContainer" | import("@omnia/fx-models").ColorTypes) => string;
25
+ complementaryColorDefinition: (colorSchemaType: "info" | "error" | "primary" | "secondary" | ColorSchemaTypes | "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,16 +0,0 @@
1
- import { GuidValue } from "../Guid";
2
- import { VelcronAppDefinition } from "../velcron";
3
- import { Spacing } from "./Spacing";
4
- import { BackgroundDefinition, ColorSchemaType } from "./ThemeDefinitionV2";
5
- export interface ChromeBlueprint {
6
- name?: string;
7
- colorSchemaType?: ColorSchemaType;
8
- header: {
9
- definitionId: GuidValue;
10
- definition?: VelcronAppDefinition;
11
- };
12
- styles: {
13
- background?: BackgroundDefinition;
14
- spacing?: Spacing;
15
- };
16
- }