Skip to content

Commit

Permalink
Merge pull request #191 from TAMULib/sprint9-staging-fixes
Browse files Browse the repository at this point in the history
Sprint9 staging fixes
  • Loading branch information
jeremythuff committed Aug 13, 2020
2 parents 6d8ad3d + 02d93c0 commit a3155d8
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 39 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [1.3.0] - 08-13-20
### Resolves

Weaver Components should have an element query strategy. (#27)
Icons should be integrated into weaver buttons. (#128)
Weaver Components should support lists with expanding and collapsing sections. (#163)
The Wvr Icon component should support animation. (#164)
Weaver Components should have a list component. (#165)
Coveralls not providing the coverage notification. (#167)
Observable subscriptions should be unsubscribed from or converted to promises. (#168)

## [0.0.5] - 05-14-2020
### Resolves

Expand Down
2 changes: 1 addition & 1 deletion defaults.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
#

BASE_URL=https://labs.library.tamu.edu/wvr-components/latest
ASSET_URL=https://labs.library.tamu.edu/wvr-components/latest/assets
ASSETS_URL=https://labs.library.tamu.edu/wvr-components/latest/assets
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "git",
"url": "git+https://github.com/TAMULib/weaver-components.git"
},
"version": "1.3.0-rc",
"version": "1.3.0",
"private": false,
"license": "MIT",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion projects/wvr-elements/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wvr/elements",
"version": "1.3.0-rc2",
"version": "1.3.0",
"description": "Collection of angular components for Weaver's Custom Web Component UI",
"author": "Texas A&M University Libraries",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion projects/wvr-elements/src/lib/core/app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { InjectionToken } from '@angular/core';

export interface AppConfig {
baseUrl?: string;
assetUrl?: string;
assetsUrl?: string;
}

export const blankConfig: AppConfig = {};
Expand Down
2 changes: 1 addition & 1 deletion projects/wvr-elements/src/lib/core/icon.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class IconService {

private fetchIcon(set: IconSet, name: string): Observable<string> {

return this.http.get(`${this.appConfig.assetUrl}/icons/${set.name}/${name}.svg`, { responseType: 'text' })
return this.http.get(`${this.appConfig.assetsUrl}/icons/${set.name}/${name}.svg`, { responseType: 'text' })
.pipe(share());
}

Expand Down
65 changes: 32 additions & 33 deletions projects/wvr-elements/src/lib/core/wvr-animation.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class WvrAnimationService {

constructor(private readonly builder: AnimationBuilder) { }

registerAnimationReciever(recieverName: string, component: WvrBaseComponent): void {
registerAnimationTargets(recieverName: string, component: WvrBaseComponent): void {
let recievers = this.recieversRegistry.get(recieverName);
if (!recievers) {
recievers = new Array<WvrBaseComponent>();
Expand All @@ -30,7 +30,6 @@ export class WvrAnimationService {
this.animationStates.set(id, new Map<string, boolean>());

return id;

}

triggerAnimationReciever(recieverName: string): void {
Expand All @@ -54,37 +53,7 @@ export class WvrAnimationService {
});
}

compileAnimation(stateId, animationName, value): AnimationMetadata | Array<AnimationMetadata> {

const a = wvrAnimations[animationName];

if (!a) {
console.warn(`${animationName} not a known animation.`);

return undefined;
}

return a(this.animationStates.get(stateId), value);
}

selectAnimation(stateId: number, animationName: string, timing: string,
to: string, from: string, animationRoot: HTMLElement): AnimationReferenceMetadata {

const animationInput: AnimationMetadata | Array<AnimationMetadata> =
this.compileAnimation(stateId, animationName, animationRoot);

if (animationInput) {
return useAnimation(animation(animationInput), {
params: {
timing,
to,
from
}
});
}
}

playAnimation(stateId: number, animationName: string, animationConfig: {}, animationRoot: HTMLElement): void {
playAnimation(stateId: number, animationName: string, animationConfig: {}, animationRoot: HTMLElement): AnimationPlayer {

const timing = animationConfig[animationName] ?
animationConfig[animationName].timing :
Expand All @@ -102,7 +71,37 @@ export class WvrAnimationService {
.build(a);
const player: AnimationPlayer = animationFactory.create(animationRoot);
player.play();

return player;
}
}

private selectAnimation(stateId: number, animationName: string, timing: string,
to: string, from: string, animationRoot: HTMLElement): AnimationReferenceMetadata {

const animationInput: AnimationMetadata | Array<AnimationMetadata> =
this.compileAnimation(stateId, animationName, animationRoot);

return useAnimation(animation(animationInput), {
params: {
timing,
to,
from
}
});
}

private compileAnimation(stateId, animationName, value): AnimationMetadata | Array<AnimationMetadata> {

const a = wvrAnimations[animationName];

if (!a) {
console.warn(`${animationName} not a known animation.`);

return [];
}

return a(this.animationStates.get(stateId), value);
}

}
2 changes: 1 addition & 1 deletion projects/wvr-elements/src/lib/shared/wvr-base.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export abstract class WvrBaseComponent implements AfterContentInit, OnInit {
const animationEvents = Object.keys(this._animationSettings);
if (animationEvents.length) {
if (this.animateId) {
this._animationService.registerAnimationReciever(this.animateId, this);
this._animationService.registerAnimationTargets(this.animateId, this);
}
this.animationStateId = this._animationService.registerAnimationStates();
animationEvents.forEach(eventName => {
Expand Down
1 change: 1 addition & 0 deletions projects/wvr-elements/src/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export * from './lib/shared/wvr-base.component';
export * from './lib/shared/alignment.enum';
export * from './lib/core/app-config';
export * from './lib/wvr-button/wvr-button.component';
export * from './lib/wvr-dropdown/wvr-dropdown.component';
export * from './lib/wvr-footer/wvr-footer.component';
Expand Down

0 comments on commit a3155d8

Please sign in to comment.