@omnia/fx-models 8.0.174-dev → 8.0.175-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.
@@ -114,6 +114,7 @@ export interface ThemedColorValue {
114
114
  colorType: ColorType;
115
115
  toned?: boolean;
116
116
  colorSchemaType?: ColorSchemaType;
117
+ opacity?: number;
117
118
  }
118
119
  export type ColorValue = string | ThemedColorValue;
119
120
  export declare enum RadialGradientShapes {
@@ -0,0 +1,324 @@
1
+ export type VelcronEffects = {
2
+ initial?: Variant;
3
+ enter?: Variant;
4
+ leave?: Variant;
5
+ visible?: Variant;
6
+ visibleOnce?: Variant;
7
+ hovered?: Variant;
8
+ tapped?: Variant;
9
+ focused?: Variant;
10
+ };
11
+ type Variant = {
12
+ transition?: Transition;
13
+ } & MotionProperties;
14
+ type Transition = (Orchestration & Repeat & TransitionDefinition) | (Orchestration & Repeat & TransitionMap);
15
+ type Easing = [number, number, number, number] | "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate";
16
+ type ResolvedKeyframesTarget = [null, ...number[]] | number[] | [null, ...string[]] | string[];
17
+ type KeyframesTarget = ResolvedKeyframesTarget;
18
+ type ResolvedSingleTarget = string | number;
19
+ type SingleTarget = ResolvedSingleTarget;
20
+ type ValueTarget = SingleTarget | KeyframesTarget;
21
+ type TransitionMap = Orchestration & Record<string, TransitionDefinition>;
22
+ /**
23
+ * Transform properties
24
+ */
25
+ type TransformValue = string | number;
26
+ interface TransformProperties {
27
+ x?: TransformValue | TransformValue[];
28
+ y?: TransformValue | TransformValue[];
29
+ z?: TransformValue | TransformValue[];
30
+ translateX?: TransformValue | TransformValue[];
31
+ translateY?: TransformValue | TransformValue[];
32
+ translateZ?: TransformValue | TransformValue[];
33
+ rotate?: TransformValue | TransformValue[];
34
+ rotateX?: TransformValue | TransformValue[];
35
+ rotateY?: TransformValue | TransformValue[];
36
+ rotateZ?: TransformValue | TransformValue[];
37
+ scale?: TransformValue | TransformValue[];
38
+ scaleX?: TransformValue | TransformValue[];
39
+ scaleY?: TransformValue | TransformValue[];
40
+ scaleZ?: TransformValue | TransformValue[];
41
+ skew?: TransformValue | TransformValue[];
42
+ skewX?: TransformValue | TransformValue[];
43
+ skewY?: TransformValue | TransformValue[];
44
+ originX?: TransformValue | TransformValue[];
45
+ originY?: TransformValue | TransformValue[];
46
+ originZ?: TransformValue | TransformValue[];
47
+ perspective?: TransformValue | TransformValue[];
48
+ transformPerspective?: TransformValue | TransformValue[];
49
+ }
50
+ /**
51
+ * Relevant styling properties
52
+ */
53
+ type StyleProperties = {
54
+ color: string;
55
+ };
56
+ /**
57
+ * Available properties for useMotion variants
58
+ */
59
+ type MotionProperties = StyleProperties | TransformProperties;
60
+ interface Orchestration {
61
+ /**
62
+ * Delay the animation by this duration (in seconds). Defaults to `0`.
63
+ */
64
+ delay?: number;
65
+ /**
66
+ * Callback triggered on animation complete.
67
+ */
68
+ onComplete?: () => void;
69
+ /**
70
+ * Should the value be set imediately
71
+ */
72
+ immediate?: boolean;
73
+ }
74
+ interface Repeat {
75
+ /**
76
+ * The number of times to repeat the transition. Set to `Infinity` for perpetual repeating.
77
+ *
78
+ * Without setting `repeatType`, this will loop the animation.
79
+ */
80
+ repeat?: number;
81
+ /**
82
+ * How to repeat the animation. This can be either:
83
+ *
84
+ * "loop": Repeats the animation from the start
85
+ *
86
+ * "reverse": Alternates between forward and backwards playback
87
+ *
88
+ * "mirror": Switchs `from` and `to` alternately
89
+ */
90
+ repeatType?: "loop" | "reverse" | "mirror";
91
+ /**
92
+ * When repeating an animation, `repeatDelay` will set the
93
+ * duration of the time to wait, in seconds, between each repetition.
94
+ */
95
+ repeatDelay?: number;
96
+ }
97
+ type PermissiveTransitionDefinition = Record<string, any>;
98
+ type TransitionDefinition = Tween | Spring | Keyframes | Inertia | PermissiveTransitionDefinition;
99
+ interface Tween extends Repeat {
100
+ /**
101
+ * Set `type` to `"tween"` to use a duration-based tween animation.
102
+ * If any non-orchestration `transition` values are set without a `type` property,
103
+ * this is used as the default animation.
104
+ */
105
+ type?: "tween";
106
+ /**
107
+ * The duration of the tween animation. Set to `0.3` by default, 0r `0.8` if animating a series of keyframes.
108
+ */
109
+ duration?: number;
110
+ /**
111
+ * The easing function to use. Set as one of the below.
112
+ *
113
+ * - The name of an existing easing function.
114
+ * - An array of four numbers to define a cubic bezier curve.
115
+ * - An easing function, that accepts and returns a value `0-1`.
116
+ *
117
+ * If the animating value is set as an array of multiple values for a keyframes
118
+ * animation, `ease` can be set as an array of easing functions to set different easings between
119
+ * each of those values.
120
+ */
121
+ ease?: Easing | Easing[];
122
+ /**
123
+ * The duration of time already elapsed in the animation. Set to `0` by
124
+ * default.
125
+ */
126
+ elapsed?: number;
127
+ /**
128
+ * When animating keyframes, `times` can be used to determine where in the animation each keyframe is reached.
129
+ * Each value in `times` is a value between `0` and `1`, representing `duration`.
130
+ *
131
+ * There must be the same number of `times` as there are keyframes.
132
+ * Defaults to an array of evenly-spread durations.
133
+ */
134
+ times?: number[];
135
+ /**
136
+ * When animating keyframes, `easings` can be used to define easing functions between each keyframe. This array should be one item fewer than the number of keyframes, as these easings apply to the transitions between the keyframes.
137
+ */
138
+ easings?: Easing[];
139
+ /**
140
+ * The value to animate from.
141
+ * By default, this is the current state of the animating value.
142
+ */
143
+ from?: number | string;
144
+ to?: number | string | ValueTarget;
145
+ velocity?: number;
146
+ delay?: number;
147
+ }
148
+ interface Spring extends Repeat {
149
+ /**
150
+ * Set `type` to `"spring"` to animate using spring physics for natural
151
+ * movement. Type is set to `"spring"` by default.
152
+ */
153
+ type: "spring";
154
+ /**
155
+ * Stiffness of the spring. Higher values will create more sudden movement.
156
+ * Set to `100` by default.
157
+ */
158
+ stiffness?: number;
159
+ /**
160
+ * Strength of opposing force. If set to 0, spring will oscillate
161
+ * indefinitely. Set to `10` by default.
162
+ */
163
+ damping?: number;
164
+ /**
165
+ * Mass of the moving object. Higher values will result in more lethargic
166
+ * movement. Set to `1` by default.
167
+ */
168
+ mass?: number;
169
+ /**
170
+ * The duration of the animation, defined in seconds. Spring animations can be a maximum of 10 seconds.
171
+ *
172
+ * If `bounce` is set, this defaults to `0.8`.
173
+ *
174
+ * Note: `duration` and `bounce` will be overridden if `stiffness`, `damping` or `mass` are set.
175
+ */
176
+ duration?: number;
177
+ /**
178
+ * `bounce` determines the "bounciness" of a spring animation.
179
+ *
180
+ * `0` is no bounce, and `1` is extremely bouncy.
181
+ *
182
+ * If `duration` is set, this defaults to `0.25`.
183
+ *
184
+ * Note: `bounce` and `duration` will be overridden if `stiffness`, `damping` or `mass` are set.
185
+ */
186
+ bounce?: number;
187
+ /**
188
+ * End animation if absolute speed (in units per second) drops below this
189
+ * value and delta is smaller than `restDelta`. Set to `0.01` by default.
190
+ */
191
+ restSpeed?: number;
192
+ /**
193
+ * End animation if distance is below this value and speed is below
194
+ * `restSpeed`. When animation ends, spring gets “snapped” to. Set to
195
+ * `0.01` by default.
196
+ */
197
+ restDelta?: number;
198
+ /**
199
+ * The value to animate from.
200
+ * By default, this is the initial state of the animating value.
201
+ */
202
+ from?: number | string;
203
+ to?: number | string | ValueTarget;
204
+ /**
205
+ * The initial velocity of the spring. By default this is the current velocity of the component.
206
+ */
207
+ velocity?: number;
208
+ delay?: number;
209
+ }
210
+ /**
211
+ * Keyframes tweens between multiple `values`.
212
+ *
213
+ * These tweens can be arranged using the `duration`, `easings`, and `times` properties.
214
+ */
215
+ interface Keyframes {
216
+ /**
217
+ * Set `type` to `"keyframes"` to animate using the keyframes animation.
218
+ * Set to `"tween"` by default. This can be used to animate between a series of values.
219
+ */
220
+ type: "keyframes";
221
+ /**
222
+ * An array of values to animate between.
223
+ */
224
+ values: KeyframesTarget;
225
+ /**
226
+ * An array of numbers between 0 and 1, where `1` represents the `total` duration.
227
+ *
228
+ * Each value represents at which point during the animation each item in the animation target should be hit, so the array should be the same length as `values`.
229
+ *
230
+ * Defaults to an array of evenly-spread durations.
231
+ */
232
+ times?: number[];
233
+ /**
234
+ * An array of easing functions for each generated tween, or a single easing function applied to all tweens.
235
+ *
236
+ * This array should be one item less than `values`, as these easings apply to the transitions *between* the `values`.
237
+ */
238
+ ease?: Easing | Easing[];
239
+ /**
240
+ * Popmotion's easing prop to define individual easings. `ease` will be mapped to this prop in keyframes animations.
241
+ */
242
+ easings?: Easing | Easing[];
243
+ elapsed?: number;
244
+ /**
245
+ * The total duration of the animation. Set to `0.3` by default.
246
+ */
247
+ duration?: number;
248
+ repeatDelay?: number;
249
+ from?: number | string;
250
+ to?: number | string | ValueTarget;
251
+ velocity?: number;
252
+ delay?: number;
253
+ }
254
+ /**
255
+ * An animation that decelerates a value based on its initial velocity,
256
+ * usually used to implement inertial scrolling.
257
+ *
258
+ * Optionally, `min` and `max` boundaries can be defined, and inertia
259
+ * will snap to these with a spring animation.
260
+ *
261
+ * This animation will automatically precalculate a target value,
262
+ * which can be modified with the `modifyTarget` property.
263
+ *
264
+ * This allows you to add snap-to-grid or similar functionality.
265
+ *
266
+ * Inertia is also the animation used for `dragTransition`, and can be configured via that prop.
267
+ */
268
+ interface Inertia {
269
+ /**
270
+ * Set `type` to animate using the inertia animation. Set to `"tween"` by
271
+ * default. This can be used for natural deceleration, like momentum scrolling.
272
+ */
273
+ type: "inertia";
274
+ /**
275
+ * A function that receives the automatically-calculated target and returns a new one. Useful for snapping the target to a grid.
276
+ */
277
+ modifyTarget?(v: number): number;
278
+ /**
279
+ * If `min` or `max` is set, this affects the stiffness of the bounce
280
+ * spring. Higher values will create more sudden movement. Set to `500` by
281
+ * default.
282
+ */
283
+ bounceStiffness?: number;
284
+ /**
285
+ * If `min` or `max` is set, this affects the damping of the bounce spring.
286
+ * If set to `0`, spring will oscillate indefinitely. Set to `10` by
287
+ * default.
288
+ */
289
+ bounceDamping?: number;
290
+ /**
291
+ * A higher power value equals a further target. Set to `0.8` by default.
292
+ */
293
+ power?: number;
294
+ /**
295
+ * Adjusting the time constant will change the duration of the
296
+ * deceleration, thereby affecting its feel. Set to `700` by default.
297
+ */
298
+ timeConstant?: number;
299
+ /**
300
+ * End the animation if the distance to the animation target is below this value, and the absolute speed is below `restSpeed`.
301
+ * When the animation ends, the value gets snapped to the animation target. Set to `0.01` by default.
302
+ * Generally the default values provide smooth animation endings, only in rare cases should you need to customize these.
303
+ */
304
+ restDelta?: number;
305
+ /**
306
+ * Minimum constraint. If set, the value will "bump" against this value (or immediately spring to it if the animation starts as less than this value).
307
+ */
308
+ min?: number;
309
+ /**
310
+ * Maximum constraint. If set, the value will "bump" against this value (or immediately snap to it, if the initial animation value exceeds this value).
311
+ */
312
+ max?: number;
313
+ /**
314
+ * The value to animate from. By default, this is the current state of the animating value.
315
+ */
316
+ from?: number | string;
317
+ /**
318
+ * The initial velocity of the animation.
319
+ * By default this is the current velocity of the component.
320
+ */
321
+ velocity?: number;
322
+ delay?: number;
323
+ }
324
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  import { VelcronOnUpdatedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnPressEvent, VelcronSpacing, VelcronStyling, VelcronCustomComponentDefinition, VelcronAppDefinition, VelcronRendererResolverReference, EventHook, Future, TextBlueprint, VelcronBindableProp, VelcronEditor, ContainerBlueprint, BackgroundDefinition, ContainerVariant } from "@omnia/fx-models/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, useVelcronThemingStore } from "..";
4
+ import { DynamicState, VelcronDefinition, VelcronEffects, useVelcronThemingStore } from "..";
5
5
  import { GuidValue, PropertyConfiguration, PropertyValue, PropertyDefinition, PropertySetupBase } from "@omnia/fx/models";
6
6
  import { useVelcronColorSchemaStore } from "../stores/VelcronColorSchema";
7
7
  export interface ResolvedComponentRenderer {
@@ -158,8 +158,6 @@ export interface VelcronFlexDefinition extends VelcronDefinition, VelcronColorSt
158
158
  border?: VelcronBorder;
159
159
  borderRadius?: VelcronDimensions;
160
160
  }
161
- export interface VelcronEffects {
162
- }
163
161
  export interface VelcronFlexRowDefinition extends VelcronDefinition, VelcronColorStyling {
164
162
  type: "row";
165
163
  events?: VelcronOnPressEvent;
@@ -1,6 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VelcronImageRatios = void 0;
4
+ const p = {
5
+ type: "row",
6
+ alignX: "center",
7
+ alignY: "center",
8
+ colorSchemaType: "primary",
9
+ direction: "row",
10
+ effects: {
11
+ initial: {
12
+ scale: 1
13
+ },
14
+ visible: {
15
+ scale: 1
16
+ },
17
+ hovered: {
18
+ scale: 1.5,
19
+ rotateY: 360, // Rotate 360 degrees on hover
20
+ transition: {
21
+ duration: 0.5, // Duration of the animation
22
+ easing: "ease-in-out" // Easing function for a smooth animation
23
+ }
24
+ },
25
+ tapped: {
26
+ scale: 1.5,
27
+ rotateX: 360, // Rotate 360 degrees on hover
28
+ transition: {
29
+ duration: 0.5, // Duration of the animation
30
+ easing: "ease-in-out" // Easing function for a smooth animation
31
+ }
32
+ }
33
+ }
34
+ };
4
35
  var VelcronImageRatios;
5
36
  (function (VelcronImageRatios) {
6
37
  VelcronImageRatios["square"] = "square";
@@ -3,13 +3,16 @@ import { VelcronImageRatios } from "./VelcronDefinitions";
3
3
  export interface VelcronState {
4
4
  images?: VelcronImagesState;
5
5
  container?: {
6
+ maxWidth?: number;
7
+ minHeight?: number;
8
+ alignX?: string;
9
+ alignY?: string;
6
10
  colorSchemaType?: string;
7
11
  spacing?: VelcronSpacing;
8
12
  blueprint?: ContainerBlueprint | ContainerVariant;
9
13
  background?: BackgroundDefinition;
10
14
  };
11
15
  grid?: VelcronGridState;
12
- colorSchemas?: VelcronColorSchemasState;
13
16
  content?: VelcronContentState;
14
17
  header?: VelcronHeaderState;
15
18
  properties?: VelcronPropertiesState;
@@ -59,11 +62,6 @@ export interface VelcronImageState {
59
62
  width?: number;
60
63
  height?: number;
61
64
  }
62
- export interface VelcronStylingState {
63
- }
64
- export interface VelcronColorSchemasState {
65
- main: string;
66
- }
67
65
  export declare const VelcronImagesStateBinding: {
68
66
  main: {
69
67
  editor: string;
@@ -96,16 +94,19 @@ export declare const VelcronStateMapping: {
96
94
  };
97
95
  };
98
96
  export declare const VelcronStateBinding: {
99
- colorSchemas: {
100
- main_depricated: {
101
- value: string;
102
- type: string;
103
- filled: string;
104
- };
105
- };
106
97
  container: {
98
+ maxWidth: string;
99
+ minHeight: string;
100
+ alignX: string;
101
+ alignY: string;
107
102
  colorSchemaType: string;
108
- spacing: string;
103
+ spacing: {
104
+ value: string;
105
+ top: string;
106
+ right: string;
107
+ bottom: string;
108
+ left: string;
109
+ };
109
110
  blueprint: string;
110
111
  background: {
111
112
  value: string;
@@ -174,13 +175,4 @@ export declare const VelcronStateBinding: {
174
175
  };
175
176
  icon: string;
176
177
  };
177
- spacing: {
178
- container: {
179
- value: string;
180
- top: string;
181
- right: string;
182
- bottom: string;
183
- left: string;
184
- };
185
- };
186
178
  };
@@ -56,16 +56,19 @@ exports.VelcronStateMapping = {
56
56
  },
57
57
  };
58
58
  exports.VelcronStateBinding = {
59
- colorSchemas: {
60
- main_depricated: {
61
- value: (0, models_1.velcronBind)("colorSchemas.main"),
62
- type: (0, models_1.velcronBind)("colorSchemas.main.type"),
63
- filled: (0, models_1.velcronBind)("colorSchemas.main.filled")
64
- }
65
- },
66
59
  container: {
60
+ maxWidth: (0, models_1.velcronBind)("$state.container.maxWidth"),
61
+ minHeight: (0, models_1.velcronBind)("$state.container.minHeight"),
62
+ alignX: (0, models_1.velcronBind)("$state.container.alignX"),
63
+ alignY: (0, models_1.velcronBind)("$state.container.alignY"),
67
64
  colorSchemaType: (0, models_1.velcronBind)("$state.container.colorSchemaType"),
68
- spacing: (0, models_1.velcronBind)("$state.container.spacing"),
65
+ spacing: {
66
+ value: (0, models_1.velcronBind)("$state.container.spacing"),
67
+ top: (0, models_1.velcronBind)("{{container.spacing.top}}"),
68
+ right: (0, models_1.velcronBind)("{{container.spacing.right}}"),
69
+ bottom: (0, models_1.velcronBind)("{{container.spacing.bottom}}"),
70
+ left: (0, models_1.velcronBind)("{{container.spacing.left}}"),
71
+ },
69
72
  blueprint: (0, models_1.velcronBind)("$state.container.blueprint"),
70
73
  background: {
71
74
  value: (0, models_1.velcronBind)("$state.container.background"),
@@ -89,14 +92,5 @@ exports.VelcronStateBinding = {
89
92
  },
90
93
  icon: (0, models_1.velcronBind)("$state.header.icon")
91
94
  },
92
- spacing: {
93
- container: {
94
- value: (0, models_1.velcronBind)("$state.spacing.chrome"),
95
- top: (0, models_1.velcronBind)("{{spacing.chrome.top}}"),
96
- right: (0, models_1.velcronBind)("{{spacing.chrome.right}}"),
97
- bottom: (0, models_1.velcronBind)("{{spacing.chrome.bottom}}"),
98
- left: (0, models_1.velcronBind)("{{spacing.chrome.left}}"),
99
- }
100
- }
101
95
  //properties?:VelcronPropertiesState,
102
96
  };
@@ -6,3 +6,4 @@ export * from "./VelcronUnitProvider";
6
6
  export * from "./VelcronPropertyEditorDefinitions";
7
7
  export * from "./ActionHooks";
8
8
  export * from "./VelcronState";
9
+ export * from "./Effects";
@@ -9,3 +9,4 @@ tslib_1.__exportStar(require("./VelcronUnitProvider"), exports);
9
9
  tslib_1.__exportStar(require("./VelcronPropertyEditorDefinitions"), exports);
10
10
  tslib_1.__exportStar(require("./ActionHooks"), exports);
11
11
  tslib_1.__exportStar(require("./VelcronState"), exports);
12
+ tslib_1.__exportStar(require("./Effects"), exports);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/fx-models",
3
3
  "license": "MIT",
4
- "version": "8.0.174-dev",
4
+ "version": "8.0.175-dev",
5
5
  "description": "Provide Omnia Fx Models Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"