Angular Skyhook Versions Save

An implementation of react-dnd for Angular.

v1.0.8

5 years ago

#5

v1.0.7

5 years ago

See #4

v1.0.6

5 years ago

Fixes SkyhookDndModule.forRoot({ backend: HTML5Backend }), which was failing due to misuse of the very confusing names for BackendFactory.

Also, exposes getHandlerId() to sources and targets so you can use them in your tests.

See here for an example of testing with react-dnd-test-backend.

v1.0.5

5 years ago

You can now do this:

interface InTransit {
  id: number;
}
// ...

// note the <InTransit>
source = this.dnd.dragSource<InTransit>('ITEM', {
  beginDrag: () => ({ id: this.id }),
  isDragging: monitor => {
    // getItem returns InTransit
    return monitor.getItem().id === this.id;
  }
});
// item$ is an Observable<InTransit>
item$ = this.source.listen(m => m.getItem());

target = this.dnd.dropTarget<InTransit>('ITEM', {
  drop: monitor => {
    // getItem returns InTransit
    const { id } = monitor.getItem();
  }
});

By default, the connection creators will try to infer your type from the beginDrag return type.

However, limitations on TypeScript prevent inferring where there is an endDrag method as well. See the comment on DragSourceSpec for why.

It won't cause an error, however; it will just infer that Item is {}.

Lastly, you can even specify the getDroppedItem type, with the second type parameter.

v1.0.4

5 years ago

There is one new @Input() noHTML5Preview on the [dragSource] directive. It applies an empty image for the HTML5 preview as a convenience.

Almost no public API changed as a result of using the dnd-core type annotations, except for the types on the InjectionTokens.

v1.0.3

5 years ago

Previously, the content in the published bundle was

  • dist/*
  • README.md
  • package.json (root)

Now, it's just the output from ng-packagr, i.e. the dist directory.

And angular-skyhook-multi-backend is now available, with versions in lockstep.

v1.0.0

5 years ago

Some changes to the way manual connections are made in this final 1.0 release. The strange DragSource.connect(c => c.dragPreview(...)) API and others have been replaced with nicer ones, like DragSource.connectDragPreview(...).

Otherwise, things are pretty solid. The examples are varied and complex. Give it a go, and file any issues you come across.

v1.0.0-beta.4

5 years ago

a5ec19108b17dcb75ef823e5f4e922fdf764e083:

Now, if you set up timers in the skyhook zone, they will correctly cause change detection when fired. Useful if doing DragLayer.listen(...).delay(1000) and the resulting asynchronous subscribers which tend to call setTimeout at odd times.