@omnia/velcron 8.0.276-dev → 8.0.278-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/actions/Clone.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.objAssign = exports.objClone = void 0;
4
- const stores_1 = require("../stores");
4
+ const providers_1 = require("../providers");
5
5
  exports.objClone = {
6
6
  name: "@clone",
7
7
  action: (action, objToClone) => {
8
- action.promise.resolve(stores_1.ReactivitySystem.makeReactive(JSON.parse(JSON.stringify(objToClone))));
8
+ action.promise.resolve(providers_1.ReactivityProvider.makeReactive(JSON.parse(JSON.stringify(objToClone))));
9
9
  }
10
10
  };
11
11
  exports.objAssign = {
package/index.d.ts CHANGED
@@ -6,3 +6,4 @@ export * from "@omnia/velcron/internal-do-not-import-from-here/shared/models";
6
6
  export * from "./rules";
7
7
  export * from "./templatebuilder";
8
8
  export * from "./events";
9
+ export * from "./providers";
package/index.js CHANGED
@@ -9,3 +9,4 @@ tslib_1.__exportStar(require("@omnia/velcron/internal-do-not-import-from-here/sh
9
9
  tslib_1.__exportStar(require("./rules"), exports);
10
10
  tslib_1.__exportStar(require("./templatebuilder"), exports);
11
11
  tslib_1.__exportStar(require("./events"), exports);
12
+ tslib_1.__exportStar(require("./providers"), exports);
@@ -60,7 +60,7 @@ export interface VelcronComponentDefinition extends VelcronDefinition {
60
60
  icon?: any;
61
61
  }
62
62
  export type VelcronCustomComponentDefinition = VelcronComponentDefinition;
63
- export type BuiltInPropertyEditorType = "text" | "number" | "slider" | "switch" | "alignment" | "color" | "markdown" | "icon" | "image" | "typography" | "spacing" | "color-schema-type" | "blueprint" | "background" | "grid" | "reference" | "select" | "property-resolver";
63
+ export type BuiltInPropertyEditorType = "text" | "number" | "slider" | "switch" | "alignment" | "color" | "flow" | "icon" | "image" | "typography" | "spacing" | "color-schema-type" | "blueprint" | "background" | "grid" | "reference" | "select" | "property-resolver";
64
64
  export type EditorLocation = "inline" | "pane" | "toolbar";
65
65
  export interface VelcronEditor<TSettings = any> {
66
66
  name?: string;
@@ -1,4 +1,4 @@
1
- import { VelcronOnUpdatedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnPressEvent, VelcronSpacing, VelcronStyling, VelcronCustomComponentDefinition, VelcronAppDefinition, VelcronRendererResolverReference, EventHook, Future, TextBlueprint, VelcronBindableProp, VelcronEditor, ContainerBlueprint, BackgroundDefinition, ContainerVariant, IconBlueprint } from "@omnia/velcron/internal-do-not-import-from-here/shared/models";
1
+ import { VelcronOnUpdatedEvent, VelcronOnClosedEvent, VelcronOnCloseRequestedEvent, VelcronOnPressEvent, VelcronSpacing, VelcronStyling, VelcronCustomComponentDefinition, VelcronAppDefinition, VelcronRendererResolverReference, EventHook, Future, TextBlueprint, VelcronBindableProp, VelcronEditor, ContainerBlueprint, BackgroundDefinition, ContainerVariant, IconBlueprint, ButtonBlueprint } 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
4
  import { DynamicState, VelcronDefinition, VelcronEffects, useVelcronThemingStore } from "..";
@@ -46,6 +46,14 @@ export interface OnItemRenderedHookResult {
46
46
  cssClass: string;
47
47
  containerRenderer?: VelcronContainerRenderer;
48
48
  }
49
+ export interface VelcronDisplay {
50
+ size: VelcronDisplaySizes;
51
+ }
52
+ export interface VelcronDisplaySizes {
53
+ sm: boolean;
54
+ md: boolean;
55
+ lg: boolean;
56
+ }
49
57
  export interface VelcronRenderContext {
50
58
  id?: string;
51
59
  rootContext: DynamicState;
@@ -71,6 +79,7 @@ export interface VelcronRenderContext {
71
79
  baseDefinition?: VelcronAppDefinition;
72
80
  subApp?: boolean;
73
81
  subAppreferenceId?: guid;
82
+ $display: VelcronDisplay;
74
83
  }
75
84
  export interface VelcronRenderContextEventHandlers {
76
85
  receiving?: {
@@ -240,13 +249,14 @@ export interface VelcronVideoDefinition extends VelcronDefinition {
240
249
  autoplay?: VelcronBindableProp<boolean>;
241
250
  muted?: VelcronBindableProp<boolean>;
242
251
  }
243
- export interface VelcronButtonDefinition extends VelcronDefinition {
252
+ export interface VelcronButtonDefinition extends VelcronDefinition, VelcronColorStyling {
244
253
  type: "button";
245
254
  text: string;
246
255
  icon?: VelcronIcon;
247
256
  disabled?: boolean;
248
257
  events?: VelcronOnPressEvent;
249
258
  size?: string;
259
+ blueprint?: VelcronBindableProp<ButtonBlueprint>;
250
260
  }
251
261
  export interface VelcronTextInputDefinition extends VelcronDefinition {
252
262
  type: "text-input";
@@ -372,8 +382,10 @@ export interface VelcronPropertyDefinitionValue {
372
382
  configuration: PropertyConfiguration<PropertyDefinition<any, any, any, PropertySetupBase>>;
373
383
  }
374
384
  export interface VelcronPropertyDefinitionValueResolver {
375
- name: string;
376
- source: IDataSourcePropertySelection;
385
+ source?: IDataSourcePropertySelection;
386
+ }
387
+ export interface VelcronPropertyEditorValue {
388
+ [key: string]: VelcronPropertyDefinitionValueResolver;
377
389
  }
378
390
  export type VelcronRenderProps<TDefinition> = {
379
391
  definition: TDefinition;
@@ -37,15 +37,16 @@ export interface VelcronNumberEditorSettings {
37
37
  step: number;
38
38
  }
39
39
  export interface VelcronPropertyMapping {
40
- name: string;
40
+ state: string;
41
+ title: string;
41
42
  definitionId: guid;
42
- dataSourceId?: guid;
43
+ dataSourceIds?: guid[];
43
44
  }
44
45
  export interface VelcronPropertyResolverEditorSettings {
45
46
  properties: Array<VelcronPropertyMapping>;
46
47
  }
47
48
  export interface VelcronBlueprintEditorSettings {
48
- type: "container" | "icon";
49
+ type: "container" | "icon" | "button";
49
50
  }
50
51
  export interface VelcronBackgroundEditorSettings {
51
52
  type: "image" | "video";
@@ -71,8 +71,10 @@ export interface VelcronImageState {
71
71
  }
72
72
  export declare const VelcronImagesStateBinding: {
73
73
  main: {
74
+ mediapickerImage: string;
74
75
  editor: string;
75
76
  url: string;
77
+ value: string;
76
78
  ratio: string;
77
79
  caption: string;
78
80
  width: string;
@@ -81,6 +83,7 @@ export declare const VelcronImagesStateBinding: {
81
83
  alt1: {
82
84
  editor: string;
83
85
  url: string;
86
+ value: string;
84
87
  ratio: string;
85
88
  caption: string;
86
89
  width: string;
@@ -89,6 +92,7 @@ export declare const VelcronImagesStateBinding: {
89
92
  alt2: {
90
93
  editor: string;
91
94
  url: string;
95
+ value: string;
92
96
  ratio: string;
93
97
  caption: string;
94
98
  width: string;
@@ -129,8 +133,10 @@ export declare const VelcronStateBinding: {
129
133
  };
130
134
  images: {
131
135
  main: {
136
+ mediapickerImage: string;
132
137
  editor: string;
133
138
  url: string;
139
+ value: string;
134
140
  ratio: string;
135
141
  caption: string;
136
142
  width: string;
@@ -139,6 +145,7 @@ export declare const VelcronStateBinding: {
139
145
  alt1: {
140
146
  editor: string;
141
147
  url: string;
148
+ value: string;
142
149
  ratio: string;
143
150
  caption: string;
144
151
  width: string;
@@ -147,6 +154,7 @@ export declare const VelcronStateBinding: {
147
154
  alt2: {
148
155
  editor: string;
149
156
  url: string;
157
+ value: string;
150
158
  ratio: string;
151
159
  caption: string;
152
160
  width: string;
@@ -4,28 +4,32 @@ exports.VelcronStateBinding = exports.VelcronStateMapping = exports.VelcronImage
4
4
  const models_1 = require("@omnia/velcron/internal-do-not-import-from-here/shared/models");
5
5
  exports.VelcronImagesStateBinding = {
6
6
  main: {
7
- editor: "{{images.main.url}}",
8
- url: "{{images.main.url}}",
9
- ratio: "{{images.main.ratio}}",
10
- caption: "{{images.main.caption}}",
11
- width: "{{images.main.width}}",
12
- height: "{{images.main.height}}",
7
+ mediapickerImage: (0, models_1.velcronBind)("images.main"),
8
+ editor: (0, models_1.velcronBind)("images.main.url"),
9
+ url: (0, models_1.velcronBind)("images.main.url"),
10
+ value: (0, models_1.velcronBind)("images.main.url"),
11
+ ratio: (0, models_1.velcronBind)("images.main.ratio"),
12
+ caption: (0, models_1.velcronBind)("images.main.caption"),
13
+ width: (0, models_1.velcronBind)("images.main.width"),
14
+ height: (0, models_1.velcronBind)("images.main.height"),
13
15
  },
14
16
  alt1: {
15
- editor: "{{images.alt1.url}}",
16
- url: "{{images.alt1.url}}",
17
- ratio: "{{images.alt1.ratio}}",
18
- caption: "{{images.alt1.caption}}",
19
- width: "{{images.alt1.width}}",
20
- height: "{{images.alt1.height}}",
17
+ editor: (0, models_1.velcronBind)("images.alt1.url"),
18
+ url: (0, models_1.velcronBind)("images.alt1.url"),
19
+ value: (0, models_1.velcronBind)("images.alt1.url"),
20
+ ratio: (0, models_1.velcronBind)("images.alt1.ratio"),
21
+ caption: (0, models_1.velcronBind)("images.alt1.caption"),
22
+ width: (0, models_1.velcronBind)("images.alt1.width"),
23
+ height: (0, models_1.velcronBind)("images.alt1.height"),
21
24
  },
22
25
  alt2: {
23
- editor: "{{images.alt2.url}}",
24
- url: "{{images.alt2.url}}",
25
- ratio: "{{images.alt2.ratio}}",
26
- caption: "{{images.alt2.caption}}",
27
- width: "{{images.alt2.width}}",
28
- height: "{{images.alt2.height}}",
26
+ editor: (0, models_1.velcronBind)("images.alt2.url"),
27
+ url: (0, models_1.velcronBind)("images.alt2.url"),
28
+ value: (0, models_1.velcronBind)("images.alt2.url"),
29
+ ratio: (0, models_1.velcronBind)("images.alt2.ratio"),
30
+ caption: (0, models_1.velcronBind)("images.alt2.caption"),
31
+ width: (0, models_1.velcronBind)("images.alt2.width"),
32
+ height: (0, models_1.velcronBind)("images.alt2.height"),
29
33
  },
30
34
  };
31
35
  const VelcronContentStateBinding = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/velcron",
3
3
  "license": "MIT",
4
- "version": "8.0.276-dev",
4
+ "version": "8.0.278-dev",
5
5
  "description": "Provide Omnia Velcron Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -44,6 +44,7 @@ export declare const VelcronConstants: {
44
44
  context: {
45
45
  thisToken: string;
46
46
  editModeToken: string;
47
+ displayToken: string;
47
48
  activeToken: string;
48
49
  };
49
50
  async: {
@@ -47,6 +47,7 @@ exports.VelcronConstants = {
47
47
  context: {
48
48
  thisToken: "$this",
49
49
  editModeToken: "$editmode",
50
+ displayToken: "$display",
50
51
  activeToken: "$active"
51
52
  },
52
53
  async: {
@@ -19,6 +19,9 @@ class VelcronData {
19
19
  if (bindTo === VelcronConstants_1.VelcronConstants.context.editModeToken) {
20
20
  return renderContext.$editmode;
21
21
  }
22
+ else if (bindTo === VelcronConstants_1.VelcronConstants.context.displayToken) {
23
+ return renderContext.$display;
24
+ }
22
25
  else if (bindTo === VelcronConstants_1.VelcronConstants.context.activeToken) {
23
26
  return renderContext.$active;
24
27
  }
@@ -110,6 +113,9 @@ class VelcronData {
110
113
  if (template.indexOf(VelcronConstants_1.VelcronConstants.context.editModeToken) > -1) {
111
114
  propertiesToEval[VelcronConstants_1.VelcronConstants.context.editModeToken] = "renderContext";
112
115
  }
116
+ if (template.indexOf(VelcronConstants_1.VelcronConstants.context.displayToken) > -1) {
117
+ propertiesToEval[VelcronConstants_1.VelcronConstants.context.displayToken] = "renderContext" + "." + VelcronConstants_1.VelcronConstants.context.displayToken;
118
+ }
113
119
  if (template.indexOf(VelcronConstants_1.VelcronConstants.context.activeToken) > -1) {
114
120
  propertiesToEval[VelcronConstants_1.VelcronConstants.context.activeToken] = "renderContext";
115
121
  }
@@ -90,6 +90,7 @@ class VelcronRenderers {
90
90
  computed: currentRenderCtx.computed,
91
91
  colors: currentRenderCtx.colors,
92
92
  $editmode: currentRenderCtx.$editmode,
93
+ $display: currentRenderCtx.$display,
93
94
  $active: currentRenderCtx.$active,
94
95
  //blueprints: currentRenderCtx.blueprints,
95
96
  disposers: currentRenderCtx.disposers,
@@ -0,0 +1,6 @@
1
+ import { VelcronDisplay } from "../models";
2
+ export declare class DisplayProvider {
3
+ static display: VelcronDisplay;
4
+ static hasProvider: boolean;
5
+ static registerProvider(reactiveDisplay: VelcronDisplay): void;
6
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DisplayProvider = void 0;
4
+ class DisplayProvider {
5
+ static { this.hasProvider = false; }
6
+ static registerProvider(reactiveDisplay) {
7
+ DisplayProvider.display = reactiveDisplay;
8
+ DisplayProvider.hasProvider = true;
9
+ }
10
+ }
11
+ exports.DisplayProvider = DisplayProvider;
@@ -1,5 +1,5 @@
1
- export declare class ReactivitySystem {
2
- static makeReactive: (obj: any) => any;
1
+ export declare class ReactivityProvider {
2
+ static makeReactive: <T = {}>(obj: T) => T;
3
3
  static hasReactivityProvider: boolean;
4
4
  static registerProvider(fn: (obj: any) => any): void;
5
5
  }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReactivityProvider = void 0;
4
+ class ReactivityProvider {
5
+ static { this.makeReactive = null; }
6
+ static { this.hasReactivityProvider = false; }
7
+ static registerProvider(fn) {
8
+ ReactivityProvider.makeReactive = fn;
9
+ ReactivityProvider.hasReactivityProvider = true;
10
+ }
11
+ }
12
+ exports.ReactivityProvider = ReactivityProvider;
@@ -0,0 +1,2 @@
1
+ export * from "./ReactivityProvider";
2
+ export * from "./DisplayProvider";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./ReactivityProvider"), exports);
5
+ tslib_1.__exportStar(require("./DisplayProvider"), exports);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defineVelcronStore = defineVelcronStore;
4
- const _1 = require(".");
4
+ const providers_1 = require("../providers");
5
5
  const stateMap = new Map();
6
6
  function defineVelcronStore(name, definition) {
7
7
  function result(newStateWithName) {
@@ -13,7 +13,7 @@ function defineVelcronStore(name, definition) {
13
13
  //we needed it in useVelcronColorSchemaStore. If we need privateState to be reactive and support non reactive stuff
14
14
  // we need to rewrite defineVelcronStore to the new defineStore pattern that supports setup in a better way
15
15
  const setup = definition.setup();
16
- const reactive = _1.ReactivitySystem.makeReactive(setup.state);
16
+ const reactive = providers_1.ReactivityProvider.makeReactive(setup.state);
17
17
  setup.state = reactive;
18
18
  stateMap.set(name, setup);
19
19
  }
package/stores/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from "./VelcronStore";
2
2
  export * from "./VelcronTheming";
3
- export * from "./ReactivitySystem";
4
3
  export * from "./VelcronColorSchema";
package/stores/index.js CHANGED
@@ -3,6 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./VelcronStore"), exports);
5
5
  tslib_1.__exportStar(require("./VelcronTheming"), exports);
6
- tslib_1.__exportStar(require("./ReactivitySystem"), exports);
7
6
  tslib_1.__exportStar(require("./VelcronColorSchema"), exports);
8
7
  //export * from "./VelcronBlueprint";
@@ -3,7 +3,7 @@ export declare class VelcronEditorBuilder {
3
3
  private editors;
4
4
  private formatStateMapping;
5
5
  add(): {
6
- blueprintEditor: (name: string, stateMapping: string, type: "container") => VelcronEditorBuilder;
6
+ blueprintEditor: (name: string, stateMapping: string, type: "container" | "icon" | "button") => VelcronEditorBuilder;
7
7
  spacingEditor: (name: string, stateMapping: string, individualSelection?: boolean) => VelcronEditorBuilder;
8
8
  imageEditor: (name: string, stateMapping: string) => VelcronEditorBuilder;
9
9
  colorSchemaEditor: (name: string, stateMapping: string) => VelcronEditorBuilder;
@@ -146,21 +146,7 @@ class VelcronEditorBuilder {
146
146
  };
147
147
  }
148
148
  build() {
149
- // const result = [] as Array<VelcronPropertyEditor>;
150
- // if(this.colorSchemaEditorBuilder){
151
- // result.push(...this.colorSchemaEditorBuilder.internalBuild());
152
- // }
153
- // if(this.contentEditorBuilder){
154
- // result.push(...this.contentEditorBuilder.internalBuild());
155
- // }
156
- // if(this.imageEditorBuilder){
157
- // result.push(...this.imageEditorBuilder.internalBuild());
158
- // }
159
- // if(this.propertyMappingBuilder){
160
- // result.push(...this.propertyMappingBuilder.internalBuild());
161
- // }
162
149
  return this.editors;
163
- // return result;
164
150
  }
165
151
  }
166
152
  exports.VelcronEditorBuilder = VelcronEditorBuilder;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReactivitySystem = void 0;
4
- class ReactivitySystem {
5
- static { this.makeReactive = null; }
6
- static { this.hasReactivityProvider = false; }
7
- static registerProvider(fn) {
8
- ReactivitySystem.makeReactive = fn;
9
- ReactivitySystem.hasReactivityProvider = true;
10
- }
11
- }
12
- exports.ReactivitySystem = ReactivitySystem;