@omnia/velcron 8.0.147-dev → 8.0.149-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.
@@ -124,8 +124,6 @@ export interface VelcronColorStyling {
124
124
  color?: string;
125
125
  }
126
126
  export interface VelcronTextStyling {
127
- text: string;
128
- placeholder?: string;
129
127
  typography?: string;
130
128
  size?: string;
131
129
  }
@@ -181,6 +179,8 @@ export interface VelcronCardDefinition extends VelcronDefinition, VelcronColorSt
181
179
  }
182
180
  export interface VelcronTextDefinition extends VelcronDefinitionWithEditMode, VelcronColorStyling, VelcronTextStyling {
183
181
  type: "text";
182
+ value?: VelcronBindableProp<string>;
183
+ placeholder?: VelcronBindableProp<string>;
184
184
  editLabel?: VelcronBindableProp;
185
185
  lineClamp?: number;
186
186
  noWrap?: boolean;
@@ -246,6 +246,8 @@ export interface VelcronIconDefinition extends VelcronDefinition, VelcronColorSt
246
246
  }
247
247
  export interface VelcronMarkdownDefinition extends VelcronDefinitionWithEditMode, VelcronColorStyling, VelcronTextStyling {
248
248
  type: "markdown";
249
+ value: VelcronBindableProp<string>;
250
+ placeholder: VelcronBindableProp<string>;
249
251
  events: VelcronOnUpdatedEvent;
250
252
  }
251
253
  export interface VelcronRiveDefinition extends VelcronDefinition {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/velcron",
3
3
  "license": "MIT",
4
- "version": "8.0.147-dev",
4
+ "version": "8.0.149-dev",
5
5
  "description": "Provide Omnia Velcron Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VelcronRenderers = void 0;
4
- const VelcronData_1 = require("./VelcronData");
5
4
  const __1 = require("..");
6
5
  class VelcronRenderers {
7
6
  static { this.components = {}; }
@@ -96,10 +95,12 @@ class VelcronRenderers {
96
95
  properties: currentRenderCtx.properties,
97
96
  };
98
97
  if (VelcronRenderers.definitionContainsCustomColorSchema(definition)) {
99
- const colorSchemaStore = (0, __1.useVelcronColorSchemaStore)(definition.key.toString());
100
- const colorSchemaType = VelcronData_1.VelcronData.dataBind(currentRenderCtx, definition.colorSchemaType);
101
- colorSchemaStore.actions.setThemeStore(currentRenderCtx.theming, colorSchemaType);
102
- result.colors = colorSchemaStore;
98
+ const colorSchemaType = __1.VelcronData.dataBind(currentRenderCtx, definition.colorSchemaType);
99
+ if (colorSchemaType && colorSchemaType !== "" && result.colors.state.colorSchemaType !== colorSchemaType) {
100
+ const colorSchemaStore = (0, __1.useVelcronColorSchemaStore)(definition.key.toString());
101
+ colorSchemaStore.actions.setThemeStore(currentRenderCtx.theming, colorSchemaType);
102
+ result.colors = colorSchemaStore;
103
+ }
103
104
  }
104
105
  return result;
105
106
  }
@@ -9,26 +9,6 @@ export declare const useVelcronColorSchemaStore: (newStateWithName?: string) =>
9
9
  isContainer: boolean;
10
10
  name: string;
11
11
  colorSchemaType: "info" | "error" | "primary" | "secondary" | ColorSchemaTypes | "accent1" | "accent2" | "accent3" | "neutral" | "warning" | "notification" | "background" | "dynamic";
12
- themeStore: {
13
- state: {
14
- currentTheme: import("@omnia/fx-models").ThemeDefinitionV2;
15
- };
16
- get: {
17
- componentBlueprints: () => void;
18
- colorSchema: (colorSchemaType: "info" | "error" | "primary" | "secondary" | ColorSchemaTypes | "accent1" | "accent2" | "accent3" | "neutral" | "warning" | "notification" | "background" | "dynamic") => ColorSchema;
19
- spacing: () => import("@omnia/fx-models").SpacingDefinition;
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" | "primary" | "secondary" | ColorSchemaTypes | "accent1" | "accent2" | "accent3" | "neutral" | "warning" | "notification" | "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" | "warning" | "notification" | "background" | "dynamic", colorType: "base" | "onBase" | "container" | "onContainer" | import("@omnia/fx-models").ColorTypes) => ColorDefinition;
23
- complementaryColorType: (colorType: "base" | "onBase" | "container" | "onContainer" | import("@omnia/fx-models").ColorTypes) => import("@omnia/fx-models").ColorTypes;
24
- complementaryColor: (colorSchemaType: "info" | "error" | "primary" | "secondary" | ColorSchemaTypes | "accent1" | "accent2" | "accent3" | "neutral" | "warning" | "notification" | "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" | "warning" | "notification" | "background" | "dynamic", colorType: "base" | "onBase" | "container" | "onContainer" | import("@omnia/fx-models").ColorTypes) => ColorDefinition;
26
- currentTheme: () => import("@omnia/fx-models").ThemeDefinitionV2;
27
- };
28
- actions: {
29
- setTheme(newTheme: import("@omnia/fx-models").ThemeDefinitionV2): void;
30
- };
31
- };
32
12
  id: import("@omnia/fx-models").GuidValue;
33
13
  };
34
14
  get: {
@@ -12,10 +12,13 @@ exports.useVelcronColorSchemaStore = (0, _1.defineVelcronStore)("ColorSchemaStor
12
12
  container: {},
13
13
  onContainer: {},
14
14
  isContainer: false,
15
- name: "",
15
+ name: (0, fx_models_1.valueOf)(""),
16
16
  colorSchemaType: fx_models_1.ColorSchemaTypes.background,
17
- themeStore: undefined,
18
17
  id: fx_models_1.Guid.newGuid(),
18
+ },
19
+ //The private state is not reactive that means it will not trigger re-rendering of the component
20
+ privateState: {
21
+ themeStore: (0, fx_models_1.valueOf)(null)
19
22
  }
20
23
  };
21
24
  },
@@ -56,17 +59,16 @@ exports.useVelcronColorSchemaStore = (0, _1.defineVelcronStore)("ColorSchemaStor
56
59
  },
57
60
  get onContainer() {
58
61
  return onContainer();
59
- },
62
+ }
60
63
  };
61
64
  },
62
- actions(state) {
65
+ actions(state, privateState) {
63
66
  function setThemeStore(themeStoreInstance, colorSchemaType, container) {
64
- state.themeStore = themeStoreInstance;
67
+ privateState.themeStore = themeStoreInstance;
65
68
  setColorSchema(colorSchemaType ? colorSchemaType : state.colorSchemaType, container);
66
69
  }
67
70
  function setColorSchema(colorSchemaType, container) {
68
- const colorSchema = state.themeStore.get.colorSchema(colorSchemaType);
69
- //ctx.mutate.colorSchema(colorSchema);
71
+ const colorSchema = privateState.themeStore.get.colorSchema(colorSchemaType);
70
72
  state.colorSchemaType = colorSchemaType;
71
73
  state.name = colorSchema.name;
72
74
  state.isContainer = container ? true : false;
@@ -81,4 +83,3 @@ exports.useVelcronColorSchemaStore = (0, _1.defineVelcronStore)("ColorSchemaStor
81
83
  };
82
84
  }
83
85
  });
84
- //return schemaStore;
@@ -9,7 +9,13 @@ function defineVelcronStore(name, definition) {
9
9
  name = newStateWithName;
10
10
  }
11
11
  if (!stateMap.has(name)) {
12
- stateMap.set(name, _1.ReactivitySystem.makeReactive(definition.setup()));
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 = _1.ReactivitySystem.makeReactive(setup.state);
17
+ setup.state = reactive;
18
+ stateMap.set(name, setup);
13
19
  }
14
20
  const reactiveState = stateMap.get(name);
15
21
  return {