Skip to content

Commit

Permalink
v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
taye committed Jul 14, 2019
1 parent ff1b219 commit 16e5668
Show file tree
Hide file tree
Showing 31 changed files with 1,015 additions and 754 deletions.
2 changes: 1 addition & 1 deletion packages/actions/resize.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ declare const resize: {
topright: string;
bottomleft: string;
};
getCursor(action: ActionProps<any>): any;
getCursor({ edges, axis, name }: ActionProps<any>): string;
defaultMargin: number;
};
export default resize;
22 changes: 11 additions & 11 deletions packages/actions/resize.js

Large diffs are not rendered by default.

30 changes: 20 additions & 10 deletions packages/auto-start/autoStart.spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions packages/auto-start/base.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/core/interactionFinder.js

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions packages/core/tests/_helpers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & Touch & MouseEvent) | ({
coords: MockCoords;
readonly page: any;
Expand All @@ -99,6 +100,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & Touch & PointerEvent) | ({
coords: MockCoords;
readonly page: any;
Expand All @@ -112,6 +114,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & Touch & TouchEvent) | ({
coords: MockCoords;
readonly page: any;
Expand All @@ -125,6 +128,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & Touch & import("@interactjs/core/InteractEvent").InteractEvent<any, any>) | ({
coords: MockCoords;
readonly page: any;
Expand All @@ -138,6 +142,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & MouseEvent) | ({
coords: MockCoords;
readonly page: any;
Expand All @@ -151,6 +156,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & MouseEvent & PointerEvent) | ({
coords: MockCoords;
readonly page: any;
Expand All @@ -164,6 +170,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & MouseEvent & TouchEvent) | ({
coords: MockCoords;
readonly page: any;
Expand All @@ -177,6 +184,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & MouseEvent & import("@interactjs/core/InteractEvent").InteractEvent<any, any>) | ({
coords: MockCoords;
readonly page: any;
Expand All @@ -190,6 +198,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & PointerEvent & MouseEvent) | ({
coords: MockCoords;
readonly page: any;
Expand All @@ -203,6 +212,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & PointerEvent) | ({
coords: MockCoords;
readonly page: any;
Expand All @@ -216,6 +226,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & PointerEvent & TouchEvent) | ({
coords: MockCoords;
readonly page: any;
Expand All @@ -229,6 +240,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & PointerEvent & import("@interactjs/core/InteractEvent").InteractEvent<any, any>) | ({
coords: MockCoords;
readonly page: any;
Expand All @@ -242,6 +254,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & import("@interactjs/core/InteractEvent").InteractEvent<any, any> & MouseEvent) | ({
coords: MockCoords;
readonly page: any;
Expand All @@ -255,6 +268,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & import("@interactjs/core/InteractEvent").InteractEvent<any, any> & PointerEvent) | ({
coords: MockCoords;
readonly page: any;
Expand All @@ -268,6 +282,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & import("@interactjs/core/InteractEvent").InteractEvent<any, any> & TouchEvent) | ({
coords: MockCoords;
readonly page: any;
Expand All @@ -281,6 +296,7 @@ export declare function testEnv<T extends Interact.Target = HTMLElement>({ plugi
readonly target: any;
readonly type: any;
readonly pointerType: any;
readonly buttons: any;
} & import("@interactjs/core/InteractEvent").InteractEvent<any, any>);
};
export declare function timeout(n: any): Promise<unknown>;
2 changes: 1 addition & 1 deletion packages/interactjs/dist/api/doclets.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions packages/interactjs/dist/api/packages_actions_resize.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -268,26 +268,26 @@ <h1 class="page-title">packages/actions/resize.ts</h1>

cursors: null as ReturnType&lt;typeof initCursors>,

getCursor (action: ActionProps) {
getCursor ({ edges, axis, name }: ActionProps) {
const cursors = resize.cursors
let result: string = null

if (action.axis) {
return cursors[action.name + action.axis]
if (axis) {
result = cursors[name + axis]
}
else if (action.edges) {
else if (edges) {
let cursorKey = ''
const edgeNames = ['top', 'bottom', 'left', 'right']

for (let i = 0; i &lt; 4; i++) {
if (action.edges[edgeNames[i]]) {
cursorKey += edgeNames[i]
for (const edge of ['top', 'bottom', 'left', 'right']) {
if (edges[edge]) {
cursorKey += edge
}
}

return cursors[cursorKey]
result = cursors[cursorKey]
}

return null
return result
},

defaultMargin: null as number,
Expand Down
18 changes: 15 additions & 3 deletions packages/interactjs/dist/api/packages_auto-start_base.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,21 @@ <h1 class="page-title">packages/auto-start/base.ts</h1>
? interactable.getRect(element)
: null

if (interactable &amp;&amp; interactable.options.styleCursor) {
const cursor = action ? scope.actions[action.name].getCursor(action) : ''
setCursor(interaction.element as HTMLElement, cursor, scope)
if (interaction.pointerType === 'mouse' &amp;&amp; interactable &amp;&amp; interactable.options.styleCursor) {
let cursor = ''

if (action) {
const { cursorChecker } = interactable.options[action.name]

if (utils.is.func(cursorChecker)) {
cursor = cursorChecker(action, interactable, element)
}
else {
cursor = scope.actions[action.name].getCursor(action)
}
}

setCursor(interaction.element as HTMLElement, cursor || '', scope)
}

scope.autoStart.signals.fire('prepared', { interaction })
Expand Down
Loading

0 comments on commit 16e5668

Please sign in to comment.