Socket
Socket
Sign inDemoInstall

@systemic-games/pixels-edit-animation

Package Overview
Dependencies
4
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.4 to 1.0.5

dist/cjs/edit/index.js

6

dist/cjs/edit/ColorType.js

@@ -9,5 +9,5 @@ "use strict";

exports.ColorTypeValues = {
Rgb: (0, pixels_core_utils_1.enumValue)(0),
Face: (0, pixels_core_utils_1.enumValue)(),
Random: (0, pixels_core_utils_1.enumValue)(),
rgb: (0, pixels_core_utils_1.enumValue)(0),
face: (0, pixels_core_utils_1.enumValue)(),
random: (0, pixels_core_utils_1.enumValue)(),
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPropsWithSkipEnum = exports.skipEnum = exports.getPropsWithDisplayOrder = exports.displayOrder = exports.getPropsWithWidget = exports.widget = exports.getPropsWithUnits = exports.units = exports.getPropsWithRange = exports.range = exports.getPropsWithName = exports.name = void 0;
exports.getPropsWithSkipEnum = exports.skipEnum = exports.getPropsWithDisplayOrder = exports.displayOrder = exports.getPropsWithWidget = exports.widget = exports.getPropsWithValues = exports.values = exports.getPropsWithUnit = exports.unit = exports.getPropsWithRange = exports.range = exports.getPropsWithName = exports.name = void 0;
function getMetadata(metadataKey, target) {
var _a;
return (_a = Reflect.getMetadata(metadataKey, target)) !== null && _a !== void 0 ? _a : [];
}
function addMetadata(metadataKey, target, metadata) {
const properties = Reflect.getMetadata(metadataKey, target);
if (properties) {
properties.push(metadata);
}
else {
Reflect.defineMetadata(metadataKey, [metadata], target);
}
// Always pass new array do defineMetadata
// so it doesn't pollute the parent object of the target
Reflect.defineMetadata(metadataKey, getMetadata(metadataKey, target).concat([metadata]), target);
}

@@ -19,7 +19,6 @@ function createDecorator(metadataKey, data) {

}
function getMetadata(metadataKey, target) {
var _a;
return (_a = Reflect.getMetadata(metadataKey, target)) !== null && _a !== void 0 ? _a : [];
}
const nameKey = Symbol("pixelAnimationName");
//
// Name property
//
const nameKey = Symbol("pixelEditAnimationName");
// Name decorator factory

@@ -35,3 +34,6 @@ function name(name) {

exports.getPropsWithName = getPropsWithName;
const rangeKey = Symbol("pixelAnimationRange");
//
// Range property
//
const rangeKey = Symbol("pixelEditAnimationRange");
// Range decorator factory

@@ -51,14 +53,34 @@ function range(min, max, step = 0) {

exports.getPropsWithRange = getPropsWithRange;
const unitKey = Symbol("pixelAnimationUnits");
// Units decorator factory
function units(unit) {
//
// Unit property
//
const unitKey = Symbol("pixelEditAnimationUnit");
// Unit decorator factory
function unit(unit) {
return createDecorator(unitKey, { unit });
}
exports.units = units;
// Get properties with a units decorator
function getPropsWithUnits(target) {
exports.unit = unit;
// Get properties with a unit decorator
function getPropsWithUnit(target) {
return getMetadata(unitKey, target);
}
exports.getPropsWithUnits = getPropsWithUnits;
const widgetKey = Symbol("pixelAnimationWidget");
exports.getPropsWithUnit = getPropsWithUnit;
//
// Values property
//
const valuesKey = Symbol("pixelEditAnimationValues");
// Unit decorator factory
function values(values) {
return createDecorator(valuesKey, { values });
}
exports.values = values;
// Get properties with a values decorator
function getPropsWithValues(target) {
return getMetadata(valuesKey, target);
}
exports.getPropsWithValues = getPropsWithValues;
//
// Widget property
//
const widgetKey = Symbol("pixelEditAnimationWidget");
// Widget decorator factory

@@ -74,3 +96,6 @@ function widget(type) {

exports.getPropsWithWidget = getPropsWithWidget;
const displayOrderKey = Symbol("pixelAnimationDisplayOrder");
//
// Display Order property
//
const displayOrderKey = Symbol("pixelEditAnimationDisplayOrder");
// Display order decorator factory

@@ -86,3 +111,6 @@ function displayOrder(index) {

exports.getPropsWithDisplayOrder = getPropsWithDisplayOrder;
const skipEnumKey = Symbol("pixelAnimationSkipEnum");
//
// Skip Enum property
//
const skipEnumKey = Symbol("pixelEditAnimationSkipEnum");
// Skip decorator

@@ -89,0 +117,0 @@ function skipEnum(target, propertyKey) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/** Base class for classes used to create and edit animations. */
class Editable {
}
exports.default = Editable;

@@ -24,3 +24,3 @@ "use strict";

get type() {
return pixels_core_animation_1.ActionTypeValues.PlayAnimation;
return pixels_core_animation_1.ActionTypeValues.playAnimation;
}

@@ -27,0 +27,0 @@ toAction(editSet, _set) {

@@ -22,3 +22,3 @@ "use strict";

get type() {
return pixels_core_animation_1.ActionTypeValues.PlayAnimation;
return pixels_core_animation_1.ActionTypeValues.playAnimation;
}

@@ -25,0 +25,0 @@ toAction(_editSet, _set) {

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -7,6 +13,11 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

const Editable_1 = __importDefault(require("./Editable"));
const decorators_1 = require("./decorators");
/**
* Base class for animation editing classes.
*/
class EditAnimation extends Editable_1.default {
constructor(name = "") {
constructor(name = "", duration = 0) {
super();
this.name = name;
this.duration = duration;
}

@@ -17,2 +28,9 @@ requiresPattern(_pattern) {

}
__decorate([
(0, decorators_1.widget)("slider"),
(0, decorators_1.range)(0.1, 30, 0.1),
(0, decorators_1.unit)("s"),
(0, decorators_1.name)("Duration")
/** Animation duration in seconds. */
], EditAnimation.prototype, "duration", void 0);
exports.default = EditAnimation;

@@ -20,4 +20,3 @@ "use strict";

var _a, _b;
super(options === null || options === void 0 ? void 0 : options.name);
this._duration = (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1;
super(options === null || options === void 0 ? void 0 : options.name, (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1);
this.faces = (_b = options === null || options === void 0 ? void 0 : options.faces) !== null && _b !== void 0 ? _b : pixels_core_animation_1.Constants.faceMaskAllLEDs;

@@ -27,10 +26,4 @@ this.gradient = options === null || options === void 0 ? void 0 : options.gradient;

get type() {
return pixels_core_animation_1.AnimationTypeValues.Gradient;
return pixels_core_animation_1.AnimationTypeValues.gradient;
}
get duration() {
return this._duration;
}
set duration(value) {
this._duration = value;
}
toAnimation(editSet, bits) {

@@ -59,8 +52,2 @@ // Add gradient

__decorate([
(0, decorators_1.widget)("slider"),
(0, decorators_1.range)(0.1, 30, 0.1),
(0, decorators_1.units)("s"),
(0, decorators_1.name)("Duration")
], EditAnimationGradient.prototype, "duration", null);
__decorate([
(0, decorators_1.widget)("faceMask"),

@@ -67,0 +54,0 @@ (0, decorators_1.range)(0, 19, 1),

@@ -20,4 +20,3 @@ "use strict";

var _a, _b;
super(options === null || options === void 0 ? void 0 : options.name);
this._duration = (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1;
super(options === null || options === void 0 ? void 0 : options.name, (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1);
this.pattern = options === null || options === void 0 ? void 0 : options.pattern;

@@ -28,10 +27,4 @@ this.gradient = options === null || options === void 0 ? void 0 : options.gradient;

get type() {
return pixels_core_animation_1.AnimationTypeValues.GradientPattern;
return pixels_core_animation_1.AnimationTypeValues.gradientPattern;
}
get duration() {
return this._duration;
}
set duration(value) {
this._duration = value;
}
toAnimation(editSet, bits) {

@@ -51,3 +44,3 @@ var _a, _b;

gradientTrackOffset,
overrideWithFace: this.overrideWithFace ? 1 : 0,
overrideWithFace: this.overrideWithFace,
});

@@ -72,8 +65,2 @@ }

__decorate([
(0, decorators_1.widget)("slider"),
(0, decorators_1.range)(0.1, 30, 0.1),
(0, decorators_1.units)("s"),
(0, decorators_1.name)("Duration")
], EditAnimationGradientPattern.prototype, "duration", null);
__decorate([
(0, decorators_1.widget)("grayscalePattern"),

@@ -87,4 +74,5 @@ (0, decorators_1.name)("LED Pattern")

__decorate([
(0, decorators_1.widget)("toggle"),
(0, decorators_1.name)("Override color based on face")
], EditAnimationGradientPattern.prototype, "overrideWithFace", void 0);
exports.default = EditAnimationGradientPattern;

@@ -19,16 +19,9 @@ "use strict";

var _a, _b;
super(options === null || options === void 0 ? void 0 : options.name);
this._duration = (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1;
super(options === null || options === void 0 ? void 0 : options.name, (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1);
this.pattern = options === null || options === void 0 ? void 0 : options.pattern;
this.flowOrder = (_b = options === null || options === void 0 ? void 0 : options.flowOrder) !== null && _b !== void 0 ? _b : false;
this.travelingOrder = (_b = options === null || options === void 0 ? void 0 : options.travelingOrder) !== null && _b !== void 0 ? _b : false;
}
get type() {
return pixels_core_animation_1.AnimationTypeValues.Keyframed;
return pixels_core_animation_1.AnimationTypeValues.keyframed;
}
get duration() {
return this._duration;
}
set duration(value) {
this._duration = value;
}
toAnimation(editSet, _bits) {

@@ -40,3 +33,3 @@ var _a, _b;

trackCount: (_b = (_a = this.pattern) === null || _a === void 0 ? void 0 : _a.gradients.length) !== null && _b !== void 0 ? _b : 0,
flowOrder: this.flowOrder ? 1 : 0,
flowOrder: this.travelingOrder ? 1 : 0,
});

@@ -49,3 +42,3 @@ }

pattern: this.pattern,
flowOrder: this.flowOrder,
travelingOrder: this.travelingOrder,
});

@@ -60,8 +53,2 @@ }

__decorate([
(0, decorators_1.widget)("slider"),
(0, decorators_1.range)(0.1, 30, 0.1),
(0, decorators_1.units)("s"),
(0, decorators_1.name)("Duration")
], EditAnimationKeyframed.prototype, "duration", null);
__decorate([
(0, decorators_1.widget)("rgbPattern"),

@@ -71,4 +58,5 @@ (0, decorators_1.name)("LED Pattern")

__decorate([
(0, decorators_1.widget)("toggle"),
(0, decorators_1.name)("Traveling Order")
], EditAnimationKeyframed.prototype, "flowOrder", void 0);
], EditAnimationKeyframed.prototype, "travelingOrder", void 0);
exports.default = EditAnimationKeyframed;

@@ -20,4 +20,3 @@ "use strict";

var _a, _b, _c, _d, _e;
super(options === null || options === void 0 ? void 0 : options.name);
this._duration = (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1;
super(options === null || options === void 0 ? void 0 : options.name, (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1);
this.gradient = options === null || options === void 0 ? void 0 : options.gradient;

@@ -31,10 +30,4 @@ this.faces = (_b = options === null || options === void 0 ? void 0 : options.faces) !== null && _b !== void 0 ? _b : pixels_core_animation_1.Constants.faceMaskAllLEDs;

get type() {
return pixels_core_animation_1.AnimationTypeValues.Noise;
return pixels_core_animation_1.AnimationTypeValues.noise;
}
get duration() {
return this._duration;
}
set duration(value) {
this._duration = value;
}
toAnimation(editSet, bits) {

@@ -75,8 +68,2 @@ // Add gradient

__decorate([
(0, decorators_1.widget)("slider"),
(0, decorators_1.range)(0.1, 30, 0.1),
(0, decorators_1.units)("s"),
(0, decorators_1.name)("Duration")
], EditAnimationNoise.prototype, "duration", null);
__decorate([
(0, decorators_1.widget)("gradient"),

@@ -83,0 +70,0 @@ (0, decorators_1.name)("Overall Gradient")

@@ -19,4 +19,3 @@ "use strict";

var _a, _b, _c, _d, _e;
super(options === null || options === void 0 ? void 0 : options.name);
this._duration = (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1;
super(options === null || options === void 0 ? void 0 : options.name, (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1);
this.faces = (_b = options === null || options === void 0 ? void 0 : options.faces) !== null && _b !== void 0 ? _b : pixels_core_animation_1.Constants.faceMaskAllLEDs;

@@ -28,10 +27,4 @@ this.count = (_c = options === null || options === void 0 ? void 0 : options.count) !== null && _c !== void 0 ? _c : 1;

get type() {
return pixels_core_animation_1.AnimationTypeValues.Rainbow;
return pixels_core_animation_1.AnimationTypeValues.rainbow;
}
get duration() {
return this._duration;
}
set duration(value) {
this._duration = value;
}
toAnimation(_editSet, _bits) {

@@ -43,3 +36,3 @@ return (0, pixels_core_utils_1.safeAssign)(new pixels_core_animation_1.AnimationRainbow(), {

count: this.count,
traveling: this.traveling ? 1 : 0,
traveling: this.traveling,
});

@@ -50,3 +43,3 @@ }

name: this.name,
duration: this._duration,
duration: this.duration,
faces: this.faces,

@@ -60,8 +53,2 @@ fade: this.fade,

__decorate([
(0, decorators_1.widget)("slider"),
(0, decorators_1.range)(0.1, 30, 0.1),
(0, decorators_1.units)("s"),
(0, decorators_1.name)("Duration")
], EditAnimationRainbow.prototype, "duration", null);
__decorate([
(0, decorators_1.widget)("faceMask"),

@@ -72,3 +59,3 @@ (0, decorators_1.range)(0, 19, 1),

__decorate([
(0, decorators_1.widget)("index"),
(0, decorators_1.widget)("count"),
(0, decorators_1.range)(1, 10, 1),

@@ -83,4 +70,5 @@ (0, decorators_1.name)("Repeat Count")

__decorate([
(0, decorators_1.widget)("toggle"),
(0, decorators_1.name)("Traveling Order")
], EditAnimationRainbow.prototype, "traveling", void 0);
exports.default = EditAnimationRainbow;

@@ -20,5 +20,4 @@ "use strict";

var _a, _b, _c, _d, _e;
super(options === null || options === void 0 ? void 0 : options.name);
const color = (_a = options === null || options === void 0 ? void 0 : options.color) !== null && _a !== void 0 ? _a : pixels_core_animation_1.Color.red;
this._duration = (_b = options === null || options === void 0 ? void 0 : options.duration) !== null && _b !== void 0 ? _b : 1;
super(options === null || options === void 0 ? void 0 : options.name, (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1);
const color = (_b = options === null || options === void 0 ? void 0 : options.color) !== null && _b !== void 0 ? _b : pixels_core_animation_1.Color.red;
this.faces = (_c = options === null || options === void 0 ? void 0 : options.faces) !== null && _c !== void 0 ? _c : pixels_core_animation_1.Constants.faceMaskAllLEDs;

@@ -30,10 +29,4 @@ this.color = color instanceof pixels_core_animation_1.Color ? EditColor_1.default.fromColor(color) : color;

get type() {
return pixels_core_animation_1.AnimationTypeValues.Simple;
return pixels_core_animation_1.AnimationTypeValues.simple;
}
get duration() {
return this._duration;
}
set duration(value) {
this._duration = value;
}
toAnimation(editSet, bits) {

@@ -59,8 +52,2 @@ return (0, pixels_core_utils_1.safeAssign)(new pixels_core_animation_1.AnimationSimple(), {

__decorate([
(0, decorators_1.widget)("slider"),
(0, decorators_1.range)(0.1, 30, 0),
(0, decorators_1.units)("s"),
(0, decorators_1.name)("Duration")
], EditAnimationSimple.prototype, "duration", null);
__decorate([
(0, decorators_1.widget)("faceMask"),

@@ -71,6 +58,7 @@ (0, decorators_1.range)(0, 19, 1),

__decorate([
(0, decorators_1.widget)("color"),
(0, decorators_1.name)("Color")
], EditAnimationSimple.prototype, "color", void 0);
__decorate([
(0, decorators_1.widget)("index"),
(0, decorators_1.widget)("count"),
(0, decorators_1.range)(1, 10, 1),

@@ -77,0 +65,0 @@ (0, decorators_1.name)("Repeat Count")

@@ -10,3 +10,3 @@ "use strict";

class EditColor extends Editable_1.default {
constructor(type = ColorType_1.ColorTypeValues.Rgb, color = pixels_core_animation_1.Color.black) {
constructor(type = ColorType_1.ColorTypeValues.rgb, color = pixels_core_animation_1.Color.black) {
super();

@@ -17,11 +17,11 @@ this.type = type;

static fromColor(color) {
return new EditColor(ColorType_1.ColorTypeValues.Rgb, color);
return new EditColor(ColorType_1.ColorTypeValues.rgb, color);
}
toColorIndex(refPalette) {
switch (this.type) {
case ColorType_1.ColorTypeValues.Rgb:
case ColorType_1.ColorTypeValues.rgb:
return EditColor.toColorIndex(refPalette, this.color);
case ColorType_1.ColorTypeValues.Face:
case ColorType_1.ColorTypeValues.face:
return pixels_core_animation_1.Constants.paletteColorFromFace;
case ColorType_1.ColorTypeValues.Random:
case ColorType_1.ColorTypeValues.random:
return pixels_core_animation_1.Constants.paletteColorFromRandom;

@@ -33,3 +33,3 @@ default:

static toColorIndex(refPalette, color) {
const colorGamma = (0, pixels_core_animation_1.gamma)(color);
const colorGamma = pixels_core_animation_1.GammaUtils.gamma(color);
let colorIndex = refPalette.findIndex((c) => colorGamma.equals(c));

@@ -36,0 +36,0 @@ if (colorIndex === -1) {

@@ -23,3 +23,3 @@ "use strict";

get type() {
return pixels_core_animation_1.ConditionTypeValues.BatteryState;
return pixels_core_animation_1.ConditionTypeValues.catteryState;
}

@@ -37,4 +37,5 @@ toCondition(_editSet, _set) {

__decorate([
(0, decorators_1.widget)("bitfield"),
(0, decorators_1.name)("Battery State")
(0, decorators_1.widget)("bitField"),
(0, decorators_1.name)("Battery State"),
(0, decorators_1.values)(pixels_core_animation_1.BatteryStateFlagsValues)
], EditConditionBatteryState.prototype, "flags", void 0);

@@ -44,4 +45,4 @@ __decorate([

(0, decorators_1.range)(5, 60),
(0, decorators_1.units)("s")
(0, decorators_1.unit)("s")
], EditConditionBatteryState.prototype, "recheckAfter", void 0);
exports.default = EditConditionBatteryState;

@@ -22,3 +22,3 @@ "use strict";

get type() {
return pixels_core_animation_1.ConditionTypeValues.ConnectionState;
return pixels_core_animation_1.ConditionTypeValues.connectionState;
}

@@ -35,5 +35,6 @@ toCondition(_editSet, _set) {

__decorate([
(0, decorators_1.widget)("bitfield"),
(0, decorators_1.name)("Connection Event")
(0, decorators_1.widget)("bitField"),
(0, decorators_1.name)("Connection Event"),
(0, decorators_1.values)(pixels_core_animation_1.ConnectionStateFlagsValues)
], EditConditionConnectionState.prototype, "flags", void 0);
exports.default = EditConditionConnectionState;

@@ -10,3 +10,3 @@ "use strict";

get type() {
return pixels_core_animation_1.ConditionTypeValues.Crooked;
return pixels_core_animation_1.ConditionTypeValues.crooked;
}

@@ -13,0 +13,0 @@ toCondition(_editSet, _set) {

@@ -23,3 +23,3 @@ "use strict";

get type() {
return pixels_core_animation_1.ConditionTypeValues.FaceCompare;
return pixels_core_animation_1.ConditionTypeValues.faceCompare;
}

@@ -37,4 +37,5 @@ toCondition(_editSet, _set) {

__decorate([
(0, decorators_1.widget)("bitfield"),
(0, decorators_1.name)("Comparison")
(0, decorators_1.widget)("bitField"),
(0, decorators_1.name)("Comparison"),
(0, decorators_1.values)(pixels_core_animation_1.FaceCompareFlagsValues)
], EditConditionFaceCompare.prototype, "flags", void 0);

@@ -41,0 +42,0 @@ __decorate([

@@ -10,3 +10,3 @@ "use strict";

get type() {
return pixels_core_animation_1.ConditionTypeValues.Handling;
return pixels_core_animation_1.ConditionTypeValues.handling;
}

@@ -13,0 +13,0 @@ toCondition(_editSet, _set) {

@@ -22,3 +22,3 @@ "use strict";

get type() {
return pixels_core_animation_1.ConditionTypeValues.HelloGoodbye;
return pixels_core_animation_1.ConditionTypeValues.helloGoodbye;
}

@@ -35,5 +35,6 @@ toCondition(_editSet, _set) {

__decorate([
(0, decorators_1.widget)("bitfield"),
(0, decorators_1.name)("Hello / Goodbye")
(0, decorators_1.widget)("bitField"),
(0, decorators_1.name)("Hello / Goodbye"),
(0, decorators_1.values)(pixels_core_animation_1.HelloGoodbyeFlagsValues)
], EditConditionHelloGoodbye.prototype, "flags", void 0);
exports.default = EditConditionHelloGoodbye;

@@ -22,3 +22,3 @@ "use strict";

get type() {
return pixels_core_animation_1.ConditionTypeValues.Idle;
return pixels_core_animation_1.ConditionTypeValues.idle;
}

@@ -37,4 +37,4 @@ toCondition(_editSet, _set) {

(0, decorators_1.range)(0.5, 30, 0.5),
(0, decorators_1.units)("s")
(0, decorators_1.unit)("s")
], EditConditionIdle.prototype, "period", void 0);
exports.default = EditConditionIdle;

@@ -22,3 +22,3 @@ "use strict";

get type() {
return pixels_core_animation_1.ConditionTypeValues.Rolling;
return pixels_core_animation_1.ConditionTypeValues.rolling;
}

@@ -37,4 +37,4 @@ toCondition(_editSet, _set) {

(0, decorators_1.range)(0.5, 5, 0.1),
(0, decorators_1.units)("s")
(0, decorators_1.unit)("s")
], EditConditionRolling.prototype, "recheckAfter", void 0);
exports.default = EditConditionRolling;
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -6,79 +32,11 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

Object.defineProperty(exports, "__esModule", { value: true });
exports.loadAppDataSet = exports.AppDataSet = exports.getPropsWithSkipEnum = exports.skipEnum = exports.getPropsWithDisplayOrder = exports.displayOrder = exports.getPropsWithWidget = exports.widget = exports.getPropsWithUnits = exports.units = exports.getPropsWithRange = exports.range = exports.getPropsWithName = exports.name = exports.EditRule = exports.EditRgbTrack = exports.EditRgbKeyframe = exports.EditRgbGradient = exports.EditProfile = exports.EditPattern = exports.EditDataSet = exports.EditConditionRolling = exports.EditConditionIdle = exports.EditConditionHelloGoodbye = exports.EditConditionHandling = exports.EditConditionFaceCompare = exports.EditConditionCrooked = exports.EditConditionConnectionState = exports.EditConditionBatteryState = exports.EditCondition = exports.EditColor = exports.EditAudioClip = exports.EditAnimationSimple = exports.EditAnimationRainbow = exports.EditAnimationNoise = exports.EditAnimationKeyframed = exports.EditAnimationGradientPattern = exports.EditAnimationGradient = exports.EditAnimation = exports.EditActionPlayAudioClip = exports.EditActionPlayAnimation = exports.EditAction = exports.Editable = exports.ColorTypeValues = void 0;
const AppDataSet_1 = __importDefault(require("./AppDataSet"));
exports.AppDataSet = AppDataSet_1.default;
const ColorType_1 = require("./edit/ColorType");
Object.defineProperty(exports, "ColorTypeValues", { enumerable: true, get: function () { return ColorType_1.ColorTypeValues; } });
const EditAction_1 = __importDefault(require("./edit/EditAction"));
exports.EditAction = EditAction_1.default;
const EditActionPlayAnimation_1 = __importDefault(require("./edit/EditActionPlayAnimation"));
exports.EditActionPlayAnimation = EditActionPlayAnimation_1.default;
const EditActionPlayAudioClip_1 = __importDefault(require("./edit/EditActionPlayAudioClip"));
exports.EditActionPlayAudioClip = EditActionPlayAudioClip_1.default;
const EditAnimation_1 = __importDefault(require("./edit/EditAnimation"));
exports.EditAnimation = EditAnimation_1.default;
const EditAnimationGradient_1 = __importDefault(require("./edit/EditAnimationGradient"));
exports.EditAnimationGradient = EditAnimationGradient_1.default;
const EditAnimationGradientPattern_1 = __importDefault(require("./edit/EditAnimationGradientPattern"));
exports.EditAnimationGradientPattern = EditAnimationGradientPattern_1.default;
const EditAnimationKeyframed_1 = __importDefault(require("./edit/EditAnimationKeyframed"));
exports.EditAnimationKeyframed = EditAnimationKeyframed_1.default;
const EditAnimationNoise_1 = __importDefault(require("./edit/EditAnimationNoise"));
exports.EditAnimationNoise = EditAnimationNoise_1.default;
const EditAnimationRainbow_1 = __importDefault(require("./edit/EditAnimationRainbow"));
exports.EditAnimationRainbow = EditAnimationRainbow_1.default;
const EditAnimationSimple_1 = __importDefault(require("./edit/EditAnimationSimple"));
exports.EditAnimationSimple = EditAnimationSimple_1.default;
const EditAudioClip_1 = __importDefault(require("./edit/EditAudioClip"));
exports.EditAudioClip = EditAudioClip_1.default;
const EditColor_1 = __importDefault(require("./edit/EditColor"));
exports.EditColor = EditColor_1.default;
const EditCondition_1 = __importDefault(require("./edit/EditCondition"));
exports.EditCondition = EditCondition_1.default;
const EditConditionBatteryState_1 = __importDefault(require("./edit/EditConditionBatteryState"));
exports.EditConditionBatteryState = EditConditionBatteryState_1.default;
const EditConditionConnectionState_1 = __importDefault(require("./edit/EditConditionConnectionState"));
exports.EditConditionConnectionState = EditConditionConnectionState_1.default;
const EditConditionCrooked_1 = __importDefault(require("./edit/EditConditionCrooked"));
exports.EditConditionCrooked = EditConditionCrooked_1.default;
const EditConditionFaceCompare_1 = __importDefault(require("./edit/EditConditionFaceCompare"));
exports.EditConditionFaceCompare = EditConditionFaceCompare_1.default;
const EditConditionHandling_1 = __importDefault(require("./edit/EditConditionHandling"));
exports.EditConditionHandling = EditConditionHandling_1.default;
const EditConditionHelloGoodbye_1 = __importDefault(require("./edit/EditConditionHelloGoodbye"));
exports.EditConditionHelloGoodbye = EditConditionHelloGoodbye_1.default;
const EditConditionIdle_1 = __importDefault(require("./edit/EditConditionIdle"));
exports.EditConditionIdle = EditConditionIdle_1.default;
const EditConditionRolling_1 = __importDefault(require("./edit/EditConditionRolling"));
exports.EditConditionRolling = EditConditionRolling_1.default;
const EditDataSet_1 = __importDefault(require("./edit/EditDataSet"));
exports.EditDataSet = EditDataSet_1.default;
const EditPattern_1 = __importDefault(require("./edit/EditPattern"));
exports.EditPattern = EditPattern_1.default;
const EditProfile_1 = __importDefault(require("./edit/EditProfile"));
exports.EditProfile = EditProfile_1.default;
const EditRgbGradient_1 = __importDefault(require("./edit/EditRgbGradient"));
exports.EditRgbGradient = EditRgbGradient_1.default;
const EditRgbKeyframe_1 = __importDefault(require("./edit/EditRgbKeyframe"));
exports.EditRgbKeyframe = EditRgbKeyframe_1.default;
const EditRgbTrack_1 = __importDefault(require("./edit/EditRgbTrack"));
exports.EditRgbTrack = EditRgbTrack_1.default;
const EditRule_1 = __importDefault(require("./edit/EditRule"));
exports.EditRule = EditRule_1.default;
const Editable_1 = __importDefault(require("./edit/Editable"));
exports.Editable = Editable_1.default;
const decorators_1 = require("./edit/decorators");
Object.defineProperty(exports, "name", { enumerable: true, get: function () { return decorators_1.name; } });
Object.defineProperty(exports, "getPropsWithName", { enumerable: true, get: function () { return decorators_1.getPropsWithName; } });
Object.defineProperty(exports, "range", { enumerable: true, get: function () { return decorators_1.range; } });
Object.defineProperty(exports, "getPropsWithRange", { enumerable: true, get: function () { return decorators_1.getPropsWithRange; } });
Object.defineProperty(exports, "units", { enumerable: true, get: function () { return decorators_1.units; } });
Object.defineProperty(exports, "getPropsWithUnits", { enumerable: true, get: function () { return decorators_1.getPropsWithUnits; } });
Object.defineProperty(exports, "widget", { enumerable: true, get: function () { return decorators_1.widget; } });
Object.defineProperty(exports, "getPropsWithWidget", { enumerable: true, get: function () { return decorators_1.getPropsWithWidget; } });
Object.defineProperty(exports, "displayOrder", { enumerable: true, get: function () { return decorators_1.displayOrder; } });
Object.defineProperty(exports, "getPropsWithDisplayOrder", { enumerable: true, get: function () { return decorators_1.getPropsWithDisplayOrder; } });
Object.defineProperty(exports, "skipEnum", { enumerable: true, get: function () { return decorators_1.skipEnum; } });
Object.defineProperty(exports, "getPropsWithSkipEnum", { enumerable: true, get: function () { return decorators_1.getPropsWithSkipEnum; } });
const loadAppDataSet_1 = __importDefault(require("./loadAppDataSet"));
exports.loadAppDataSet = loadAppDataSet_1.default;
exports.Json = exports.getEditWidgetsData = exports.loadAppDataSet = exports.AppDataSet = void 0;
var AppDataSet_1 = require("./AppDataSet");
Object.defineProperty(exports, "AppDataSet", { enumerable: true, get: function () { return __importDefault(AppDataSet_1).default; } });
var loadAppDataSet_1 = require("./loadAppDataSet");
Object.defineProperty(exports, "loadAppDataSet", { enumerable: true, get: function () { return __importDefault(loadAppDataSet_1).default; } });
__exportStar(require("./getEditWidgetsData"), exports);
var getEditWidgetsData_1 = require("./getEditWidgetsData");
Object.defineProperty(exports, "getEditWidgetsData", { enumerable: true, get: function () { return __importDefault(getEditWidgetsData_1).default; } });
exports.Json = __importStar(require("./jsonTypes"));
__exportStar(require("./edit"), exports);

@@ -48,5 +48,5 @@ "use strict";

switch (color.type) {
case ColorType_1.ColorTypeValues.Rgb:
case ColorType_1.ColorTypeValues.Face:
case ColorType_1.ColorTypeValues.Random:
case ColorType_1.ColorTypeValues.rgb:
case ColorType_1.ColorTypeValues.face:
case ColorType_1.ColorTypeValues.random:
c.type = color.type;

@@ -75,17 +75,17 @@ break;

switch (condition.type) {
case pixels_core_animation_1.ConditionTypeValues.HelloGoodbye:
case pixels_core_animation_1.ConditionTypeValues.helloGoodbye:
return (0, pixels_core_utils_1.safeAssign)(new EditConditionHelloGoodbye_1.default(), data);
case pixels_core_animation_1.ConditionTypeValues.Handling:
case pixels_core_animation_1.ConditionTypeValues.handling:
return new EditConditionHandling_1.default();
case pixels_core_animation_1.ConditionTypeValues.Rolling:
case pixels_core_animation_1.ConditionTypeValues.rolling:
return (0, pixels_core_utils_1.safeAssign)(new EditConditionRolling_1.default(), data);
case pixels_core_animation_1.ConditionTypeValues.FaceCompare:
case pixels_core_animation_1.ConditionTypeValues.faceCompare:
return (0, pixels_core_utils_1.safeAssign)(new EditConditionFaceCompare_1.default(), data);
case pixels_core_animation_1.ConditionTypeValues.Crooked:
case pixels_core_animation_1.ConditionTypeValues.crooked:
return new EditConditionCrooked_1.default();
case pixels_core_animation_1.ConditionTypeValues.ConnectionState:
case pixels_core_animation_1.ConditionTypeValues.connectionState:
return (0, pixels_core_utils_1.safeAssign)(new EditConditionConnectionState_1.default(), data);
case pixels_core_animation_1.ConditionTypeValues.BatteryState:
case pixels_core_animation_1.ConditionTypeValues.catteryState:
return (0, pixels_core_utils_1.safeAssign)(new EditConditionBatteryState_1.default(), data);
case pixels_core_animation_1.ConditionTypeValues.Idle:
case pixels_core_animation_1.ConditionTypeValues.idle:
return (0, pixels_core_utils_1.safeAssign)(new EditConditionIdle_1.default(), data);

@@ -105,3 +105,3 @@ default:

switch (act.type) {
case pixels_core_animation_1.ActionTypeValues.PlayAnimation:
case pixels_core_animation_1.ActionTypeValues.playAnimation:
return (0, pixels_core_utils_1.safeAssign)(new EditActionPlayAnimation_1.default(), {

@@ -112,3 +112,3 @@ animation: animations[(_a = data.animationIndex) !== null && _a !== void 0 ? _a : -1],

});
case pixels_core_animation_1.ActionTypeValues.PlayAudioClip:
case pixels_core_animation_1.ActionTypeValues.playAudioClip:
return (0, pixels_core_utils_1.safeAssign)(new EditActionPlayAudioClip_1.default(), {

@@ -145,3 +145,3 @@ clip: audioClips[(_b = data.audioClipIndex) !== null && _b !== void 0 ? _b : -1],

//TODO make those creations and assignments in a more generic way
case pixels_core_animation_1.AnimationTypeValues.Simple:
case pixels_core_animation_1.AnimationTypeValues.simple:
return new EditAnimationSimple_1.default({

@@ -155,3 +155,3 @@ name: data.name,

});
case pixels_core_animation_1.AnimationTypeValues.Rainbow:
case pixels_core_animation_1.AnimationTypeValues.rainbow:
return new EditAnimationRainbow_1.default({

@@ -165,3 +165,3 @@ name: data.name,

});
case pixels_core_animation_1.AnimationTypeValues.Keyframed:
case pixels_core_animation_1.AnimationTypeValues.keyframed:
return new EditAnimationKeyframed_1.default({

@@ -171,5 +171,5 @@ name: data.name,

pattern: patterns[(_a = data.patternIndex) !== null && _a !== void 0 ? _a : -1],
flowOrder: data.traveling,
travelingOrder: data.traveling,
});
case pixels_core_animation_1.AnimationTypeValues.GradientPattern:
case pixels_core_animation_1.AnimationTypeValues.gradientPattern:
return new EditAnimationGradientPattern_1.default({

@@ -182,3 +182,3 @@ name: data.name,

});
case pixels_core_animation_1.AnimationTypeValues.Gradient:
case pixels_core_animation_1.AnimationTypeValues.gradient:
return new EditAnimationGradient_1.default({

@@ -185,0 +185,0 @@ name: data.name,

@@ -6,5 +6,5 @@ import { enumValue } from "@systemic-games/pixels-core-utils";

export const ColorTypeValues = {
Rgb: enumValue(0),
Face: enumValue(),
Random: enumValue(),
rgb: enumValue(0),
face: enumValue(),
random: enumValue(),
};

@@ -0,9 +1,9 @@

function getMetadata(metadataKey, target) {
var _a;
return (_a = Reflect.getMetadata(metadataKey, target)) !== null && _a !== void 0 ? _a : [];
}
function addMetadata(metadataKey, target, metadata) {
const properties = Reflect.getMetadata(metadataKey, target);
if (properties) {
properties.push(metadata);
}
else {
Reflect.defineMetadata(metadataKey, [metadata], target);
}
// Always pass new array do defineMetadata
// so it doesn't pollute the parent object of the target
Reflect.defineMetadata(metadataKey, getMetadata(metadataKey, target).concat([metadata]), target);
}

@@ -16,7 +16,6 @@ function createDecorator(metadataKey, data) {

}
function getMetadata(metadataKey, target) {
var _a;
return (_a = Reflect.getMetadata(metadataKey, target)) !== null && _a !== void 0 ? _a : [];
}
const nameKey = Symbol("pixelAnimationName");
//
// Name property
//
const nameKey = Symbol("pixelEditAnimationName");
// Name decorator factory

@@ -30,3 +29,6 @@ export function name(name) {

}
const rangeKey = Symbol("pixelAnimationRange");
//
// Range property
//
const rangeKey = Symbol("pixelEditAnimationRange");
// Range decorator factory

@@ -44,12 +46,30 @@ export function range(min, max, step = 0) {

}
const unitKey = Symbol("pixelAnimationUnits");
// Units decorator factory
export function units(unit) {
//
// Unit property
//
const unitKey = Symbol("pixelEditAnimationUnit");
// Unit decorator factory
export function unit(unit) {
return createDecorator(unitKey, { unit });
}
// Get properties with a units decorator
export function getPropsWithUnits(target) {
// Get properties with a unit decorator
export function getPropsWithUnit(target) {
return getMetadata(unitKey, target);
}
const widgetKey = Symbol("pixelAnimationWidget");
//
// Values property
//
const valuesKey = Symbol("pixelEditAnimationValues");
// Unit decorator factory
export function values(values) {
return createDecorator(valuesKey, { values });
}
// Get properties with a values decorator
export function getPropsWithValues(target) {
return getMetadata(valuesKey, target);
}
//
// Widget property
//
const widgetKey = Symbol("pixelEditAnimationWidget");
// Widget decorator factory

@@ -63,3 +83,6 @@ export function widget(type) {

}
const displayOrderKey = Symbol("pixelAnimationDisplayOrder");
//
// Display Order property
//
const displayOrderKey = Symbol("pixelEditAnimationDisplayOrder");
// Display order decorator factory

@@ -73,3 +96,6 @@ export function displayOrder(index) {

}
const skipEnumKey = Symbol("pixelAnimationSkipEnum");
//
// Skip Enum property
//
const skipEnumKey = Symbol("pixelEditAnimationSkipEnum");
// Skip decorator

@@ -76,0 +102,0 @@ export function skipEnum(target, propertyKey) {

@@ -0,2 +1,3 @@

/** Base class for classes used to create and edit animations. */
export default class Editable {
}

@@ -19,3 +19,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

get type() {
return ActionTypeValues.PlayAnimation;
return ActionTypeValues.playAnimation;
}

@@ -22,0 +22,0 @@ toAction(editSet, _set) {

@@ -17,3 +17,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

get type() {
return ActionTypeValues.PlayAnimation;
return ActionTypeValues.playAnimation;
}

@@ -20,0 +20,0 @@ toAction(_editSet, _set) {

@@ -0,6 +1,17 @@

var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import Editable from "./Editable";
import { widget, range, unit, name } from "./decorators";
/**
* Base class for animation editing classes.
*/
export default class EditAnimation extends Editable {
constructor(name = "") {
constructor(name = "", duration = 0) {
super();
this.name = name;
this.duration = duration;
}

@@ -11,1 +22,8 @@ requiresPattern(_pattern) {

}
__decorate([
widget("slider"),
range(0.1, 30, 0.1),
unit("s"),
name("Duration")
/** Animation duration in seconds. */
], EditAnimation.prototype, "duration", void 0);

@@ -11,8 +11,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

import EditRgbTrack from "./EditRgbTrack";
import { widget, range, units, name } from "./decorators";
import { widget, range, name } from "./decorators";
export default class EditAnimationGradient extends EditAnimation {
constructor(options) {
var _a, _b;
super(options === null || options === void 0 ? void 0 : options.name);
this._duration = (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1;
super(options === null || options === void 0 ? void 0 : options.name, (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1);
this.faces = (_b = options === null || options === void 0 ? void 0 : options.faces) !== null && _b !== void 0 ? _b : Constants.faceMaskAllLEDs;

@@ -22,10 +21,4 @@ this.gradient = options === null || options === void 0 ? void 0 : options.gradient;

get type() {
return AnimationTypeValues.Gradient;
return AnimationTypeValues.gradient;
}
get duration() {
return this._duration;
}
set duration(value) {
this._duration = value;
}
toAnimation(editSet, bits) {

@@ -54,8 +47,2 @@ // Add gradient

__decorate([
widget("slider"),
range(0.1, 30, 0.1),
units("s"),
name("Duration")
], EditAnimationGradient.prototype, "duration", null);
__decorate([
widget("faceMask"),

@@ -62,0 +49,0 @@ range(0, 19, 1),

@@ -11,8 +11,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

import EditRgbTrack from "./EditRgbTrack";
import { widget, range, units, name } from "./decorators";
import { widget, name } from "./decorators";
export default class EditAnimationGradientPattern extends EditAnimation {
constructor(options) {
var _a, _b;
super(options === null || options === void 0 ? void 0 : options.name);
this._duration = (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1;
super(options === null || options === void 0 ? void 0 : options.name, (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1);
this.pattern = options === null || options === void 0 ? void 0 : options.pattern;

@@ -23,10 +22,4 @@ this.gradient = options === null || options === void 0 ? void 0 : options.gradient;

get type() {
return AnimationTypeValues.GradientPattern;
return AnimationTypeValues.gradientPattern;
}
get duration() {
return this._duration;
}
set duration(value) {
this._duration = value;
}
toAnimation(editSet, bits) {

@@ -46,3 +39,3 @@ var _a, _b;

gradientTrackOffset,
overrideWithFace: this.overrideWithFace ? 1 : 0,
overrideWithFace: this.overrideWithFace,
});

@@ -67,8 +60,2 @@ }

__decorate([
widget("slider"),
range(0.1, 30, 0.1),
units("s"),
name("Duration")
], EditAnimationGradientPattern.prototype, "duration", null);
__decorate([
widget("grayscalePattern"),

@@ -82,3 +69,4 @@ name("LED Pattern")

__decorate([
widget("toggle"),
name("Override color based on face")
], EditAnimationGradientPattern.prototype, "overrideWithFace", void 0);

@@ -10,20 +10,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

import EditAnimation from "./EditAnimation";
import { widget, range, units, name } from "./decorators";
import { name, widget } from "./decorators";
export default class EditAnimationKeyframed extends EditAnimation {
constructor(options) {
var _a, _b;
super(options === null || options === void 0 ? void 0 : options.name);
this._duration = (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1;
super(options === null || options === void 0 ? void 0 : options.name, (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1);
this.pattern = options === null || options === void 0 ? void 0 : options.pattern;
this.flowOrder = (_b = options === null || options === void 0 ? void 0 : options.flowOrder) !== null && _b !== void 0 ? _b : false;
this.travelingOrder = (_b = options === null || options === void 0 ? void 0 : options.travelingOrder) !== null && _b !== void 0 ? _b : false;
}
get type() {
return AnimationTypeValues.Keyframed;
return AnimationTypeValues.keyframed;
}
get duration() {
return this._duration;
}
set duration(value) {
this._duration = value;
}
toAnimation(editSet, _bits) {

@@ -35,3 +28,3 @@ var _a, _b;

trackCount: (_b = (_a = this.pattern) === null || _a === void 0 ? void 0 : _a.gradients.length) !== null && _b !== void 0 ? _b : 0,
flowOrder: this.flowOrder ? 1 : 0,
flowOrder: this.travelingOrder ? 1 : 0,
});

@@ -44,3 +37,3 @@ }

pattern: this.pattern,
flowOrder: this.flowOrder,
travelingOrder: this.travelingOrder,
});

@@ -55,8 +48,2 @@ }

__decorate([
widget("slider"),
range(0.1, 30, 0.1),
units("s"),
name("Duration")
], EditAnimationKeyframed.prototype, "duration", null);
__decorate([
widget("rgbPattern"),

@@ -66,3 +53,4 @@ name("LED Pattern")

__decorate([
widget("toggle"),
name("Traveling Order")
], EditAnimationKeyframed.prototype, "flowOrder", void 0);
], EditAnimationKeyframed.prototype, "travelingOrder", void 0);

@@ -11,8 +11,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

import EditRgbTrack from "./EditRgbTrack";
import { widget, range, units, name } from "./decorators";
import { widget, range, name } from "./decorators";
export default class EditAnimationNoise extends EditAnimation {
constructor(options) {
var _a, _b, _c, _d, _e;
super(options === null || options === void 0 ? void 0 : options.name);
this._duration = (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1;
super(options === null || options === void 0 ? void 0 : options.name, (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1);
this.gradient = options === null || options === void 0 ? void 0 : options.gradient;

@@ -26,10 +25,4 @@ this.faces = (_b = options === null || options === void 0 ? void 0 : options.faces) !== null && _b !== void 0 ? _b : Constants.faceMaskAllLEDs;

get type() {
return AnimationTypeValues.Noise;
return AnimationTypeValues.noise;
}
get duration() {
return this._duration;
}
set duration(value) {
this._duration = value;
}
toAnimation(editSet, bits) {

@@ -70,8 +63,2 @@ // Add gradient

__decorate([
widget("slider"),
range(0.1, 30, 0.1),
units("s"),
name("Duration")
], EditAnimationNoise.prototype, "duration", null);
__decorate([
widget("gradient"),

@@ -78,0 +65,0 @@ name("Overall Gradient")

@@ -10,8 +10,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

import EditAnimation from "./EditAnimation";
import { widget, range, units, name } from "./decorators";
import { widget, range, name } from "./decorators";
export default class EditAnimationRainbow extends EditAnimation {
constructor(options) {
var _a, _b, _c, _d, _e;
super(options === null || options === void 0 ? void 0 : options.name);
this._duration = (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1;
super(options === null || options === void 0 ? void 0 : options.name, (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1);
this.faces = (_b = options === null || options === void 0 ? void 0 : options.faces) !== null && _b !== void 0 ? _b : Constants.faceMaskAllLEDs;

@@ -23,10 +22,4 @@ this.count = (_c = options === null || options === void 0 ? void 0 : options.count) !== null && _c !== void 0 ? _c : 1;

get type() {
return AnimationTypeValues.Rainbow;
return AnimationTypeValues.rainbow;
}
get duration() {
return this._duration;
}
set duration(value) {
this._duration = value;
}
toAnimation(_editSet, _bits) {

@@ -38,3 +31,3 @@ return safeAssign(new AnimationRainbow(), {

count: this.count,
traveling: this.traveling ? 1 : 0,
traveling: this.traveling,
});

@@ -45,3 +38,3 @@ }

name: this.name,
duration: this._duration,
duration: this.duration,
faces: this.faces,

@@ -55,8 +48,2 @@ fade: this.fade,

__decorate([
widget("slider"),
range(0.1, 30, 0.1),
units("s"),
name("Duration")
], EditAnimationRainbow.prototype, "duration", null);
__decorate([
widget("faceMask"),

@@ -67,3 +54,3 @@ range(0, 19, 1),

__decorate([
widget("index"),
widget("count"),
range(1, 10, 1),

@@ -78,3 +65,4 @@ name("Repeat Count")

__decorate([
widget("toggle"),
name("Traveling Order")
], EditAnimationRainbow.prototype, "traveling", void 0);

@@ -11,9 +11,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

import EditColor from "./EditColor";
import { widget, range, units, name } from "./decorators";
import { widget, range, name } from "./decorators";
export default class EditAnimationSimple extends EditAnimation {
constructor(options) {
var _a, _b, _c, _d, _e;
super(options === null || options === void 0 ? void 0 : options.name);
const color = (_a = options === null || options === void 0 ? void 0 : options.color) !== null && _a !== void 0 ? _a : Color.red;
this._duration = (_b = options === null || options === void 0 ? void 0 : options.duration) !== null && _b !== void 0 ? _b : 1;
super(options === null || options === void 0 ? void 0 : options.name, (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1);
const color = (_b = options === null || options === void 0 ? void 0 : options.color) !== null && _b !== void 0 ? _b : Color.red;
this.faces = (_c = options === null || options === void 0 ? void 0 : options.faces) !== null && _c !== void 0 ? _c : Constants.faceMaskAllLEDs;

@@ -25,10 +24,4 @@ this.color = color instanceof Color ? EditColor.fromColor(color) : color;

get type() {
return AnimationTypeValues.Simple;
return AnimationTypeValues.simple;
}
get duration() {
return this._duration;
}
set duration(value) {
this._duration = value;
}
toAnimation(editSet, bits) {

@@ -54,8 +47,2 @@ return safeAssign(new AnimationSimple(), {

__decorate([
widget("slider"),
range(0.1, 30, 0),
units("s"),
name("Duration")
], EditAnimationSimple.prototype, "duration", null);
__decorate([
widget("faceMask"),

@@ -66,6 +53,7 @@ range(0, 19, 1),

__decorate([
widget("color"),
name("Color")
], EditAnimationSimple.prototype, "color", void 0);
__decorate([
widget("index"),
widget("count"),
range(1, 10, 1),

@@ -72,0 +60,0 @@ name("Repeat Count")

@@ -1,6 +0,6 @@

import { Constants, Color, gamma } from "@systemic-games/pixels-core-animation";
import { Constants, Color, GammaUtils, } from "@systemic-games/pixels-core-animation";
import { ColorTypeValues } from "./ColorType";
import Editable from "./Editable";
export default class EditColor extends Editable {
constructor(type = ColorTypeValues.Rgb, color = Color.black) {
constructor(type = ColorTypeValues.rgb, color = Color.black) {
super();

@@ -11,11 +11,11 @@ this.type = type;

static fromColor(color) {
return new EditColor(ColorTypeValues.Rgb, color);
return new EditColor(ColorTypeValues.rgb, color);
}
toColorIndex(refPalette) {
switch (this.type) {
case ColorTypeValues.Rgb:
case ColorTypeValues.rgb:
return EditColor.toColorIndex(refPalette, this.color);
case ColorTypeValues.Face:
case ColorTypeValues.face:
return Constants.paletteColorFromFace;
case ColorTypeValues.Random:
case ColorTypeValues.random:
return Constants.paletteColorFromRandom;

@@ -27,3 +27,3 @@ default:

static toColorIndex(refPalette, color) {
const colorGamma = gamma(color);
const colorGamma = GammaUtils.gamma(color);
let colorIndex = refPalette.findIndex((c) => colorGamma.equals(c));

@@ -30,0 +30,0 @@ if (colorIndex === -1) {

@@ -7,6 +7,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

};
import { ConditionTypeValues, ConditionBatteryState, } from "@systemic-games/pixels-core-animation";
import { ConditionTypeValues, ConditionBatteryState, BatteryStateFlagsValues, } from "@systemic-games/pixels-core-animation";
import { safeAssign } from "@systemic-games/pixels-core-utils";
import EditCondition from "./EditCondition";
import { name, widget, range, units } from "./decorators";
import { name, widget, range, unit, values } from "./decorators";
export default class EditConditionBatteryState extends EditCondition {

@@ -19,3 +19,3 @@ constructor(flags = 0, recheckAfter = 1) {

get type() {
return ConditionTypeValues.BatteryState;
return ConditionTypeValues.catteryState;
}

@@ -33,4 +33,5 @@ toCondition(_editSet, _set) {

__decorate([
widget("bitfield"),
name("Battery State")
widget("bitField"),
name("Battery State"),
values(BatteryStateFlagsValues)
], EditConditionBatteryState.prototype, "flags", void 0);

@@ -40,3 +41,3 @@ __decorate([

range(5, 60),
units("s")
unit("s")
], EditConditionBatteryState.prototype, "recheckAfter", void 0);

@@ -7,6 +7,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

};
import { ConditionTypeValues, ConditionConnectionState, } from "@systemic-games/pixels-core-animation";
import { ConditionTypeValues, ConditionConnectionState, ConnectionStateFlagsValues, } from "@systemic-games/pixels-core-animation";
import { safeAssign } from "@systemic-games/pixels-core-utils";
import EditCondition from "./EditCondition";
import { name, widget } from "./decorators";
import { name, values, widget } from "./decorators";
export default class EditConditionConnectionState extends EditCondition {

@@ -18,3 +18,3 @@ constructor(flags = 0) {

get type() {
return ConditionTypeValues.ConnectionState;
return ConditionTypeValues.connectionState;
}

@@ -31,4 +31,5 @@ toCondition(_editSet, _set) {

__decorate([
widget("bitfield"),
name("Connection Event")
widget("bitField"),
name("Connection Event"),
values(ConnectionStateFlagsValues)
], EditConditionConnectionState.prototype, "flags", void 0);

@@ -5,3 +5,3 @@ import { ConditionTypeValues, ConditionCrooked, } from "@systemic-games/pixels-core-animation";

get type() {
return ConditionTypeValues.Crooked;
return ConditionTypeValues.crooked;
}

@@ -8,0 +8,0 @@ toCondition(_editSet, _set) {

@@ -7,6 +7,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

};
import { ConditionTypeValues, ConditionFaceCompare, } from "@systemic-games/pixels-core-animation";
import { ConditionTypeValues, ConditionFaceCompare, FaceCompareFlagsValues, } from "@systemic-games/pixels-core-animation";
import { safeAssign } from "@systemic-games/pixels-core-utils";
import EditCondition from "./EditCondition";
import { name, range, widget } from "./decorators";
import { name, range, values, widget } from "./decorators";
export default class EditConditionFaceCompare extends EditCondition {

@@ -19,3 +19,3 @@ constructor(flags = 0, faceIndex = 0) {

get type() {
return ConditionTypeValues.FaceCompare;
return ConditionTypeValues.faceCompare;
}

@@ -33,4 +33,5 @@ toCondition(_editSet, _set) {

__decorate([
widget("bitfield"),
name("Comparison")
widget("bitField"),
name("Comparison"),
values(FaceCompareFlagsValues)
], EditConditionFaceCompare.prototype, "flags", void 0);

@@ -37,0 +38,0 @@ __decorate([

@@ -5,3 +5,3 @@ import { ConditionTypeValues, ConditionHandling, } from "@systemic-games/pixels-core-animation";

get type() {
return ConditionTypeValues.Handling;
return ConditionTypeValues.handling;
}

@@ -8,0 +8,0 @@ toCondition(_editSet, _set) {

@@ -7,6 +7,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

};
import { ConditionTypeValues, ConditionHelloGoodbye, } from "@systemic-games/pixels-core-animation";
import { ConditionTypeValues, ConditionHelloGoodbye, HelloGoodbyeFlagsValues, } from "@systemic-games/pixels-core-animation";
import { safeAssign } from "@systemic-games/pixels-core-utils";
import EditCondition from "./EditCondition";
import { name, widget } from "./decorators";
import { name, values, widget } from "./decorators";
export default class EditConditionHelloGoodbye extends EditCondition {

@@ -18,3 +18,3 @@ constructor(flags = 0) {

get type() {
return ConditionTypeValues.HelloGoodbye;
return ConditionTypeValues.helloGoodbye;
}

@@ -31,4 +31,5 @@ toCondition(_editSet, _set) {

__decorate([
widget("bitfield"),
name("Hello / Goodbye")
widget("bitField"),
name("Hello / Goodbye"),
values(HelloGoodbyeFlagsValues)
], EditConditionHelloGoodbye.prototype, "flags", void 0);

@@ -10,3 +10,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

import EditCondition from "./EditCondition";
import { range, units, widget } from "./decorators";
import { range, unit, widget } from "./decorators";
export default class EditConditionIdle extends EditCondition {

@@ -18,3 +18,3 @@ constructor(period = 10) {

get type() {
return ConditionTypeValues.Idle;
return ConditionTypeValues.idle;
}

@@ -33,3 +33,3 @@ toCondition(_editSet, _set) {

range(0.5, 30, 0.5),
units("s")
unit("s")
], EditConditionIdle.prototype, "period", void 0);

@@ -10,3 +10,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

import EditCondition from "./EditCondition";
import { range, units, widget } from "./decorators";
import { range, unit, widget } from "./decorators";
export default class EditConditionRolling extends EditCondition {

@@ -18,3 +18,3 @@ constructor(recheckAfter = 1) {

get type() {
return ConditionTypeValues.Rolling;
return ConditionTypeValues.rolling;
}

@@ -33,3 +33,3 @@ toCondition(_editSet, _set) {

range(0.5, 5, 0.1),
units("s")
unit("s")
], EditConditionRolling.prototype, "recheckAfter", void 0);

@@ -1,37 +0,6 @@

import AppDataSet from "./AppDataSet";
import { ColorTypeValues } from "./edit/ColorType";
import EditAction from "./edit/EditAction";
import EditActionPlayAnimation from "./edit/EditActionPlayAnimation";
import EditActionPlayAudioClip from "./edit/EditActionPlayAudioClip";
import EditAnimation from "./edit/EditAnimation";
import EditAnimationGradient from "./edit/EditAnimationGradient";
import EditAnimationGradientPattern from "./edit/EditAnimationGradientPattern";
import EditAnimationKeyframed from "./edit/EditAnimationKeyframed";
import EditAnimationNoise from "./edit/EditAnimationNoise";
import EditAnimationRainbow from "./edit/EditAnimationRainbow";
import EditAnimationSimple from "./edit/EditAnimationSimple";
import EditAudioClip from "./edit/EditAudioClip";
import EditColor from "./edit/EditColor";
import EditCondition from "./edit/EditCondition";
import EditConditionBatteryState from "./edit/EditConditionBatteryState";
import EditConditionConnectionState from "./edit/EditConditionConnectionState";
import EditConditionCrooked from "./edit/EditConditionCrooked";
import EditConditionFaceCompare from "./edit/EditConditionFaceCompare";
import EditConditionHandling from "./edit/EditConditionHandling";
import EditConditionHelloGoodbye from "./edit/EditConditionHelloGoodbye";
import EditConditionIdle from "./edit/EditConditionIdle";
import EditConditionRolling from "./edit/EditConditionRolling";
import EditDataSet from "./edit/EditDataSet";
import EditPattern from "./edit/EditPattern";
import EditProfile from "./edit/EditProfile";
import EditRgbGradient from "./edit/EditRgbGradient";
import EditRgbKeyframe from "./edit/EditRgbKeyframe";
import EditRgbTrack from "./edit/EditRgbTrack";
import EditRule from "./edit/EditRule";
import Editable from "./edit/Editable";
import { name, getPropsWithName, range, getPropsWithRange, units, getPropsWithUnits, widget, getPropsWithWidget, displayOrder, getPropsWithDisplayOrder, skipEnum, getPropsWithSkipEnum, } from "./edit/decorators";
import loadAppDataSet from "./loadAppDataSet";
export { ColorTypeValues, Editable, EditAction, EditActionPlayAnimation, EditActionPlayAudioClip, EditAnimation, EditAnimationGradient, EditAnimationGradientPattern, EditAnimationKeyframed, EditAnimationNoise, EditAnimationRainbow, EditAnimationSimple, EditAudioClip, EditColor, EditCondition, EditConditionBatteryState, EditConditionConnectionState, EditConditionCrooked, EditConditionFaceCompare, EditConditionHandling, EditConditionHelloGoodbye, EditConditionIdle, EditConditionRolling, EditDataSet, EditPattern, EditProfile, EditRgbGradient, EditRgbKeyframe, EditRgbTrack, EditRule, };
export { name, getPropsWithName, range, getPropsWithRange, units, getPropsWithUnits, widget, getPropsWithWidget, displayOrder, getPropsWithDisplayOrder, skipEnum, getPropsWithSkipEnum, };
export { AppDataSet };
export { loadAppDataSet, };
export { default as AppDataSet } from "./AppDataSet";
export { default as loadAppDataSet } from "./loadAppDataSet";
export * from "./getEditWidgetsData";
export { default as getEditWidgetsData } from "./getEditWidgetsData";
export * as Json from "./jsonTypes";
export * from "./edit";

@@ -43,5 +43,5 @@ import { AnimationTypeValues, ActionTypeValues, ConditionTypeValues, Color, } from "@systemic-games/pixels-core-animation";

switch (color.type) {
case ColorTypeValues.Rgb:
case ColorTypeValues.Face:
case ColorTypeValues.Random:
case ColorTypeValues.rgb:
case ColorTypeValues.face:
case ColorTypeValues.random:
c.type = color.type;

@@ -70,17 +70,17 @@ break;

switch (condition.type) {
case ConditionTypeValues.HelloGoodbye:
case ConditionTypeValues.helloGoodbye:
return safeAssign(new EditConditionHelloGoodbye(), data);
case ConditionTypeValues.Handling:
case ConditionTypeValues.handling:
return new EditConditionHandling();
case ConditionTypeValues.Rolling:
case ConditionTypeValues.rolling:
return safeAssign(new EditConditionRolling(), data);
case ConditionTypeValues.FaceCompare:
case ConditionTypeValues.faceCompare:
return safeAssign(new EditConditionFaceCompare(), data);
case ConditionTypeValues.Crooked:
case ConditionTypeValues.crooked:
return new EditConditionCrooked();
case ConditionTypeValues.ConnectionState:
case ConditionTypeValues.connectionState:
return safeAssign(new EditConditionConnectionState(), data);
case ConditionTypeValues.BatteryState:
case ConditionTypeValues.catteryState:
return safeAssign(new EditConditionBatteryState(), data);
case ConditionTypeValues.Idle:
case ConditionTypeValues.idle:
return safeAssign(new EditConditionIdle(), data);

@@ -100,3 +100,3 @@ default:

switch (act.type) {
case ActionTypeValues.PlayAnimation:
case ActionTypeValues.playAnimation:
return safeAssign(new EditActionPlayAnimation(), {

@@ -107,3 +107,3 @@ animation: animations[(_a = data.animationIndex) !== null && _a !== void 0 ? _a : -1],

});
case ActionTypeValues.PlayAudioClip:
case ActionTypeValues.playAudioClip:
return safeAssign(new EditActionPlayAudioClip(), {

@@ -140,3 +140,3 @@ clip: audioClips[(_b = data.audioClipIndex) !== null && _b !== void 0 ? _b : -1],

//TODO make those creations and assignments in a more generic way
case AnimationTypeValues.Simple:
case AnimationTypeValues.simple:
return new EditAnimationSimple({

@@ -150,3 +150,3 @@ name: data.name,

});
case AnimationTypeValues.Rainbow:
case AnimationTypeValues.rainbow:
return new EditAnimationRainbow({

@@ -160,3 +160,3 @@ name: data.name,

});
case AnimationTypeValues.Keyframed:
case AnimationTypeValues.keyframed:
return new EditAnimationKeyframed({

@@ -166,5 +166,5 @@ name: data.name,

pattern: patterns[(_a = data.patternIndex) !== null && _a !== void 0 ? _a : -1],
flowOrder: data.traveling,
travelingOrder: data.traveling,
});
case AnimationTypeValues.GradientPattern:
case AnimationTypeValues.gradientPattern:
return new EditAnimationGradientPattern({

@@ -177,3 +177,3 @@ name: data.name,

});
case AnimationTypeValues.Gradient:
case AnimationTypeValues.gradient:
return new EditAnimationGradient({

@@ -180,0 +180,0 @@ name: data.name,

@@ -5,5 +5,5 @@ /**

export declare const ColorTypeValues: {
readonly Rgb: number;
readonly Face: number;
readonly Random: number;
readonly rgb: number;
readonly face: number;
readonly random: number;
};

@@ -10,0 +10,0 @@ /**

@@ -16,9 +16,17 @@ export interface PropertyData {

export declare function getPropsWithRange(target: object): RangeProperty[];
export declare type UnitsType = "s" | "ms";
export interface UnitsProperty extends PropertyData {
unit: UnitsType;
export declare type UnitType = "s" | "ms";
export interface UnitProperty extends PropertyData {
unit: UnitType;
}
export declare function units(unit: UnitsType): (target: object, propertyKey: string) => void;
export declare function getPropsWithUnits(target: object): UnitsProperty[];
export declare type WidgetType = "faceMask" | "index" | "slider" | "gradient" | "grayscalePattern" | "rgbPattern" | "faceIndex" | "playbackFace" | "bitfield";
export declare function unit(unit: UnitType): (target: object, propertyKey: string) => void;
export declare function getPropsWithUnit(target: object): UnitProperty[];
export declare type ValuesType = {
[key: string]: number;
};
export interface ValuesProperty extends PropertyData {
values: ValuesType;
}
export declare function values(values: ValuesType): (target: object, propertyKey: string) => void;
export declare function getPropsWithValues(target: object): ValuesProperty[];
export declare type WidgetType = "toggle" | "count" | "slider" | "faceMask" | "faceIndex" | "playbackFace" | "bitField" | "color" | "gradient" | "grayscalePattern" | "rgbPattern";
export interface WidgetProperty extends PropertyData {

@@ -25,0 +33,0 @@ type: WidgetType;

@@ -0,3 +1,4 @@

/** Base class for classes used to create and edit animations. */
export default abstract class Editable {
}
//# sourceMappingURL=Editable.d.ts.map

@@ -5,8 +5,13 @@ import { AnimationType, AnimationBits, AnimationPreset } from "@systemic-games/pixels-core-animation";

import Editable from "./Editable";
/**
* Base class for animation editing classes.
*/
export default abstract class EditAnimation extends Editable {
/** The animation name. */
name: string;
/** The animation type (constant). */
abstract get type(): AnimationType;
abstract get duration(): number;
abstract set duration(value: number);
constructor(name?: string);
/** Animation duration in seconds. */
duration: number;
constructor(name?: string, duration?: number);
abstract toAnimation(editSet: EditDataSet, bits: AnimationBits): AnimationPreset;

@@ -13,0 +18,0 @@ abstract duplicate(): EditAnimation;

@@ -6,6 +6,3 @@ import { AnimationType, AnimationBits, AnimationPreset } from "@systemic-games/pixels-core-animation";

export default class EditAnimationGradient extends EditAnimation {
private _duration;
get type(): AnimationType;
get duration(): number;
set duration(value: number);
faces: number;

@@ -12,0 +9,0 @@ gradient?: EditRgbGradient;

@@ -7,6 +7,3 @@ import { AnimationType, AnimationBits, AnimationPreset } from "@systemic-games/pixels-core-animation";

export default class EditAnimationGradientPattern extends EditAnimation {
private _duration;
get type(): AnimationType;
get duration(): number;
set duration(value: number);
pattern?: EditPattern;

@@ -13,0 +10,0 @@ gradient?: EditRgbGradient;

@@ -6,8 +6,5 @@ import { AnimationType, AnimationBits, AnimationPreset } from "@systemic-games/pixels-core-animation";

export default class EditAnimationKeyframed extends EditAnimation {
private _duration;
get type(): AnimationType;
get duration(): number;
set duration(value: number);
pattern?: EditPattern;
flowOrder: boolean;
travelingOrder: boolean;
constructor(options?: {

@@ -17,3 +14,3 @@ name?: string;

pattern?: EditPattern;
flowOrder?: boolean;
travelingOrder?: boolean;
});

@@ -20,0 +17,0 @@ toAnimation(editSet: EditDataSet, _bits: AnimationBits): AnimationPreset;

@@ -6,6 +6,3 @@ import { AnimationType, AnimationBits, AnimationPreset } from "@systemic-games/pixels-core-animation";

export default class EditAnimationNoise extends EditAnimation {
private _duration;
get type(): AnimationType;
get duration(): number;
set duration(value: number);
gradient?: EditRgbGradient;

@@ -12,0 +9,0 @@ faces: number;

@@ -5,6 +5,3 @@ import { AnimationType, AnimationBits, AnimationPreset } from "@systemic-games/pixels-core-animation";

export default class EditAnimationRainbow extends EditAnimation {
private _duration;
get type(): AnimationType;
get duration(): number;
set duration(value: number);
faces: number;

@@ -11,0 +8,0 @@ count: number;

@@ -6,6 +6,3 @@ import { AnimationType, AnimationBits, AnimationPreset, Color } from "@systemic-games/pixels-core-animation";

export default class EditAnimationSimple extends EditAnimation {
private _duration;
get type(): AnimationType;
get duration(): number;
set duration(value: number);
faces: number;

@@ -12,0 +9,0 @@ color: EditColor;

@@ -1,38 +0,7 @@

import AppDataSet from "./AppDataSet";
import { ColorTypeValues, type ColorType } from "./edit/ColorType";
import EditAction from "./edit/EditAction";
import EditActionPlayAnimation from "./edit/EditActionPlayAnimation";
import EditActionPlayAudioClip from "./edit/EditActionPlayAudioClip";
import EditAnimation from "./edit/EditAnimation";
import EditAnimationGradient from "./edit/EditAnimationGradient";
import EditAnimationGradientPattern from "./edit/EditAnimationGradientPattern";
import EditAnimationKeyframed from "./edit/EditAnimationKeyframed";
import EditAnimationNoise from "./edit/EditAnimationNoise";
import EditAnimationRainbow from "./edit/EditAnimationRainbow";
import EditAnimationSimple from "./edit/EditAnimationSimple";
import EditAudioClip from "./edit/EditAudioClip";
import EditColor from "./edit/EditColor";
import EditCondition from "./edit/EditCondition";
import EditConditionBatteryState from "./edit/EditConditionBatteryState";
import EditConditionConnectionState from "./edit/EditConditionConnectionState";
import EditConditionCrooked from "./edit/EditConditionCrooked";
import EditConditionFaceCompare from "./edit/EditConditionFaceCompare";
import EditConditionHandling from "./edit/EditConditionHandling";
import EditConditionHelloGoodbye from "./edit/EditConditionHelloGoodbye";
import EditConditionIdle from "./edit/EditConditionIdle";
import EditConditionRolling from "./edit/EditConditionRolling";
import EditDataSet from "./edit/EditDataSet";
import EditPattern from "./edit/EditPattern";
import EditProfile from "./edit/EditProfile";
import EditRgbGradient from "./edit/EditRgbGradient";
import EditRgbKeyframe from "./edit/EditRgbKeyframe";
import EditRgbTrack from "./edit/EditRgbTrack";
import EditRule from "./edit/EditRule";
import Editable from "./edit/Editable";
import { PropertyData, NameProperty, name, getPropsWithName, RangeProperty, range, getPropsWithRange, type UnitsType, UnitsProperty, units, getPropsWithUnits, type WidgetType, WidgetProperty, widget, getPropsWithWidget, DisplayOrderProperty, displayOrder, getPropsWithDisplayOrder, skipEnum, getPropsWithSkipEnum } from "./edit/decorators";
import loadAppDataSet, { JsonRgbColor, JsonKeyframe, JsonGradient, JsonPattern, JsonAudioClip, JsonPreviewSettings, JsonColor, JsonAnimationData, JsonAnimation, JsonConditionData, JsonCondition, JsonActionData, JsonAction, JsonRule, JsonProfile, JsonDataSet } from "./loadAppDataSet";
export { ColorTypeValues, type ColorType, Editable, EditAction, EditActionPlayAnimation, EditActionPlayAudioClip, EditAnimation, EditAnimationGradient, EditAnimationGradientPattern, EditAnimationKeyframed, EditAnimationNoise, EditAnimationRainbow, EditAnimationSimple, EditAudioClip, EditColor, EditCondition, EditConditionBatteryState, EditConditionConnectionState, EditConditionCrooked, EditConditionFaceCompare, EditConditionHandling, EditConditionHelloGoodbye, EditConditionIdle, EditConditionRolling, EditDataSet, EditPattern, EditProfile, EditRgbGradient, EditRgbKeyframe, EditRgbTrack, EditRule, };
export { PropertyData, NameProperty, name, getPropsWithName, RangeProperty, range, getPropsWithRange, type UnitsType, UnitsProperty, units, getPropsWithUnits, type WidgetType, WidgetProperty, widget, getPropsWithWidget, DisplayOrderProperty, displayOrder, getPropsWithDisplayOrder, skipEnum, getPropsWithSkipEnum, };
export { AppDataSet };
export { loadAppDataSet, JsonRgbColor, JsonKeyframe, JsonGradient, JsonPattern, JsonAudioClip, JsonPreviewSettings, JsonColor, JsonAnimationData, JsonAnimation, JsonConditionData, JsonCondition, JsonActionData, JsonAction, JsonRule, JsonProfile, JsonDataSet, };
export { default as AppDataSet } from "./AppDataSet";
export { default as loadAppDataSet } from "./loadAppDataSet";
export * from "./getEditWidgetsData";
export { default as getEditWidgetsData } from "./getEditWidgetsData";
export * as Json from "./jsonTypes";
export * from "./edit";
//# sourceMappingURL=index.d.ts.map
import AppDataSet from "./AppDataSet";
export interface JsonRgbColor {
r?: number;
g?: number;
b?: number;
}
export interface JsonKeyframe {
time?: number;
color?: JsonRgbColor;
}
export interface JsonGradient {
keyframes?: JsonKeyframe[];
}
export interface JsonPattern {
name?: string;
gradients?: JsonGradient[];
}
export interface JsonAudioClip {
name?: string;
id?: number;
}
export interface JsonPreviewSettings {
design?: number;
}
export interface JsonColor {
type: number;
rgbColor: JsonRgbColor;
}
export interface JsonAnimationData {
name?: string;
duration?: number;
count?: number;
fade?: number;
faces?: number;
patternIndex?: number;
traveling?: boolean;
overrideWithFace?: boolean;
color?: JsonColor;
gradient?: JsonGradient;
defaultPreviewSettings?: JsonPreviewSettings;
}
export interface JsonAnimation {
type?: number;
data?: JsonAnimationData;
}
export interface JsonConditionData {
flags?: number;
faceIndex?: number;
recheckAfter?: number;
period?: number;
}
export interface JsonCondition {
type?: number;
data?: JsonConditionData;
}
export interface JsonActionData {
animationIndex?: number;
faceIndex?: number;
loopCount?: number;
audioClipIndex?: number;
}
export interface JsonAction {
type?: number;
data?: JsonActionData;
}
export interface JsonRule {
condition?: JsonCondition;
actions?: JsonAction[];
}
export interface JsonProfile {
name?: string | null;
description?: string | null;
rules?: JsonRule[];
defaultPreviewSettings?: JsonPreviewSettings;
}
export interface JsonDataSet {
jsonVersion?: number;
patterns?: JsonPattern[];
animations?: JsonAnimation[];
audioClips?: JsonAudioClip[];
behaviors?: JsonProfile[];
defaultBehavior?: JsonProfile;
}
export default function (jsonData: JsonDataSet): AppDataSet;
import * as Json from "./jsonTypes";
export default function (jsonData: Json.DataSet): AppDataSet;
//# sourceMappingURL=loadAppDataSet.d.ts.map

@@ -5,5 +5,5 @@ /**

export declare const ColorTypeValues: {
readonly Rgb: number;
readonly Face: number;
readonly Random: number;
readonly rgb: number;
readonly face: number;
readonly random: number;
};

@@ -10,0 +10,0 @@ /**

@@ -16,9 +16,17 @@ export interface PropertyData {

export declare function getPropsWithRange(target: object): RangeProperty[];
export declare type UnitsType = "s" | "ms";
export interface UnitsProperty extends PropertyData {
unit: UnitsType;
export declare type UnitType = "s" | "ms";
export interface UnitProperty extends PropertyData {
unit: UnitType;
}
export declare function units(unit: UnitsType): (target: object, propertyKey: string) => void;
export declare function getPropsWithUnits(target: object): UnitsProperty[];
export declare type WidgetType = "faceMask" | "index" | "slider" | "gradient" | "grayscalePattern" | "rgbPattern" | "faceIndex" | "playbackFace" | "bitfield";
export declare function unit(unit: UnitType): (target: object, propertyKey: string) => void;
export declare function getPropsWithUnit(target: object): UnitProperty[];
export declare type ValuesType = {
[key: string]: number;
};
export interface ValuesProperty extends PropertyData {
values: ValuesType;
}
export declare function values(values: ValuesType): (target: object, propertyKey: string) => void;
export declare function getPropsWithValues(target: object): ValuesProperty[];
export declare type WidgetType = "toggle" | "count" | "slider" | "faceMask" | "faceIndex" | "playbackFace" | "bitField" | "color" | "gradient" | "grayscalePattern" | "rgbPattern";
export interface WidgetProperty extends PropertyData {

@@ -25,0 +33,0 @@ type: WidgetType;

@@ -0,3 +1,4 @@

/** Base class for classes used to create and edit animations. */
export default abstract class Editable {
}
//# sourceMappingURL=Editable.d.ts.map

@@ -5,8 +5,13 @@ import { AnimationType, AnimationBits, AnimationPreset } from "@systemic-games/pixels-core-animation";

import Editable from "./Editable";
/**
* Base class for animation editing classes.
*/
export default abstract class EditAnimation extends Editable {
/** The animation name. */
name: string;
/** The animation type (constant). */
abstract get type(): AnimationType;
abstract get duration(): number;
abstract set duration(value: number);
constructor(name?: string);
/** Animation duration in seconds. */
duration: number;
constructor(name?: string, duration?: number);
abstract toAnimation(editSet: EditDataSet, bits: AnimationBits): AnimationPreset;

@@ -13,0 +18,0 @@ abstract duplicate(): EditAnimation;

@@ -6,6 +6,3 @@ import { AnimationType, AnimationBits, AnimationPreset } from "@systemic-games/pixels-core-animation";

export default class EditAnimationGradient extends EditAnimation {
private _duration;
get type(): AnimationType;
get duration(): number;
set duration(value: number);
faces: number;

@@ -12,0 +9,0 @@ gradient?: EditRgbGradient;

@@ -7,6 +7,3 @@ import { AnimationType, AnimationBits, AnimationPreset } from "@systemic-games/pixels-core-animation";

export default class EditAnimationGradientPattern extends EditAnimation {
private _duration;
get type(): AnimationType;
get duration(): number;
set duration(value: number);
pattern?: EditPattern;

@@ -13,0 +10,0 @@ gradient?: EditRgbGradient;

@@ -6,8 +6,5 @@ import { AnimationType, AnimationBits, AnimationPreset } from "@systemic-games/pixels-core-animation";

export default class EditAnimationKeyframed extends EditAnimation {
private _duration;
get type(): AnimationType;
get duration(): number;
set duration(value: number);
pattern?: EditPattern;
flowOrder: boolean;
travelingOrder: boolean;
constructor(options?: {

@@ -17,3 +14,3 @@ name?: string;

pattern?: EditPattern;
flowOrder?: boolean;
travelingOrder?: boolean;
});

@@ -20,0 +17,0 @@ toAnimation(editSet: EditDataSet, _bits: AnimationBits): AnimationPreset;

@@ -6,6 +6,3 @@ import { AnimationType, AnimationBits, AnimationPreset } from "@systemic-games/pixels-core-animation";

export default class EditAnimationNoise extends EditAnimation {
private _duration;
get type(): AnimationType;
get duration(): number;
set duration(value: number);
gradient?: EditRgbGradient;

@@ -12,0 +9,0 @@ faces: number;

@@ -5,6 +5,3 @@ import { AnimationType, AnimationBits, AnimationPreset } from "@systemic-games/pixels-core-animation";

export default class EditAnimationRainbow extends EditAnimation {
private _duration;
get type(): AnimationType;
get duration(): number;
set duration(value: number);
faces: number;

@@ -11,0 +8,0 @@ count: number;

@@ -6,6 +6,3 @@ import { AnimationType, AnimationBits, AnimationPreset, Color } from "@systemic-games/pixels-core-animation";

export default class EditAnimationSimple extends EditAnimation {
private _duration;
get type(): AnimationType;
get duration(): number;
set duration(value: number);
faces: number;

@@ -12,0 +9,0 @@ color: EditColor;

@@ -1,38 +0,7 @@

import AppDataSet from "./AppDataSet";
import { ColorTypeValues, type ColorType } from "./edit/ColorType";
import EditAction from "./edit/EditAction";
import EditActionPlayAnimation from "./edit/EditActionPlayAnimation";
import EditActionPlayAudioClip from "./edit/EditActionPlayAudioClip";
import EditAnimation from "./edit/EditAnimation";
import EditAnimationGradient from "./edit/EditAnimationGradient";
import EditAnimationGradientPattern from "./edit/EditAnimationGradientPattern";
import EditAnimationKeyframed from "./edit/EditAnimationKeyframed";
import EditAnimationNoise from "./edit/EditAnimationNoise";
import EditAnimationRainbow from "./edit/EditAnimationRainbow";
import EditAnimationSimple from "./edit/EditAnimationSimple";
import EditAudioClip from "./edit/EditAudioClip";
import EditColor from "./edit/EditColor";
import EditCondition from "./edit/EditCondition";
import EditConditionBatteryState from "./edit/EditConditionBatteryState";
import EditConditionConnectionState from "./edit/EditConditionConnectionState";
import EditConditionCrooked from "./edit/EditConditionCrooked";
import EditConditionFaceCompare from "./edit/EditConditionFaceCompare";
import EditConditionHandling from "./edit/EditConditionHandling";
import EditConditionHelloGoodbye from "./edit/EditConditionHelloGoodbye";
import EditConditionIdle from "./edit/EditConditionIdle";
import EditConditionRolling from "./edit/EditConditionRolling";
import EditDataSet from "./edit/EditDataSet";
import EditPattern from "./edit/EditPattern";
import EditProfile from "./edit/EditProfile";
import EditRgbGradient from "./edit/EditRgbGradient";
import EditRgbKeyframe from "./edit/EditRgbKeyframe";
import EditRgbTrack from "./edit/EditRgbTrack";
import EditRule from "./edit/EditRule";
import Editable from "./edit/Editable";
import { PropertyData, NameProperty, name, getPropsWithName, RangeProperty, range, getPropsWithRange, type UnitsType, UnitsProperty, units, getPropsWithUnits, type WidgetType, WidgetProperty, widget, getPropsWithWidget, DisplayOrderProperty, displayOrder, getPropsWithDisplayOrder, skipEnum, getPropsWithSkipEnum } from "./edit/decorators";
import loadAppDataSet, { JsonRgbColor, JsonKeyframe, JsonGradient, JsonPattern, JsonAudioClip, JsonPreviewSettings, JsonColor, JsonAnimationData, JsonAnimation, JsonConditionData, JsonCondition, JsonActionData, JsonAction, JsonRule, JsonProfile, JsonDataSet } from "./loadAppDataSet";
export { ColorTypeValues, type ColorType, Editable, EditAction, EditActionPlayAnimation, EditActionPlayAudioClip, EditAnimation, EditAnimationGradient, EditAnimationGradientPattern, EditAnimationKeyframed, EditAnimationNoise, EditAnimationRainbow, EditAnimationSimple, EditAudioClip, EditColor, EditCondition, EditConditionBatteryState, EditConditionConnectionState, EditConditionCrooked, EditConditionFaceCompare, EditConditionHandling, EditConditionHelloGoodbye, EditConditionIdle, EditConditionRolling, EditDataSet, EditPattern, EditProfile, EditRgbGradient, EditRgbKeyframe, EditRgbTrack, EditRule, };
export { PropertyData, NameProperty, name, getPropsWithName, RangeProperty, range, getPropsWithRange, type UnitsType, UnitsProperty, units, getPropsWithUnits, type WidgetType, WidgetProperty, widget, getPropsWithWidget, DisplayOrderProperty, displayOrder, getPropsWithDisplayOrder, skipEnum, getPropsWithSkipEnum, };
export { AppDataSet };
export { loadAppDataSet, JsonRgbColor, JsonKeyframe, JsonGradient, JsonPattern, JsonAudioClip, JsonPreviewSettings, JsonColor, JsonAnimationData, JsonAnimation, JsonConditionData, JsonCondition, JsonActionData, JsonAction, JsonRule, JsonProfile, JsonDataSet, };
export { default as AppDataSet } from "./AppDataSet";
export { default as loadAppDataSet } from "./loadAppDataSet";
export * from "./getEditWidgetsData";
export { default as getEditWidgetsData } from "./getEditWidgetsData";
export * as Json from "./jsonTypes";
export * from "./edit";
//# sourceMappingURL=index.d.ts.map
import AppDataSet from "./AppDataSet";
export interface JsonRgbColor {
r?: number;
g?: number;
b?: number;
}
export interface JsonKeyframe {
time?: number;
color?: JsonRgbColor;
}
export interface JsonGradient {
keyframes?: JsonKeyframe[];
}
export interface JsonPattern {
name?: string;
gradients?: JsonGradient[];
}
export interface JsonAudioClip {
name?: string;
id?: number;
}
export interface JsonPreviewSettings {
design?: number;
}
export interface JsonColor {
type: number;
rgbColor: JsonRgbColor;
}
export interface JsonAnimationData {
name?: string;
duration?: number;
count?: number;
fade?: number;
faces?: number;
patternIndex?: number;
traveling?: boolean;
overrideWithFace?: boolean;
color?: JsonColor;
gradient?: JsonGradient;
defaultPreviewSettings?: JsonPreviewSettings;
}
export interface JsonAnimation {
type?: number;
data?: JsonAnimationData;
}
export interface JsonConditionData {
flags?: number;
faceIndex?: number;
recheckAfter?: number;
period?: number;
}
export interface JsonCondition {
type?: number;
data?: JsonConditionData;
}
export interface JsonActionData {
animationIndex?: number;
faceIndex?: number;
loopCount?: number;
audioClipIndex?: number;
}
export interface JsonAction {
type?: number;
data?: JsonActionData;
}
export interface JsonRule {
condition?: JsonCondition;
actions?: JsonAction[];
}
export interface JsonProfile {
name?: string | null;
description?: string | null;
rules?: JsonRule[];
defaultPreviewSettings?: JsonPreviewSettings;
}
export interface JsonDataSet {
jsonVersion?: number;
patterns?: JsonPattern[];
animations?: JsonAnimation[];
audioClips?: JsonAudioClip[];
behaviors?: JsonProfile[];
defaultBehavior?: JsonProfile;
}
export default function (jsonData: JsonDataSet): AppDataSet;
import * as Json from "./jsonTypes";
export default function (jsonData: Json.DataSet): AppDataSet;
//# sourceMappingURL=loadAppDataSet.d.ts.map
{
"name": "@systemic-games/pixels-edit-animation",
"version": "1.0.4",
"version": "1.0.5",
"description": "",

@@ -51,4 +51,4 @@ "main": "dist/cjs/index.js",

"dependencies": {
"@systemic-games/pixels-core-animation": "1.0.4",
"@systemic-games/pixels-core-utils": "1.0.4"
"@systemic-games/pixels-core-animation": "1.0.5",
"@systemic-games/pixels-core-utils": "1.0.5"
},

@@ -55,0 +55,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc