@microsoft/fast-element
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.8.1](https://github.com/Microsoft/fast-dna/compare/@microsoft/fast-element@0.8.0...@microsoft/fast-element@0.8.1) (2020-04-29) | ||
### Bug Fixes | ||
* removes circular dependencies from web-component packages ([#3037](https://github.com/Microsoft/fast-dna/issues/3037)) ([0f84942](https://github.com/Microsoft/fast-dna/commit/0f849429ca930bcea474e6e4f73f1f8e21248a0f)) | ||
# [0.8.0](https://github.com/Microsoft/fast-dna/compare/@microsoft/fast-element@0.7.0...@microsoft/fast-element@0.8.0) (2020-04-27) | ||
@@ -8,0 +19,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { FASTElementDefinition } from "./fast-element"; | ||
import { FASTElementDefinition } from "./fast-definitions"; | ||
import { ElementView } from "./view"; | ||
@@ -3,0 +3,0 @@ import { PropertyChangeNotifier } from "./observation/notifier"; |
@@ -1,2 +0,2 @@ | ||
import { FASTElement } from "./fast-element"; | ||
import { getDefinition } from "./fast-definitions"; | ||
import { PropertyChangeNotifier } from "./observation/notifier"; | ||
@@ -163,3 +163,3 @@ import { defaultExecutionContext, Observable } from "./observation/observable"; | ||
} | ||
const definition = FASTElement.getDefinition(element.constructor); | ||
const definition = getDefinition(element.constructor); | ||
if (definition === void 0) { | ||
@@ -166,0 +166,0 @@ throw new Error("Missing fast element definition."); |
import { Controller } from "./controller"; | ||
import { ElementViewTemplate } from "./template"; | ||
import { ElementStyles } from "./styles"; | ||
import { AttributeConfiguration, AttributeDefinition } from "./attributes"; | ||
export declare type PartialFASTElementDefinition = { | ||
readonly name: string; | ||
readonly template?: ElementViewTemplate; | ||
readonly styles?: ElementStyles; | ||
readonly attributes?: (AttributeConfiguration | string)[]; | ||
readonly shadowOptions?: Partial<ShadowRootInit> | null; | ||
readonly elementOptions?: ElementDefinitionOptions; | ||
}; | ||
export declare class FASTElementDefinition { | ||
readonly name: string; | ||
readonly attributes: ReadonlyArray<AttributeDefinition>; | ||
readonly propertyLookup: Record<string, AttributeDefinition>; | ||
readonly attributeLookup: Record<string, AttributeDefinition>; | ||
readonly template?: ElementViewTemplate | undefined; | ||
readonly styles?: ElementStyles | undefined; | ||
readonly shadowOptions?: ShadowRootInit | undefined; | ||
readonly elementOptions?: ElementDefinitionOptions | undefined; | ||
constructor(name: string, attributes: ReadonlyArray<AttributeDefinition>, propertyLookup: Record<string, AttributeDefinition>, attributeLookup: Record<string, AttributeDefinition>, template?: ElementViewTemplate | undefined, styles?: ElementStyles | undefined, shadowOptions?: ShadowRootInit | undefined, elementOptions?: ElementDefinitionOptions | undefined); | ||
} | ||
import { getDefinition, PartialFASTElementDefinition } from "./fast-definitions"; | ||
export declare const FASTElement: { | ||
@@ -560,4 +539,4 @@ new (): { | ||
define<T_4 extends Function>(Type: T_4, nameOrDef?: string | PartialFASTElementDefinition): T_4; | ||
getDefinition<T_5 extends Function>(Type: T_5): FASTElementDefinition | undefined; | ||
getDefinition: typeof getDefinition; | ||
}; | ||
export declare function customElement(nameOrDef: string | PartialFASTElementDefinition): (type: Function) => void; |
@@ -0,18 +1,7 @@ | ||
import { AttributeDefinition } from "./attributes"; | ||
import { Controller } from "./controller"; | ||
import { AttributeDefinition } from "./attributes"; | ||
import { Observable } from "./observation/observable"; | ||
import { fastDefinitions, FASTElementDefinition, getDefinition, } from "./fast-definitions"; | ||
const defaultShadowOptions = { mode: "open" }; | ||
const defaultElementOptions = {}; | ||
export class FASTElementDefinition { | ||
constructor(name, attributes, propertyLookup, attributeLookup, template, styles, shadowOptions, elementOptions) { | ||
this.name = name; | ||
this.attributes = attributes; | ||
this.propertyLookup = propertyLookup; | ||
this.attributeLookup = attributeLookup; | ||
this.template = template; | ||
this.styles = styles; | ||
this.shadowOptions = shadowOptions; | ||
this.elementOptions = elementOptions; | ||
} | ||
} | ||
/* eslint-disable-next-line @typescript-eslint/explicit-function-return-type */ | ||
@@ -39,3 +28,2 @@ function createFASTElement(BaseType) { | ||
} | ||
const fastDefinitions = new Map(); | ||
export const FASTElement = Object.assign(createFASTElement(HTMLElement), { | ||
@@ -79,5 +67,3 @@ from(BaseType) { | ||
}, | ||
getDefinition(Type) { | ||
return fastDefinitions.get(Type); | ||
}, | ||
getDefinition, | ||
}); | ||
@@ -84,0 +70,0 @@ export function customElement(nameOrDef) { |
@@ -5,3 +5,3 @@ { | ||
"sideEffects": false, | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"author": { | ||
@@ -34,3 +34,3 @@ "name": "Microsoft", | ||
}, | ||
"gitHead": "526e002ac76d999f6ab3acea249e63bbc4d79173" | ||
"gitHead": "1e2f25db7314bed4f0aa694ed5cc370ea67affef" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
175939
54
3607