@microsoft/fast-element 3.0.0-rc.1 → 3.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -1
- package/README.md +50 -14
- package/dist/context/context.api.json +13 -13
- package/dist/declarative/declarative.api.json +654 -15
- package/dist/di/di.api.json +15 -15
- package/dist/dts/__test__/helpers.d.ts +6 -0
- package/dist/dts/__test__/setup-node.d.ts +0 -0
- package/dist/dts/binding/binding.d.ts +15 -5
- package/dist/dts/binding/one-time.d.ts +1 -1
- package/dist/dts/binding/one-way.d.ts +1 -1
- package/dist/dts/binding/signal.d.ts +1 -1
- package/dist/dts/binding/two-way.d.ts +1 -1
- package/dist/dts/components/attributes.d.ts +1 -1
- package/dist/dts/components/enable-hydration.d.ts +22 -2
- package/dist/dts/components/fast-definitions.d.ts +7 -4
- package/dist/dts/components/fast-element.d.ts +42 -12
- package/dist/dts/components/hydration-tracker.d.ts +47 -4
- package/dist/dts/components/hydration.d.ts +5 -0
- package/dist/dts/context.d.ts +7 -7
- package/dist/dts/declarative/debug.d.ts +2 -3
- package/dist/dts/declarative/index.d.ts +3 -2
- package/dist/dts/declarative/interfaces.d.ts +1 -2
- package/dist/dts/declarative/template.d.ts +2 -1
- package/dist/dts/declarative/utilities.d.ts +50 -4
- package/dist/dts/di/di.d.ts +6 -6
- package/dist/dts/dom-policy.d.ts +22 -4
- package/dist/dts/dom.d.ts +4 -16
- package/dist/dts/hydration/diagnostics.d.ts +93 -0
- package/dist/dts/hydration/hydration-debugger.d.ts +35 -0
- package/dist/dts/hydration/messages.d.ts +62 -0
- package/dist/dts/hydration/target-builder.d.ts +26 -1
- package/dist/dts/hydration.d.ts +7 -3
- package/dist/dts/index.d.ts +7 -3
- package/dist/dts/interfaces.d.ts +1 -0
- package/dist/dts/observation/observable.d.ts +3 -3
- package/dist/dts/platform.d.ts +20 -4
- package/dist/dts/registry.d.ts +1 -0
- package/dist/dts/templating/children.d.ts +1 -1
- package/dist/dts/templating/compiler.d.ts +1 -1
- package/dist/dts/templating/html-binding-directive.d.ts +6 -2
- package/dist/dts/templating/html-directive.d.ts +2 -1
- package/dist/dts/templating/hydration-view.d.ts +24 -3
- package/dist/dts/templating/ref.d.ts +1 -1
- package/dist/dts/templating/render.d.ts +2 -2
- package/dist/dts/templating/repeat.d.ts +1 -1
- package/dist/dts/templating/slotted.d.ts +1 -1
- package/dist/dts/templating/template.d.ts +5 -5
- package/dist/dts/templating/when.d.ts +1 -1
- package/dist/dts/testing/fakes.d.ts +4 -4
- package/dist/esm/__test__/helpers.js +22 -0
- package/dist/esm/__test__/setup-node.js +18 -0
- package/dist/esm/binding/two-way.js +1 -2
- package/dist/esm/components/attributes.js +12 -8
- package/dist/esm/components/element-controller.js +11 -6
- package/dist/esm/components/enable-hydration.js +27 -3
- package/dist/esm/components/fast-definitions.js +19 -18
- package/dist/esm/components/hydration-tracker.js +34 -5
- package/dist/esm/components/hydration.js +85 -6
- package/dist/esm/debug.js +1 -0
- package/dist/esm/declarative/attribute-map.js +2 -1
- package/dist/esm/declarative/debug.js +0 -1
- package/dist/esm/declarative/index.js +1 -0
- package/dist/esm/declarative/interfaces.js +0 -1
- package/dist/esm/declarative/observer-map-utilities.js +58 -55
- package/dist/esm/declarative/template-bridge.js +4 -14
- package/dist/esm/declarative/template.js +4 -3
- package/dist/esm/declarative/utilities.js +236 -1
- package/dist/esm/di/di.js +2 -1
- package/dist/esm/dom-policy.js +33 -4
- package/dist/esm/hydration/diagnostics.js +50 -0
- package/dist/esm/hydration/hydration-debugger.js +112 -0
- package/dist/esm/hydration/messages.js +84 -0
- package/dist/esm/hydration/target-builder.js +65 -19
- package/dist/esm/hydration.js +3 -1
- package/dist/esm/index.js +6 -2
- package/dist/esm/interfaces.js +1 -0
- package/dist/esm/metadata.js +2 -8
- package/dist/esm/observation/notifier.js +2 -4
- package/dist/esm/registry.js +1 -0
- package/dist/esm/templating/html-binding-directive.js +1 -1
- package/dist/esm/templating/hydration-view.js +20 -27
- package/dist/esm/templating/render.js +39 -18
- package/dist/esm/templating/repeat.js +51 -17
- package/dist/esm/templating/view.js +1 -1
- package/dist/esm/testing/fixture.js +2 -2
- package/dist/esm/testing/timeout.js +2 -2
- package/dist/fast-element.api.json +1329 -99
- package/dist/fast-element.d.ts +147 -66
- package/dist/fast-element.debug.js +392 -99
- package/dist/fast-element.debug.min.js +2 -2
- package/dist/fast-element.js +392 -99
- package/dist/fast-element.min.js +2 -2
- package/dist/fast-element.untrimmed.d.ts +133 -70
- package/dist/hydration/hydration.api.json +1280 -57
- package/dist/styles/styles.api.json +1 -1
- package/package.json +21 -9
- package/ARCHITECTURE_FASTELEMENT.md +0 -63
- package/ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md +0 -36
- package/ARCHITECTURE_INTRO.md +0 -10
- package/ARCHITECTURE_OVERVIEW.md +0 -52
- package/ARCHITECTURE_UPDATES.md +0 -11
- package/CHANGELOG.json +0 -2275
- package/DECLARATIVE_DESIGN.md +0 -806
- package/DECLARATIVE_HTML.md +0 -470
- package/DECLARATIVE_MIGRATION.md +0 -215
- package/DECLARATIVE_RENDERING.md +0 -530
- package/DECLARATIVE_RENDERING_LIFECYCLE.md +0 -288
- package/DECLARATIVE_SCHEMA_OBSERVER_MAP.md +0 -489
- package/DESIGN.md +0 -615
- package/MIGRATION.md +0 -387
- package/SIZES.md +0 -25
- package/api-extractor.arrays.json +0 -15
- package/api-extractor.context.json +0 -15
- package/api-extractor.declarative.json +0 -15
- package/api-extractor.di.json +0 -15
- package/api-extractor.hydration.json +0 -15
- package/api-extractor.styles.json +0 -15
- package/biome.json +0 -4
- package/docs/ACKNOWLEDGEMENTS.md +0 -12
- package/docs/api-report.api.md +0 -1299
- package/docs/arrays/api-report.api.md +0 -114
- package/docs/context/api-report.api.md +0 -69
- package/docs/declarative/api-report.api.md +0 -397
- package/docs/di/api-report.api.md +0 -315
- package/docs/fast-element-2-changes.md +0 -15
- package/docs/hydration/api-report.api.md +0 -285
- package/docs/styles/api-report.api.md +0 -135
- package/playwright.config.ts +0 -26
- package/playwright.declarative.config.ts +0 -26
- package/playwright.declarative.webui.config.ts +0 -20
- package/scripts/declarative/build-fixtures-with-webui.js +0 -135
- package/scripts/declarative/build-fixtures.js +0 -49
- package/scripts/declarative/build-fixtures.utilities.js +0 -101
- package/scripts/measure-sizes.js +0 -219
- package/scripts/run-api-extractor.js +0 -70
- package/test/declarative/fixtures/README.md +0 -72
- package/test/declarative/fixtures/WRITING_FIXTURES.md +0 -330
- package/test/declarative/fixtures/bindings/README.md +0 -12
- package/test/declarative/fixtures/bindings/attribute/entry.html +0 -13
- package/test/declarative/fixtures/bindings/attribute/fast-build.config.json +0 -6
- package/test/declarative/fixtures/bindings/attribute/index.html +0 -25
- package/test/declarative/fixtures/bindings/attribute/main.ts +0 -41
- package/test/declarative/fixtures/bindings/attribute/state.json +0 -8
- package/test/declarative/fixtures/bindings/attribute/templates.html +0 -11
- package/test/declarative/fixtures/bindings/content/entry.html +0 -12
- package/test/declarative/fixtures/bindings/content/fast-build.config.json +0 -6
- package/test/declarative/fixtures/bindings/content/index.html +0 -19
- package/test/declarative/fixtures/bindings/content/main.ts +0 -27
- package/test/declarative/fixtures/bindings/content/state.json +0 -4
- package/test/declarative/fixtures/bindings/content/templates.html +0 -6
- package/test/declarative/fixtures/bindings/dot-syntax/entry.html +0 -11
- package/test/declarative/fixtures/bindings/dot-syntax/fast-build.config.json +0 -6
- package/test/declarative/fixtures/bindings/dot-syntax/index.html +0 -47
- package/test/declarative/fixtures/bindings/dot-syntax/main.ts +0 -59
- package/test/declarative/fixtures/bindings/dot-syntax/state.json +0 -16
- package/test/declarative/fixtures/bindings/dot-syntax/templates.html +0 -17
- package/test/declarative/fixtures/bindings/event/entry.html +0 -11
- package/test/declarative/fixtures/bindings/event/fast-build.config.json +0 -6
- package/test/declarative/fixtures/bindings/event/index.html +0 -43
- package/test/declarative/fixtures/bindings/event/main.ts +0 -43
- package/test/declarative/fixtures/bindings/event/state.json +0 -3
- package/test/declarative/fixtures/bindings/event/templates.html +0 -18
- package/test/declarative/fixtures/bindings/host/entry.html +0 -40
- package/test/declarative/fixtures/bindings/host/fast-build.config.json +0 -6
- package/test/declarative/fixtures/bindings/host/index.html +0 -96
- package/test/declarative/fixtures/bindings/host/main.ts +0 -222
- package/test/declarative/fixtures/bindings/host/state.json +0 -9
- package/test/declarative/fixtures/bindings/host/templates.html +0 -55
- package/test/declarative/fixtures/directives/README.md +0 -12
- package/test/declarative/fixtures/directives/children/entry.html +0 -11
- package/test/declarative/fixtures/directives/children/fast-build.config.json +0 -6
- package/test/declarative/fixtures/directives/children/index.html +0 -15
- package/test/declarative/fixtures/directives/children/main.ts +0 -22
- package/test/declarative/fixtures/directives/children/state.json +0 -3
- package/test/declarative/fixtures/directives/children/templates.html +0 -3
- package/test/declarative/fixtures/directives/ref/entry.html +0 -11
- package/test/declarative/fixtures/directives/ref/fast-build.config.json +0 -6
- package/test/declarative/fixtures/directives/ref/index.html +0 -15
- package/test/declarative/fixtures/directives/ref/main.ts +0 -17
- package/test/declarative/fixtures/directives/ref/state.json +0 -1
- package/test/declarative/fixtures/directives/ref/templates.html +0 -3
- package/test/declarative/fixtures/directives/repeat/entry.html +0 -21
- package/test/declarative/fixtures/directives/repeat/fast-build.config.json +0 -6
- package/test/declarative/fixtures/directives/repeat/index.html +0 -133
- package/test/declarative/fixtures/directives/repeat/main.ts +0 -110
- package/test/declarative/fixtures/directives/repeat/sprites.svg +0 -8
- package/test/declarative/fixtures/directives/repeat/state.json +0 -10
- package/test/declarative/fixtures/directives/repeat/templates.html +0 -75
- package/test/declarative/fixtures/directives/slotted/entry.html +0 -17
- package/test/declarative/fixtures/directives/slotted/fast-build.config.json +0 -6
- package/test/declarative/fixtures/directives/slotted/index.html +0 -27
- package/test/declarative/fixtures/directives/slotted/main.ts +0 -29
- package/test/declarative/fixtures/directives/slotted/state.json +0 -1
- package/test/declarative/fixtures/directives/slotted/templates.html +0 -7
- package/test/declarative/fixtures/directives/when/entry.html +0 -51
- package/test/declarative/fixtures/directives/when/fast-build.config.json +0 -6
- package/test/declarative/fixtures/directives/when/index.html +0 -136
- package/test/declarative/fixtures/directives/when/main.ts +0 -172
- package/test/declarative/fixtures/directives/when/state.json +0 -12
- package/test/declarative/fixtures/directives/when/templates.html +0 -75
- package/test/declarative/fixtures/ecosystem/README.md +0 -11
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/entry.html +0 -12
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/fast-build.config.json +0 -6
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/index.html +0 -20
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/main.ts +0 -68
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/state.json +0 -4
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/templates.html +0 -7
- package/test/declarative/fixtures/ecosystem/errors/entry.html +0 -12
- package/test/declarative/fixtures/ecosystem/errors/fast-build.config.json +0 -6
- package/test/declarative/fixtures/ecosystem/errors/index.html +0 -20
- package/test/declarative/fixtures/ecosystem/errors/main.ts +0 -17
- package/test/declarative/fixtures/ecosystem/errors/state.json +0 -1
- package/test/declarative/fixtures/ecosystem/errors/templates.html +0 -7
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/entry.html +0 -17
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/fast-build.config.json +0 -6
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/index.html +0 -56
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/main.ts +0 -134
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/state.json +0 -12
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/templates.html +0 -34
- package/test/declarative/fixtures/ecosystem/performance-metrics/entry.html +0 -25
- package/test/declarative/fixtures/ecosystem/performance-metrics/fast-build.config.json +0 -6
- package/test/declarative/fixtures/ecosystem/performance-metrics/fast-card.css +0 -10
- package/test/declarative/fixtures/ecosystem/performance-metrics/index.html +0 -181
- package/test/declarative/fixtures/ecosystem/performance-metrics/main.ts +0 -58
- package/test/declarative/fixtures/ecosystem/performance-metrics/state.json +0 -6
- package/test/declarative/fixtures/ecosystem/performance-metrics/templates.html +0 -15
- package/test/declarative/fixtures/extensions/README.md +0 -15
- package/test/declarative/fixtures/extensions/attribute-map/entry.html +0 -14
- package/test/declarative/fixtures/extensions/attribute-map/fast-build.config.json +0 -6
- package/test/declarative/fixtures/extensions/attribute-map/index.html +0 -31
- package/test/declarative/fixtures/extensions/attribute-map/main.ts +0 -40
- package/test/declarative/fixtures/extensions/attribute-map/state.json +0 -4
- package/test/declarative/fixtures/extensions/attribute-map/templates.html +0 -14
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/entry.html +0 -12
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/fast-build.config.json +0 -7
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/index.html +0 -25
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/main.ts +0 -31
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/state.json +0 -5
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/templates.html +0 -11
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/entry.html +0 -13
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/fast-build.config.json +0 -7
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/index.html +0 -23
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/main.ts +0 -37
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/state.json +0 -1
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/templates.html +0 -9
- package/test/declarative/fixtures/extensions/observer-map/entry.html +0 -15
- package/test/declarative/fixtures/extensions/observer-map/fast-build.config.json +0 -6
- package/test/declarative/fixtures/extensions/observer-map/index.html +0 -442
- package/test/declarative/fixtures/extensions/observer-map/main.ts +0 -482
- package/test/declarative/fixtures/extensions/observer-map/state.json +0 -158
- package/test/declarative/fixtures/extensions/observer-map/templates.html +0 -172
- package/test/declarative/fixtures/extensions/observer-map-config-object/entry.html +0 -16
- package/test/declarative/fixtures/extensions/observer-map-config-object/fast-build.config.json +0 -6
- package/test/declarative/fixtures/extensions/observer-map-config-object/index.html +0 -27
- package/test/declarative/fixtures/extensions/observer-map-config-object/main.ts +0 -53
- package/test/declarative/fixtures/extensions/observer-map-config-object/state.json +0 -9
- package/test/declarative/fixtures/extensions/observer-map-config-object/templates.html +0 -12
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/README.md +0 -98
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/entry.html +0 -156
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/fast-build.config.json +0 -6
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/index.html +0 -376
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/main.ts +0 -366
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/state.json +0 -69
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/templates.html +0 -91
- package/test/declarative/fixtures/extensions/observer-map-properties/entry.html +0 -14
- package/test/declarative/fixtures/extensions/observer-map-properties/fast-build.config.json +0 -6
- package/test/declarative/fixtures/extensions/observer-map-properties/index.html +0 -110
- package/test/declarative/fixtures/extensions/observer-map-properties/main.ts +0 -175
- package/test/declarative/fixtures/extensions/observer-map-properties/state.json +0 -29
- package/test/declarative/fixtures/extensions/observer-map-properties/templates.html +0 -55
- package/test/declarative/fixtures/scenarios/README.md +0 -7
- package/test/declarative/fixtures/scenarios/nested-elements/entry.html +0 -16
- package/test/declarative/fixtures/scenarios/nested-elements/fast-build.config.json +0 -6
- package/test/declarative/fixtures/scenarios/nested-elements/index.html +0 -126
- package/test/declarative/fixtures/scenarios/nested-elements/main.ts +0 -214
- package/test/declarative/fixtures/scenarios/nested-elements/state.json +0 -10
- package/test/declarative/fixtures/scenarios/nested-elements/templates.html +0 -54
- package/test/declarative/index.html +0 -12
- package/test/declarative/vite.config.ts +0 -55
- package/test/declarative-main.ts +0 -6
- package/test/extension-subpaths-main.ts +0 -9
- package/test/index.html +0 -11
- package/test/main.ts +0 -109
- package/test/pure-declarative-main.ts +0 -1
- package/test/vite.config.ts +0 -19
- package/tsconfig.api-extractor.json +0 -6
package/dist/di/di.api.json
CHANGED
|
@@ -1530,7 +1530,7 @@
|
|
|
1530
1530
|
},
|
|
1531
1531
|
{
|
|
1532
1532
|
"kind": "Content",
|
|
1533
|
-
"text": "<T>;\n singleton<
|
|
1533
|
+
"text": "<T>;\n singleton<T extends "
|
|
1534
1534
|
},
|
|
1535
1535
|
{
|
|
1536
1536
|
"kind": "Reference",
|
|
@@ -1539,7 +1539,7 @@
|
|
|
1539
1539
|
},
|
|
1540
1540
|
{
|
|
1541
1541
|
"kind": "Content",
|
|
1542
|
-
"text": ">(target:
|
|
1542
|
+
"text": ">(target: T & "
|
|
1543
1543
|
},
|
|
1544
1544
|
{
|
|
1545
1545
|
"kind": "Reference",
|
|
@@ -1557,7 +1557,7 @@
|
|
|
1557
1557
|
},
|
|
1558
1558
|
{
|
|
1559
1559
|
"kind": "Content",
|
|
1560
|
-
"text": "<
|
|
1560
|
+
"text": "<T>>, options?: "
|
|
1561
1561
|
},
|
|
1562
1562
|
{
|
|
1563
1563
|
"kind": "Reference",
|
|
@@ -1566,7 +1566,7 @@
|
|
|
1566
1566
|
},
|
|
1567
1567
|
{
|
|
1568
1568
|
"kind": "Content",
|
|
1569
|
-
"text": "):
|
|
1569
|
+
"text": "): T & "
|
|
1570
1570
|
},
|
|
1571
1571
|
{
|
|
1572
1572
|
"kind": "Reference",
|
|
@@ -1575,7 +1575,7 @@
|
|
|
1575
1575
|
},
|
|
1576
1576
|
{
|
|
1577
1577
|
"kind": "Content",
|
|
1578
|
-
"text": "<
|
|
1578
|
+
"text": "<T>;\n}>"
|
|
1579
1579
|
}
|
|
1580
1580
|
],
|
|
1581
1581
|
"fileUrlPath": "dist/dts/di/di.d.ts",
|
|
@@ -2702,7 +2702,7 @@
|
|
|
2702
2702
|
},
|
|
2703
2703
|
{
|
|
2704
2704
|
"kind": "Content",
|
|
2705
|
-
"text": "<T>;\n singleton<
|
|
2705
|
+
"text": "<T>;\n singleton<T extends "
|
|
2706
2706
|
},
|
|
2707
2707
|
{
|
|
2708
2708
|
"kind": "Reference",
|
|
@@ -2720,7 +2720,7 @@
|
|
|
2720
2720
|
},
|
|
2721
2721
|
{
|
|
2722
2722
|
"kind": "Content",
|
|
2723
|
-
"text": ", value:
|
|
2723
|
+
"text": ", value: T): "
|
|
2724
2724
|
},
|
|
2725
2725
|
{
|
|
2726
2726
|
"kind": "Reference",
|
|
@@ -2738,7 +2738,7 @@
|
|
|
2738
2738
|
},
|
|
2739
2739
|
{
|
|
2740
2740
|
"kind": "Content",
|
|
2741
|
-
"text": "<
|
|
2741
|
+
"text": "<T>>;\n transient<T extends "
|
|
2742
2742
|
},
|
|
2743
2743
|
{
|
|
2744
2744
|
"kind": "Reference",
|
|
@@ -2756,7 +2756,7 @@
|
|
|
2756
2756
|
},
|
|
2757
2757
|
{
|
|
2758
2758
|
"kind": "Content",
|
|
2759
|
-
"text": ", value:
|
|
2759
|
+
"text": ", value: T): "
|
|
2760
2760
|
},
|
|
2761
2761
|
{
|
|
2762
2762
|
"kind": "Reference",
|
|
@@ -2774,7 +2774,7 @@
|
|
|
2774
2774
|
},
|
|
2775
2775
|
{
|
|
2776
2776
|
"kind": "Content",
|
|
2777
|
-
"text": "<
|
|
2777
|
+
"text": "<T>>;\n callback<T>(key: "
|
|
2778
2778
|
},
|
|
2779
2779
|
{
|
|
2780
2780
|
"kind": "Reference",
|
|
@@ -2792,7 +2792,7 @@
|
|
|
2792
2792
|
},
|
|
2793
2793
|
{
|
|
2794
2794
|
"kind": "Content",
|
|
2795
|
-
"text": "<
|
|
2795
|
+
"text": "<T>): "
|
|
2796
2796
|
},
|
|
2797
2797
|
{
|
|
2798
2798
|
"kind": "Reference",
|
|
@@ -2810,7 +2810,7 @@
|
|
|
2810
2810
|
},
|
|
2811
2811
|
{
|
|
2812
2812
|
"kind": "Content",
|
|
2813
|
-
"text": "<
|
|
2813
|
+
"text": "<T>>;\n cachedCallback<T>(key: "
|
|
2814
2814
|
},
|
|
2815
2815
|
{
|
|
2816
2816
|
"kind": "Reference",
|
|
@@ -2828,7 +2828,7 @@
|
|
|
2828
2828
|
},
|
|
2829
2829
|
{
|
|
2830
2830
|
"kind": "Content",
|
|
2831
|
-
"text": "<
|
|
2831
|
+
"text": "<T>): "
|
|
2832
2832
|
},
|
|
2833
2833
|
{
|
|
2834
2834
|
"kind": "Reference",
|
|
@@ -2846,7 +2846,7 @@
|
|
|
2846
2846
|
},
|
|
2847
2847
|
{
|
|
2848
2848
|
"kind": "Content",
|
|
2849
|
-
"text": "<
|
|
2849
|
+
"text": "<T>>;\n aliasTo<T>(originalKey: T, aliasKey: "
|
|
2850
2850
|
},
|
|
2851
2851
|
{
|
|
2852
2852
|
"kind": "Reference",
|
|
@@ -2873,7 +2873,7 @@
|
|
|
2873
2873
|
},
|
|
2874
2874
|
{
|
|
2875
2875
|
"kind": "Content",
|
|
2876
|
-
"text": "<
|
|
2876
|
+
"text": "<T>>;\n}>"
|
|
2877
2877
|
}
|
|
2878
2878
|
],
|
|
2879
2879
|
"fileUrlPath": "dist/dts/di/di.d.ts",
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function toHTML(node: Node, preserveCommentMarkup?: boolean): string;
|
|
2
|
+
export declare function createTrackableDOMPolicy(): {
|
|
3
|
+
used: boolean;
|
|
4
|
+
createHTML: (html: string) => string;
|
|
5
|
+
protect(tagName: any, aspect: any, aspectName: any, sink: any): (node: any, aspectName: any, value: any, ...args: any[]) => void;
|
|
6
|
+
};
|
|
File without changes
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { DOMAspect
|
|
1
|
+
import type { DOMAspect } from "../dom.js";
|
|
2
|
+
import type { DOMPolicy } from "../dom-policy.js";
|
|
2
3
|
import type { Subscriber } from "../observation/notifier.js";
|
|
3
4
|
import type { Expression, ExpressionObserver } from "../observation/observable.js";
|
|
4
5
|
/**
|
|
@@ -26,20 +27,29 @@ export interface BindingDirective {
|
|
|
26
27
|
* @public
|
|
27
28
|
*/
|
|
28
29
|
export declare abstract class Binding<TSource = any, TReturn = any, TParent = any> {
|
|
29
|
-
evaluate: Expression<TSource, TReturn, TParent>;
|
|
30
|
-
policy?: DOMPolicy | undefined;
|
|
31
|
-
isVolatile: boolean;
|
|
32
30
|
/**
|
|
33
31
|
* Options associated with the binding.
|
|
34
32
|
*/
|
|
35
33
|
options?: any;
|
|
34
|
+
/**
|
|
35
|
+
* Evaluates the binding.
|
|
36
|
+
*/
|
|
37
|
+
evaluate: Expression<TSource, TReturn, TParent>;
|
|
38
|
+
/**
|
|
39
|
+
* The security policy to associate with this binding.
|
|
40
|
+
*/
|
|
41
|
+
policy?: DOMPolicy;
|
|
42
|
+
/**
|
|
43
|
+
* Indicates whether the binding is volatile.
|
|
44
|
+
*/
|
|
45
|
+
isVolatile: boolean;
|
|
36
46
|
/**
|
|
37
47
|
* Creates a binding.
|
|
38
48
|
* @param evaluate - Evaluates the binding.
|
|
39
49
|
* @param policy - The security policy to associate with this binding.
|
|
40
50
|
* @param isVolatile - Indicates whether the binding is volatile.
|
|
41
51
|
*/
|
|
42
|
-
constructor(evaluate: Expression<TSource, TReturn, TParent>, policy?: DOMPolicy
|
|
52
|
+
constructor(evaluate: Expression<TSource, TReturn, TParent>, policy?: DOMPolicy, isVolatile?: boolean);
|
|
43
53
|
/**
|
|
44
54
|
* Creates an observer capable of notifying a subscriber when the output of a binding changes.
|
|
45
55
|
* @param subscriber - The subscriber to changes in the binding.
|
|
@@ -75,7 +75,7 @@ export declare const nullableBooleanConverter: ValueConverter;
|
|
|
75
75
|
*/
|
|
76
76
|
export declare const nullableNumberConverter: ValueConverter;
|
|
77
77
|
/**
|
|
78
|
-
* An implementation of
|
|
78
|
+
* An implementation of {@link Accessor} that supports reactivity,
|
|
79
79
|
* change callbacks, attribute reflection, and type conversion for
|
|
80
80
|
* custom elements.
|
|
81
81
|
* @public
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type HydrationOptions } from "./hydration-tracker.js";
|
|
2
|
+
export { StopHydration } from "./hydration-tracker.js";
|
|
2
3
|
export type { HydrationOptions };
|
|
3
4
|
/**
|
|
4
5
|
* Enables hydration support for prerendered FAST elements.
|
|
@@ -10,19 +11,38 @@ export type { HydrationOptions };
|
|
|
10
11
|
*
|
|
11
12
|
* Safe to call multiple times — the hydration hook is installed once
|
|
12
13
|
* and subsequent calls merge their options into the shared tracker.
|
|
14
|
+
* By default, the hook stops hydrating new prerendered elements after
|
|
15
|
+
* the global `hydrationComplete` callback. Set
|
|
16
|
+
* `stopHydration` to `StopHydration.never` for streaming scenarios
|
|
17
|
+
* that append hydratable Declarative Shadow DOM after the initial batch.
|
|
18
|
+
*
|
|
19
|
+
* Pass `debugger: hydrationDebugger()` to swap the default minimal
|
|
20
|
+
* hydration mismatch error message for a rich "Expected / Received"
|
|
21
|
+
* report including the SSR HTML snippet and structured
|
|
22
|
+
* `expected`/`received` fields on `HydrationBindingError` /
|
|
23
|
+
* `HydrationTargetElementError`. The debugger module is tree-shaken
|
|
24
|
+
* out of production hydration bundles unless explicitly imported.
|
|
13
25
|
*
|
|
14
26
|
* @example
|
|
15
27
|
* ```ts
|
|
16
|
-
* import { enableHydration } from "@microsoft/fast-element/hydration.js";
|
|
28
|
+
* import { enableHydration, StopHydration } from "@microsoft/fast-element/hydration.js";
|
|
17
29
|
*
|
|
18
30
|
* enableHydration({
|
|
31
|
+
* stopHydration: StopHydration.never,
|
|
19
32
|
* hydrationComplete() {
|
|
20
33
|
* console.log("hydration complete");
|
|
21
34
|
* },
|
|
22
35
|
* });
|
|
23
36
|
* ```
|
|
24
37
|
*
|
|
25
|
-
* @
|
|
38
|
+
* @example Rich hydration mismatch diagnostics
|
|
39
|
+
* ```ts
|
|
40
|
+
* import { enableHydration, hydrationDebugger } from "@microsoft/fast-element/hydration.js";
|
|
41
|
+
*
|
|
42
|
+
* enableHydration({ debugger: hydrationDebugger() });
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @param options - Optional global hydration callbacks and behavior.
|
|
26
46
|
* @public
|
|
27
47
|
*/
|
|
28
48
|
export declare function enableHydration(options?: HydrationOptions): void;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { type Constructable } from "../interfaces.js";
|
|
2
|
-
import { type TypeRegistry } from "../platform.js";
|
|
2
|
+
import { type TypeDefinition, type TypeRegistry } from "../platform.js";
|
|
3
3
|
import { type ComposableStyles, ElementStyles } from "../styles/element-styles.js";
|
|
4
4
|
import type { ElementViewTemplate } from "../templating/template.js";
|
|
5
5
|
import { type AttributeConfiguration, AttributeDefinition } from "./attributes.js";
|
|
6
6
|
import type { Schema } from "./schema.js";
|
|
7
7
|
/**
|
|
8
|
-
* The FAST custom element registry
|
|
9
|
-
* @
|
|
8
|
+
* The FAST custom element registry.
|
|
9
|
+
* @remarks
|
|
10
|
+
* This registry stores FAST element definitions by constructor so consumers can
|
|
11
|
+
* look up the `FASTElementDefinition` associated with an element type or instance.
|
|
12
|
+
* @public
|
|
10
13
|
*/
|
|
11
14
|
export declare const fastElementRegistry: TypeRegistry<FASTElementDefinition>;
|
|
12
|
-
export type { TypeRegistry };
|
|
15
|
+
export type { TypeDefinition, TypeRegistry };
|
|
13
16
|
/**
|
|
14
17
|
* Shadow root initialization options.
|
|
15
18
|
* @public
|
|
@@ -45,22 +45,53 @@ export interface FASTElement extends HTMLElement {
|
|
|
45
45
|
*/
|
|
46
46
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
/**
|
|
49
|
+
* The FASTElement constructor and static registration helpers.
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export interface FASTElementConstructor {
|
|
53
|
+
/**
|
|
54
|
+
* Creates a FASTElement instance.
|
|
55
|
+
*/
|
|
56
|
+
new (): FASTElement;
|
|
57
|
+
/**
|
|
58
|
+
* Defines a platform custom element based on the provided type and definition.
|
|
59
|
+
* @param nameOrDef - The name of the element to define or a definition object.
|
|
60
|
+
* @param extensions - Optional callbacks to run before registration.
|
|
61
|
+
*/
|
|
62
|
+
define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition<TType>, extensions?: FASTElementExtension[]): Promise<TType>;
|
|
63
|
+
/**
|
|
64
|
+
* Defines a platform custom element based on the provided type and definition.
|
|
65
|
+
* @param type - The custom element type to define.
|
|
66
|
+
* @param nameOrDef - The name of the element to define or a definition object.
|
|
67
|
+
* @param extensions - Optional callbacks to run before registration.
|
|
68
|
+
*/
|
|
69
|
+
define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition<TType>, extensions?: FASTElementExtension[]): Promise<TType>;
|
|
70
|
+
/**
|
|
71
|
+
* Composes FASTElement metadata without registering the element.
|
|
72
|
+
* @param nameOrDef - The name of the element to compose or a definition object.
|
|
73
|
+
*/
|
|
74
|
+
compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition<TType>): Promise<FASTElementDefinition<TType>>;
|
|
75
|
+
/**
|
|
76
|
+
* Composes FASTElement metadata without registering the element.
|
|
77
|
+
* @param type - The custom element type to compose.
|
|
78
|
+
* @param nameOrDef - The name of the element to compose or a definition object.
|
|
79
|
+
*/
|
|
80
|
+
compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition<TType>): Promise<FASTElementDefinition<TType>>;
|
|
81
|
+
/**
|
|
82
|
+
* Creates a new FASTElement base class inherited from the provided base type.
|
|
83
|
+
* @param BaseType - The base element type to inherit from.
|
|
84
|
+
*/
|
|
85
|
+
from<TBase extends typeof HTMLElement>(BaseType: TBase): {
|
|
86
|
+
new (): InstanceType<TBase> & FASTElement;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
53
89
|
/**
|
|
54
90
|
* A minimal base class for FASTElements that also provides
|
|
55
91
|
* static helpers for working with FASTElements.
|
|
56
92
|
* @public
|
|
57
93
|
*/
|
|
58
|
-
export declare const FASTElement:
|
|
59
|
-
new (): FASTElement;
|
|
60
|
-
define: typeof define;
|
|
61
|
-
compose: typeof compose;
|
|
62
|
-
from: typeof from;
|
|
63
|
-
};
|
|
94
|
+
export declare const FASTElement: FASTElementConstructor;
|
|
64
95
|
/**
|
|
65
96
|
* Decorator: Defines a platform custom element based on `FASTElement`.
|
|
66
97
|
* @param nameOrDef - The name of the element to define or a definition object
|
|
@@ -68,4 +99,3 @@ export declare const FASTElement: {
|
|
|
68
99
|
* @public
|
|
69
100
|
*/
|
|
70
101
|
export declare function customElement(nameOrDef: string | PartialFASTElementDefinition): (type: Constructable<HTMLElement>) => void;
|
|
71
|
-
export {};
|
|
@@ -1,12 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Describes when FAST should stop hydrating newly connected prerendered elements.
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export declare const StopHydration: Readonly<{
|
|
6
|
+
/**
|
|
7
|
+
* Stop hydrating new prerendered elements after the active hydration batch completes.
|
|
8
|
+
*/
|
|
9
|
+
readonly hydrationComplete: "hydration-complete";
|
|
10
|
+
/**
|
|
11
|
+
* Keep the hydration hook active for later prerendered elements.
|
|
12
|
+
*/
|
|
13
|
+
readonly never: "never";
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Describes when FAST should stop hydrating newly connected prerendered elements.
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
export type StopHydration = (typeof StopHydration)[keyof typeof StopHydration];
|
|
20
|
+
import type { HydrationDebugger } from "../hydration/hydration-debugger.js";
|
|
21
|
+
/**
|
|
22
|
+
* Options for configuring global hydration lifecycle events and behavior.
|
|
3
23
|
* @public
|
|
4
24
|
*/
|
|
5
25
|
export interface HydrationOptions {
|
|
6
|
-
/** Called
|
|
26
|
+
/** Called when a prerendered hydration batch begins. */
|
|
7
27
|
hydrationStarted?(): void;
|
|
8
|
-
/** Called after all prerendered elements
|
|
28
|
+
/** Called after all prerendered elements in a hydration batch complete. */
|
|
9
29
|
hydrationComplete?(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Indicates when the hydration hook should stop handling new
|
|
32
|
+
* prerendered elements.
|
|
33
|
+
*
|
|
34
|
+
* @defaultValue StopHydration.hydrationComplete
|
|
35
|
+
*/
|
|
36
|
+
stopHydration?: StopHydration;
|
|
37
|
+
/**
|
|
38
|
+
* Optional opt-in debugger that swaps the default minimal hydration
|
|
39
|
+
* mismatch error message for a rich "Expected … / Received …" report
|
|
40
|
+
* including an HTML snippet of the SSR DOM and structured
|
|
41
|
+
* `expected`/`received` fields on `HydrationBindingError` /
|
|
42
|
+
* `HydrationTargetElementError`. Obtained via
|
|
43
|
+
* `hydrationDebugger()` from `@microsoft/fast-element/hydration.js`.
|
|
44
|
+
*/
|
|
45
|
+
debugger?: HydrationDebugger;
|
|
10
46
|
}
|
|
11
47
|
/**
|
|
12
48
|
* Tracks prerendered elements through the hydration lifecycle and
|
|
@@ -17,11 +53,18 @@ export interface HydrationOptions {
|
|
|
17
53
|
* @public
|
|
18
54
|
*/
|
|
19
55
|
export declare class HydrationTracker {
|
|
20
|
-
private options;
|
|
21
56
|
private elements;
|
|
22
57
|
private started;
|
|
58
|
+
private completed;
|
|
23
59
|
private checkTimer;
|
|
60
|
+
private callbacks;
|
|
61
|
+
private stopHydration;
|
|
24
62
|
constructor(options: HydrationOptions);
|
|
63
|
+
/**
|
|
64
|
+
* Indicates whether the hydration hook should attempt to hydrate
|
|
65
|
+
* prerendered elements.
|
|
66
|
+
*/
|
|
67
|
+
get shouldHydrate(): boolean;
|
|
25
68
|
/**
|
|
26
69
|
* Registers an element as pending hydration.
|
|
27
70
|
* Fires `hydrationStarted` on the first call.
|
|
@@ -8,6 +8,8 @@ import type { ElementViewTemplate, HydratableElementViewTemplate, HydratableSynt
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const HydrationMarkup: Readonly<{
|
|
10
10
|
attributeMarkerName: "data-fe";
|
|
11
|
+
legacyAttributeMarkerName: "data-fe-b";
|
|
12
|
+
legacyCompactAttributeMarkerName: "data-fe-c";
|
|
11
13
|
contentBindingStartMarker(): string;
|
|
12
14
|
contentBindingEndMarker(): string;
|
|
13
15
|
repeatStartMarker(): string;
|
|
@@ -28,6 +30,9 @@ export declare const HydrationMarkup: Readonly<{
|
|
|
28
30
|
* of attribute binding factories targeting this element.
|
|
29
31
|
*/
|
|
30
32
|
parseAttributeBindingCount(node: Element): number | null;
|
|
33
|
+
parseLegacyAttributeBindingIndices(node: Element): number[] | null;
|
|
34
|
+
removeLegacyAttributeBindingMarkers(node: Element): void;
|
|
35
|
+
parseLegacyContentBindingStartIndex(data: string): number | null;
|
|
31
36
|
}>;
|
|
32
37
|
/**
|
|
33
38
|
* @internal
|
package/dist/dts/context.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export declare const Context: Readonly<{
|
|
|
56
56
|
* @param name - The name to use for the connext. Useful in debugging.
|
|
57
57
|
* @param initialValue - An optional initial value to use if a context handler isn't found.
|
|
58
58
|
*/
|
|
59
|
-
create<
|
|
59
|
+
create<T = unknown>(name: string, initialValue?: T): FASTContext<T>;
|
|
60
60
|
/**
|
|
61
61
|
* Sets the strategy used by all FAST-specific context requests made through the
|
|
62
62
|
* Context.request, Context.get, Context.defineProperty, and ContextDecorator APIs.
|
|
@@ -73,7 +73,7 @@ export declare const Context: Readonly<{
|
|
|
73
73
|
* Uses the default request strategy to locate the context. If no context is found
|
|
74
74
|
* then the initial value of the context is returned.
|
|
75
75
|
*/
|
|
76
|
-
get<
|
|
76
|
+
get<T extends UnknownContext>(target: EventTarget, context: T): ContextType<T>;
|
|
77
77
|
/**
|
|
78
78
|
* Requests the context value for the target node.
|
|
79
79
|
* @param target - The target to request the context for.
|
|
@@ -84,7 +84,7 @@ export declare const Context: Readonly<{
|
|
|
84
84
|
* @remarks
|
|
85
85
|
* Uses the default request strategy to locate the context.
|
|
86
86
|
*/
|
|
87
|
-
request<
|
|
87
|
+
request<T extends UnknownContext>(target: EventTarget, context: T, callback: ContextCallback<ContextType<T>>, multiple?: boolean): void;
|
|
88
88
|
/**
|
|
89
89
|
*
|
|
90
90
|
* @param target - The target to dispatch the context event on.
|
|
@@ -96,14 +96,14 @@ export declare const Context: Readonly<{
|
|
|
96
96
|
* This API does NOT use the default request strategy. It always dispatches
|
|
97
97
|
* an event through the DOM.
|
|
98
98
|
*/
|
|
99
|
-
dispatch<
|
|
99
|
+
dispatch<T extends UnknownContext>(target: EventTarget, context: T, callback: ContextCallback<ContextType<T>>, multiple?: boolean): void;
|
|
100
100
|
/**
|
|
101
101
|
* Enables an event target to provide a context value.
|
|
102
102
|
* @param target - The target to provide the context value for.
|
|
103
103
|
* @param context - The context to provide the value for.
|
|
104
104
|
* @param value - The value to provide for the context.
|
|
105
105
|
*/
|
|
106
|
-
provide<
|
|
106
|
+
provide<T extends UnknownContext>(target: EventTarget, context: T, value: ContextType<T>): void;
|
|
107
107
|
/**
|
|
108
108
|
*
|
|
109
109
|
* @param target - The target on which to handle context requests.
|
|
@@ -113,7 +113,7 @@ export declare const Context: Readonly<{
|
|
|
113
113
|
* If a context is not provided then the callback will be invoked for all context
|
|
114
114
|
* requests that are received on the target.
|
|
115
115
|
*/
|
|
116
|
-
handle<
|
|
116
|
+
handle<T extends UnknownContext>(target: EventTarget, callback: (event: ContextEvent<T>) => void, context?: T): void;
|
|
117
117
|
/**
|
|
118
118
|
* Defines a getter-only property on the target that will return the context
|
|
119
119
|
* value for the target.
|
|
@@ -124,7 +124,7 @@ export declare const Context: Readonly<{
|
|
|
124
124
|
* Uses the default request strategy to locate the context and will return the
|
|
125
125
|
* initialValue if the context isn't handled.
|
|
126
126
|
*/
|
|
127
|
-
defineProperty<
|
|
127
|
+
defineProperty<T extends UnknownContext>(target: Constructable<EventTarget> | EventTarget, propertyName: string, context: T): void;
|
|
128
128
|
}>;
|
|
129
129
|
/**
|
|
130
130
|
* An unknown context type.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export type { AttributeConfiguration, AttributeDefinition, AttributeMode, ValueConverter, } from "../components/attributes.js";
|
|
2
2
|
export type { FASTElementDefinition, FASTElementExtension, FASTElementTemplateResolver, PartialFASTElementDefinition, ShadowRootOptions, TemplateLifecycleCallbacks, } from "../components/fast-definitions.js";
|
|
3
3
|
export { type AccessCachedPath, type CachedPath, type CachedPathCommon, type CachedPathMap, type ChildrenMap, type DefaultCachedPath, type EventCachedPath, type JSONSchema, type JSONSchemaCommon, type JSONSchemaDefinition, type RegisterPathConfig, type RepeatCachedPath, Schema, schemaRegistry, } from "../components/schema.js";
|
|
4
|
-
export type {
|
|
5
|
-
export type
|
|
4
|
+
export type { DOMAspect, DOMSink } from "../dom.js";
|
|
5
|
+
export { type DOMAspectGuards, type DOMElementGuards, type DOMGuards, DOMPolicy, type DOMPolicyOptions, type DOMSinkGuards, } from "../dom-policy.js";
|
|
6
|
+
export type { Constructable, TrustedTypesPolicy } from "../interfaces.js";
|
|
6
7
|
export type { Accessor } from "../observation/observable.js";
|
|
7
8
|
export type { ComposableStyles, ConstructibleStyleStrategy, ElementStyles, } from "../styles/element-styles.js";
|
|
8
9
|
export type { StyleStrategy, StyleTarget } from "../styles/style-strategy.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FASTElementTemplateResolver, TemplateLifecycleCallbacks } from "../components/fast-definitions.js";
|
|
2
|
+
import type { Constructable } from "../interfaces.js";
|
|
2
3
|
/**
|
|
3
4
|
* Returns a declarative template resolver that waits for the matching
|
|
4
5
|
* `<f-template>` element and resolves it into a concrete `ViewTemplate`.
|
|
@@ -6,4 +7,4 @@ import type { FASTElementTemplateResolver, TemplateLifecycleCallbacks } from "..
|
|
|
6
7
|
* @param callbacks - Optional per-element lifecycle callbacks.
|
|
7
8
|
* @public
|
|
8
9
|
*/
|
|
9
|
-
export declare function declarativeTemplate(callbacks?: TemplateLifecycleCallbacks): FASTElementTemplateResolver
|
|
10
|
+
export declare function declarativeTemplate<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(callbacks?: TemplateLifecycleCallbacks): FASTElementTemplateResolver<TType>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JSONSchema, type Schema } from "../components/schema.js";
|
|
2
|
-
import { eventArgAccessor, executionContextAccessor } from "./syntax.js";
|
|
2
|
+
import { attributeDirectivePrefix, clientSideCloseExpression, clientSideOpenExpression, closeExpression, eventArgAccessor, executionContextAccessor, openExpression } from "./syntax.js";
|
|
3
3
|
export { assignObservables, assignProxy, deepEqual, deepMerge, findDef, isPlainObject, } from "./observer-map-utilities.js";
|
|
4
4
|
/**
|
|
5
5
|
* Declarative behavior type.
|
|
@@ -99,7 +99,7 @@ export interface ChildrenMap {
|
|
|
99
99
|
* @public
|
|
100
100
|
*/
|
|
101
101
|
export declare const contextPrefixDot: string;
|
|
102
|
-
export { eventArgAccessor, executionContextAccessor };
|
|
102
|
+
export { attributeDirectivePrefix, clientSideCloseExpression, clientSideOpenExpression, closeExpression, eventArgAccessor, executionContextAccessor, openExpression, };
|
|
103
103
|
/**
|
|
104
104
|
* The type of a parsed event handler argument.
|
|
105
105
|
* @public
|
|
@@ -169,6 +169,8 @@ export type ComparisonOperator = (typeof ComparisonOperator)[keyof typeof Compar
|
|
|
169
169
|
* @public
|
|
170
170
|
*/
|
|
171
171
|
export declare const Operator: {
|
|
172
|
+
readonly AND: "&&";
|
|
173
|
+
readonly OR: "||";
|
|
172
174
|
readonly ACCESS: "access";
|
|
173
175
|
readonly EQUALS: "==";
|
|
174
176
|
readonly GREATER_THAN: ">";
|
|
@@ -177,8 +179,6 @@ export declare const Operator: {
|
|
|
177
179
|
readonly LESS_THAN_OR_EQUALS: "<=";
|
|
178
180
|
readonly NOT: "!";
|
|
179
181
|
readonly NOT_EQUALS: "!=";
|
|
180
|
-
readonly AND: "&&";
|
|
181
|
-
readonly OR: "||";
|
|
182
182
|
};
|
|
183
183
|
/**
|
|
184
184
|
* Declarative expression operator token.
|
|
@@ -281,6 +281,52 @@ export declare function getExpressionChain(value: string): ChainedExpression | v
|
|
|
281
281
|
* @public
|
|
282
282
|
*/
|
|
283
283
|
export declare function transformInnerHTML(innerHTML: string, index?: number): string;
|
|
284
|
+
/**
|
|
285
|
+
* Tag name of the HTML element whose contents are auto-escaped to render
|
|
286
|
+
* code samples literally. Inside this element FAST binding delimiters
|
|
287
|
+
* (`{{...}}`, `{{{...}}}`, `{...}`) are neutralised by replacing each
|
|
288
|
+
* `{` / `}` with the HTML numeric character reference `{` /
|
|
289
|
+
* `}` so the literal text is rendered instead of a binding.
|
|
290
|
+
*
|
|
291
|
+
* The escape behaviour is split between the server-side renderer
|
|
292
|
+
* (`escape_code_sample_elements` in `microsoft-fast-build`) and the
|
|
293
|
+
* client-side `<f-template>` parser (`escapeBracesInCodeElements`
|
|
294
|
+
* below):
|
|
295
|
+
*
|
|
296
|
+
* - Curly-brace escape runs in **both** server and client because
|
|
297
|
+
* `{` / `}` are decoded to literal `{` / `}` in the DOM
|
|
298
|
+
* and the `.innerHTML` serializer does not re-encode them — so the
|
|
299
|
+
* server-side escape would otherwise be undone on the client.
|
|
300
|
+
* - Angle brackets of FAST directive tags (`<f-when>`, `</f-when>`,
|
|
301
|
+
* `<f-repeat>`, `</f-repeat>`, case-insensitive) inside this element
|
|
302
|
+
* are escaped on the **server only**. The DOM serializer
|
|
303
|
+
* re-encodes `<` / `>` in text content automatically, so the client
|
|
304
|
+
* never sees raw directive tags inside `<code>` regardless of what
|
|
305
|
+
* the page source contained.
|
|
306
|
+
* - Real HTML elements (`<button>`) and custom elements (`<my-widget>`)
|
|
307
|
+
* inside this element keep their angle brackets and continue to
|
|
308
|
+
* render as live DOM elements; only the brace-binding syntax inside
|
|
309
|
+
* their text and attribute values is neutralised.
|
|
310
|
+
* @public
|
|
311
|
+
*/
|
|
312
|
+
export declare const codeElementName = "code";
|
|
313
|
+
/**
|
|
314
|
+
* Preprocess an HTML string by escaping FAST brace characters inside every
|
|
315
|
+
* `<code>` element. Mirrors part of the brace/angle-bracket escaping
|
|
316
|
+
* behaviour of Microsoft WebUI's `webui-press` markdown renderer so that
|
|
317
|
+
* example template snippets inside `<code>` render literally instead of
|
|
318
|
+
* being interpreted as bindings.
|
|
319
|
+
*
|
|
320
|
+
* Nested `<code>` elements are handled via depth tracking. The pass is
|
|
321
|
+
* idempotent because `{` / `}` inside an already-processed `<code>` have
|
|
322
|
+
* been replaced with entities, so a second pass finds nothing to escape.
|
|
323
|
+
*
|
|
324
|
+
* This is the client-side half of a two-stage escape — see the JSDoc on
|
|
325
|
+
* {@link codeElementName} for why only braces are handled here and
|
|
326
|
+
* `<` / `>` are exclusively handled on the server.
|
|
327
|
+
* @public
|
|
328
|
+
*/
|
|
329
|
+
export declare function escapeBracesInCodeElements(innerHTML: string): string;
|
|
284
330
|
/**
|
|
285
331
|
* Resolves boolean logic
|
|
286
332
|
* used for f-when and boolean attributes
|