@omnia/velcron 8.0.277-dev → 8.0.279-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 +2 -2
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/internal-do-not-import-from-here/shared/models/velcron/VelcronDefinition.d.ts +1 -1
- package/models/VelcronDefinitions.d.ts +9 -7
- package/package.json +1 -1
- package/parser/VelcronConstants.d.ts +1 -0
- package/parser/VelcronConstants.js +1 -0
- package/parser/VelcronData.js +6 -0
- package/parser/VelcronRenderers.js +1 -0
- package/providers/DisplayProvider.d.ts +6 -0
- package/providers/DisplayProvider.js +11 -0
- package/{stores/ReactivitySystem.d.ts → providers/ReactivityProvider.d.ts} +2 -2
- package/providers/ReactivityProvider.js +12 -0
- package/providers/index.d.ts +2 -0
- package/providers/index.js +5 -0
- package/stores/VelcronStore.js +2 -2
- package/stores/index.d.ts +0 -1
- package/stores/index.js +0 -1
- package/stores/ReactivitySystem.js +0 -12
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
|
|
4
|
+
const providers_1 = require("../providers");
|
|
5
5
|
exports.objClone = {
|
|
6
6
|
name: "@clone",
|
|
7
7
|
action: (action, objToClone) => {
|
|
8
|
-
action.promise.resolve(
|
|
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
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" | "
|
|
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;
|
|
@@ -4,7 +4,6 @@ import { AssignOperators, VelcronHorizontalAlignments, VelcronIconTypes, Velcron
|
|
|
4
4
|
import { DynamicState, VelcronDefinition, VelcronEffects, useVelcronThemingStore } from "..";
|
|
5
5
|
import { guid, PropertyConfiguration, PropertyValue, PropertyDefinition, PropertySetupBase } from "@omnia/fx/models";
|
|
6
6
|
import { useVelcronColorSchemaStore } from "../stores/VelcronColorSchema";
|
|
7
|
-
import { IDataSourcePropertySelection } from "internal/fx/ux/properties/models/PropertyPicker";
|
|
8
7
|
export interface ResolvedComponentRenderer {
|
|
9
8
|
component: unknown;
|
|
10
9
|
definition: VelcronDefinition;
|
|
@@ -46,6 +45,14 @@ export interface OnItemRenderedHookResult {
|
|
|
46
45
|
cssClass: string;
|
|
47
46
|
containerRenderer?: VelcronContainerRenderer;
|
|
48
47
|
}
|
|
48
|
+
export interface VelcronDisplay {
|
|
49
|
+
size: VelcronDisplaySizes;
|
|
50
|
+
}
|
|
51
|
+
export interface VelcronDisplaySizes {
|
|
52
|
+
sm: boolean;
|
|
53
|
+
md: boolean;
|
|
54
|
+
lg: boolean;
|
|
55
|
+
}
|
|
49
56
|
export interface VelcronRenderContext {
|
|
50
57
|
id?: string;
|
|
51
58
|
rootContext: DynamicState;
|
|
@@ -71,6 +78,7 @@ export interface VelcronRenderContext {
|
|
|
71
78
|
baseDefinition?: VelcronAppDefinition;
|
|
72
79
|
subApp?: boolean;
|
|
73
80
|
subAppreferenceId?: guid;
|
|
81
|
+
$display: VelcronDisplay;
|
|
74
82
|
}
|
|
75
83
|
export interface VelcronRenderContextEventHandlers {
|
|
76
84
|
receiving?: {
|
|
@@ -372,12 +380,6 @@ export interface VelcronPropertyDefinitionValue {
|
|
|
372
380
|
value: PropertyValue;
|
|
373
381
|
configuration: PropertyConfiguration<PropertyDefinition<any, any, any, PropertySetupBase>>;
|
|
374
382
|
}
|
|
375
|
-
export interface VelcronPropertyDefinitionValueResolver {
|
|
376
|
-
source?: IDataSourcePropertySelection;
|
|
377
|
-
}
|
|
378
|
-
export interface VelcronPropertyEditorValue {
|
|
379
|
-
[key: string]: VelcronPropertyDefinitionValueResolver;
|
|
380
|
-
}
|
|
381
383
|
export type VelcronRenderProps<TDefinition> = {
|
|
382
384
|
definition: TDefinition;
|
|
383
385
|
renderContext: VelcronRenderContext;
|
package/package.json
CHANGED
package/parser/VelcronData.js
CHANGED
|
@@ -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,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
|
|
2
|
-
static makeReactive: (obj:
|
|
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;
|
package/stores/VelcronStore.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defineVelcronStore = defineVelcronStore;
|
|
4
|
-
const
|
|
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 =
|
|
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
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";
|
|
@@ -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;
|