@microsoft/fast-element 2.10.3 → 3.0.0-rc.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.
- package/ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md +1 -1
- package/ARCHITECTURE_OVERVIEW.md +2 -2
- package/CHANGELOG.json +31 -1
- package/CHANGELOG.md +10 -2
- package/DECLARATIVE_DESIGN.md +806 -0
- package/DECLARATIVE_HTML.md +470 -0
- package/DECLARATIVE_MIGRATION.md +215 -0
- package/DECLARATIVE_RENDERING.md +530 -0
- package/DECLARATIVE_RENDERING_LIFECYCLE.md +288 -0
- package/DECLARATIVE_SCHEMA_OBSERVER_MAP.md +489 -0
- package/DESIGN.md +143 -34
- package/MIGRATION.md +387 -0
- package/README.md +208 -1
- package/SIZES.md +25 -0
- package/api-extractor.arrays.json +15 -0
- package/api-extractor.context.json +1 -0
- package/api-extractor.declarative.json +15 -0
- package/api-extractor.di.json +1 -0
- package/api-extractor.hydration.json +15 -0
- package/api-extractor.styles.json +15 -0
- package/dist/arrays/arrays.api.json +2621 -0
- package/dist/context/context.api.json +1 -1
- package/dist/declarative/declarative.api.json +7844 -0
- package/dist/di/di.api.json +2 -2
- package/dist/dts/array-observer.d.ts +2 -0
- package/dist/dts/arrays.d.ts +2 -0
- package/dist/dts/attr.d.ts +1 -0
- package/dist/dts/binding/signal.d.ts +6 -6
- package/dist/dts/binding/two-way.d.ts +1 -0
- package/dist/dts/binding.d.ts +7 -0
- package/dist/dts/components/attributes.d.ts +2 -5
- package/dist/dts/components/definition-schema-transforms.d.ts +9 -0
- package/dist/dts/components/element-controller.d.ts +80 -114
- package/dist/dts/components/element-hydration.d.ts +1 -1
- package/dist/dts/components/enable-hydration.d.ts +34 -0
- package/dist/dts/components/fast-definitions.d.ts +91 -42
- package/dist/dts/components/fast-element.d.ts +5 -8
- package/dist/dts/components/hydration-tracker.d.ts +40 -0
- package/dist/dts/components/hydration.d.ts +18 -53
- package/dist/dts/components/schema.d.ts +205 -0
- package/dist/dts/context.d.ts +6 -6
- package/dist/dts/css.d.ts +3 -0
- package/dist/dts/debug.d.ts +5 -1
- package/dist/dts/declarative/attribute-map.d.ts +58 -0
- package/dist/dts/declarative/debug.d.ts +5 -0
- package/dist/dts/declarative/index.d.ts +13 -0
- package/dist/dts/declarative/interfaces.d.ts +9 -0
- package/dist/dts/declarative/observer-map-utilities.d.ts +58 -0
- package/dist/dts/declarative/observer-map.d.ts +89 -0
- package/dist/dts/declarative/runtime.d.ts +5 -0
- package/dist/dts/declarative/syntax.d.ts +21 -0
- package/dist/dts/declarative/template-bridge.d.ts +33 -0
- package/dist/dts/declarative/template-parser.d.ts +98 -0
- package/dist/dts/declarative/template.d.ts +9 -0
- package/dist/dts/declarative/utilities.d.ts +312 -0
- package/dist/dts/di/di.d.ts +1 -1
- package/dist/dts/directives/children.d.ts +2 -0
- package/dist/dts/directives/node-observation.d.ts +2 -0
- package/dist/dts/directives/ref.d.ts +2 -0
- package/dist/dts/directives/repeat.d.ts +4 -0
- package/dist/dts/directives/slotted.d.ts +2 -0
- package/dist/dts/directives/when.d.ts +3 -0
- package/dist/dts/dom-policy.d.ts +1 -1
- package/dist/dts/html.d.ts +5 -0
- package/dist/dts/hydration/runtime.d.ts +7 -0
- package/dist/dts/hydration/target-builder.d.ts +15 -12
- package/dist/dts/hydration.d.ts +14 -0
- package/dist/dts/index.d.ts +38 -42
- package/dist/dts/index.debug.d.ts +0 -1
- package/dist/dts/index.rollup.debug.d.ts +0 -1
- package/dist/dts/interfaces.d.ts +1 -49
- package/dist/dts/observable.d.ts +3 -6
- package/dist/dts/observation/arrays.d.ts +1 -1
- package/dist/dts/observation/update-queue.d.ts +1 -1
- package/dist/dts/platform.d.ts +25 -4
- package/dist/dts/render.d.ts +7 -0
- package/dist/dts/schema.d.ts +1 -0
- package/dist/dts/state/exports.d.ts +1 -1
- package/dist/dts/state/state.d.ts +2 -2
- package/dist/dts/styles/css-directive.d.ts +5 -12
- package/dist/dts/styles/css.d.ts +5 -7
- package/dist/dts/styles/element-styles.d.ts +0 -10
- package/dist/dts/styles.d.ts +6 -0
- package/dist/dts/templating/children.d.ts +1 -1
- package/dist/dts/templating/html-binding-directive.d.ts +10 -0
- package/dist/dts/templating/html-directive.d.ts +17 -0
- package/dist/dts/templating/hydration-view.d.ts +109 -0
- package/dist/dts/templating/ref.d.ts +1 -1
- package/dist/dts/templating/render.d.ts +8 -2
- package/dist/dts/templating/repeat.d.ts +2 -2
- package/dist/dts/templating/slotted.d.ts +1 -1
- package/dist/dts/templating/template.d.ts +17 -9
- package/dist/dts/templating/view.d.ts +25 -102
- package/dist/dts/templating/when.d.ts +1 -1
- package/dist/dts/templating.d.ts +10 -0
- package/dist/dts/testing/exports.d.ts +2 -2
- package/dist/dts/tsdoc-metadata.json +1 -1
- package/dist/dts/updates.d.ts +1 -0
- package/dist/dts/volatile.d.ts +2 -0
- package/dist/esm/array-observer.js +1 -0
- package/dist/esm/arrays.js +1 -0
- package/dist/esm/attr.js +1 -0
- package/dist/esm/binding/normalize.js +1 -1
- package/dist/esm/binding/signal.js +4 -4
- package/dist/esm/binding/two-way.js +2 -1
- package/dist/esm/binding.js +4 -0
- package/dist/esm/components/attributes.js +8 -5
- package/dist/esm/components/definition-schema-transforms.js +23 -0
- package/dist/esm/components/element-controller.js +200 -269
- package/dist/esm/components/element-hydration.js +1 -1
- package/dist/esm/components/enable-hydration.js +100 -0
- package/dist/esm/components/fast-definitions.js +211 -49
- package/dist/esm/components/fast-element.js +18 -27
- package/dist/esm/components/hydration-tracker.js +93 -0
- package/dist/esm/components/hydration.js +62 -144
- package/dist/esm/components/schema.js +253 -0
- package/dist/esm/context.js +6 -6
- package/dist/esm/css.js +3 -0
- package/dist/esm/debug.js +26 -26
- package/dist/esm/declarative/attribute-map.js +121 -0
- package/dist/esm/declarative/debug.js +5 -0
- package/dist/esm/declarative/index.js +3 -0
- package/dist/esm/declarative/interfaces.js +10 -0
- package/dist/esm/declarative/observer-map-utilities.js +562 -0
- package/dist/esm/declarative/observer-map.js +216 -0
- package/dist/esm/declarative/runtime.js +14 -0
- package/dist/esm/declarative/syntax.js +36 -0
- package/dist/esm/declarative/template-bridge.js +170 -0
- package/dist/esm/declarative/template-parser.js +306 -0
- package/dist/esm/declarative/template.js +142 -0
- package/dist/esm/declarative/utilities.js +834 -0
- package/dist/esm/di/di.js +6 -8
- package/dist/esm/directives/children.js +1 -0
- package/dist/esm/directives/node-observation.js +1 -0
- package/dist/esm/directives/ref.js +1 -0
- package/dist/esm/directives/repeat.js +1 -0
- package/dist/esm/directives/slotted.js +1 -0
- package/dist/esm/directives/when.js +1 -0
- package/dist/esm/dom-policy.js +2 -2
- package/dist/esm/dom.js +1 -1
- package/dist/esm/html.js +2 -0
- package/dist/esm/hydration/runtime.js +33 -0
- package/dist/esm/hydration/target-builder.js +97 -90
- package/dist/esm/hydration.js +4 -0
- package/dist/esm/index.debug.js +2 -1
- package/dist/esm/index.js +34 -29
- package/dist/esm/index.rollup.debug.js +3 -2
- package/dist/esm/index.rollup.js +1 -1
- package/dist/esm/interfaces.js +1 -45
- package/dist/esm/observable.js +1 -4
- package/dist/esm/observation/arrays.js +1 -1
- package/dist/esm/observation/observable.js +5 -5
- package/dist/esm/observation/update-queue.js +47 -58
- package/dist/esm/platform.js +31 -30
- package/dist/esm/render.js +1 -0
- package/dist/esm/schema.js +1 -0
- package/dist/esm/state/exports.js +1 -1
- package/dist/esm/styles/css-directive.js +1 -2
- package/dist/esm/styles/css.js +15 -56
- package/dist/esm/styles/element-styles.js +69 -15
- package/dist/esm/styles.js +2 -0
- package/dist/esm/templating/html-binding-directive.js +24 -10
- package/dist/esm/templating/hydration-view.js +235 -0
- package/dist/esm/templating/render.js +13 -2
- package/dist/esm/templating/repeat.js +36 -34
- package/dist/esm/templating/template.js +7 -7
- package/dist/esm/templating/view.js +24 -233
- package/dist/esm/templating.js +7 -0
- package/dist/esm/testing/exports.js +2 -2
- package/dist/esm/updates.js +1 -0
- package/dist/esm/volatile.js +1 -0
- package/dist/fast-element.api.json +9017 -6996
- package/dist/fast-element.d.ts +3557 -796
- package/dist/fast-element.debug.js +5093 -4419
- package/dist/fast-element.debug.min.js +2 -2
- package/dist/fast-element.js +5398 -4655
- package/dist/fast-element.min.js +2 -2
- package/dist/fast-element.untrimmed.d.ts +881 -481
- package/dist/hydration/hydration.api.json +5237 -0
- package/dist/styles/styles.api.json +2672 -0
- package/docs/api-report.api.md +344 -167
- package/docs/arrays/api-report.api.md +114 -0
- package/docs/declarative/api-report.api.md +397 -0
- package/docs/hydration/api-report.api.md +285 -0
- package/docs/styles/api-report.api.md +135 -0
- package/package.json +149 -40
- package/playwright.declarative.config.ts +26 -0
- package/playwright.declarative.webui.config.ts +20 -0
- package/scripts/declarative/build-fixtures-with-webui.js +135 -0
- package/scripts/declarative/build-fixtures.js +49 -0
- package/scripts/declarative/build-fixtures.utilities.js +101 -0
- package/scripts/measure-sizes.js +219 -0
- package/scripts/run-api-extractor.js +39 -20
- package/test/declarative/fixtures/README.md +72 -0
- package/test/declarative/fixtures/WRITING_FIXTURES.md +330 -0
- package/test/declarative/fixtures/bindings/README.md +12 -0
- package/test/declarative/fixtures/bindings/attribute/entry.html +13 -0
- package/test/declarative/fixtures/bindings/attribute/fast-build.config.json +6 -0
- package/test/declarative/fixtures/bindings/attribute/index.html +25 -0
- package/test/declarative/fixtures/bindings/attribute/main.ts +41 -0
- package/test/declarative/fixtures/bindings/attribute/state.json +8 -0
- package/test/declarative/fixtures/bindings/attribute/templates.html +11 -0
- package/test/declarative/fixtures/bindings/content/entry.html +12 -0
- package/test/declarative/fixtures/bindings/content/fast-build.config.json +6 -0
- package/test/declarative/fixtures/bindings/content/index.html +19 -0
- package/test/declarative/fixtures/bindings/content/main.ts +27 -0
- package/test/declarative/fixtures/bindings/content/state.json +4 -0
- package/test/declarative/fixtures/bindings/content/templates.html +6 -0
- package/test/declarative/fixtures/bindings/dot-syntax/entry.html +11 -0
- package/test/declarative/fixtures/bindings/dot-syntax/fast-build.config.json +6 -0
- package/test/declarative/fixtures/bindings/dot-syntax/index.html +47 -0
- package/test/declarative/fixtures/bindings/dot-syntax/main.ts +59 -0
- package/test/declarative/fixtures/bindings/dot-syntax/state.json +16 -0
- package/test/declarative/fixtures/bindings/dot-syntax/templates.html +17 -0
- package/test/declarative/fixtures/bindings/event/entry.html +11 -0
- package/test/declarative/fixtures/bindings/event/fast-build.config.json +6 -0
- package/test/declarative/fixtures/bindings/event/index.html +43 -0
- package/test/declarative/fixtures/bindings/event/main.ts +43 -0
- package/test/declarative/fixtures/bindings/event/state.json +3 -0
- package/test/declarative/fixtures/bindings/event/templates.html +18 -0
- package/test/declarative/fixtures/bindings/host/entry.html +40 -0
- package/test/declarative/fixtures/bindings/host/fast-build.config.json +6 -0
- package/test/declarative/fixtures/bindings/host/index.html +96 -0
- package/test/declarative/fixtures/bindings/host/main.ts +222 -0
- package/test/declarative/fixtures/bindings/host/state.json +9 -0
- package/test/declarative/fixtures/bindings/host/templates.html +55 -0
- package/test/declarative/fixtures/directives/README.md +12 -0
- package/test/declarative/fixtures/directives/children/entry.html +11 -0
- package/test/declarative/fixtures/directives/children/fast-build.config.json +6 -0
- package/test/declarative/fixtures/directives/children/index.html +15 -0
- package/test/declarative/fixtures/directives/children/main.ts +22 -0
- package/test/declarative/fixtures/directives/children/state.json +3 -0
- package/test/declarative/fixtures/directives/children/templates.html +3 -0
- package/test/declarative/fixtures/directives/ref/entry.html +11 -0
- package/test/declarative/fixtures/directives/ref/fast-build.config.json +6 -0
- package/test/declarative/fixtures/directives/ref/index.html +15 -0
- package/test/declarative/fixtures/directives/ref/main.ts +17 -0
- package/test/declarative/fixtures/directives/ref/state.json +1 -0
- package/test/declarative/fixtures/directives/ref/templates.html +3 -0
- package/test/declarative/fixtures/directives/repeat/entry.html +21 -0
- package/test/declarative/fixtures/directives/repeat/fast-build.config.json +6 -0
- package/test/declarative/fixtures/directives/repeat/index.html +133 -0
- package/test/declarative/fixtures/directives/repeat/main.ts +110 -0
- package/test/declarative/fixtures/directives/repeat/sprites.svg +8 -0
- package/test/declarative/fixtures/directives/repeat/state.json +10 -0
- package/test/declarative/fixtures/directives/repeat/templates.html +75 -0
- package/test/declarative/fixtures/directives/slotted/entry.html +17 -0
- package/test/declarative/fixtures/directives/slotted/fast-build.config.json +6 -0
- package/test/declarative/fixtures/directives/slotted/index.html +27 -0
- package/test/declarative/fixtures/directives/slotted/main.ts +29 -0
- package/test/declarative/fixtures/directives/slotted/state.json +1 -0
- package/test/declarative/fixtures/directives/slotted/templates.html +7 -0
- package/test/declarative/fixtures/directives/when/entry.html +51 -0
- package/test/declarative/fixtures/directives/when/fast-build.config.json +6 -0
- package/test/declarative/fixtures/directives/when/index.html +136 -0
- package/test/declarative/fixtures/directives/when/main.ts +172 -0
- package/test/declarative/fixtures/directives/when/state.json +12 -0
- package/test/declarative/fixtures/directives/when/templates.html +75 -0
- package/test/declarative/fixtures/ecosystem/README.md +11 -0
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/entry.html +12 -0
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/fast-build.config.json +6 -0
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/index.html +20 -0
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/main.ts +68 -0
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/state.json +4 -0
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/templates.html +7 -0
- package/test/declarative/fixtures/ecosystem/errors/entry.html +12 -0
- package/test/declarative/fixtures/ecosystem/errors/fast-build.config.json +6 -0
- package/test/declarative/fixtures/ecosystem/errors/index.html +20 -0
- package/test/declarative/fixtures/ecosystem/errors/main.ts +17 -0
- package/test/declarative/fixtures/ecosystem/errors/state.json +1 -0
- package/test/declarative/fixtures/ecosystem/errors/templates.html +7 -0
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/entry.html +17 -0
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/fast-build.config.json +6 -0
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/index.html +56 -0
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/main.ts +134 -0
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/state.json +12 -0
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/templates.html +34 -0
- package/test/declarative/fixtures/ecosystem/performance-metrics/entry.html +25 -0
- package/test/declarative/fixtures/ecosystem/performance-metrics/fast-build.config.json +6 -0
- package/test/declarative/fixtures/ecosystem/performance-metrics/fast-card.css +10 -0
- package/test/declarative/fixtures/ecosystem/performance-metrics/index.html +181 -0
- package/test/declarative/fixtures/ecosystem/performance-metrics/main.ts +58 -0
- package/test/declarative/fixtures/ecosystem/performance-metrics/state.json +6 -0
- package/test/declarative/fixtures/ecosystem/performance-metrics/templates.html +15 -0
- package/test/declarative/fixtures/extensions/README.md +15 -0
- package/test/declarative/fixtures/extensions/attribute-map/entry.html +14 -0
- package/test/declarative/fixtures/extensions/attribute-map/fast-build.config.json +6 -0
- package/test/declarative/fixtures/extensions/attribute-map/index.html +31 -0
- package/test/declarative/fixtures/extensions/attribute-map/main.ts +40 -0
- package/test/declarative/fixtures/extensions/attribute-map/state.json +4 -0
- package/test/declarative/fixtures/extensions/attribute-map/templates.html +14 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/entry.html +12 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/fast-build.config.json +7 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/index.html +25 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/main.ts +31 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/state.json +5 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/templates.html +11 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/entry.html +13 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/fast-build.config.json +7 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/index.html +23 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/main.ts +37 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/state.json +1 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/templates.html +9 -0
- package/test/declarative/fixtures/extensions/observer-map/entry.html +15 -0
- package/test/declarative/fixtures/extensions/observer-map/fast-build.config.json +6 -0
- package/test/declarative/fixtures/extensions/observer-map/index.html +442 -0
- package/test/declarative/fixtures/extensions/observer-map/main.ts +482 -0
- package/test/declarative/fixtures/extensions/observer-map/state.json +158 -0
- package/test/declarative/fixtures/extensions/observer-map/templates.html +172 -0
- package/test/declarative/fixtures/extensions/observer-map-config-object/entry.html +16 -0
- package/test/declarative/fixtures/extensions/observer-map-config-object/fast-build.config.json +6 -0
- package/test/declarative/fixtures/extensions/observer-map-config-object/index.html +27 -0
- package/test/declarative/fixtures/extensions/observer-map-config-object/main.ts +53 -0
- package/test/declarative/fixtures/extensions/observer-map-config-object/state.json +9 -0
- package/test/declarative/fixtures/extensions/observer-map-config-object/templates.html +12 -0
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/README.md +98 -0
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/entry.html +156 -0
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/fast-build.config.json +6 -0
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/index.html +376 -0
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/main.ts +366 -0
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/state.json +69 -0
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/templates.html +91 -0
- package/test/declarative/fixtures/extensions/observer-map-properties/entry.html +14 -0
- package/test/declarative/fixtures/extensions/observer-map-properties/fast-build.config.json +6 -0
- package/test/declarative/fixtures/extensions/observer-map-properties/index.html +110 -0
- package/test/declarative/fixtures/extensions/observer-map-properties/main.ts +175 -0
- package/test/declarative/fixtures/extensions/observer-map-properties/state.json +29 -0
- package/test/declarative/fixtures/extensions/observer-map-properties/templates.html +55 -0
- package/test/declarative/fixtures/scenarios/README.md +7 -0
- package/test/declarative/fixtures/scenarios/nested-elements/entry.html +16 -0
- package/test/declarative/fixtures/scenarios/nested-elements/fast-build.config.json +6 -0
- package/test/declarative/fixtures/scenarios/nested-elements/index.html +126 -0
- package/test/declarative/fixtures/scenarios/nested-elements/main.ts +214 -0
- package/test/declarative/fixtures/scenarios/nested-elements/state.json +10 -0
- package/test/declarative/fixtures/scenarios/nested-elements/templates.html +54 -0
- package/test/declarative/index.html +12 -0
- package/test/declarative/vite.config.ts +55 -0
- package/test/declarative-main.ts +6 -0
- package/test/extension-subpaths-main.ts +9 -0
- package/test/main.ts +38 -33
- package/test/pure-declarative-main.ts +1 -0
- package/dist/dts/components/install-hydration.d.ts +0 -1
- package/dist/dts/pending-task.d.ts +0 -32
- package/dist/dts/polyfills.d.ts +0 -0
- package/dist/dts/styles/css-binding-directive.d.ts +0 -60
- package/dist/dts/templating/install-hydratable-view-templates.d.ts +0 -1
- package/dist/esm/components/install-hydration.js +0 -3
- package/dist/esm/pending-task.js +0 -28
- package/dist/esm/polyfills.js +0 -60
- package/dist/esm/styles/css-binding-directive.js +0 -76
- package/dist/esm/templating/install-hydratable-view-templates.js +0 -23
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { FASTElementDefinition } from "../components/fast-definitions.js";
|
|
2
|
+
import type { ElementViewTemplate } from "../templating/template.js";
|
|
3
|
+
/**
|
|
4
|
+
* Publishes a concrete template for a definition.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export interface TemplatePublisher {
|
|
8
|
+
publishTemplate(definition: FASTElementDefinition): ElementViewTemplate | Promise<ElementViewTemplate>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Coordinates declarative template publishers and FAST element definitions.
|
|
12
|
+
* Requests are keyed by registry + element name so scoped registries can
|
|
13
|
+
* resolve templates independently.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare class DeclarativeTemplateBridge {
|
|
17
|
+
private readonly buckets;
|
|
18
|
+
requestTemplate(definition: FASTElementDefinition): Promise<ElementViewTemplate>;
|
|
19
|
+
registerPublisher(registry: CustomElementRegistry, name: string | undefined, publisher: TemplatePublisher): void;
|
|
20
|
+
unregisterPublisher(registry: CustomElementRegistry, name: string | undefined, publisher: TemplatePublisher): void;
|
|
21
|
+
movePublisher(registry: CustomElementRegistry, previousName: string | undefined, nextName: string | undefined, publisher: TemplatePublisher): void;
|
|
22
|
+
private getBucket;
|
|
23
|
+
private processBucket;
|
|
24
|
+
private resetPublisherRequests;
|
|
25
|
+
private resolveRequest;
|
|
26
|
+
private rejectRequest;
|
|
27
|
+
private cleanupBucket;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Shared template bridge storage for the current FAST runtime.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export declare const declarativeTemplateBridge: DeclarativeTemplateBridge;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { Schema } from "../components/schema.js";
|
|
2
|
+
import { ViewTemplate } from "../templating/template.js";
|
|
3
|
+
/**
|
|
4
|
+
* The return type for {@link TemplateParser.parse}.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface ResolvedStringsAndValues {
|
|
8
|
+
strings: Array<string>;
|
|
9
|
+
values: Array<any>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Converts declarative HTML template markup into the `strings` and `values`
|
|
13
|
+
* arrays that `ViewTemplate.create()` consumes.
|
|
14
|
+
*
|
|
15
|
+
* This class is intentionally stateless across invocations — all mutable
|
|
16
|
+
* parsing state lives on the call stack or in the `TemplateResolutionContext`.
|
|
17
|
+
*
|
|
18
|
+
* The parsing pipeline is fully synchronous — no promises are allocated
|
|
19
|
+
* during template resolution.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare class TemplateParser {
|
|
23
|
+
/**
|
|
24
|
+
* Parse declarative HTML into strings and values for ViewTemplate creation.
|
|
25
|
+
* @param innerHTML - The transformed innerHTML to parse.
|
|
26
|
+
* @param schema - The Schema instance for property tracking.
|
|
27
|
+
* @returns The resolved strings and values.
|
|
28
|
+
*/
|
|
29
|
+
parse(innerHTML: string, schema: Schema): ResolvedStringsAndValues;
|
|
30
|
+
/**
|
|
31
|
+
* Create a ViewTemplate from resolved strings and values.
|
|
32
|
+
* @param strings - The strings array.
|
|
33
|
+
* @param values - The interpreted values.
|
|
34
|
+
*/
|
|
35
|
+
createTemplate(strings: Array<string>, values: Array<any>): ViewTemplate<any, any>;
|
|
36
|
+
/**
|
|
37
|
+
* Resolve strings and values from an innerHTML string.
|
|
38
|
+
* @param rootPropertyName - The root property name for schema registration.
|
|
39
|
+
* @param innerHTML - The innerHTML.
|
|
40
|
+
* @param context - The template resolution context.
|
|
41
|
+
*/
|
|
42
|
+
private resolveStringsAndValues;
|
|
43
|
+
/**
|
|
44
|
+
* Resolve a template directive (when/repeat).
|
|
45
|
+
* @param rootPropertyName - The root property name for schema registration.
|
|
46
|
+
* @param behaviorConfig - The directive behavior configuration object.
|
|
47
|
+
* @param externalValues - The interpreted values from the parent.
|
|
48
|
+
* @param innerHTML - The innerHTML.
|
|
49
|
+
* @param context - The template resolution context.
|
|
50
|
+
*/
|
|
51
|
+
private resolveTemplateDirective;
|
|
52
|
+
/**
|
|
53
|
+
* Resolve an attribute directive (children/slotted/ref).
|
|
54
|
+
* @param name - The name of the directive.
|
|
55
|
+
* @param propName - The property name to pass to the directive.
|
|
56
|
+
* @param externalValues - The interpreted values from the parent.
|
|
57
|
+
*/
|
|
58
|
+
private resolveAttributeDirective;
|
|
59
|
+
/**
|
|
60
|
+
* Resolve an access binding — shared by content bindings, boolean-attribute
|
|
61
|
+
* fallback, and default attribute bindings.
|
|
62
|
+
* @returns An object with the resolved binding function and the updated rootPropertyName.
|
|
63
|
+
*/
|
|
64
|
+
private resolveAccessBinding;
|
|
65
|
+
/**
|
|
66
|
+
* Resolve an event binding (the "\@" aspect).
|
|
67
|
+
* @returns An object with the event binding function and the updated rootPropertyName.
|
|
68
|
+
*/
|
|
69
|
+
private resolveEventBinding;
|
|
70
|
+
/**
|
|
71
|
+
* Resolve a content data binding (`{{expression}}` in text content).
|
|
72
|
+
*/
|
|
73
|
+
private resolveContentBinding;
|
|
74
|
+
/**
|
|
75
|
+
* Resolve an attribute data binding (`{{expression}}` in an HTML attribute).
|
|
76
|
+
* Dispatches to event, expression, or access binding handlers based on aspect.
|
|
77
|
+
*/
|
|
78
|
+
private resolveAttributeBinding;
|
|
79
|
+
/**
|
|
80
|
+
* Resolve an attribute directive binding (`f-children`, `f-slotted`, `f-ref`).
|
|
81
|
+
*/
|
|
82
|
+
private resolveAttributeDirectiveBinding;
|
|
83
|
+
/**
|
|
84
|
+
* Dispatcher for data binding resolution. Routes to the appropriate handler
|
|
85
|
+
* based on the binding subtype.
|
|
86
|
+
*/
|
|
87
|
+
private resolveDataBinding;
|
|
88
|
+
/**
|
|
89
|
+
* Resolver of the innerHTML string. Finds the next binding or directive
|
|
90
|
+
* in the HTML and dispatches to the appropriate handler.
|
|
91
|
+
* @param rootPropertyName - The root property name for schema registration.
|
|
92
|
+
* @param innerHTML - The innerHTML to parse.
|
|
93
|
+
* @param strings - Accumulator for literal HTML segments and running previous-string.
|
|
94
|
+
* @param values - The values array (accumulates binding functions and directives).
|
|
95
|
+
* @param context - The template resolution context.
|
|
96
|
+
*/
|
|
97
|
+
private resolveInnerHTML;
|
|
98
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FASTElementTemplateResolver, TemplateLifecycleCallbacks } from "../components/fast-definitions.js";
|
|
2
|
+
/**
|
|
3
|
+
* Returns a declarative template resolver that waits for the matching
|
|
4
|
+
* `<f-template>` element and resolves it into a concrete `ViewTemplate`.
|
|
5
|
+
*
|
|
6
|
+
* @param callbacks - Optional per-element lifecycle callbacks.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export declare function declarativeTemplate(callbacks?: TemplateLifecycleCallbacks): FASTElementTemplateResolver;
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { type JSONSchema, type Schema } from "../components/schema.js";
|
|
2
|
+
import { eventArgAccessor, executionContextAccessor } from "./syntax.js";
|
|
3
|
+
export { assignObservables, assignProxy, deepEqual, deepMerge, findDef, isPlainObject, } from "./observer-map-utilities.js";
|
|
4
|
+
/**
|
|
5
|
+
* Declarative behavior type.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export type BehaviorType = "dataBinding" | "templateDirective";
|
|
9
|
+
/**
|
|
10
|
+
* Declarative attribute directive names.
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export type AttributeDirective = "children" | "slotted" | "ref";
|
|
14
|
+
/**
|
|
15
|
+
* Declarative data binding marker type.
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export type DataBindingBindingType = "client" | "default" | "unescaped";
|
|
19
|
+
/**
|
|
20
|
+
* Base behavior configuration.
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export interface BehaviorConfig {
|
|
24
|
+
type: BehaviorType;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Declarative schema path type.
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export type PathType = "access" | "default" | "event" | "repeat";
|
|
31
|
+
/**
|
|
32
|
+
* Content binding behavior configuration.
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export interface ContentDataBindingBehaviorConfig extends BaseDataBindingBehaviorConfig {
|
|
36
|
+
subtype: "content";
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Attribute binding behavior configuration.
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
export interface AttributeDataBindingBehaviorConfig extends BaseDataBindingBehaviorConfig {
|
|
43
|
+
subtype: "attribute";
|
|
44
|
+
aspect: "@" | ":" | "?" | null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Attribute directive binding behavior configuration.
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
export interface AttributeDirectiveBindingBehaviorConfig extends BaseDataBindingBehaviorConfig {
|
|
51
|
+
subtype: "attributeDirective";
|
|
52
|
+
name: AttributeDirective;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Declarative data binding behavior configuration.
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
export type DataBindingBehaviorConfig = ContentDataBindingBehaviorConfig | AttributeDataBindingBehaviorConfig | AttributeDirectiveBindingBehaviorConfig;
|
|
59
|
+
/**
|
|
60
|
+
* Base data binding behavior configuration.
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
export interface BaseDataBindingBehaviorConfig extends BehaviorConfig {
|
|
64
|
+
type: "dataBinding";
|
|
65
|
+
bindingType: DataBindingBindingType;
|
|
66
|
+
openingStartIndex: number;
|
|
67
|
+
openingEndIndex: number;
|
|
68
|
+
closingStartIndex: number;
|
|
69
|
+
closingEndIndex: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Declarative template directive names.
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
export type TemplateDirective = "when" | "repeat";
|
|
76
|
+
/**
|
|
77
|
+
* Template directive behavior configuration.
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
export interface TemplateDirectiveBehaviorConfig extends BehaviorConfig {
|
|
81
|
+
type: "templateDirective";
|
|
82
|
+
name: TemplateDirective;
|
|
83
|
+
value: string;
|
|
84
|
+
openingTagStartIndex: number;
|
|
85
|
+
openingTagEndIndex: number;
|
|
86
|
+
closingTagStartIndex: number;
|
|
87
|
+
closingTagEndIndex: number;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Map between child component attribute references and custom element names.
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
93
|
+
export interface ChildrenMap {
|
|
94
|
+
customElementName: string;
|
|
95
|
+
attributeName: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Prefix used for execution context paths.
|
|
99
|
+
* @public
|
|
100
|
+
*/
|
|
101
|
+
export declare const contextPrefixDot: string;
|
|
102
|
+
export { eventArgAccessor, executionContextAccessor };
|
|
103
|
+
/**
|
|
104
|
+
* The type of a parsed event handler argument.
|
|
105
|
+
* @public
|
|
106
|
+
*/
|
|
107
|
+
export type EventArgType = "event" | "context" | "binding";
|
|
108
|
+
/**
|
|
109
|
+
* A parsed event handler argument descriptor.
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
export interface ParsedEventArg {
|
|
113
|
+
type: EventArgType;
|
|
114
|
+
/** The raw argument string, present only when `type` is `"binding"`. */
|
|
115
|
+
rawArg?: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Parses the arguments string of an event handler binding into an array of
|
|
119
|
+
* typed argument descriptors. Unrecognised tokens are returned as `"binding"`
|
|
120
|
+
* type with their raw string preserved.
|
|
121
|
+
*
|
|
122
|
+
* Special arguments:
|
|
123
|
+
* - `$e` — resolves to the DOM event object
|
|
124
|
+
* - `$c` — resolves to the full execution context object
|
|
125
|
+
*
|
|
126
|
+
* Any other token is treated as a binding path and resolved against the current
|
|
127
|
+
* data source.
|
|
128
|
+
*
|
|
129
|
+
* @param argsString - The raw arguments string from between the parentheses,
|
|
130
|
+
* e.g. `""`, `"$e"`, `"$c"`, or `"$e, $c"`.
|
|
131
|
+
* @returns An array of {@link ParsedEventArg} descriptors.
|
|
132
|
+
* @public
|
|
133
|
+
*/
|
|
134
|
+
export declare function parseEventArgs(argsString: string): ParsedEventArg[];
|
|
135
|
+
/**
|
|
136
|
+
* Logical operator tokens.
|
|
137
|
+
* @public
|
|
138
|
+
*/
|
|
139
|
+
export declare const LogicalOperator: {
|
|
140
|
+
readonly AND: "&&";
|
|
141
|
+
readonly OR: "||";
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Logical operator token.
|
|
145
|
+
* @public
|
|
146
|
+
*/
|
|
147
|
+
export type LogicalOperator = (typeof LogicalOperator)[keyof typeof LogicalOperator];
|
|
148
|
+
/**
|
|
149
|
+
* Comparison operator tokens.
|
|
150
|
+
* @public
|
|
151
|
+
*/
|
|
152
|
+
export declare const ComparisonOperator: {
|
|
153
|
+
readonly ACCESS: "access";
|
|
154
|
+
readonly EQUALS: "==";
|
|
155
|
+
readonly GREATER_THAN: ">";
|
|
156
|
+
readonly GREATER_THAN_OR_EQUALS: ">=";
|
|
157
|
+
readonly LESS_THAN: "<";
|
|
158
|
+
readonly LESS_THAN_OR_EQUALS: "<=";
|
|
159
|
+
readonly NOT: "!";
|
|
160
|
+
readonly NOT_EQUALS: "!=";
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Comparison operator token.
|
|
164
|
+
* @public
|
|
165
|
+
*/
|
|
166
|
+
export type ComparisonOperator = (typeof ComparisonOperator)[keyof typeof ComparisonOperator];
|
|
167
|
+
/**
|
|
168
|
+
* Declarative expression operator tokens.
|
|
169
|
+
* @public
|
|
170
|
+
*/
|
|
171
|
+
export declare const Operator: {
|
|
172
|
+
readonly ACCESS: "access";
|
|
173
|
+
readonly EQUALS: "==";
|
|
174
|
+
readonly GREATER_THAN: ">";
|
|
175
|
+
readonly GREATER_THAN_OR_EQUALS: ">=";
|
|
176
|
+
readonly LESS_THAN: "<";
|
|
177
|
+
readonly LESS_THAN_OR_EQUALS: "<=";
|
|
178
|
+
readonly NOT: "!";
|
|
179
|
+
readonly NOT_EQUALS: "!=";
|
|
180
|
+
readonly AND: "&&";
|
|
181
|
+
readonly OR: "||";
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Declarative expression operator token.
|
|
185
|
+
* @public
|
|
186
|
+
*/
|
|
187
|
+
export type Operator = (typeof Operator)[keyof typeof Operator];
|
|
188
|
+
/**
|
|
189
|
+
* Get the index of the next matching tag
|
|
190
|
+
* @param openingTagStartSlice - The slice starting from the opening tag
|
|
191
|
+
* @param openingTag - The opening tag string
|
|
192
|
+
* @param closingTag - The closing tag
|
|
193
|
+
* @param openingTagStartIndex - The opening tag start index derived from the innerHTML
|
|
194
|
+
* @returns index
|
|
195
|
+
* @public
|
|
196
|
+
*/
|
|
197
|
+
export declare function getIndexOfNextMatchingTag(openingTagStartSlice: string, openingTag: string, closingTag: string, openingTagStartIndex: number): number;
|
|
198
|
+
/**
|
|
199
|
+
* Get the next behavior
|
|
200
|
+
* @param innerHTML - The innerHTML string to evaluate
|
|
201
|
+
* @param offset - The current offset in the original string.
|
|
202
|
+
* @returns DataBindingBehaviorConfig | DirectiveBehaviorConfig | null - A configuration object or null
|
|
203
|
+
* @public
|
|
204
|
+
*/
|
|
205
|
+
export declare function getNextBehavior(innerHTML: string, offset?: number): DataBindingBehaviorConfig | TemplateDirectiveBehaviorConfig | null;
|
|
206
|
+
/**
|
|
207
|
+
* Create a function to resolve a value from an object using a path with dot syntax.
|
|
208
|
+
* e.g. "foo.bar"
|
|
209
|
+
* @param path - The dot syntax path to an objects property.
|
|
210
|
+
* @param contextPath - The current repeat context path.
|
|
211
|
+
* @param level - The current repeat nesting level.
|
|
212
|
+
* @param rootSchema - The root schema for resolving context paths.
|
|
213
|
+
* @returns A function to access the value from a given path.
|
|
214
|
+
* @public
|
|
215
|
+
*/
|
|
216
|
+
export declare function pathResolver(path: string, contextPath: string | null, level: number, rootSchema: JSONSchema): (accessibleObject: any, context: any) => any;
|
|
217
|
+
/**
|
|
218
|
+
* Creates a binding resolver and records the binding path in the schema.
|
|
219
|
+
* @param previousString - The previous literal string before the binding.
|
|
220
|
+
* @param rootPropertyName - The current root property name.
|
|
221
|
+
* @param path - The binding path to resolve.
|
|
222
|
+
* @param parentContext - The parent repeat context.
|
|
223
|
+
* @param type - The schema path type.
|
|
224
|
+
* @param schema - The schema to record paths in.
|
|
225
|
+
* @param currentContext - The current repeat context.
|
|
226
|
+
* @param level - The current repeat nesting level.
|
|
227
|
+
* @returns A function that resolves the binding path.
|
|
228
|
+
* @public
|
|
229
|
+
*/
|
|
230
|
+
export declare function bindingResolver(previousString: string | null, rootPropertyName: string | null, path: string, parentContext: string | null, type: PathType, schema: Schema, currentContext: string | null, level: number): (accessibleObject: any, context: any) => any;
|
|
231
|
+
/**
|
|
232
|
+
* Creates a resolver for a chained expression and records its paths in the schema.
|
|
233
|
+
* @param rootPropertyName - The current root property name.
|
|
234
|
+
* @param expression - The expression to resolve.
|
|
235
|
+
* @param parentContext - The parent repeat context.
|
|
236
|
+
* @param level - The current repeat nesting level.
|
|
237
|
+
* @param schema - The schema to record paths in.
|
|
238
|
+
* @returns A function that resolves the expression.
|
|
239
|
+
* @public
|
|
240
|
+
*/
|
|
241
|
+
export declare function expressionResolver(rootPropertyName: string | null, expression: ChainedExpression, parentContext: string | null, level: number, schema: Schema): (accessibleObject: any, context: any) => any;
|
|
242
|
+
/**
|
|
243
|
+
* Extracts all paths from a ChainedExpression, including nested expressions
|
|
244
|
+
* @param chainedExpression - The chained expression to extract paths from
|
|
245
|
+
* @returns A Set containing all unique paths found in the expression chain
|
|
246
|
+
* @public
|
|
247
|
+
*/
|
|
248
|
+
export declare function extractPathsFromChainedExpression(chainedExpression: ChainedExpression): Set<string>;
|
|
249
|
+
/**
|
|
250
|
+
* Declarative expression descriptor.
|
|
251
|
+
* @public
|
|
252
|
+
*/
|
|
253
|
+
export interface DeclarativeExpression {
|
|
254
|
+
operator: Operator;
|
|
255
|
+
left: string;
|
|
256
|
+
leftIsValue: boolean | null;
|
|
257
|
+
right: string | boolean | number | null;
|
|
258
|
+
rightIsValue: boolean | null;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Declarative chained expression descriptor.
|
|
262
|
+
* @public
|
|
263
|
+
*/
|
|
264
|
+
export interface ChainedExpression {
|
|
265
|
+
operator?: LogicalOperator;
|
|
266
|
+
expression: DeclarativeExpression;
|
|
267
|
+
next?: ChainedExpression;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Gets the expression chain as a configuration object
|
|
271
|
+
* @param value - The binding string value
|
|
272
|
+
* @returns - A configuration object containing information about the expression
|
|
273
|
+
* @public
|
|
274
|
+
*/
|
|
275
|
+
export declare function getExpressionChain(value: string): ChainedExpression | void;
|
|
276
|
+
/**
|
|
277
|
+
* This is the transform utility for rationalizing declarative HTML syntax
|
|
278
|
+
* with bindings in the ViewTemplate
|
|
279
|
+
* @param innerHTML - The innerHTML to transform.
|
|
280
|
+
* @param index - The index to start the current slice of HTML to evaluate.
|
|
281
|
+
* @public
|
|
282
|
+
*/
|
|
283
|
+
export declare function transformInnerHTML(innerHTML: string, index?: number): string;
|
|
284
|
+
/**
|
|
285
|
+
* Resolves boolean logic
|
|
286
|
+
* used for f-when and boolean attributes
|
|
287
|
+
* @param rootPropertyName - The current root property name.
|
|
288
|
+
* @param expression - The chained expression to resolve.
|
|
289
|
+
* @param parentContext - The parent repeat context.
|
|
290
|
+
* @param level - The current repeat nesting level.
|
|
291
|
+
* @param schema - The schema to record paths in.
|
|
292
|
+
* @returns - A binding that resolves the chained expression logic
|
|
293
|
+
* @public
|
|
294
|
+
*/
|
|
295
|
+
export declare function getBooleanBinding(rootPropertyName: string | null, expression: ChainedExpression, parentContext: string | null, level: number, schema: Schema): (x: boolean, c: any) => any;
|
|
296
|
+
/**
|
|
297
|
+
* Get the root property name
|
|
298
|
+
* @param rootPropertyName - The root property
|
|
299
|
+
* @param path - The dot syntax path
|
|
300
|
+
* @param context - The context created by a repeat
|
|
301
|
+
* @param type - The type of path binding
|
|
302
|
+
* @returns
|
|
303
|
+
* @public
|
|
304
|
+
*/
|
|
305
|
+
export declare function getRootPropertyName(rootPropertyName: string | null, path: string, context: null | string, type: PathType): string | null;
|
|
306
|
+
/**
|
|
307
|
+
* Get details of bindings to the attributes of child custom elements
|
|
308
|
+
* @param previousString - The previous string before the binding
|
|
309
|
+
* @returns null, or a custom element name and attribute name
|
|
310
|
+
* @public
|
|
311
|
+
*/
|
|
312
|
+
export declare function getChildrenMap(previousString: string | null): ChildrenMap | null;
|
package/dist/dts/di/di.d.ts
CHANGED
|
@@ -390,7 +390,7 @@ export interface InterfaceConfiguration {
|
|
|
390
390
|
friendlyName?: string;
|
|
391
391
|
/**
|
|
392
392
|
* When true, the dependency will be re-resolved when FASTElement connection changes.
|
|
393
|
-
* If the resolved value changes due to connection change,
|
|
393
|
+
* If the resolved value changes due to connection change, an observable notification
|
|
394
394
|
* will be emitted for the property, with the previous and next values provided to any subscriber.
|
|
395
395
|
*/
|
|
396
396
|
respectConnection?: boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { Binding } from "../binding/binding.js";
|
|
2
|
+
export type { Expression } from "../observation/observable.js";
|
|
3
|
+
export { RepeatBehavior, RepeatDirective, type RepeatOptions, repeat, } from "../templating/repeat.js";
|
|
4
|
+
export type { CaptureType, ViewTemplate } from "../templating/template.js";
|
package/dist/dts/dom-policy.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ export type DOMPolicyOptions = {
|
|
|
75
75
|
declare const DOMPolicy: Readonly<{
|
|
76
76
|
/**
|
|
77
77
|
* Creates a new DOM Policy object.
|
|
78
|
-
* @param options The options to use in creating the policy.
|
|
78
|
+
* @param options - The options to use in creating the policy.
|
|
79
79
|
* @returns The newly created DOMPolicy.
|
|
80
80
|
*/
|
|
81
81
|
create(options?: DOMPolicyOptions): Readonly<IDOMPolicy>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { Binding } from "./binding/binding.js";
|
|
2
|
+
export type { DOMPolicy } from "./dom.js";
|
|
3
|
+
export type { Expression } from "./observation/observable.js";
|
|
4
|
+
export { type ElementViewTemplate, type HTMLTemplateCompilationResult, type HTMLTemplateTag, html, InlineTemplateDirective, type SyntheticViewTemplate, type TemplateValue, ViewTemplate, } from "./templating/template.js";
|
|
5
|
+
export { type ElementView, HTMLView, type SyntheticView } from "./templating/view.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Installs the hydration runtime on `ViewTemplate.prototype`,
|
|
3
|
+
* making all templates hydratable. Call this before any hydration
|
|
4
|
+
* occurs. Safe to call multiple times — subsequent calls are no-ops.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare function ensureHydrationRuntime(): void;
|
|
@@ -7,7 +7,7 @@ export declare class HydrationTargetElementError extends Error {
|
|
|
7
7
|
/**
|
|
8
8
|
* The node to target factory.
|
|
9
9
|
*/
|
|
10
|
-
readonly node:
|
|
10
|
+
readonly node: Node;
|
|
11
11
|
/**
|
|
12
12
|
* String representation of the HTML in the template that
|
|
13
13
|
* threw the target element error.
|
|
@@ -25,10 +25,11 @@ export declare class HydrationTargetElementError extends Error {
|
|
|
25
25
|
/**
|
|
26
26
|
* The node to target factory.
|
|
27
27
|
*/
|
|
28
|
-
node:
|
|
28
|
+
node: Node);
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* Represents the DOM boundaries controlled by a view
|
|
32
|
+
* @public
|
|
32
33
|
*/
|
|
33
34
|
export interface ViewBoundaries {
|
|
34
35
|
first: Node;
|
|
@@ -37,6 +38,7 @@ export interface ViewBoundaries {
|
|
|
37
38
|
/**
|
|
38
39
|
* Stores relationships between a {@link ViewBehaviorFactory} and
|
|
39
40
|
* the {@link ViewBoundaries} the factory created.
|
|
41
|
+
* @public
|
|
40
42
|
*/
|
|
41
43
|
export interface ViewBehaviorBoundaries {
|
|
42
44
|
[factoryId: string]: ViewBoundaries;
|
|
@@ -52,20 +54,21 @@ export declare function createRangeForNodes(first: Node, last: Node): Range;
|
|
|
52
54
|
/**
|
|
53
55
|
* Maps compiled ViewBehaviorFactory IDs to their corresponding DOM nodes in the
|
|
54
56
|
* server-rendered shadow root. Uses a TreeWalker to scan the existing DOM between
|
|
55
|
-
* firstNode and lastNode,
|
|
57
|
+
* firstNode and lastNode, processing data-free sequential hydration markers.
|
|
56
58
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
+
* A sequential factory pointer advances through the factories array in DFS order.
|
|
60
|
+
* Since the template compiler and hydration walker both traverse the DOM in
|
|
61
|
+
* identical depth-first order, no embedded indices are needed in markers.
|
|
59
62
|
*
|
|
60
|
-
* For
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
63
|
+
* For element nodes: parses `data-fe="N"` to determine the count of attribute
|
|
64
|
+
* binding factories, then consumes N factories sequentially.
|
|
65
|
+
*
|
|
66
|
+
* For comment nodes: `fe:b` markers consume the next factory for content bindings,
|
|
67
|
+
* using balanced depth counting for nested marker pairing. `fe:e` markers cause
|
|
68
|
+
* the walker to skip nested custom element subtrees.
|
|
65
69
|
*
|
|
66
70
|
* Host bindings (targetNodeId='h') appear at the start of the factories array but
|
|
67
|
-
* have no SSR markers — getHydrationIndexOffset() computes
|
|
68
|
-
* marker indices align with the correct non-host factories.
|
|
71
|
+
* have no SSR markers — getHydrationIndexOffset() computes the initial pointer value.
|
|
69
72
|
*
|
|
70
73
|
* @param firstNode - The first node of the view.
|
|
71
74
|
* @param lastNode - The last node of the view.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type { HydrationOptions } from "./components/enable-hydration.js";
|
|
2
|
+
export { deferHydrationAttribute, enableHydration, } from "./components/enable-hydration.js";
|
|
3
|
+
export { isHydratable } from "./components/hydration.js";
|
|
4
|
+
export { HydrationTracker } from "./components/hydration-tracker.js";
|
|
5
|
+
export type { DOMAspect, DOMPolicy, DOMSink, } from "./dom.js";
|
|
6
|
+
export type { ViewBehaviorBoundaries, ViewBoundaries, } from "./hydration/target-builder.js";
|
|
7
|
+
export type { Disposable } from "./interfaces.js";
|
|
8
|
+
export type { ExecutionContext, ExpressionController, SourceLifetime, } from "./observation/observable.js";
|
|
9
|
+
export type { ContentTemplate, ContentView, HydratableContentTemplate, } from "./templating/html-binding-directive.js";
|
|
10
|
+
export type { ViewBehavior, ViewBehaviorFactory, ViewBehaviorTargets, ViewController, } from "./templating/html-directive.js";
|
|
11
|
+
export type { HydratableView, HydratableViewController, ViewNodes, } from "./templating/hydration-view.js";
|
|
12
|
+
export { HydrationBindingError, HydrationStage, } from "./templating/hydration-view.js";
|
|
13
|
+
export type { CaptureType, ElementViewTemplate, HydratableElementViewTemplate, HydratableSyntheticViewTemplate, SyntheticViewTemplate, } from "./templating/template.js";
|
|
14
|
+
export type { DefaultExecutionContext, ElementView, SyntheticView, View, } from "./templating/view.js";
|