Skip to content

Commit

Permalink
Add clearer code-structure
Browse files Browse the repository at this point in the history
Rename legacy-directives to alias because we will keep them.
Move alias-directory into directives.
Add own NgModule holding only the aliases.
Add own directory for modules.
  • Loading branch information
mralexandernickel committed Sep 11, 2019
1 parent c96253e commit 62a4194
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 40 deletions.
2 changes: 1 addition & 1 deletion projects/ngx-intersection/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mralexandernickel/ngx-intersection",
"version": "0.9.0",
"version": "0.9.1",
"publishConfig": {
"access": "public"
},
Expand Down
24 changes: 0 additions & 24 deletions projects/ngx-intersection/src/lib/angular-intersection.module.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Directive, Output, EventEmitter } from '@angular/core';
import { IntersectionPresentStartOnceDirective } from '../directives/public-api';
import { IntersectionPresentStartOnceDirective } from '../public-api';

@Directive({
selector: '[libEnterViewportOnce]',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Directive, Output, EventEmitter } from '@angular/core';
import { IntersectionPresentStartDirective } from '../directives/public-api';
import { IntersectionPresentStartDirective } from '../public-api';

@Directive({
selector: '[libEnterViewport]',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Directive, Output, EventEmitter } from '@angular/core';
import { IntersectionPresentStartExitDirective } from '../directives/public-api';
import { IntersectionPresentStartExitDirective } from '../public-api';

@Directive({
selector: '[libExitViewport]',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Directive, Output, EventEmitter } from '@angular/core';
import { IntersectionPastStartDirective } from '../directives/public-api';
import { IntersectionPastStartDirective } from '../public-api';

@Directive({
selector: '[libHasEnteredViewport]',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './enter-viewport.directive';
export * from './enter-viewport-once.directive';
export * from './will-enter-viewport.directive';
// export * from './has-entered-viewport.directive';
export * from './has-entered-viewport.directive';
export * from './exit-viewport.directive';
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Directive, Output, EventEmitter } from '@angular/core';
import { IntersectionFutureStartDirective } from '../directives/public-api';
import { IntersectionFutureStartDirective } from '../public-api';

@Directive({
selector: '[libWillEnterViewport]',
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-intersection/src/lib/directives/public-api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './abstract.viewport.directive';
export * from './intersection-directives.module';
export * from './future/public-api';
export * from './past/public-api';
export * from './present/public-api';
export * from './alias/public-api';
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { NgModule } from '@angular/core';
import { directivesAlias } from './intersection-directives-alias.module';
/**
* This module is here only for legacy-reasons, but since it doesn't hold *any*
* own logic we can easily keep on releasing it.
*/
@NgModule({
declarations: directivesAlias,
exports: directivesAlias
})
export class AngularIntersectionModule {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { NgModule } from '@angular/core';
import {
EnterViewportDirective,
EnterViewportOnceDirective,
WillEnterViewportDirective,
ExitViewportDirective,
HasEnteredViewportDirective
} from '../directives/alias/public-api';

export const directivesAlias = [
EnterViewportDirective,
EnterViewportOnceDirective,
WillEnterViewportDirective,
ExitViewportDirective,
HasEnteredViewportDirective
];

@NgModule({
declarations: directivesAlias,
exports: directivesAlias
})
export class IntersectionDirectivesAliasModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
IntersectionFutureEndOnceExitDirective,
IntersectionFutureStartExitDirective,
IntersectionFutureStartOnceExitDirective
} from './future/public-api';
} from '../directives/future/public-api';
import {
IntersectionPastEndDirective,
IntersectionPastEndOnceDirective,
Expand All @@ -18,7 +18,7 @@ import {
IntersectionPastEndOnceExitDirective,
IntersectionPastStartExitDirective,
IntersectionPastStartOnceExitDirective
} from './past/public-api';
} from '../directives/past/public-api';
import {
IntersectionPresentEndDirective,
IntersectionPresentEndOnceDirective,
Expand All @@ -28,7 +28,7 @@ import {
IntersectionPresentEndOnceExitDirective,
IntersectionPresentStartExitDirective,
IntersectionPresentStartOnceExitDirective
} from './present/public-api';
} from '../directives/present/public-api';

export const intersectionDirectives = [
// future
Expand Down
3 changes: 3 additions & 0 deletions projects/ngx-intersection/src/lib/modules/public-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './intersection-directives.module';
export * from './intersection-directives-alias.module';
export * from './angular-intersection.module';
6 changes: 1 addition & 5 deletions projects/ngx-intersection/src/public-api.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
//
// MODULES
// =============================================================================
export * from './lib/angular-intersection.module';
//
// LEGACY DIRECTIVES
// =============================================================================
export * from './lib/legacy-directives/public-api';
export * from './lib/modules/public-api';
//
// SERVICES
// =============================================================================
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/app.component.styl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ $menu--height = ($space--default * 4)
z-index: 10

&.open
mix-blend-mode: normal

svg
path
fill: $color--primary
Expand Down

0 comments on commit 62a4194

Please sign in to comment.