@microsoft/fast-element 1.10.2 → 2.0.0-beta.3
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.
- package/.eslintrc.json +1 -12
- package/CHANGELOG.json +387 -1
- package/CHANGELOG.md +74 -2
- package/README.md +2 -2
- package/dist/dts/components/attributes.d.ts +4 -1
- package/dist/dts/components/controller.d.ts +12 -11
- package/dist/dts/components/fast-definitions.d.ts +10 -2
- package/dist/dts/components/fast-element.d.ts +12 -5
- package/dist/dts/context.d.ts +157 -0
- package/dist/dts/debug.d.ts +1 -0
- package/dist/dts/hooks.d.ts +20 -0
- package/dist/dts/index.d.ts +16 -15
- package/dist/dts/index.debug.d.ts +2 -0
- package/dist/dts/index.rollup.d.ts +2 -0
- package/dist/dts/index.rollup.debug.d.ts +3 -0
- package/dist/dts/interfaces.d.ts +145 -0
- package/dist/dts/metadata.d.ts +25 -0
- package/dist/dts/observation/arrays.d.ts +207 -0
- package/dist/dts/observation/behavior.d.ts +4 -4
- package/dist/dts/observation/notifier.d.ts +18 -18
- package/dist/dts/observation/observable.d.ts +56 -18
- package/dist/dts/observation/splice-strategies.d.ts +13 -0
- package/dist/dts/observation/update-queue.d.ts +40 -0
- package/dist/dts/platform.d.ts +18 -67
- package/dist/dts/polyfills.d.ts +8 -0
- package/dist/dts/styles/css-directive.d.ts +43 -5
- package/dist/dts/styles/css.d.ts +19 -3
- package/dist/dts/styles/element-styles.d.ts +42 -62
- package/dist/dts/templating/binding-signal.d.ts +38 -0
- package/dist/dts/templating/binding-two-way.d.ts +56 -0
- package/dist/dts/templating/binding.d.ts +233 -65
- package/dist/dts/templating/children.d.ts +18 -15
- package/dist/dts/templating/compiler.d.ts +46 -28
- package/dist/dts/templating/dom.d.ts +41 -0
- package/dist/dts/templating/html-directive.d.ts +181 -43
- package/dist/dts/templating/markup.d.ts +48 -0
- package/dist/dts/templating/node-observation.d.ts +45 -29
- package/dist/dts/templating/ref.d.ts +6 -12
- package/dist/dts/templating/repeat.d.ts +26 -14
- package/dist/dts/templating/slotted.d.ts +13 -14
- package/dist/dts/templating/template.d.ts +27 -21
- package/dist/dts/templating/view.d.ts +15 -22
- package/dist/{tsdoc-metadata.json → dts/tsdoc-metadata.json} +1 -1
- package/dist/dts/utilities.d.ts +40 -0
- package/dist/esm/components/attributes.js +25 -24
- package/dist/esm/components/controller.js +77 -57
- package/dist/esm/components/fast-definitions.js +16 -22
- package/dist/esm/components/fast-element.js +10 -2
- package/dist/esm/context.js +159 -0
- package/dist/esm/debug.js +30 -0
- package/dist/esm/hooks.js +32 -0
- package/dist/esm/index.debug.js +2 -0
- package/dist/esm/index.js +19 -14
- package/dist/esm/index.rollup.debug.js +3 -0
- package/dist/esm/index.rollup.js +2 -0
- package/dist/esm/interfaces.js +8 -1
- package/dist/esm/metadata.js +60 -0
- package/dist/esm/observation/arrays.js +269 -0
- package/dist/esm/observation/notifier.js +27 -35
- package/dist/esm/observation/observable.js +93 -68
- package/dist/esm/observation/{array-change-records.js → splice-strategies.js} +136 -62
- package/dist/esm/observation/update-queue.js +67 -0
- package/dist/esm/platform.js +36 -42
- package/dist/esm/polyfills.js +85 -0
- package/dist/esm/styles/css-directive.js +29 -13
- package/dist/esm/styles/css.js +27 -40
- package/dist/esm/styles/element-styles.js +65 -104
- package/dist/esm/templating/binding-signal.js +84 -0
- package/dist/esm/templating/binding-two-way.js +82 -0
- package/dist/esm/templating/binding.js +306 -153
- package/dist/esm/templating/children.js +33 -23
- package/dist/esm/templating/compiler.js +236 -152
- package/dist/esm/templating/dom.js +49 -0
- package/dist/esm/templating/html-directive.js +128 -40
- package/dist/esm/templating/markup.js +75 -0
- package/dist/esm/templating/node-observation.js +50 -45
- package/dist/esm/templating/ref.js +7 -16
- package/dist/esm/templating/repeat.js +39 -36
- package/dist/esm/templating/slotted.js +23 -20
- package/dist/esm/templating/template.js +51 -95
- package/dist/esm/templating/view.js +44 -43
- package/dist/esm/templating/when.js +2 -1
- package/dist/esm/utilities.js +139 -0
- package/dist/fast-element.api.json +11789 -5377
- package/dist/fast-element.d.ts +1178 -530
- package/dist/fast-element.debug.js +3722 -0
- package/dist/fast-element.debug.min.js +1 -0
- package/dist/fast-element.js +3484 -4033
- package/dist/fast-element.min.js +1 -1
- package/dist/fast-element.untrimmed.d.ts +2699 -0
- package/docs/api-report.md +472 -219
- package/docs/fast-element-2-changes.md +15 -0
- package/docs/guide/declaring-templates.md +4 -4
- package/docs/guide/defining-elements.md +2 -2
- package/docs/guide/next-steps.md +2 -2
- package/docs/guide/observables-and-state.md +1 -1
- package/docs/guide/using-directives.md +1 -1
- package/karma.conf.cjs +6 -17
- package/package.json +63 -15
- package/dist/dts/dom.d.ts +0 -112
- package/dist/dts/observation/array-change-records.d.ts +0 -48
- package/dist/dts/observation/array-observer.d.ts +0 -9
- package/dist/esm/dom.js +0 -207
- package/dist/esm/observation/array-observer.js +0 -177
package/.eslintrc.json
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"rules": {
|
|
4
4
|
"max-classes-per-file": "off",
|
|
5
5
|
"no-case-declarations": "off",
|
|
6
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
6
7
|
"@typescript-eslint/ban-types": [
|
|
7
8
|
"error",
|
|
8
9
|
{
|
|
@@ -13,18 +14,6 @@
|
|
|
13
14
|
},
|
|
14
15
|
"extendDefaults": true
|
|
15
16
|
}
|
|
16
|
-
],
|
|
17
|
-
"@typescript-eslint/no-use-before-define": ["error", { "typedefs": false }],
|
|
18
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
19
|
-
"@typescript-eslint/explicit-function-return-type": [
|
|
20
|
-
"error",
|
|
21
|
-
{
|
|
22
|
-
"allowExpressions": true
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
"import/extensions": [
|
|
26
|
-
"error",
|
|
27
|
-
"always"
|
|
28
17
|
]
|
|
29
18
|
}
|
|
30
19
|
}
|
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,393 @@
|
|
|
2
2
|
"name": "@microsoft/fast-element",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Wed, 22 Jun 2022 20:17:50 GMT",
|
|
6
|
+
"tag": "@microsoft/fast-element_v2.0.0-beta.3",
|
|
7
|
+
"version": "2.0.0-beta.3",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "fix: correct aspect type for content that looks like an attribute",
|
|
12
|
+
"author": "nicholasrice@users.noreply.github.com",
|
|
13
|
+
"commit": "f28cdb9fdba9cb27904acfad7444de82d447f39e",
|
|
14
|
+
"package": "@microsoft/fast-element"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Wed, 15 Jun 2022 17:41:10 GMT",
|
|
21
|
+
"tag": "@microsoft/fast-element_v2.0.0-beta.2",
|
|
22
|
+
"version": "2.0.0-beta.2",
|
|
23
|
+
"comments": {
|
|
24
|
+
"prerelease": [
|
|
25
|
+
{
|
|
26
|
+
"comment": "doc: add note to FASTElement.metadata API",
|
|
27
|
+
"author": "roeisenb@microsoft.com",
|
|
28
|
+
"commit": "359467f9ae67c46a33dfc28ce86dfd908072695d",
|
|
29
|
+
"package": "@microsoft/fast-element"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"comment": "when recycle is set to false while itemBinding stays the same, views should be recreated",
|
|
33
|
+
"author": "wendy.hsu@microsoft.com",
|
|
34
|
+
"commit": "9c92b9bb5bc9bf221b439c0a776b3621fdd9d9aa",
|
|
35
|
+
"package": "@microsoft/fast-element"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"comment": "feat: simplify execution context to align closer with v1",
|
|
39
|
+
"author": "roeisenb@microsoft.com",
|
|
40
|
+
"commit": "488d051999c43b93a0beef4db30a2bddd6bbdc64",
|
|
41
|
+
"package": "@microsoft/fast-element"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"comment": "feat: ergo improvements to context, array length, and metadata",
|
|
45
|
+
"author": "roeisenb@microsoft.com",
|
|
46
|
+
"commit": "12f5671e215ebd2b95c9cc83f856e233e01e9c4a",
|
|
47
|
+
"package": "@microsoft/fast-element"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"comment": "feat: move optional bindings out of rollup and list as exports",
|
|
51
|
+
"author": "roeisenb@microsoft.com",
|
|
52
|
+
"commit": "e86a638b9e84cbf36d950025889742944e68e512",
|
|
53
|
+
"package": "@microsoft/fast-element"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"comment": "fix: make SyntheticViewTemplate type a string so it is generally usable",
|
|
57
|
+
"author": "roeisenb@microsoft.com",
|
|
58
|
+
"commit": "de7f234ef871204fcac2b5df59433d919809341d",
|
|
59
|
+
"package": "@microsoft/fast-element"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"comment": "feat: implement W3C WC community context protocol and integrate with DI",
|
|
63
|
+
"author": "roeisenb@microsoft.com",
|
|
64
|
+
"commit": "c45297c0ca48b7e5f4343ba48e5183f2bccdb946",
|
|
65
|
+
"package": "@microsoft/fast-element"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"date": "Wed, 01 Jun 2022 17:53:14 GMT",
|
|
72
|
+
"tag": "@microsoft/fast-element_v2.0.0-beta.1",
|
|
73
|
+
"version": "2.0.0-beta.1",
|
|
74
|
+
"comments": {
|
|
75
|
+
"prerelease": [
|
|
76
|
+
{
|
|
77
|
+
"comment": "`DOM` - Tree Walker methods are no longer used and are thus removed. The API for removing child nodes has been removed as well since it was only used in one place and could be inlined. The helper `createCustomAttributePlaceholder()` no longer requires an attribute name. It will be uniquely generated internally.",
|
|
78
|
+
"author": "roeisenb@microsoft.com",
|
|
79
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
80
|
+
"package": "@microsoft/fast-element"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"comment": "`class` - Bindings to `class` are now more nuanced. Binding directly to `class` will simply set the `className` property. If you need to bind to `class` knowing that manual JS will also manipulate the `classList` in addition to the binding, then you should now bind to `:classList` instead. This allows for performance optimizations in the simple, most common case.",
|
|
84
|
+
"author": "roeisenb@microsoft.com",
|
|
85
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
86
|
+
"package": "@microsoft/fast-element"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"comment": "`Behavior` and `ViewBehavior` - `Behavior` now requires an `ExecutionContext` for `unbind`. Behaviors can be used for elements or views. `ViewBehavior` has been introduced for use exclusively with views, and provides some optimization opportunities.",
|
|
90
|
+
"author": "roeisenb@microsoft.com",
|
|
91
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
92
|
+
"package": "@microsoft/fast-element"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"comment": "`RefBehavior` has been replaced with `RefDirective`. The directive also implements `ViewBehavior` allowing a single directive instance to be shared across all template instances that use the ref.",
|
|
96
|
+
"author": "roeisenb@microsoft.com",
|
|
97
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
98
|
+
"package": "@microsoft/fast-element"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"comment": "Removed `SlottedBehavior` and `ChildrenBehavior` have been replaced with `SlottedDirective` and `ChildrenDirective`. These directives allow a single directive instance to be shared across all template instances that use the ref.",
|
|
102
|
+
"author": "roeisenb@microsoft.com",
|
|
103
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
104
|
+
"package": "@microsoft/fast-element"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"comment": "Removed `AttachedBehaviorHTMLDirective` and `AttachedBehaviorType` since they are no longer used in the new directive/behavior architecture for ref, slotted, and children.",
|
|
108
|
+
"author": "roeisenb@microsoft.com",
|
|
109
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
110
|
+
"package": "@microsoft/fast-element"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"comment": "Renamed `Notifier#source` to `Notifier#subject` to align with other observable terminology and prevent name clashes with `BindingObserver` properties.",
|
|
114
|
+
"author": "roeisenb@microsoft.com",
|
|
115
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
116
|
+
"package": "@microsoft/fast-element"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"comment": "feat: create unified API for parsing markers",
|
|
120
|
+
"author": "roeisenb@microsoft.com",
|
|
121
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
122
|
+
"package": "@microsoft/fast-element"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"comment": "allow null values in attributeChangedCallback",
|
|
126
|
+
"author": "nicholasrice@users.noreply.github.com",
|
|
127
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
128
|
+
"package": "@microsoft/fast-element"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"comment": "feat: add splice strategies for array observation",
|
|
132
|
+
"author": "roeisenb@microsoft.com",
|
|
133
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
134
|
+
"package": "@microsoft/fast-element"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"comment": "feat: handle existing shadow roots when upgrading",
|
|
138
|
+
"author": "roeisenb@microsoft.com",
|
|
139
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
140
|
+
"package": "@microsoft/fast-element"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"comment": "fix: enable safer type inference on the repeat helper",
|
|
144
|
+
"author": "roeisenb@microsoft.com",
|
|
145
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
146
|
+
"package": "@microsoft/fast-element"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"comment": "Set prerelease version",
|
|
150
|
+
"author": "nicholasrice@users.noreply.github.com",
|
|
151
|
+
"commit": "5b313a3262b977acbee3c2efac87d0d14a82f792",
|
|
152
|
+
"package": "@microsoft/fast-element"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"comment": "refactor: separate update queue from DOM and fix architectural layers",
|
|
156
|
+
"author": "roeisenb@microsoft.com",
|
|
157
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
158
|
+
"package": "@microsoft/fast-element"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"comment": "feat: aspected html directive exposes metadata",
|
|
162
|
+
"author": "roeisenb@microsoft.com",
|
|
163
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
164
|
+
"package": "@microsoft/fast-element"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"comment": "`HTMLDirective` - The `targetIndex: number` property has been replaced by a `targetId: string` property. The `createBehavior` method no longer takes a target `Node` but instead takes a `BehaviorTargets` instance. The actual target can be looked up on the `BehaviorTargets` instance by indexing with the `targetId` property.",
|
|
168
|
+
"author": "roeisenb@microsoft.com",
|
|
169
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
170
|
+
"package": "@microsoft/fast-element"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"comment": "`compileTemplate()` - Internals have been significantly changed. The implementation no longer uses a TreeWalker. The return type has change to an `HTMLTemplateCompilationResult` with different properties.",
|
|
174
|
+
"author": "roeisenb@microsoft.com",
|
|
175
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
176
|
+
"package": "@microsoft/fast-element"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"comment": "refactor: move template/style resolution to lazy getter",
|
|
180
|
+
"author": "roeisenb@microsoft.com",
|
|
181
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
182
|
+
"package": "@microsoft/fast-element"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"comment": "refactor: enable pluggable template compiler for SSR scenarios",
|
|
186
|
+
"author": "roeisenb@microsoft.com",
|
|
187
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
188
|
+
"package": "@microsoft/fast-element"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"comment": "feat: enable pluggable style handling strategies",
|
|
192
|
+
"author": "roeisenb@microsoft.com",
|
|
193
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
194
|
+
"package": "@microsoft/fast-element"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"comment": "fix(fast-element): do not notify splices for changes pre-subscription",
|
|
198
|
+
"author": "roeisenb@microsoft.com",
|
|
199
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
200
|
+
"package": "@microsoft/fast-element"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"comment": "feat: new directive registration/identification model",
|
|
204
|
+
"author": "roeisenb@microsoft.com",
|
|
205
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
206
|
+
"package": "@microsoft/fast-element"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"comment": "fix: prevent duplicative array observation patch",
|
|
210
|
+
"author": "roeisenb@microsoft.com",
|
|
211
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
212
|
+
"package": "@microsoft/fast-element"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"comment": "Adds Aspect as public export",
|
|
216
|
+
"author": "nicholasrice@users.noreply.github.com",
|
|
217
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
218
|
+
"package": "@microsoft/fast-element"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"comment": "feat: expose official Markup and Parser APIs",
|
|
222
|
+
"author": "roeisenb@microsoft.com",
|
|
223
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
224
|
+
"package": "@microsoft/fast-element"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"comment": "refactor: refine binding mode types",
|
|
228
|
+
"author": "roeisenb@microsoft.com",
|
|
229
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
230
|
+
"package": "@microsoft/fast-element"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"comment": "feat: add two-way binding",
|
|
234
|
+
"author": "roeisenb@microsoft.com",
|
|
235
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
236
|
+
"package": "@microsoft/fast-element"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"comment": "fix: defend against for/in use on arrays",
|
|
240
|
+
"author": "roeisenb@microsoft.com",
|
|
241
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
242
|
+
"package": "@microsoft/fast-element"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"comment": "fix: merge bug related to moved APIs",
|
|
246
|
+
"author": "roeisenb@microsoft.com",
|
|
247
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
248
|
+
"package": "@microsoft/fast-element"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"comment": "feat: enable multiple instances of fast-element on a page at once",
|
|
252
|
+
"author": "roeisenb@microsoft.com",
|
|
253
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
254
|
+
"package": "@microsoft/fast-element"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"comment": "Upgrade TypeScript",
|
|
258
|
+
"author": "nicholasrice@users.noreply.github.com",
|
|
259
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
260
|
+
"package": "@microsoft/fast-element"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"comment": "enumerate fast-element package as a ES module package",
|
|
264
|
+
"author": "nicholasrice@users.noreply.github.com",
|
|
265
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
266
|
+
"package": "@microsoft/fast-element"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"comment": "feat: enable array length observation",
|
|
270
|
+
"author": "roeisenb@microsoft.com",
|
|
271
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
272
|
+
"package": "@microsoft/fast-element"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"comment": "feat: add utilities and hooks, and change exports",
|
|
276
|
+
"author": "roeisenb@microsoft.com",
|
|
277
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
278
|
+
"package": "@microsoft/fast-element"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"comment": "refactor: new design for execution context",
|
|
282
|
+
"author": "roeisenb@microsoft.com",
|
|
283
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
284
|
+
"package": "@microsoft/fast-element"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"comment": "chore: fast-element package and build modernization",
|
|
288
|
+
"author": "roeisenb@microsoft.com",
|
|
289
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
290
|
+
"package": "@microsoft/fast-element"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"comment": "feat: new CSSDirective design",
|
|
294
|
+
"author": "roeisenb@microsoft.com",
|
|
295
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
296
|
+
"package": "@microsoft/fast-element"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"comment": "chore: configure fast-element for internal stripping",
|
|
300
|
+
"author": "roeisenb@microsoft.com",
|
|
301
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
302
|
+
"package": "@microsoft/fast-element"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"comment": "feat: enable synchronous dom updates for SSR",
|
|
306
|
+
"author": "roeisenb@microsoft.com",
|
|
307
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
308
|
+
"package": "@microsoft/fast-element"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"comment": "refactor: extract polyfill and polyfill-like code to an optional module",
|
|
312
|
+
"author": "roeisenb@microsoft.com",
|
|
313
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
314
|
+
"package": "@microsoft/fast-element"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"comment": "feat: add warn/error message infrastructure",
|
|
318
|
+
"author": "roeisenb@microsoft.com",
|
|
319
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
320
|
+
"package": "@microsoft/fast-element"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"comment": "`View` and `HTMLView` - Type parameters added to enable strongly typed views based on their data source. The constructor of `HTMLView` has a new signature based on changes to the compiler's output. Internals have been cleaned up and no longer rely on the Range type.",
|
|
324
|
+
"author": "roeisenb@microsoft.com",
|
|
325
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
326
|
+
"package": "@microsoft/fast-element"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"comment": "`ElementViewTemplate`, `SyntheticViewTemplate`, and `ViewTemplate` - Added type parameters throughout. Logic to instantiate and apply behaviors moved out of the template and into the view where it can be lazily executed. Removed the ability of the `render` method to take a string id of the node to render to. You must provide a node.",
|
|
330
|
+
"author": "roeisenb@microsoft.com",
|
|
331
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
332
|
+
"package": "@microsoft/fast-element"
|
|
333
|
+
}
|
|
334
|
+
],
|
|
335
|
+
"none": [
|
|
336
|
+
{
|
|
337
|
+
"comment": "update api extractor and typescript to use the latest versions",
|
|
338
|
+
"author": "chhol@microsoft.com",
|
|
339
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
340
|
+
"package": "@microsoft/fast-element"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"comment": "docs: add alpha tags to unfinished binding APIs",
|
|
344
|
+
"author": "roeisenb@microsoft.com",
|
|
345
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
346
|
+
"package": "@microsoft/fast-element"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"comment": "automated update of api-report.md",
|
|
350
|
+
"author": "nicholasrice@users.noreply.github.com",
|
|
351
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
352
|
+
"package": "@microsoft/fast-element"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"comment": "Fixed linting errors and warnings",
|
|
356
|
+
"author": "7559015+janechu@users.noreply.github.com",
|
|
357
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
358
|
+
"package": "@microsoft/fast-element"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"comment": "remove unnecessary dependency on @types/ie11 package",
|
|
362
|
+
"author": "chhol@microsoft.com",
|
|
363
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
364
|
+
"package": "@microsoft/fast-element"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"comment": "Updated api-extractor version and exported markdown",
|
|
368
|
+
"author": "7559015+janechu@users.noreply.github.com",
|
|
369
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
370
|
+
"package": "@microsoft/fast-element"
|
|
371
|
+
}
|
|
372
|
+
]
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"date": "Sun, 29 May 2022 07:08:52 GMT",
|
|
377
|
+
"tag": "@microsoft/fast-element_v1.10.2",
|
|
378
|
+
"version": "1.10.2",
|
|
379
|
+
"comments": {
|
|
380
|
+
"none": [
|
|
381
|
+
{
|
|
382
|
+
"comment": "add md extensions to referenced doc links for fast-element readme",
|
|
383
|
+
"author": "steph@huynhicode.dev",
|
|
384
|
+
"commit": "283b4838d46ed83c70ff4ad91f7f72a4936d59bf",
|
|
385
|
+
"package": "@microsoft/fast-element"
|
|
386
|
+
}
|
|
387
|
+
]
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"date": "Tue, 24 May 2022 07:10:02 GMT",
|
|
6
392
|
"tag": "@microsoft/fast-element_v1.10.2",
|
|
7
393
|
"version": "1.10.2",
|
|
8
394
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,84 @@
|
|
|
1
1
|
# Change Log - @microsoft/fast-element
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 22 Jun 2022 20:17:50 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 2.0.0-beta.3
|
|
8
|
+
|
|
9
|
+
Wed, 22 Jun 2022 20:17:50 GMT
|
|
10
|
+
|
|
11
|
+
### Changes
|
|
12
|
+
|
|
13
|
+
- fix: correct aspect type for content that looks like an attribute (nicholasrice@users.noreply.github.com)
|
|
14
|
+
|
|
15
|
+
## 2.0.0-beta.2
|
|
16
|
+
|
|
17
|
+
Wed, 15 Jun 2022 17:41:10 GMT
|
|
18
|
+
|
|
19
|
+
### Changes
|
|
20
|
+
|
|
21
|
+
- doc: add note to FASTElement.metadata API (roeisenb@microsoft.com)
|
|
22
|
+
- when recycle is set to false while itemBinding stays the same, views should be recreated (wendy.hsu@microsoft.com)
|
|
23
|
+
- feat: simplify execution context to align closer with v1 (roeisenb@microsoft.com)
|
|
24
|
+
- feat: ergo improvements to context, array length, and metadata (roeisenb@microsoft.com)
|
|
25
|
+
- feat: move optional bindings out of rollup and list as exports (roeisenb@microsoft.com)
|
|
26
|
+
- fix: make SyntheticViewTemplate type a string so it is generally usable (roeisenb@microsoft.com)
|
|
27
|
+
- feat: implement W3C WC community context protocol and integrate with DI (roeisenb@microsoft.com)
|
|
28
|
+
|
|
29
|
+
## 2.0.0-beta.1
|
|
30
|
+
|
|
31
|
+
Wed, 01 Jun 2022 17:53:14 GMT
|
|
32
|
+
|
|
33
|
+
### Changes
|
|
34
|
+
|
|
35
|
+
- `DOM` - Tree Walker methods are no longer used and are thus removed. The API for removing child nodes has been removed as well since it was only used in one place and could be inlined. The helper `createCustomAttributePlaceholder()` no longer requires an attribute name. It will be uniquely generated internally. (roeisenb@microsoft.com)
|
|
36
|
+
- `class` - Bindings to `class` are now more nuanced. Binding directly to `class` will simply set the `className` property. If you need to bind to `class` knowing that manual JS will also manipulate the `classList` in addition to the binding, then you should now bind to `:classList` instead. This allows for performance optimizations in the simple, most common case. (roeisenb@microsoft.com)
|
|
37
|
+
- `Behavior` and `ViewBehavior` - `Behavior` now requires an `ExecutionContext` for `unbind`. Behaviors can be used for elements or views. `ViewBehavior` has been introduced for use exclusively with views, and provides some optimization opportunities. (roeisenb@microsoft.com)
|
|
38
|
+
- `RefBehavior` has been replaced with `RefDirective`. The directive also implements `ViewBehavior` allowing a single directive instance to be shared across all template instances that use the ref. (roeisenb@microsoft.com)
|
|
39
|
+
- Removed `SlottedBehavior` and `ChildrenBehavior` have been replaced with `SlottedDirective` and `ChildrenDirective`. These directives allow a single directive instance to be shared across all template instances that use the ref. (roeisenb@microsoft.com)
|
|
40
|
+
- Removed `AttachedBehaviorHTMLDirective` and `AttachedBehaviorType` since they are no longer used in the new directive/behavior architecture for ref, slotted, and children. (roeisenb@microsoft.com)
|
|
41
|
+
- Renamed `Notifier#source` to `Notifier#subject` to align with other observable terminology and prevent name clashes with `BindingObserver` properties. (roeisenb@microsoft.com)
|
|
42
|
+
- feat: create unified API for parsing markers (roeisenb@microsoft.com)
|
|
43
|
+
- allow null values in attributeChangedCallback (nicholasrice@users.noreply.github.com)
|
|
44
|
+
- feat: add splice strategies for array observation (roeisenb@microsoft.com)
|
|
45
|
+
- feat: handle existing shadow roots when upgrading (roeisenb@microsoft.com)
|
|
46
|
+
- fix: enable safer type inference on the repeat helper (roeisenb@microsoft.com)
|
|
47
|
+
- Set prerelease version (nicholasrice@users.noreply.github.com)
|
|
48
|
+
- refactor: separate update queue from DOM and fix architectural layers (roeisenb@microsoft.com)
|
|
49
|
+
- feat: aspected html directive exposes metadata (roeisenb@microsoft.com)
|
|
50
|
+
- `HTMLDirective` - The `targetIndex: number` property has been replaced by a `targetId: string` property. The `createBehavior` method no longer takes a target `Node` but instead takes a `BehaviorTargets` instance. The actual target can be looked up on the `BehaviorTargets` instance by indexing with the `targetId` property. (roeisenb@microsoft.com)
|
|
51
|
+
- `compileTemplate()` - Internals have been significantly changed. The implementation no longer uses a TreeWalker. The return type has change to an `HTMLTemplateCompilationResult` with different properties. (roeisenb@microsoft.com)
|
|
52
|
+
- refactor: move template/style resolution to lazy getter (roeisenb@microsoft.com)
|
|
53
|
+
- refactor: enable pluggable template compiler for SSR scenarios (roeisenb@microsoft.com)
|
|
54
|
+
- feat: enable pluggable style handling strategies (roeisenb@microsoft.com)
|
|
55
|
+
- fix(fast-element): do not notify splices for changes pre-subscription (roeisenb@microsoft.com)
|
|
56
|
+
- feat: new directive registration/identification model (roeisenb@microsoft.com)
|
|
57
|
+
- fix: prevent duplicative array observation patch (roeisenb@microsoft.com)
|
|
58
|
+
- Adds Aspect as public export (nicholasrice@users.noreply.github.com)
|
|
59
|
+
- feat: expose official Markup and Parser APIs (roeisenb@microsoft.com)
|
|
60
|
+
- refactor: refine binding mode types (roeisenb@microsoft.com)
|
|
61
|
+
- feat: add two-way binding (roeisenb@microsoft.com)
|
|
62
|
+
- fix: defend against for/in use on arrays (roeisenb@microsoft.com)
|
|
63
|
+
- fix: merge bug related to moved APIs (roeisenb@microsoft.com)
|
|
64
|
+
- feat: enable multiple instances of fast-element on a page at once (roeisenb@microsoft.com)
|
|
65
|
+
- Upgrade TypeScript (nicholasrice@users.noreply.github.com)
|
|
66
|
+
- enumerate fast-element package as a ES module package (nicholasrice@users.noreply.github.com)
|
|
67
|
+
- feat: enable array length observation (roeisenb@microsoft.com)
|
|
68
|
+
- feat: add utilities and hooks, and change exports (roeisenb@microsoft.com)
|
|
69
|
+
- refactor: new design for execution context (roeisenb@microsoft.com)
|
|
70
|
+
- chore: fast-element package and build modernization (roeisenb@microsoft.com)
|
|
71
|
+
- feat: new CSSDirective design (roeisenb@microsoft.com)
|
|
72
|
+
- chore: configure fast-element for internal stripping (roeisenb@microsoft.com)
|
|
73
|
+
- feat: enable synchronous dom updates for SSR (roeisenb@microsoft.com)
|
|
74
|
+
- refactor: extract polyfill and polyfill-like code to an optional module (roeisenb@microsoft.com)
|
|
75
|
+
- feat: add warn/error message infrastructure (roeisenb@microsoft.com)
|
|
76
|
+
- `View` and `HTMLView` - Type parameters added to enable strongly typed views based on their data source. The constructor of `HTMLView` has a new signature based on changes to the compiler's output. Internals have been cleaned up and no longer rely on the Range type. (roeisenb@microsoft.com)
|
|
77
|
+
- `ElementViewTemplate`, `SyntheticViewTemplate`, and `ViewTemplate` - Added type parameters throughout. Logic to instantiate and apply behaviors moved out of the template and into the view where it can be lazily executed. Removed the ability of the `render` method to take a string id of the node to render to. You must provide a node. (roeisenb@microsoft.com)
|
|
78
|
+
|
|
7
79
|
## 1.10.2
|
|
8
80
|
|
|
9
|
-
Tue, 24 May 2022 07:
|
|
81
|
+
Tue, 24 May 2022 07:10:02 GMT
|
|
10
82
|
|
|
11
83
|
### Patches
|
|
12
84
|
|
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ import { FASTElement } from '@microsoft/fast-element';
|
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
:::tip
|
|
29
|
-
Looking for a setup that integrates with a particular front-end framework or bundler? Check out [our integration docs](
|
|
29
|
+
Looking for a setup that integrates with a particular front-end framework or bundler? Check out [our integration docs](../integrations/introduction.md).
|
|
30
30
|
:::
|
|
31
31
|
|
|
32
32
|
### From CDN
|
|
@@ -58,5 +58,5 @@ For simplicity, examples throughout the documentation will assume the library ha
|
|
|
58
58
|
:::
|
|
59
59
|
|
|
60
60
|
:::tip
|
|
61
|
-
Looking for a quick guide on building components? Check out [our Cheat Sheet](
|
|
61
|
+
Looking for a quick guide on building components? Check out [our Cheat Sheet](../resources/cheat-sheet.md#building-components).
|
|
62
62
|
:::
|
|
@@ -16,6 +16,8 @@ export interface ValueConverter {
|
|
|
16
16
|
*/
|
|
17
17
|
fromView(value: any): any;
|
|
18
18
|
}
|
|
19
|
+
declare const booleanMode = "boolean";
|
|
20
|
+
declare const reflectMode = "reflect";
|
|
19
21
|
/**
|
|
20
22
|
* The mode that specifies the runtime behavior of the attribute.
|
|
21
23
|
* @remarks
|
|
@@ -27,7 +29,7 @@ export interface ValueConverter {
|
|
|
27
29
|
* changes in the DOM, but does not reflect property changes back.
|
|
28
30
|
* @public
|
|
29
31
|
*/
|
|
30
|
-
export declare type AttributeMode =
|
|
32
|
+
export declare type AttributeMode = typeof reflectMode | typeof booleanMode | "fromView";
|
|
31
33
|
/**
|
|
32
34
|
* Metadata used to configure a custom attribute's behavior.
|
|
33
35
|
* @public
|
|
@@ -135,3 +137,4 @@ export declare function attr(config?: DecoratorAttributeConfiguration): (target:
|
|
|
135
137
|
* @public
|
|
136
138
|
*/
|
|
137
139
|
export declare function attr(target: {}, prop: string): void;
|
|
140
|
+
export {};
|
|
@@ -8,10 +8,11 @@ import { FASTElementDefinition } from "./fast-definitions.js";
|
|
|
8
8
|
* Controls the lifecycle and rendering of a `FASTElement`.
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
export declare class Controller extends PropertyChangeNotifier {
|
|
11
|
+
export declare class Controller<TElement extends HTMLElement = HTMLElement> extends PropertyChangeNotifier {
|
|
12
12
|
private boundObservables;
|
|
13
13
|
private behaviors;
|
|
14
14
|
private needsInitialization;
|
|
15
|
+
private hasExistingShadowRoot;
|
|
15
16
|
private _template;
|
|
16
17
|
private _styles;
|
|
17
18
|
private _isConnected;
|
|
@@ -27,7 +28,7 @@ export declare class Controller extends PropertyChangeNotifier {
|
|
|
27
28
|
/**
|
|
28
29
|
* The element being controlled by this controller.
|
|
29
30
|
*/
|
|
30
|
-
readonly element:
|
|
31
|
+
readonly element: TElement;
|
|
31
32
|
/**
|
|
32
33
|
* The element definition that instructs this controller
|
|
33
34
|
* in how to handle rendering and other platform integrations.
|
|
@@ -38,7 +39,7 @@ export declare class Controller extends PropertyChangeNotifier {
|
|
|
38
39
|
* @remarks
|
|
39
40
|
* If `null` then the element is managing its own rendering.
|
|
40
41
|
*/
|
|
41
|
-
readonly view: ElementView | null;
|
|
42
|
+
readonly view: ElementView<TElement> | null;
|
|
42
43
|
/**
|
|
43
44
|
* Indicates whether or not the custom element has been
|
|
44
45
|
* connected to the document.
|
|
@@ -50,8 +51,8 @@ export declare class Controller extends PropertyChangeNotifier {
|
|
|
50
51
|
* @remarks
|
|
51
52
|
* This value can only be accurately read after connect but can be set at any time.
|
|
52
53
|
*/
|
|
53
|
-
get template(): ElementViewTemplate | null;
|
|
54
|
-
set template(value: ElementViewTemplate | null);
|
|
54
|
+
get template(): ElementViewTemplate<TElement> | null;
|
|
55
|
+
set template(value: ElementViewTemplate<TElement> | null);
|
|
55
56
|
/**
|
|
56
57
|
* Gets/sets the primary styles used for the component.
|
|
57
58
|
* @remarks
|
|
@@ -66,28 +67,28 @@ export declare class Controller extends PropertyChangeNotifier {
|
|
|
66
67
|
* controller in how to handle rendering and other platform integrations.
|
|
67
68
|
* @internal
|
|
68
69
|
*/
|
|
69
|
-
constructor(element:
|
|
70
|
+
constructor(element: TElement, definition: FASTElementDefinition);
|
|
70
71
|
/**
|
|
71
72
|
* Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot.
|
|
72
73
|
* @param styles - The styles to add.
|
|
73
74
|
*/
|
|
74
|
-
addStyles(styles: ElementStyles | HTMLStyleElement): void;
|
|
75
|
+
addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
75
76
|
/**
|
|
76
77
|
* Removes styles from this element. Providing an HTMLStyleElement will detach the element instance from the shadowRoot.
|
|
77
78
|
* @param styles - the styles to remove.
|
|
78
79
|
*/
|
|
79
|
-
removeStyles(styles: ElementStyles | HTMLStyleElement): void;
|
|
80
|
+
removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
80
81
|
/**
|
|
81
82
|
* Adds behaviors to this element.
|
|
82
83
|
* @param behaviors - The behaviors to add.
|
|
83
84
|
*/
|
|
84
|
-
addBehaviors(behaviors: ReadonlyArray<Behavior
|
|
85
|
+
addBehaviors(behaviors: ReadonlyArray<Behavior<TElement>>): void;
|
|
85
86
|
/**
|
|
86
87
|
* Removes behaviors from this element.
|
|
87
88
|
* @param behaviors - The behaviors to remove.
|
|
88
89
|
* @param force - Forces unbinding of behaviors.
|
|
89
90
|
*/
|
|
90
|
-
removeBehaviors(behaviors: ReadonlyArray<Behavior
|
|
91
|
+
removeBehaviors(behaviors: ReadonlyArray<Behavior<TElement>>, force?: boolean): void;
|
|
91
92
|
/**
|
|
92
93
|
* Runs connected lifecycle behavior on the associated element.
|
|
93
94
|
*/
|
|
@@ -102,7 +103,7 @@ export declare class Controller extends PropertyChangeNotifier {
|
|
|
102
103
|
* @param oldValue - The previous value of the attribute.
|
|
103
104
|
* @param newValue - The new value of the attribute.
|
|
104
105
|
*/
|
|
105
|
-
onAttributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
106
|
+
onAttributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
106
107
|
/**
|
|
107
108
|
* Emits a custom HTML event.
|
|
108
109
|
* @param type - The type name of the event.
|