@amodx/schemas 0.0.2 → 0.0.22
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/Inputs/DefaultInputs.d.ts +14 -2
- package/Inputs/DefaultInputs.js +43 -4
- package/Inputs/registerInput.d.ts +1 -1
- package/Properties.d.ts +22 -1
- package/Properties.js +14 -2
- package/package.json +1 -1
- package/Schema/Node.d.ts +0 -0
- package/Schema/Node.js +0 -1
- package/Schema/Object.d.ts +0 -0
- package/Schema/Object.js +0 -1
- package/Schema/Property.d.ts +0 -0
- package/Schema/Property.js +0 -1
- package/Schema/Schema.d.ts +0 -2
- package/Schema/Schema.js +0 -2
|
@@ -2,7 +2,19 @@ declare const StringInput: import("./registerInput").RegisteredInput<string, imp
|
|
|
2
2
|
min: number;
|
|
3
3
|
max: number;
|
|
4
4
|
}>;
|
|
5
|
-
declare const
|
|
5
|
+
declare const ButtonInput: import("./registerInput").RegisteredInput<Function, import("./PropertyInput").PropertyInputBaseProperties>;
|
|
6
|
+
declare const HEXColorInput: import("./registerInput").RegisteredInput<string, import("./PropertyInput").PropertyInputBaseProperties>;
|
|
7
|
+
declare const Color3Input: import("./registerInput").RegisteredInput<{
|
|
8
|
+
r: number;
|
|
9
|
+
g: number;
|
|
10
|
+
b: number;
|
|
11
|
+
}, import("./PropertyInput").PropertyInputBaseProperties>;
|
|
12
|
+
declare const Color4Input: import("./registerInput").RegisteredInput<{
|
|
13
|
+
r: number;
|
|
14
|
+
g: number;
|
|
15
|
+
b: number;
|
|
16
|
+
a: number;
|
|
17
|
+
}, import("./PropertyInput").PropertyInputBaseProperties>;
|
|
6
18
|
declare const RangeInput: import("./registerInput").RegisteredInput<number, import("./PropertyInput").PropertyInputBaseProperties & {
|
|
7
19
|
min: number;
|
|
8
20
|
max: number;
|
|
@@ -34,4 +46,4 @@ declare const SelectInput: import("./registerInput").RegisteredInput<string | nu
|
|
|
34
46
|
mode?: string;
|
|
35
47
|
}>;
|
|
36
48
|
declare const BooleanInput: import("./registerInput").RegisteredInput<boolean, import("./PropertyInput").PropertyInputBaseProperties>;
|
|
37
|
-
export {
|
|
49
|
+
export { ButtonInput as ButtonPropertyInput, HEXColorInput as HexColorPropertyInput, Color3Input as Color3PropertyInput, Color4Input as Color4PropertyInput, RangeInput as RangePropertyInput, FloatInput as FloatPropertyInput, Vec2Input as Vec2PropertyInput, Vec3Input as Vec3PropertyInput, IntInput as IntPropertyInput, StringInput as StringPropertyInput, SelectInput as SelectPropertyInput, BooleanInput as BooleanPropertyInput, };
|
package/Inputs/DefaultInputs.js
CHANGED
|
@@ -13,9 +13,21 @@ const StringInput = registerInput({
|
|
|
13
13
|
};
|
|
14
14
|
},
|
|
15
15
|
});
|
|
16
|
-
const
|
|
17
|
-
id: "
|
|
18
|
-
name: "
|
|
16
|
+
const ButtonInput = registerInput({
|
|
17
|
+
id: "button",
|
|
18
|
+
name: "Button",
|
|
19
|
+
compare(value1, value2) {
|
|
20
|
+
return value1 == value2;
|
|
21
|
+
},
|
|
22
|
+
createProperties(properties) {
|
|
23
|
+
return {
|
|
24
|
+
...properties,
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const HEXColorInput = registerInput({
|
|
29
|
+
id: "hex-color",
|
|
30
|
+
name: "Hex Color",
|
|
19
31
|
compare(value1, value2) {
|
|
20
32
|
return value1 === value2;
|
|
21
33
|
},
|
|
@@ -25,6 +37,33 @@ const ColorInput = registerInput({
|
|
|
25
37
|
};
|
|
26
38
|
},
|
|
27
39
|
});
|
|
40
|
+
const Color3Input = registerInput({
|
|
41
|
+
id: "color3",
|
|
42
|
+
name: "Color3",
|
|
43
|
+
compare(value1, value2) {
|
|
44
|
+
return (value1.r === value2.r && value1.g === value2.g && value1.b == value2.b);
|
|
45
|
+
},
|
|
46
|
+
createProperties(properties) {
|
|
47
|
+
return {
|
|
48
|
+
...properties,
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
const Color4Input = registerInput({
|
|
53
|
+
id: "color4",
|
|
54
|
+
name: "Color4",
|
|
55
|
+
compare(value1, value2) {
|
|
56
|
+
return (value1.r === value2.r &&
|
|
57
|
+
value1.g === value2.g &&
|
|
58
|
+
value1.b == value2.b &&
|
|
59
|
+
value1.a == value2.a);
|
|
60
|
+
},
|
|
61
|
+
createProperties(properties) {
|
|
62
|
+
return {
|
|
63
|
+
...properties,
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
});
|
|
28
67
|
const RangeInput = registerInput({
|
|
29
68
|
id: "range",
|
|
30
69
|
name: "Range",
|
|
@@ -119,4 +158,4 @@ const BooleanInput = registerInput({
|
|
|
119
158
|
};
|
|
120
159
|
},
|
|
121
160
|
});
|
|
122
|
-
export {
|
|
161
|
+
export { ButtonInput as ButtonPropertyInput, HEXColorInput as HexColorPropertyInput, Color3Input as Color3PropertyInput, Color4Input as Color4PropertyInput, RangeInput as RangePropertyInput, FloatInput as FloatPropertyInput, Vec2Input as Vec2PropertyInput, Vec3Input as Vec3PropertyInput, IntInput as IntPropertyInput, StringInput as StringPropertyInput, SelectInput as SelectPropertyInput, BooleanInput as BooleanPropertyInput, };
|
|
@@ -11,7 +11,7 @@ export type RegisteredInput<Value extends any = any, Properties extends Property
|
|
|
11
11
|
properties: Properties;
|
|
12
12
|
value: Value;
|
|
13
13
|
createPropertyFC(defaultValue: Value): PropertyFC<Value, PropertyInputBase<Value, Properties>>;
|
|
14
|
-
createPropertyRenderFC<RenderedData extends any = any, Props extends
|
|
14
|
+
createPropertyRenderFC<RenderedData extends any = any, Props extends {} = {}>(fc: (props: {
|
|
15
15
|
node: SchemaNode<Value, PropertyInputBase<Value, Properties>>;
|
|
16
16
|
} & Props) => RenderedData): PropertyRenderFC<RenderedData, Value, PropertyInputBase<Value, Properties>, Props>;
|
|
17
17
|
};
|
package/Properties.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare const StringProp: PropertyFC<string, import("./Inputs").PropertyI
|
|
|
14
14
|
min: number;
|
|
15
15
|
max: number;
|
|
16
16
|
}>>;
|
|
17
|
+
export declare const ButtonProp: PropertyFC<Function, import("./Inputs").PropertyInputBase<Function, import("./Inputs").PropertyInputBaseProperties>>;
|
|
17
18
|
export declare const FloatProp: PropertyFC<number, import("./Inputs").PropertyInputBase<number, import("./Inputs").PropertyInputBaseProperties & {
|
|
18
19
|
min: number;
|
|
19
20
|
max: number;
|
|
@@ -27,7 +28,27 @@ export declare const RangeProp: PropertyFC<number, import("./Inputs").PropertyIn
|
|
|
27
28
|
max: number;
|
|
28
29
|
step: number;
|
|
29
30
|
}>>;
|
|
30
|
-
export declare const
|
|
31
|
+
export declare const HexColorProp: PropertyFC<string, import("./Inputs").PropertyInputBase<string, import("./Inputs").PropertyInputBaseProperties>>;
|
|
32
|
+
export declare const Color3Prop: PropertyFC<{
|
|
33
|
+
r: number;
|
|
34
|
+
g: number;
|
|
35
|
+
b: number;
|
|
36
|
+
}, import("./Inputs").PropertyInputBase<{
|
|
37
|
+
r: number;
|
|
38
|
+
g: number;
|
|
39
|
+
b: number;
|
|
40
|
+
}, import("./Inputs").PropertyInputBaseProperties>>;
|
|
41
|
+
export declare const Color4Prop: PropertyFC<{
|
|
42
|
+
r: number;
|
|
43
|
+
g: number;
|
|
44
|
+
b: number;
|
|
45
|
+
a: number;
|
|
46
|
+
}, import("./Inputs").PropertyInputBase<{
|
|
47
|
+
r: number;
|
|
48
|
+
g: number;
|
|
49
|
+
b: number;
|
|
50
|
+
a: number;
|
|
51
|
+
}, import("./Inputs").PropertyInputBaseProperties>>;
|
|
31
52
|
export declare const SelectProp: PropertyFC<string | number, import("./Inputs").PropertyInputBase<string | number, import("./Inputs").PropertyInputBaseProperties & {
|
|
32
53
|
options: string[] | [string, string | number][];
|
|
33
54
|
mode?: string;
|
package/Properties.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Color3PropertyInput, Color4PropertyInput, HexColorPropertyInput, FloatPropertyInput, IntPropertyInput, RangePropertyInput, SelectPropertyInput, StringPropertyInput, Vec2PropertyInput, Vec3PropertyInput, BooleanPropertyInput, ButtonPropertyInput, } from "./Inputs/DefaultInputs";
|
|
2
2
|
import { ObjectPath } from "./Properties/ObjectPath";
|
|
3
3
|
import { Property } from "./Properties/Property";
|
|
4
4
|
import { PropertyCondition } from "./Properties/PropertyCondition";
|
|
@@ -28,10 +28,22 @@ export const AnyProp = (id, data = {}) => {
|
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
export const StringProp = StringPropertyInput.createPropertyFC("");
|
|
31
|
+
export const ButtonProp = ButtonPropertyInput.createPropertyFC(() => { });
|
|
31
32
|
export const FloatProp = FloatPropertyInput.createPropertyFC(0);
|
|
32
33
|
export const IntProp = IntPropertyInput.createPropertyFC(0);
|
|
33
34
|
export const RangeProp = RangePropertyInput.createPropertyFC(0);
|
|
34
|
-
export const
|
|
35
|
+
export const HexColorProp = HexColorPropertyInput.createPropertyFC("#ffffff");
|
|
36
|
+
export const Color3Prop = Color3PropertyInput.createPropertyFC({
|
|
37
|
+
r: 255,
|
|
38
|
+
g: 255,
|
|
39
|
+
b: 255,
|
|
40
|
+
});
|
|
41
|
+
export const Color4Prop = Color4PropertyInput.createPropertyFC({
|
|
42
|
+
r: 255,
|
|
43
|
+
g: 255,
|
|
44
|
+
b: 255,
|
|
45
|
+
a: 255,
|
|
46
|
+
});
|
|
35
47
|
export const SelectProp = SelectPropertyInput.createPropertyFC("");
|
|
36
48
|
export const Vec2Prop = Vec2PropertyInput.createPropertyFC({ x: 0, y: 0 });
|
|
37
49
|
export const Vec3Prop = Vec3PropertyInput.createPropertyFC({
|
package/package.json
CHANGED
package/Schema/Node.d.ts
DELETED
|
File without changes
|
package/Schema/Node.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/Schema/Object.d.ts
DELETED
|
File without changes
|
package/Schema/Object.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/Schema/Property.d.ts
DELETED
|
File without changes
|
package/Schema/Property.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/Schema/Schema.d.ts
DELETED
package/Schema/Schema.js
DELETED