Skip to content

Releases: cormacrelf/angular-skyhook

multi-backend v1.0.8: fix for noImplicitAny:true + skipLibCheck:false

25 Jun 12:53
Compare
Choose a tag to compare

v1.0.7: fix TypeScript < 2.7 compatibility

21 Jun 01:57
Compare
Choose a tag to compare

v1.0.6: fix forRoot with plain backends; support testing

19 Jun 12:36
Compare
Choose a tag to compare

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: type annotations on connections

19 Jun 05:06
Compare
Choose a tag to compare

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: noHTML5Preview

18 Jun 16:48
Compare
Choose a tag to compare

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: Publish contents fixed; release multi-backend

18 Jun 11:10
Compare
Choose a tag to compare

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: Stable

08 Jun 21:42
Compare
Choose a tag to compare

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.

Correct Zone for setTimeout/delay/click handlers

08 Jun 20:39
Compare
Choose a tag to compare

a5ec191:

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.