@omnia/fx-models 8.0.26-vnext → 8.0.28-vnext

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/Layout.d.ts CHANGED
@@ -485,21 +485,16 @@ export interface LayoutRendererCanvasApi {
485
485
  }
486
486
  export interface Breakpoint {
487
487
  xs: boolean;
488
- xsOnly: boolean;
489
488
  sm: boolean;
490
- smOnly: boolean;
491
489
  smAndDown: boolean;
492
490
  smAndUp: boolean;
493
491
  md: boolean;
494
- mdOnly: boolean;
495
492
  mdAndDown: boolean;
496
493
  mdAndUp: boolean;
497
494
  lg: boolean;
498
- lgOnly: boolean;
499
495
  lgAndDown: boolean;
500
496
  lgAndUp: boolean;
501
497
  xl: boolean;
502
- xlOnly: boolean;
503
498
  name: ("xs" | "sm" | "md" | "lg" | "xl");
504
499
  width: number;
505
500
  height: number;
@@ -508,8 +503,9 @@ export interface Breakpoint {
508
503
  sm: number;
509
504
  md: number;
510
505
  lg: number;
506
+ xl: number;
507
+ xxl: number;
511
508
  };
512
- scrollbarWidth: number;
513
509
  }
514
510
  /**
515
511
  * Define different context extending this so that Layout can different multiple media provider per context
@@ -1,5 +1,5 @@
1
- import { VelcronComponentDescriptor } from "../../editor/models/VelcronDescriptors";
2
- import { VelcronEvent, VelcronOnChangedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnLoadEvent, VelcronOnPressEvent } from "./VelcronEvents";
1
+ import { VelcronComponentDescriptor, VelcronDefinitionEditableProperty } from "../../editor/models/VelcronDescriptors";
2
+ import { VelcronEvent, VelcronOnChangedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnEditModeEvent, VelcronOnLoadEvent, VelcronOnPressEvent } from "./VelcronEvents";
3
3
  import { VelcroncomponentArrayType, VelcronPrimitiveType } from "./VelcronTypes";
4
4
  import { AssignOperators, VelcronHorizontalAlignments, VelcronIconTypes, VelcronActionTypes, VelcronVerticalAlignments } from "./Enums";
5
5
  import { useVelcronThemingStore } from "..";
@@ -28,19 +28,15 @@ export interface ColorSchemaReference {
28
28
  name: string;
29
29
  schema: string;
30
30
  }
31
- export interface VelcronState {
32
- colorSchemas?: {
33
- [key: string]: ColorSchemaReference;
34
- };
35
- }
31
+ export type DynamicState = object;
36
32
  export interface OnItemRenderedHookResult {
37
33
  cssClass: string;
38
34
  containerRenderer?: VelcronContainerRenderer;
39
35
  }
40
36
  export interface VelcronRenderContext {
41
37
  id?: string;
42
- rootContext: VelcronState;
43
- currentContext: VelcronState;
38
+ rootContext: DynamicState;
39
+ currentContext: DynamicState;
44
40
  theming?: ReturnType<typeof useVelcronThemingStore>;
45
41
  colors?: ReturnType<typeof useVelcronColorSchemaStore>;
46
42
  actions?: {
@@ -56,6 +52,7 @@ export interface VelcronRenderContext {
56
52
  parent?: VelcronRenderContext;
57
53
  hooks?: VelcronRenderContextHooks;
58
54
  eventHandlers?: VelcronRenderContextEventHandlers;
55
+ editMode?: boolean;
59
56
  }
60
57
  export interface VelcronRenderContextEventHandlers {
61
58
  receiving?: {
@@ -116,6 +113,11 @@ export interface VelcronDefinition extends VelcronDefinitionBase {
116
113
  if?: string;
117
114
  events?: VelcronEvent;
118
115
  }
116
+ export type VelcronBindableProp<TPropType = string> = TPropType | string;
117
+ export type VelcronStringBindableProp = string;
118
+ export interface VelcronDefinitionWithEditMode extends VelcronDefinition {
119
+ edit?: VelcronBindableProp<boolean>;
120
+ }
119
121
  export interface VelcronColorStyling {
120
122
  colorSchemaType?: string;
121
123
  color?: string;
@@ -150,17 +152,17 @@ export interface VelcronIcon {
150
152
  type: VelcronIconTypes;
151
153
  name: string;
152
154
  }
153
- export interface VelcronAppDefinition extends VelcronDefinitionBase {
155
+ export interface VelcronAppDefinition<TState extends DynamicState = DynamicState> extends VelcronDefinitionBase {
154
156
  type: "Velcron";
155
157
  version: string;
156
158
  name: string;
157
159
  body?: Array<VelcronDefinition>;
158
- events?: VelcronOnLoadEvent & VelcronOnPressEvent;
160
+ events?: VelcronOnLoadEvent & VelcronOnEditModeEvent;
159
161
  actions?: {
160
162
  [name: string]: [];
161
163
  };
162
164
  components?: Array<VelcronCustomComponentDefinition>;
163
- state?: VelcronState;
165
+ state?: TState;
164
166
  computed?: {
165
167
  [name: string]: [];
166
168
  };
@@ -190,14 +192,16 @@ export interface VelcronCardDefinition extends VelcronDefinition {
190
192
  footer?: Array<VelcronDefinition>;
191
193
  events?: VelcronOnPressEvent;
192
194
  }
193
- export interface VelcronTextDefinition extends VelcronDefinition {
195
+ export interface VelcronTextDefinition extends VelcronDefinitionEditableProperty {
194
196
  type: "Text";
195
197
  text: string;
198
+ bind: string;
199
+ editLabel?: VelcronBindableProp;
196
200
  color?: string;
197
201
  lineClamp?: number;
198
202
  noWrap?: boolean;
199
203
  typography?: string;
200
- events?: VelcronOnPressEvent;
204
+ events?: VelcronOnPressEvent & VelcronOnChangedEvent;
201
205
  }
202
206
  export declare enum VelcronImageRatios {
203
207
  square = 1,
@@ -207,6 +211,7 @@ export interface VelcronImageDefinition extends VelcronDefinition {
207
211
  type: "Image";
208
212
  source: string;
209
213
  ratio: VelcronImageRatios;
214
+ cover?: VelcronBindableProp<boolean>;
210
215
  borderRadius?: VelcronDimensions;
211
216
  events?: VelcronOnPressEvent;
212
217
  }
@@ -245,12 +250,10 @@ export interface VelcronIconDefinition extends VelcronDefinition {
245
250
  size?: number;
246
251
  events?: VelcronOnPressEvent;
247
252
  }
248
- export interface VelcronMarkdownDefinition extends VelcronDefinition {
253
+ export interface VelcronMarkdownDefinition extends VelcronDefinitionWithEditMode {
249
254
  type: "Markdown";
250
255
  text: string;
251
- initialValue: string;
252
256
  bind: string;
253
- edit?: boolean | string;
254
257
  events: VelcronOnChangedEvent;
255
258
  }
256
259
  export interface VelcronDimensions {
@@ -4,6 +4,9 @@ export type VelcronOnPressEvent = {
4
4
  export type VelcronOnLoadEvent = {
5
5
  onLoaded?: Array<string>;
6
6
  };
7
+ export type VelcronOnEditModeEvent = {
8
+ onEditMode?: Array<string>;
9
+ };
7
10
  export type VelcronOnChangedEvent = {
8
11
  onChanged?: Array<string>;
9
12
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/fx-models",
3
3
  "license": "MIT",
4
- "version": "8.0.26-vnext",
4
+ "version": "8.0.28-vnext",
5
5
  "description": "Provide Omnia Fx Models Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,6 +1,6 @@
1
- import { Guid, VelcronAppDefinition } from "..";
2
- export interface VelcronDefinitionRegistration {
1
+ import { DynamicState, Guid, VelcronAppDefinition } from "..";
2
+ export interface VelcronDefinitionRegistration<TDefinitionState extends DynamicState = DynamicState> {
3
3
  id: Guid;
4
- definition: VelcronAppDefinition;
4
+ definition: VelcronAppDefinition<TDefinitionState>;
5
5
  title: string;
6
6
  }