@microsoft/fast-element 2.0.0-beta.1 → 2.0.0-beta.10

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 (96) hide show
  1. package/CHANGELOG.json +333 -0
  2. package/CHANGELOG.md +106 -1
  3. package/dist/dts/components/attributes.d.ts +10 -0
  4. package/dist/dts/components/{controller.d.ts → element-controller.d.ts} +24 -25
  5. package/dist/dts/components/fast-definitions.d.ts +43 -9
  6. package/dist/dts/components/fast-element.d.ts +15 -21
  7. package/dist/dts/context.d.ts +157 -0
  8. package/dist/dts/di/di.d.ts +899 -0
  9. package/dist/dts/index.d.ts +2 -2
  10. package/dist/dts/interfaces.d.ts +44 -12
  11. package/dist/dts/metadata.d.ts +25 -0
  12. package/dist/dts/observation/arrays.d.ts +1 -1
  13. package/dist/dts/observation/observable.d.ts +101 -75
  14. package/dist/dts/pending-task.d.ts +20 -0
  15. package/dist/dts/platform.d.ts +6 -0
  16. package/dist/dts/state/exports.d.ts +3 -0
  17. package/dist/dts/state/reactive.d.ts +8 -0
  18. package/dist/dts/state/state.d.ts +141 -0
  19. package/dist/dts/state/visitor.d.ts +6 -0
  20. package/dist/dts/state/watch.d.ts +10 -0
  21. package/dist/dts/styles/css-directive.d.ts +2 -2
  22. package/dist/dts/styles/element-styles.d.ts +9 -3
  23. package/dist/dts/styles/host.d.ts +68 -0
  24. package/dist/dts/templating/binding-signal.d.ts +21 -0
  25. package/dist/dts/templating/binding-two-way.d.ts +39 -0
  26. package/dist/dts/templating/binding.d.ts +69 -294
  27. package/dist/dts/templating/children.d.ts +1 -1
  28. package/dist/dts/templating/compiler.d.ts +1 -2
  29. package/dist/dts/templating/html-directive.d.ts +93 -35
  30. package/dist/dts/templating/node-observation.d.ts +4 -5
  31. package/dist/dts/templating/ref.d.ts +5 -13
  32. package/dist/dts/templating/render.d.ts +272 -0
  33. package/dist/dts/templating/repeat.d.ts +20 -75
  34. package/dist/dts/templating/slotted.d.ts +1 -1
  35. package/dist/dts/templating/template.d.ts +12 -61
  36. package/dist/dts/templating/view.d.ts +77 -12
  37. package/dist/dts/templating/when.d.ts +3 -3
  38. package/dist/dts/testing/exports.d.ts +3 -0
  39. package/dist/dts/testing/fakes.d.ts +4 -0
  40. package/dist/dts/testing/fixture.d.ts +84 -0
  41. package/dist/dts/testing/timeout.d.ts +7 -0
  42. package/dist/{tsdoc-metadata.json → dts/tsdoc-metadata.json} +0 -0
  43. package/dist/dts/utilities.d.ts +0 -18
  44. package/dist/esm/components/attributes.js +13 -4
  45. package/dist/esm/components/{controller.js → element-controller.js} +95 -105
  46. package/dist/esm/components/fast-definitions.js +38 -28
  47. package/dist/esm/components/fast-element.js +31 -12
  48. package/dist/esm/context.js +163 -0
  49. package/dist/esm/debug.js +36 -4
  50. package/dist/esm/di/di.js +1435 -0
  51. package/dist/esm/index.js +2 -1
  52. package/dist/esm/interfaces.js +4 -0
  53. package/dist/esm/metadata.js +60 -0
  54. package/dist/esm/observation/arrays.js +304 -3
  55. package/dist/esm/observation/observable.js +81 -87
  56. package/dist/esm/pending-task.js +16 -0
  57. package/dist/esm/platform.js +25 -1
  58. package/dist/esm/state/exports.js +3 -0
  59. package/dist/esm/state/reactive.js +34 -0
  60. package/dist/esm/state/state.js +148 -0
  61. package/dist/esm/state/visitor.js +28 -0
  62. package/dist/esm/state/watch.js +36 -0
  63. package/dist/esm/styles/css.js +4 -4
  64. package/dist/esm/styles/element-styles.js +14 -0
  65. package/dist/esm/{observation/behavior.js → styles/host.js} +0 -0
  66. package/dist/esm/templating/binding-signal.js +83 -0
  67. package/dist/esm/templating/binding-two-way.js +103 -0
  68. package/dist/esm/templating/binding.js +134 -414
  69. package/dist/esm/templating/compiler.js +30 -7
  70. package/dist/esm/templating/html-directive.js +100 -28
  71. package/dist/esm/templating/node-observation.js +9 -8
  72. package/dist/esm/templating/ref.js +4 -12
  73. package/dist/esm/templating/render.js +391 -0
  74. package/dist/esm/templating/repeat.js +96 -72
  75. package/dist/esm/templating/template.js +11 -29
  76. package/dist/esm/templating/view.js +107 -29
  77. package/dist/esm/templating/when.js +5 -4
  78. package/dist/esm/testing/exports.js +3 -0
  79. package/dist/esm/testing/fakes.js +76 -0
  80. package/dist/esm/testing/fixture.js +86 -0
  81. package/dist/esm/testing/timeout.js +24 -0
  82. package/dist/esm/utilities.js +0 -95
  83. package/dist/fast-element.api.json +9034 -10524
  84. package/dist/fast-element.d.ts +707 -811
  85. package/dist/fast-element.debug.js +1133 -850
  86. package/dist/fast-element.debug.min.js +1 -1
  87. package/dist/fast-element.js +1097 -846
  88. package/dist/fast-element.min.js +1 -1
  89. package/dist/fast-element.untrimmed.d.ts +724 -818
  90. package/docs/api-report.md +264 -305
  91. package/package.json +39 -10
  92. package/dist/dts/hooks.d.ts +0 -20
  93. package/dist/dts/observation/behavior.d.ts +0 -19
  94. package/dist/dts/observation/splice-strategies.d.ts +0 -13
  95. package/dist/esm/hooks.js +0 -32
  96. package/dist/esm/observation/splice-strategies.js +0 -400
package/CHANGELOG.json CHANGED
@@ -1,6 +1,339 @@
1
1
  {
2
2
  "name": "@microsoft/fast-element",
3
3
  "entries": [
4
+ {
5
+ "date": "Mon, 03 Oct 2022 23:44:38 GMT",
6
+ "tag": "@microsoft/fast-element_v2.0.0-beta.10",
7
+ "version": "2.0.0-beta.10",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "roeisenb@microsoft.com",
12
+ "package": "@microsoft/fast-element",
13
+ "commit": "d29444567d824eb92f4e91e9e173319aef30cfb5",
14
+ "comment": "fix: observation kernel missing binding observer disconnect method"
15
+ },
16
+ {
17
+ "author": "roeisenb@microsoft.com",
18
+ "package": "@microsoft/fast-element",
19
+ "commit": "9d620288eb30d963aa7ac08b4d771d79ea6eef7b",
20
+ "comment": "feat: less surprising class bindings w/ more flexibility for developers"
21
+ },
22
+ {
23
+ "author": "roeisenb@microsoft.com",
24
+ "package": "@microsoft/fast-element",
25
+ "commit": "a378bfa01843a8a042f3ae37aad6c8fd14fdbcc6",
26
+ "comment": "fix: don't allow registering FASTElement itself as a web component"
27
+ }
28
+ ]
29
+ }
30
+ },
31
+ {
32
+ "date": "Wed, 28 Sep 2022 20:45:51 GMT",
33
+ "tag": "@microsoft/fast-element_v2.0.0-beta.9",
34
+ "version": "2.0.0-beta.9",
35
+ "comments": {
36
+ "prerelease": [
37
+ {
38
+ "author": "roeisenb@microsoft.com",
39
+ "package": "@microsoft/fast-element",
40
+ "commit": "08fab33015853b7f820fdfdac2aecddfeb31843f",
41
+ "comment": "fix: ensure composed templates receive the existing execution context"
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ {
47
+ "date": "Tue, 27 Sep 2022 22:31:52 GMT",
48
+ "tag": "@microsoft/fast-element_v2.0.0-beta.8",
49
+ "version": "2.0.0-beta.8",
50
+ "comments": {
51
+ "prerelease": [
52
+ {
53
+ "author": "roeisenb@microsoft.com",
54
+ "package": "@microsoft/fast-element",
55
+ "commit": "8834c6732c727d39f92f72b197388453a9c17f9b",
56
+ "comment": "fix: correct view state when processing unbindables during rebind"
57
+ },
58
+ {
59
+ "author": "roeisenb@microsoft.com",
60
+ "package": "@microsoft/fast-element",
61
+ "commit": "d949a8873621f409f9d9f3453cdb40b593d14b67",
62
+ "comment": "fix: do not crash when null/undefined is provided literally in templates"
63
+ }
64
+ ]
65
+ }
66
+ },
67
+ {
68
+ "date": "Fri, 23 Sep 2022 22:53:27 GMT",
69
+ "tag": "@microsoft/fast-element_v2.0.0-beta.7",
70
+ "version": "2.0.0-beta.7",
71
+ "comments": {
72
+ "prerelease": [
73
+ {
74
+ "author": "roeisenb@microsoft.com",
75
+ "package": "@microsoft/fast-element",
76
+ "commit": "1646b26450a08a77c8bd6302560fe12cc6989ae1",
77
+ "comment": "feat: improve parent typing and fix repeat context type bug"
78
+ },
79
+ {
80
+ "author": "roeisenb@microsoft.com",
81
+ "package": "@microsoft/fast-element",
82
+ "commit": "0d786392a38e1d83e56fb1e2112a3e571d193c11",
83
+ "comment": "feat: prepare fast-element for scoped element registries"
84
+ },
85
+ {
86
+ "author": "wendywendy@microsoft.com",
87
+ "package": "@microsoft/fast-element",
88
+ "commit": "a42ff75a9130a5ce13006c272c2e2bbbaffdbb41",
89
+ "comment": "persist totalAvailableViews to compare against removeIndex"
90
+ },
91
+ {
92
+ "author": "863023+radium-v@users.noreply.github.com",
93
+ "package": "@microsoft/fast-element",
94
+ "commit": "ec2b158dcf39c8b4152b22c3b65963046b473e17",
95
+ "comment": "make ElementsFilter type arguments optional"
96
+ },
97
+ {
98
+ "author": "roeisenb@microsoft.com",
99
+ "package": "@microsoft/fast-element",
100
+ "commit": "1039218eafa9a8dbea9da94e1c7803de48d1484c",
101
+ "comment": "fix(fast-element): attributes properly located in inheritance hierarchy"
102
+ },
103
+ {
104
+ "author": "nicholasrice@users.noreply.github.com",
105
+ "package": "@microsoft/fast-element",
106
+ "commit": "c1909e9899d517f9483b24043d49a8b193af3c26",
107
+ "comment": "Adds PendingTask community protocol"
108
+ },
109
+ {
110
+ "author": "roeisenb@microsoft.com",
111
+ "package": "@microsoft/fast-element",
112
+ "commit": "2edd63a8abe24c68cfc7c76d773c912c6f2d6543",
113
+ "comment": "feat: new behavior and context API design"
114
+ },
115
+ {
116
+ "author": "roeisenb@microsoft.com",
117
+ "package": "@microsoft/fast-element",
118
+ "commit": "eb62934b258334c7f92ab3a1112ea62b3901cdac",
119
+ "comment": "feat: implement getAsync code path for dependency injection"
120
+ }
121
+ ]
122
+ }
123
+ },
124
+ {
125
+ "date": "Thu, 01 Sep 2022 21:53:34 GMT",
126
+ "tag": "@microsoft/fast-element_v2.0.0-beta.6",
127
+ "version": "2.0.0-beta.6",
128
+ "comments": {
129
+ "prerelease": [
130
+ {
131
+ "author": "roeisenb@microsoft.com",
132
+ "package": "@microsoft/fast-element",
133
+ "commit": "da9ebbe1b7471cd4e6f7b74f2f9bf02fcc54da4f",
134
+ "comment": "feat: add new state, ownedState, and computedState APIs"
135
+ }
136
+ ]
137
+ }
138
+ },
139
+ {
140
+ "date": "Thu, 18 Aug 2022 20:46:10 GMT",
141
+ "tag": "@microsoft/fast-element_v2.0.0-beta.5",
142
+ "version": "2.0.0-beta.5",
143
+ "comments": {
144
+ "prerelease": [
145
+ {
146
+ "author": "nicholasrice@users.noreply.github.com",
147
+ "package": "@microsoft/fast-element",
148
+ "commit": "218cfc014f5c76464493725f83bd883e8b07defa",
149
+ "comment": "Fix ExpressionObserer bug where watcher was not reset if the binding threw"
150
+ },
151
+ {
152
+ "author": "prudepixie@users.noreply.github.com",
153
+ "package": "@microsoft/fast-element",
154
+ "commit": "fdd4514664691021a5673934c95acf31a8e73416",
155
+ "comment": "make insertbefore noop in view"
156
+ },
157
+ {
158
+ "author": "prudepixie@users.noreply.github.com",
159
+ "package": "@microsoft/fast-element",
160
+ "commit": "eb8d5a59f645b85567adadac41a3bfa66001f941",
161
+ "comment": "make sure default options for recycle gets set in different scenarios"
162
+ },
163
+ {
164
+ "author": "roeisenb@microsoft.com",
165
+ "package": "@microsoft/fast-element",
166
+ "commit": "ac3954c97acd3bd549a27829593855c431a24027",
167
+ "comment": "refactor: remove dependency of DI on FASTElement"
168
+ },
169
+ {
170
+ "author": "32497422+KingOfTac@users.noreply.github.com",
171
+ "package": "@microsoft/fast-element",
172
+ "commit": "29308db7920baaaac5b31b206d551669e165bc06",
173
+ "comment": "add subpath export for package.json to packages"
174
+ },
175
+ {
176
+ "author": "prudepixie@users.noreply.github.com",
177
+ "package": "@microsoft/fast-element",
178
+ "commit": "775d51602cba544347ec1e57fdb4fea248d1b1b5",
179
+ "comment": "change default array strategy to merge strategy, update repeat directive"
180
+ },
181
+ {
182
+ "author": "nicholasrice@users.noreply.github.com",
183
+ "package": "@microsoft/fast-element",
184
+ "commit": "aeac1198f427c33f789a2d869f58549ea5bfea57",
185
+ "comment": "assert FASTElement's type so that instanceof behavior is consistent with other class implementations"
186
+ }
187
+ ]
188
+ }
189
+ },
190
+ {
191
+ "date": "Mon, 18 Jul 2022 21:10:01 GMT",
192
+ "tag": "@microsoft/fast-element_v2.0.0-beta.4",
193
+ "version": "2.0.0-beta.4",
194
+ "comments": {
195
+ "prerelease": [
196
+ {
197
+ "author": "roeisenb@microsoft.com",
198
+ "package": "@microsoft/fast-element",
199
+ "commit": "f9fb9c88902bd81233fb927a7357d4bca7634f29",
200
+ "comment": "feat: extract all error messages from context and DI"
201
+ },
202
+ {
203
+ "author": "roeisenb@microsoft.com",
204
+ "package": "@microsoft/fast-element",
205
+ "commit": "27dc848327b25328e428f67505684d2171b58711",
206
+ "comment": "feat: introduce new binding API"
207
+ },
208
+ {
209
+ "author": "roeisenb@microsoft.com",
210
+ "package": "@microsoft/fast-element",
211
+ "commit": "7f4d6b5587f6eff52e5b7f414e27543bb4d7772d",
212
+ "comment": "Enabled DOM Container fallback functions when a container cannot be located."
213
+ },
214
+ {
215
+ "author": "roeisenb@microsoft.com",
216
+ "package": "@microsoft/fast-element",
217
+ "commit": "0f57d55822bbf97ab69f90efc0a0d100b27e10eb",
218
+ "comment": "feat: add render directive, renderWith decorator, and RenderInstruction"
219
+ },
220
+ {
221
+ "author": "prudepixie@users.noreply.github.com",
222
+ "package": "@microsoft/fast-element",
223
+ "commit": "94e6b0a0e7e1fd1167bd6453c3f7b27efdc91804",
224
+ "comment": "only store removed views if it can't be reused right away"
225
+ },
226
+ {
227
+ "author": "32497422+KingOfTac@users.noreply.github.com",
228
+ "package": "@microsoft/fast-element",
229
+ "commit": "11d5b4075118456b2e7c2a4f32a415eeea94ed7f",
230
+ "comment": "fix: enable createElementTemplate to have undefined attributes"
231
+ },
232
+ {
233
+ "author": "prudepixie@users.noreply.github.com",
234
+ "package": "@microsoft/fast-element",
235
+ "commit": "31296ea2be3981d25f5feb773b2895dbedfaf2c2",
236
+ "comment": "use index to track reusable views"
237
+ },
238
+ {
239
+ "author": "roeisenb@microsoft.com",
240
+ "package": "@microsoft/fast-element",
241
+ "commit": "4567188a47598b3d2589b05f039bea695f2b8875",
242
+ "comment": "feat: enable render, repeat, and when template helpers to handle static data in addition to the already supported dynamic bindings"
243
+ },
244
+ {
245
+ "author": "roeisenb@microsoft.com",
246
+ "package": "@microsoft/fast-element",
247
+ "commit": "f164aa75e62ed71c9386902051c021f1fdfba364",
248
+ "comment": "fix: FASTElementDefinition#isDefined should be true only after define"
249
+ },
250
+ {
251
+ "author": "roeisenb@microsoft.com",
252
+ "package": "@microsoft/fast-element",
253
+ "commit": "aacfde6d1f52a20af5511c5e792f730bd091d452",
254
+ "comment": "feat: move testing and dependency injection to fast-element"
255
+ },
256
+ {
257
+ "author": "roeisenb@microsoft.com",
258
+ "package": "@microsoft/fast-element",
259
+ "commit": "04c51a17dde6d03dc2e2a4de3666cbbec950d900",
260
+ "comment": "fix: warn when host bindings are accidentally applied on non CE views"
261
+ },
262
+ {
263
+ "author": "roeisenb@microsoft.com",
264
+ "package": "@microsoft/fast-element",
265
+ "commit": "b32eb1004960da95b74dba7f111ee859b6655896",
266
+ "comment": "feat: perf and safety improvements to fast element definition"
267
+ }
268
+ ]
269
+ }
270
+ },
271
+ {
272
+ "date": "Wed, 22 Jun 2022 20:17:50 GMT",
273
+ "tag": "@microsoft/fast-element_v2.0.0-beta.3",
274
+ "version": "2.0.0-beta.3",
275
+ "comments": {
276
+ "prerelease": [
277
+ {
278
+ "comment": "fix: correct aspect type for content that looks like an attribute",
279
+ "author": "nicholasrice@users.noreply.github.com",
280
+ "commit": "f28cdb9fdba9cb27904acfad7444de82d447f39e",
281
+ "package": "@microsoft/fast-element"
282
+ }
283
+ ]
284
+ }
285
+ },
286
+ {
287
+ "date": "Wed, 15 Jun 2022 17:41:10 GMT",
288
+ "tag": "@microsoft/fast-element_v2.0.0-beta.2",
289
+ "version": "2.0.0-beta.2",
290
+ "comments": {
291
+ "prerelease": [
292
+ {
293
+ "comment": "doc: add note to FASTElement.metadata API",
294
+ "author": "roeisenb@microsoft.com",
295
+ "commit": "359467f9ae67c46a33dfc28ce86dfd908072695d",
296
+ "package": "@microsoft/fast-element"
297
+ },
298
+ {
299
+ "comment": "when recycle is set to false while itemBinding stays the same, views should be recreated",
300
+ "author": "wendy.hsu@microsoft.com",
301
+ "commit": "9c92b9bb5bc9bf221b439c0a776b3621fdd9d9aa",
302
+ "package": "@microsoft/fast-element"
303
+ },
304
+ {
305
+ "comment": "feat: simplify execution context to align closer with v1",
306
+ "author": "roeisenb@microsoft.com",
307
+ "commit": "488d051999c43b93a0beef4db30a2bddd6bbdc64",
308
+ "package": "@microsoft/fast-element"
309
+ },
310
+ {
311
+ "comment": "feat: ergo improvements to context, array length, and metadata",
312
+ "author": "roeisenb@microsoft.com",
313
+ "commit": "12f5671e215ebd2b95c9cc83f856e233e01e9c4a",
314
+ "package": "@microsoft/fast-element"
315
+ },
316
+ {
317
+ "comment": "feat: move optional bindings out of rollup and list as exports",
318
+ "author": "roeisenb@microsoft.com",
319
+ "commit": "e86a638b9e84cbf36d950025889742944e68e512",
320
+ "package": "@microsoft/fast-element"
321
+ },
322
+ {
323
+ "comment": "fix: make SyntheticViewTemplate type a string so it is generally usable",
324
+ "author": "roeisenb@microsoft.com",
325
+ "commit": "de7f234ef871204fcac2b5df59433d919809341d",
326
+ "package": "@microsoft/fast-element"
327
+ },
328
+ {
329
+ "comment": "feat: implement W3C WC community context protocol and integrate with DI",
330
+ "author": "roeisenb@microsoft.com",
331
+ "commit": "c45297c0ca48b7e5f4343ba48e5183f2bccdb946",
332
+ "package": "@microsoft/fast-element"
333
+ }
334
+ ]
335
+ }
336
+ },
4
337
  {
5
338
  "date": "Wed, 01 Jun 2022 17:53:14 GMT",
6
339
  "tag": "@microsoft/fast-element_v2.0.0-beta.1",
package/CHANGELOG.md CHANGED
@@ -1,9 +1,114 @@
1
1
  # Change Log - @microsoft/fast-element
2
2
 
3
- This log was last generated on Wed, 01 Jun 2022 17:53:14 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 03 Oct 2022 23:44:38 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.0.0-beta.10
8
+
9
+ Mon, 03 Oct 2022 23:44:38 GMT
10
+
11
+ ### Changes
12
+
13
+ - fix: observation kernel missing binding observer disconnect method (roeisenb@microsoft.com)
14
+ - feat: less surprising class bindings w/ more flexibility for developers (roeisenb@microsoft.com)
15
+ - fix: don't allow registering FASTElement itself as a web component (roeisenb@microsoft.com)
16
+
17
+ ## 2.0.0-beta.9
18
+
19
+ Wed, 28 Sep 2022 20:45:51 GMT
20
+
21
+ ### Changes
22
+
23
+ - fix: ensure composed templates receive the existing execution context (roeisenb@microsoft.com)
24
+
25
+ ## 2.0.0-beta.8
26
+
27
+ Tue, 27 Sep 2022 22:31:52 GMT
28
+
29
+ ### Changes
30
+
31
+ - fix: correct view state when processing unbindables during rebind (roeisenb@microsoft.com)
32
+ - fix: do not crash when null/undefined is provided literally in templates (roeisenb@microsoft.com)
33
+
34
+ ## 2.0.0-beta.7
35
+
36
+ Fri, 23 Sep 2022 22:53:27 GMT
37
+
38
+ ### Changes
39
+
40
+ - feat: improve parent typing and fix repeat context type bug (roeisenb@microsoft.com)
41
+ - feat: prepare fast-element for scoped element registries (roeisenb@microsoft.com)
42
+ - persist totalAvailableViews to compare against removeIndex (wendywendy@microsoft.com)
43
+ - make ElementsFilter type arguments optional (863023+radium-v@users.noreply.github.com)
44
+ - fix(fast-element): attributes properly located in inheritance hierarchy (roeisenb@microsoft.com)
45
+ - Adds PendingTask community protocol (nicholasrice@users.noreply.github.com)
46
+ - feat: new behavior and context API design (roeisenb@microsoft.com)
47
+ - feat: implement getAsync code path for dependency injection (roeisenb@microsoft.com)
48
+
49
+ ## 2.0.0-beta.6
50
+
51
+ Thu, 01 Sep 2022 21:53:34 GMT
52
+
53
+ ### Changes
54
+
55
+ - feat: add new state, ownedState, and computedState APIs (roeisenb@microsoft.com)
56
+
57
+ ## 2.0.0-beta.5
58
+
59
+ Thu, 18 Aug 2022 20:46:10 GMT
60
+
61
+ ### Changes
62
+
63
+ - Fix ExpressionObserer bug where watcher was not reset if the binding threw (nicholasrice@users.noreply.github.com)
64
+ - make insertbefore noop in view (prudepixie@users.noreply.github.com)
65
+ - make sure default options for recycle gets set in different scenarios (prudepixie@users.noreply.github.com)
66
+ - refactor: remove dependency of DI on FASTElement (roeisenb@microsoft.com)
67
+ - add subpath export for package.json to packages (32497422+KingOfTac@users.noreply.github.com)
68
+ - change default array strategy to merge strategy, update repeat directive (prudepixie@users.noreply.github.com)
69
+ - assert FASTElement's type so that instanceof behavior is consistent with other class implementations (nicholasrice@users.noreply.github.com)
70
+
71
+ ## 2.0.0-beta.4
72
+
73
+ Mon, 18 Jul 2022 21:10:01 GMT
74
+
75
+ ### Changes
76
+
77
+ - feat: extract all error messages from context and DI (roeisenb@microsoft.com)
78
+ - feat: introduce new binding API (roeisenb@microsoft.com)
79
+ - Enabled DOM Container fallback functions when a container cannot be located. (roeisenb@microsoft.com)
80
+ - feat: add render directive, renderWith decorator, and RenderInstruction (roeisenb@microsoft.com)
81
+ - only store removed views if it can't be reused right away (prudepixie@users.noreply.github.com)
82
+ - fix: enable createElementTemplate to have undefined attributes (32497422+KingOfTac@users.noreply.github.com)
83
+ - use index to track reusable views (prudepixie@users.noreply.github.com)
84
+ - feat: enable render, repeat, and when template helpers to handle static data in addition to the already supported dynamic bindings (roeisenb@microsoft.com)
85
+ - fix: FASTElementDefinition#isDefined should be true only after define (roeisenb@microsoft.com)
86
+ - feat: move testing and dependency injection to fast-element (roeisenb@microsoft.com)
87
+ - fix: warn when host bindings are accidentally applied on non CE views (roeisenb@microsoft.com)
88
+ - feat: perf and safety improvements to fast element definition (roeisenb@microsoft.com)
89
+
90
+ ## 2.0.0-beta.3
91
+
92
+ Wed, 22 Jun 2022 20:17:50 GMT
93
+
94
+ ### Changes
95
+
96
+ - fix: correct aspect type for content that looks like an attribute (nicholasrice@users.noreply.github.com)
97
+
98
+ ## 2.0.0-beta.2
99
+
100
+ Wed, 15 Jun 2022 17:41:10 GMT
101
+
102
+ ### Changes
103
+
104
+ - doc: add note to FASTElement.metadata API (roeisenb@microsoft.com)
105
+ - when recycle is set to false while itemBinding stays the same, views should be recreated (wendy.hsu@microsoft.com)
106
+ - feat: simplify execution context to align closer with v1 (roeisenb@microsoft.com)
107
+ - feat: ergo improvements to context, array length, and metadata (roeisenb@microsoft.com)
108
+ - feat: move optional bindings out of rollup and list as exports (roeisenb@microsoft.com)
109
+ - fix: make SyntheticViewTemplate type a string so it is generally usable (roeisenb@microsoft.com)
110
+ - feat: implement W3C WC community context protocol and integrate with DI (roeisenb@microsoft.com)
111
+
7
112
  ## 2.0.0-beta.1
8
113
 
9
114
  Wed, 01 Jun 2022 17:53:14 GMT
@@ -40,6 +40,16 @@ export declare type AttributeConfiguration = {
40
40
  mode?: AttributeMode;
41
41
  converter?: ValueConverter;
42
42
  };
43
+ /**
44
+ * Metadata used to configure a custom attribute's behavior.
45
+ * @public
46
+ */
47
+ export declare const AttributeConfiguration: Readonly<{
48
+ /**
49
+ * Locates all attribute configurations associated with a type.
50
+ */
51
+ locate: (target: {}) => AttributeConfiguration[];
52
+ }>;
43
53
  /**
44
54
  * Metadata used to configure a custom attribute's behavior through a decorator.
45
55
  * @public
@@ -1,21 +1,21 @@
1
- import type { Behavior } from "../observation/behavior.js";
1
+ import type { HostBehavior, HostController } from "../styles/host.js";
2
2
  import { PropertyChangeNotifier } from "../observation/notifier.js";
3
- import type { ElementStyles } from "../styles/element-styles.js";
4
3
  import type { ElementViewTemplate } from "../templating/template.js";
5
4
  import type { ElementView } from "../templating/view.js";
5
+ import type { ElementStyles } from "../styles/element-styles.js";
6
6
  import { FASTElementDefinition } from "./fast-definitions.js";
7
7
  /**
8
8
  * Controls the lifecycle and rendering of a `FASTElement`.
9
9
  * @public
10
10
  */
11
- export declare class Controller<TElement extends HTMLElement = HTMLElement> extends PropertyChangeNotifier {
11
+ export declare class ElementController<TElement extends HTMLElement = HTMLElement> extends PropertyChangeNotifier implements HostController<TElement> {
12
12
  private boundObservables;
13
- private behaviors;
14
13
  private needsInitialization;
15
14
  private hasExistingShadowRoot;
16
15
  private _template;
17
- private _styles;
18
16
  private _isConnected;
17
+ private behaviors;
18
+ private _mainStyles;
19
19
  /**
20
20
  * This allows Observable.getNotifier(...) to return the Controller
21
21
  * when the notifier for the Controller itself is being requested. The
@@ -28,7 +28,7 @@ export declare class Controller<TElement extends HTMLElement = HTMLElement> exte
28
28
  /**
29
29
  * The element being controlled by this controller.
30
30
  */
31
- readonly element: TElement;
31
+ readonly source: TElement;
32
32
  /**
33
33
  * The element definition that instructs this controller
34
34
  * in how to handle rendering and other platform integrations.
@@ -54,12 +54,11 @@ export declare class Controller<TElement extends HTMLElement = HTMLElement> exte
54
54
  get template(): ElementViewTemplate<TElement> | null;
55
55
  set template(value: ElementViewTemplate<TElement> | null);
56
56
  /**
57
- * Gets/sets the primary styles used for the component.
58
- * @remarks
59
- * This value can only be accurately read after connect but can be set at any time.
57
+ * The main set of styles used for the component, independent
58
+ * of any dynamically added styles.
60
59
  */
61
- get styles(): ElementStyles | null;
62
- set styles(value: ElementStyles | null);
60
+ get mainStyles(): ElementStyles | null;
61
+ set mainStyles(value: ElementStyles | null);
63
62
  /**
64
63
  * Creates a Controller to control the specified element.
65
64
  * @param element - The element to be controlled by this controller.
@@ -68,6 +67,17 @@ export declare class Controller<TElement extends HTMLElement = HTMLElement> exte
68
67
  * @internal
69
68
  */
70
69
  constructor(element: TElement, definition: FASTElementDefinition);
70
+ /**
71
+ * Adds the behavior to the component.
72
+ * @param behavior - The behavior to add.
73
+ */
74
+ addBehavior(behavior: HostBehavior<TElement>): void;
75
+ /**
76
+ * Removes the behavior from the component.
77
+ * @param behavior - The behavior to remove.
78
+ * @param force - Forces removal even if this behavior was added more than once.
79
+ */
80
+ removeBehavior(behavior: HostBehavior<TElement>, force?: boolean): void;
71
81
  /**
72
82
  * Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot.
73
83
  * @param styles - The styles to add.
@@ -78,25 +88,14 @@ export declare class Controller<TElement extends HTMLElement = HTMLElement> exte
78
88
  * @param styles - the styles to remove.
79
89
  */
80
90
  removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
81
- /**
82
- * Adds behaviors to this element.
83
- * @param behaviors - The behaviors to add.
84
- */
85
- addBehaviors(behaviors: ReadonlyArray<Behavior<TElement>>): void;
86
- /**
87
- * Removes behaviors from this element.
88
- * @param behaviors - The behaviors to remove.
89
- * @param force - Forces unbinding of behaviors.
90
- */
91
- removeBehaviors(behaviors: ReadonlyArray<Behavior<TElement>>, force?: boolean): void;
92
91
  /**
93
92
  * Runs connected lifecycle behavior on the associated element.
94
93
  */
95
- onConnectedCallback(): void;
94
+ connect(): void;
96
95
  /**
97
96
  * Runs disconnected lifecycle behavior on the associated element.
98
97
  */
99
- onDisconnectedCallback(): void;
98
+ disconnect(): void;
100
99
  /**
101
100
  * Runs the attribute changed callback for the associated element.
102
101
  * @param name - The name of the attribute that changed.
@@ -123,5 +122,5 @@ export declare class Controller<TElement extends HTMLElement = HTMLElement> exte
123
122
  * registered either through the use of the {@link customElement}
124
123
  * decorator or a call to `FASTElement.define`.
125
124
  */
126
- static forCustomElement(element: HTMLElement): Controller;
125
+ static forCustomElement(element: HTMLElement): ElementController;
127
126
  }
@@ -2,6 +2,18 @@ import { Constructable } from "../interfaces.js";
2
2
  import { ComposableStyles, ElementStyles } from "../styles/element-styles.js";
3
3
  import type { ElementViewTemplate } from "../templating/template.js";
4
4
  import { AttributeConfiguration, AttributeDefinition } from "./attributes.js";
5
+ /**
6
+ * Shadow root initialization options.
7
+ * @public
8
+ */
9
+ export interface ShadowRootOptions extends ShadowRootInit {
10
+ /**
11
+ * A registry that provides the custom elements visible
12
+ * from within this shadow root.
13
+ * @beta
14
+ */
15
+ registry?: CustomElementRegistry;
16
+ }
5
17
  /**
6
18
  * Represents metadata configuration for a custom element.
7
19
  * @public
@@ -25,19 +37,28 @@ export interface PartialFASTElementDefinition {
25
37
  readonly attributes?: (AttributeConfiguration | string)[];
26
38
  /**
27
39
  * Options controlling the creation of the custom element's shadow DOM.
40
+ * @remarks
41
+ * If not provided, defaults to an open shadow root. Provide null
42
+ * to render to the associated template to the light DOM instead.
28
43
  */
29
- readonly shadowOptions?: Partial<ShadowRootInit> | null;
44
+ readonly shadowOptions?: Partial<ShadowRootOptions> | null;
30
45
  /**
31
46
  * Options controlling how the custom element is defined with the platform.
32
47
  */
33
48
  readonly elementOptions?: ElementDefinitionOptions;
49
+ /**
50
+ * The registry to register this component in by default.
51
+ * @remarks
52
+ * If not provided, defaults to the global registry.
53
+ */
54
+ readonly registry?: CustomElementRegistry;
34
55
  }
35
56
  /**
36
57
  * Defines metadata for a FASTElement.
37
58
  * @public
38
59
  */
39
60
  export declare class FASTElementDefinition<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>> {
40
- private observedAttributes;
61
+ private platformDefined;
41
62
  /**
42
63
  * The type this element definition describes.
43
64
  */
@@ -73,23 +94,36 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
73
94
  /**
74
95
  * Options controlling the creation of the custom element's shadow DOM.
75
96
  */
76
- readonly shadowOptions?: ShadowRootInit;
97
+ readonly shadowOptions?: ShadowRootOptions;
77
98
  /**
78
99
  * Options controlling how the custom element is defined with the platform.
79
100
  */
80
- readonly elementOptions?: ElementDefinitionOptions;
101
+ readonly elementOptions: ElementDefinitionOptions;
81
102
  /**
82
- * Creates an instance of FASTElementDefinition.
83
- * @param type - The type this definition is being created for.
84
- * @param nameOrConfig - The name of the element to define or a config object
85
- * that describes the element to define.
103
+ * The registry to register this component in by default.
86
104
  */
87
- constructor(type: TType, nameOrConfig?: PartialFASTElementDefinition | string);
105
+ readonly registry: CustomElementRegistry;
106
+ private constructor();
88
107
  /**
89
108
  * Defines a custom element based on this definition.
90
109
  * @param registry - The element registry to define the element in.
110
+ * @remarks
111
+ * This operation is idempotent per registry.
91
112
  */
92
113
  define(registry?: CustomElementRegistry): this;
114
+ /**
115
+ * Creates an instance of FASTElementDefinition.
116
+ * @param type - The type this definition is being created for.
117
+ * @param nameOrDef - The name of the element to define or a config object
118
+ * that describes the element to define.
119
+ */
120
+ static compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
121
+ /**
122
+ * Registers a FASTElement base type.
123
+ * @param type - The type to register as a base type.
124
+ * @internal
125
+ */
126
+ static registerBaseType(type: Function): void;
93
127
  /**
94
128
  * Gets the element definition associated with the specified type.
95
129
  * @param type - The custom element type to retrieve the definition for.