Skip to content

Commit

Permalink
feat: jsr support
Browse files Browse the repository at this point in the history
  • Loading branch information
rootEnginear committed Aug 22, 2024
1 parent 91ccfe1 commit 82a7131
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ Thumbs.db
# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

/local
8 changes: 8 additions & 0 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "@rootenginear/svelte-action-motionone",
"version": "0.4.0",
"exports": "./src/lib/index.ts",
"publish": {
"include": ["./src/lib/**/*", "./LICENSE", "./README.md", "./package.json", "./jsr.json"]
}
}
4 changes: 2 additions & 2 deletions src/lib/actions/inView.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { EMPTY_FUNCTION, type ActionOptions } from '$lib/utils/action.js';
import { getNodeElements } from '$lib/utils/selector.js';
import type {
AnimationOptions,
ElementOrSelector,
Expand All @@ -9,6 +7,8 @@ import type {
} from 'motion';
import { animate as motionAnimate, inView as motionInView } from 'motion';
import type { Action } from 'svelte/action';
import { EMPTY_FUNCTION, type ActionOptions } from '../utils/action.js';
import { getNodeElements } from '../utils/selector.js';

export type InViewActionOptions = ActionOptions & {
onStart: (entry: IntersectionObserverEntry) => void | ViewChangeHandler;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/actions/scroll.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { EMPTY_FUNCTION, type ActionOptions } from '$lib/utils/action.js';
import { getNodeElement, getNodeElements } from '$lib/utils/selector.js';
import type {
AnimationOptions,
ElementOrSelector,
Expand All @@ -9,6 +7,8 @@ import type {
} from 'motion';
import { animate as motionAnimate, scroll as motionScroll } from 'motion';
import type { Action } from 'svelte/action';
import { EMPTY_FUNCTION, type ActionOptions } from '../utils/action.js';
import { getNodeElement, getNodeElements } from '../utils/selector.js';

export type ExtendedScrollOptions = {
options?: Omit<ScrollOptions, 'container' | 'target'> & {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export interface ActionOptions {
*/
export const createAction =
<O, F>(f: (node: Element, options: O) => F, options: NoInfer<O>) =>
(node: Element) =>
(node: Element): F =>
f(node, options);

0 comments on commit 82a7131

Please sign in to comment.