Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: publish v1.10.18 #1006

Merged
merged 6 commits into from
Jul 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## v1.10.18

- fix(interact): remove types dependency
- fix: set "type": "module" for scoped packages
- fix(modifiers): allow toggling aspectRatio modifier during interaction
- fix(types): import plugins for module augmentations
- fix(interactjs): don't assign module.exports in esm package

## v1.10.17

- fixed missing typings when only the `@interactjs/interactjs` package is
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@interactjs/_dev",
"version": "1.10.17",
"version": "1.10.18",
"private": true,
"directories": {
"bin": "./bin"
Expand Down
9 changes: 5 additions & 4 deletions packages/@interactjs/actions/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"name": "@interactjs/actions",
"version": "1.10.17",
"version": "1.10.18",
"main": "index",
"module": "index",
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/taye/interact.js.git",
"directory": "packages/@interactjs/actions"
},
"peerDependencies": {
"@interactjs/core": "1.10.17",
"@interactjs/utils": "1.10.17"
"@interactjs/core": "1.10.18",
"@interactjs/utils": "1.10.18"
},
"optionalDependencies": {
"@interactjs/interact": "1.10.17"
"@interactjs/interact": "1.10.18"
},
"publishConfig": {
"access": "public"
Expand Down
7 changes: 7 additions & 0 deletions packages/@interactjs/actions/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import type { Scope } from '@interactjs/core/scope'

/* eslint-disable import/no-duplicates */
import './drag/plugin'
import './drop/plugin'
import './gesture/plugin'
import './resize/plugin'

import drag from './drag/plugin'
import drop from './drop/plugin'
import gesture from './gesture/plugin'
import resize from './resize/plugin'
/* eslint-enable import/no-duplicates */

export default {
id: 'actions',
Expand Down
7 changes: 4 additions & 3 deletions packages/@interactjs/auto-scroll/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
"name": "@interactjs/auto-scroll",
"version": "1.10.17",
"version": "1.10.18",
"main": "index",
"module": "index",
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/taye/interact.js.git",
"directory": "packages/@interactjs/auto-scroll"
},
"peerDependencies": {
"@interactjs/utils": "1.10.17"
"@interactjs/utils": "1.10.18"
},
"optionalDependencies": {
"@interactjs/interact": "1.10.17"
"@interactjs/interact": "1.10.18"
},
"publishConfig": {
"access": "public"
Expand Down
9 changes: 5 additions & 4 deletions packages/@interactjs/auto-start/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"name": "@interactjs/auto-start",
"version": "1.10.17",
"version": "1.10.18",
"main": "index",
"module": "index",
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/taye/interact.js.git",
"directory": "packages/@interactjs/auto-start"
},
"peerDependencies": {
"@interactjs/core": "1.10.17",
"@interactjs/utils": "1.10.17"
"@interactjs/core": "1.10.18",
"@interactjs/utils": "1.10.18"
},
"optionalDependencies": {
"@interactjs/interact": "1.10.17"
"@interactjs/interact": "1.10.18"
},
"publishConfig": {
"access": "public"
Expand Down
5 changes: 3 additions & 2 deletions packages/@interactjs/core/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"name": "@interactjs/core",
"version": "1.10.17",
"version": "1.10.18",
"main": "index",
"module": "index",
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/taye/interact.js.git",
"directory": "packages/@interactjs/core"
},
"peerDependencies": {
"@interactjs/utils": "1.10.17"
"@interactjs/utils": "1.10.18"
},
"publishConfig": {
"access": "public"
Expand Down
9 changes: 5 additions & 4 deletions packages/@interactjs/dev-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"name": "@interactjs/dev-tools",
"version": "1.10.17",
"version": "1.10.18",
"main": "index",
"module": "index",
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/taye/interact.js.git",
"directory": "packages/@interactjs/dev-tools"
},
"peerDependencies": {
"@interactjs/modifiers": "1.10.17",
"@interactjs/utils": "1.10.17"
"@interactjs/modifiers": "1.10.18",
"@interactjs/utils": "1.10.18"
},
"optionalDependencies": {
"@interactjs/interact": "1.10.17"
"@interactjs/interact": "1.10.18"
},
"devDependencies": {
"vue": "next"
Expand Down
5 changes: 4 additions & 1 deletion packages/@interactjs/dev-tools/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// eslint-disable-next-line import/no-extraneous-dependencies, import/no-duplicates
import '@interactjs/dev-tools/visualizer/plugin'

import type Interaction from '@interactjs/core/Interaction'
import type { Scope, Plugin } from '@interactjs/core/scope'
import type { Element, OptionMethod } from '@interactjs/core/types'
// eslint-disable-next-line import/no-extraneous-dependencies
// eslint-disable-next-line import/no-extraneous-dependencies, import/no-duplicates
import visualizer from '@interactjs/dev-tools/visualizer/plugin'
import domObjects from '@interactjs/utils/domObjects'
import { parentNode } from '@interactjs/utils/domUtils'
Expand Down
13 changes: 7 additions & 6 deletions packages/@interactjs/inertia/package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
{
"name": "@interactjs/inertia",
"version": "1.10.17",
"version": "1.10.18",
"main": "index",
"module": "index",
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/taye/interact.js.git",
"directory": "packages/@interactjs/inertia"
},
"dependencies": {
"@interactjs/offset": "1.10.17"
"@interactjs/offset": "1.10.18"
},
"peerDependencies": {
"@interactjs/core": "1.10.17",
"@interactjs/modifiers": "1.10.17",
"@interactjs/utils": "1.10.17"
"@interactjs/core": "1.10.18",
"@interactjs/modifiers": "1.10.18",
"@interactjs/utils": "1.10.18"
},
"optionalDependencies": {
"@interactjs/interact": "1.10.17"
"@interactjs/interact": "1.10.18"
},
"publishConfig": {
"access": "public"
Expand Down
9 changes: 4 additions & 5 deletions packages/@interactjs/interact/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
{
"name": "@interactjs/interact",
"version": "1.10.17",
"version": "1.10.18",
"main": "index",
"module": "index",
"_typings": "typings.d.ts",
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/taye/interact.js.git",
"directory": "packages/@interactjs/interact"
},
"dependencies": {
"@interactjs/core": "1.10.17",
"@interactjs/types": "1.10.17",
"@interactjs/utils": "1.10.17"
"@interactjs/core": "1.10.18",
"@interactjs/utils": "1.10.18"
},
"publishConfig": {
"access": "public"
Expand Down
7 changes: 0 additions & 7 deletions packages/@interactjs/interactjs/index.stub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ if (process.env.NODE_ENV !== 'production') {
}

export default interact

if (typeof module === 'object' && !!module) {
try {
module.exports = interact
} catch {}
}

;(interact as any).default = interact

const _ = {
Expand Down
7 changes: 0 additions & 7 deletions packages/@interactjs/interactjs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ if (process.env.NODE_ENV !== 'production') {
}

export default interact

if (typeof module === 'object' && !!module) {
try {
module.exports = interact
} catch {}
}

;(interact as any).default = interact

const _ = {
Expand Down
43 changes: 22 additions & 21 deletions packages/@interactjs/interactjs/package.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
{
"name": "@interactjs/interactjs",
"version": "1.10.17",
"version": "1.10.18",
"main": "index",
"module": "index",
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/taye/interact.js.git"
},
"dependencies": {
"@interactjs/actions": "1.10.17",
"@interactjs/arrange": "1.10.17",
"@interactjs/auto-scroll": "1.10.17",
"@interactjs/auto-start": "1.10.17",
"@interactjs/clone": "1.10.17",
"@interactjs/core": "1.10.17",
"@interactjs/dev-tools": "1.10.17",
"@interactjs/feedback": "1.10.17",
"@interactjs/inertia": "1.10.17",
"@interactjs/interact": "1.10.17",
"@interactjs/modifiers": "1.10.17",
"@interactjs/multi-target": "1.10.17",
"@interactjs/offset": "1.10.17",
"@interactjs/pointer-events": "1.10.17",
"@interactjs/react": "1.10.17",
"@interactjs/rebound": "1.10.17",
"@interactjs/symbol-tree": "1.10.17",
"@interactjs/reflow": "1.10.17",
"@interactjs/utils": "1.10.17",
"@interactjs/vue": "1.10.17"
"@interactjs/actions": "1.10.18",
"@interactjs/arrange": "1.10.18",
"@interactjs/auto-scroll": "1.10.18",
"@interactjs/auto-start": "1.10.18",
"@interactjs/clone": "1.10.18",
"@interactjs/core": "1.10.18",
"@interactjs/dev-tools": "1.10.18",
"@interactjs/feedback": "1.10.18",
"@interactjs/inertia": "1.10.18",
"@interactjs/interact": "1.10.18",
"@interactjs/modifiers": "1.10.18",
"@interactjs/multi-target": "1.10.18",
"@interactjs/offset": "1.10.18",
"@interactjs/pointer-events": "1.10.18",
"@interactjs/react": "1.10.18",
"@interactjs/rebound": "1.10.18",
"@interactjs/symbol-tree": "1.10.18",
"@interactjs/reflow": "1.10.18",
"@interactjs/utils": "1.10.18",
"@interactjs/vue": "1.10.18"
},
"publishConfig": {
"access": "public"
Expand Down
24 changes: 18 additions & 6 deletions packages/@interactjs/modifiers/Modification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,28 @@ export default class Modification {
startDelta!: Point
result!: ModificationResult
endResult!: Point
edges!: EdgeOptions
startEdges!: EdgeOptions
edges: EdgeOptions
readonly interaction: Readonly<Interaction>

constructor (interaction: Interaction) {
this.interaction = interaction
this.result = createResult()
this.edges = {
left: false,
right: false,
top: false,
bottom: false,
}
}

start ({ phase }: { phase: EventPhase }, pageCoords: Point) {
const { interaction } = this
const modifierList = getModifierList(interaction)
this.prepareStates(modifierList)

this.edges = extend({}, interaction.edges)
this.startEdges = extend({}, interaction.edges)
this.edges = extend({}, this.startEdges)
this.startOffset = getRectOffset(interaction.rect, pageCoords)
this.startDelta = { x: 0, y: 0 }

Expand All @@ -68,8 +76,8 @@ export default class Modification {
arg.interaction = interaction
arg.interactable = interaction.interactable
arg.element = interaction.element
arg.rect = arg.rect || interaction.rect
arg.edges = this.edges
arg.rect ||= interaction.rect
arg.edges ||= this.startEdges
arg.startOffset = this.startOffset

return arg as ModifierArg
Expand All @@ -85,10 +93,11 @@ export default class Modification {
}

setAll (arg: MethodArg & Partial<ModifierArg>): ModificationResult {
const { phase, preEnd, skipModifiers, rect: unmodifiedRect } = arg
const { phase, preEnd, skipModifiers, rect: unmodifiedRect, edges: unmodifiedEdges } = arg

arg.coords = extend({}, arg.pageCoords)
arg.rect = extend({}, unmodifiedRect)
arg.edges = extend({}, unmodifiedEdges)

const states = skipModifiers ? this.states.slice(skipModifiers) : this.states

Expand All @@ -103,7 +112,7 @@ export default class Modification {
arg.state = state
returnValue = state.methods.set(arg as ModifierArg<never>)

rectUtils.addEdges(this.interaction.edges, arg.rect, {
rectUtils.addEdges(arg.edges, arg.rect, {
x: arg.coords.x - lastModifierCoords.x,
y: arg.coords.y - lastModifierCoords.y,
})
Expand All @@ -112,6 +121,8 @@ export default class Modification {
newResult.eventProps.push(returnValue)
}

extend(this.edges, arg.edges)

newResult.delta.x = arg.coords.x - arg.pageCoords.x
newResult.delta.y = arg.coords.y - arg.pageCoords.y

Expand Down Expand Up @@ -341,6 +352,7 @@ export default class Modification {
copyFrom (other: Modification) {
this.startOffset = other.startOffset
this.startDelta = other.startDelta
this.startEdges = other.startEdges
this.edges = other.edges
this.states = other.states.map((s) => clone(s) as ModifierState)
this.result = createResult(extend({}, other.result.coords), extend({}, other.result.rect))
Expand Down
Loading