@amodx/schemas 0.0.2 → 0.0.21

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.
@@ -2,7 +2,18 @@ declare const StringInput: import("./registerInput").RegisteredInput<string, imp
2
2
  min: number;
3
3
  max: number;
4
4
  }>;
5
- declare const ColorInput: import("./registerInput").RegisteredInput<string, import("./PropertyInput").PropertyInputBaseProperties>;
5
+ declare const HEXColorInput: import("./registerInput").RegisteredInput<string, import("./PropertyInput").PropertyInputBaseProperties>;
6
+ declare const Color3Input: import("./registerInput").RegisteredInput<{
7
+ r: number;
8
+ g: number;
9
+ b: number;
10
+ }, import("./PropertyInput").PropertyInputBaseProperties>;
11
+ declare const Color4Input: import("./registerInput").RegisteredInput<{
12
+ r: number;
13
+ g: number;
14
+ b: number;
15
+ a: number;
16
+ }, import("./PropertyInput").PropertyInputBaseProperties>;
6
17
  declare const RangeInput: import("./registerInput").RegisteredInput<number, import("./PropertyInput").PropertyInputBaseProperties & {
7
18
  min: number;
8
19
  max: number;
@@ -34,4 +45,4 @@ declare const SelectInput: import("./registerInput").RegisteredInput<string | nu
34
45
  mode?: string;
35
46
  }>;
36
47
  declare const BooleanInput: import("./registerInput").RegisteredInput<boolean, import("./PropertyInput").PropertyInputBaseProperties>;
37
- export { ColorInput as ColorPropertyInput, RangeInput as RangePropertyInput, FloatInput as FloatPropertyInput, Vec2Input as Vec2PropertyInput, Vec3Input as Vec3PropertyInput, IntInput as IntPropertyInput, StringInput as StringPropertyInput, SelectInput as SelectPropertyInput, BooleanInput as BooleanPropertyInput, };
48
+ export { 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, };
@@ -13,9 +13,9 @@ const StringInput = registerInput({
13
13
  };
14
14
  },
15
15
  });
16
- const ColorInput = registerInput({
17
- id: "color",
18
- name: "Color",
16
+ const HEXColorInput = registerInput({
17
+ id: "hex-color",
18
+ name: "Hex Color",
19
19
  compare(value1, value2) {
20
20
  return value1 === value2;
21
21
  },
@@ -25,6 +25,33 @@ const ColorInput = registerInput({
25
25
  };
26
26
  },
27
27
  });
28
+ const Color3Input = registerInput({
29
+ id: "color3",
30
+ name: "Color3",
31
+ compare(value1, value2) {
32
+ return (value1.r === value2.r && value1.g === value2.g && value1.b == value2.b);
33
+ },
34
+ createProperties(properties) {
35
+ return {
36
+ ...properties,
37
+ };
38
+ },
39
+ });
40
+ const Color4Input = registerInput({
41
+ id: "color4",
42
+ name: "Color4",
43
+ compare(value1, value2) {
44
+ return (value1.r === value2.r &&
45
+ value1.g === value2.g &&
46
+ value1.b == value2.b &&
47
+ value1.a == value2.a);
48
+ },
49
+ createProperties(properties) {
50
+ return {
51
+ ...properties,
52
+ };
53
+ },
54
+ });
28
55
  const RangeInput = registerInput({
29
56
  id: "range",
30
57
  name: "Range",
@@ -119,4 +146,4 @@ const BooleanInput = registerInput({
119
146
  };
120
147
  },
121
148
  });
122
- export { ColorInput as ColorPropertyInput, RangeInput as RangePropertyInput, FloatInput as FloatPropertyInput, Vec2Input as Vec2PropertyInput, Vec3Input as Vec3PropertyInput, IntInput as IntPropertyInput, StringInput as StringPropertyInput, SelectInput as SelectPropertyInput, BooleanInput as BooleanPropertyInput, };
149
+ export { 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/Properties.d.ts CHANGED
@@ -27,7 +27,27 @@ export declare const RangeProp: PropertyFC<number, import("./Inputs").PropertyIn
27
27
  max: number;
28
28
  step: number;
29
29
  }>>;
30
- export declare const ColorProp: PropertyFC<string, import("./Inputs").PropertyInputBase<string, import("./Inputs").PropertyInputBaseProperties>>;
30
+ export declare const HexColorProp: PropertyFC<string, import("./Inputs").PropertyInputBase<string, import("./Inputs").PropertyInputBaseProperties>>;
31
+ export declare const Color3Prop: PropertyFC<{
32
+ r: number;
33
+ g: number;
34
+ b: number;
35
+ }, import("./Inputs").PropertyInputBase<{
36
+ r: number;
37
+ g: number;
38
+ b: number;
39
+ }, import("./Inputs").PropertyInputBaseProperties>>;
40
+ export declare const Color4Prop: PropertyFC<{
41
+ r: number;
42
+ g: number;
43
+ b: number;
44
+ a: number;
45
+ }, import("./Inputs").PropertyInputBase<{
46
+ r: number;
47
+ g: number;
48
+ b: number;
49
+ a: number;
50
+ }, import("./Inputs").PropertyInputBaseProperties>>;
31
51
  export declare const SelectProp: PropertyFC<string | number, import("./Inputs").PropertyInputBase<string | number, import("./Inputs").PropertyInputBaseProperties & {
32
52
  options: string[] | [string, string | number][];
33
53
  mode?: string;
package/Properties.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ColorPropertyInput, FloatPropertyInput, IntPropertyInput, RangePropertyInput, SelectPropertyInput, StringPropertyInput, Vec2PropertyInput, Vec3PropertyInput, BooleanPropertyInput, } from "./Inputs/DefaultInputs";
1
+ import { Color3PropertyInput, Color4PropertyInput, HexColorPropertyInput, FloatPropertyInput, IntPropertyInput, RangePropertyInput, SelectPropertyInput, StringPropertyInput, Vec2PropertyInput, Vec3PropertyInput, BooleanPropertyInput, } from "./Inputs/DefaultInputs";
2
2
  import { ObjectPath } from "./Properties/ObjectPath";
3
3
  import { Property } from "./Properties/Property";
4
4
  import { PropertyCondition } from "./Properties/PropertyCondition";
@@ -31,7 +31,18 @@ export const StringProp = StringPropertyInput.createPropertyFC("");
31
31
  export const FloatProp = FloatPropertyInput.createPropertyFC(0);
32
32
  export const IntProp = IntPropertyInput.createPropertyFC(0);
33
33
  export const RangeProp = RangePropertyInput.createPropertyFC(0);
34
- export const ColorProp = ColorPropertyInput.createPropertyFC("#ffffff");
34
+ export const HexColorProp = HexColorPropertyInput.createPropertyFC("#ffffff");
35
+ export const Color3Prop = Color3PropertyInput.createPropertyFC({
36
+ r: 255,
37
+ g: 255,
38
+ b: 255,
39
+ });
40
+ export const Color4Prop = Color4PropertyInput.createPropertyFC({
41
+ r: 255,
42
+ g: 255,
43
+ b: 255,
44
+ a: 255,
45
+ });
35
46
  export const SelectProp = SelectPropertyInput.createPropertyFC("");
36
47
  export const Vec2Prop = Vec2PropertyInput.createPropertyFC({ x: 0, y: 0 });
37
48
  export const Vec3Prop = Vec3PropertyInput.createPropertyFC({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amodx/schemas",
3
- "version": "0.0.02",
3
+ "version": "0.0.21",
4
4
  "module": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "type": "module",