diff --git a/packages/animations/browser/index.ts b/packages/animations/browser/index.ts new file mode 100644 index 0000000000..ffe366afa1 --- /dev/null +++ b/packages/animations/browser/index.ts @@ -0,0 +1,14 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +// This file is not used to build this module. It is only used during editing +// by the TypeScript language serivce and during build for verifcation. `ngc` +// replaces this file with production index.ts when it rewrites private symbol +// names. + +export * from './src/browser'; diff --git a/packages/animations/browser/package.json b/packages/animations/browser/package.json new file mode 100644 index 0000000000..584c245aef --- /dev/null +++ b/packages/animations/browser/package.json @@ -0,0 +1,6 @@ +{ + "typings": "../typings/browser/index.d.ts", + "main": "../bundles/animation-browser.umd.js", + "module": "../@angular/animations/browser.es5.js", + "es2015": "../@angular/animations/browser.js" +} diff --git a/packages/animations/browser/public_api.ts b/packages/animations/browser/public_api.ts new file mode 100644 index 0000000000..9275e0d9de --- /dev/null +++ b/packages/animations/browser/public_api.ts @@ -0,0 +1,14 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the animation package. + */ +export * from './src/browser'; diff --git a/packages/animations/browser/rollup.config.js b/packages/animations/browser/rollup.config.js new file mode 100644 index 0000000000..96ab02a275 --- /dev/null +++ b/packages/animations/browser/rollup.config.js @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +export default { + entry: '../../../dist/packages-dist/animations/@angular/animations/browser.es5.js', + dest: '../../../dist/packages-dist/animations/bundles/animations-browser.umd.js', + format: 'umd', + moduleName: 'ng.animations.browser', + globals: { + '@angular/core': 'ng.core', + '@angular/common': 'ng.common', + '@angular/animations': 'ng.animations' + } +}; diff --git a/packages/platform-browser/animations/src/animation_engine.ts b/packages/animations/browser/src/animation_engine.ts similarity index 100% rename from packages/platform-browser/animations/src/animation_engine.ts rename to packages/animations/browser/src/animation_engine.ts diff --git a/packages/animations/browser/src/browser.ts b/packages/animations/browser/src/browser.ts new file mode 100644 index 0000000000..108be7b1ae --- /dev/null +++ b/packages/animations/browser/src/browser.ts @@ -0,0 +1,15 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all animation APIs of the animation browser package. + */ +export {AnimationDriver} from './render/animation_driver'; +export * from './private_export'; diff --git a/packages/platform-browser/animations/src/dsl/animation.ts b/packages/animations/browser/src/dsl/animation.ts similarity index 100% rename from packages/platform-browser/animations/src/dsl/animation.ts rename to packages/animations/browser/src/dsl/animation.ts diff --git a/packages/platform-browser/animations/src/dsl/animation_dsl_visitor.ts b/packages/animations/browser/src/dsl/animation_dsl_visitor.ts similarity index 100% rename from packages/platform-browser/animations/src/dsl/animation_dsl_visitor.ts rename to packages/animations/browser/src/dsl/animation_dsl_visitor.ts diff --git a/packages/platform-browser/animations/src/dsl/animation_timeline_instruction.ts b/packages/animations/browser/src/dsl/animation_timeline_instruction.ts similarity index 100% rename from packages/platform-browser/animations/src/dsl/animation_timeline_instruction.ts rename to packages/animations/browser/src/dsl/animation_timeline_instruction.ts diff --git a/packages/platform-browser/animations/src/dsl/animation_timeline_visitor.ts b/packages/animations/browser/src/dsl/animation_timeline_visitor.ts similarity index 100% rename from packages/platform-browser/animations/src/dsl/animation_timeline_visitor.ts rename to packages/animations/browser/src/dsl/animation_timeline_visitor.ts diff --git a/packages/platform-browser/animations/src/dsl/animation_transition_expr.ts b/packages/animations/browser/src/dsl/animation_transition_expr.ts similarity index 100% rename from packages/platform-browser/animations/src/dsl/animation_transition_expr.ts rename to packages/animations/browser/src/dsl/animation_transition_expr.ts diff --git a/packages/platform-browser/animations/src/dsl/animation_transition_factory.ts b/packages/animations/browser/src/dsl/animation_transition_factory.ts similarity index 100% rename from packages/platform-browser/animations/src/dsl/animation_transition_factory.ts rename to packages/animations/browser/src/dsl/animation_transition_factory.ts diff --git a/packages/platform-browser/animations/src/dsl/animation_transition_instruction.ts b/packages/animations/browser/src/dsl/animation_transition_instruction.ts similarity index 100% rename from packages/platform-browser/animations/src/dsl/animation_transition_instruction.ts rename to packages/animations/browser/src/dsl/animation_transition_instruction.ts diff --git a/packages/platform-browser/animations/src/dsl/animation_trigger.ts b/packages/animations/browser/src/dsl/animation_trigger.ts similarity index 100% rename from packages/platform-browser/animations/src/dsl/animation_trigger.ts rename to packages/animations/browser/src/dsl/animation_trigger.ts diff --git a/packages/platform-browser/animations/src/dsl/animation_validator_visitor.ts b/packages/animations/browser/src/dsl/animation_validator_visitor.ts similarity index 100% rename from packages/platform-browser/animations/src/dsl/animation_validator_visitor.ts rename to packages/animations/browser/src/dsl/animation_validator_visitor.ts diff --git a/packages/platform-browser/animations/src/dsl/style_normalization/animation_style_normalizer.ts b/packages/animations/browser/src/dsl/style_normalization/animation_style_normalizer.ts similarity index 100% rename from packages/platform-browser/animations/src/dsl/style_normalization/animation_style_normalizer.ts rename to packages/animations/browser/src/dsl/style_normalization/animation_style_normalizer.ts diff --git a/packages/platform-browser/animations/src/dsl/style_normalization/web_animations_style_normalizer.ts b/packages/animations/browser/src/dsl/style_normalization/web_animations_style_normalizer.ts similarity index 100% rename from packages/platform-browser/animations/src/dsl/style_normalization/web_animations_style_normalizer.ts rename to packages/animations/browser/src/dsl/style_normalization/web_animations_style_normalizer.ts diff --git a/packages/animations/browser/src/private_export.ts b/packages/animations/browser/src/private_export.ts new file mode 100644 index 0000000000..8ec3f97de9 --- /dev/null +++ b/packages/animations/browser/src/private_export.ts @@ -0,0 +1,15 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +export {AnimationEngine as ɵAnimationEngine} from './animation_engine'; +export {Animation as ɵAnimation} from './dsl/animation'; +export {AnimationStyleNormalizer as ɵAnimationStyleNormalizer, NoopAnimationStyleNormalizer as ɵNoopAnimationStyleNormalizer} from './dsl/style_normalization/animation_style_normalizer'; +export {WebAnimationsStyleNormalizer as ɵWebAnimationsStyleNormalizer} from './dsl/style_normalization/web_animations_style_normalizer'; +export {NoopAnimationDriver as ɵNoopAnimationDriver} from './render/animation_driver'; +export {DomAnimationEngine as ɵDomAnimationEngine} from './render/dom_animation_engine'; +export {NoopAnimationEngine as ɵNoopAnimationEngine} from './render/noop_animation_engine'; +export {WebAnimationsDriver as ɵWebAnimationsDriver, supportsWebAnimations as ɵsupportsWebAnimations} from './render/web_animations/web_animations_driver'; diff --git a/packages/platform-browser/animations/src/render/animation_driver.ts b/packages/animations/browser/src/render/animation_driver.ts similarity index 100% rename from packages/platform-browser/animations/src/render/animation_driver.ts rename to packages/animations/browser/src/render/animation_driver.ts diff --git a/packages/platform-browser/animations/src/render/animation_engine_instruction.ts b/packages/animations/browser/src/render/animation_engine_instruction.ts similarity index 100% rename from packages/platform-browser/animations/src/render/animation_engine_instruction.ts rename to packages/animations/browser/src/render/animation_engine_instruction.ts diff --git a/packages/platform-browser/animations/src/render/dom_animation_engine.ts b/packages/animations/browser/src/render/dom_animation_engine.ts similarity index 100% rename from packages/platform-browser/animations/src/render/dom_animation_engine.ts rename to packages/animations/browser/src/render/dom_animation_engine.ts diff --git a/packages/platform-browser/animations/src/render/noop_animation_engine.ts b/packages/animations/browser/src/render/noop_animation_engine.ts similarity index 100% rename from packages/platform-browser/animations/src/render/noop_animation_engine.ts rename to packages/animations/browser/src/render/noop_animation_engine.ts diff --git a/packages/platform-browser/animations/src/render/web_animations/dom_animation.ts b/packages/animations/browser/src/render/web_animations/dom_animation.ts similarity index 100% rename from packages/platform-browser/animations/src/render/web_animations/dom_animation.ts rename to packages/animations/browser/src/render/web_animations/dom_animation.ts diff --git a/packages/platform-browser/animations/src/render/web_animations/web_animations_driver.ts b/packages/animations/browser/src/render/web_animations/web_animations_driver.ts similarity index 100% rename from packages/platform-browser/animations/src/render/web_animations/web_animations_driver.ts rename to packages/animations/browser/src/render/web_animations/web_animations_driver.ts diff --git a/packages/platform-browser/animations/src/render/web_animations/web_animations_player.ts b/packages/animations/browser/src/render/web_animations/web_animations_player.ts similarity index 100% rename from packages/platform-browser/animations/src/render/web_animations/web_animations_player.ts rename to packages/animations/browser/src/render/web_animations/web_animations_player.ts diff --git a/packages/platform-browser/animations/src/util.ts b/packages/animations/browser/src/util.ts similarity index 100% rename from packages/platform-browser/animations/src/util.ts rename to packages/animations/browser/src/util.ts diff --git a/packages/platform-browser/animations/test/dsl/animation_spec.ts b/packages/animations/browser/test/dsl/animation_spec.ts similarity index 100% rename from packages/platform-browser/animations/test/dsl/animation_spec.ts rename to packages/animations/browser/test/dsl/animation_spec.ts diff --git a/packages/platform-browser/animations/test/dsl/animation_trigger_spec.ts b/packages/animations/browser/test/dsl/animation_trigger_spec.ts similarity index 100% rename from packages/platform-browser/animations/test/dsl/animation_trigger_spec.ts rename to packages/animations/browser/test/dsl/animation_trigger_spec.ts diff --git a/packages/platform-browser/animations/test/dsl/style_normalizer/web_animations_style_normalizer_spec.ts b/packages/animations/browser/test/dsl/style_normalizer/web_animations_style_normalizer_spec.ts similarity index 100% rename from packages/platform-browser/animations/test/dsl/style_normalizer/web_animations_style_normalizer_spec.ts rename to packages/animations/browser/test/dsl/style_normalizer/web_animations_style_normalizer_spec.ts diff --git a/packages/platform-browser/animations/test/engine/dom_animation_engine_spec.ts b/packages/animations/browser/test/engine/dom_animation_engine_spec.ts similarity index 100% rename from packages/platform-browser/animations/test/engine/dom_animation_engine_spec.ts rename to packages/animations/browser/test/engine/dom_animation_engine_spec.ts diff --git a/packages/platform-browser/animations/testing/index.ts b/packages/animations/browser/testing/index.ts similarity index 100% rename from packages/platform-browser/animations/testing/index.ts rename to packages/animations/browser/testing/index.ts diff --git a/packages/platform-browser/animations/testing/package.json b/packages/animations/browser/testing/package.json similarity index 100% rename from packages/platform-browser/animations/testing/package.json rename to packages/animations/browser/testing/package.json diff --git a/packages/animations/browser/testing/rollup.config.js b/packages/animations/browser/testing/rollup.config.js new file mode 100644 index 0000000000..bde5281dad --- /dev/null +++ b/packages/animations/browser/testing/rollup.config.js @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +export default { + entry: '../../../../dist/packages-dist/animations/@angular/animations/browser/testing.es5.js', + dest: '../../../../dist/packages-dist/animations/bundles/animations-browser-testing.umd.js', + format: 'umd', + moduleName: 'ng.animations.browser.testing', + globals: { + '@angular/core': 'ng.core', + '@angular/common': 'ng.common', + '@angular/animations': 'ng.animations' + } +}; diff --git a/packages/platform-browser/animations/testing/src/mock_animation_driver.ts b/packages/animations/browser/testing/src/mock_animation_driver.ts similarity index 100% rename from packages/platform-browser/animations/testing/src/mock_animation_driver.ts rename to packages/animations/browser/testing/src/mock_animation_driver.ts diff --git a/packages/platform-browser/animations/testing/src/testing.ts b/packages/animations/browser/testing/src/testing.ts similarity index 100% rename from packages/platform-browser/animations/testing/src/testing.ts rename to packages/animations/browser/testing/src/testing.ts diff --git a/packages/animations/browser/testing/tsconfig-build.json b/packages/animations/browser/testing/tsconfig-build.json new file mode 100644 index 0000000000..fea449e67c --- /dev/null +++ b/packages/animations/browser/testing/tsconfig-build.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig-build", + "compilerOptions": { + "paths": { + "@angular/animations": ["../../dist/packages/animations"] + } + }, + "files": [ + "index.ts", + "../../../../node_modules/@types/hammerjs/index.d.ts", + "../../../../node_modules/@types/jasmine/index.d.ts", + "../../../../node_modules/zone.js/dist/zone.js.d.ts" + ], + "angularCompilerOptions": { + "strictMetadataEmit": true + } +} diff --git a/packages/animations/browser/tsconfig-build.json b/packages/animations/browser/tsconfig-build.json new file mode 100644 index 0000000000..769bd13ed6 --- /dev/null +++ b/packages/animations/browser/tsconfig-build.json @@ -0,0 +1,20 @@ +{ + "extends": "../tsconfig-build", + + "compilerOptions": { + "paths": { + "@angular/animations": ["../../dist/packages/animations"] + } + }, + "files": [ + "public_api.ts", + "../../../node_modules/zone.js/dist/zone.js.d.ts", + "../../system.d.ts" + ], + "angularCompilerOptions": { + "annotateForClosureCompiler": true, + "strictMetadataEmit": true, + "flatModuleOutFile": "index.js", + "flatModuleId": "@angular/animations/browser" + } +} diff --git a/packages/animations/src/version.ts b/packages/animations/src/version.ts index 1964425208..68ff8e5b3e 100644 --- a/packages/animations/src/version.ts +++ b/packages/animations/src/version.ts @@ -12,7 +12,21 @@ * Entry point for all public APIs of the animation package. */ -import {Version} from '@angular/core'; +/** + * @whatItDoes Represents the version of angular/animations + * + * @stable + */ +export class Version { + constructor(public full: string) {} + + get major(): string { return this.full.split('.')[0]; } + + get minor(): string { return this.full.split('.')[1]; } + + get patch(): string { return this.full.split('.').slice(2).join('.'); } +} + /** * @stable */ diff --git a/packages/animations/tsconfig-build.json b/packages/animations/tsconfig-build.json index 91550f95ce..48195a320d 100644 --- a/packages/animations/tsconfig-build.json +++ b/packages/animations/tsconfig-build.json @@ -8,8 +8,6 @@ "moduleResolution": "node", "outDir": "../../dist/packages/animations", "paths": { - "@angular/core": ["../../dist/packages/core"], - "@angular/core/testing": ["../../dist/packages/core/testing"] }, "rootDir": ".", "sourceMap": true, diff --git a/packages/compiler-cli/integrationtest/src/module.ts b/packages/compiler-cli/integrationtest/src/module.ts index 58c2857b06..10149b33c2 100644 --- a/packages/compiler-cli/integrationtest/src/module.ts +++ b/packages/compiler-cli/integrationtest/src/module.ts @@ -6,9 +6,10 @@ * found in the LICENSE file at https://angular.io/license */ +import {ɵAnimationEngine} from '@angular/animations/browser'; import {ApplicationRef, NgModule, NgZone, Provider, RendererFactory2} from '@angular/core'; import {FormsModule} from '@angular/forms'; -import {NoopAnimationsModule, ɵAnimationEngine, ɵAnimationRendererFactory} from '@angular/platform-browser/animations'; +import {NoopAnimationsModule, ɵAnimationRendererFactory} from '@angular/platform-browser/animations'; import {ServerModule, ɵServerRendererFactory2} from '@angular/platform-server'; import {MdButtonModule} from '@angular2-material/button'; // Note: don't refer to third_party_src as we want to test that diff --git a/packages/core/test/animation/animation_integration_spec.ts b/packages/core/test/animation/animation_integration_spec.ts index 970593d5a0..00c5af35d8 100644 --- a/packages/core/test/animation/animation_integration_spec.ts +++ b/packages/core/test/animation/animation_integration_spec.ts @@ -6,10 +6,11 @@ * found in the LICENSE file at https://angular.io/license */ import {AUTO_STYLE, AnimationEvent, animate, keyframes, state, style, transition, trigger} from '@angular/animations'; +import {AnimationDriver, ɵAnimationEngine} from '@angular/animations/browser'; +import {MockAnimationDriver, MockAnimationPlayer} from '@angular/animations/browser/testing'; import {Component, HostBinding, HostListener, RendererFactory2, ViewChild} from '@angular/core'; import {ɵDomRendererFactory2} from '@angular/platform-browser'; -import {AnimationDriver, BrowserAnimationsModule, ɵAnimationEngine} from '@angular/platform-browser/animations'; -import {MockAnimationDriver, MockAnimationPlayer} from '@angular/platform-browser/animations/testing'; +import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; import {TestBed} from '../../testing'; diff --git a/packages/examples/_common/system-config.ts b/packages/examples/_common/system-config.ts index d99a44038c..590679e329 100644 --- a/packages/examples/_common/system-config.ts +++ b/packages/examples/_common/system-config.ts @@ -11,6 +11,7 @@ System.config({ '@angular/common': '/vendor/@angular/common/bundles/common.umd.js', '@angular/compiler': '/vendor/@angular/compiler/bundles/compiler.umd.js', '@angular/animations': '/vendor/@angular/animations/bundles/animations.umd.js', + '@angular/animations/browser': '/vendor/@angular/animations/bundles/animations-browser.umd.js', '@angular/platform-browser/animations': '/vendor/@angular/platform-browser/bundles/platform-browser-animations.umd.js', '@angular/core': '/vendor/@angular/core/bundles/core.umd.js', diff --git a/packages/examples/core/animation/ts/dsl/animation_example.ts b/packages/examples/core/animation/ts/dsl/animation_example.ts index d0cec6075b..f561085b58 100644 --- a/packages/examples/core/animation/ts/dsl/animation_example.ts +++ b/packages/examples/core/animation/ts/dsl/animation_example.ts @@ -7,7 +7,8 @@ */ // #docregion Component -import {Component, NgModule, animate, state, style, transition, trigger} from '@angular/core'; +import {animate, state, style, transition, trigger} from '@angular/animations'; +import {Component, NgModule} from '@angular/core'; import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; @Component({ diff --git a/packages/platform-browser/animations/index.ts b/packages/platform-browser/animations/index.ts index 1904b8e43c..05e6b19532 100644 --- a/packages/platform-browser/animations/index.ts +++ b/packages/platform-browser/animations/index.ts @@ -11,4 +11,4 @@ // replaces this file with production index.ts when it rewrites private symbol // names. -export * from './src/animations'; +export * from './public_api'; diff --git a/packages/platform-browser/animations/src/render/animation_renderer.ts b/packages/platform-browser/animations/src/animation_renderer.ts similarity index 97% rename from packages/platform-browser/animations/src/render/animation_renderer.ts rename to packages/platform-browser/animations/src/animation_renderer.ts index 319501189e..6da022fccb 100644 --- a/packages/platform-browser/animations/src/render/animation_renderer.ts +++ b/packages/platform-browser/animations/src/animation_renderer.ts @@ -5,11 +5,10 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -import {AnimationEvent, AnimationTriggerMetadata} from '@angular/animations'; +import {AnimationTriggerMetadata} from '@angular/animations'; +import {ɵAnimationEngine as AnimationEngine} from '@angular/animations/browser'; import {Injectable, NgZone, Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2} from '@angular/core'; -import {AnimationEngine} from '../animation_engine'; - @Injectable() export class AnimationRendererFactory implements RendererFactory2 { constructor( diff --git a/packages/platform-browser/animations/src/animations.ts b/packages/platform-browser/animations/src/animations.ts index 49a6a9c6eb..919817e66e 100644 --- a/packages/platform-browser/animations/src/animations.ts +++ b/packages/platform-browser/animations/src/animations.ts @@ -12,5 +12,4 @@ * Entry point for all animation APIs of the animation browser package. */ export {BrowserAnimationsModule, NoopAnimationsModule} from './module'; -export {AnimationDriver} from './render/animation_driver'; export * from './private_export'; diff --git a/packages/platform-browser/animations/src/module.ts b/packages/platform-browser/animations/src/module.ts index 7eb858fd0d..effd444d2f 100644 --- a/packages/platform-browser/animations/src/module.ts +++ b/packages/platform-browser/animations/src/module.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ import {NgModule} from '@angular/core'; -import {BrowserModule, ɵDomRendererFactory2} from '@angular/platform-browser'; +import {BrowserModule} from '@angular/platform-browser'; import {BROWSER_ANIMATIONS_PROVIDERS, BROWSER_NOOP_ANIMATIONS_PROVIDERS} from './providers'; diff --git a/packages/platform-browser/animations/src/private_export.ts b/packages/platform-browser/animations/src/private_export.ts index ce1194ce24..f1411716df 100644 --- a/packages/platform-browser/animations/src/private_export.ts +++ b/packages/platform-browser/animations/src/private_export.ts @@ -5,9 +5,4 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -export {AnimationEngine as ɵAnimationEngine} from './animation_engine'; -export {Animation as ɵAnimation} from './dsl/animation'; -export {AnimationStyleNormalizer as ɵAnimationStyleNormalizer, NoopAnimationStyleNormalizer as ɵNoopAnimationStyleNormalizer} from './dsl/style_normalization/animation_style_normalizer'; -export {NoopAnimationDriver as ɵNoopAnimationDriver} from './render/animation_driver'; -export {AnimationRenderer as ɵAnimationRenderer, AnimationRendererFactory as ɵAnimationRendererFactory} from './render/animation_renderer'; -export {DomAnimationEngine as ɵDomAnimationEngine} from './render/dom_animation_engine'; +export {AnimationRenderer as ɵAnimationRenderer, AnimationRendererFactory as ɵAnimationRendererFactory} from './animation_renderer'; diff --git a/packages/platform-browser/animations/src/providers.ts b/packages/platform-browser/animations/src/providers.ts index 1498c228b5..7c700aa65c 100644 --- a/packages/platform-browser/animations/src/providers.ts +++ b/packages/platform-browser/animations/src/providers.ts @@ -6,17 +6,11 @@ * found in the LICENSE file at https://angular.io/license */ +import {AnimationDriver, ɵAnimationEngine as AnimationEngine, ɵAnimationStyleNormalizer as AnimationStyleNormalizer, ɵDomAnimationEngine as DomAnimationEngine, ɵNoopAnimationDriver as NoopAnimationDriver, ɵNoopAnimationEngine as NoopAnimationEngine, ɵWebAnimationsDriver as WebAnimationsDriver, ɵWebAnimationsStyleNormalizer as WebAnimationsStyleNormalizer, ɵsupportsWebAnimations as supportsWebAnimations} from '@angular/animations/browser'; import {Injectable, NgZone, Provider, RendererFactory2} from '@angular/core'; -import {ɵDomRendererFactory2} from '@angular/platform-browser'; +import {ɵDomRendererFactory2 as DomRendererFactory2} from '@angular/platform-browser'; -import {AnimationEngine} from './animation_engine'; -import {AnimationStyleNormalizer} from './dsl/style_normalization/animation_style_normalizer'; -import {WebAnimationsStyleNormalizer} from './dsl/style_normalization/web_animations_style_normalizer'; -import {AnimationDriver, NoopAnimationDriver} from './render/animation_driver'; -import {AnimationRendererFactory} from './render/animation_renderer'; -import {DomAnimationEngine} from './render/dom_animation_engine'; -import {NoopAnimationEngine} from './render/noop_animation_engine'; -import {WebAnimationsDriver, supportsWebAnimations} from './render/web_animations/web_animations_driver'; +import {AnimationRendererFactory} from './animation_renderer'; @Injectable() export class InjectableAnimationEngine extends DomAnimationEngine { @@ -37,7 +31,7 @@ export function instantiateDefaultStyleNormalizer() { } export function instantiateRendererFactory( - renderer: ɵDomRendererFactory2, engine: AnimationEngine, zone: NgZone) { + renderer: DomRendererFactory2, engine: AnimationEngine, zone: NgZone) { return new AnimationRendererFactory(renderer, engine, zone); } @@ -51,7 +45,7 @@ export const BROWSER_ANIMATIONS_PROVIDERS: Provider[] = [ {provide: AnimationEngine, useClass: InjectableAnimationEngine}, { provide: RendererFactory2, useFactory: instantiateRendererFactory, - deps: [ɵDomRendererFactory2, AnimationEngine, NgZone] + deps: [DomRendererFactory2, AnimationEngine, NgZone] } ]; @@ -63,6 +57,6 @@ export const BROWSER_NOOP_ANIMATIONS_PROVIDERS: Provider[] = [ {provide: AnimationEngine, useClass: NoopAnimationEngine}, { provide: RendererFactory2, useFactory: instantiateRendererFactory, - deps: [ɵDomRendererFactory2, AnimationEngine, NgZone] + deps: [DomRendererFactory2, AnimationEngine, NgZone] } -]; \ No newline at end of file +]; diff --git a/packages/platform-browser/animations/test/noop_animation_engine_spec.ts b/packages/platform-browser/animations/test/noop_animation_engine_spec.ts index 114bbd2f2f..ef36ba1211 100644 --- a/packages/platform-browser/animations/test/noop_animation_engine_spec.ts +++ b/packages/platform-browser/animations/test/noop_animation_engine_spec.ts @@ -6,10 +6,9 @@ * found in the LICENSE file at https://angular.io/license */ import {state, style, trigger} from '@angular/animations'; +import {ɵNoopAnimationEngine as NoopAnimationEngine} from '@angular/animations/browser'; import {el} from '@angular/platform-browser/testing/src/browser_util'; -import {NoopAnimationEngine} from '../src/render/noop_animation_engine'; - export function main() { describe('NoopAnimationEngine', () => { let captures: string[] = []; diff --git a/packages/platform-browser/animations/test/noop_animations_module_spec.ts b/packages/platform-browser/animations/test/noop_animations_module_spec.ts index 56d0182ba0..0735104a85 100644 --- a/packages/platform-browser/animations/test/noop_animations_module_spec.ts +++ b/packages/platform-browser/animations/test/noop_animations_module_spec.ts @@ -5,12 +5,12 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -import {animate, state, style, transition, trigger} from '@angular/animations'; +import {animate, style, transition, trigger} from '@angular/animations'; +import {ɵAnimationEngine, ɵNoopAnimationEngine} from '@angular/animations/browser'; import {Component} from '@angular/core'; import {TestBed} from '@angular/core/testing'; -import {ɵAnimationEngine} from '@angular/platform-browser/animations'; + import {NoopAnimationsModule} from '../src/module'; -import {NoopAnimationEngine} from '../src/render/noop_animation_engine'; export function main() { describe('NoopAnimationsModule', () => { @@ -18,7 +18,7 @@ export function main() { it('the engine should be a Noop engine', () => { const engine = TestBed.get(ɵAnimationEngine); - expect(engine instanceof NoopAnimationEngine).toBeTruthy(); + expect(engine instanceof ɵNoopAnimationEngine).toBeTruthy(); }); it('should flush and fire callbacks when the zone becomes stable', (async) => { diff --git a/packages/platform-browser/animations/testing/rollup.config.js b/packages/platform-browser/animations/testing/rollup.config.js deleted file mode 100644 index 0ee8058d39..0000000000 --- a/packages/platform-browser/animations/testing/rollup.config.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -export default { - entry: - '../../../../dist/packages-dist/platform-browser/@angular/platform-browser/animations/testing.es5.js', - dest: - '../../../../dist/packages-dist/platform-browser/bundles/platform-browser-animations-testing.umd.js', - format: 'umd', - moduleName: 'ng.platformBrowser.testing', - globals: { - '@angular/core': 'ng.core', - '@angular/common': 'ng.common', - '@angular/platform-browser': 'ng.platformBrowser' - } -}; diff --git a/packages/platform-browser/animations/testing/tsconfig-build.json b/packages/platform-browser/animations/testing/tsconfig-build.json deleted file mode 100644 index 661aed0ea3..0000000000 --- a/packages/platform-browser/animations/testing/tsconfig-build.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": "../../tsconfig-build", - "compilerOptions": { - "outDir": "../../../../dist/packages/platform-browser", - "paths": { - "@angular/core": ["../../dist/packages/core"], - "@angular/core/testing": ["../../dist/packages/core/testing"], - "@angular/animations": ["../../dist/packages/animations"], - "@angular/platform-browser": ["../../dist/packages/platform-browser"], - "@angular/platform-browser/animations": ["../../dist/packages/platform-browser/animations"], - "@angular/common": ["../../dist/packages/common"], - "@angular/common/testing": ["../../dist/packages/common/testing"] - } - }, - "files": [ - "index.ts", - "../../../../node_modules/@types/hammerjs/index.d.ts", - "../../../../node_modules/@types/jasmine/index.d.ts", - "../../../../node_modules/zone.js/dist/zone.js.d.ts" - ], - "angularCompilerOptions": { - "strictMetadataEmit": true - } -} diff --git a/packages/platform-browser/animations/tsconfig-build.json b/packages/platform-browser/animations/tsconfig-build.json index 14bb7a3c08..b73d97145d 100644 --- a/packages/platform-browser/animations/tsconfig-build.json +++ b/packages/platform-browser/animations/tsconfig-build.json @@ -2,12 +2,12 @@ "extends": "../tsconfig-build", "compilerOptions": { - "outDir": "../../../dist/packages/platform-browser", "paths": { "rxjs/*": ["../../node_modules/rxjs/*"], "@angular/core": ["../../dist/packages/core"], "@angular/core/testing": ["../../dist/packages/core/testing"], "@angular/animations": ["../../dist/packages/animations"], + "@angular/animations/browser": ["../../dist/packages/animations/browser"], "@angular/platform-browser": ["../../dist/packages/platform-browser"] } }, diff --git a/packages/platform-browser/test/animation/animation_renderer_spec.ts b/packages/platform-browser/test/animation/animation_renderer_spec.ts index 66fb69c4f6..cc8cf3d199 100644 --- a/packages/platform-browser/test/animation/animation_renderer_spec.ts +++ b/packages/platform-browser/test/animation/animation_renderer_spec.ts @@ -6,9 +6,10 @@ * found in the LICENSE file at https://angular.io/license */ import {AnimationPlayer, AnimationTriggerMetadata, animate, state, style, transition, trigger} from '@angular/animations'; +import {ɵAnimationEngine} from '@angular/animations/browser'; import {Component, Injectable, RendererFactory2, RendererType2, ViewChild} from '@angular/core'; import {TestBed} from '@angular/core/testing'; -import {BrowserAnimationsModule, ɵAnimationEngine, ɵAnimationRendererFactory} from '@angular/platform-browser/animations'; +import {BrowserAnimationsModule, ɵAnimationRendererFactory} from '@angular/platform-browser/animations'; import {InjectableAnimationEngine} from '../../animations/src/providers'; import {el} from '../../testing/src/browser_util'; diff --git a/test-main.js b/test-main.js index 6130b6410d..1627fbd7fd 100644 --- a/test-main.js +++ b/test-main.js @@ -33,6 +33,8 @@ System.config({ packages: { '@angular/core/testing': {main: 'index.js', defaultExtension: 'js'}, '@angular/core': {main: 'index.js', defaultExtension: 'js'}, + '@angular/animations/browser/testing': {main: 'index.js', defaultExtension: 'js'}, + '@angular/animations/browser': {main: 'index.js', defaultExtension: 'js'}, '@angular/animations/testing': {main: 'index.js', defaultExtension: 'js'}, '@angular/animations': {main: 'index.js', defaultExtension: 'js'}, '@angular/compiler/testing': {main: 'index.js', defaultExtension: 'js'}, diff --git a/tools/gulp-tasks/public-api.js b/tools/gulp-tasks/public-api.js index 380bdca8b1..be79b22c47 100644 --- a/tools/gulp-tasks/public-api.js +++ b/tools/gulp-tasks/public-api.js @@ -19,8 +19,9 @@ const entrypoints = [ 'dist/packages-dist/http/typings/http.d.ts', 'dist/packages-dist/http/typings/testing/index.d.ts', 'dist/packages-dist/forms/typings/forms.d.ts', 'dist/packages-dist/router/typings/router.d.ts', 'dist/packages-dist/animations/typings/animations.d.ts', - 'dist/packages-dist/platform-browser/typings/animations/index.d.ts', - 'dist/packages-dist/platform-browser/typings/animations/testing/index.d.ts' + 'dist/packages-dist/animations/typings/browser/index.d.ts', + 'dist/packages-dist/animations/typings/browser/testing/index.d.ts', + 'dist/packages-dist/platform-browser/typings/animations/index.d.ts' ]; const publicApiDir = 'tools/public_api_guard'; diff --git a/tools/public_api_guard/animations/typings/browser/index.d.ts b/tools/public_api_guard/animations/typings/browser/index.d.ts new file mode 100644 index 0000000000..26904af387 --- /dev/null +++ b/tools/public_api_guard/animations/typings/browser/index.d.ts @@ -0,0 +1,7 @@ +/** @experimental */ +export declare abstract class AnimationDriver { + abstract animate(element: any, keyframes: { + [key: string]: string | number; + }[], duration: number, delay: number, easing: string, previousPlayers?: any[]): any; + static NOOP: AnimationDriver; +} diff --git a/tools/public_api_guard/animations/typings/browser/testing/index.d.ts b/tools/public_api_guard/animations/typings/browser/testing/index.d.ts new file mode 100644 index 0000000000..8452f075a0 --- /dev/null +++ b/tools/public_api_guard/animations/typings/browser/testing/index.d.ts @@ -0,0 +1,27 @@ +/** @experimental */ +export declare class MockAnimationDriver implements AnimationDriver { + animate(element: any, keyframes: { + [key: string]: string | number; + }[], duration: number, delay: number, easing: string, previousPlayers?: any[]): MockAnimationPlayer; + static log: AnimationPlayer[]; +} + +/** @experimental */ +export declare class MockAnimationPlayer extends NoopAnimationPlayer { + delay: number; + duration: number; + easing: string; + element: any; + keyframes: { + [key: string]: string | number; + }[]; + previousPlayers: any[]; + previousStyles: { + [key: string]: string | number; + }; + constructor(element: any, keyframes: { + [key: string]: string | number; + }[], duration: number, delay: number, easing: string, previousPlayers: any[]); + destroy(): void; + finish(): void; +} diff --git a/tools/public_api_guard/platform-browser/typings/animations/index.d.ts b/tools/public_api_guard/platform-browser/typings/animations/index.d.ts index 786f09b601..f9a80e456c 100644 --- a/tools/public_api_guard/platform-browser/typings/animations/index.d.ts +++ b/tools/public_api_guard/platform-browser/typings/animations/index.d.ts @@ -1,11 +1,3 @@ -/** @experimental */ -export declare abstract class AnimationDriver { - abstract animate(element: any, keyframes: { - [key: string]: string | number; - }[], duration: number, delay: number, easing: string, previousPlayers?: any[]): any; - static NOOP: AnimationDriver; -} - /** @experimental */ export declare class BrowserAnimationsModule { }