@microsoft/fast-element 2.0.0-beta.9 → 2.0.1

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 (142) hide show
  1. package/.eslintrc.json +1 -1
  2. package/CHANGELOG.json +518 -0
  3. package/CHANGELOG.md +181 -1
  4. package/README.md +1 -9
  5. package/api-extractor.context.json +14 -0
  6. package/api-extractor.di.json +14 -0
  7. package/dist/context/context.api.json +1068 -0
  8. package/dist/di/di.api.json +4929 -0
  9. package/dist/dts/binding/binding.d.ts +49 -0
  10. package/dist/dts/binding/normalize.d.ts +9 -0
  11. package/dist/dts/binding/one-time.d.ts +11 -0
  12. package/dist/dts/binding/one-way.d.ts +20 -0
  13. package/dist/dts/{templating/binding-signal.d.ts → binding/signal.d.ts} +19 -4
  14. package/dist/dts/{templating/binding-two-way.d.ts → binding/two-way.d.ts} +9 -5
  15. package/dist/dts/components/attributes.d.ts +7 -1
  16. package/dist/dts/components/element-controller.d.ts +104 -8
  17. package/dist/dts/components/element-hydration.d.ts +2 -0
  18. package/dist/dts/components/fast-definitions.d.ts +6 -0
  19. package/dist/dts/components/hydration.d.ts +56 -0
  20. package/dist/dts/components/install-hydration.d.ts +1 -0
  21. package/dist/dts/context.d.ts +29 -15
  22. package/dist/dts/di/di.d.ts +0 -5
  23. package/dist/dts/dom-policy.d.ts +83 -0
  24. package/dist/dts/dom.d.ts +100 -0
  25. package/dist/dts/hydration/target-builder.d.ts +63 -0
  26. package/dist/dts/index.d.ts +33 -26
  27. package/dist/dts/index.rollup.d.ts +0 -1
  28. package/dist/dts/index.rollup.debug.d.ts +0 -1
  29. package/dist/dts/interfaces.d.ts +32 -82
  30. package/dist/dts/metadata.d.ts +6 -5
  31. package/dist/dts/observation/arrays.d.ts +1 -1
  32. package/dist/dts/observation/observable.bench.d.ts +18 -0
  33. package/dist/dts/observation/observable.d.ts +5 -5
  34. package/dist/dts/pending-task.d.ts +19 -7
  35. package/dist/dts/platform.d.ts +11 -2
  36. package/dist/dts/polyfills.d.ts +0 -8
  37. package/dist/dts/styles/css-binding-directive.d.ts +60 -0
  38. package/dist/dts/styles/css.d.ts +9 -7
  39. package/dist/dts/styles/element-styles.d.ts +1 -14
  40. package/dist/dts/styles/host.d.ts +2 -5
  41. package/dist/dts/styles/style-strategy.d.ts +42 -0
  42. package/dist/dts/templating/compiler.d.ts +11 -13
  43. package/dist/dts/templating/{binding.d.ts → html-binding-directive.d.ts} +21 -41
  44. package/dist/dts/templating/html-directive.d.ts +44 -140
  45. package/dist/dts/templating/install-hydratable-view-templates.d.ts +1 -0
  46. package/dist/dts/templating/node-observation.d.ts +11 -1
  47. package/dist/dts/templating/ref.d.ts +4 -0
  48. package/dist/dts/templating/render.bench.d.ts +3 -0
  49. package/dist/dts/templating/render.d.ts +49 -9
  50. package/dist/dts/templating/repeat-basic-reverse.bench.d.ts +3 -0
  51. package/dist/dts/templating/repeat-basic-shift.bench.d.ts +3 -0
  52. package/dist/dts/templating/repeat.d.ts +31 -9
  53. package/dist/dts/templating/template.d.ts +97 -12
  54. package/dist/dts/templating/view.d.ts +146 -29
  55. package/dist/dts/templating/when-basic.bench.d.ts +3 -0
  56. package/dist/dts/templating/when-conditional.bench.d.ts +3 -0
  57. package/dist/dts/templating/when-switch.bench.d.ts +3 -0
  58. package/dist/dts/templating/when.d.ts +3 -1
  59. package/dist/dts/testing/fakes.d.ts +12 -1
  60. package/dist/dts/tsdoc-metadata.json +1 -1
  61. package/dist/dts/utilities.d.ts +55 -1
  62. package/dist/esm/binding/binding.js +18 -0
  63. package/dist/esm/binding/normalize.js +17 -0
  64. package/dist/esm/binding/one-time.js +21 -0
  65. package/dist/esm/binding/one-way.js +30 -0
  66. package/dist/esm/{templating/binding-signal.js → binding/signal.js} +22 -6
  67. package/dist/esm/{templating/binding-two-way.js → binding/two-way.js} +18 -12
  68. package/dist/esm/components/attributes.js +19 -6
  69. package/dist/esm/components/element-controller.js +319 -49
  70. package/dist/esm/components/element-hydration.js +2 -0
  71. package/dist/esm/components/fast-definitions.js +12 -4
  72. package/dist/esm/components/fast-element.js +3 -1
  73. package/dist/esm/components/hydration.js +104 -0
  74. package/dist/esm/components/install-hydration.js +3 -0
  75. package/dist/esm/context.js +26 -4
  76. package/dist/esm/debug.js +8 -2
  77. package/dist/esm/di/di.js +9 -12
  78. package/dist/esm/dom-policy.js +345 -0
  79. package/dist/esm/dom.js +101 -0
  80. package/dist/esm/hydration/target-builder.js +175 -0
  81. package/dist/esm/index.js +34 -25
  82. package/dist/esm/index.rollup.debug.js +3 -1
  83. package/dist/esm/index.rollup.js +3 -1
  84. package/dist/esm/interfaces.js +51 -3
  85. package/dist/esm/metadata.js +11 -8
  86. package/dist/esm/observation/arrays.js +1 -1
  87. package/dist/esm/observation/observable.bench.js +79 -0
  88. package/dist/esm/observation/observable.js +20 -15
  89. package/dist/esm/observation/update-queue.js +2 -2
  90. package/dist/esm/pending-task.js +13 -1
  91. package/dist/esm/platform.js +12 -2
  92. package/dist/esm/polyfills.js +3 -61
  93. package/dist/esm/styles/css-binding-directive.js +76 -0
  94. package/dist/esm/styles/css.js +14 -7
  95. package/dist/esm/styles/element-styles.js +0 -33
  96. package/dist/esm/styles/style-strategy.js +1 -0
  97. package/dist/esm/templating/children.js +8 -4
  98. package/dist/esm/templating/compiler.js +37 -44
  99. package/dist/esm/templating/html-binding-directive.js +218 -0
  100. package/dist/esm/templating/html-directive.js +25 -152
  101. package/dist/esm/templating/install-hydratable-view-templates.js +17 -0
  102. package/dist/esm/templating/node-observation.js +14 -8
  103. package/dist/esm/templating/ref.js +1 -1
  104. package/dist/esm/templating/render.bench.js +56 -0
  105. package/dist/esm/templating/render.js +74 -30
  106. package/dist/esm/templating/repeat-basic-reverse.bench.js +43 -0
  107. package/dist/esm/templating/repeat-basic-shift.bench.js +43 -0
  108. package/dist/esm/templating/repeat.js +116 -17
  109. package/dist/esm/templating/template.js +135 -60
  110. package/dist/esm/templating/view.js +254 -34
  111. package/dist/esm/templating/when-basic.bench.js +36 -0
  112. package/dist/esm/templating/when-conditional.bench.js +39 -0
  113. package/dist/esm/templating/when-switch.bench.js +68 -0
  114. package/dist/esm/templating/when.js +12 -5
  115. package/dist/esm/testing/fakes.js +32 -1
  116. package/dist/esm/testing/fixture.js +1 -1
  117. package/dist/esm/utilities.js +97 -1
  118. package/dist/fast-element.api.json +9789 -5667
  119. package/dist/fast-element.d.ts +813 -2392
  120. package/dist/fast-element.debug.js +2788 -974
  121. package/dist/fast-element.debug.min.js +3 -1
  122. package/dist/fast-element.js +2641 -833
  123. package/dist/fast-element.min.js +3 -1
  124. package/dist/fast-element.untrimmed.d.ts +662 -314
  125. package/docs/{api-report.md → api-report.api.md} +238 -151
  126. package/docs/context/api-report.api.md +69 -0
  127. package/docs/di/api-report.api.md +315 -0
  128. package/karma.conf.cjs +2 -1
  129. package/package.json +59 -47
  130. package/scripts/run-api-extractor.js +51 -0
  131. package/scripts/run-benchmarks.js +46 -0
  132. package/tensile.config.js +12 -0
  133. package/dist/dts/templating/dom.d.ts +0 -41
  134. package/dist/esm/templating/binding.js +0 -282
  135. package/dist/esm/templating/dom.js +0 -49
  136. package/docs/guide/declaring-templates.md +0 -230
  137. package/docs/guide/defining-elements.md +0 -214
  138. package/docs/guide/leveraging-css.md +0 -253
  139. package/docs/guide/next-steps.md +0 -13
  140. package/docs/guide/observables-and-state.md +0 -213
  141. package/docs/guide/using-directives.md +0 -576
  142. package/docs/guide/working-with-shadow-dom.md +0 -296
package/CHANGELOG.md CHANGED
@@ -1,9 +1,189 @@
1
1
  # Change Log - @microsoft/fast-element
2
2
 
3
- This log was last generated on Wed, 28 Sep 2022 20:45:51 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 11 Dec 2024 19:52:58 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.0.1
8
+
9
+ Wed, 11 Dec 2024 19:52:58 GMT
10
+
11
+ ### Patches
12
+
13
+ - Patch bumping to apply latest tag to the package (7559015+janechu@users.noreply.github.com)
14
+ - fast-element: Simplify conditional checks in element-controller (abaris@null.net)
15
+
16
+ ## 2.0.0
17
+
18
+ Mon, 19 Aug 2024 22:04:19 GMT
19
+
20
+ ### Major changes
21
+
22
+ - Update @microsoft/fast-element to major version (13071055+chrisdholt@users.noreply.github.com)
23
+
24
+ ### Changes
25
+
26
+ - Fix CodeQL issues (7559015+janechu@users.noreply.github.com)
27
+ - Adds support for FASTElement hydration (171390049+prabhujayapal@users.noreply.github.com)
28
+
29
+ ## 2.0.0-beta.26
30
+
31
+ Fri, 18 Aug 2023 00:04:40 GMT
32
+
33
+ ### Changes
34
+
35
+ - BREAKING: update fast-element export paths to include extensions (chhol@microsoft.com)
36
+ - update fast-element exports to be explicit (chhol@microsoft.com)
37
+
38
+ ## 2.0.0-beta.25
39
+
40
+ Sat, 12 Aug 2023 00:26:36 GMT
41
+
42
+ ### Changes
43
+
44
+ - Prevent notification of array splices when operation does not mutate array values (nicholasrice@users.noreply.github.com)
45
+ - Adds volatile binding support for JavaScript optional chaining syntax (nicholasrice@users.noreply.github.com)
46
+
47
+ ## 2.0.0-beta.24
48
+
49
+ Fri, 16 Jun 2023 18:17:12 GMT
50
+
51
+ ### Changes
52
+
53
+ - fix: update compiler to ensure first and last child references are defined (chhol@microsoft.com)
54
+ - Adds 'else' template option to the when directive (nicholasrice@users.noreply.github.com)
55
+ - fixed a bug where re-binding a ChildrenDirective instance would throw a runtime exception from the mutation handler (nicholasrice@users.noreply.github.com)
56
+ - Update adoptedStyleSheets strategy to use push/splice when available to fix Safari 16.4 bug (nicholasrice@users.noreply.github.com)
57
+ - fixes a bug where ChildrenDirective could not be used multiple times for the same element (nicholasrice@users.noreply.github.com)
58
+ - fixed bug causing behaviors attached to stylesheets not to be removed when the stylesheet was removed (nicholasrice@users.noreply.github.com)
59
+
60
+ ## 2.0.0-beta.23
61
+
62
+ Tue, 28 Mar 2023 22:14:10 GMT
63
+
64
+ ### Changes
65
+
66
+ - docs: add missing API docs (rob@bluespire.com)
67
+ - fix: correct types for a break in TypeScript 5 legacy decorators (rob@bluespire.com)
68
+
69
+ ## 2.0.0-beta.22
70
+
71
+ Sat, 11 Mar 2023 00:09:48 GMT
72
+
73
+ ### Changes
74
+
75
+ - feat: add Context.for (rob@bluespire.com)
76
+ - feat: enable data binding in CSS (rob@bluespire.com)
77
+ - add directives support for createElementTemplate (32497422+KingOfTac@users.noreply.github.com)
78
+ - fix: clean up toJSON noop on core fast-element types (rob@bluespire.com)
79
+
80
+ ## 2.0.0-beta.21
81
+
82
+ Tue, 14 Feb 2023 04:02:35 GMT
83
+
84
+ ### Changes
85
+
86
+ - fix: cleanup types, docs, etc. in root source files of fast-element in preparation for release (rob@bluespire.com)
87
+ - Remove un-necessary expression from StyleElementStrategy (nicholasrice@users.noreply.github.com)
88
+
89
+ ## 2.0.0-beta.20
90
+
91
+ Wed, 11 Jan 2023 22:07:47 GMT
92
+
93
+ ### Changes
94
+
95
+ - add nullableBooleanConverter for attributes (863023+radium-v@users.noreply.github.com)
96
+ - update return type for dangerousHTML to DangerousHTMLDirective (chhol@microsoft.com)
97
+ - chore: remove deprecated APIs from fast-element (rob@bluespire.com)
98
+ - chore: cleanup fast-element interfaces (roeisenb@microsoft.com)
99
+ - refactor(fast-element): replace dangerousHTML with html.partial (roeisenb@microsoft.com)
100
+ - feat: add ability to inline templates (roeisenb@microsoft.com)
101
+
102
+ ## 2.0.0-beta.19
103
+
104
+ Fri, 02 Dec 2022 01:18:22 GMT
105
+
106
+ ### Changes
107
+
108
+ - feat: add kernel mode with isolation by default (roeisenb@microsoft.com)
109
+
110
+ ## 2.0.0-beta.18
111
+
112
+ Tue, 15 Nov 2022 02:40:34 GMT
113
+
114
+ ### Changes
115
+
116
+ - chore: move ViewBehaviorOrchestrator to utilities (roeisenb@microsoft.com)
117
+ - feat: add new DOM Policy protection throughout (roeisenb@microsoft.com)
118
+
119
+ ## 2.0.0-beta.17
120
+
121
+ Tue, 01 Nov 2022 23:26:26 GMT
122
+
123
+ ### Changes
124
+
125
+ - fix: prevent circular reference errors when stringifying DOM nodes controlled by FAST's rendering engine (roeisenb@microsoft.com)
126
+
127
+ ## 2.0.0-beta.16
128
+
129
+ Fri, 28 Oct 2022 20:44:44 GMT
130
+
131
+ ### Changes
132
+
133
+ - Fixed bug preventing main component stylesheet behaviors from being connected during connectedCallback (nicholasrice@users.noreply.github.com)
134
+
135
+ ## 2.0.0-beta.15
136
+
137
+ Tue, 25 Oct 2022 20:24:32 GMT
138
+
139
+ ### Changes
140
+
141
+ - Updated the ElementController to connect behaviors prior to rendering element templates (nicholasrice@users.noreply.github.com)
142
+ - Added support to fast-element to support element hydration and the `defer-hydration` attribute (nicholasrice@users.noreply.github.com)
143
+
144
+ ## 2.0.0-beta.14
145
+
146
+ Fri, 14 Oct 2022 18:26:11 GMT
147
+
148
+ ### Changes
149
+
150
+ - fix: tokenList bindings track adds and removes from multiple sources (roeisenb@microsoft.com)
151
+ - refactor: remove duplication and re-organize binding behavior logic (roeisenb@microsoft.com)
152
+
153
+ ## 2.0.0-beta.13
154
+
155
+ Mon, 10 Oct 2022 20:28:02 GMT
156
+
157
+ ### Changes
158
+
159
+ - fix: prevent event callbacks when controller is not bound (roeisenb@microsoft.com)
160
+
161
+ ## 2.0.0-beta.12
162
+
163
+ Thu, 06 Oct 2022 23:21:20 GMT
164
+
165
+ ### Changes
166
+
167
+ - fix: repeat update view context positioning (roeisenb@microsoft.com)
168
+
169
+ ## 2.0.0-beta.11
170
+
171
+ Wed, 05 Oct 2022 23:26:01 GMT
172
+
173
+ ### Changes
174
+
175
+ - fix: removed a shadowRoot leak from ElementController (nicholasrice@users.noreply.github.com)
176
+
177
+ ## 2.0.0-beta.10
178
+
179
+ Mon, 03 Oct 2022 23:44:38 GMT
180
+
181
+ ### Changes
182
+
183
+ - fix: observation kernel missing binding observer disconnect method (roeisenb@microsoft.com)
184
+ - feat: less surprising class bindings w/ more flexibility for developers (roeisenb@microsoft.com)
185
+ - fix: don't allow registering FASTElement itself as a web component (roeisenb@microsoft.com)
186
+
7
187
  ## 2.0.0-beta.9
8
188
 
9
189
  Wed, 28 Sep 2022 20:45:51 GMT
package/README.md CHANGED
@@ -9,26 +9,18 @@ The `fast-element` library is a lightweight means to easily build performant, me
9
9
 
10
10
  ### From NPM
11
11
 
12
- To install the `fast-element` library, use either `npm` or `yarn` as follows:
12
+ To install the latest `fast-element` library using `npm`:
13
13
 
14
14
  ```shell
15
15
  npm install --save @microsoft/fast-element
16
16
  ```
17
17
 
18
- ```shell
19
- yarn add @microsoft/fast-element
20
- ```
21
-
22
18
  Within your JavaScript or TypeScript code, you can then import library APIs like this:
23
19
 
24
20
  ```ts
25
21
  import { FASTElement } from '@microsoft/fast-element';
26
22
  ```
27
23
 
28
- :::tip
29
- Looking for a setup that integrates with a particular front-end framework or bundler? Check out [our integration docs](../integrations/introduction.md).
30
- :::
31
-
32
24
  ### From CDN
33
25
 
34
26
  A pre-bundled script that contains all APIs needed to build web components with FAST Element is available on CDN. You can use this script by adding [`type="module"`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) to the script element and then importing from the CDN.
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../api-extractor.json",
4
+ "mainEntryPointFilePath": "./dist/dts/context.d.ts",
5
+ "apiReport": {
6
+ "enabled": true,
7
+ "reportFolder": "<projectFolder>/docs/context",
8
+ "reportFileName": "api-report"
9
+ },
10
+ "docModel": {
11
+ "enabled": true,
12
+ "apiJsonFilePath": "<projectFolder>/dist/context/context.api.json"
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../api-extractor.json",
4
+ "mainEntryPointFilePath": "./dist/dts/di/di.d.ts",
5
+ "apiReport": {
6
+ "enabled": true,
7
+ "reportFolder": "<projectFolder>/docs/di",
8
+ "reportFileName": "api-report"
9
+ },
10
+ "docModel": {
11
+ "enabled": true,
12
+ "apiJsonFilePath": "<projectFolder>/dist/di/di.api.json"
13
+ }
14
+ }