@omnia/velcron 8.0.457-dev → 8.0.458-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/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export * from "./models";
2
2
  export * from "./parser";
3
3
  export * from "./actions";
4
- export * from "./stores";
5
4
  export * from "@omnia/velcron/internal-do-not-import-from-here/shared/models";
6
5
  export * from "./rules";
7
6
  export * from "./templatebuilder";
package/index.js CHANGED
@@ -4,7 +4,7 @@ const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./models"), exports);
5
5
  tslib_1.__exportStar(require("./parser"), exports);
6
6
  tslib_1.__exportStar(require("./actions"), exports);
7
- tslib_1.__exportStar(require("./stores"), exports);
7
+ //export * from "./stores";
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);
@@ -3,6 +3,7 @@ import { SpacingDefinition, Spacing, SpacingValue } from "./Spacing";
3
3
  import { TypographyFontDefinition, TextStyleValue } from "./Typography";
4
4
  import { ThemeBase } from "./ThemeBase";
5
5
  import { VelcronRendererResolverReference } from "../velcron";
6
+ import { TextAlignment } from "@omnia/fx-models";
6
7
  export interface BlueprintStrategy {
7
8
  buttons: {
8
9
  primary: ButtonBlueprint;
@@ -30,12 +31,24 @@ export interface VariantBlueprints<T> extends Blueprints {
30
31
  variant7?: T;
31
32
  variant8?: T;
32
33
  }
34
+ export interface HeaderIconSettings {
35
+ blueprint?: IconBlueprint;
36
+ background?: BackgroundDefinition;
37
+ spacing?: Spacing;
38
+ }
33
39
  export interface HeaderBlueprint extends Blueprint {
40
+ /**velcron */
34
41
  renderer?: VelcronRendererResolverReference;
35
42
  state?: any;
43
+ /**Settings */
44
+ background?: BackgroundDefinition;
45
+ textAlign?: TextAlignment;
46
+ padding?: SpacingValue;
47
+ text?: TextBlueprint;
48
+ iconSettings?: HeaderIconSettings;
36
49
  }
37
50
  export interface HeaderBlueprints extends Blueprints, VariantBlueprints<HeaderBlueprint>, BlueprintsReference {
38
- primary?: TabsBlueprint;
51
+ primary?: HeaderBlueprint;
39
52
  }
40
53
  export interface TextFillBlueprints extends VariantBlueprints<TextFillBlueprint>, Blueprints, BlueprintsReference {
41
54
  }
@@ -156,7 +169,7 @@ export interface TabsBlueprint extends Blueprint {
156
169
  text?: TextBlueprint;
157
170
  icon?: IconBlueprint;
158
171
  active?: {
159
- viewTemplate?: VelcronRendererResolverReference;
172
+ renderer?: VelcronRendererResolverReference;
160
173
  padding?: Spacing;
161
174
  iconPadding?: SpacingValue;
162
175
  background?: BackgroundDefinition;
@@ -165,7 +178,7 @@ export interface TabsBlueprint extends Blueprint {
165
178
  };
166
179
  inactive?: {
167
180
  background?: BackgroundDefinition;
168
- viewTemplate?: VelcronRendererResolverReference;
181
+ renderer?: VelcronRendererResolverReference;
169
182
  };
170
183
  }
171
184
  export interface TextBlueprint extends Blueprint {
@@ -1,11 +1,11 @@
1
1
  import { VelcronOnUpdatedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnPressEvent, VelcronSpacing, VelcronStyling, VelcronCustomComponentDefinition, VelcronAppDefinition, VelcronRendererResolverReference, EventHook, Future, TextBlueprint, VelcronBindableProp, VelcronEditor, ContainerFillBlueprint, BackgroundDefinition, BlueprintVariant, IconBlueprint, ButtonBlueprint, VelcronOnPressOutsideEvent, VelcronOnPointerEnterEvent, VelcronOnPointerLeaveEvent, VelcronColorStyling, VelcronOverflowValues, VelcronImageRatios } 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 { DynamicState, VelcronDefinition, VelcronEffects, useVelcronThemingStore } from "..";
4
+ import { DynamicState, VelcronDefinition, VelcronEffects } from "..";
5
5
  import { guid, PropertyConfiguration, PropertyValue, PropertyDefinition, PropertySetupBase } from "@omnia/velcron/internal-do-not-import-from-here/shared/models";
6
- import { useVelcronColorSchemaStore } from "../stores/VelcronColorSchema";
7
6
  import { Properties } from "csstype";
8
7
  import type { AnimationOptionsWithOverrides, InViewOptions, VariantDefinition, Variants } from "motion";
8
+ import { useColorSchemaStore, useThemeStore } from "internal/fx/ux/mobile";
9
9
  export interface ResolvedComponentRenderer {
10
10
  component: unknown;
11
11
  definition: VelcronDefinition;
@@ -83,8 +83,8 @@ export interface VelcronRenderContext {
83
83
  id?: string;
84
84
  rootContext: DynamicState;
85
85
  currentContext: DynamicState;
86
- theming?: ReturnType<typeof useVelcronThemingStore>;
87
- colors?: ReturnType<typeof useVelcronColorSchemaStore>;
86
+ theming?: ReturnType<typeof useThemeStore>;
87
+ colors?: ReturnType<typeof useColorSchemaStore>;
88
88
  actions?: {
89
89
  [name: string]: Array<string>;
90
90
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/velcron",
3
3
  "license": "MIT",
4
- "version": "8.0.457-dev",
4
+ "version": "8.0.458-dev",
5
5
  "description": "Provide Omnia Velcron Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -2,6 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VelcronRenderers = void 0;
4
4
  const __1 = require("..");
5
+ //import { ColorSchemaType, InternalColorSchemaStoreType, ServiceContainerContext, useColorSchemaStore, useInject, useThemeStore } from "internal/fx/ux/mobile";
6
+ // import { InternalColorSchemaStoreType, useColorSchemaStore, useThemeStore } from "internal/fx/ux/aurora/shared-mobile";
7
+ const stores_1 = require("internal/fx/shared/aurora/stores");
5
8
  class VelcronRenderers {
6
9
  static { this.components = {}; }
7
10
  static { this.referenceResolvers = {}; }
@@ -82,13 +85,13 @@ class VelcronRenderers {
82
85
  static createNewRendererContext(currentRenderCtx, definition, newViewModel) {
83
86
  const result = {
84
87
  rootContext: currentRenderCtx.rootContext,
85
- theming: currentRenderCtx.theming,
86
88
  currentContext: newViewModel ? newViewModel : currentRenderCtx.currentContext,
87
89
  actions: currentRenderCtx.actions,
88
90
  components: currentRenderCtx.components,
89
91
  hooks: currentRenderCtx.hooks,
90
92
  computed: currentRenderCtx.computed,
91
93
  colors: currentRenderCtx.colors,
94
+ theming: currentRenderCtx.theming,
92
95
  $editmode: currentRenderCtx.$editmode,
93
96
  $display: currentRenderCtx.$display,
94
97
  $active: currentRenderCtx.$active,
@@ -100,10 +103,19 @@ class VelcronRenderers {
100
103
  };
101
104
  if (VelcronRenderers.definitionContainsCustomColorSchema(definition)) {
102
105
  const colorSchemaType = __1.VelcronDataBinder.bind(currentRenderCtx, definition.colorSchemaType);
103
- if (colorSchemaType && colorSchemaType !== "" && result.colors.state.colorSchemaType !== colorSchemaType) {
104
- const colorSchemaStore = (0, __1.useVelcronColorSchemaStore)(definition.key.toString());
105
- colorSchemaStore.actions.setThemeStore(currentRenderCtx.theming, colorSchemaType);
106
- result.colors = colorSchemaStore;
106
+ if (colorSchemaType && result.colors.state.colorSchemaType !== colorSchemaType) {
107
+ const themeStore = (0, stores_1.useThemeStore)();
108
+ // const { value, setValue } = themeStore.get.getOrSetColorSchema(colorSchemaType);
109
+ // let colorSchemaStoreRef: InternalColorSchemaStoreType;
110
+ // if (value) {
111
+ // colorSchemaStoreRef = value as InternalColorSchemaStoreType;
112
+ // } else {
113
+ // colorSchemaStoreRef = useInject(ServiceContainerContext).createInstance(useColorSchemaStore, null, true);
114
+ // (colorSchemaStoreRef as InternalColorSchemaStoreType).actions.disableAutoDispose();
115
+ // colorSchemaStoreRef.actions.setColorSchema(colorSchemaType);
116
+ // setValue(colorSchemaStoreRef);
117
+ // }
118
+ // result.colors = colorSchemaStoreRef;
107
119
  }
108
120
  }
109
121
  return result;
@@ -1,25 +0,0 @@
1
- import { ColorDefinition, ColorSchema, ColorSchemaType, ColorSchemaTypes, guid } from "@omnia/velcron/internal-do-not-import-from-here/shared/models";
2
- import { useVelcronThemingStore } from ".";
3
- export declare const useVelcronColorSchemaStore: (newStateWithName?: string) => {
4
- state: {
5
- base: ColorDefinition;
6
- onBase: ColorDefinition;
7
- container: ColorDefinition;
8
- onContainer: ColorDefinition;
9
- isContainer: boolean;
10
- name: string;
11
- colorSchemaType: ColorSchemaTypes | ColorSchemaType;
12
- id: guid;
13
- };
14
- get: {
15
- readonly colorSchema: ColorSchema;
16
- readonly base: ColorDefinition;
17
- readonly onBase: ColorDefinition;
18
- readonly container: ColorDefinition;
19
- readonly onContainer: ColorDefinition;
20
- };
21
- actions: {
22
- setThemeStore: (themeStoreInstance: ReturnType<typeof useVelcronThemingStore>, colorSchemaType?: ColorSchemaTypes | ColorSchemaType, container?: boolean) => void;
23
- setColorSchema: (colorSchemaType: ColorSchemaType, container?: boolean) => void;
24
- };
25
- };
@@ -1,83 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useVelcronColorSchemaStore = void 0;
4
- const models_1 = require("@omnia/velcron/internal-do-not-import-from-here/shared/models");
5
- const _1 = require(".");
6
- exports.useVelcronColorSchemaStore = (0, _1.defineVelcronStore)("ColorSchemaStore", {
7
- setup() {
8
- return {
9
- state: {
10
- base: {},
11
- onBase: {},
12
- container: {},
13
- onContainer: {},
14
- isContainer: false,
15
- name: (0, models_1.valueOf)(""),
16
- colorSchemaType: models_1.ColorSchemaTypes.background,
17
- id: (0, models_1.guid)(),
18
- },
19
- //The private state is not reactive that means it will not trigger re-rendering of the component
20
- privateState: {
21
- themeStore: (0, models_1.valueOf)(null)
22
- }
23
- };
24
- },
25
- getters(state) {
26
- function colorSchema() {
27
- return {
28
- base: state.base,
29
- onBase: state.onBase,
30
- name: state.name,
31
- };
32
- }
33
- function base() {
34
- return state.base;
35
- }
36
- function onBase() {
37
- return state.onBase;
38
- }
39
- function container() {
40
- return state.container;
41
- }
42
- function onContainer() {
43
- return state.onContainer;
44
- }
45
- return {
46
- get colorSchema() {
47
- return colorSchema();
48
- },
49
- get base() {
50
- return base();
51
- },
52
- get onBase() {
53
- return onBase();
54
- },
55
- get container() {
56
- return container();
57
- },
58
- get onContainer() {
59
- return onContainer();
60
- }
61
- };
62
- },
63
- actions(state, privateState) {
64
- function setThemeStore(themeStoreInstance, colorSchemaType, container) {
65
- privateState.themeStore = themeStoreInstance;
66
- setColorSchema(colorSchemaType ? colorSchemaType : state.colorSchemaType, container);
67
- }
68
- function setColorSchema(colorSchemaType, container) {
69
- const colorSchema = privateState.themeStore.get.colorSchema(colorSchemaType);
70
- state.colorSchemaType = colorSchemaType;
71
- state.name = colorSchema.name;
72
- state.isContainer = container ? true : false;
73
- state.base = container ? colorSchema["container"] : colorSchema["base"];
74
- state.onBase = container ? colorSchema["onContainer"] : colorSchema["onBase"];
75
- state.container = container ? colorSchema["base"] : colorSchema["container"];
76
- state.onContainer = container ? colorSchema["onBase"] : colorSchema["onContainer"];
77
- }
78
- return {
79
- setThemeStore,
80
- setColorSchema
81
- };
82
- }
83
- });
@@ -1,12 +0,0 @@
1
- export declare function 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"];
10
- get: TGetters;
11
- actions: TActions;
12
- };
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defineVelcronStore = defineVelcronStore;
4
- const providers_1 = require("../providers");
5
- const stateMap = new Map();
6
- function defineVelcronStore(name, definition) {
7
- function result(newStateWithName) {
8
- if (newStateWithName && newStateWithName !== "" && newStateWithName !== name) {
9
- name = newStateWithName;
10
- }
11
- if (!stateMap.has(name)) {
12
- //NOTE: At the moment the privateState is not reactive this is because we dont have a way to declare non reactive stuff
13
- //we needed it in useVelcronColorSchemaStore. If we need privateState to be reactive and support non reactive stuff
14
- // we need to rewrite defineVelcronStore to the new defineStore pattern that supports setup in a better way
15
- const setup = definition.setup();
16
- const reactive = providers_1.ReactivityProvider.makeReactive(setup.state);
17
- setup.state = reactive;
18
- stateMap.set(name, setup);
19
- }
20
- const reactiveState = stateMap.get(name);
21
- return {
22
- state: reactiveState.state,
23
- get: definition.getters?.(reactiveState.state, reactiveState.privateState),
24
- actions: definition.actions?.(reactiveState.state, reactiveState.privateState)
25
- };
26
- }
27
- return result;
28
- }
@@ -1,19 +0,0 @@
1
- import { ColorSchemaType, ColorSchemaTypes, ColorType, ColorTypes, ContainerFillBlueprint, BlueprintVariant, ResolvedThemeDefinition, TextStyleSize, TextStyleSizes, TextStyleType, TextStyleTypes } from "..";
2
- export declare const useVelcronThemingStore: (newStateWithName?: string) => {
3
- state: {
4
- currentTheme: ResolvedThemeDefinition;
5
- };
6
- get: {
7
- componentBlueprints: () => void;
8
- containerBlueprint: (type: BlueprintVariant | ContainerFillBlueprint | string) => any;
9
- colorSchema: (colorSchemaType: ColorSchemaTypes | ColorSchemaType) => import("..").ColorSchema;
10
- spacing: () => import("..").SpacingBlueprint;
11
- typography: (typographyType: TextStyleTypes | TextStyleType, size: TextStyleSizes | TextStyleSize) => any;
12
- color: (colorSchemaType: ColorSchemaTypes | ColorSchemaType, colorType: ColorTypes | ColorType) => string;
13
- colorDefinition: (colorSchemaType: ColorSchemaTypes | ColorSchemaType, colorType: ColorTypes | ColorType) => import("..").ColorDefinition;
14
- currentTheme: () => ResolvedThemeDefinition;
15
- };
16
- actions: {
17
- setTheme(newTheme: ResolvedThemeDefinition): void;
18
- };
19
- };
@@ -1,64 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useVelcronThemingStore = void 0;
4
- const __1 = require("..");
5
- const VelcronStore_1 = require("./VelcronStore");
6
- exports.useVelcronThemingStore = (0, VelcronStore_1.defineVelcronStore)("VelcronTheming", {
7
- setup() {
8
- return {
9
- state: {
10
- currentTheme: {},
11
- }
12
- };
13
- },
14
- getters(state) {
15
- return {
16
- componentBlueprints: () => {
17
- state.currentTheme.components;
18
- },
19
- containerBlueprint: (type) => {
20
- return (0, __1.useThemeMethods)(() => state.currentTheme).containerBlueprint(type);
21
- },
22
- colorSchema: (colorSchemaType) => {
23
- return (0, __1.useThemeMethods)(() => state.currentTheme).colorSchema(colorSchemaType);
24
- },
25
- spacing: () => {
26
- return state.currentTheme.spacing;
27
- },
28
- typography: (typographyType, size) => {
29
- const typography = state.currentTheme.typography;
30
- if (typographyType === __1.TextStyleTypes.text) {
31
- return typography.text[size];
32
- }
33
- else if (typographyType === __1.TextStyleTypes.title) {
34
- return typography.title[size];
35
- }
36
- else if (typographyType === __1.TextStyleTypes.display) {
37
- return typography.display[size];
38
- }
39
- else if (typographyType === __1.TextStyleTypes.headline) {
40
- return typography.headline[size];
41
- }
42
- else if (typographyType === __1.TextStyleTypes.label) {
43
- return typography.label[size];
44
- }
45
- },
46
- color: (colorSchemaType, colorType) => {
47
- return (0, __1.useThemeMethods)(() => state.currentTheme).color(colorSchemaType, colorType);
48
- },
49
- colorDefinition: (colorSchemaType, colorType) => {
50
- return (0, __1.useThemeMethods)(() => state.currentTheme).colorDefinition(colorSchemaType, colorType);
51
- },
52
- currentTheme: () => {
53
- return this.currentTheme.state;
54
- }
55
- };
56
- },
57
- actions(state) {
58
- return {
59
- setTheme(newTheme) {
60
- state.currentTheme = newTheme;
61
- }
62
- };
63
- }
64
- });
package/stores/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from "./VelcronStore";
2
- export * from "./VelcronTheming";
3
- export * from "./VelcronColorSchema";
package/stores/index.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./VelcronStore"), exports);
5
- tslib_1.__exportStar(require("./VelcronTheming"), exports);
6
- tslib_1.__exportStar(require("./VelcronColorSchema"), exports);
7
- //export * from "./VelcronBlueprint";