@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
package/dist/esm/di/di.js
CHANGED
|
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
* Big thanks to https://github.com/fkleuver and the https://github.com/aurelia/aurelia project
|
|
12
12
|
* for the bulk of this code and many of the associated tests.
|
|
13
13
|
*/
|
|
14
|
-
import { Context,
|
|
14
|
+
import { Context, } from "../context.js";
|
|
15
15
|
import { Message } from "../interfaces.js";
|
|
16
16
|
import { Metadata } from "../metadata.js";
|
|
17
17
|
import { emptyArray, FAST } from "../platform.js";
|
|
@@ -181,7 +181,7 @@ function createContext(nameConfigOrCallback, configuror) {
|
|
|
181
181
|
return configure(new ResolverBuilder(container, key !== null && key !== void 0 ? key : Interface));
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
Interface.toString = function
|
|
184
|
+
Interface.toString = function interfaceToString() {
|
|
185
185
|
return `DIContext<${Interface.name}>`;
|
|
186
186
|
};
|
|
187
187
|
return Interface;
|
|
@@ -1132,9 +1132,7 @@ export class ContainerImpl {
|
|
|
1132
1132
|
}
|
|
1133
1133
|
getAll(key, searchAncestors = false) {
|
|
1134
1134
|
validateKey(key);
|
|
1135
|
-
|
|
1136
|
-
const requestor = this;
|
|
1137
|
-
let current = requestor;
|
|
1135
|
+
let current = this;
|
|
1138
1136
|
let resolver;
|
|
1139
1137
|
if (searchAncestors) {
|
|
1140
1138
|
let resolutions = emptyArray;
|
|
@@ -1143,7 +1141,7 @@ export class ContainerImpl {
|
|
|
1143
1141
|
if (resolver != null) {
|
|
1144
1142
|
resolutions = resolutions.concat(
|
|
1145
1143
|
/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
|
|
1146
|
-
buildAllResponse(resolver, current,
|
|
1144
|
+
buildAllResponse(resolver, current, this));
|
|
1147
1145
|
}
|
|
1148
1146
|
current = current.parent;
|
|
1149
1147
|
}
|
|
@@ -1159,7 +1157,7 @@ export class ContainerImpl {
|
|
|
1159
1157
|
}
|
|
1160
1158
|
}
|
|
1161
1159
|
else {
|
|
1162
|
-
return buildAllResponse(resolver, current,
|
|
1160
|
+
return buildAllResponse(resolver, current, this);
|
|
1163
1161
|
}
|
|
1164
1162
|
}
|
|
1165
1163
|
}
|
|
@@ -1199,7 +1197,7 @@ export class ContainerImpl {
|
|
|
1199
1197
|
if (!(registrationResolver instanceof Object) ||
|
|
1200
1198
|
registrationResolver.resolve == null) {
|
|
1201
1199
|
const newResolver = handler.resolvers.get(keyAsValue);
|
|
1202
|
-
if (newResolver
|
|
1200
|
+
if (newResolver !== void 0) {
|
|
1203
1201
|
return newResolver;
|
|
1204
1202
|
}
|
|
1205
1203
|
throw FAST.error(Message.invalidResolver);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChildrenDirective, children, } from "../templating/children.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { elements, NodeObservationDirective, } from "../templating/node-observation.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RefDirective, ref } from "../templating/ref.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RepeatBehavior, RepeatDirective, repeat, } from "../templating/repeat.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SlottedDirective, slotted, } from "../templating/slotted.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { when } from "../templating/when.js";
|
package/dist/esm/dom-policy.js
CHANGED
|
@@ -295,7 +295,7 @@ function createDOMGuards(config, defaults) {
|
|
|
295
295
|
function createTrustedType() {
|
|
296
296
|
const createHTML = html => html;
|
|
297
297
|
return globalThis.trustedTypes
|
|
298
|
-
? globalThis.trustedTypes.createPolicy("fast-
|
|
298
|
+
? globalThis.trustedTypes.createPolicy("fast-element", { createHTML })
|
|
299
299
|
: { createHTML };
|
|
300
300
|
}
|
|
301
301
|
function tryGuard(aspectGuards, tagName, aspect, aspectName, sink) {
|
|
@@ -314,7 +314,7 @@ function tryGuard(aspectGuards, tagName, aspect, aspectName, sink) {
|
|
|
314
314
|
const DOMPolicy = Object.freeze({
|
|
315
315
|
/**
|
|
316
316
|
* Creates a new DOM Policy object.
|
|
317
|
-
* @param options The options to use in creating the policy.
|
|
317
|
+
* @param options - The options to use in creating the policy.
|
|
318
318
|
* @returns The newly created DOMPolicy.
|
|
319
319
|
*/
|
|
320
320
|
create(options = {}) {
|
package/dist/esm/dom.js
CHANGED
|
@@ -36,7 +36,7 @@ export const DOMAspect = Object.freeze({
|
|
|
36
36
|
});
|
|
37
37
|
const createHTML = html => html;
|
|
38
38
|
const fastTrustedType = globalThis.trustedTypes
|
|
39
|
-
? globalThis.trustedTypes.createPolicy("fast-
|
|
39
|
+
? globalThis.trustedTypes.createPolicy("fast-element", { createHTML })
|
|
40
40
|
: { createHTML };
|
|
41
41
|
let defaultPolicy = Object.freeze({
|
|
42
42
|
createHTML(value) {
|
package/dist/esm/html.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Hydratable } from "../components/hydration.js";
|
|
2
|
+
import { ViewTemplate } from "../templating/template.js";
|
|
3
|
+
import { HydrationView } from "../templating/hydration-view.js";
|
|
4
|
+
let installed = false;
|
|
5
|
+
/**
|
|
6
|
+
* Installs the hydration runtime on `ViewTemplate.prototype`,
|
|
7
|
+
* making all templates hydratable. Call this before any hydration
|
|
8
|
+
* occurs. Safe to call multiple times — subsequent calls are no-ops.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export function ensureHydrationRuntime() {
|
|
12
|
+
if (installed) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const prototype = ViewTemplate.prototype;
|
|
16
|
+
if (prototype[Hydratable] !== Hydratable) {
|
|
17
|
+
Object.defineProperties(prototype, {
|
|
18
|
+
[Hydratable]: {
|
|
19
|
+
value: Hydratable,
|
|
20
|
+
enumerable: false,
|
|
21
|
+
configurable: false,
|
|
22
|
+
},
|
|
23
|
+
hydrate: {
|
|
24
|
+
value(firstChild, lastChild, hostBindingTarget) {
|
|
25
|
+
return new HydrationView(firstChild, lastChild, this, hostBindingTarget);
|
|
26
|
+
},
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: false,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
installed = true;
|
|
33
|
+
}
|
|
@@ -39,26 +39,24 @@ export function createRangeForNodes(first, last) {
|
|
|
39
39
|
range.setEnd(last, isComment(last) || isText(last) ? last.data.length : last.childNodes.length);
|
|
40
40
|
return range;
|
|
41
41
|
}
|
|
42
|
-
function isShadowRoot(node) {
|
|
43
|
-
return node instanceof DocumentFragment && "mode" in node;
|
|
44
|
-
}
|
|
45
42
|
/**
|
|
46
43
|
* Maps compiled ViewBehaviorFactory IDs to their corresponding DOM nodes in the
|
|
47
44
|
* server-rendered shadow root. Uses a TreeWalker to scan the existing DOM between
|
|
48
|
-
* firstNode and lastNode,
|
|
45
|
+
* firstNode and lastNode, processing data-free sequential hydration markers.
|
|
46
|
+
*
|
|
47
|
+
* A sequential factory pointer advances through the factories array in DFS order.
|
|
48
|
+
* Since the template compiler and hydration walker both traverse the DOM in
|
|
49
|
+
* identical depth-first order, no embedded indices are needed in markers.
|
|
49
50
|
*
|
|
50
|
-
* For element nodes: parses `data-fe
|
|
51
|
-
* factories
|
|
51
|
+
* For element nodes: parses `data-fe="N"` to determine the count of attribute
|
|
52
|
+
* binding factories, then consumes N factories sequentially.
|
|
52
53
|
*
|
|
53
|
-
* For comment nodes:
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* Element boundary markers (`fe-eb$$start/end$$`) cause the walker to skip over
|
|
57
|
-
* nested custom elements that handle their own hydration.
|
|
54
|
+
* For comment nodes: `fe:b` markers consume the next factory for content bindings,
|
|
55
|
+
* using balanced depth counting for nested marker pairing. `fe:e` markers cause
|
|
56
|
+
* the walker to skip nested custom element subtrees.
|
|
58
57
|
*
|
|
59
58
|
* Host bindings (targetNodeId='h') appear at the start of the factories array but
|
|
60
|
-
* have no SSR markers — getHydrationIndexOffset() computes
|
|
61
|
-
* marker indices align with the correct non-host factories.
|
|
59
|
+
* have no SSR markers — getHydrationIndexOffset() computes the initial pointer value.
|
|
62
60
|
*
|
|
63
61
|
* @param firstNode - The first node of the view.
|
|
64
62
|
* @param lastNode - The last node of the view.
|
|
@@ -66,9 +64,9 @@ function isShadowRoot(node) {
|
|
|
66
64
|
* @returns - A {@link ViewBehaviorTargets } object for the factories in the view.
|
|
67
65
|
*/
|
|
68
66
|
export function buildViewBindingTargets(firstNode, lastNode, factories) {
|
|
67
|
+
var _a, _b;
|
|
69
68
|
const range = createRangeForNodes(firstNode, lastNode);
|
|
70
69
|
const treeRoot = range.commonAncestorContainer;
|
|
71
|
-
const hydrationIndexOffset = getHydrationIndexOffset(factories);
|
|
72
70
|
const walker = document.createTreeWalker(treeRoot, NodeFilter.SHOW_ELEMENT + NodeFilter.SHOW_COMMENT + NodeFilter.SHOW_TEXT, {
|
|
73
71
|
acceptNode(node) {
|
|
74
72
|
return range.comparePoint(node, 0) === 0
|
|
@@ -78,15 +76,40 @@ export function buildViewBindingTargets(firstNode, lastNode, factories) {
|
|
|
78
76
|
});
|
|
79
77
|
const targets = {};
|
|
80
78
|
const boundaries = {};
|
|
79
|
+
// Sequential factory pointer — skip host bindings at the start
|
|
80
|
+
let factoryPointer = getHydrationIndexOffset(factories);
|
|
81
81
|
let node = (walker.currentNode = firstNode);
|
|
82
82
|
while (node !== null) {
|
|
83
83
|
switch (node.nodeType) {
|
|
84
84
|
case Node.ELEMENT_NODE: {
|
|
85
|
-
|
|
85
|
+
const count = HydrationMarkup.parseAttributeBindingCount(node);
|
|
86
|
+
if (count !== null) {
|
|
87
|
+
for (let i = 0; i < count; i++) {
|
|
88
|
+
const factory = factories[factoryPointer++];
|
|
89
|
+
if (!factory) {
|
|
90
|
+
throw new HydrationTargetElementError(`HydrationView was unable to successfully target factory on ${node.nodeName} inside ${node.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`, factories, node);
|
|
91
|
+
}
|
|
92
|
+
targetFactory(factory, node, targets);
|
|
93
|
+
}
|
|
94
|
+
node.removeAttribute(HydrationMarkup.attributeMarkerName);
|
|
95
|
+
}
|
|
86
96
|
break;
|
|
87
97
|
}
|
|
88
98
|
case Node.COMMENT_NODE: {
|
|
89
|
-
|
|
99
|
+
const data = node.data;
|
|
100
|
+
if (data === "fe:e") {
|
|
101
|
+
// Element boundary — clear start marker and skip subtree
|
|
102
|
+
node.data = "";
|
|
103
|
+
skipToElementBoundaryEnd(walker, factories, node);
|
|
104
|
+
}
|
|
105
|
+
else if (data === "fe:b") {
|
|
106
|
+
// Content binding — consume next factory
|
|
107
|
+
const factory = factories[factoryPointer++];
|
|
108
|
+
if (!factory) {
|
|
109
|
+
throw new HydrationTargetElementError(`HydrationView ran out of factories while processing a content binding marker inside ${(_b = (_a = node.getRootNode().host) === null || _a === void 0 ? void 0 : _a.nodeName) !== null && _b !== void 0 ? _b : "unknown"}. This likely indicates a template mismatch between SSR rendering and hydration.`, factories, node);
|
|
110
|
+
}
|
|
111
|
+
targetContentBinding(node, walker, factory, factories, targets, boundaries);
|
|
112
|
+
}
|
|
90
113
|
break;
|
|
91
114
|
}
|
|
92
115
|
}
|
|
@@ -95,100 +118,84 @@ export function buildViewBindingTargets(firstNode, lastNode, factories) {
|
|
|
95
118
|
range.detach();
|
|
96
119
|
return { targets, boundaries };
|
|
97
120
|
}
|
|
98
|
-
function
|
|
99
|
-
var _a, _b;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (!factory) {
|
|
106
|
-
throw new HydrationTargetElementError(`HydrationView was unable to successfully target factory on ${node.nodeName} inside ${node.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`, factories, node);
|
|
107
|
-
}
|
|
108
|
-
targetFactory(factory, node, targets);
|
|
109
|
-
}
|
|
110
|
-
node.removeAttribute(HydrationMarkup.attributeMarkerName);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
function targetComment(node, walker, factories, targets, boundaries, hydrationIndexOffset) {
|
|
114
|
-
if (HydrationMarkup.isElementBoundaryStartMarker(node)) {
|
|
115
|
-
skipToElementBoundaryEndMarker(node, walker);
|
|
116
|
-
return;
|
|
121
|
+
function targetContentBinding(node, walker, factory, factories, targets, boundaries) {
|
|
122
|
+
var _a, _b, _c, _d;
|
|
123
|
+
const nodes = [];
|
|
124
|
+
let current = walker.nextSibling();
|
|
125
|
+
node.data = "";
|
|
126
|
+
if (current === null) {
|
|
127
|
+
throw new HydrationTargetElementError(`Error hydrating content binding inside "${(_b = (_a = node.getRootNode().host) === null || _a === void 0 ? void 0 : _a.nodeName) !== null && _b !== void 0 ? _b : "unknown"}": no sibling found after content binding start marker.`, factories, node);
|
|
117
128
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
const first = current;
|
|
129
|
-
// Search for the binding end marker that closes the binding.
|
|
130
|
-
while (current !== null) {
|
|
131
|
-
if (isComment(current)) {
|
|
132
|
-
const parsed = HydrationMarkup.parseContentBindingEndMarker(current.data);
|
|
133
|
-
if (parsed && parsed[1] === id) {
|
|
129
|
+
const first = current;
|
|
130
|
+
// Balanced depth counting for nested content markers
|
|
131
|
+
let depth = 0;
|
|
132
|
+
while (current !== null) {
|
|
133
|
+
if (isComment(current)) {
|
|
134
|
+
if (current.data === "fe:b") {
|
|
135
|
+
depth++;
|
|
136
|
+
}
|
|
137
|
+
else if (current.data === "fe:/b") {
|
|
138
|
+
if (depth === 0)
|
|
134
139
|
break;
|
|
135
|
-
|
|
140
|
+
depth--;
|
|
136
141
|
}
|
|
137
|
-
nodes.push(current);
|
|
138
|
-
current = walker.nextSibling();
|
|
139
|
-
}
|
|
140
|
-
if (current === null) {
|
|
141
|
-
const root = node.getRootNode();
|
|
142
|
-
throw new Error(`Error hydrating Comment node inside "${isShadowRoot(root) ? root.host.nodeName : root.nodeName}".`);
|
|
143
|
-
}
|
|
144
|
-
current.data = "";
|
|
145
|
-
if (nodes.length === 1 && isText(nodes[0])) {
|
|
146
|
-
targetFactory(factory, nodes[0], targets);
|
|
147
142
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
143
|
+
nodes.push(current);
|
|
144
|
+
current = walker.nextSibling();
|
|
145
|
+
}
|
|
146
|
+
if (current === null) {
|
|
147
|
+
throw new HydrationTargetElementError(`Error hydrating content binding inside "${(_d = (_c = node.getRootNode().host) === null || _c === void 0 ? void 0 : _c.nodeName) !== null && _d !== void 0 ? _d : "unknown"}": missing fe:/b end marker.`, factories, node);
|
|
148
|
+
}
|
|
149
|
+
current.data = "";
|
|
150
|
+
if (nodes.length === 1 && isText(nodes[0])) {
|
|
151
|
+
targetFactory(factory, nodes[0], targets);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
// If current === first, it means there is no content in
|
|
155
|
+
// the view. This happens when a `when` directive evaluates false,
|
|
156
|
+
// or whenever a content binding returns null or undefined.
|
|
157
|
+
if (current !== first && current.previousSibling !== null) {
|
|
158
|
+
boundaries[factory.targetNodeId] = {
|
|
159
|
+
first,
|
|
160
|
+
last: current.previousSibling,
|
|
161
|
+
};
|
|
167
162
|
}
|
|
163
|
+
// Insert a text node so text content binding targets it
|
|
164
|
+
const dummyTextNode = current.parentNode.insertBefore(document.createTextNode(""), current);
|
|
165
|
+
targetFactory(factory, dummyTextNode, targets);
|
|
168
166
|
}
|
|
169
167
|
}
|
|
170
168
|
/**
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* @param walker - tree walker
|
|
169
|
+
* Skips past a nested custom element's shadow content using balanced
|
|
170
|
+
* depth counting to handle nested element boundaries correctly.
|
|
174
171
|
*/
|
|
175
|
-
function
|
|
176
|
-
|
|
172
|
+
function skipToElementBoundaryEnd(walker, factories, startNode) {
|
|
173
|
+
var _a, _b;
|
|
174
|
+
let depth = 0;
|
|
177
175
|
let current = walker.nextSibling();
|
|
178
176
|
while (current !== null) {
|
|
179
177
|
if (isComment(current)) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
178
|
+
if (current.data === "fe:e") {
|
|
179
|
+
current.data = "";
|
|
180
|
+
depth++;
|
|
181
|
+
}
|
|
182
|
+
else if (current.data === "fe:/e") {
|
|
183
|
+
if (depth === 0) {
|
|
184
|
+
current.data = "";
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
current.data = "";
|
|
188
|
+
depth--;
|
|
183
189
|
}
|
|
184
190
|
}
|
|
185
191
|
current = walker.nextSibling();
|
|
186
192
|
}
|
|
193
|
+
throw new HydrationTargetElementError(`HydrationView could not find the end of an element boundary inside ${(_b = (_a = startNode.getRootNode().host) === null || _a === void 0 ? void 0 : _a.nodeName) !== null && _b !== void 0 ? _b : "unknown"}. This likely indicates a template mismatch between SSR rendering and hydration.`, factories, startNode);
|
|
187
194
|
}
|
|
188
195
|
/**
|
|
189
196
|
* Counts how many factories at the start of the array are host bindings (targetNodeId='h').
|
|
190
197
|
* Host bindings target the custom element itself and are not represented by SSR markers,
|
|
191
|
-
* so the
|
|
198
|
+
* so the factory pointer must start past them.
|
|
192
199
|
*/
|
|
193
200
|
function getHydrationIndexOffset(factories) {
|
|
194
201
|
let offset = 0;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { deferHydrationAttribute, enableHydration, } from "./components/enable-hydration.js";
|
|
2
|
+
export { isHydratable } from "./components/hydration.js";
|
|
3
|
+
export { HydrationTracker } from "./components/hydration-tracker.js";
|
|
4
|
+
export { HydrationBindingError, HydrationStage, } from "./templating/hydration-view.js";
|
package/dist/esm/index.debug.js
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -1,39 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
//
|
|
3
|
-
export {
|
|
4
|
-
// Observation
|
|
5
|
-
export { ArrayObserver, lengthOf, Sort, sortedCount, Splice, SpliceStrategy, SpliceStrategySupport, } from "./observation/arrays.js";
|
|
6
|
-
export { PropertyChangeNotifier, SubscriberSet, } from "./observation/notifier.js";
|
|
7
|
-
export { ExecutionContext, Observable, observable, SourceLifetime, volatile, } from "./observation/observable.js";
|
|
8
|
-
export { Updates } from "./observation/update-queue.js";
|
|
1
|
+
// Kernel
|
|
2
|
+
// Components
|
|
3
|
+
export { AttributeConfiguration, AttributeDefinition, attr, booleanConverter, nullableBooleanConverter, nullableNumberConverter, } from "./attr.js";
|
|
9
4
|
// Binding
|
|
10
5
|
export { Binding } from "./binding/binding.js";
|
|
11
6
|
export { normalizeBinding } from "./binding/normalize.js";
|
|
12
7
|
export { oneTime } from "./binding/one-time.js";
|
|
13
8
|
export { listener, oneWay } from "./binding/one-way.js";
|
|
9
|
+
export { Signal, signal } from "./binding/signal.js";
|
|
10
|
+
export { TwoWaySettings, twoWay, } from "./binding/two-way.js";
|
|
11
|
+
export { ElementController, Stages, } from "./components/element-controller.js";
|
|
12
|
+
export { FASTElementDefinition, fastElementRegistry, } from "./components/fast-definitions.js";
|
|
13
|
+
export { customElement, FASTElement } from "./components/fast-element.js";
|
|
14
|
+
export { enableDebug } from "./debug.js";
|
|
15
|
+
// Directives
|
|
16
|
+
export { ChildrenDirective, children, } from "./directives/children.js";
|
|
17
|
+
export { elements, NodeObservationDirective, } from "./directives/node-observation.js";
|
|
18
|
+
export { RefDirective, ref } from "./directives/ref.js";
|
|
19
|
+
export { RepeatBehavior, RepeatDirective, repeat, } from "./directives/repeat.js";
|
|
20
|
+
export { SlottedDirective, slotted, } from "./directives/slotted.js";
|
|
21
|
+
export { when } from "./directives/when.js";
|
|
22
|
+
export * from "./dom.js";
|
|
23
|
+
export { DOMPolicy, } from "./dom-policy.js";
|
|
24
|
+
export { ArrayObserver, lengthOf, Sort, Splice, SpliceStrategy, SpliceStrategySupport, sortedCount, } from "./observation/arrays.js";
|
|
25
|
+
// Observation
|
|
26
|
+
export { PropertyChangeNotifier, SubscriberSet, } from "./observation/notifier.js";
|
|
27
|
+
export { ExecutionContext, Observable, observable, SourceLifetime, volatile, } from "./observation/observable.js";
|
|
28
|
+
export { Updates } from "./observation/update-queue.js";
|
|
29
|
+
export { emptyArray, FAST } from "./platform.js";
|
|
30
|
+
export { Schema, schemaRegistry, } from "./schema.js";
|
|
31
|
+
export * from "./state/exports.js";
|
|
14
32
|
// Styles
|
|
15
|
-
export { CSSBindingDirective } from "./styles/css-binding-directive.js";
|
|
16
|
-
export { cssDirective, CSSDirective, } from "./styles/css-directive.js";
|
|
17
33
|
export { css } from "./styles/css.js";
|
|
18
|
-
export {
|
|
19
|
-
export {} from "./styles/
|
|
34
|
+
export { CSSDirective, cssDirective, } from "./styles/css-directive.js";
|
|
35
|
+
export { ElementStyles } from "./styles/element-styles.js";
|
|
20
36
|
// Templating
|
|
21
|
-
export { children, ChildrenDirective } from "./templating/children.js";
|
|
22
37
|
export { Compiler } from "./templating/compiler.js";
|
|
23
|
-
export { HTMLBindingDirective } from "./templating/html-binding-directive.js";
|
|
24
|
-
export {
|
|
38
|
+
export { HTMLBindingDirective, } from "./templating/html-binding-directive.js";
|
|
39
|
+
export { HTMLDirective, htmlDirective, StatelessAttachedAttributeDirective, } from "./templating/html-directive.js";
|
|
25
40
|
export { Markup, Parser } from "./templating/markup.js";
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export
|
|
30
|
-
export { slotted, SlottedDirective } from "./templating/slotted.js";
|
|
31
|
-
export { html, InlineTemplateDirective, ViewTemplate } from "./templating/template.js";
|
|
32
|
-
export { HTMLView, HydrationBindingError } from "./templating/view.js";
|
|
33
|
-
export { when } from "./templating/when.js";
|
|
34
|
-
// Components
|
|
35
|
-
export { attr, AttributeConfiguration, AttributeDefinition, booleanConverter, nullableBooleanConverter, nullableNumberConverter, } from "./components/attributes.js";
|
|
36
|
-
export { ElementController, HydratableElementController, needsHydrationAttribute, Stages, } from "./components/element-controller.js";
|
|
37
|
-
export { FASTElementDefinition, fastElementRegistry, TemplateOptions, } from "./components/fast-definitions.js";
|
|
38
|
-
export { customElement, FASTElement } from "./components/fast-element.js";
|
|
39
|
-
export { deferHydrationAttribute, isHydratable } from "./components/hydration.js";
|
|
41
|
+
export { RenderBehavior, RenderDirective, render } from "./templating/render.js";
|
|
42
|
+
export { html, InlineTemplateDirective, ViewTemplate, } from "./templating/template.js";
|
|
43
|
+
export { DefaultExecutionContext, HTMLView, } from "./templating/view.js";
|
|
44
|
+
export * from "./utilities.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import "./debug.js";
|
|
2
|
-
import { DOMPolicy } from "./dom-policy.js";
|
|
1
|
+
import { enableDebug } from "./debug.js";
|
|
3
2
|
import { DOM } from "./dom.js";
|
|
3
|
+
import { DOMPolicy } from "./dom-policy.js";
|
|
4
|
+
enableDebug();
|
|
4
5
|
export * from "./index.js";
|
|
5
6
|
DOM.setPolicy(DOMPolicy.create());
|
package/dist/esm/index.rollup.js
CHANGED
package/dist/esm/interfaces.js
CHANGED
|
@@ -1,48 +1,3 @@
|
|
|
1
|
-
let kernelMode;
|
|
2
|
-
const kernelAttr = "fast-kernel";
|
|
3
|
-
try {
|
|
4
|
-
if (document.currentScript) {
|
|
5
|
-
kernelMode = document.currentScript.getAttribute(kernelAttr);
|
|
6
|
-
}
|
|
7
|
-
else {
|
|
8
|
-
const scripts = document.getElementsByTagName("script");
|
|
9
|
-
const currentScript = scripts[scripts.length - 1];
|
|
10
|
-
kernelMode = currentScript.getAttribute(kernelAttr);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
catch (e) {
|
|
14
|
-
kernelMode = "isolate";
|
|
15
|
-
}
|
|
16
|
-
let KernelServiceId;
|
|
17
|
-
switch (kernelMode) {
|
|
18
|
-
case "share": // share the kernel across major versions
|
|
19
|
-
KernelServiceId = Object.freeze({
|
|
20
|
-
updateQueue: 1,
|
|
21
|
-
observable: 2,
|
|
22
|
-
contextEvent: 3,
|
|
23
|
-
elementRegistry: 4,
|
|
24
|
-
});
|
|
25
|
-
break;
|
|
26
|
-
case "share-v2": // only share the kernel with other v2 instances
|
|
27
|
-
KernelServiceId = Object.freeze({
|
|
28
|
-
updateQueue: 1.2,
|
|
29
|
-
observable: 2.2,
|
|
30
|
-
contextEvent: 3.2,
|
|
31
|
-
elementRegistry: 4.2,
|
|
32
|
-
});
|
|
33
|
-
break;
|
|
34
|
-
default:
|
|
35
|
-
// fully isolate the kernel from all other FAST instances
|
|
36
|
-
const postfix = `-${Math.random().toString(36).substring(2, 8)}`;
|
|
37
|
-
KernelServiceId = Object.freeze({
|
|
38
|
-
updateQueue: `1.2${postfix}`,
|
|
39
|
-
observable: `2.2${postfix}`,
|
|
40
|
-
contextEvent: `3.2${postfix}`,
|
|
41
|
-
elementRegistry: `4.2${postfix}`,
|
|
42
|
-
});
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
export { KernelServiceId };
|
|
46
1
|
/**
|
|
47
2
|
* Warning and error messages.
|
|
48
3
|
* @internal
|
|
@@ -62,6 +17,7 @@ export var Message;
|
|
|
62
17
|
Message[Message["onlySetTemplatePolicyOnce"] = 1207] = "onlySetTemplatePolicyOnce";
|
|
63
18
|
Message[Message["cannotSetTemplatePolicyAfterCompilation"] = 1208] = "cannotSetTemplatePolicyAfterCompilation";
|
|
64
19
|
Message[Message["blockedByDOMPolicy"] = 1209] = "blockedByDOMPolicy";
|
|
20
|
+
Message[Message["invalidHydrationAttributeMarker"] = 1210] = "invalidHydrationAttributeMarker";
|
|
65
21
|
// 1301 - 1400 Styles
|
|
66
22
|
// 1401 - 1500 Components
|
|
67
23
|
Message[Message["missingElementDefinition"] = 1401] = "missingElementDefinition";
|
package/dist/esm/observable.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Observable exports for easy access to the Observable API
|
|
3
|
-
*/
|
|
4
|
-
export { ExecutionContext, Observable, observable, SourceLifetime, volatile, } from "./observation/observable.js";
|
|
5
1
|
export { PropertyChangeNotifier, SubscriberSet } from "./observation/notifier.js";
|
|
2
|
+
export { ExecutionContext, Observable, observable, SourceLifetime, } from "./observation/observable.js";
|
|
@@ -589,7 +589,7 @@ export const ArrayObserver = Object.freeze({
|
|
|
589
589
|
* Enables the array observation mechanism.
|
|
590
590
|
* @remarks
|
|
591
591
|
* Array observation is enabled automatically when using the
|
|
592
|
-
*
|
|
592
|
+
* `RepeatDirective`, so calling this API manually is
|
|
593
593
|
* not typically necessary.
|
|
594
594
|
*/
|
|
595
595
|
enable() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isFunction, isString,
|
|
1
|
+
import { isFunction, isString, Message, } from "../interfaces.js";
|
|
2
2
|
import { createMetadataLocator, FAST, makeSerializationNoop } from "../platform.js";
|
|
3
3
|
import { PropertyChangeNotifier, SubscriberSet } from "./notifier.js";
|
|
4
4
|
import { Updates } from "./update-queue.js";
|
|
@@ -21,7 +21,7 @@ export const SourceLifetime = Object.freeze({
|
|
|
21
21
|
* Common Observable APIs.
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
|
-
export const Observable =
|
|
24
|
+
export const Observable = (() => {
|
|
25
25
|
const queueUpdate = Updates.enqueue;
|
|
26
26
|
const volatileRegex = /(:|&&|\|\||if|\?\.)/;
|
|
27
27
|
const notifierLookup = new WeakMap();
|
|
@@ -264,7 +264,7 @@ export const Observable = FAST.getById(KernelServiceId.observable, () => {
|
|
|
264
264
|
return volatileRegex.test(expression.toString());
|
|
265
265
|
},
|
|
266
266
|
});
|
|
267
|
-
});
|
|
267
|
+
})();
|
|
268
268
|
/**
|
|
269
269
|
* Decorator: Defines an observable property on the target.
|
|
270
270
|
* @param target - The target to define the observable on.
|
|
@@ -289,7 +289,7 @@ export function volatile(target, name, descriptor) {
|
|
|
289
289
|
},
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
|
-
const contextEvent =
|
|
292
|
+
const contextEvent = (() => {
|
|
293
293
|
let current = null;
|
|
294
294
|
return {
|
|
295
295
|
get() {
|
|
@@ -299,7 +299,7 @@ const contextEvent = FAST.getById(KernelServiceId.contextEvent, () => {
|
|
|
299
299
|
current = event;
|
|
300
300
|
},
|
|
301
301
|
};
|
|
302
|
-
});
|
|
302
|
+
})();
|
|
303
303
|
/**
|
|
304
304
|
* Provides additional contextual information available to behaviors and expressions.
|
|
305
305
|
* @public
|