@microsoft/fast-element 2.9.1 → 2.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.json +15 -0
  2. package/CHANGELOG.md +9 -1
  3. package/dist/context/context.api.json +7 -7
  4. package/dist/di/di.api.json +12 -12
  5. package/dist/dts/binding/two-way.d.ts +1 -1
  6. package/dist/dts/components/attributes.d.ts +3 -3
  7. package/dist/dts/components/fast-definitions.d.ts +1 -1
  8. package/dist/dts/context.d.ts +7 -7
  9. package/dist/dts/di/di.d.ts +13 -13
  10. package/dist/dts/dom-policy.d.ts +5 -5
  11. package/dist/dts/dom.d.ts +2 -2
  12. package/dist/dts/interfaces.d.ts +7 -7
  13. package/dist/dts/observation/arrays.d.ts +1 -1
  14. package/dist/dts/observation/observable.d.ts +2 -2
  15. package/dist/dts/state/state.d.ts +9 -9
  16. package/dist/dts/styles/css-binding-directive.d.ts +1 -1
  17. package/dist/dts/styles/css-directive.d.ts +1 -1
  18. package/dist/dts/styles/css.d.ts +2 -2
  19. package/dist/dts/styles/element-styles.d.ts +2 -2
  20. package/dist/dts/templating/children.d.ts +1 -1
  21. package/dist/dts/templating/compiler.d.ts +1 -1
  22. package/dist/dts/templating/html-directive.d.ts +3 -3
  23. package/dist/dts/templating/node-observation.d.ts +1 -1
  24. package/dist/dts/templating/render.d.ts +6 -6
  25. package/dist/dts/templating/template.d.ts +2 -2
  26. package/dist/esm/components/element-controller.js +84 -84
  27. package/dist/esm/components/fast-definitions.js +15 -15
  28. package/dist/esm/di/di.js +12 -12
  29. package/dist/esm/observation/arrays.js +12 -12
  30. package/dist/esm/styles/element-styles.js +9 -9
  31. package/dist/esm/templating/repeat.js +7 -7
  32. package/dist/esm/templating/view.js +9 -9
  33. package/dist/fast-element.api.json +26 -26
  34. package/dist/fast-element.d.ts +4 -4
  35. package/dist/fast-element.debug.js +141 -139
  36. package/dist/fast-element.debug.min.js +2 -2
  37. package/dist/fast-element.js +141 -139
  38. package/dist/fast-element.min.js +2 -2
  39. package/docs/di/api-report.api.md +4 -4
  40. package/karma.conf.cjs +13 -7
  41. package/package.json +3 -44
@@ -6,7 +6,7 @@ import { ComposableStyles, ElementStyles } from "./element-styles.js";
6
6
  * Represents the types of values that can be interpolated into a template.
7
7
  * @public
8
8
  */
9
- export declare type CSSValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | ComposableStyles | CSSDirective;
9
+ export type CSSValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | ComposableStyles | CSSDirective;
10
10
  /**
11
11
  * Transforms a template literal string into styles.
12
12
  * @param strings - The string fragments that are interpolated with the values.
@@ -16,7 +16,7 @@ export declare type CSSValue<TSource, TParent = any> = Expression<TSource, any,
16
16
  * Use the .partial method to create partial CSS fragments.
17
17
  * @public
18
18
  */
19
- export declare type CSSTemplateTag = (<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: CSSValue<TSource, TParent>[]) => ElementStyles) & {
19
+ export type CSSTemplateTag = (<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: CSSValue<TSource, TParent>[]) => ElementStyles) & {
20
20
  /**
21
21
  * Transforms a template literal string into partial CSS.
22
22
  * @param strings - The string fragments that are interpolated with the values.
@@ -4,12 +4,12 @@ import type { HostBehavior } from "./host.js";
4
4
  * Represents styles that can be composed into the ShadowDOM of a custom element.
5
5
  * @public
6
6
  */
7
- export declare type ComposableStyles = string | ElementStyles | CSSStyleSheet;
7
+ export type ComposableStyles = string | ElementStyles | CSSStyleSheet;
8
8
  /**
9
9
  * A type that instantiates a StyleStrategy.
10
10
  * @public
11
11
  */
12
- export declare type ConstructibleStyleStrategy = {
12
+ export type ConstructibleStyleStrategy = {
13
13
  /**
14
14
  * Creates an instance of the strategy.
15
15
  * @param styles - The styles to initialize the strategy with.
@@ -25,7 +25,7 @@ export interface SubtreeDirectiveOptions<T = any> extends NodeBehaviorOptions<T>
25
25
  * The options used to configure child/subtree node observation.
26
26
  * @public
27
27
  */
28
- export declare type ChildrenDirectiveOptions<T = any> = ChildListDirectiveOptions<T> | SubtreeDirectiveOptions<T>;
28
+ export type ChildrenDirectiveOptions<T = any> = ChildListDirectiveOptions<T> | SubtreeDirectiveOptions<T>;
29
29
  /**
30
30
  * The runtime behavior for child node observation.
31
31
  * @public
@@ -6,7 +6,7 @@ import type { HTMLTemplateCompilationResult as TemplateCompilationResult } from
6
6
  * by the html template function into a result that can instantiate views.
7
7
  * @public
8
8
  */
9
- export declare type CompilationStrategy = (
9
+ export type CompilationStrategy = (
10
10
  /**
11
11
  * The preprocessed HTML string or template to compile.
12
12
  */
@@ -6,7 +6,7 @@ import type { ExpressionController } from "../observation/observable.js";
6
6
  * The target nodes available to a behavior.
7
7
  * @public
8
8
  */
9
- export declare type ViewBehaviorTargets = {
9
+ export type ViewBehaviorTargets = {
10
10
  [id: string]: Node;
11
11
  };
12
12
  /**
@@ -61,12 +61,12 @@ export interface ViewBehaviorFactory {
61
61
  * Represents a ViewBehaviorFactory after the compilation process has completed.
62
62
  * @public
63
63
  */
64
- export declare type CompiledViewBehaviorFactory = Required<ViewBehaviorFactory>;
64
+ export type CompiledViewBehaviorFactory = Required<ViewBehaviorFactory>;
65
65
  /**
66
66
  * Used to add behavior factories when constructing templates.
67
67
  * @public
68
68
  */
69
- export declare type AddViewBehaviorFactory = (factory: ViewBehaviorFactory) => string;
69
+ export type AddViewBehaviorFactory = (factory: ViewBehaviorFactory) => string;
70
70
  /**
71
71
  * Instructs the template engine to apply behavior to a node.
72
72
  * @public
@@ -22,7 +22,7 @@ export interface NodeBehaviorOptions<T = any> {
22
22
  *
23
23
  * @public
24
24
  */
25
- export declare type ElementsFilter = (value: Node, index?: number, array?: Node[]) => boolean;
25
+ export type ElementsFilter = (value: Node, index?: number, array?: Node[]) => boolean;
26
26
  /**
27
27
  * Creates a function that can be used to filter a Node array, selecting only elements.
28
28
  * @param selector - An optional selector to restrict the filter to.
@@ -95,7 +95,7 @@ export interface RenderInstruction {
95
95
  * Render options that are common to all configurations.
96
96
  * @public
97
97
  */
98
- export declare type CommonRenderOptions = {
98
+ export type CommonRenderOptions = {
99
99
  /**
100
100
  * The type this instruction is associated with.
101
101
  */
@@ -109,7 +109,7 @@ export declare type CommonRenderOptions = {
109
109
  * Render options used to specify a template.
110
110
  * @public
111
111
  */
112
- export declare type TemplateRenderOptions = CommonRenderOptions & {
112
+ export type TemplateRenderOptions = CommonRenderOptions & {
113
113
  /**
114
114
  * The template to use when rendering.
115
115
  */
@@ -119,7 +119,7 @@ export declare type TemplateRenderOptions = CommonRenderOptions & {
119
119
  * Render options that are common to all element render instructions.
120
120
  * @public
121
121
  */
122
- export declare type BaseElementRenderOptions<TSource = any, TParent = any> = CommonRenderOptions & {
122
+ export type BaseElementRenderOptions<TSource = any, TParent = any> = CommonRenderOptions & {
123
123
  /**
124
124
  * Attributes to use when creating the element template.
125
125
  * @remarks
@@ -149,7 +149,7 @@ export declare type BaseElementRenderOptions<TSource = any, TParent = any> = Com
149
149
  * Render options for directly creating an element with {@link RenderInstruction.createElementTemplate}
150
150
  * @public
151
151
  */
152
- export declare type ElementCreateOptions<TSource = any, TParent = any> = Omit<BaseElementRenderOptions, "type" | "name"> & {
152
+ export type ElementCreateOptions<TSource = any, TParent = any> = Omit<BaseElementRenderOptions, "type" | "name"> & {
153
153
  /**
154
154
  * Directives to use when creating the element template. These directives are applied directly to the specified tag.
155
155
  *
@@ -162,7 +162,7 @@ export declare type ElementCreateOptions<TSource = any, TParent = any> = Omit<Ba
162
162
  * Render options used to specify an element.
163
163
  * @public
164
164
  */
165
- export declare type ElementConstructorRenderOptions<TSource = any, TParent = any> = BaseElementRenderOptions<TSource, TParent> & {
165
+ export type ElementConstructorRenderOptions<TSource = any, TParent = any> = BaseElementRenderOptions<TSource, TParent> & {
166
166
  /**
167
167
  * The element to use when rendering.
168
168
  */
@@ -172,7 +172,7 @@ export declare type ElementConstructorRenderOptions<TSource = any, TParent = any
172
172
  * Render options use to specify an element by tag name.
173
173
  * @public
174
174
  */
175
- export declare type TagNameRenderOptions<TSource = any, TParent = any> = BaseElementRenderOptions<TSource, TParent> & {
175
+ export type TagNameRenderOptions<TSource = any, TParent = any> = BaseElementRenderOptions<TSource, TParent> & {
176
176
  /**
177
177
  * The tag name to use when rendering.
178
178
  */
@@ -65,7 +65,7 @@ export interface HTMLTemplateCompilationResult<TSource = any, TParent = any> {
65
65
  * Represents the types of values that can be interpolated into a template.
66
66
  * @public
67
67
  */
68
- export declare type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource, TParent>;
68
+ export type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource, TParent>;
69
69
  /**
70
70
  * Inlines a template into another template.
71
71
  * @public
@@ -165,7 +165,7 @@ export declare class ViewTemplate<TSource = any, TParent = any> implements Eleme
165
165
  * other template instances, and Directive instances.
166
166
  * @public
167
167
  */
168
- export declare type HTMLTemplateTag = (<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]) => ViewTemplate<TSource, TParent>) & {
168
+ export type HTMLTemplateTag = (<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]) => ViewTemplate<TSource, TParent>) & {
169
169
  /**
170
170
  * Transforms a template literal string into partial HTML.
171
171
  * @param html - The HTML string fragment to interpolate.
@@ -27,90 +27,6 @@ let elementControllerStrategy;
27
27
  * @public
28
28
  */
29
29
  export class ElementController extends PropertyChangeNotifier {
30
- /**
31
- * Creates a Controller to control the specified element.
32
- * @param element - The element to be controlled by this controller.
33
- * @param definition - The element definition metadata that instructs this
34
- * controller in how to handle rendering and other platform integrations.
35
- * @internal
36
- */
37
- constructor(element, definition) {
38
- super(element);
39
- /**
40
- * A map of observable properties that were set on the element before upgrade.
41
- */
42
- this.boundObservables = null;
43
- /**
44
- * Indicates whether the controller needs to perform initial rendering.
45
- */
46
- this.needsInitialization = true;
47
- /**
48
- * Indicates whether the element has an existing shadow root (e.g. from declarative shadow DOM).
49
- */
50
- this.hasExistingShadowRoot = false;
51
- /**
52
- * The template used to render the component.
53
- */
54
- this._template = null;
55
- /**
56
- * The current lifecycle stage of the controller.
57
- */
58
- this.stage = 3 /* Stages.disconnected */;
59
- /**
60
- * A guard against connecting behaviors multiple times
61
- * during connect in scenarios where a behavior adds
62
- * another behavior during it's connectedCallback
63
- */
64
- this.guardBehaviorConnection = false;
65
- /**
66
- * The behaviors associated with the component.
67
- */
68
- this.behaviors = null;
69
- /**
70
- * Tracks whether behaviors are connected so that
71
- * behaviors cant be connected multiple times
72
- */
73
- this.behaviorsConnected = false;
74
- /**
75
- * The main set of styles used for the component, independent of any
76
- * dynamically added styles.
77
- */
78
- this._mainStyles = null;
79
- /**
80
- * This allows Observable.getNotifier(...) to return the Controller
81
- * when the notifier for the Controller itself is being requested. The
82
- * result is that the Observable system does not need to create a separate
83
- * instance of Notifier for observables on the Controller. The component and
84
- * the controller will now share the same notifier, removing one-object construct
85
- * per web component instance.
86
- */
87
- this.$fastController = this;
88
- /**
89
- * The view associated with the custom element.
90
- * @remarks
91
- * If `null` then the element is managing its own rendering.
92
- */
93
- this.view = null;
94
- this.source = element;
95
- this.definition = definition;
96
- this.shadowOptions = definition.shadowOptions;
97
- // Capture any observable values that were set by the binding engine before
98
- // the browser upgraded the element. Then delete the property since it will
99
- // shadow the getter/setter that is required to make the observable operate.
100
- // Later, in the connect callback, we'll re-apply the values.
101
- const accessors = Observable.getAccessors(element);
102
- if (accessors.length > 0) {
103
- const boundObservables = (this.boundObservables = Object.create(null));
104
- for (let i = 0, ii = accessors.length; i < ii; ++i) {
105
- const propertyName = accessors[i].name;
106
- const value = element[propertyName];
107
- if (value !== void 0) {
108
- delete element[propertyName];
109
- boundObservables[propertyName] = value;
110
- }
111
- }
112
- }
113
- }
114
30
  /**
115
31
  * Indicates whether or not the custom element has been
116
32
  * connected to the document.
@@ -224,6 +140,90 @@ export class ElementController extends PropertyChangeNotifier {
224
140
  this.addStyles(value);
225
141
  }
226
142
  }
143
+ /**
144
+ * Creates a Controller to control the specified element.
145
+ * @param element - The element to be controlled by this controller.
146
+ * @param definition - The element definition metadata that instructs this
147
+ * controller in how to handle rendering and other platform integrations.
148
+ * @internal
149
+ */
150
+ constructor(element, definition) {
151
+ super(element);
152
+ /**
153
+ * A map of observable properties that were set on the element before upgrade.
154
+ */
155
+ this.boundObservables = null;
156
+ /**
157
+ * Indicates whether the controller needs to perform initial rendering.
158
+ */
159
+ this.needsInitialization = true;
160
+ /**
161
+ * Indicates whether the element has an existing shadow root (e.g. from declarative shadow DOM).
162
+ */
163
+ this.hasExistingShadowRoot = false;
164
+ /**
165
+ * The template used to render the component.
166
+ */
167
+ this._template = null;
168
+ /**
169
+ * The current lifecycle stage of the controller.
170
+ */
171
+ this.stage = 3 /* Stages.disconnected */;
172
+ /**
173
+ * A guard against connecting behaviors multiple times
174
+ * during connect in scenarios where a behavior adds
175
+ * another behavior during it's connectedCallback
176
+ */
177
+ this.guardBehaviorConnection = false;
178
+ /**
179
+ * The behaviors associated with the component.
180
+ */
181
+ this.behaviors = null;
182
+ /**
183
+ * Tracks whether behaviors are connected so that
184
+ * behaviors cant be connected multiple times
185
+ */
186
+ this.behaviorsConnected = false;
187
+ /**
188
+ * The main set of styles used for the component, independent of any
189
+ * dynamically added styles.
190
+ */
191
+ this._mainStyles = null;
192
+ /**
193
+ * This allows Observable.getNotifier(...) to return the Controller
194
+ * when the notifier for the Controller itself is being requested. The
195
+ * result is that the Observable system does not need to create a separate
196
+ * instance of Notifier for observables on the Controller. The component and
197
+ * the controller will now share the same notifier, removing one-object construct
198
+ * per web component instance.
199
+ */
200
+ this.$fastController = this;
201
+ /**
202
+ * The view associated with the custom element.
203
+ * @remarks
204
+ * If `null` then the element is managing its own rendering.
205
+ */
206
+ this.view = null;
207
+ this.source = element;
208
+ this.definition = definition;
209
+ this.shadowOptions = definition.shadowOptions;
210
+ // Capture any observable values that were set by the binding engine before
211
+ // the browser upgraded the element. Then delete the property since it will
212
+ // shadow the getter/setter that is required to make the observable operate.
213
+ // Later, in the connect callback, we'll re-apply the values.
214
+ const accessors = Observable.getAccessors(element);
215
+ if (accessors.length > 0) {
216
+ const boundObservables = (this.boundObservables = Object.create(null));
217
+ for (let i = 0, ii = accessors.length; i < ii; ++i) {
218
+ const propertyName = accessors[i].name;
219
+ const value = element[propertyName];
220
+ if (value !== void 0) {
221
+ delete element[propertyName];
222
+ boundObservables[propertyName] = value;
223
+ }
224
+ }
225
+ }
226
+ }
227
227
  /**
228
228
  * Registers an unbind handler with the controller.
229
229
  * @param behavior - An object to call when the controller unbinds.
@@ -33,6 +33,12 @@ export const TemplateOptions = {
33
33
  * @public
34
34
  */
35
35
  export class FASTElementDefinition {
36
+ /**
37
+ * Indicates if this element has been defined in at least one registry.
38
+ */
39
+ get isDefined() {
40
+ return this.platformDefined;
41
+ }
36
42
  constructor(type, nameOrConfig = type.definition) {
37
43
  var _b;
38
44
  this.platformDefined = false;
@@ -75,14 +81,8 @@ export class FASTElementDefinition {
75
81
  : Object.assign(Object.assign({}, defaultElementOptions), nameOrConfig.elementOptions);
76
82
  this.styles = ElementStyles.normalize(nameOrConfig.styles);
77
83
  fastElementRegistry.register(this);
78
- Observable.defineProperty(FASTElementDefinition.isRegistered, this.name);
79
- FASTElementDefinition.isRegistered[this.name] = this.type;
80
- }
81
- /**
82
- * Indicates if this element has been defined in at least one registry.
83
- */
84
- get isDefined() {
85
- return this.platformDefined;
84
+ Observable.defineProperty(_a.isRegistered, this.name);
85
+ _a.isRegistered[this.name] = this.type;
86
86
  }
87
87
  /**
88
88
  * Defines a custom element based on this definition.
@@ -108,10 +108,10 @@ export class FASTElementDefinition {
108
108
  */
109
109
  static compose(type, nameOrDef) {
110
110
  if (fastElementBaseTypes.has(type) || fastElementRegistry.getByType(type)) {
111
- return new FASTElementDefinition(class extends type {
111
+ return new _a(class extends type {
112
112
  }, nameOrDef);
113
113
  }
114
- return new FASTElementDefinition(type, nameOrDef);
114
+ return new _a(type, nameOrDef);
115
115
  }
116
116
  /**
117
117
  * Registers a FASTElement base type.
@@ -133,10 +133,10 @@ export class FASTElementDefinition {
133
133
  static composeAsync(type, nameOrDef) {
134
134
  return new Promise(resolve => {
135
135
  if (fastElementBaseTypes.has(type) || fastElementRegistry.getByType(type)) {
136
- resolve(new FASTElementDefinition(class extends type {
136
+ resolve(new _a(class extends type {
137
137
  }, nameOrDef));
138
138
  }
139
- const definition = new FASTElementDefinition(type, nameOrDef);
139
+ const definition = new _a(type, nameOrDef);
140
140
  Observable.getNotifier(definition).subscribe({
141
141
  handleChange: () => {
142
142
  var _b, _c;
@@ -169,10 +169,10 @@ FASTElementDefinition.getForInstance = fastElementRegistry.getForInstance;
169
169
  */
170
170
  FASTElementDefinition.registerAsync = (name) => __awaiter(void 0, void 0, void 0, function* () {
171
171
  return new Promise(resolve => {
172
- if (FASTElementDefinition.isRegistered[name]) {
173
- resolve(FASTElementDefinition.isRegistered[name]);
172
+ if (_a.isRegistered[name]) {
173
+ resolve(_a.isRegistered[name]);
174
174
  }
175
- Observable.getNotifier(FASTElementDefinition.isRegistered).subscribe({ handleChange: () => resolve(FASTElementDefinition.isRegistered[name]) }, name);
175
+ Observable.getNotifier(_a.isRegistered).subscribe({ handleChange: () => resolve(_a.isRegistered[name]) }, name);
176
176
  });
177
177
  });
178
178
  Observable.defineProperty(FASTElementDefinition.prototype, "template");
package/dist/esm/di/di.js CHANGED
@@ -902,6 +902,18 @@ const factories = new Map();
902
902
  * @internal
903
903
  */
904
904
  export class ContainerImpl {
905
+ get parent() {
906
+ if (this._parent === void 0) {
907
+ this._parent = this.config.parentLocator(this.owner);
908
+ }
909
+ return this._parent;
910
+ }
911
+ get depth() {
912
+ return this.parent === null ? 0 : this.parent.depth + 1;
913
+ }
914
+ get responsibleForOwnerRequests() {
915
+ return this.config.responsibleForOwnerRequests;
916
+ }
905
917
  constructor(owner, config) {
906
918
  this.owner = owner;
907
919
  this.config = config;
@@ -935,18 +947,6 @@ export class ContainerImpl {
935
947
  }
936
948
  }
937
949
  }
938
- get parent() {
939
- if (this._parent === void 0) {
940
- this._parent = this.config.parentLocator(this.owner);
941
- }
942
- return this._parent;
943
- }
944
- get depth() {
945
- return this.parent === null ? 0 : this.parent.depth + 1;
946
- }
947
- get responsibleForOwnerRequests() {
948
- return this.config.responsibleForOwnerRequests;
949
- }
950
950
  handleContextRequests(enable) {
951
951
  this.isHandlingContextRequests = enable;
952
952
  }
@@ -470,18 +470,6 @@ function setNonEnumerable(target, property, value, writable = true) {
470
470
  });
471
471
  }
472
472
  class DefaultArrayObserver extends SubscriberSet {
473
- constructor(subject) {
474
- super(subject);
475
- this.oldCollection = void 0;
476
- this.splices = void 0;
477
- this.sorts = void 0;
478
- this.needsQueue = true;
479
- this._strategy = null;
480
- this._lengthObserver = void 0;
481
- this._sortObserver = void 0;
482
- this.call = this.flush;
483
- setNonEnumerable(subject, "$fastController", this);
484
- }
485
473
  get strategy() {
486
474
  return this._strategy;
487
475
  }
@@ -522,6 +510,18 @@ class DefaultArrayObserver extends SubscriberSet {
522
510
  }
523
511
  return observer;
524
512
  }
513
+ constructor(subject) {
514
+ super(subject);
515
+ this.oldCollection = void 0;
516
+ this.splices = void 0;
517
+ this.sorts = void 0;
518
+ this.needsQueue = true;
519
+ this._strategy = null;
520
+ this._lengthObserver = void 0;
521
+ this._sortObserver = void 0;
522
+ this.call = this.flush;
523
+ setNonEnumerable(subject, "$fastController", this);
524
+ }
525
525
  subscribe(subscriber) {
526
526
  this.flush();
527
527
  super.subscribe(subscriber);
@@ -9,6 +9,15 @@ function reduceStyles(styles) {
9
9
  * @public
10
10
  */
11
11
  export class ElementStyles {
12
+ /**
13
+ * Gets the StyleStrategy associated with these element styles.
14
+ */
15
+ get strategy() {
16
+ if (this._strategy === null) {
17
+ this.withStrategy(DefaultStyleStrategy);
18
+ }
19
+ return this._strategy;
20
+ }
12
21
  /**
13
22
  * Creates an instance of ElementStyles.
14
23
  * @param styles - The styles that will be associated with elements.
@@ -21,15 +30,6 @@ export class ElementStyles {
21
30
  .map((x) => x instanceof ElementStyles ? x.behaviors : null)
22
31
  .reduce((prev, curr) => (curr === null ? prev : prev === null ? curr : prev.concat(curr)), null);
23
32
  }
24
- /**
25
- * Gets the StyleStrategy associated with these element styles.
26
- */
27
- get strategy() {
28
- if (this._strategy === null) {
29
- this.withStrategy(DefaultStyleStrategy);
30
- }
31
- return this._strategy;
32
- }
33
33
  /** @internal */
34
34
  addStylesTo(target) {
35
35
  this.strategy.addStylesTo(target);
@@ -348,6 +348,13 @@ export class RepeatBehavior {
348
348
  * @public
349
349
  */
350
350
  export class RepeatDirective {
351
+ /**
352
+ * Creates a placeholder string based on the directive's index within the template.
353
+ * @param index - The index of the directive within the template.
354
+ */
355
+ createHTML(add) {
356
+ return Markup.comment(add(this));
357
+ }
351
358
  /**
352
359
  * Creates an instance of RepeatDirective.
353
360
  * @param dataBinding - The binding that provides the array to render.
@@ -360,13 +367,6 @@ export class RepeatDirective {
360
367
  this.options = options;
361
368
  ArrayObserver.enable();
362
369
  }
363
- /**
364
- * Creates a placeholder string based on the directive's index within the template.
365
- * @param index - The index of the directive within the template.
366
- */
367
- createHTML(add) {
368
- return Markup.comment(add(this));
369
- }
370
370
  /**
371
371
  * Creates a behavior for the provided target node.
372
372
  * @param target - The node instance to create the behavior for.
@@ -278,6 +278,15 @@ export class HydrationBindingError extends Error {
278
278
  }
279
279
  }
280
280
  export class HydrationView extends DefaultExecutionContext {
281
+ get hydrationStage() {
282
+ return this._hydrationStage;
283
+ }
284
+ get targets() {
285
+ return this._targets;
286
+ }
287
+ get bindingViewBoundaries() {
288
+ return this._bindingViewBoundaries;
289
+ }
281
290
  constructor(firstChild, lastChild, sourceTemplate, hostBindingTarget) {
282
291
  super();
283
292
  this.firstChild = firstChild;
@@ -297,15 +306,6 @@ export class HydrationView extends DefaultExecutionContext {
297
306
  this._targets = {};
298
307
  this.factories = sourceTemplate.compile().factories;
299
308
  }
300
- get hydrationStage() {
301
- return this._hydrationStage;
302
- }
303
- get targets() {
304
- return this._targets;
305
- }
306
- get bindingViewBoundaries() {
307
- return this._bindingViewBoundaries;
308
- }
309
309
  /**
310
310
  * no-op. Hydrated views are don't need to be moved from a documentFragment
311
311
  * to the target node.