@omnia/fx 7.0.513-dev → 7.0.515-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.
@@ -2,7 +2,7 @@ import { VelcronComponentDescriptor } from "./VelcronDescriptors";
2
2
  import { VelcronEvent, VelcronOnChangedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnLoadEvent, VelcronOnPressEvent } from "./VelcronEvents";
3
3
  import { VelcroncomponentArrayType, VelcronPrimitiveType } from "./VelcronTypes";
4
4
  import { AssignOperators, VelcronHorizontalAlignments, VelcronIconTypes, VelcronActionTypes, VerticalAlignments } from "./Enums";
5
- import { useVelcronThemingStore } from "..";
5
+ import { ColorSchema, useVelcronThemingStore } from "..";
6
6
  export interface ResolvedComponentRenderer {
7
7
  component: unknown;
8
8
  definition: VelcronDefinition;
@@ -33,6 +33,8 @@ export interface VelcronRenderContext {
33
33
  rootContext: DynamicViewModel;
34
34
  currentContext: DynamicViewModel;
35
35
  theming?: ReturnType<typeof useVelcronThemingStore>;
36
+ colorSchemaName?: string;
37
+ colorSchema?: ColorSchema;
36
38
  actions?: {
37
39
  [name: string]: [];
38
40
  };
@@ -91,6 +93,9 @@ export interface VelcronDefinitionBase {
91
93
  */
92
94
  key?: string;
93
95
  }
96
+ export interface VelcronCustomThemeSettings {
97
+ colorSchema?: string;
98
+ }
94
99
  export interface VelcronDefinition extends VelcronDefinitionBase {
95
100
  body?: Array<VelcronDefinition>;
96
101
  style?: VelcronStyling;
@@ -202,7 +207,7 @@ export interface VelcronIconDefinition extends VelcronDefinition {
202
207
  size?: number;
203
208
  events?: VelcronOnPressEvent;
204
209
  }
205
- export interface VelcronFlexViewDefinition extends VelcronDefinition {
210
+ export interface VelcronFlexViewDefinition extends VelcronDefinition, VelcronCustomThemeSettings {
206
211
  type: "FlexView";
207
212
  column?: boolean;
208
213
  body: Array<VelcronDefinition>;
@@ -212,7 +217,6 @@ export interface VelcronFlexViewDefinition extends VelcronDefinition {
212
217
  grow?: number;
213
218
  border?: VelcronBorder;
214
219
  borderRadius?: VelcronDimensions;
215
- colorSchema?: string;
216
220
  width: string;
217
221
  }
218
222
  export interface VelcronDimensions {
@@ -1,4 +1,4 @@
1
- import { BuiltInComponentRenderers, DynamicViewModel, ResolvedComponentRenderer, VelcronDefinition, VelcronRenderContext } from "../models";
1
+ import { BuiltInComponentRenderers, DynamicViewModel, ResolvedComponentRenderer, VelcronCustomComponentDefinition, VelcronDefinition, VelcronRenderContext } from "../models";
2
2
  export declare class VelcronRenderers {
3
3
  private static components;
4
4
  static registerComponent(type: string, component: any): void;
@@ -6,5 +6,31 @@ export declare class VelcronRenderers {
6
6
  static hasComponent(type: string): any;
7
7
  static registerComponents(components: BuiltInComponentRenderers): void;
8
8
  static getComponent(definition: VelcronDefinition, renderContext: VelcronRenderContext): ResolvedComponentRenderer;
9
+ static definitionContainsCustomColorSchema(definition: VelcronDefinition): boolean;
10
+ static createNewRendererContext(currentRenderCtx: VelcronRenderContext, definition: VelcronDefinition, newViewModel?: DynamicViewModel): {
11
+ rootContext: object;
12
+ theming: {
13
+ state: {
14
+ currentTheme: import("@omnia/fx-models").ThemeDefinitionV2;
15
+ };
16
+ get: {
17
+ colorSchema: (schema: string) => import("@omnia/fx-models").ColorSchema;
18
+ typography: (name: string) => import("@omnia/fx-models").TypographyType;
19
+ color: (schemaName: string, colorType: string) => string;
20
+ };
21
+ actions: {
22
+ setTheme(newTheme: import("@omnia/fx-models").ThemeDefinitionV2): void;
23
+ };
24
+ };
25
+ currentContext: object;
26
+ actions: {
27
+ [name: string]: [];
28
+ };
29
+ components: VelcronCustomComponentDefinition[];
30
+ hooks: import("../models").VelcronRenderContextHooks;
31
+ computed: {
32
+ [name: string]: [];
33
+ };
34
+ };
9
35
  static ensureRenderContext(rendererInfo: ResolvedComponentRenderer, definition: VelcronDefinition, currentRenderCtx: VelcronRenderContext, newViewModel?: DynamicViewModel): VelcronRenderContext;
10
36
  }
@@ -1,9 +1,12 @@
1
- export declare const defineVelcronStore: <TState, TGetters, TActions>(name: string, definition: {
2
- state: TState;
3
- getters: (state: TState) => TGetters;
4
- actions: (state: TState) => TActions;
5
- }) => () => {
6
- state: TState;
1
+ export declare const defineVelcronStore: <TSetup extends {
2
+ state: object;
3
+ privateState?: object;
4
+ }, TGetters, TActions>(name: string, definition: {
5
+ setup: () => TSetup;
6
+ getters?: (state: TSetup["state"], privateState?: TSetup["privateState"]) => TGetters;
7
+ actions?: (state: TSetup["state"], privateState?: TSetup["privateState"]) => TActions;
8
+ }) => (newStateWithName?: string) => {
9
+ state: TSetup["state"];
7
10
  get: TGetters;
8
11
  actions: TActions;
9
12
  };
@@ -1,16 +1,14 @@
1
- import { ColorSchema, ThemeDefinitionV2, TypographyType } from "..";
2
- export declare const useVelcronThemingStore: () => {
1
+ import { ThemeDefinitionV2, TypographyType } from "..";
2
+ export declare const useVelcronThemingStore: (newStateWithName?: string) => {
3
3
  state: {
4
4
  currentTheme: ThemeDefinitionV2;
5
- activeSchema: string;
6
5
  };
7
6
  get: {
8
- activeColorSchema: () => ColorSchema;
7
+ colorSchema: (schema: string) => import("..").ColorSchema;
9
8
  typography: (name: string) => TypographyType;
10
- colorFromActiveSchema: (name: string) => string;
9
+ color: (schemaName: string, colorType: string) => string;
11
10
  };
12
11
  actions: {
13
- setActiveSchema(name: string): void;
14
12
  setTheme(newTheme: ThemeDefinitionV2): void;
15
13
  };
16
14
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/fx",
3
3
  "license": "MIT",
4
- "version": "7.0.513-dev",
4
+ "version": "7.0.515-dev",
5
5
  "description": "Provide Omnia Fx typings and tooling for clientside Omnia development.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -20,7 +20,7 @@
20
20
  ],
21
21
  "author": "Precio Fishbone",
22
22
  "dependencies": {
23
- "@omnia/fx-models": "7.0.513-dev",
23
+ "@omnia/fx-models": "7.0.515-dev",
24
24
  "@microsoft/signalr": "6.0.1",
25
25
  "broadcast-channel": "4.8.0",
26
26
  "dayjs": "1.10.7",