@microsoft/fast-element
Advanced tools
Comparing version 1.8.0 to 1.9.0
@@ -5,6 +5,48 @@ { | ||
{ | ||
"date": "Tue, 08 Mar 2022 07:10:44 GMT", | ||
"date": "Wed, 06 Apr 2022 07:10:25 GMT", | ||
"tag": "@microsoft/fast-element_v1.9.0", | ||
"version": "1.9.0", | ||
"comments": { | ||
"minor": [ | ||
{ | ||
"comment": "convert fast-element to type:module", | ||
"author": "nicholasrice@users.noreply.github.com", | ||
"commit": "ead7f7340654236f2503359e2fc6f0b41639b507", | ||
"package": "@microsoft/fast-element" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Sun, 03 Apr 2022 07:12:01 GMT", | ||
"tag": "@microsoft/fast-element_v1.8.0", | ||
"version": "1.8.0", | ||
"comments": { | ||
"none": [ | ||
{ | ||
"comment": "Fixed a typo in a doc example", | ||
"author": "47367562+bheston@users.noreply.github.com", | ||
"commit": "35913ce3a2dcba83bebb63cce2b8edf4e9da7df9", | ||
"package": "@microsoft/fast-element" | ||
}, | ||
{ | ||
"comment": "add comment-style tags for syntax highlighting (#5561)", | ||
"author": "chhol@microsoft.com", | ||
"commit": "7495a63e6e89b6e92e2d7f289eea063a8a354108", | ||
"package": "@microsoft/fast-element" | ||
}, | ||
{ | ||
"comment": "Update binding documentation to have an accurate example. Changes \"Bindings\" to \"Volatile Properties\".", | ||
"author": "tgoze@ntst.com", | ||
"commit": "1ffb431816f418864d2385b29ba494efcb3fa844", | ||
"package": "@microsoft/fast-element" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Tue, 08 Mar 2022 07:12:45 GMT", | ||
"tag": "@microsoft/fast-element_v1.8.0", | ||
"version": "1.8.0", | ||
"comments": { | ||
"minor": [ | ||
@@ -11,0 +53,0 @@ { |
# Change Log - @microsoft/fast-element | ||
This log was last generated on Tue, 08 Mar 2022 07:10:44 GMT and should not be manually modified. | ||
This log was last generated on Wed, 06 Apr 2022 07:10:25 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## 1.9.0 | ||
Wed, 06 Apr 2022 07:10:25 GMT | ||
### Minor changes | ||
- convert fast-element to type:module (nicholasrice@users.noreply.github.com) | ||
## 1.8.0 | ||
Tue, 08 Mar 2022 07:10:44 GMT | ||
Tue, 08 Mar 2022 07:12:45 GMT | ||
@@ -11,0 +19,0 @@ ### Minor changes |
@@ -1,2 +0,2 @@ | ||
import { Accessor } from "../observation/observable"; | ||
import { Accessor } from "../observation/observable.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Represents objects that can convert values to and from |
@@ -1,7 +0,7 @@ | ||
import type { Behavior } from "../observation/behavior"; | ||
import { PropertyChangeNotifier } from "../observation/notifier"; | ||
import type { ElementStyles } from "../styles/element-styles"; | ||
import type { ElementViewTemplate } from "../templating/template"; | ||
import type { ElementView } from "../templating/view"; | ||
import { FASTElementDefinition } from "./fast-definitions"; | ||
import type { Behavior } from "../observation/behavior.js"; | ||
import { PropertyChangeNotifier } from "../observation/notifier.js"; | ||
import type { ElementStyles } from "../styles/element-styles.js"; | ||
import type { ElementViewTemplate } from "../templating/template.js"; | ||
import type { ElementView } from "../templating/view.js"; | ||
import { FASTElementDefinition } from "./fast-definitions.js"; | ||
/** | ||
@@ -8,0 +8,0 @@ * Controls the lifecycle and rendering of a `FASTElement`. |
@@ -1,4 +0,4 @@ | ||
import { ComposableStyles, ElementStyles } from "../styles/element-styles"; | ||
import type { ElementViewTemplate } from "../templating/template"; | ||
import { AttributeConfiguration, AttributeDefinition } from "./attributes"; | ||
import { ComposableStyles, ElementStyles } from "../styles/element-styles.js"; | ||
import type { ElementViewTemplate } from "../templating/template.js"; | ||
import { AttributeConfiguration, AttributeDefinition } from "./attributes.js"; | ||
/** | ||
@@ -5,0 +5,0 @@ * Represents metadata configuration for a custom element. |
@@ -1,3 +0,3 @@ | ||
import { Controller } from "./controller"; | ||
import { PartialFASTElementDefinition } from "./fast-definitions"; | ||
import { Controller } from "./controller.js"; | ||
import { PartialFASTElementDefinition } from "./fast-definitions.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * Represents a custom element based on the FASTElement infrastructure. |
@@ -1,3 +0,3 @@ | ||
import type { Callable } from "./interfaces"; | ||
import { TrustedTypesPolicy } from "./platform"; | ||
import type { Callable } from "./interfaces.js"; | ||
import { TrustedTypesPolicy } from "./platform.js"; | ||
/** @internal */ | ||
@@ -4,0 +4,0 @@ export declare const _interpolationStart: string; |
@@ -1,26 +0,26 @@ | ||
export * from "./platform"; | ||
export * from "./templating/template"; | ||
export * from "./components/fast-element"; | ||
export { FASTElementDefinition, PartialFASTElementDefinition, } from "./components/fast-definitions"; | ||
export * from "./components/attributes"; | ||
export * from "./components/controller"; | ||
export type { Callable, Constructable, Mutable } from "./interfaces"; | ||
export * from "./templating/compiler"; | ||
export { ElementStyles, ElementStyleFactory, ComposableStyles, StyleTarget, } from "./styles/element-styles"; | ||
export { css, cssPartial } from "./styles/css"; | ||
export { CSSDirective } from "./styles/css-directive"; | ||
export * from "./templating/view"; | ||
export * from "./observation/observable"; | ||
export * from "./observation/notifier"; | ||
export { Splice } from "./observation/array-change-records"; | ||
export { enableArrayObservation } from "./observation/array-observer"; | ||
export { DOM } from "./dom"; | ||
export type { Behavior } from "./observation/behavior"; | ||
export * from "./templating/binding"; | ||
export * from "./templating/html-directive"; | ||
export * from "./templating/ref"; | ||
export * from "./templating/when"; | ||
export * from "./templating/repeat"; | ||
export * from "./templating/slotted"; | ||
export * from "./templating/children"; | ||
export { elements, ElementsFilter, NodeBehaviorOptions, } from "./templating/node-observation"; | ||
export * from "./platform.js"; | ||
export * from "./templating/template.js"; | ||
export * from "./components/fast-element.js"; | ||
export { FASTElementDefinition, PartialFASTElementDefinition, } from "./components/fast-definitions.js"; | ||
export * from "./components/attributes.js"; | ||
export * from "./components/controller.js"; | ||
export type { Callable, Constructable, Mutable } from "./interfaces.js"; | ||
export * from "./templating/compiler.js"; | ||
export { ElementStyles, ElementStyleFactory, ComposableStyles, StyleTarget, } from "./styles/element-styles.js"; | ||
export { css, cssPartial } from "./styles/css.js"; | ||
export { CSSDirective } from "./styles/css-directive.js"; | ||
export * from "./templating/view.js"; | ||
export * from "./observation/observable.js"; | ||
export * from "./observation/notifier.js"; | ||
export { Splice } from "./observation/array-change-records.js"; | ||
export { enableArrayObservation } from "./observation/array-observer.js"; | ||
export { DOM } from "./dom.js"; | ||
export type { Behavior } from "./observation/behavior.js"; | ||
export * from "./templating/binding.js"; | ||
export * from "./templating/html-directive.js"; | ||
export * from "./templating/ref.js"; | ||
export * from "./templating/when.js"; | ||
export * from "./templating/repeat.js"; | ||
export * from "./templating/slotted.js"; | ||
export * from "./templating/children.js"; | ||
export { elements, ElementsFilter, NodeBehaviorOptions, } from "./templating/node-observation.js"; |
@@ -1,2 +0,2 @@ | ||
import type { ExecutionContext } from "./observable"; | ||
import type { ExecutionContext } from "./observable.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Represents and object that can contribute behavior to a view or |
@@ -1,2 +0,2 @@ | ||
import type { Notifier, Subscriber } from "./notifier"; | ||
import type { Notifier, Subscriber } from "./notifier.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Represents a getter/setter property accessor on an object. |
@@ -1,3 +0,3 @@ | ||
import type { Behavior } from "../observation/behavior"; | ||
import type { ComposableStyles } from "./element-styles"; | ||
import type { Behavior } from "../observation/behavior.js"; | ||
import type { ComposableStyles } from "./element-styles.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * Directive for use in {@link css}. |
@@ -1,3 +0,3 @@ | ||
import { CSSDirective } from "./css-directive"; | ||
import { ComposableStyles, ElementStyles } from "./element-styles"; | ||
import { CSSDirective } from "./css-directive.js"; | ||
import { ComposableStyles, ElementStyles } from "./element-styles.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * Transforms a template literal string into styles. |
@@ -1,2 +0,2 @@ | ||
import type { Behavior } from "../observation/behavior"; | ||
import type { Behavior } from "../observation/behavior.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * A node that can be targeted by styles. |
@@ -1,4 +0,4 @@ | ||
import type { Behavior } from "../observation/behavior"; | ||
import { Binding, BindingObserver, ExecutionContext } from "../observation/observable"; | ||
import { TargetedHTMLDirective } from "./html-directive"; | ||
import type { Behavior } from "../observation/behavior.js"; | ||
import { Binding, BindingObserver, ExecutionContext } from "../observation/observable.js"; | ||
import { TargetedHTMLDirective } from "./html-directive.js"; | ||
declare function normalBind(this: BindingBehavior, source: unknown, context: ExecutionContext): void; | ||
@@ -5,0 +5,0 @@ declare function normalUnbind(this: BindingBehavior): void; |
@@ -1,3 +0,3 @@ | ||
import { NodeBehaviorOptions, NodeObservationBehavior } from "./node-observation"; | ||
import type { CaptureType } from "./template"; | ||
import { NodeBehaviorOptions, NodeObservationBehavior } from "./node-observation.js"; | ||
import type { CaptureType } from "./template.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * The options used to configure child list observation. |
@@ -1,2 +0,2 @@ | ||
import type { HTMLDirective, NodeBehaviorFactory } from "./html-directive"; | ||
import type { HTMLDirective, NodeBehaviorFactory } from "./html-directive.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * The result of compiling a template and its directives. |
@@ -1,2 +0,2 @@ | ||
import type { Behavior } from "../observation/behavior"; | ||
import type { Behavior } from "../observation/behavior.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * A factory that can create a {@link Behavior} associated with a particular |
@@ -1,2 +0,2 @@ | ||
import type { Behavior } from "../observation/behavior"; | ||
import type { Behavior } from "../observation/behavior.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Options for configuring node observation behavior. |
@@ -1,3 +0,3 @@ | ||
import type { Behavior } from "../observation/behavior"; | ||
import type { CaptureType } from "./template"; | ||
import type { Behavior } from "../observation/behavior.js"; | ||
import type { CaptureType } from "./template.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * The runtime behavior for template references. |
@@ -1,7 +0,7 @@ | ||
import { Binding, ExecutionContext } from "../observation/observable"; | ||
import type { Subscriber } from "../observation/notifier"; | ||
import type { Splice } from "../observation/array-change-records"; | ||
import type { Behavior } from "../observation/behavior"; | ||
import { HTMLDirective } from "./html-directive"; | ||
import type { CaptureType, SyntheticViewTemplate } from "./template"; | ||
import { Binding, ExecutionContext } from "../observation/observable.js"; | ||
import type { Subscriber } from "../observation/notifier.js"; | ||
import type { Splice } from "../observation/array-change-records.js"; | ||
import type { Behavior } from "../observation/behavior.js"; | ||
import { HTMLDirective } from "./html-directive.js"; | ||
import type { CaptureType, SyntheticViewTemplate } from "./template.js"; | ||
/** | ||
@@ -8,0 +8,0 @@ * Options for configuring repeat behavior. |
@@ -1,3 +0,3 @@ | ||
import { NodeBehaviorOptions, NodeObservationBehavior } from "./node-observation"; | ||
import type { CaptureType } from "./template"; | ||
import { NodeBehaviorOptions, NodeObservationBehavior } from "./node-observation.js"; | ||
import type { CaptureType } from "./template.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * The options used to configure slotted node observation. |
@@ -1,4 +0,4 @@ | ||
import { Binding } from "../observation/observable"; | ||
import { ElementView, HTMLView, SyntheticView } from "./view"; | ||
import { HTMLDirective } from "./html-directive"; | ||
import { Binding } from "../observation/observable.js"; | ||
import { ElementView, HTMLView, SyntheticView } from "./view.js"; | ||
import { HTMLDirective } from "./html-directive.js"; | ||
/** | ||
@@ -5,0 +5,0 @@ * A template capable of creating views specifically for rendering custom elements. |
@@ -1,3 +0,3 @@ | ||
import type { Behavior } from "../observation/behavior"; | ||
import type { ExecutionContext } from "../observation/observable"; | ||
import type { Behavior } from "../observation/behavior.js"; | ||
import type { ExecutionContext } from "../observation/observable.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * Represents a collection of DOM nodes which can be bound to a data source. |
@@ -1,3 +0,3 @@ | ||
import type { Binding } from "../observation/observable"; | ||
import type { CaptureType, SyntheticViewTemplate } from "./template"; | ||
import type { Binding } from "../observation/observable.js"; | ||
import type { CaptureType, SyntheticViewTemplate } from "./template.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * A directive that enables basic conditional rendering in a template. |
@@ -1,3 +0,3 @@ | ||
import { Observable } from "../observation/observable"; | ||
import { DOM } from "../dom"; | ||
import { Observable } from "../observation/observable.js"; | ||
import { DOM } from "../dom.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * A {@link ValueConverter} that converts to and from `boolean` values. |
@@ -1,5 +0,5 @@ | ||
import { DOM } from "../dom"; | ||
import { PropertyChangeNotifier } from "../observation/notifier"; | ||
import { defaultExecutionContext, Observable } from "../observation/observable"; | ||
import { FASTElementDefinition } from "./fast-definitions"; | ||
import { DOM } from "../dom.js"; | ||
import { PropertyChangeNotifier } from "../observation/notifier.js"; | ||
import { defaultExecutionContext, Observable } from "../observation/observable.js"; | ||
import { FASTElementDefinition } from "./fast-definitions.js"; | ||
const shadowRoots = new WeakMap(); | ||
@@ -6,0 +6,0 @@ const defaultEventOptions = { |
@@ -1,5 +0,5 @@ | ||
import { FAST } from "../platform"; | ||
import { Observable } from "../observation/observable"; | ||
import { ElementStyles } from "../styles/element-styles"; | ||
import { AttributeDefinition } from "./attributes"; | ||
import { FAST } from "../platform.js"; | ||
import { Observable } from "../observation/observable.js"; | ||
import { ElementStyles } from "../styles/element-styles.js"; | ||
import { AttributeDefinition } from "./attributes.js"; | ||
const defaultShadowOptions = { mode: "open" }; | ||
@@ -6,0 +6,0 @@ const defaultElementOptions = {}; |
@@ -1,3 +0,3 @@ | ||
import { Controller } from "./controller"; | ||
import { FASTElementDefinition } from "./fast-definitions"; | ||
import { Controller } from "./controller.js"; | ||
import { FASTElementDefinition, } from "./fast-definitions.js"; | ||
/* eslint-disable-next-line @typescript-eslint/explicit-function-return-type */ | ||
@@ -4,0 +4,0 @@ function createFASTElement(BaseType) { |
@@ -1,2 +0,2 @@ | ||
import { $global } from "./platform"; | ||
import { $global } from "./platform.js"; | ||
const updateQueue = $global.FAST.getById(1 /* updateQueue */, () => { | ||
@@ -3,0 +3,0 @@ const tasks = []; |
@@ -1,23 +0,23 @@ | ||
export * from "./platform"; | ||
export * from "./templating/template"; | ||
export * from "./components/fast-element"; | ||
export { FASTElementDefinition, } from "./components/fast-definitions"; | ||
export * from "./components/attributes"; | ||
export * from "./components/controller"; | ||
export * from "./templating/compiler"; | ||
export { ElementStyles, } from "./styles/element-styles"; | ||
export { css, cssPartial } from "./styles/css"; | ||
export { CSSDirective } from "./styles/css-directive"; | ||
export * from "./templating/view"; | ||
export * from "./observation/observable"; | ||
export * from "./observation/notifier"; | ||
export { enableArrayObservation } from "./observation/array-observer"; | ||
export { DOM } from "./dom"; | ||
export * from "./templating/binding"; | ||
export * from "./templating/html-directive"; | ||
export * from "./templating/ref"; | ||
export * from "./templating/when"; | ||
export * from "./templating/repeat"; | ||
export * from "./templating/slotted"; | ||
export * from "./templating/children"; | ||
export { elements, } from "./templating/node-observation"; | ||
export * from "./platform.js"; | ||
export * from "./templating/template.js"; | ||
export * from "./components/fast-element.js"; | ||
export { FASTElementDefinition, } from "./components/fast-definitions.js"; | ||
export * from "./components/attributes.js"; | ||
export * from "./components/controller.js"; | ||
export * from "./templating/compiler.js"; | ||
export { ElementStyles, } from "./styles/element-styles.js"; | ||
export { css, cssPartial } from "./styles/css.js"; | ||
export { CSSDirective } from "./styles/css-directive.js"; | ||
export * from "./templating/view.js"; | ||
export * from "./observation/observable.js"; | ||
export * from "./observation/notifier.js"; | ||
export { enableArrayObservation } from "./observation/array-observer.js"; | ||
export { DOM } from "./dom.js"; | ||
export * from "./templating/binding.js"; | ||
export * from "./templating/html-directive.js"; | ||
export * from "./templating/ref.js"; | ||
export * from "./templating/when.js"; | ||
export * from "./templating/repeat.js"; | ||
export * from "./templating/slotted.js"; | ||
export * from "./templating/children.js"; | ||
export { elements, } from "./templating/node-observation.js"; |
@@ -1,2 +0,2 @@ | ||
import { emptyArray } from "../platform"; | ||
import { emptyArray } from "../platform.js"; | ||
/** @internal */ | ||
@@ -3,0 +3,0 @@ export function newSplice(index, removed, addedCount) { |
@@ -1,5 +0,5 @@ | ||
import { DOM } from "../dom"; | ||
import { calcSplices, newSplice, projectArraySplices } from "./array-change-records"; | ||
import { SubscriberSet } from "./notifier"; | ||
import { Observable } from "./observable"; | ||
import { DOM } from "../dom.js"; | ||
import { calcSplices, newSplice, projectArraySplices } from "./array-change-records.js"; | ||
import { SubscriberSet } from "./notifier.js"; | ||
import { Observable } from "./observable.js"; | ||
let arrayObservationEnabled = false; | ||
@@ -6,0 +6,0 @@ function adjustIndex(changeRecord, array) { |
@@ -1,4 +0,4 @@ | ||
import { DOM } from "../dom"; | ||
import { PropertyChangeNotifier, SubscriberSet } from "./notifier"; | ||
import { FAST } from "../platform"; | ||
import { DOM } from "../dom.js"; | ||
import { FAST } from "../platform.js"; | ||
import { PropertyChangeNotifier, SubscriberSet } from "./notifier.js"; | ||
/** | ||
@@ -5,0 +5,0 @@ * Common Observable APIs. |
@@ -1,3 +0,3 @@ | ||
import { CSSDirective } from "./css-directive"; | ||
import { ElementStyles } from "./element-styles"; | ||
import { CSSDirective } from "./css-directive.js"; | ||
import { ElementStyles } from "./element-styles.js"; | ||
function collectStyles(strings, values) { | ||
@@ -4,0 +4,0 @@ const styles = []; |
@@ -1,2 +0,2 @@ | ||
import { DOM } from "../dom"; | ||
import { DOM } from "../dom.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Represents styles that can be applied to a custom element. |
@@ -1,4 +0,4 @@ | ||
import { DOM } from "../dom"; | ||
import { ExecutionContext, Observable, } from "../observation/observable"; | ||
import { TargetedHTMLDirective } from "./html-directive"; | ||
import { DOM } from "../dom.js"; | ||
import { ExecutionContext, Observable, } from "../observation/observable.js"; | ||
import { TargetedHTMLDirective } from "./html-directive.js"; | ||
function normalBind(source, context) { | ||
@@ -5,0 +5,0 @@ this.source = source; |
@@ -1,3 +0,3 @@ | ||
import { AttachedBehaviorHTMLDirective } from "./html-directive"; | ||
import { NodeObservationBehavior } from "./node-observation"; | ||
import { AttachedBehaviorHTMLDirective } from "./html-directive.js"; | ||
import { NodeObservationBehavior } from "./node-observation.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * The runtime behavior for child node observation. |
@@ -1,3 +0,3 @@ | ||
import { _interpolationEnd, _interpolationStart, DOM } from "../dom"; | ||
import { HTMLBindingDirective } from "./binding"; | ||
import { _interpolationEnd, _interpolationStart, DOM } from "../dom.js"; | ||
import { HTMLBindingDirective } from "./binding.js"; | ||
let sharedContext = null; | ||
@@ -4,0 +4,0 @@ class CompilationContext { |
@@ -1,2 +0,2 @@ | ||
import { DOM } from "../dom"; | ||
import { DOM } from "../dom.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Instructs the template engine to apply behavior to a node. |
@@ -1,3 +0,3 @@ | ||
import { Observable } from "../observation/observable"; | ||
import { emptyArray } from "../platform"; | ||
import { Observable } from "../observation/observable.js"; | ||
import { emptyArray } from "../platform.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * Creates a function that can be used to filter a Node array, selecting only elements. |
@@ -1,2 +0,2 @@ | ||
import { AttachedBehaviorHTMLDirective } from "./html-directive"; | ||
import { AttachedBehaviorHTMLDirective } from "./html-directive.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * The runtime behavior for template references. |
@@ -1,7 +0,7 @@ | ||
import { DOM } from "../dom"; | ||
import { Observable, } from "../observation/observable"; | ||
import { enableArrayObservation } from "../observation/array-observer"; | ||
import { emptyArray } from "../platform"; | ||
import { HTMLDirective } from "./html-directive"; | ||
import { HTMLView } from "./view"; | ||
import { DOM } from "../dom.js"; | ||
import { Observable, } from "../observation/observable.js"; | ||
import { enableArrayObservation } from "../observation/array-observer.js"; | ||
import { emptyArray } from "../platform.js"; | ||
import { HTMLDirective } from "./html-directive.js"; | ||
import { HTMLView } from "./view.js"; | ||
const defaultRepeatOptions = Object.freeze({ | ||
@@ -8,0 +8,0 @@ positioning: false, |
@@ -1,3 +0,3 @@ | ||
import { AttachedBehaviorHTMLDirective } from "./html-directive"; | ||
import { NodeObservationBehavior } from "./node-observation"; | ||
import { AttachedBehaviorHTMLDirective } from "./html-directive.js"; | ||
import { NodeObservationBehavior } from "./node-observation.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * The runtime behavior for slotted node observation. |
@@ -1,7 +0,7 @@ | ||
import { DOM } from "../dom"; | ||
import { defaultExecutionContext } from "../observation/observable"; | ||
import { compileTemplate } from "./compiler"; | ||
import { HTMLView } from "./view"; | ||
import { HTMLDirective, TargetedHTMLDirective, } from "./html-directive"; | ||
import { HTMLBindingDirective } from "./binding"; | ||
import { DOM } from "../dom.js"; | ||
import { defaultExecutionContext } from "../observation/observable.js"; | ||
import { compileTemplate } from "./compiler.js"; | ||
import { HTMLView } from "./view.js"; | ||
import { HTMLDirective, TargetedHTMLDirective, } from "./html-directive.js"; | ||
import { HTMLBindingDirective } from "./binding.js"; | ||
/** | ||
@@ -8,0 +8,0 @@ * A template capable of creating HTMLView instances or rendering directly to DOM. |
@@ -175,21 +175,23 @@ --- | ||
## Bindings | ||
## Observing Volatile Properties | ||
In addition to watching properties and arrays, you can also watch arbitrary bindings. | ||
In addition to watching properties and arrays, you can also watch volatile properties. | ||
**Example: Subscribing to a Binding** | ||
**Example: Subscribing to a Volatile Property** | ||
```ts | ||
import { Observable } from '@microsoft/fast-element'; | ||
import { Observable, defaultExecutionContext } from '@microsoft/fast-element'; | ||
const binding = (x: MyClass) => x.someBoolean ? x.valueA : x.valueB; | ||
const bindingObserver = Observable.binding(binding); | ||
const myObject = new MyClass(); | ||
const handler = { | ||
handleChange(source: any) { | ||
// respond to the change here | ||
// the source is the bindingObserver itself | ||
// the source is the volatile binding itself | ||
} | ||
}; | ||
const bindingObserver = Observable.binding(myObject.computedValue, handler); | ||
bindingObserver.observe(myObject, defaultExecutionContext); | ||
bindingObserver.subscribe(handler); | ||
// Call this to dismantle the observer | ||
bindingObserver.disconnect(); | ||
``` | ||
@@ -196,0 +198,0 @@ |
@@ -333,3 +333,3 @@ --- | ||
<li> | ||
${(x, c) = c.parent.selectTemplate(x)} | ||
${(x, c) => c.parent.selectTemplate(x)} | ||
</li> | ||
@@ -336,0 +336,0 @@ `)} |
@@ -5,3 +5,3 @@ { | ||
"sideEffects": false, | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"author": { | ||
@@ -21,2 +21,3 @@ "name": "Microsoft", | ||
"types": "dist/fast-element.d.ts", | ||
"type": "module", | ||
"unpkg": "dist/fast-element.min.js", | ||
@@ -37,13 +38,13 @@ "scripts": { | ||
"eslint:fix": "eslint . --ext .ts --fix", | ||
"test": "yarn test-chrome:verbose && yarn doc:ci", | ||
"test": "yarn eslint && yarn test-chrome:verbose && yarn doc:ci", | ||
"test-node": "mocha --reporter min --exit dist/esm/__test__/setup-node.js './dist/esm/**/*.spec.js'", | ||
"test-node:verbose": "mocha --reporter spec --exit dist/esm/__test__/setup-node.js './dist/esm/**/*.spec.js'", | ||
"test-chrome": "karma start karma.conf.js --browsers=ChromeHeadlessOpt --single-run --coverage", | ||
"test-chrome:verbose": "karma start karma.conf.js --browsers=ChromeHeadlessOpt --single-run --coverage --reporter=mocha", | ||
"test-chrome:watch": "karma start karma.conf.js --browsers=ChromeHeadlessOpt --coverage --watch-extensions js", | ||
"test-chrome:debugger": "karma start karma.conf.js --browsers=ChromeDebugging", | ||
"test-chrome:verbose:watch": "karma start karma.conf.js --browsers=ChromeHeadlessOpt --coverage --watch-extensions js --reporter=mocha", | ||
"test-chrome:verbose:debugger": "karma start karma.conf.js --browsers=ChromeDebugging --reporter=mocha", | ||
"test-firefox": "karma start karma.conf.js --browsers=FirefoxHeadless --single-run --coverage", | ||
"test-firefox:verbose": "karma start karma.conf.js --browsers=FirefoxHeadless --single-run --coverage --reporter=mocha" | ||
"test-chrome": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --single-run --coverage", | ||
"test-chrome:verbose": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --single-run --coverage --reporter=mocha", | ||
"test-chrome:watch": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --coverage --watch-extensions js", | ||
"test-chrome:debugger": "karma start karma.conf.cjs --browsers=ChromeDebugging", | ||
"test-chrome:verbose:watch": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --coverage --watch-extensions js --reporter=mocha", | ||
"test-chrome:verbose:debugger": "karma start karma.conf.cjs --browsers=ChromeDebugging --reporter=mocha", | ||
"test-firefox": "karma start karma.conf.cjs --browsers=FirefoxHeadless --single-run --coverage", | ||
"test-firefox:verbose": "karma start karma.conf.cjs --browsers=FirefoxHeadless --single-run --coverage --reporter=mocha" | ||
}, | ||
@@ -50,0 +51,0 @@ "devDependencies": { |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances 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
940592
74
22407
Yes
3