-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve dragging behaviour when a scale transform is applied. (#24)
* Code formatting. * Improved the dragging behaviour when a scale transform is applied and improved the snapping behaviour to respect the scale as well.
- Loading branch information
Showing
16 changed files
with
1,069 additions
and
1,039 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
const config = { | ||
transform: { | ||
'^.+\\.js$': 'babel-jest', | ||
'^.+\\.svelte$': [ | ||
'svelte-jester', | ||
{ | ||
preprocess: true, | ||
}, | ||
], | ||
'^.+\\.ts$': 'ts-jest', | ||
}, | ||
moduleFileExtensions: ['js', 'ts', 'svelte'], | ||
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'], | ||
testEnvironment: 'jsdom', | ||
transformIgnorePatterns: ['/node_modules/(?!(.+\\.svelte$))', '\\.pnp\\.[^\\/]+$'], | ||
transform: { | ||
'^.+\\.js$': 'babel-jest', | ||
'^.+\\.svelte$': [ | ||
'svelte-jester', | ||
{ | ||
preprocess: true, | ||
}, | ||
], | ||
'^.+\\.ts$': 'ts-jest', | ||
}, | ||
moduleFileExtensions: ['js', 'ts', 'svelte'], | ||
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'], | ||
testEnvironment: 'jsdom', | ||
transformIgnorePatterns: ['/node_modules/(?!(.+\\.svelte$))', '\\.pnp\\.[^\\/]+$'], | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,63 @@ | ||
{ | ||
"name": "svelte-drag", | ||
"version": "2.2.1", | ||
"description": "Svelte port of react-draggable", | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.js", | ||
"type": "module", | ||
"types": "dist/index.d.ts", | ||
"typings": "dist/index.d.ts", | ||
"files": [ | ||
"dist/" | ||
], | ||
"sideEffects": false, | ||
"exports": { | ||
"import": "./dist/index.js", | ||
"default": "./dist/index.js", | ||
"require": "./dist/index.cjs" | ||
}, | ||
"scripts": { | ||
"test": "jest test", | ||
"test:watch": "pnpm run test -- --watch", | ||
"watch": "tsup --watch", | ||
"prepublishOnly": "tsup", | ||
"pub": "pnpm publish", | ||
"format": "prettier --write --plugin-search-dir=. '**/*.{js,ts,tsx,json,svelte,html}'" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/PuruVJ/svelte-drag.git" | ||
}, | ||
"keywords": [ | ||
"draggable", | ||
"svelte", | ||
"react-draggable", | ||
"drag", | ||
"svelte", | ||
"small", | ||
"tiny", | ||
"performant" | ||
], | ||
"author": "Puru Vijay", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/PuruVJ/svelte-drag/issues" | ||
}, | ||
"homepage": "https://github.com/PuruVJ/svelte-drag#readme", | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.16.4", | ||
"@testing-library/jest-dom": "^5.15.1", | ||
"@testing-library/svelte": "^3.0.3", | ||
"babel-jest": "^27.3.1", | ||
"jest": "^27.3.1", | ||
"prettier": "^2.4.1", | ||
"prettier-plugin-svelte": "^2.5.0", | ||
"svelte": "^3.44.2", | ||
"svelte-jester": "^2.1.5", | ||
"svelte-preprocess": "^4.9.8", | ||
"ts-jest": "^27.0.7", | ||
"tsm": "^2.1.4", | ||
"tsup": "^5.9.1", | ||
"typescript": "^4.5.2" | ||
} | ||
"name": "svelte-drag", | ||
"version": "2.2.1", | ||
"description": "Svelte port of react-draggable", | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.js", | ||
"type": "module", | ||
"types": "dist/index.d.ts", | ||
"typings": "dist/index.d.ts", | ||
"files": [ | ||
"dist/" | ||
], | ||
"sideEffects": false, | ||
"exports": { | ||
"import": "./dist/index.js", | ||
"default": "./dist/index.js", | ||
"require": "./dist/index.cjs" | ||
}, | ||
"scripts": { | ||
"test": "jest test", | ||
"test:watch": "pnpm run test -- --watch", | ||
"watch": "tsup --watch", | ||
"prepublishOnly": "tsup", | ||
"pub": "pnpm publish", | ||
"format": "prettier --write --plugin-search-dir=. '**/*.{js,ts,tsx,json,svelte,html}'" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/PuruVJ/svelte-drag.git" | ||
}, | ||
"keywords": [ | ||
"draggable", | ||
"svelte", | ||
"react-draggable", | ||
"drag", | ||
"svelte", | ||
"small", | ||
"tiny", | ||
"performant" | ||
], | ||
"author": "Puru Vijay", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/PuruVJ/svelte-drag/issues" | ||
}, | ||
"homepage": "https://github.com/PuruVJ/svelte-drag#readme", | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.16.4", | ||
"@testing-library/jest-dom": "^5.15.1", | ||
"@testing-library/svelte": "^3.0.3", | ||
"babel-jest": "^27.3.1", | ||
"jest": "^27.3.1", | ||
"prettier": "^2.4.1", | ||
"prettier-plugin-svelte": "^2.5.0", | ||
"svelte": "^3.44.2", | ||
"svelte-jester": "^2.1.5", | ||
"svelte-preprocess": "^4.9.8", | ||
"ts-jest": "^27.0.7", | ||
"tsm": "^2.1.4", | ||
"tsup": "^5.9.1", | ||
"typescript": "^4.5.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export declare namespace svelte.JSX { | ||
interface HTMLAttributes { | ||
'onsvelte-drag:start'?: (e: CustomEvent<null>) => void; | ||
'onsvelte-drag:end'?: (e: CustomEvent<null>) => void; | ||
'onsvelte-drag'?: (e: CustomEvent<{ offsetX: number; offsetY: number }>) => void; | ||
} | ||
interface HTMLAttributes { | ||
'onsvelte-drag:start'?: (e: CustomEvent<null>) => void; | ||
'onsvelte-drag:end'?: (e: CustomEvent<null>) => void; | ||
'onsvelte-drag'?: (e: CustomEvent<{ offsetX: number; offsetY: number }>) => void; | ||
} | ||
} |
Oops, something went wrong.