Skip to content

Commit

Permalink
feat: added actions and context to types
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelOsborne committed Aug 7, 2023
1 parent f7ca31d commit 8a384c0
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"proud-goats-turn",
"shy-laws-taste",
"silent-rabbits-dress",
"tasty-hotels-look",
"warm-ravens-punch"
]
}
5 changes: 5 additions & 0 deletions .changeset/tasty-hotels-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@dotlottie/dotlottie-js": patch
---

added actions and context to types
15 changes: 14 additions & 1 deletion apps/node/lf-interactivity-page-generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,19 @@ async function createDotLottie() {
.addStateMachine({
descriptor: {
id: 'state_segments_on_hover',
initial: 'loopState',
initial: 'idleState',
},
states: {
idleState: {
animationId: 'segments_on_hover',
statePlaybackSettings: {
autoplay: false,
loop: false,
},
onMouseEnter: {
state: 'loopState',
},
},
loopState: {
animationId: 'segments_on_hover',
statePlaybackSettings: {
Expand All @@ -67,6 +77,9 @@ async function createDotLottie() {
hover: true,
segments: [45, 60],
},
onMouseLeave: {
state: 'idleState',
},
},
},
})
Expand Down
6 changes: 6 additions & 0 deletions packages/dotlottie-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @dotlottie/dotlottie-js

## 0.4.0-beta.12

### Patch Changes

- added actions and context to types

## 0.4.0-beta.11

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/dotlottie-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dotlottie/dotlottie-js",
"version": "0.4.0-beta.11",
"version": "0.4.0-beta.12",
"type": "module",
"description": "This library helps in creating and modifying .lottie files.",
"repository": {
Expand Down
2 changes: 2 additions & 0 deletions packages/dotlottie-js/src/common/dotlottie-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ export interface XStateTargetEvent {

export interface XState {
after: Record<number, XStateTargetEvent>;
context: Record<string, unknown>;
entry?: () => void;
exit?: () => void;
meta: StateAnimationSettings;
on: Record<keyof EventMap, XStateTargetEvent>;
}

export interface XStateMachine {
actions: Record<string, unknown>;
id: string;
initial: string;
states: Record<string, XState>;
Expand Down

0 comments on commit 8a384c0

Please sign in to comment.