definition-generator-framework 1.9.13 → 1.9.14
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/dist/helpers/validator/custom-validators/helpers/sprite-validation.helper.d.ts +13 -0
- package/dist/helpers/validator/custom-validators/helpers/sprite-validation.helper.js +53 -0
- package/dist/helpers/validator/custom-validators/helpers/sprite-validation.helper.js.map +1 -0
- package/dist/helpers/validator/custom-validators/helpers/sprite-validation.helper.test.d.ts +1 -0
- package/dist/helpers/validator/custom-validators/helpers/sprite-validation.helper.test.js +96 -0
- package/dist/helpers/validator/custom-validators/helpers/sprite-validation.helper.test.js.map +1 -0
- package/dist/helpers/validator/custom-validators/path.custom-validator.d.ts +2 -2
- package/dist/helpers/validator/custom-validators/position-on-sprite.d.ts +14 -0
- package/dist/helpers/validator/custom-validators/position-on-sprite.js +44 -0
- package/dist/helpers/validator/custom-validators/position-on-sprite.js.map +1 -0
- package/dist/helpers/validator/custom-validators/reference.custom-validator.d.ts +2 -2
- package/dist/helpers/validator/custom-validators/sprite.custom-validator.d.ts +2 -2
- package/dist/helpers/validator/joi-custom-validators.d.ts +9 -2
- package/dist/helpers/validator/joi-custom-validators.js +11 -5
- package/dist/helpers/validator/joi-custom-validators.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +23 -1
- package/dist/index.js.map +1 -1
- package/dist/pre-made-components/_validators/shape-validators.d.ts +7 -0
- package/dist/pre-made-components/_validators/shape-validators.js +37 -0
- package/dist/pre-made-components/_validators/shape-validators.js.map +1 -0
- package/dist/pre-made-components/_validators/sprite-validators.d.ts +4 -0
- package/dist/pre-made-components/_validators/sprite-validators.js +39 -0
- package/dist/pre-made-components/_validators/sprite-validators.js.map +1 -0
- package/dist/pre-made-components/assets/1-sprite.d.ts +14 -0
- package/dist/pre-made-components/assets/1-sprite.js +74 -0
- package/dist/pre-made-components/assets/1-sprite.js.map +1 -0
- package/dist/pre-made-components/assets/2-sprite-group.d.ts +10 -0
- package/dist/pre-made-components/assets/2-sprite-group.js +41 -0
- package/dist/pre-made-components/assets/2-sprite-group.js.map +1 -0
- package/dist/pre-made-components/assets/3-font.d.ts +15 -0
- package/dist/pre-made-components/assets/3-font.js +58 -0
- package/dist/pre-made-components/assets/3-font.js.map +1 -0
- package/dist/pre-made-components/events/1-event.js +1 -1
- package/dist/pre-made-components/events/1-event.js.map +1 -1
- package/package.json +2 -1
- package/package.json.bak +2 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Vec2 } from 'helpers-lib';
|
|
2
|
+
export declare class SpriteValidationHelper {
|
|
3
|
+
private anchorLocation;
|
|
4
|
+
private scale;
|
|
5
|
+
private boundingBox;
|
|
6
|
+
private checkIfPositionIsOnSprite;
|
|
7
|
+
constructor(spriteSize: Vec2, anchor: Vec2, scale: number, checkIfPositionIsOnSprite?: boolean);
|
|
8
|
+
convertPositionToSpriteAnchor(position: Vec2): Vec2;
|
|
9
|
+
getRotationFromAnchor(positionFromAnchor: Vec2): number;
|
|
10
|
+
private validateLocationOnSprite;
|
|
11
|
+
private getAnchorLocation;
|
|
12
|
+
private getBoundingBox;
|
|
13
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpriteValidationHelper = void 0;
|
|
4
|
+
const helpers_lib_1 = require("helpers-lib");
|
|
5
|
+
class SpriteValidationHelper {
|
|
6
|
+
constructor(spriteSize, anchor, scale, checkIfPositionIsOnSprite) {
|
|
7
|
+
spriteSize = { x: spriteSize.x * scale, y: spriteSize.y * scale };
|
|
8
|
+
this.scale = scale;
|
|
9
|
+
this.checkIfPositionIsOnSprite = checkIfPositionIsOnSprite || false;
|
|
10
|
+
this.anchorLocation = this.getAnchorLocation(spriteSize, anchor);
|
|
11
|
+
this.boundingBox = this.getBoundingBox(spriteSize, this.anchorLocation);
|
|
12
|
+
}
|
|
13
|
+
convertPositionToSpriteAnchor(position) {
|
|
14
|
+
position = { x: position.x * this.scale, y: position.y * this.scale };
|
|
15
|
+
let positionToSpriteAnchor = {
|
|
16
|
+
x: position.x + this.boundingBox.topLeft.x,
|
|
17
|
+
y: position.y + this.boundingBox.topLeft.y
|
|
18
|
+
};
|
|
19
|
+
if (this.checkIfPositionIsOnSprite) {
|
|
20
|
+
let valid = this.validateLocationOnSprite(positionToSpriteAnchor);
|
|
21
|
+
if (!valid) {
|
|
22
|
+
throw new Error(`location is outside of the sprite boundaries. Entered position: {x: ${position.x}, y: ${position.y}}, position on sprite: {x: ${positionToSpriteAnchor.x}, y: ${positionToSpriteAnchor.y}}, bounding box: ${JSON.stringify(this.boundingBox)}.`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return positionToSpriteAnchor;
|
|
26
|
+
}
|
|
27
|
+
getRotationFromAnchor(positionFromAnchor) {
|
|
28
|
+
return helpers_lib_1.Vector.fromVec2(positionFromAnchor).radian.value;
|
|
29
|
+
}
|
|
30
|
+
validateLocationOnSprite(location) {
|
|
31
|
+
if (location.x < this.boundingBox.topLeft.x ||
|
|
32
|
+
location.x > this.boundingBox.bottomRight.x ||
|
|
33
|
+
location.y < this.boundingBox.topLeft.y ||
|
|
34
|
+
location.y > this.boundingBox.bottomRight.y) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
getAnchorLocation(spriteSize, anchor) {
|
|
42
|
+
return { x: spriteSize.x * anchor.x, y: spriteSize.y * anchor.y };
|
|
43
|
+
}
|
|
44
|
+
getBoundingBox(spriteSize, anchorLocation) {
|
|
45
|
+
let boundingBox = {
|
|
46
|
+
topLeft: { x: -anchorLocation.x, y: -anchorLocation.y },
|
|
47
|
+
bottomRight: { x: spriteSize.x - anchorLocation.x, y: spriteSize.y - anchorLocation.y }
|
|
48
|
+
};
|
|
49
|
+
return boundingBox;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.SpriteValidationHelper = SpriteValidationHelper;
|
|
53
|
+
//# sourceMappingURL=sprite-validation.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sprite-validation.helper.js","sourceRoot":"","sources":["../../../../../src/helpers/validator/custom-validators/helpers/sprite-validation.helper.ts"],"names":[],"mappings":";;;AAAA,6CAAiD;AAEjD,MAAa,sBAAsB;IAMjC,YAAY,UAAgB,EAAE,MAAY,EAAE,KAAa,EAAE,yBAAmC;QAC5F,UAAU,GAAG,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC;QAClE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,yBAAyB,GAAG,yBAAyB,IAAI,KAAK,CAAC;QAEpE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QACjE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAC1E,CAAC;IAED,6BAA6B,CAAC,QAAc;QAC1C,QAAQ,GAAG,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAEtE,IAAI,sBAAsB,GAAG;YAC3B,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YAC1C,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;SAC3C,CAAC;QAEF,IAAI,IAAI,CAAC,yBAAyB,EAAE,CAAC;YACnC,IAAI,KAAK,GAAG,IAAI,C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AC,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE;YACvD,WAAW,EAAE,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,EAAE;SACxF,CAAC;QACF,OAAO,WAAW,CAAC;IACrB,CAAC;CACF;AAnED,wDAmEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const sprite_validation_helper_1 = require("./sprite-validation.helper");
|
|
5
|
+
(0, vitest_1.describe)('Validators', () => {
|
|
6
|
+
(0, vitest_1.describe)('convertPositionToSpriteAnchor', () => {
|
|
7
|
+
(0, vitest_1.test)('should convert the location to the sprite location', () => {
|
|
8
|
+
let location = { x: 50, y: 50 };
|
|
9
|
+
let spriteSize = { x: 100, y: 100 };
|
|
10
|
+
let anchor = { x: 0.8, y: 0.5 };
|
|
11
|
+
let spriteValidationHelper = new sprite_validation_helper_1.SpriteValidationHelper(spriteSize, anchor, 1);
|
|
12
|
+
(0, vitest_1.expect)(spriteValidationHelper.convertPositionToSpriteAnchor(location)).toEqual({ x: -30, y: 0 });
|
|
13
|
+
});
|
|
14
|
+
(0, vitest_1.test)('should convert the location with scale to the sprite location', () => {
|
|
15
|
+
let location = { x: 50, y: 50 };
|
|
16
|
+
let spriteSize = { x: 100, y: 100 };
|
|
17
|
+
let anchor = { x: 0.8, y: 0.5 };
|
|
18
|
+
let spriteValidationHelper = new sprite_validation_helper_1.SpriteValidationHelper(spriteSize, anchor, 0.5);
|
|
19
|
+
(0, vitest_1.expect)(spriteValidationHelper.convertPositionToSpriteAnchor(location)).toEqual({ x: -15, y: 0 });
|
|
20
|
+
});
|
|
21
|
+
(0, vitest_1.test)('should throw an error if location is outside of the sprite boundaries', () => {
|
|
22
|
+
let location = { x: -51, y: 51 };
|
|
23
|
+
let spriteSize = { x: 100, y: 100 };
|
|
24
|
+
let anchor = { x: 0.5, y: 0.5 };
|
|
25
|
+
let spriteValidationHelper = new sprite_validation_helper_1.SpriteValidationHelper(spriteSize, anchor, 1, true);
|
|
26
|
+
(0, vitest_1.expect)(() => spriteValidationHelper.convertPositionToSpriteAnchor(location)).toThrow();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
(0, vitest_1.describe)('getRotationFromAnchor', () => {
|
|
30
|
+
(0, vitest_1.test)('should return the rotation from the anchor sample 1', () => {
|
|
31
|
+
let positionFromAnchor = { x: 25, y: 0 };
|
|
32
|
+
let spriteSize = { x: 100, y: 100 };
|
|
33
|
+
let anchor = { x: 0.5, y: 0.5 };
|
|
34
|
+
let spriteValidationHelper = new sprite_validation_helper_1.SpriteValidationHelper(spriteSize, anchor, 1);
|
|
35
|
+
(0, vitest_1.expect)(spriteValidationHelper.getRotationFromAnchor(positionFromAnchor)).toEqual(Math.PI / 2);
|
|
36
|
+
});
|
|
37
|
+
(0, vitest_1.test)('should return the rotation from the anchor with scale sample 1', () => {
|
|
38
|
+
let positionFromAnchor = { x: 25, y: 0 };
|
|
39
|
+
let spriteSize = { x: 100, y: 100 };
|
|
40
|
+
let anchor = { x: 0.5, y: 0.5 };
|
|
41
|
+
let spriteValidationHelper = new sprite_validation_helper_1.SpriteValidationHelper(spriteSize, anchor, 0.5);
|
|
42
|
+
(0, vitest_1.expect)(spriteValidationHelper.getRotationFromAnchor(positionFromAnchor)).toEqual(Math.PI / 2);
|
|
43
|
+
});
|
|
44
|
+
(0, vitest_1.test)('should return the rotation from the anchor sample 2', () => {
|
|
45
|
+
let positionFromAnchor = { x: 0, y: -25 };
|
|
46
|
+
let spriteSize = { x: 100, y: 100 };
|
|
47
|
+
let anchor = { x: 0.5, y: 0.5 };
|
|
48
|
+
let spriteValidationHelper = new sprite_validation_helper_1.SpriteValidationHelper(spriteSize, anchor, 1);
|
|
49
|
+
(0, vitest_1.expect)(spriteValidationHelper.getRotationFromAnchor(positionFromAnchor)).toEqual(0);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
(0, vitest_1.describe)('validateLocationOnSprite', () => {
|
|
53
|
+
(0, vitest_1.test)('should not throw an error if location on the sprite boundaries', () => {
|
|
54
|
+
let location = { x: -50, y: 50 };
|
|
55
|
+
let spriteSize = { x: 100, y: 100 };
|
|
56
|
+
let anchor = { x: 0.5, y: 0.5 };
|
|
57
|
+
let spriteValidationHelper = new sprite_validation_helper_1.SpriteValidationHelper(spriteSize, anchor, 1);
|
|
58
|
+
(0, vitest_1.expect)(spriteValidationHelper['validateLocationOnSprite'](location)).toEqual(true);
|
|
59
|
+
});
|
|
60
|
+
(0, vitest_1.test)('should not throw an error if location is inside of the sprite with scale boundaries', () => {
|
|
61
|
+
let location = { x: -51, y: 51 };
|
|
62
|
+
let spriteSize = { x: 100, y: 100 };
|
|
63
|
+
let anchor = { x: 0.5, y: 0.5 };
|
|
64
|
+
let spriteValidationHelper = new sprite_validation_helper_1.SpriteValidationHelper(spriteSize, anchor, 2);
|
|
65
|
+
(0, vitest_1.expect)(spriteValidationHelper['validateLocationOnSprite'](location)).toEqual(true);
|
|
66
|
+
});
|
|
67
|
+
(0, vitest_1.test)('should throw an error if location is outside of the sprite boundaries', () => {
|
|
68
|
+
let location = { x: -51, y: 51 };
|
|
69
|
+
let spriteSize = { x: 100, y: 100 };
|
|
70
|
+
let anchor = { x: 0.5, y: 0.5 };
|
|
71
|
+
let spriteValidationHelper = new sprite_validation_helper_1.SpriteValidationHelper(spriteSize, anchor, 1);
|
|
72
|
+
(0, vitest_1.expect)(spriteValidationHelper['validateLocationOnSprite'](location)).toEqual(false);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
(0, vitest_1.describe)('getBoundingBox', () => {
|
|
76
|
+
(0, vitest_1.test)('should return the bounding box of the sprite without scale', () => {
|
|
77
|
+
let spriteSize = { x: 100, y: 100 };
|
|
78
|
+
let anchor = { x: 0.2, y: 0.2 };
|
|
79
|
+
let spriteValidationHelper = new sprite_validation_helper_1.SpriteValidationHelper(spriteSize, anchor, 1);
|
|
80
|
+
(0, vitest_1.expect)(spriteValidationHelper['boundingBox']).toEqual({
|
|
81
|
+
topLeft: { x: -20, y: -20 },
|
|
82
|
+
bottomRight: { x: 80, y: 80 }
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
(0, vitest_1.test)('should return the bounding box of the sprite with scale', () => {
|
|
86
|
+
let spriteSize = { x: 100, y: 100 };
|
|
87
|
+
let anchor = { x: 0.2, y: 0.2 };
|
|
88
|
+
let spriteValidationHelper = new sprite_validation_helper_1.SpriteValidationHelper(spriteSize, anchor, 0.5);
|
|
89
|
+
(0, vitest_1.expect)(spriteValidationHelper['boundingBox']).toEqual({
|
|
90
|
+
topLeft: { x: -10, y: -10 },
|
|
91
|
+
bottomRight: { x: 40, y: 40 }
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=sprite-validation.helper.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sprite-validation.helper.test.js","sourceRoot":"","sources":["../../../../../src/helpers/validator/custom-validators/helpers/sprite-validation.helper.test.ts"],"names":[],"mappings":";;AAAA,mCAAgD;AAEhD,yEAAoE;AAEpE,IAAA,iBAAQ,EAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,IAAA,iBAAQ,EAAC,+BAA+B,EAAE,GAAG,EAAE;QAC7C,IAAA,aAAI,EAAC,oDAAoD,EAAE,GAAG,EAAE;YAC9D,IAAI,QAAQ,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;YAChC,IAAI,UAAU,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;YACpC,IAAI,MAAM,GAAG,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C,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Joi, { ErrorReport } from 'joi';
|
|
2
2
|
import { FileSystem } from '../../../framework/interfaces';
|
|
3
|
-
import {
|
|
4
|
-
export declare class PathCustomValidator implements
|
|
3
|
+
import { CustomStringValidator } from '../joi-custom-validators';
|
|
4
|
+
export declare class PathCustomValidator implements CustomStringValidator {
|
|
5
5
|
private fs;
|
|
6
6
|
readonly regex: RegExp;
|
|
7
7
|
readonly validate: (value: string, helpers: Joi.CustomHelpers) => any | ErrorReport;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Joi, { ErrorReport } from 'joi';
|
|
2
|
+
import { RawSpriteDefinition } from '../../../pre-made-components/assets/1-sprite';
|
|
3
|
+
import { CustomObjectValidator } from '../joi-custom-validators';
|
|
4
|
+
export interface PositionOnSpriteValidationOptions {
|
|
5
|
+
selectSpriteDefinition: (value: any) => RawSpriteDefinition;
|
|
6
|
+
positionsJsonPath: string | string[];
|
|
7
|
+
includeRotationFromAnchor?: boolean;
|
|
8
|
+
checkIfPositionIsOnSprite?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class PositionOnSpriteCustomValidator implements CustomObjectValidator {
|
|
11
|
+
private options;
|
|
12
|
+
readonly validate: (value: string, helpers: Joi.CustomHelpers) => any | ErrorReport;
|
|
13
|
+
constructor(options: PositionOnSpriteValidationOptions);
|
|
14
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PositionOnSpriteCustomValidator = void 0;
|
|
4
|
+
const helpers_lib_1 = require("helpers-lib");
|
|
5
|
+
const jsonpath_plus_1 = require("jsonpath-plus");
|
|
6
|
+
const sprite_validation_helper_1 = require("./helpers/sprite-validation.helper");
|
|
7
|
+
class PositionOnSpriteCustomValidator {
|
|
8
|
+
constructor(options) {
|
|
9
|
+
this.options = options;
|
|
10
|
+
this.validate = (value, helpers) => {
|
|
11
|
+
let spriteDefinition = this.options.selectSpriteDefinition(value);
|
|
12
|
+
if (!spriteDefinition) {
|
|
13
|
+
throw new Error(`positionOnSprite - callback function did not return sprite definition.`);
|
|
14
|
+
}
|
|
15
|
+
let spriteValidationHelper = new sprite_validation_helper_1.SpriteValidationHelper(spriteDefinition.url.size, spriteDefinition.anchor, spriteDefinition.scale, this.options.checkIfPositionIsOnSprite);
|
|
16
|
+
let positionsJsonPaths = Array.isArray(this.options.positionsJsonPath)
|
|
17
|
+
? this.options.positionsJsonPath
|
|
18
|
+
: [this.options.positionsJsonPath];
|
|
19
|
+
positionsJsonPaths.forEach(jsonPath => (0, jsonpath_plus_1.JSONPath)({ json: value, path: jsonPath }).forEach((item) => {
|
|
20
|
+
if (!helpers_lib_1.Comparator.isObject(item)) {
|
|
21
|
+
throw new Error(`positionOnSprite, positions json path returned a non-object result. Value: "${item}".`);
|
|
22
|
+
}
|
|
23
|
+
else if (!helpers_lib_1.Comparator.isNumber(item.x) || !helpers_lib_1.Comparator.isNumber(item.y)) {
|
|
24
|
+
throw new Error(`positionOnSprite, positions json path returned a non-vec2 result. Value: "${item}".`);
|
|
25
|
+
}
|
|
26
|
+
let positionFromAnchor = spriteValidationHelper.convertPositionToSpriteAnchor(item);
|
|
27
|
+
positionFromAnchor = { x: Math.round(positionFromAnchor.x), y: Math.round(positionFromAnchor.y) };
|
|
28
|
+
if (this.options.includeRotationFromAnchor) {
|
|
29
|
+
item.rotationFromAnchor = spriteValidationHelper.getRotationFromAnchor(positionFromAnchor);
|
|
30
|
+
item.positionFromAnchor = positionFromAnchor;
|
|
31
|
+
delete item.x;
|
|
32
|
+
delete item.y;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
item.x = positionFromAnchor.x;
|
|
36
|
+
item.y = positionFromAnchor.y;
|
|
37
|
+
}
|
|
38
|
+
}));
|
|
39
|
+
return value;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.PositionOnSpriteCustomValidator = PositionOnSpriteCustomValidator;
|
|
44
|
+
//# sourceMappingURL=position-on-sprite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position-on-sprite.js","sourceRoot":"","sources":["../../../../src/helpers/validator/custom-validators/position-on-sprite.ts"],"names":[],"mappings":";;;AAAA,6CAA+C;AAE/C,iDAAyC;AAIzC,iFAA4E;AAS5E,MAAa,+BAA+B;IA4C1C,YAAoB,OAA0C;QAA1C,YAAO,GAAP,OAAO,CAAmC;QA3CrD,aAAQ,GAAG,CAAC,KAAa,EAAE,OAA0B,EAAqB,EAAE;YACnF,IAAI,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;YAClE,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;YAC5F,CAAC;YAED,IAAI,sBAAsB,GAAG,IAAI,iDAAsB,CACrD,gBAAgB,CAAC,GAAG,CAAC,IAAI,EACzB,gBAAgB,CAAC,MAAM,EACvB,gBAAgB,CAAC,KAAK,EACtB,IAAI,CAAC,OAAO,CAAC,yBAAyB,CACvC,CAAC;YAEF,IAAI,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC;gBACpE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB;gBAChC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;YAErC,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CACpC,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,IAAS,EAAE,EAAE;gBAC9D,IAAI,CAAC,wBAAU,CAAC,QAAQ,CAAC,IAAI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abstract class ReferenceCustomValidatorBase implements
|
|
3
|
+
import { CustomStringValidator, ReferenceCustomValidatorOptions } from '../joi-custom-validators';
|
|
4
|
+
declare abstract class ReferenceCustomValidatorBase implements CustomStringValidator {
|
|
5
5
|
protected options?: ReferenceCustomValidatorOptions | undefined;
|
|
6
6
|
readonly regex: RegExp;
|
|
7
7
|
abstract readonly validate: Joi.CustomValidator<any, any>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Vec2 } from 'helpers-lib';
|
|
2
2
|
import Joi, { ErrorReport } from 'joi';
|
|
3
3
|
import { FileSystem } from '../../../framework/interfaces';
|
|
4
|
-
import {
|
|
4
|
+
import { CustomStringValidator } from '../joi-custom-validators';
|
|
5
5
|
export interface ValidatedSpriteUrl {
|
|
6
6
|
readonly url: string;
|
|
7
7
|
readonly size: Vec2;
|
|
8
8
|
}
|
|
9
|
-
export declare class SpriteCustomValidator implements
|
|
9
|
+
export declare class SpriteCustomValidator implements CustomStringValidator {
|
|
10
10
|
private fs;
|
|
11
11
|
readonly regex: RegExp;
|
|
12
12
|
readonly validate: (value: string, helpers: Joi.CustomHelpers) => any | ErrorReport;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
2
|
import { DefinitionComponentClassType } from '../../decorators/definition-component';
|
|
3
3
|
import { FileSystem } from '../../framework/interfaces';
|
|
4
|
-
|
|
4
|
+
import { PositionOnSpriteValidationOptions } from './custom-validators/position-on-sprite';
|
|
5
|
+
export interface CustomStringValidator {
|
|
5
6
|
readonly regex: RegExp;
|
|
6
7
|
readonly validate: Joi.CustomValidator<any, any>;
|
|
7
8
|
}
|
|
9
|
+
export interface CustomObjectValidator {
|
|
10
|
+
readonly validate: Joi.CustomValidator<any, any>;
|
|
11
|
+
}
|
|
8
12
|
export interface ReferenceCustomValidatorOptions {
|
|
9
13
|
propertyShouldExist?: string | string[];
|
|
10
14
|
}
|
|
@@ -15,8 +19,11 @@ declare module 'joi' {
|
|
|
15
19
|
reference(definitionComponentClass: DefinitionComponentClassType<any> | DefinitionComponentClassType<any>[], options?: ReferenceCustomValidatorOptions): Joi.StringSchema;
|
|
16
20
|
lazyReference(componentName: string, options?: ReferenceCustomValidatorOptions): Joi.StringSchema;
|
|
17
21
|
}
|
|
22
|
+
interface ObjectSchema {
|
|
23
|
+
positionOnSprite(options: PositionOnSpriteValidationOptions): Joi.ObjectSchema;
|
|
24
|
+
}
|
|
18
25
|
}
|
|
19
26
|
export declare class JoiCustomValidators {
|
|
20
27
|
static decorate(joi: object, fs: FileSystem): void;
|
|
21
|
-
private static
|
|
28
|
+
private static defineCustomStringValidator;
|
|
22
29
|
}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.JoiCustomValidators = void 0;
|
|
7
7
|
const joi_1 = __importDefault(require("joi"));
|
|
8
8
|
const path_custom_validator_1 = require("./custom-validators/path.custom-validator");
|
|
9
|
+
const position_on_sprite_1 = require("./custom-validators/position-on-sprite");
|
|
9
10
|
const reference_custom_validator_1 = require("./custom-validators/reference.custom-validator");
|
|
10
11
|
const sprite_custom_validator_1 = require("./custom-validators/sprite.custom-validator");
|
|
11
12
|
class JoiCustomValidators {
|
|
@@ -13,28 +14,33 @@ class JoiCustomValidators {
|
|
|
13
14
|
// @ts-ignore
|
|
14
15
|
joi.string().__proto__.path = function () {
|
|
15
16
|
let pathCustomValidator = new path_custom_validator_1.PathCustomValidator(fs);
|
|
16
|
-
return JoiCustomValidators.
|
|
17
|
+
return JoiCustomValidators.defineCustomStringValidator(this, pathCustomValidator);
|
|
17
18
|
};
|
|
18
19
|
// @ts-ignore
|
|
19
20
|
joi.string().__proto__.sprite = function () {
|
|
20
21
|
let spriteCustomValidator = new sprite_custom_validator_1.SpriteCustomValidator(fs);
|
|
21
|
-
return JoiCustomValidators.
|
|
22
|
+
return JoiCustomValidators.defineCustomStringValidator(this, spriteCustomValidator);
|
|
22
23
|
};
|
|
23
24
|
// @ts-ignore
|
|
24
25
|
joi.string().__proto__.reference = function (definitionComponentClasses, options) {
|
|
25
26
|
let referenceCustomValidator = new reference_custom_validator_1.ReferenceCustomValidator(definitionComponentClasses, options);
|
|
26
|
-
return JoiCustomValidators.
|
|
27
|
+
return JoiCustomValidators.defineCustomStringValidator(this, referenceCustomValidator);
|
|
27
28
|
};
|
|
28
29
|
// @ts-ignore
|
|
29
30
|
joi.string().__proto__.lazyReference = function (componentName, options) {
|
|
30
31
|
let lazyReferenceCustomValidator = new reference_custom_validator_1.LazyReferenceCustomValidator(componentName, options);
|
|
31
|
-
return JoiCustomValidators.
|
|
32
|
+
return JoiCustomValidators.defineCustomStringValidator(this, lazyReferenceCustomValidator);
|
|
33
|
+
};
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
joi.object().__proto__.positionOnSprite = function (options) {
|
|
36
|
+
let positionOnSpriteValidator = new position_on_sprite_1.PositionOnSpriteCustomValidator(options);
|
|
37
|
+
return this.custom(positionOnSpriteValidator.validate);
|
|
32
38
|
};
|
|
33
39
|
if (joi !== joi_1.default) {
|
|
34
40
|
this.decorate(joi_1.default, fs);
|
|
35
41
|
}
|
|
36
42
|
}
|
|
37
|
-
static
|
|
43
|
+
static defineCustomStringValidator(schema, customValidator) {
|
|
38
44
|
return schema.regex(customValidator.regex).custom(customValidator.validate);
|
|
39
45
|
}
|
|
40
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joi-custom-validators.js","sourceRoot":"","sources":["../../../src/helpers/validator/joi-custom-validators.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AAItB,qFAAgF;AAChF,+FAAwH;AACxH,yFAAoF;
|
|
1
|
+
{"version":3,"file":"joi-custom-validators.js","sourceRoot":"","sources":["../../../src/helpers/validator/joi-custom-validators.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AAItB,qFAAgF;AAChF,+EAA4H;AAC5H,+FAAwH;AACxH,yFAAoF;AA8BpF,MAAa,mBAAmB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AC,yBAAyB,CAAC,QAAQ,CAAC,CAAC;QACzD,CAAC,CAAC;QAEF,IAAI,GAAG,KAAK,aAAG,EAAE,CAAC;YAChB,IAAI,CAAC,QAAQ,CAAC,aAAG,EAAE,EAAE,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,2BAA2B,CAAC,MAAwB,EAAE,eAAsC;QACzG,OAAO,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC9E,CAAC;CACF;AA3CD,kDA2CC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,5 +5,10 @@ export { ErrorLog, LocationInFile, Output } from './framework/interfaces';
|
|
|
5
5
|
export { ValidatedSpriteUrl } from './helpers/validator/custom-validators/sprite.custom-validator';
|
|
6
6
|
export { JoiCustomValidators } from './helpers/validator/joi-custom-validators';
|
|
7
7
|
export { Validator } from './helpers/validator/validator';
|
|
8
|
+
export * from './pre-made-components/_validators/shape-validators';
|
|
9
|
+
export * from './pre-made-components/_validators/sprite-validators';
|
|
10
|
+
export { SpriteComponent } from './pre-made-components/assets/1-sprite';
|
|
11
|
+
export { SpriteGroupComponent } from './pre-made-components/assets/2-sprite-group';
|
|
12
|
+
export { FontComponent } from './pre-made-components/assets/3-font';
|
|
8
13
|
export { EventComponent } from './pre-made-components/events/1-event';
|
|
9
14
|
export { EventTestComponent } from './pre-made-components/events/2-event-test';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EventTestComponent = exports.EventComponent = exports.Validator = exports.JoiCustomValidators = exports.DefinitionStore = exports.DefinitionGeneratorDecorator = exports.DefinitionGenerator = exports.SingleDefinitionComponent = exports.DefinitionComponentDecorator = exports.DefinitionComponent = void 0;
|
|
17
|
+
exports.EventTestComponent = exports.EventComponent = exports.FontComponent = exports.SpriteGroupComponent = exports.SpriteComponent = exports.Validator = exports.JoiCustomValidators = exports.DefinitionStore = exports.DefinitionGeneratorDecorator = exports.DefinitionGenerator = exports.SingleDefinitionComponent = exports.DefinitionComponentDecorator = exports.DefinitionComponent = void 0;
|
|
4
18
|
require('./setup');
|
|
5
19
|
var definition_component_1 = require("./decorators/definition-component");
|
|
6
20
|
Object.defineProperty(exports, "DefinitionComponent", { enumerable: true, get: function () { return definition_component_1.DefinitionComponent; } });
|
|
@@ -15,6 +29,14 @@ var joi_custom_validators_1 = require("./helpers/validator/joi-custom-validators
|
|
|
15
29
|
Object.defineProperty(exports, "JoiCustomValidators", { enumerable: true, get: function () { return joi_custom_validators_1.JoiCustomValidators; } });
|
|
16
30
|
var validator_1 = require("./helpers/validator/validator");
|
|
17
31
|
Object.defineProperty(exports, "Validator", { enumerable: true, get: function () { return validator_1.Validator; } });
|
|
32
|
+
__exportStar(require("./pre-made-components/_validators/shape-validators"), exports);
|
|
33
|
+
__exportStar(require("./pre-made-components/_validators/sprite-validators"), exports);
|
|
34
|
+
var _1_sprite_1 = require("./pre-made-components/assets/1-sprite");
|
|
35
|
+
Object.defineProperty(exports, "SpriteComponent", { enumerable: true, get: function () { return _1_sprite_1.SpriteComponent; } });
|
|
36
|
+
var _2_sprite_group_1 = require("./pre-made-components/assets/2-sprite-group");
|
|
37
|
+
Object.defineProperty(exports, "SpriteGroupComponent", { enumerable: true, get: function () { return _2_sprite_group_1.SpriteGroupComponent; } });
|
|
38
|
+
var _3_font_1 = require("./pre-made-components/assets/3-font");
|
|
39
|
+
Object.defineProperty(exports, "FontComponent", { enumerable: true, get: function () { return _3_font_1.FontComponent; } });
|
|
18
40
|
var _1_event_1 = require("./pre-made-components/events/1-event");
|
|
19
41
|
Object.defineProperty(exports, "EventComponent", { enumerable: true, get: function () { return _1_event_1.EventComponent; } });
|
|
20
42
|
var _2_event_test_1 = require("./pre-made-components/events/2-event-test");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAO,CAAC,SAAS,CAAC,CAAC;AAEnB,0EAK2C;AAJzC,2HAAA,mBAAmB,OAAA;AAEnB,oIAAA,4BAA4B,OAAA;AAC5B,iIAAA,yBAAyB,OAAA;AAE3B,0EAAsG;AAA7F,2HAAA,mBAAmB,OAAA;AAAE,oIAAA,4BAA4B,OAAA;AAC1D,iEAA+D;AAAtD,mHAAA,eAAe,OAAA;AAGxB,mFAAgF;AAAvE,4HAAA,mBAAmB,OAAA;AAC5B,2DAA0D;AAAjD,sGAAA,SAAS,OAAA;AAElB,qFAAmE;AACnE,sFAAoE;AACpE,mEAAwE;AAA/D,4GAAA,eAAe,OAAA;AACxB,+EAAmF;AAA1E,uHAAA,oBAAoB,OAAA;AAC7B,+DAAoE;AAA3D,wGAAA,aAAa,OAAA;AACtB,iEAAsE;AAA7D,0GAAA,cAAc,OAAA;AACvB,2EAA+E;AAAtE,mHAAA,kBAAkB,OAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Vec2 } from 'helpers-lib';
|
|
2
|
+
import Joi from 'joi';
|
|
3
|
+
export declare const PoligonSchema: () => Joi.ArraySchema<Vec2[][]>;
|
|
4
|
+
export declare const Vec2Schema: () => Joi.ObjectSchema<Vec2>;
|
|
5
|
+
export declare const HexColorSchema: () => Joi.StringSchema;
|
|
6
|
+
export declare const RotationSchema: () => Joi.NumberSchema<number>;
|
|
7
|
+
export declare const FixedArraySchema: (itemSchema: Joi.ObjectSchema<any>, size: number) => Joi.ArraySchema;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FixedArraySchema = exports.RotationSchema = exports.HexColorSchema = exports.Vec2Schema = exports.PoligonSchema = void 0;
|
|
7
|
+
const helpers_lib_1 = require("helpers-lib");
|
|
8
|
+
const joi_1 = __importDefault(require("joi"));
|
|
9
|
+
const PoligonSchema = () => joi_1.default.array().items(joi_1.default.array().items((0, exports.Vec2Schema)().required()).min(3).required()).min(1);
|
|
10
|
+
exports.PoligonSchema = PoligonSchema;
|
|
11
|
+
const Vec2Schema = () => joi_1.default.object().keys({
|
|
12
|
+
x: joi_1.default.number().required(),
|
|
13
|
+
y: joi_1.default.number().required()
|
|
14
|
+
});
|
|
15
|
+
exports.Vec2Schema = Vec2Schema;
|
|
16
|
+
const HexColorSchema = () => joi_1.default.string()
|
|
17
|
+
.pattern(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)
|
|
18
|
+
.custom(value => helpers_lib_1.ColorHelper.stringColorToRGBColor(value));
|
|
19
|
+
exports.HexColorSchema = HexColorSchema;
|
|
20
|
+
const RotationSchema = () => joi_1.default.number().min(-Math.PI).max(Math.PI);
|
|
21
|
+
exports.RotationSchema = RotationSchema;
|
|
22
|
+
const FixedArraySchema = (itemSchema, size) => joi_1.default.array()
|
|
23
|
+
.items(itemSchema)
|
|
24
|
+
.max(size)
|
|
25
|
+
.custom(value => {
|
|
26
|
+
if (value.length > size) {
|
|
27
|
+
throw new Error(`Array exceeds maximum size of ${size}`);
|
|
28
|
+
}
|
|
29
|
+
while (value.length < size) {
|
|
30
|
+
value.push(undefined);
|
|
31
|
+
}
|
|
32
|
+
return value;
|
|
33
|
+
})
|
|
34
|
+
.default(helpers_lib_1.ArrayHelper.createEmptyArray(size))
|
|
35
|
+
.optional();
|
|
36
|
+
exports.FixedArraySchema = FixedArraySchema;
|
|
37
|
+
//# sourceMappingURL=shape-validators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape-validators.js","sourceRoot":"","sources":["../../../src/pre-made-components/_validators/shape-validators.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA6D;AAC7D,8CAAsB;AAEf,MAAM,aAAa,GAAG,GAA8B,EAAE,CAC3D,aAAG,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,aAAG,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,IAAA,kBAAU,GAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAD5E,QAAA,aAAa,iBAC+D;AAElF,MAAM,UAAU,GAAG,GAA2B,EAAE,CACrD,aAAG,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC;IAChB,CAAC,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,CAAC,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC3B,CAAC,CAAC;AAJQ,QAAA,UAAU,cAIlB;AAEE,MAAM,cAAc,GAAG,GAAqB,EAAE,CACnD,aAAG,CAAC,MAAM,EAAE;KACT,OAAO,CAAC,oCAAoC,CAAC;KAC7C,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,yBAAW,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC;AAHlD,QAAA,cAAc,kBAGoC;AAExD,MAAM,cAAc,GAAG,GAA6B,EAAE,CAAC,aAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAAzF,QAAA,cAAc,kBAA2E;AAE/F,MAAM,gBAAgB,GAAG,CAAC,UAAiC,EAAE,IAAY,EAAmB,EAAE,CACnG,aAAG,CAAC,KAAK,EAAE;KACR,KAAK,CAAC,UAAU,CAAC;KACjB,GAAG,CAAC,IAAI,CAAC;KACT,MAAM,CAAC,KAAK,CAAC,EAAE;IACd,IAAI,KAAK,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,iCAAiC,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;KACD,OAAO,CAAC,yBAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;KAC3C,QAAQ,EAAE,CAAC;AAdH,QAAA,gBAAgB,oBAcb"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SpriteSchema = exports.PixelPerfectSpriteSchema = void 0;
|
|
7
|
+
const joi_1 = __importDefault(require("joi"));
|
|
8
|
+
const definition_store_1 = require("../../framework/definition-store");
|
|
9
|
+
const _1_sprite_1 = require("../assets/1-sprite");
|
|
10
|
+
const PixelPerfectSpriteSchema = () => joi_1.default.string()
|
|
11
|
+
.reference(_1_sprite_1.SpriteComponent)
|
|
12
|
+
.custom((value) => {
|
|
13
|
+
let spriteDefinition = definition_store_1.DefinitionStore.getDefinitionOrFail(_1_sprite_1.SpriteComponent, value);
|
|
14
|
+
if (spriteDefinition.url.size.x % 4 !== 0) {
|
|
15
|
+
throw new Error(`Sprite width must be multiplier of four in order to keep the pixel perfection. Got: '${spriteDefinition.url.size.x}'`);
|
|
16
|
+
}
|
|
17
|
+
if (spriteDefinition.url.size.y % 4 !== 0) {
|
|
18
|
+
throw new Error(`Sprite height must be multiplier of four in order to keep the pixel perfection. Got: '${spriteDefinition.url.size.y}'`);
|
|
19
|
+
}
|
|
20
|
+
return value;
|
|
21
|
+
});
|
|
22
|
+
exports.PixelPerfectSpriteSchema = PixelPerfectSpriteSchema;
|
|
23
|
+
const SpriteSchema = (size) => joi_1.default.string()
|
|
24
|
+
.reference(_1_sprite_1.SpriteComponent)
|
|
25
|
+
.custom((value) => {
|
|
26
|
+
let spriteDefinition = definition_store_1.DefinitionStore.getDefinitionOrFail(_1_sprite_1.SpriteComponent, value);
|
|
27
|
+
if (spriteDefinition.url.size.x !== size.x) {
|
|
28
|
+
throw new Error(`Sprite width must be '${size.x}px'. Got: '${spriteDefinition.url.size.x}'`);
|
|
29
|
+
}
|
|
30
|
+
if (spriteDefinition.url.size.y !== size.y) {
|
|
31
|
+
throw new Error(`Sprite height must be '${size.y}px'. Got: '${spriteDefinition.url.size.y}'`);
|
|
32
|
+
}
|
|
33
|
+
if (spriteDefinition.scale !== 0.5) {
|
|
34
|
+
throw new Error(`Sprite '${value}' scale must be 0.5. Got: '${spriteDefinition.scale}'`);
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
});
|
|
38
|
+
exports.SpriteSchema = SpriteSchema;
|
|
39
|
+
//# sourceMappingURL=sprite-validators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sprite-validators.js","sourceRoot":"","sources":["../../../src/pre-made-components/_validators/sprite-validators.ts"],"names":[],"mappings":";;;;;;AACA,8CAAsB;AAEtB,uEAAmE;AACnE,kDAAqD;AAE9C,MAAM,wBAAwB,GAAG,GAAqB,EAAE,CAC7D,aAAG,CAAC,MAAM,EAAE;KACT,SAAS,CAAC,2BAAe,CAAC;KAC1B,MAAM,CAAC,CAAC,KAAa,EAAE,EAAE;IACxB,IAAI,gBAAgB,GAAG,kCAAe,CAAC,mBAAmB,CAAC,2BAAe,EAAE,KAAK,CAAC,CAAC;IACnF,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CACb,wFAAwF,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CACvH,CAAC;IACJ,CAAC;IACD,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CACb,yFAAyF,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CACxH,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC,CAAC;AAhBM,QAAA,wBAAwB,4BAgB9B;AAEA,MAAM,YAAY,GAAG,CAAC,IAAY,EAAoB,EAAE,CAC7D,aAAG,CAAC,MAAM,EAAE;KACT,SAAS,CAAC,2BAAe,CAAC;KAC1B,MAAM,CAAC,CAAC,KAAa,EAAE,EAAE;IACxB,IAAI,gBAAgB,GAAG,kCAAe,CAAC,mBAAmB,CAAC,2BAAe,EAAE,KAAK,CAAC,CAAC;IACnF,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,CAAC,CAAC,cAAc,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAC/F,CAAC;IACD,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,0BAA0B,IAAI,CAAC,CAAC,cAAc,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAChG,CAAC;IACD,IAAI,gBAAgB,CAAC,KAAK,KAAK,GAAG,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,WAAW,KAAK,8BAA8B,gBAAgB,CAAC,KAAK,GAAG,CAAC,CAAC;IAC3F,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC,CAAC;AAfM,QAAA,YAAY,gBAelB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Vec2 } from 'helpers-lib';
|
|
2
|
+
import { DefinitionComponent } from '../../decorators/definition-component';
|
|
3
|
+
import { Output } from '../../framework/interfaces';
|
|
4
|
+
import { ValidatedSpriteUrl } from '../../helpers/validator/custom-validators/sprite.custom-validator';
|
|
5
|
+
export interface RawSpriteDefinition {
|
|
6
|
+
id: string;
|
|
7
|
+
url: ValidatedSpriteUrl;
|
|
8
|
+
scale: number;
|
|
9
|
+
anchor: Vec2;
|
|
10
|
+
boundingShapes: Vec2[][];
|
|
11
|
+
}
|
|
12
|
+
export declare class SpriteComponent extends DefinitionComponent<RawSpriteDefinition> {
|
|
13
|
+
process(definitions: RawSpriteDefinition[], output: Output): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SpriteComponent = void 0;
|
|
13
|
+
const helpers_lib_1 = require("helpers-lib");
|
|
14
|
+
const joi_1 = __importDefault(require("joi"));
|
|
15
|
+
const definition_component_1 = require("../../decorators/definition-component");
|
|
16
|
+
const shape_validators_1 = require("../_validators/shape-validators");
|
|
17
|
+
let SpriteComponent = class SpriteComponent extends definition_component_1.DefinitionComponent {
|
|
18
|
+
async process(definitions, output) {
|
|
19
|
+
await output.addFile({
|
|
20
|
+
path: '/_premade/sprites.ts',
|
|
21
|
+
preText: `import { AssetDefinition } from 'bard-legends-framework';`,
|
|
22
|
+
variableName: 'SpriteAssets',
|
|
23
|
+
variableType: 'readonly AssetDefinition[]',
|
|
24
|
+
assetUrl: 'url',
|
|
25
|
+
variable: definitions.map(definition => ({
|
|
26
|
+
id: definition.id,
|
|
27
|
+
url: definition.url.url
|
|
28
|
+
}))
|
|
29
|
+
});
|
|
30
|
+
await output.addFile({
|
|
31
|
+
path: '/_premade/sprite-asset-definition.ts',
|
|
32
|
+
preText: `import { SpriteDefinition } from "bard-legends-framework";`,
|
|
33
|
+
variableName: 'SpriteDefinitions',
|
|
34
|
+
variableType: 'Readonly<Record<string, SpriteDefinition>>',
|
|
35
|
+
variable: helpers_lib_1.JsonHelper.arrayToObject(definitions, 'id', {
|
|
36
|
+
transformFunction: definition => ({
|
|
37
|
+
id: definition.id,
|
|
38
|
+
size: definition.url.size,
|
|
39
|
+
scale: definition.scale,
|
|
40
|
+
anchor: definition.anchor,
|
|
41
|
+
boundingShapes: definition.boundingShapes
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.SpriteComponent = SpriteComponent;
|
|
48
|
+
exports.SpriteComponent = SpriteComponent = __decorate([
|
|
49
|
+
(0, definition_component_1.DefinitionComponentDecorator)({
|
|
50
|
+
componentName: 'SPRITE',
|
|
51
|
+
keyName: 'id',
|
|
52
|
+
validationSchema: joi_1.default.object()
|
|
53
|
+
.keys({
|
|
54
|
+
id: joi_1.default.string().required(),
|
|
55
|
+
url: joi_1.default.string().sprite().required(),
|
|
56
|
+
scale: joi_1.default.number().min(0.1).max(1).default(1).optional(),
|
|
57
|
+
anchor: joi_1.default.object()
|
|
58
|
+
.keys({
|
|
59
|
+
x: joi_1.default.number().min(0).max(1).required(),
|
|
60
|
+
y: joi_1.default.number().min(0).max(1).required()
|
|
61
|
+
})
|
|
62
|
+
.default({ x: 0.5, y: 0.5 })
|
|
63
|
+
.optional(),
|
|
64
|
+
boundingShapes: (0, shape_validators_1.PoligonSchema)().optional()
|
|
65
|
+
})
|
|
66
|
+
.positionOnSprite({
|
|
67
|
+
selectSpriteDefinition: (value) => value,
|
|
68
|
+
positionsJsonPath: ['$..boundingShapes[*][*]'],
|
|
69
|
+
includeRotationFromAnchor: false
|
|
70
|
+
})
|
|
71
|
+
.required()
|
|
72
|
+
})
|
|
73
|
+
], SpriteComponent);
|
|
74
|
+
//# sourceMappingURL=1-sprite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1-sprite.js","sourceRoot":"","sources":["../../../src/pre-made-components/assets/1-sprite.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA+C;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aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC3B,GAAG,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YACrC,KAAK,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;YACzD,MAAM,EAAE,aAAG,CAAC,MAAM,EAAE;iBACjB,IAAI,CAAC;gBACJ,CAAC,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;gBACxC,CAAC,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;aACzC,CAAC;iBACD,OAAO,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;iBAC3B,QAAQ,EAAE;YACb,cAAc,EAAE,IAAA,gCAAa,GAAE,CAAC,QAAQ,EAAE;SAC3C,CAAC;aACD,gBAAgB,CAAC;YAChB,sBAAsB,EAAE,CAAC,KAA0B,EAAE,EAAE,CAAC,KAAK;YAC7D,iBAAiB,EAAE,CAAC,yBAAyB,CAAC;YAC9C,yBAAyB,EAAE,KAAK;SACjC,CAAC;aACD,QAAQ,EAAE;KACd,CAAC;GACW,eAAe,CA8B3B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DefinitionComponent } from '../../decorators/definition-component';
|
|
2
|
+
import { Output } from '../../framework/interfaces';
|
|
3
|
+
interface SpriteGroupDefinition {
|
|
4
|
+
id: string;
|
|
5
|
+
group: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare class SpriteGroupComponent extends DefinitionComponent<SpriteGroupDefinition> {
|
|
8
|
+
process(definitions: SpriteGroupDefinition[], output: Output): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SpriteGroupComponent = void 0;
|
|
13
|
+
const helpers_lib_1 = require("helpers-lib");
|
|
14
|
+
const joi_1 = __importDefault(require("joi"));
|
|
15
|
+
const definition_component_1 = require("../../decorators/definition-component");
|
|
16
|
+
const _1_sprite_1 = require("./1-sprite");
|
|
17
|
+
let SpriteGroupComponent = class SpriteGroupComponent extends definition_component_1.DefinitionComponent {
|
|
18
|
+
async process(definitions, output) {
|
|
19
|
+
await output.addFile({
|
|
20
|
+
path: '/_premade/sprite-groups.ts',
|
|
21
|
+
preText: ``,
|
|
22
|
+
variableName: 'SpriteGroupDefinitions',
|
|
23
|
+
variableType: 'Readonly<Record<string, readonly string[]>>',
|
|
24
|
+
variable: helpers_lib_1.JsonHelper.arrayToObject(definitions, 'id', { transformFunction: definition => definition.group })
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.SpriteGroupComponent = SpriteGroupComponent;
|
|
29
|
+
exports.SpriteGroupComponent = SpriteGroupComponent = __decorate([
|
|
30
|
+
(0, definition_component_1.DefinitionComponentDecorator)({
|
|
31
|
+
componentName: 'SPRITE-GROUP',
|
|
32
|
+
keyName: 'id',
|
|
33
|
+
validationSchema: joi_1.default.object()
|
|
34
|
+
.keys({
|
|
35
|
+
id: joi_1.default.string().required(),
|
|
36
|
+
group: joi_1.default.array().items(joi_1.default.string().reference(_1_sprite_1.SpriteComponent)).unique().required()
|
|
37
|
+
})
|
|
38
|
+
.required()
|
|
39
|
+
})
|
|
40
|
+
], SpriteGroupComponent);
|
|
41
|
+
//# sourceMappingURL=2-sprite-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"2-sprite-group.js","sourceRoot":"","sources":["../../../src/pre-made-components/assets/2-sprite-group.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAyC;AACzC,8CAAsB;AAEtB,gFAA0G;AAE1G,0CAA6C;AAiBtC,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,0CAA0C;IAClF,KAAK,CAAC,OAAO,CAAC,WAAoC,EAAE,MAAc;QAChE,MAAM,MAAM,CAAC,OAAO,CAAC;YACnB,IAAI,EAAE,4BAA4B;YAClC,OAAO,EAAE,EAAE;YACX,YAAY,EAAE,wBAAwB;YACtC,YAAY,EAAE,6CAA6C;YAC3D,QAAQ,EAAE,wBAAU,CAAC,aAAa,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,iBAAiB,EAAE,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;SAC7G,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAVY,oDAAoB;+BAApB,oBAAoB;IAVhC,IAAA,mDAA4B,EAAC;QAC5B,aAAa,EAAE,cAAc;QAC7B,OAAO,EAAE,IAAI;QACb,gBAAgB,EAAE,aAAG,CAAC,MAAM,EAAE;aAC3B,IAAI,CAAC;YACJ,EAAE,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC3B,KAAK,EAAE,aAAG,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,aAAG,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,2BAAe,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SACtF,CAAC;aACD,QAAQ,EAAE;KACd,CAAC;GACW,oBAAoB,CAUhC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DefinitionComponent } from '../../decorators/definition-component';
|
|
2
|
+
import { Output } from '../../framework/interfaces';
|
|
3
|
+
interface RawFontDefinition {
|
|
4
|
+
id: string;
|
|
5
|
+
fontFamily: string;
|
|
6
|
+
url: string;
|
|
7
|
+
}
|
|
8
|
+
export interface FontDefinition {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly fontFamily: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class FontComponent extends DefinitionComponent<RawFontDefinition> {
|
|
13
|
+
process(definitions: RawFontDefinition[], output: Output): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FontComponent = void 0;
|
|
13
|
+
const helpers_lib_1 = require("helpers-lib");
|
|
14
|
+
const joi_1 = __importDefault(require("joi"));
|
|
15
|
+
const definition_component_1 = require("../../decorators/definition-component");
|
|
16
|
+
// ---- END ----
|
|
17
|
+
let FontComponent = class FontComponent extends definition_component_1.DefinitionComponent {
|
|
18
|
+
async process(definitions, output) {
|
|
19
|
+
await output.addFile({
|
|
20
|
+
path: '/_premade/fonts.ts',
|
|
21
|
+
preText: `import { AssetDefinition } from 'bard-legends-framework';`,
|
|
22
|
+
variableName: 'FontAssets',
|
|
23
|
+
variableType: 'readonly AssetDefinition[]',
|
|
24
|
+
assetUrl: 'url',
|
|
25
|
+
variable: definitions.map(definition => ({
|
|
26
|
+
id: definition.id,
|
|
27
|
+
url: definition.url
|
|
28
|
+
}))
|
|
29
|
+
});
|
|
30
|
+
await output.addFile({
|
|
31
|
+
path: '/_premade/font-asset-definitions.ts',
|
|
32
|
+
preText: `import { FontDefinition } from "../../";`,
|
|
33
|
+
variableName: 'FontDefinitions',
|
|
34
|
+
variableType: 'Readonly<Record<string, FontDefinition>>',
|
|
35
|
+
variable: helpers_lib_1.JsonHelper.arrayToObject(definitions, 'id', {
|
|
36
|
+
transformFunction: definition => ({
|
|
37
|
+
id: definition.id,
|
|
38
|
+
fontFamily: definition.fontFamily
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.FontComponent = FontComponent;
|
|
45
|
+
exports.FontComponent = FontComponent = __decorate([
|
|
46
|
+
(0, definition_component_1.DefinitionComponentDecorator)({
|
|
47
|
+
componentName: 'FONT',
|
|
48
|
+
keyName: 'id',
|
|
49
|
+
validationSchema: joi_1.default.object()
|
|
50
|
+
.keys({
|
|
51
|
+
id: joi_1.default.string().required(),
|
|
52
|
+
fontFamily: joi_1.default.string().required(),
|
|
53
|
+
url: joi_1.default.string().path().required()
|
|
54
|
+
})
|
|
55
|
+
.required()
|
|
56
|
+
})
|
|
57
|
+
], FontComponent);
|
|
58
|
+
//# sourceMappingURL=3-font.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"3-font.js","sourceRoot":"","sources":["../../../src/pre-made-components/assets/3-font.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAyC;AACzC,8CAAsB;AAEtB,gFAA0G;AAc1G,gBAAgB;AAaT,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,0CAAsC;IACvE,KAAK,CAAC,OAAO,CAAC,WAAgC,EAAE,MAAc;QAC5D,MAAM,MAAM,CAAC,OAAO,CAAC;YACnB,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,2DAA2D;YACpE,YAAY,EAAE,YAAY;YAC1B,YAAY,EAAE,4BAA4B;YAC1C,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBACvC,EAAE,EAAE,UAAU,CAAC,EAAE;gBACjB,GAAG,EAAE,UAAU,CAAC,GAAG;aACpB,CAAC,CAAC;SACJ,CAAC,CAAC;QAEH,MAAM,MAAM,CAAC,OAAO,CAAC;YACnB,IAAI,EAAE,qCAAqC;YAC3C,OAAO,EAAE,0CAA0C;YACnD,YAAY,EAAE,iBAAiB;YAC/B,YAAY,EAAE,0CAA0C;YACxD,QAAQ,EAAE,wBAAU,CAAC,aAAa,CAAC,WAAW,EAAE,IAAI,EAAE;gBACpD,iBAAiB,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;oBAChC,EAAE,EAAE,UAAU,CAAC,EAAE;oBACjB,UAAU,EAAE,UAAU,CAAC,UAAU;iBAClC,CAAC;aACH,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA3BY,sCAAa;wBAAb,aAAa;IAXzB,IAAA,mDAA4B,EAAC;QAC5B,aAAa,EAAE,MAAM;QACrB,OAAO,EAAE,IAAI;QACb,gBAAgB,EAAE,aAAG,CAAC,MAAM,EAAE;aAC3B,IAAI,CAAC;YACJ,EAAE,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC3B,UAAU,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YACnC,GAAG,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;SACpC,CAAC;aACD,QAAQ,EAAE;KACd,CAAC;GACW,aAAa,CA2BzB"}
|
|
@@ -130,7 +130,7 @@ const ActionsSchema = () => joi_1.default.array()
|
|
|
130
130
|
let EventComponent = class EventComponent extends definition_component_1.DefinitionComponent {
|
|
131
131
|
async process(definitions, output) {
|
|
132
132
|
await output.addFile({
|
|
133
|
-
path: '/_premade
|
|
133
|
+
path: '/_premade/events/events.ts',
|
|
134
134
|
preText: `import { EventDefinition } from "story-engine-lib";`,
|
|
135
135
|
variableName: 'EventDefinitions',
|
|
136
136
|
variableType: 'Readonly<Record<string, EventDefinition>>',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1-event.js","sourceRoot":"","sources":["../../../src/pre-made-components/events/1-event.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAyC;AACzC,8CAAsB;AAGtB,gFAA0G;AAG1G,uBAAuB;AACvB,MAAM,mBAAmB,GAAG,GAAe,EAAE,CAC3C,aAAG,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5B,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,KAAK;CACb,CAAC,CAAC,CAAC;AAEN,qBAAqB;AACrB,MAAM,iBAAiB,GAAG,aAAG,CAAC,MAAM,EAAE;KACnC,IAAI,CAAC;IACJ,WAAW,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE;CAC5D,CAAC;KACD,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;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AC;AACf,CAAC,CAAC,CACH,CACJ;KACA,MAAM,CAAC,CAAC,KAAuC,EAAE,EAAE;IAClD,IAAI,0BAA0B,GAAG,KAAK,CAAC;IACvC,IAAI,cAAc,GAAG,KAAK,CAAC;IAE3B,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACrB,IAAI,cAAc,EAAE,CAAC;YACnB,0BAA0B,GAAG,IAAI,CAAC;QACpC,CAAC;aAAM,IACL,MAAM,CAAC,IAAI,KAAK,aAAa;YAC7B,MAAM,CAAC,IAAI,KAAK,mBAAmB;YACnC,MAAM,CAAC,IAAI,KAAK,sBAAsB;YACtC,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAChC,CAAC;YACD,cAAc,GAAG,IAAI,CAAC;QACxB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,0BAA0B,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACtE,CAAC;SAAM,CAAC;QACN,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;KACD,EAAE,CAAC,oBAAoB,CAAC,CAAC;AAYvB,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,0CAAoC;IACtE,KAAK,CAAC,OAAO,CAAC,WAA8B,EAAE,MAAc;QAC1D,MAAM,MAAM,CAAC,OAAO,CAAC;YACnB,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"1-event.js","sourceRoot":"","sources":["../../../src/pre-made-components/events/1-event.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAyC;AACzC,8CAAsB;AAGtB,gFAA0G;AAG1G,uBAAuB;AACvB,MAAM,mBAAmB,GAAG,GAAe,EAAE,CAC3C,aAAG,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5B,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,KAAK;CACb,CAAC,CAAC,CAAC;AAEN,qBAAqB;AACrB,MA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D,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAVY,wCAAc;yBAAd,cAAc;IAV1B,IAAA,mDAA4B,EAAC;QAC5B,aAAa,EAAE,OAAO;QACtB,OAAO,EAAE,IAAI;QACb,gBAAgB,EAAE,aAAG,CAAC,MAAM,EAAE;aAC3B,IAAI,CAAC;YACJ,EAAE,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC3B,OAAO,EAAE,aAAa,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;SAC3C,CAAC;aACD,QAAQ,EAAE;KACd,CAAC;GACW,cAAc,CAU1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "definition-generator-framework",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.14",
|
|
4
4
|
"description": "Definition Generator Framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"image-size": "1.1.1",
|
|
40
40
|
"joi": "17.11.0",
|
|
41
41
|
"prettier": "3.3.3",
|
|
42
|
+
"jsonpath-plus": "8.1.0",
|
|
42
43
|
"story-engine-lib": "0.0.1"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
package/package.json.bak
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "definition-generator-framework",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.14",
|
|
4
4
|
"description": "Definition Generator Framework",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"image-size": "1.1.1",
|
|
40
40
|
"joi": "17.11.0",
|
|
41
41
|
"prettier": "3.3.3",
|
|
42
|
+
"jsonpath-plus": "8.1.0",
|
|
42
43
|
"story-engine-lib": "0.0.1"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|