@microsoft/fast-element 2.9.1 → 2.10.0

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 (93) hide show
  1. package/CHANGELOG.json +58 -0
  2. package/CHANGELOG.md +22 -1
  3. package/dist/context/context.api.json +7 -7
  4. package/dist/di/di.api.json +12 -12
  5. package/dist/dts/binding/one-way.d.ts +1 -1
  6. package/dist/dts/binding/two-way.d.ts +3 -3
  7. package/dist/dts/components/attributes.d.ts +4 -4
  8. package/dist/dts/components/element-controller.d.ts +19 -8
  9. package/dist/dts/components/fast-definitions.d.ts +5 -5
  10. package/dist/dts/components/fast-element.d.ts +2 -2
  11. package/dist/dts/context.d.ts +8 -8
  12. package/dist/dts/di/di.d.ts +15 -15
  13. package/dist/dts/dom-policy.d.ts +8 -8
  14. package/dist/dts/dom.d.ts +2 -2
  15. package/dist/dts/index.d.ts +41 -28
  16. package/dist/dts/interfaces.d.ts +7 -7
  17. package/dist/dts/observable.d.ts +4 -2
  18. package/dist/dts/observation/arrays.d.ts +2 -2
  19. package/dist/dts/observation/observable.d.ts +3 -3
  20. package/dist/dts/observation/update-queue.d.ts +1 -1
  21. package/dist/dts/platform.d.ts +1 -1
  22. package/dist/dts/state/state.d.ts +10 -10
  23. package/dist/dts/state/watch.d.ts +1 -1
  24. package/dist/dts/styles/css-binding-directive.d.ts +2 -2
  25. package/dist/dts/styles/css-directive.d.ts +1 -1
  26. package/dist/dts/styles/css.d.ts +4 -4
  27. package/dist/dts/styles/element-styles.d.ts +2 -2
  28. package/dist/dts/templating/children.d.ts +2 -2
  29. package/dist/dts/templating/compiler.d.ts +3 -3
  30. package/dist/dts/templating/html-binding-directive.d.ts +3 -3
  31. package/dist/dts/templating/html-directive.d.ts +5 -5
  32. package/dist/dts/templating/node-observation.d.ts +2 -2
  33. package/dist/dts/templating/ref.d.ts +1 -1
  34. package/dist/dts/templating/render.d.ts +10 -10
  35. package/dist/dts/templating/repeat.d.ts +4 -4
  36. package/dist/dts/templating/slotted.d.ts +1 -1
  37. package/dist/dts/templating/template.d.ts +4 -4
  38. package/dist/dts/templating/view.d.ts +2 -2
  39. package/dist/esm/binding/one-way.js +1 -1
  40. package/dist/esm/binding/two-way.js +3 -3
  41. package/dist/esm/components/element-controller.js +152 -106
  42. package/dist/esm/components/fast-definitions.js +16 -16
  43. package/dist/esm/context.js +2 -2
  44. package/dist/esm/di/di.js +73 -63
  45. package/dist/esm/dom-policy.js +2 -2
  46. package/dist/esm/dom.js +2 -2
  47. package/dist/esm/index.js +21 -22
  48. package/dist/esm/interfaces.js +38 -0
  49. package/dist/esm/observable.js +1 -1
  50. package/dist/esm/observation/arrays.js +29 -22
  51. package/dist/esm/observation/observable.js +3 -3
  52. package/dist/esm/styles/css.js +2 -2
  53. package/dist/esm/styles/element-styles.js +9 -9
  54. package/dist/esm/templating/children.js +1 -1
  55. package/dist/esm/templating/compiler.js +5 -5
  56. package/dist/esm/templating/html-binding-directive.js +2 -2
  57. package/dist/esm/templating/node-observation.js +1 -1
  58. package/dist/esm/templating/render.js +4 -4
  59. package/dist/esm/templating/repeat.js +11 -11
  60. package/dist/esm/templating/slotted.js +1 -1
  61. package/dist/esm/templating/template.js +7 -7
  62. package/dist/esm/templating/view.js +9 -9
  63. package/dist/fast-element.api.json +96 -37
  64. package/dist/fast-element.d.ts +4 -4
  65. package/dist/fast-element.debug.js +2414 -2321
  66. package/dist/fast-element.debug.min.js +2 -2
  67. package/dist/fast-element.js +2414 -2321
  68. package/dist/fast-element.min.js +2 -2
  69. package/dist/fast-element.untrimmed.d.ts +17 -6
  70. package/docs/api-report.api.md +5 -4
  71. package/docs/di/api-report.api.md +4 -4
  72. package/karma.conf.cjs +13 -7
  73. package/package.json +6 -46
  74. package/playwright.config.ts +18 -0
  75. package/test/index.html +11 -0
  76. package/test/main.ts +10 -0
  77. package/test/vite.config.ts +19 -0
  78. package/dist/dts/observation/observable.bench.d.ts +0 -18
  79. package/dist/dts/templating/render.bench.d.ts +0 -3
  80. package/dist/dts/templating/repeat-basic-reverse.bench.d.ts +0 -3
  81. package/dist/dts/templating/repeat-basic-shift.bench.d.ts +0 -3
  82. package/dist/dts/templating/when-basic.bench.d.ts +0 -3
  83. package/dist/dts/templating/when-conditional.bench.d.ts +0 -3
  84. package/dist/dts/templating/when-switch.bench.d.ts +0 -3
  85. package/dist/esm/observation/observable.bench.js +0 -79
  86. package/dist/esm/templating/render.bench.js +0 -56
  87. package/dist/esm/templating/repeat-basic-reverse.bench.js +0 -43
  88. package/dist/esm/templating/repeat-basic-shift.bench.js +0 -43
  89. package/dist/esm/templating/when-basic.bench.js +0 -36
  90. package/dist/esm/templating/when-conditional.bench.js +0 -39
  91. package/dist/esm/templating/when-switch.bench.js +0 -68
  92. package/scripts/run-benchmarks.js +0 -46
  93. package/tensile.config.js +0 -12
@@ -330,7 +330,7 @@
330
330
  "excerptTokens": [
331
331
  {
332
332
  "kind": "Content",
333
- "text": "export declare type AddBehavior = "
333
+ "text": "export type AddBehavior = "
334
334
  },
335
335
  {
336
336
  "kind": "Content",
@@ -374,7 +374,7 @@
374
374
  "excerptTokens": [
375
375
  {
376
376
  "kind": "Content",
377
- "text": "export declare type AddViewBehaviorFactory = "
377
+ "text": "export type AddViewBehaviorFactory = "
378
378
  },
379
379
  {
380
380
  "kind": "Content",
@@ -957,7 +957,7 @@
957
957
  "excerptTokens": [
958
958
  {
959
959
  "kind": "Content",
960
- "text": "export declare type AttributeConfiguration = "
960
+ "text": "export type AttributeConfiguration = "
961
961
  },
962
962
  {
963
963
  "kind": "Content",
@@ -1437,7 +1437,7 @@
1437
1437
  "excerptTokens": [
1438
1438
  {
1439
1439
  "kind": "Content",
1440
- "text": "export declare type AttributeMode = "
1440
+ "text": "export type AttributeMode = "
1441
1441
  },
1442
1442
  {
1443
1443
  "kind": "Content",
@@ -1959,7 +1959,7 @@
1959
1959
  "excerptTokens": [
1960
1960
  {
1961
1961
  "kind": "Content",
1962
- "text": "export declare type Callable = "
1962
+ "text": "export type Callable = "
1963
1963
  },
1964
1964
  {
1965
1965
  "kind": "Content",
@@ -2444,7 +2444,7 @@
2444
2444
  "excerptTokens": [
2445
2445
  {
2446
2446
  "kind": "Content",
2447
- "text": "export declare type ChildrenDirectiveOptions<T = "
2447
+ "text": "export type ChildrenDirectiveOptions<T = "
2448
2448
  },
2449
2449
  {
2450
2450
  "kind": "Content",
@@ -2505,7 +2505,7 @@
2505
2505
  "excerptTokens": [
2506
2506
  {
2507
2507
  "kind": "Content",
2508
- "text": "export declare type Class<T, C = "
2508
+ "text": "export type Class<T, C = "
2509
2509
  },
2510
2510
  {
2511
2511
  "kind": "Content",
@@ -2572,7 +2572,7 @@
2572
2572
  "excerptTokens": [
2573
2573
  {
2574
2574
  "kind": "Content",
2575
- "text": "export declare type CompilationStrategy = "
2575
+ "text": "export type CompilationStrategy = "
2576
2576
  },
2577
2577
  {
2578
2578
  "kind": "Content",
@@ -2639,7 +2639,7 @@
2639
2639
  "excerptTokens": [
2640
2640
  {
2641
2641
  "kind": "Content",
2642
- "text": "export declare type CompiledViewBehaviorFactory = "
2642
+ "text": "export type CompiledViewBehaviorFactory = "
2643
2643
  },
2644
2644
  {
2645
2645
  "kind": "Reference",
@@ -2783,7 +2783,7 @@
2783
2783
  "excerptTokens": [
2784
2784
  {
2785
2785
  "kind": "Content",
2786
- "text": "export declare type ComposableStyles = "
2786
+ "text": "export type ComposableStyles = "
2787
2787
  },
2788
2788
  {
2789
2789
  "kind": "Content",
@@ -2823,7 +2823,7 @@
2823
2823
  "excerptTokens": [
2824
2824
  {
2825
2825
  "kind": "Content",
2826
- "text": "export declare type Constructable<T = "
2826
+ "text": "export type Constructable<T = "
2827
2827
  },
2828
2828
  {
2829
2829
  "kind": "Content",
@@ -2870,7 +2870,7 @@
2870
2870
  "excerptTokens": [
2871
2871
  {
2872
2872
  "kind": "Content",
2873
- "text": "export declare type ConstructibleStyleStrategy = "
2873
+ "text": "export type ConstructibleStyleStrategy = "
2874
2874
  },
2875
2875
  {
2876
2876
  "kind": "Content",
@@ -4016,7 +4016,7 @@
4016
4016
  "excerptTokens": [
4017
4017
  {
4018
4018
  "kind": "Content",
4019
- "text": "export declare type CSSTemplateTag = "
4019
+ "text": "export type CSSTemplateTag = "
4020
4020
  },
4021
4021
  {
4022
4022
  "kind": "Content",
@@ -4096,7 +4096,7 @@
4096
4096
  "excerptTokens": [
4097
4097
  {
4098
4098
  "kind": "Content",
4099
- "text": "export declare type CSSValue<TSource, TParent = "
4099
+ "text": "export type CSSValue<TSource, TParent = "
4100
4100
  },
4101
4101
  {
4102
4102
  "kind": "Content",
@@ -4250,7 +4250,7 @@
4250
4250
  "excerptTokens": [
4251
4251
  {
4252
4252
  "kind": "Content",
4253
- "text": "export declare type DecoratorAttributeConfiguration = "
4253
+ "text": "export type DecoratorAttributeConfiguration = "
4254
4254
  },
4255
4255
  {
4256
4256
  "kind": "Reference",
@@ -4427,7 +4427,7 @@
4427
4427
  "excerptTokens": [
4428
4428
  {
4429
4429
  "kind": "Content",
4430
- "text": "export declare type DOMAspect = "
4430
+ "text": "export type DOMAspect = "
4431
4431
  },
4432
4432
  {
4433
4433
  "kind": "Content",
@@ -4667,7 +4667,7 @@
4667
4667
  "excerptTokens": [
4668
4668
  {
4669
4669
  "kind": "Content",
4670
- "text": "export declare type DOMSink = "
4670
+ "text": "export type DOMSink = "
4671
4671
  },
4672
4672
  {
4673
4673
  "kind": "Content",
@@ -6194,7 +6194,7 @@
6194
6194
  "excerptTokens": [
6195
6195
  {
6196
6196
  "kind": "Content",
6197
- "text": "export declare type ElementsFilter = "
6197
+ "text": "export type ElementsFilter = "
6198
6198
  },
6199
6199
  {
6200
6200
  "kind": "Content",
@@ -7569,7 +7569,7 @@
7569
7569
  "excerptTokens": [
7570
7570
  {
7571
7571
  "kind": "Content",
7572
- "text": "export declare type Expression<TSource = "
7572
+ "text": "export type Expression<TSource = "
7573
7573
  },
7574
7574
  {
7575
7575
  "kind": "Content",
@@ -11512,7 +11512,7 @@
11512
11512
  "excerptTokens": [
11513
11513
  {
11514
11514
  "kind": "Content",
11515
- "text": "export declare type HTMLTemplateTag = "
11515
+ "text": "export type HTMLTemplateTag = "
11516
11516
  },
11517
11517
  {
11518
11518
  "kind": "Content",
@@ -12578,7 +12578,7 @@
12578
12578
  "excerptTokens": [
12579
12579
  {
12580
12580
  "kind": "Content",
12581
- "text": "static lifecycleCallbacks?: "
12581
+ "text": "static lifecycleCallbacks: "
12582
12582
  },
12583
12583
  {
12584
12584
  "kind": "Reference",
@@ -12591,7 +12591,7 @@
12591
12591
  }
12592
12592
  ],
12593
12593
  "isReadonly": false,
12594
- "isOptional": true,
12594
+ "isOptional": false,
12595
12595
  "releaseTag": "Beta",
12596
12596
  "name": "lifecycleCallbacks",
12597
12597
  "propertyTypeTokenRange": {
@@ -13107,26 +13107,57 @@
13107
13107
  "excerptTokens": [
13108
13108
  {
13109
13109
  "kind": "Content",
13110
- "text": "export interface HydrationControllerCallbacks "
13110
+ "text": "export interface HydrationControllerCallbacks<TElement extends "
13111
+ },
13112
+ {
13113
+ "kind": "Reference",
13114
+ "text": "HTMLElement",
13115
+ "canonicalReference": "!HTMLElement:interface"
13116
+ },
13117
+ {
13118
+ "kind": "Content",
13119
+ "text": " = "
13120
+ },
13121
+ {
13122
+ "kind": "Reference",
13123
+ "text": "HTMLElement",
13124
+ "canonicalReference": "!HTMLElement:interface"
13125
+ },
13126
+ {
13127
+ "kind": "Content",
13128
+ "text": "> "
13111
13129
  }
13112
13130
  ],
13113
13131
  "fileUrlPath": "dist/dts/components/element-controller.d.ts",
13114
13132
  "releaseTag": "Public",
13133
+ "typeParameters": [
13134
+ {
13135
+ "typeParameterName": "TElement",
13136
+ "constraintTokenRange": {
13137
+ "startIndex": 1,
13138
+ "endIndex": 2
13139
+ },
13140
+ "defaultTypeTokenRange": {
13141
+ "startIndex": 3,
13142
+ "endIndex": 4
13143
+ }
13144
+ }
13145
+ ],
13115
13146
  "name": "HydrationControllerCallbacks",
13116
13147
  "preserveMemberOrder": false,
13117
13148
  "members": [
13118
13149
  {
13119
13150
  "kind": "MethodSignature",
13120
13151
  "canonicalReference": "@microsoft/fast-element!HydrationControllerCallbacks#elementDidHydrate:member(1)",
13121
- "docComment": "/**\n * Called after hydration has finished\n */\n",
13152
+ "docComment": "/**\n * Called after an individual element's hydration has finished\n */\n",
13122
13153
  "excerptTokens": [
13123
13154
  {
13124
13155
  "kind": "Content",
13125
- "text": "elementDidHydrate?(name: "
13156
+ "text": "elementDidHydrate?(source: "
13126
13157
  },
13127
13158
  {
13128
13159
  "kind": "Content",
13129
- "text": "string"
13160
+ "text": "TElement"
13130
13161
  },
13131
13162
  {
13132
13163
  "kind": "Content",
@@ -13150,7 +13181,7 @@
13150
13181
  "overloadIndex": 1,
13151
13182
  "parameters": [
13152
13183
  {
13153
- "parameterName": "name",
13184
+ "parameterName": "source",
13154
13185
  "parameterTypeTokenRange": {
13155
13186
  "startIndex": 1,
13156
13187
  "endIndex": 2
@@ -13163,15 +13194,15 @@
13163
13194
  {
13164
13195
  "kind": "MethodSignature",
13165
13196
  "canonicalReference": "@microsoft/fast-element!HydrationControllerCallbacks#elementWillHydrate:member(1)",
13166
- "docComment": "/**\n * Called before hydration has started\n */\n",
13197
+ "docComment": "/**\n * Called before an individual element's hydration begins\n */\n",
13167
13198
  "excerptTokens": [
13168
13199
  {
13169
13200
  "kind": "Content",
13170
- "text": "elementWillHydrate?(name: "
13201
+ "text": "elementWillHydrate?(source: "
13171
13202
  },
13172
13203
  {
13173
13204
  "kind": "Content",
13174
- "text": "string"
13205
+ "text": "TElement"
13175
13206
  },
13176
13207
  {
13177
13208
  "kind": "Content",
@@ -13195,7 +13226,7 @@
13195
13226
  "overloadIndex": 1,
13196
13227
  "parameters": [
13197
13228
  {
13198
- "parameterName": "name",
13229
+ "parameterName": "source",
13199
13230
  "parameterTypeTokenRange": {
13200
13231
  "startIndex": 1,
13201
13232
  "endIndex": 2
@@ -13232,6 +13263,34 @@
13232
13263
  "overloadIndex": 1,
13233
13264
  "parameters": [],
13234
13265
  "name": "hydrationComplete"
13266
+ },
13267
+ {
13268
+ "kind": "MethodSignature",
13269
+ "canonicalReference": "@microsoft/fast-element!HydrationControllerCallbacks#hydrationStarted:member(1)",
13270
+ "docComment": "/**\n * Called once when the first element enters the hydration pipeline. This is the earliest point at which we know a component has been async-defined with `defer-and-hydrate`, a template is pending via `<f-template>`, and the element has `needs-hydration`.\n */\n",
13271
+ "excerptTokens": [
13272
+ {
13273
+ "kind": "Content",
13274
+ "text": "hydrationStarted?(): "
13275
+ },
13276
+ {
13277
+ "kind": "Content",
13278
+ "text": "void"
13279
+ },
13280
+ {
13281
+ "kind": "Content",
13282
+ "text": ";"
13283
+ }
13284
+ ],
13285
+ "isOptional": true,
13286
+ "returnTypeTokenRange": {
13287
+ "startIndex": 1,
13288
+ "endIndex": 2
13289
+ },
13290
+ "releaseTag": "Public",
13291
+ "overloadIndex": 1,
13292
+ "parameters": [],
13293
+ "name": "hydrationStarted"
13235
13294
  }
13236
13295
  ],
13237
13296
  "extendsTokenRanges": []
@@ -18698,7 +18757,7 @@
18698
18757
  "excerptTokens": [
18699
18758
  {
18700
18759
  "kind": "Content",
18701
- "text": "export declare type SourceLifetime = "
18760
+ "text": "export type SourceLifetime = "
18702
18761
  },
18703
18762
  {
18704
18763
  "kind": "Content",
@@ -19897,7 +19956,7 @@
19897
19956
  "excerptTokens": [
19898
19957
  {
19899
19958
  "kind": "Content",
19900
- "text": "export declare type SpliceStrategySupport = "
19959
+ "text": "export type SpliceStrategySupport = "
19901
19960
  },
19902
19961
  {
19903
19962
  "kind": "Content",
@@ -21655,7 +21714,7 @@
21655
21714
  "excerptTokens": [
21656
21715
  {
21657
21716
  "kind": "Content",
21658
- "text": "export declare type TemplateOptions = "
21717
+ "text": "export type TemplateOptions = "
21659
21718
  },
21660
21719
  {
21661
21720
  "kind": "Content",
@@ -21722,7 +21781,7 @@
21722
21781
  "excerptTokens": [
21723
21782
  {
21724
21783
  "kind": "Content",
21725
- "text": "export declare type TemplateValue<TSource, TParent = "
21784
+ "text": "export type TemplateValue<TSource, TParent = "
21726
21785
  },
21727
21786
  {
21728
21787
  "kind": "Content",
@@ -21812,7 +21871,7 @@
21812
21871
  "excerptTokens": [
21813
21872
  {
21814
21873
  "kind": "Content",
21815
- "text": "export declare type TrustedTypesPolicy = "
21874
+ "text": "export type TrustedTypesPolicy = "
21816
21875
  },
21817
21876
  {
21818
21877
  "kind": "Content",
@@ -22656,7 +22715,7 @@
22656
22715
  "excerptTokens": [
22657
22716
  {
22658
22717
  "kind": "Content",
22659
- "text": "export declare type ViewBehaviorTargets = "
22718
+ "text": "export type ViewBehaviorTargets = "
22660
22719
  },
22661
22720
  {
22662
22721
  "kind": "Content",
@@ -431,7 +431,7 @@ export declare const DI: Readonly<{
431
431
  *
432
432
  * @public
433
433
  */
434
- transient<T extends Constructable<{}>>(target: T & Partial<RegisterSelf<T>>): T & RegisterSelf<T>;
434
+ transient<T extends Constructable>(target: T & Partial<RegisterSelf<T>>): T & RegisterSelf<T>;
435
435
  /**
436
436
  * Registers the `target` class as a singleton dependency; the class will only be created once. Each
437
437
  * consecutive time the dependency is resolved, the same instance will be returned.
@@ -455,7 +455,7 @@ export declare const DI: Readonly<{
455
455
  *
456
456
  * @public
457
457
  */
458
- singleton<T_1 extends Constructable<{}>>(target: T_1 & Partial<RegisterSelf<T_1>>, options?: SingletonOptions): T_1 & RegisterSelf<T_1>;
458
+ singleton<T_1 extends Constructable>(target: T_1 & Partial<RegisterSelf<T_1>>, options?: SingletonOptions): T_1 & RegisterSelf<T_1>;
459
459
  }>;
460
460
 
461
461
  /**
@@ -762,7 +762,7 @@ export declare const Registration: Readonly<{
762
762
  * @param key - The key to register the singleton under.
763
763
  * @param value - The class to instantiate as a singleton when first requested.
764
764
  */
765
- singleton<T_1 extends Constructable<{}>>(key: Key, value: T_1): Registration<InstanceType<T_1>>;
765
+ singleton<T_1 extends Constructable>(key: Key, value: T_1): Registration<InstanceType<T_1>>;
766
766
  /**
767
767
  * Creates an instance from a class.
768
768
  * Every time you request this {@link Key} you will get a new instance.
@@ -775,7 +775,7 @@ export declare const Registration: Readonly<{
775
775
  * @param key - The key to register the instance type under.
776
776
  * @param value - The class to instantiate each time the key is requested.
777
777
  */
778
- transient<T_2 extends Constructable<{}>>(key: Key, value: T_2): Registration<InstanceType<T_2>>;
778
+ transient<T_2 extends Constructable>(key: Key, value: T_2): Registration<InstanceType<T_2>>;
779
779
  /**
780
780
  * Delegates to a callback function to provide the dependency.
781
781
  * Every time you request this {@link Key} the callback will be invoked to provide