Socket
Socket
Sign inDemoInstall

@systemic-games/pixels-edit-animation

Package Overview
Dependencies
5
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.0 to 1.2.2

dist/src/__tests__/test.test.d.ts

5

dist/cjs/createDataSet.js

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

exports.createDataSetForAnimations = createDataSetForAnimations;
function createDataSetForProfile(profile) {
const dataSet = new edit_1.EditDataSet({ profile });
function createDataSetForProfile(profile, brightnessFactor) {
const brightness = (brightnessFactor !== null && brightnessFactor !== void 0 ? brightnessFactor : 1) * profile.brightness;
const dataSet = new edit_1.EditDataSet({ profile, brightness });
// Add the animations and patterns that the profile uses

@@ -56,0 +57,0 @@ addAnimations(dataSet, dataSet.profile.collectAnimations());

16

dist/cjs/edit/decorators.js

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

//
const nameKey = Symbol("pixelEditAnimationName");
const nameKey = Symbol.for("PixelsEditAnimationName");
// Name decorator factory

@@ -37,3 +37,3 @@ function name(name) {

//
const rangeKey = Symbol("pixelEditAnimationRange");
const rangeKey = Symbol.for("PixelsEditAnimationRange");
// Range decorator factory

@@ -56,3 +56,3 @@ function range(min, max, step) {

//
const unitKey = Symbol("pixelEditAnimationUnit");
const unitKey = Symbol.for("PixelsEditAnimationUnit");
// Unit decorator factory

@@ -71,3 +71,3 @@ function unit(unit) {

//
const valuesKey = Symbol("pixelEditAnimationValues");
const valuesKey = Symbol.for("PixelsEditAnimationValues");
// Unit decorator factory

@@ -86,3 +86,3 @@ function values(values) {

//
const widgetKey = Symbol("pixelEditAnimationWidget");
const widgetKey = Symbol.for("PixelsEditAnimationWidget");
// Widget decorator factory

@@ -101,3 +101,3 @@ function widget(type) {

//
const displayOrderKey = Symbol("pixelEditAnimationDisplayOrder");
const displayOrderKey = Symbol.for("PixelsEditAnimationDisplayOrder");
// Display order decorator factory

@@ -116,3 +116,3 @@ function displayOrder(index) {

//
const skipEnumKey = Symbol("pixelEditAnimationSkipEnum");
const skipEnumKey = Symbol.for("PixelsEditAnimationSkipEnum");
// Skip decorator

@@ -131,3 +131,3 @@ function skipEnum(target, propertyKey) {

//
const observableKey = Symbol("pixelObservable");
const observableKey = Symbol.for("PixelsObservable");
// Skip decorator

@@ -134,0 +134,0 @@ function observable(target, propertyKey) {

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

constructor(opt) {
var _a, _b, _c, _d;
var _a, _b, _c, _d, _e;
this.patterns = (_a = opt === null || opt === void 0 ? void 0 : opt.patterns) !== null && _a !== void 0 ? _a : [];

@@ -17,2 +17,3 @@ this.rgbPatterns = (_b = opt === null || opt === void 0 ? void 0 : opt.rgbPatterns) !== null && _b !== void 0 ? _b : [];

this.profile = (_d = opt === null || opt === void 0 ? void 0 : opt.profile) !== null && _d !== void 0 ? _d : new EditProfile_1.default();
this.brightness = (_e = opt === null || opt === void 0 ? void 0 : opt.brightness) !== null && _e !== void 0 ? _e : 1;
}

@@ -67,2 +68,4 @@ getPatternTrackOffset(pattern) {

}
// Brightness
set.brightness = Math.round(Math.min(1, Math.max(0, this.brightness)) * 255);
// Now convert

@@ -69,0 +72,0 @@ set.profile = this.profile.toProfile(this, set);

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

constructor(opt) {
var _a, _b, _c, _d, _e;
var _a, _b, _c, _d, _e, _f, _g;
super(opt);

@@ -25,4 +25,6 @@ this.description = (_a = opt === null || opt === void 0 ? void 0 : opt.description) !== null && _a !== void 0 ? _a : "";

this.dieType = (_c = opt === null || opt === void 0 ? void 0 : opt.dieType) !== null && _c !== void 0 ? _c : "d20";
this.creationDate = (_d = opt === null || opt === void 0 ? void 0 : opt.creationDate) !== null && _d !== void 0 ? _d : new Date();
this.lastChanged = (_e = opt === null || opt === void 0 ? void 0 : opt.lastChanged) !== null && _e !== void 0 ? _e : new Date();
this.colorway = (_d = opt === null || opt === void 0 ? void 0 : opt.colorway) !== null && _d !== void 0 ? _d : "onyxBlack";
this.brightness = (_e = opt === null || opt === void 0 ? void 0 : opt.brightness) !== null && _e !== void 0 ? _e : 1;
this.creationDate = (_f = opt === null || opt === void 0 ? void 0 : opt.creationDate) !== null && _f !== void 0 ? _f : new Date();
this.lastChanged = (_g = opt === null || opt === void 0 ? void 0 : opt.lastChanged) !== null && _g !== void 0 ? _g : new Date();
this.lastUsed = opt === null || opt === void 0 ? void 0 : opt.lastUsed;

@@ -79,2 +81,8 @@ }

decorators_1.observable
], EditProfile.prototype, "colorway", void 0);
__decorate([
decorators_1.observable
], EditProfile.prototype, "brightness", void 0);
__decorate([
decorators_1.observable
], EditProfile.prototype, "creationDate", void 0);

@@ -81,0 +89,0 @@ __decorate([

@@ -75,3 +75,2 @@ "use strict";

"This profile has your device say the rolled numbers out loud (when the app is open)";
(0, defaultRules_1.addDefaultRollingRules)(profile, dieType);
pushRolledAnimNonTopFaceRule(animations_1.PrebuildAnimations.noise);

@@ -78,0 +77,0 @@ pushRolledAnimTopFaceRule(animations_1.PrebuildAnimations.noiseRainbow);

@@ -367,2 +367,4 @@ "use strict";

dieType: profile.dieType,
colorway: profile.colorway,
brightness: profile.brightness,
hash,

@@ -369,0 +371,0 @@ creationDate: profile.creationDate.getTime(),

@@ -47,4 +47,5 @@ import { EditDataSet } from "./edit";

}
export function createDataSetForProfile(profile) {
const dataSet = new EditDataSet({ profile });
export function createDataSetForProfile(profile, brightnessFactor) {
const brightness = (brightnessFactor !== null && brightnessFactor !== void 0 ? brightnessFactor : 1) * profile.brightness;
const dataSet = new EditDataSet({ profile, brightness });
// Add the animations and patterns that the profile uses

@@ -51,0 +52,0 @@ addAnimations(dataSet, dataSet.profile.collectAnimations());

@@ -19,3 +19,3 @@ function getMetadata(metadataKey, target) {

//
const nameKey = Symbol("pixelEditAnimationName");
const nameKey = Symbol.for("PixelsEditAnimationName");
// Name decorator factory

@@ -32,3 +32,3 @@ export function name(name) {

//
const rangeKey = Symbol("pixelEditAnimationRange");
const rangeKey = Symbol.for("PixelsEditAnimationRange");
// Range decorator factory

@@ -49,3 +49,3 @@ export function range(min, max, step) {

//
const unitKey = Symbol("pixelEditAnimationUnit");
const unitKey = Symbol.for("PixelsEditAnimationUnit");
// Unit decorator factory

@@ -62,3 +62,3 @@ export function unit(unit) {

//
const valuesKey = Symbol("pixelEditAnimationValues");
const valuesKey = Symbol.for("PixelsEditAnimationValues");
// Unit decorator factory

@@ -75,3 +75,3 @@ export function values(values) {

//
const widgetKey = Symbol("pixelEditAnimationWidget");
const widgetKey = Symbol.for("PixelsEditAnimationWidget");
// Widget decorator factory

@@ -88,3 +88,3 @@ export function widget(type) {

//
const displayOrderKey = Symbol("pixelEditAnimationDisplayOrder");
const displayOrderKey = Symbol.for("PixelsEditAnimationDisplayOrder");
// Display order decorator factory

@@ -101,3 +101,3 @@ export function displayOrder(index) {

//
const skipEnumKey = Symbol("pixelEditAnimationSkipEnum");
const skipEnumKey = Symbol.for("PixelsEditAnimationSkipEnum");
// Skip decorator

@@ -114,3 +114,3 @@ export function skipEnum(target, propertyKey) {

//
const observableKey = Symbol("pixelObservable");
const observableKey = Symbol.for("PixelsObservable");
// Skip decorator

@@ -117,0 +117,0 @@ export function observable(target, propertyKey) {

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

constructor(opt) {
var _a, _b, _c, _d;
var _a, _b, _c, _d, _e;
this.patterns = (_a = opt === null || opt === void 0 ? void 0 : opt.patterns) !== null && _a !== void 0 ? _a : [];

@@ -12,2 +12,3 @@ this.rgbPatterns = (_b = opt === null || opt === void 0 ? void 0 : opt.rgbPatterns) !== null && _b !== void 0 ? _b : [];

this.profile = (_d = opt === null || opt === void 0 ? void 0 : opt.profile) !== null && _d !== void 0 ? _d : new EditProfile();
this.brightness = (_e = opt === null || opt === void 0 ? void 0 : opt.brightness) !== null && _e !== void 0 ? _e : 1;
}

@@ -62,2 +63,4 @@ getPatternTrackOffset(pattern) {

}
// Brightness
set.brightness = Math.round(Math.min(1, Math.max(0, this.brightness)) * 255);
// Now convert

@@ -64,0 +67,0 @@ set.profile = this.profile.toProfile(this, set);

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

constructor(opt) {
var _a, _b, _c, _d, _e;
var _a, _b, _c, _d, _e, _f, _g;
super(opt);

@@ -20,4 +20,6 @@ this.description = (_a = opt === null || opt === void 0 ? void 0 : opt.description) !== null && _a !== void 0 ? _a : "";

this.dieType = (_c = opt === null || opt === void 0 ? void 0 : opt.dieType) !== null && _c !== void 0 ? _c : "d20";
this.creationDate = (_d = opt === null || opt === void 0 ? void 0 : opt.creationDate) !== null && _d !== void 0 ? _d : new Date();
this.lastChanged = (_e = opt === null || opt === void 0 ? void 0 : opt.lastChanged) !== null && _e !== void 0 ? _e : new Date();
this.colorway = (_d = opt === null || opt === void 0 ? void 0 : opt.colorway) !== null && _d !== void 0 ? _d : "onyxBlack";
this.brightness = (_e = opt === null || opt === void 0 ? void 0 : opt.brightness) !== null && _e !== void 0 ? _e : 1;
this.creationDate = (_f = opt === null || opt === void 0 ? void 0 : opt.creationDate) !== null && _f !== void 0 ? _f : new Date();
this.lastChanged = (_g = opt === null || opt === void 0 ? void 0 : opt.lastChanged) !== null && _g !== void 0 ? _g : new Date();
this.lastUsed = opt === null || opt === void 0 ? void 0 : opt.lastUsed;

@@ -73,2 +75,8 @@ }

observable
], EditProfile.prototype, "colorway", void 0);
__decorate([
observable
], EditProfile.prototype, "brightness", void 0);
__decorate([
observable
], EditProfile.prototype, "creationDate", void 0);

@@ -75,0 +83,0 @@ __decorate([

@@ -72,3 +72,2 @@ import { AnimConstants, DiceUtils, } from "@systemic-games/pixels-core-animation";

"This profile has your device say the rolled numbers out loud (when the app is open)";
addDefaultRollingRules(profile, dieType);
pushRolledAnimNonTopFaceRule(PrebuildAnimations.noise);

@@ -75,0 +74,0 @@ pushRolledAnimTopFaceRule(PrebuildAnimations.noiseRainbow);

@@ -356,2 +356,4 @@ import { AnimationFlagsValues, BatteryStateFlagsValues, Color, ColorUtils, ConnectionStateFlagsValues, DataSet, FaceCompareFlagsValues, HelloGoodbyeFlagsValues, NoiseColorOverrideTypeValues, NormalsColorOverrideTypeValues, } from "@systemic-games/pixels-core-animation";

dieType: profile.dieType,
colorway: profile.colorway,
brightness: profile.brightness,
hash,

@@ -358,0 +360,0 @@ creationDate: profile.creationDate.getTime(),

import { EditAnimation, EditDataSet, EditProfile } from "./edit";
export declare function createDataSetForAnimation(animation: Readonly<EditAnimation>): EditDataSet;
export declare function createDataSetForAnimations(animations: readonly Readonly<EditAnimation>[]): EditDataSet;
export declare function createDataSetForProfile(profile: Readonly<EditProfile>): EditDataSet;
export declare function createDataSetForProfile(profile: Readonly<EditProfile>, brightnessFactor?: number): EditDataSet;
//# sourceMappingURL=createDataSet.d.ts.map

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

import EditDataSet from "./EditDataSet";
export type ActionWebRequestFormat = "parameters" | "json";
export type ActionWebRequestFormat = "parameters" | "json" | "discord";
export default class EditActionMakeWebRequest extends EditActionRunOnDevice {

@@ -8,0 +8,0 @@ readonly type = "makeWebRequest";

@@ -10,2 +10,3 @@ import { DataSet } from "@systemic-games/pixels-core-animation";

readonly profile: Readonly<EditProfile>;
brightness: number;
constructor(opt?: {

@@ -16,2 +17,3 @@ patterns?: Readonly<EditPattern>[];

profile?: Readonly<EditProfile>;
brightness?: number;
});

@@ -18,0 +20,0 @@ getPatternTrackOffset(pattern: Readonly<EditPattern>): number;

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

import { ActionType, DataSet, PixelDieType, Profile } from "@systemic-games/pixels-core-animation";
import { ActionType, DataSet, PixelColorway, PixelDieType, Profile } from "@systemic-games/pixels-core-animation";
import EditActionRunOnDevice from "./EditActionRunOnDevice";

@@ -11,2 +11,4 @@ import EditAnimation from "./EditAnimation";

dieType: PixelDieType;
colorway: PixelColorway;
brightness: number;
creationDate: Date;

@@ -21,2 +23,4 @@ lastChanged: Date;

dieType?: PixelDieType;
colorway?: PixelColorway;
brightness?: number;
creationDate?: Date;

@@ -23,0 +27,0 @@ lastChanged?: Date;

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

import { BatteryStateFlags, ConnectionStateFlags, HelloGoodbyeFlags, PixelDieType } from "@systemic-games/pixels-core-animation";
import { BatteryStateFlags, ConnectionStateFlags, HelloGoodbyeFlags, PixelColorway, PixelDieType } from "@systemic-games/pixels-core-animation";
import { UniqueNamedData } from "./unique";

@@ -7,2 +7,4 @@ import { ActionWebRequestFormat } from "../edit";

dieType: PixelDieType;
colorway: PixelColorway;
brightness: number;
hash: number;

@@ -9,0 +11,0 @@ creationDate: number;

{
"name": "@systemic-games/pixels-edit-animation",
"version": "1.2.0",
"version": "1.2.2",
"description": "Classes to help manipulating Pixels animations.",

@@ -54,4 +54,4 @@ "main": "dist/cjs/index",

"dependencies": {
"@systemic-games/pixels-core-animation": "~1.2.0",
"@systemic-games/pixels-core-utils": "~1.2.0",
"@systemic-games/pixels-core-animation": "~1.2.2",
"@systemic-games/pixels-core-utils": "~1.2.2",
"base64-js": "^1.5.1"

@@ -58,0 +58,0 @@ },

@@ -65,5 +65,7 @@ import { EditAnimation, EditDataSet, EditProfile } from "./edit";

export function createDataSetForProfile(
profile: Readonly<EditProfile>
profile: Readonly<EditProfile>,
brightnessFactor?: number
): EditDataSet {
const dataSet = new EditDataSet({ profile });
const brightness = (brightnessFactor ?? 1) * profile.brightness;
const dataSet = new EditDataSet({ profile, brightness });

@@ -70,0 +72,0 @@ // Add the animations and patterns that the profile uses

@@ -43,3 +43,3 @@ export interface PropertyData {

const nameKey = Symbol("pixelEditAnimationName");
const nameKey = Symbol.for("PixelsEditAnimationName");

@@ -66,3 +66,3 @@ export interface NameProperty extends PropertyData {

const rangeKey = Symbol("pixelEditAnimationRange");
const rangeKey = Symbol.for("PixelsEditAnimationRange");

@@ -97,3 +97,3 @@ export interface RangeProperty extends PropertyData {

const unitKey = Symbol("pixelEditAnimationUnit");
const unitKey = Symbol.for("PixelsEditAnimationUnit");

@@ -122,3 +122,3 @@ export type UnitType = "s" | "ms";

const valuesKey = Symbol("pixelEditAnimationValues");
const valuesKey = Symbol.for("PixelsEditAnimationValues");

@@ -147,3 +147,3 @@ export type ValuesType = { [key: string]: number };

const widgetKey = Symbol("pixelEditAnimationWidget");
const widgetKey = Symbol.for("PixelsEditAnimationWidget");

@@ -187,3 +187,3 @@ export type WidgetType =

const displayOrderKey = Symbol("pixelEditAnimationDisplayOrder");
const displayOrderKey = Symbol.for("PixelsEditAnimationDisplayOrder");

@@ -212,3 +212,3 @@ export interface DisplayOrderProperty extends PropertyData {

const skipEnumKey = Symbol("pixelEditAnimationSkipEnum");
const skipEnumKey = Symbol.for("PixelsEditAnimationSkipEnum");

@@ -229,3 +229,3 @@ // Skip decorator

const observableKey = Symbol("pixelObservable");
const observableKey = Symbol.for("PixelsObservable");

@@ -232,0 +232,0 @@ // Skip decorator

@@ -14,3 +14,3 @@ import {

export type ActionWebRequestFormat = "parameters" | "json";
export type ActionWebRequestFormat = "parameters" | "json" | "discord";

@@ -17,0 +17,0 @@ export default class EditActionMakeWebRequest extends EditActionRunOnDevice {

@@ -13,2 +13,3 @@ import { DataSet } from "@systemic-games/pixels-core-animation";

readonly profile: Readonly<EditProfile>;
brightness: number;

@@ -20,2 +21,3 @@ constructor(opt?: {

profile?: Readonly<EditProfile>;
brightness?: number;
}) {

@@ -26,2 +28,3 @@ this.patterns = opt?.patterns ?? [];

this.profile = opt?.profile ?? new EditProfile();
this.brightness = opt?.brightness ?? 1;
}

@@ -81,2 +84,7 @@

// Brightness
set.brightness = Math.round(
Math.min(1, Math.max(0, this.brightness)) * 255
);
// Now convert

@@ -83,0 +91,0 @@ set.profile = this.profile.toProfile(this, set);

import {
ActionType,
DataSet,
PixelColorway,
PixelDieType,

@@ -26,2 +27,8 @@ Profile,

@observable
colorway: PixelColorway;
@observable
brightness: number;
// TODO The properties below should be moved to a separate class

@@ -44,2 +51,4 @@

dieType?: PixelDieType;
colorway?: PixelColorway;
brightness?: number;
creationDate?: Date;

@@ -53,2 +62,4 @@ lastChanged?: Date;

this.dieType = opt?.dieType ?? "d20";
this.colorway = opt?.colorway ?? "onyxBlack";
this.brightness = opt?.brightness ?? 1;
this.creationDate = opt?.creationDate ?? new Date();

@@ -55,0 +66,0 @@ this.lastChanged = opt?.lastChanged ?? new Date();

@@ -134,3 +134,2 @@ import {

"This profile has your device say the rolled numbers out loud (when the app is open)";
addDefaultRollingRules(profile, dieType);
pushRolledAnimNonTopFaceRule(PrebuildAnimations.noise);

@@ -137,0 +136,0 @@ pushRolledAnimTopFaceRule(PrebuildAnimations.noiseRainbow);

@@ -555,2 +555,4 @@ import {

dieType: profile.dieType,
colorway: profile.colorway,
brightness: profile.brightness,
hash,

@@ -557,0 +559,0 @@ creationDate: profile.creationDate.getTime(),

@@ -5,2 +5,3 @@ import {

HelloGoodbyeFlags,
PixelColorway,
PixelDieType,

@@ -15,2 +16,4 @@ } from "@systemic-games/pixels-core-animation";

dieType: PixelDieType;
colorway: PixelColorway;
brightness: number;
hash: number;

@@ -17,0 +20,0 @@ creationDate: number;

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