Skip to content

Commit

Permalink
chore: 🤖 remove unncessary setters from v2
Browse files Browse the repository at this point in the history
  • Loading branch information
theashraf committed Oct 25, 2024
1 parent bb2a8d2 commit d9dffb3
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 56 deletions.
4 changes: 0 additions & 4 deletions apps/node/audio_test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import { getAnimation, getAudio, getAllAudio } from '@dotlottie/dotlottie-js/nod

// const dl = await
// dotLottie
// .setAuthor('Sam!')
// .setVersion('1.0')
// .addAnimation({
// id: 'audio',
// // url: 'https://assets10.lottiefiles.com/packages/lf20_tykuirhr.json',
Expand Down Expand Up @@ -64,8 +62,6 @@ import { getAnimation, getAudio, getAllAudio } from '@dotlottie/dotlottie-js/nod
const double = new DotLottie();

const doubleAnimation = await double
.setAuthor('Sam!')
.setVersion('1.0')
.addAnimation({
id: 'audio_0',
// url: 'https://assets10.lottiefiles.com/packages/lf20_tykuirhr.json',
Expand Down
Binary file added apps/node/exploding_pigeon.zip
Binary file not shown.
4 changes: 0 additions & 4 deletions apps/node/lf-interactivity-page-generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ async function createDotLottie() {
// Can't change to a different animation
// TODO: MACROS!! START_FRAME / END_FRAME
const dl = await dotLottie
.setAuthor('Sam!')
.setVersion('1.0')
.addAnimation({
id: 'segments',
url: 'https://assets2.lottiefiles.com/packages/lf20_4fET62.json',
Expand Down Expand Up @@ -608,8 +606,6 @@ async function createSingles() {
const stateSegments = new DotLottie();

await stateSegments
.setAuthor('Sam!')
.setVersion('1.0')
.addAnimation({
id: 'segments',
url: 'https://assets2.lottiefiles.com/packages/lf20_4fET62.json',
Expand Down
20 changes: 1 addition & 19 deletions apps/node/script.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@

import fs from 'fs';

import { DotLottie } from '@dotlottie/dotlottie-js/node';
import { DotLottie } from '@dotlottie/dotlottie-js';

async function createDotLottieForTests() {
const dotLottie = new DotLottie();

await dotLottie
.setAuthor('Joe')
.setVersion('1.0')
.addAnimation({
id: 'pigeon',
url: 'https://lottie.host/071a2de9-52ca-4ce4-ba2f-a5befd220bdd/ECzVp4eaMa.json',
Expand Down Expand Up @@ -126,8 +124,6 @@ async function createExplodingPigeon() {
const dotLottie = new DotLottie();

await dotLottie
.setAuthor('Sam')
.setVersion('1.0')
.addAnimation({
id: 'pigeon',
url: 'https://lottie.host/071a2de9-52ca-4ce4-ba2f-a5befd220bdd/ECzVp4eaMa.json',
Expand Down Expand Up @@ -339,8 +335,6 @@ async function createListenersAnimation() {
const dotLottie = new DotLottie();

await dotLottie
.setAuthor('Joe')
.setVersion('1.0')
.addAnimation({
id: 'pigeon',
url: 'https://lottie.host/071a2de9-52ca-4ce4-ba2f-a5befd220bdd/ECzVp4eaMa.json',
Expand Down Expand Up @@ -441,8 +435,6 @@ async function createDotLottie() {
const dotLottie = new DotLottie();

await dotLottie
.setAuthor('Joe')
.setVersion('1.0')
.addAnimation({
id: 'animation_1',
url: 'https://lottie.host/18b639d1-a200-4225-ba0e-3456d40f95a5/wlrsaqWa8r.json',
Expand Down Expand Up @@ -487,8 +479,6 @@ async function create_pigeon_fsm_eq_guard() {
const dotLottie = new DotLottie();

await dotLottie
.setAuthor('Joe')
.setVersion('1.0')
.addAnimation({
id: 'pigeon',
url: 'https://lottie.host/071a2de9-52ca-4ce4-ba2f-a5befd220bdd/ECzVp4eaMa.json',
Expand Down Expand Up @@ -611,8 +601,6 @@ async function create_pigeon_gt_gte_guard() {
const dotLottie = new DotLottie();

await dotLottie
.setAuthor('Joe')
.setVersion('1.0')
.addAnimation({
id: 'pigeon',
url: 'https://lottie.host/071a2de9-52ca-4ce4-ba2f-a5befd220bdd/ECzVp4eaMa.json',
Expand Down Expand Up @@ -735,8 +723,6 @@ async function create_pigeon_lt_lte_guard() {
const dotLottie = new DotLottie();

await dotLottie
.setAuthor('Joe')
.setVersion('1.0')
.addAnimation({
id: 'pigeon',
url: 'https://lottie.host/071a2de9-52ca-4ce4-ba2f-a5befd220bdd/ECzVp4eaMa.json',
Expand Down Expand Up @@ -860,8 +846,6 @@ async function create_pigeon_ne_guard() {
const dotLottie = new DotLottie();

await dotLottie
.setAuthor('Joe')
.setVersion('1.0')
.addAnimation({
id: 'pigeon',
url: 'https://lottie.host/071a2de9-52ca-4ce4-ba2f-a5befd220bdd/ECzVp4eaMa.json',
Expand Down Expand Up @@ -1172,8 +1156,6 @@ async function debugScenario() {
const dotLottie = new DotLottie();

await dotLottie
.setAuthor('Sam')
.setVersion('1.0')
.addAnimation({
id: 'folder',
url: 'https://lottie.host/32e49c72-af7a-4a79-97e4-fb0d115eae3e/wIqFzTMKsk.json',
Expand Down
29 changes: 0 additions & 29 deletions packages/dotlottie-js/src/v2/common/dotlottie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,9 @@ import { LottieThemeCommon } from './theme';
import { DotLottieError, createError, isAudioAsset, isImageAsset, isValidURL } from './utils';

export interface DotLottieOptions {
author?: string;
customData?: Record<string, string>;
description?: string;
enableDuplicateImageOptimization?: boolean;
generator?: string;
keywords?: string;
plugins?: DotLottiePlugin[];
revision?: number;
version?: string;
}

export interface GetAnimationOptions {
Expand All @@ -47,38 +41,15 @@ export class DotLottieCommon {

protected readonly _stateMachinesMap: Map<string, DotLottieStateMachineCommon> = new Map();

protected _author?: string;

protected _description?: string;

protected _generator: string = `${pkg.name}@${pkg.version}`;

protected _keywords?: string;

protected _version: string = '2.0.0';

protected _revision?: number;

// Custom data for the dotLottie
protected _customData?: Record<string, unknown>;

public enableDuplicateImageOptimization?: boolean;

public constructor(options?: DotLottieOptions) {
this._author = options?.author ?? 'LottieFiles';

this._description = options?.description ?? '';

this._generator = options?.generator ?? `${pkg.name}@${pkg.version}`;

this._keywords = options?.keywords ?? 'dotLottie';

this._version = options?.version ?? '1.0';

this._customData = options?.customData ?? {};

this._revision = options?.revision ?? 1;

this.enableDuplicateImageOptimization = options?.enableDuplicateImageOptimization ?? false;
}

Expand Down

0 comments on commit d9dffb3

Please sign in to comment.