@omnia/velcron 8.0.146-dev → 8.0.148-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.
|
@@ -82,7 +82,8 @@ export interface VelcronRenderContextEventHandlersInstance extends VelcronRender
|
|
|
82
82
|
export interface VelcronRenderContextHooks {
|
|
83
83
|
dialogVisibilityChanged?: ((visible: boolean) => void);
|
|
84
84
|
onItemSelected?: ((item: VelcronDefinition) => void);
|
|
85
|
-
|
|
85
|
+
wrapperStyleExtensions?: ((item: VelcronDefinition) => string);
|
|
86
|
+
appStyleExtension?: (() => string);
|
|
86
87
|
onItemCreatedProps?: ((item: VelcronDefinition) => object);
|
|
87
88
|
}
|
|
88
89
|
export interface VelcronContainerRenderer {
|
|
@@ -123,8 +124,6 @@ export interface VelcronColorStyling {
|
|
|
123
124
|
color?: string;
|
|
124
125
|
}
|
|
125
126
|
export interface VelcronTextStyling {
|
|
126
|
-
text: string;
|
|
127
|
-
placeholder?: string;
|
|
128
127
|
typography?: string;
|
|
129
128
|
size?: string;
|
|
130
129
|
}
|
|
@@ -180,6 +179,8 @@ export interface VelcronCardDefinition extends VelcronDefinition, VelcronColorSt
|
|
|
180
179
|
}
|
|
181
180
|
export interface VelcronTextDefinition extends VelcronDefinitionWithEditMode, VelcronColorStyling, VelcronTextStyling {
|
|
182
181
|
type: "text";
|
|
182
|
+
value: VelcronBindableProp<string>;
|
|
183
|
+
placeholder?: VelcronBindableProp<string>;
|
|
183
184
|
editLabel?: VelcronBindableProp;
|
|
184
185
|
lineClamp?: number;
|
|
185
186
|
noWrap?: boolean;
|
|
@@ -245,6 +246,8 @@ export interface VelcronIconDefinition extends VelcronDefinition, VelcronColorSt
|
|
|
245
246
|
}
|
|
246
247
|
export interface VelcronMarkdownDefinition extends VelcronDefinitionWithEditMode, VelcronColorStyling, VelcronTextStyling {
|
|
247
248
|
type: "markdown";
|
|
249
|
+
value: VelcronBindableProp<string>;
|
|
250
|
+
placeholder: VelcronBindableProp<string>;
|
|
248
251
|
events: VelcronOnUpdatedEvent;
|
|
249
252
|
}
|
|
250
253
|
export interface VelcronRiveDefinition extends VelcronDefinition {
|
package/package.json
CHANGED
|
@@ -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
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
67
|
+
privateState.themeStore = themeStoreInstance;
|
|
65
68
|
setColorSchema(colorSchemaType ? colorSchemaType : state.colorSchemaType, container);
|
|
66
69
|
}
|
|
67
70
|
function setColorSchema(colorSchemaType, container) {
|
|
68
|
-
const colorSchema =
|
|
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;
|
package/stores/VelcronStore.js
CHANGED
|
@@ -9,7 +9,13 @@ function defineVelcronStore(name, definition) {
|
|
|
9
9
|
name = newStateWithName;
|
|
10
10
|
}
|
|
11
11
|
if (!stateMap.has(name)) {
|
|
12
|
-
|
|
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 {
|