2016-06-23 12:47:54 -04:00
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
*/
|
|
|
|
|
2016-08-12 17:45:36 -04:00
|
|
|
import {ANALYZE_FOR_ENTRY_COMPONENTS, ChangeDetectionStrategy, ChangeDetectorRef, ComponentFactory, ComponentFactoryResolver, ElementRef, Injector, LOCALE_ID as LOCALE_ID_, NgModuleFactory, QueryList, RenderComponentType, Renderer, SecurityContext, SimpleChange, TRANSLATIONS_FORMAT as TRANSLATIONS_FORMAT_, TemplateRef, ViewContainerRef, ViewEncapsulation} from '@angular/core';
|
2016-08-22 20:18:25 -04:00
|
|
|
|
2016-08-24 20:39:49 -04:00
|
|
|
import {AnimationGroupPlayer as AnimationGroupPlayer_, AnimationKeyframe as AnimationKeyframe_, AnimationOutput as AnimationOutput_, AnimationSequencePlayer as AnimationSequencePlayer_, AnimationStyles as AnimationStyles_, AppElement, AppView, ChangeDetectorStatus, CodegenComponentFactoryResolver, DebugAppView, DebugContext, EMPTY_ARRAY, EMPTY_MAP, NgModuleInjector, NoOpAnimationPlayer as NoOpAnimationPlayer_, StaticNodeDebugInfo, TemplateRef_, UNINITIALIZED, ValueUnwrapper, ViewType, ViewUtils, balanceAnimationKeyframes as impBalanceAnimationKeyframes, castByValue, checkBinding, clearStyles as impClearStyles, collectAndResolveStyles as impCollectAndResolveStyles, devModeEqual, flattenNestedViewRenderNodes, interpolate, prepareFinalAnimationStyles as impBalanceAnimationStyles, pureProxy1, pureProxy10, pureProxy2, pureProxy3, pureProxy4, pureProxy5, pureProxy6, pureProxy7, pureProxy8, pureProxy9, reflector, renderStyles as impRenderStyles} from '../core_private';
|
2016-04-28 20:50:03 -04:00
|
|
|
|
|
|
|
import {CompileIdentifierMetadata, CompileTokenMetadata} from './compile_metadata';
|
|
|
|
import {assetUrl} from './util';
|
2016-01-06 17:13:44 -05:00
|
|
|
|
2016-04-28 20:50:03 -04:00
|
|
|
var APP_VIEW_MODULE_URL = assetUrl('core', 'linker/view');
|
|
|
|
var VIEW_UTILS_MODULE_URL = assetUrl('core', 'linker/view_utils');
|
|
|
|
var CD_MODULE_URL = assetUrl('core', 'change_detection/change_detection');
|
2016-01-06 17:13:44 -05:00
|
|
|
|
|
|
|
// Reassign the imports to different variables so we can
|
|
|
|
// define static variables with the name of the import.
|
|
|
|
// (only needed for Dart).
|
2016-04-18 16:24:42 -04:00
|
|
|
var impViewUtils = ViewUtils;
|
2016-01-06 17:13:44 -05:00
|
|
|
var impAppView = AppView;
|
2016-04-29 12:11:57 -04:00
|
|
|
var impDebugAppView = DebugAppView;
|
2016-01-06 17:13:44 -05:00
|
|
|
var impDebugContext = DebugContext;
|
|
|
|
var impAppElement = AppElement;
|
|
|
|
var impElementRef = ElementRef;
|
|
|
|
var impViewContainerRef = ViewContainerRef;
|
|
|
|
var impChangeDetectorRef = ChangeDetectorRef;
|
|
|
|
var impRenderComponentType = RenderComponentType;
|
|
|
|
var impQueryList = QueryList;
|
|
|
|
var impTemplateRef = TemplateRef;
|
|
|
|
var impTemplateRef_ = TemplateRef_;
|
|
|
|
var impValueUnwrapper = ValueUnwrapper;
|
|
|
|
var impInjector = Injector;
|
|
|
|
var impViewEncapsulation = ViewEncapsulation;
|
|
|
|
var impViewType = ViewType;
|
|
|
|
var impChangeDetectionStrategy = ChangeDetectionStrategy;
|
|
|
|
var impStaticNodeDebugInfo = StaticNodeDebugInfo;
|
|
|
|
var impRenderer = Renderer;
|
|
|
|
var impSimpleChange = SimpleChange;
|
2016-07-07 19:35:13 -04:00
|
|
|
var impUNINITIALIZED = UNINITIALIZED;
|
2016-06-27 23:00:30 -04:00
|
|
|
var impChangeDetectorStatus = ChangeDetectorStatus;
|
2016-01-06 17:13:44 -05:00
|
|
|
var impFlattenNestedViewRenderNodes = flattenNestedViewRenderNodes;
|
|
|
|
var impDevModeEqual = devModeEqual;
|
|
|
|
var impInterpolate = interpolate;
|
|
|
|
var impCheckBinding = checkBinding;
|
2016-04-22 18:33:32 -04:00
|
|
|
var impCastByValue = castByValue;
|
2016-04-29 13:43:26 -04:00
|
|
|
var impEMPTY_ARRAY = EMPTY_ARRAY;
|
|
|
|
var impEMPTY_MAP = EMPTY_MAP;
|
2016-05-25 15:46:22 -04:00
|
|
|
var impAnimationGroupPlayer = AnimationGroupPlayer_;
|
|
|
|
var impAnimationSequencePlayer = AnimationSequencePlayer_;
|
|
|
|
var impAnimationKeyframe = AnimationKeyframe_;
|
|
|
|
var impAnimationStyles = AnimationStyles_;
|
|
|
|
var impNoOpAnimationPlayer = NoOpAnimationPlayer_;
|
2016-08-22 20:18:25 -04:00
|
|
|
var impAnimationOutput = AnimationOutput_;
|
2016-05-25 15:46:22 -04:00
|
|
|
|
2016-06-08 19:38:52 -04:00
|
|
|
var ANIMATION_STYLE_UTIL_ASSET_URL = assetUrl('core', 'animation/animation_style_util');
|
2016-01-06 17:13:44 -05:00
|
|
|
|
2016-08-24 20:39:49 -04:00
|
|
|
export interface IdentifierSpec {
|
|
|
|
name: string;
|
|
|
|
moduleUrl: string;
|
|
|
|
runtime: any;
|
|
|
|
}
|
|
|
|
|
2016-01-06 17:13:44 -05:00
|
|
|
export class Identifiers {
|
2016-08-24 20:39:49 -04:00
|
|
|
static ANALYZE_FOR_ENTRY_COMPONENTS: IdentifierSpec = {
|
2016-07-25 03:36:30 -04:00
|
|
|
name: 'ANALYZE_FOR_ENTRY_COMPONENTS',
|
2016-07-07 13:05:55 -04:00
|
|
|
moduleUrl: assetUrl('core', 'metadata/di'),
|
2016-07-25 03:36:30 -04:00
|
|
|
runtime: ANALYZE_FOR_ENTRY_COMPONENTS
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ViewUtils: IdentifierSpec = {
|
|
|
|
name: 'ViewUtils',
|
|
|
|
moduleUrl: assetUrl('core', 'linker/view_utils'),
|
|
|
|
runtime: impViewUtils
|
|
|
|
};
|
|
|
|
static AppView:
|
|
|
|
IdentifierSpec = {name: 'AppView', moduleUrl: APP_VIEW_MODULE_URL, runtime: impAppView};
|
|
|
|
static DebugAppView: IdentifierSpec = {
|
|
|
|
name: 'DebugAppView',
|
|
|
|
moduleUrl: APP_VIEW_MODULE_URL,
|
|
|
|
runtime: impDebugAppView
|
|
|
|
};
|
|
|
|
static AppElement: IdentifierSpec = {
|
|
|
|
name: 'AppElement',
|
|
|
|
moduleUrl: assetUrl('core', 'linker/element'),
|
|
|
|
runtime: impAppElement
|
|
|
|
};
|
|
|
|
static ElementRef: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'ElementRef',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'linker/element_ref'),
|
2016-01-06 17:13:44 -05:00
|
|
|
runtime: impElementRef
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ViewContainerRef: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'ViewContainerRef',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'linker/view_container_ref'),
|
2016-01-06 17:13:44 -05:00
|
|
|
runtime: impViewContainerRef
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ChangeDetectorRef: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'ChangeDetectorRef',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'change_detection/change_detector_ref'),
|
2016-01-06 17:13:44 -05:00
|
|
|
runtime: impChangeDetectorRef
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static RenderComponentType: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'RenderComponentType',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'render/api'),
|
2016-01-06 17:13:44 -05:00
|
|
|
runtime: impRenderComponentType
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static QueryList: IdentifierSpec = {
|
|
|
|
name: 'QueryList',
|
|
|
|
moduleUrl: assetUrl('core', 'linker/query_list'),
|
|
|
|
runtime: impQueryList
|
|
|
|
};
|
|
|
|
static TemplateRef: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'TemplateRef',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'linker/template_ref'),
|
2016-01-06 17:13:44 -05:00
|
|
|
runtime: impTemplateRef
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static TemplateRef_: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'TemplateRef_',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'linker/template_ref'),
|
2016-01-06 17:13:44 -05:00
|
|
|
runtime: impTemplateRef_
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static CodegenComponentFactoryResolver: IdentifierSpec = {
|
2016-06-22 17:06:23 -04:00
|
|
|
name: 'CodegenComponentFactoryResolver',
|
|
|
|
moduleUrl: assetUrl('core', 'linker/component_factory_resolver'),
|
|
|
|
runtime: CodegenComponentFactoryResolver
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ComponentFactoryResolver: IdentifierSpec = {
|
2016-06-22 17:06:23 -04:00
|
|
|
name: 'ComponentFactoryResolver',
|
|
|
|
moduleUrl: assetUrl('core', 'linker/component_factory_resolver'),
|
|
|
|
runtime: ComponentFactoryResolver
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ComponentFactory: IdentifierSpec = {
|
2016-06-28 12:54:42 -04:00
|
|
|
name: 'ComponentFactory',
|
|
|
|
runtime: ComponentFactory,
|
|
|
|
moduleUrl: assetUrl('core', 'linker/component_factory')
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static NgModuleFactory: IdentifierSpec = {
|
2016-07-18 06:50:31 -04:00
|
|
|
name: 'NgModuleFactory',
|
|
|
|
runtime: NgModuleFactory,
|
|
|
|
moduleUrl: assetUrl('core', 'linker/ng_module_factory')
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static NgModuleInjector: IdentifierSpec = {
|
2016-07-18 06:50:31 -04:00
|
|
|
name: 'NgModuleInjector',
|
|
|
|
runtime: NgModuleInjector,
|
|
|
|
moduleUrl: assetUrl('core', 'linker/ng_module_factory')
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ValueUnwrapper: IdentifierSpec = {
|
|
|
|
name: 'ValueUnwrapper',
|
|
|
|
moduleUrl: CD_MODULE_URL,
|
|
|
|
runtime: impValueUnwrapper
|
|
|
|
};
|
|
|
|
static Injector: IdentifierSpec = {
|
|
|
|
name: 'Injector',
|
|
|
|
moduleUrl: assetUrl('core', 'di/injector'),
|
|
|
|
runtime: impInjector
|
|
|
|
};
|
|
|
|
static ViewEncapsulation: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'ViewEncapsulation',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'metadata/view'),
|
2016-01-06 17:13:44 -05:00
|
|
|
runtime: impViewEncapsulation
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static ViewType: IdentifierSpec = {
|
|
|
|
name: 'ViewType',
|
|
|
|
moduleUrl: assetUrl('core', 'linker/view_type'),
|
|
|
|
runtime: impViewType
|
|
|
|
};
|
|
|
|
static ChangeDetectionStrategy: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'ChangeDetectionStrategy',
|
|
|
|
moduleUrl: CD_MODULE_URL,
|
|
|
|
runtime: impChangeDetectionStrategy
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static StaticNodeDebugInfo: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'StaticNodeDebugInfo',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'linker/debug_context'),
|
2016-01-06 17:13:44 -05:00
|
|
|
runtime: impStaticNodeDebugInfo
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static DebugContext: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'DebugContext',
|
2016-04-28 20:50:03 -04:00
|
|
|
moduleUrl: assetUrl('core', 'linker/debug_context'),
|
2016-01-06 17:13:44 -05:00
|
|
|
runtime: impDebugContext
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static Renderer: IdentifierSpec = {
|
|
|
|
name: 'Renderer',
|
|
|
|
moduleUrl: assetUrl('core', 'render/api'),
|
|
|
|
runtime: impRenderer
|
|
|
|
};
|
|
|
|
static SimpleChange:
|
|
|
|
IdentifierSpec = {name: 'SimpleChange', moduleUrl: CD_MODULE_URL, runtime: impSimpleChange};
|
|
|
|
static UNINITIALIZED:
|
|
|
|
IdentifierSpec = {name: 'UNINITIALIZED', moduleUrl: CD_MODULE_URL, runtime: impUNINITIALIZED};
|
|
|
|
static ChangeDetectorStatus: IdentifierSpec = {
|
|
|
|
name: 'ChangeDetectorStatus',
|
|
|
|
moduleUrl: CD_MODULE_URL,
|
|
|
|
runtime: impChangeDetectorStatus
|
|
|
|
};
|
|
|
|
static checkBinding: IdentifierSpec = {
|
|
|
|
name: 'checkBinding',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
|
|
|
runtime: impCheckBinding
|
|
|
|
};
|
|
|
|
static flattenNestedViewRenderNodes: IdentifierSpec = {
|
2016-01-06 17:13:44 -05:00
|
|
|
name: 'flattenNestedViewRenderNodes',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
|
|
|
runtime: impFlattenNestedViewRenderNodes
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static devModeEqual:
|
|
|
|
IdentifierSpec = {name: 'devModeEqual', moduleUrl: CD_MODULE_URL, runtime: impDevModeEqual};
|
|
|
|
static interpolate: IdentifierSpec = {
|
|
|
|
name: 'interpolate',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
|
|
|
runtime: impInterpolate
|
|
|
|
};
|
|
|
|
static castByValue: IdentifierSpec = {
|
|
|
|
name: 'castByValue',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
|
|
|
runtime: impCastByValue
|
|
|
|
};
|
|
|
|
static EMPTY_ARRAY: IdentifierSpec = {
|
|
|
|
name: 'EMPTY_ARRAY',
|
|
|
|
moduleUrl: VIEW_UTILS_MODULE_URL,
|
|
|
|
runtime: impEMPTY_ARRAY
|
|
|
|
};
|
|
|
|
static EMPTY_MAP:
|
|
|
|
IdentifierSpec = {name: 'EMPTY_MAP', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: impEMPTY_MAP};
|
2016-04-29 13:43:26 -04:00
|
|
|
|
2016-04-22 18:33:32 -04:00
|
|
|
static pureProxies = [
|
|
|
|
null,
|
2016-08-24 20:39:49 -04:00
|
|
|
{name: 'pureProxy1', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy1},
|
|
|
|
{name: 'pureProxy2', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy2},
|
|
|
|
{name: 'pureProxy3', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy3},
|
|
|
|
{name: 'pureProxy4', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy4},
|
|
|
|
{name: 'pureProxy5', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy5},
|
|
|
|
{name: 'pureProxy6', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy6},
|
|
|
|
{name: 'pureProxy7', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy7},
|
|
|
|
{name: 'pureProxy8', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy8},
|
|
|
|
{name: 'pureProxy9', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy9},
|
|
|
|
{name: 'pureProxy10', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy10},
|
2016-04-22 18:33:32 -04:00
|
|
|
];
|
2016-08-24 20:39:49 -04:00
|
|
|
static SecurityContext: IdentifierSpec = {
|
feat: security implementation in Angular 2.
Summary:
This adds basic security hooks to Angular 2.
* `SecurityContext` is a private API between core, compiler, and
platform-browser. `SecurityContext` communicates what context a value is used
in across template parser, compiler, and sanitization at runtime.
* `SanitizationService` is the bare bones interface to sanitize values for a
particular context.
* `SchemaElementRegistry.securityContext(tagName, attributeOrPropertyName)`
determines the security context for an attribute or property (it turns out
attributes and properties match for the purposes of sanitization).
Based on these hooks:
* `DomSchemaElementRegistry` decides what sanitization applies in a particular
context.
* `DomSanitizationService` implements `SanitizationService` and adds *Safe
Value*s, i.e. the ability to mark a value as safe and not requiring further
sanitization.
* `url_sanitizer` and `style_sanitizer` sanitize URLs and Styles, respectively
(surprise!).
`DomSanitizationService` is the default implementation bound for browser
applications, in the three contexts (browser rendering, web worker rendering,
server side rendering).
BREAKING CHANGES:
*** SECURITY WARNING ***
Angular 2 Release Candidates do not implement proper contextual escaping yet.
Make sure to correctly escape all values that go into the DOM.
*** SECURITY WARNING ***
Reviewers: IgorMinar
Differential Revision: https://reviews.angular.io/D103
2016-04-29 19:04:08 -04:00
|
|
|
name: 'SecurityContext',
|
|
|
|
moduleUrl: assetUrl('core', 'security'),
|
|
|
|
runtime: SecurityContext,
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static AnimationKeyframe: IdentifierSpec = {
|
2016-05-25 15:46:22 -04:00
|
|
|
name: 'AnimationKeyframe',
|
2016-06-08 19:38:52 -04:00
|
|
|
moduleUrl: assetUrl('core', 'animation/animation_keyframe'),
|
2016-05-25 15:46:22 -04:00
|
|
|
runtime: impAnimationKeyframe
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static AnimationStyles: IdentifierSpec = {
|
2016-05-25 15:46:22 -04:00
|
|
|
name: 'AnimationStyles',
|
2016-06-08 19:38:52 -04:00
|
|
|
moduleUrl: assetUrl('core', 'animation/animation_styles'),
|
2016-05-25 15:46:22 -04:00
|
|
|
runtime: impAnimationStyles
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static NoOpAnimationPlayer: IdentifierSpec = {
|
2016-05-25 15:46:22 -04:00
|
|
|
name: 'NoOpAnimationPlayer',
|
2016-06-08 19:38:52 -04:00
|
|
|
moduleUrl: assetUrl('core', 'animation/animation_player'),
|
2016-05-25 15:46:22 -04:00
|
|
|
runtime: impNoOpAnimationPlayer
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static AnimationGroupPlayer: IdentifierSpec = {
|
2016-05-25 15:46:22 -04:00
|
|
|
name: 'AnimationGroupPlayer',
|
2016-06-08 19:38:52 -04:00
|
|
|
moduleUrl: assetUrl('core', 'animation/animation_group_player'),
|
2016-05-25 15:46:22 -04:00
|
|
|
runtime: impAnimationGroupPlayer
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static AnimationSequencePlayer: IdentifierSpec = {
|
2016-05-25 15:46:22 -04:00
|
|
|
name: 'AnimationSequencePlayer',
|
2016-06-08 19:38:52 -04:00
|
|
|
moduleUrl: assetUrl('core', 'animation/animation_sequence_player'),
|
2016-05-25 15:46:22 -04:00
|
|
|
runtime: impAnimationSequencePlayer
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static prepareFinalAnimationStyles: IdentifierSpec = {
|
2016-06-03 21:27:34 -04:00
|
|
|
name: 'prepareFinalAnimationStyles',
|
2016-05-25 15:46:22 -04:00
|
|
|
moduleUrl: ANIMATION_STYLE_UTIL_ASSET_URL,
|
2016-05-31 12:15:17 -04:00
|
|
|
runtime: impBalanceAnimationStyles
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static balanceAnimationKeyframes: IdentifierSpec = {
|
2016-05-25 15:46:22 -04:00
|
|
|
name: 'balanceAnimationKeyframes',
|
|
|
|
moduleUrl: ANIMATION_STYLE_UTIL_ASSET_URL,
|
2016-05-31 12:15:17 -04:00
|
|
|
runtime: impBalanceAnimationKeyframes
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static clearStyles: IdentifierSpec = {
|
|
|
|
name: 'clearStyles',
|
|
|
|
moduleUrl: ANIMATION_STYLE_UTIL_ASSET_URL,
|
|
|
|
runtime: impClearStyles
|
|
|
|
};
|
|
|
|
static renderStyles: IdentifierSpec = {
|
|
|
|
name: 'renderStyles',
|
|
|
|
moduleUrl: ANIMATION_STYLE_UTIL_ASSET_URL,
|
|
|
|
runtime: impRenderStyles
|
|
|
|
};
|
|
|
|
static collectAndResolveStyles: IdentifierSpec = {
|
2016-05-25 15:46:22 -04:00
|
|
|
name: 'collectAndResolveStyles',
|
|
|
|
moduleUrl: ANIMATION_STYLE_UTIL_ASSET_URL,
|
2016-05-31 12:15:17 -04:00
|
|
|
runtime: impCollectAndResolveStyles
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static LOCALE_ID: IdentifierSpec = {
|
|
|
|
name: 'LOCALE_ID',
|
|
|
|
moduleUrl: assetUrl('core', 'i18n/tokens'),
|
|
|
|
runtime: LOCALE_ID_
|
|
|
|
};
|
|
|
|
static TRANSLATIONS_FORMAT: IdentifierSpec = {
|
2016-08-12 17:45:36 -04:00
|
|
|
name: 'TRANSLATIONS_FORMAT',
|
|
|
|
moduleUrl: assetUrl('core', 'i18n/tokens'),
|
|
|
|
runtime: TRANSLATIONS_FORMAT_
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
static AnimationOutput: IdentifierSpec = {
|
2016-08-22 20:18:25 -04:00
|
|
|
name: 'AnimationOutput',
|
|
|
|
moduleUrl: assetUrl('core', 'animation/animation_output'),
|
|
|
|
runtime: impAnimationOutput
|
2016-08-24 20:39:49 -04:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function resolveIdentifier(identifier: IdentifierSpec) {
|
|
|
|
return new CompileIdentifierMetadata({
|
|
|
|
name: identifier.name,
|
|
|
|
moduleUrl: identifier.moduleUrl,
|
|
|
|
runtime: reflector.resolveType(identifier.name, identifier.moduleUrl) || identifier.runtime
|
2016-08-22 20:18:25 -04:00
|
|
|
});
|
2016-01-06 17:13:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export function identifierToken(identifier: CompileIdentifierMetadata): CompileTokenMetadata {
|
|
|
|
return new CompileTokenMetadata({identifier: identifier});
|
|
|
|
}
|
2016-08-24 20:39:49 -04:00
|
|
|
|
|
|
|
export function resolveIdentifierToken(identifier: IdentifierSpec): CompileTokenMetadata {
|
|
|
|
return identifierToken(resolveIdentifier(identifier));
|
|
|
|
}
|
|
|
|
|
|
|
|
export function resolveEnumIdentifier(
|
|
|
|
enumType: CompileIdentifierMetadata, name: string): CompileIdentifierMetadata {
|
|
|
|
const resolvedEnum = reflector.resolveEnum(enumType, name);
|
|
|
|
if (resolvedEnum) {
|
|
|
|
return new CompileIdentifierMetadata(
|
|
|
|
{name: enumType.name, moduleUrl: enumType.moduleUrl, runtime: resolvedEnum});
|
|
|
|
} else {
|
|
|
|
return new CompileIdentifierMetadata({
|
|
|
|
name: `${enumType.name}.${name}`,
|
|
|
|
moduleUrl: enumType.moduleUrl,
|
|
|
|
runtime: enumType.runtime[name]
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|