@lushly-dev/fast-element 3.0.1-preview.1 → 3.0.1-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/command/command.api.json +40 -40
- package/dist/context/context.api.json +6 -6
- package/dist/declarative/declarative.api.json +33 -33
- package/dist/definition-schema/definition-schema.api.json +7 -7
- package/dist/di/di.api.json +31 -31
- package/dist/dts/declarative/debug.d.ts +2 -2
- package/dist/dts/declarative/utilities.d.ts +2 -2
- package/dist/dts/hydration/target-builder.d.ts +2 -2
- package/dist/dts/templating/hydration-view.d.ts +1 -1
- package/dist/dts/testing/fakes.d.ts +2 -1
- package/dist/dts/tsdoc-metadata.json +1 -1
- package/dist/esm/binding/two-way.js +1 -2
- package/dist/esm/command/behaviors/undo-behavior.js +2 -1
- package/dist/esm/command/registry.js +9 -6
- package/dist/esm/command/validation.js +5 -8
- package/dist/esm/components/element-controller.js +5 -4
- package/dist/esm/components/hydration-tracker.js +2 -1
- package/dist/esm/declarative/attribute-map.js +2 -1
- package/dist/esm/di/di.js +2 -1
- package/dist/esm/metadata.js +2 -8
- package/dist/esm/observation/notifier.js +2 -4
- package/dist/fast-element.api.json +97 -97
- package/dist/fast-element.debug.js +32 -46
- package/dist/fast-element.debug.min.js +2 -2
- package/dist/fast-element.js +32 -46
- package/dist/fast-element.min.js +2 -2
- package/dist/observation/arrays/arrays.api.json +6 -6
- package/dist/scoped/scoped.api.json +10 -10
- package/dist/trust/trust.api.json +4 -4
- package/package.json +10 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"metadata": {
|
|
3
3
|
"toolPackage": "@microsoft/api-extractor",
|
|
4
|
-
"toolVersion": "7.
|
|
4
|
+
"toolVersion": "7.60.1",
|
|
5
5
|
"schemaVersion": 1011,
|
|
6
6
|
"oldestForwardsCompatibleVersion": 1001,
|
|
7
7
|
"tsdocConfig": {
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
},
|
|
179
179
|
"kind": "Package",
|
|
180
180
|
"canonicalReference": "@lushly-dev/fast-element!",
|
|
181
|
-
"docComment": "/**\n * Scoped Custom Element Registries support for FAST-AF.\n *\n * @remarks\n *\n * This module provides utilities for working with Scoped Custom Element Registries
|
|
181
|
+
"docComment": "/**\n * Scoped Custom Element Registries support for FAST-AF.\n *\n * @remarks\n *\n * This module provides utilities for working with Scoped Custom Element Registries,\n * enabling isolated component definitions within shadow roots. This solves namespace\n * collisions for micro-frontends and design system versioning.\n *\n * @example\n *\n * Using ScopedRegistryMixin (recommended)\n * ```typescript\n * import { FASTElement, html } from '@lushly-dev/fast-element';\n * import { ScopedRegistryMixin } from '@lushly-dev/fast-element/scoped.js';\n *\n * class MyButton extends HTMLElement {}\n *\n * class MyCard extends ScopedRegistryMixin(FASTElement) {\n * static elementDefinitions = {\n * 'my-button': MyButton,\n * };\n * }\n *\n * // The shadow root gets the scoped registry, so <my-button> is upgraded without\n * // being defined globally.\n * await FASTElement.define(MyCard, {\n * name: 'my-card',\n * template: html`<my-button>Click me</my-button>`,\n * shadowOptions: MyCard.getShadowOptions(),\n * });\n * ```\n *\n * @example\n *\n * Using createRegistry directly\n * ```typescript\n * import {\n * createRegistry,\n * createRegistryAsync,\n * supportsScopedRegistries,\n * ensureScopedRegistrySupport,\n * } from '@lushly-dev/fast-element/scoped.js';\n *\n * class MyButton extends HTMLElement {}\n * class MyInput extends HTMLElement {}\n *\n * // Check support\n * if (supportsScopedRegistries()) {\n * const registry = createRegistry([\n * [MyButton, 'my-button'],\n * [MyInput, 'my-input'],\n * ]);\n *\n * element.attachShadow({\n * mode: 'open',\n * customElementRegistry: registry,\n * });\n * }\n *\n * // Or use async version with automatic polyfill\n * const registry = await createRegistryAsync([\n * [MyButton, 'my-button'],\n * ]);\n * ```\n *\n * @packageDocumentation\n */\n",
|
|
182
182
|
"name": "@lushly-dev/fast-element",
|
|
183
183
|
"preserveMemberOrder": false,
|
|
184
184
|
"members": [
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
{
|
|
192
192
|
"kind": "Function",
|
|
193
193
|
"canonicalReference": "@lushly-dev/fast-element!createRegistry:function(1)",
|
|
194
|
-
"docComment": "/**\n * Creates a scoped custom element registry with the provided element definitions.\n *\n * @remarks\n *\n * When scoped registries are supported, creates a new CustomElementRegistry and defines all provided elements in it. When not supported, falls back to registering elements on the global `customElements` registry (with a dev warning).\n *\n * In strict mode, throws an error if scoped registries are not supported instead of falling back to the global registry.\n *\n * @param definitions - Array of [Constructor, tagName] tuples to register\n *\n * @param options - Configuration options\n *\n * @returns The created registry, or undefined if fallback to global occurred\n *\n * @example\n * ```typescript\n * // Basic usage\n * const registry = createRegistry([\n * [MyButton, 'my-button'],\n * [MyInput, 'my-input'],\n * ]);\n *\n * if (registry) {\n * element.attachShadow({ mode: 'open', customElementRegistry: registry });\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Strict mode - throws if not supported\n * const registry = createRegistry(\n * [[MyButton, 'my-button']],\n * { strict: true }\n * );\n * ```\n *\n * @public\n */\n",
|
|
194
|
+
"docComment": "/**\n * Creates a scoped custom element registry with the provided element definitions.\n *\n * @remarks\n *\n * When scoped registries are supported, creates a new CustomElementRegistry\n * and defines all provided elements in it. When not supported, falls back to\n * registering elements on the global `customElements` registry (with a dev warning).\n *\n * In strict mode, throws an error if scoped registries are not supported\n * instead of falling back to the global registry.\n *\n * @param definitions - Array of [Constructor, tagName] tuples to register\n *\n * @param options - Configuration options\n *\n * @returns The created registry, or undefined if fallback to global occurred\n *\n * @example\n * ```typescript\n * // Basic usage\n * const registry = createRegistry([\n * [MyButton, 'my-button'],\n * [MyInput, 'my-input'],\n * ]);\n *\n * if (registry) {\n * element.attachShadow({ mode: 'open', customElementRegistry: registry });\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Strict mode - throws if not supported\n * const registry = createRegistry(\n * [[MyButton, 'my-button']],\n * { strict: true }\n * );\n * ```\n *\n * @public\n */\n",
|
|
195
195
|
"excerptTokens": [
|
|
196
196
|
{
|
|
197
197
|
"kind": "Content",
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
{
|
|
264
264
|
"kind": "Function",
|
|
265
265
|
"canonicalReference": "@lushly-dev/fast-element!createRegistryAsync:function(1)",
|
|
266
|
-
"docComment": "/**\n * Creates a scoped custom element registry with automatic polyfill loading.\n *\n * @remarks\n *\n * This async version first ensures scoped registry support is available (loading the polyfill if necessary), then creates the registry.\n *\n * Unlike `createRegistry()`, this function always operates in strict mode after polyfill loading, as the polyfill should provide support. If the polyfill fails to load, the underlying `ensureScopedRegistrySupport()
|
|
266
|
+
"docComment": "/**\n * Creates a scoped custom element registry with automatic polyfill loading.\n *\n * @remarks\n *\n * This async version first ensures scoped registry support is available\n * (loading the polyfill if necessary), then creates the registry.\n *\n * Unlike `createRegistry()`, this function always operates in strict mode\n * after polyfill loading, as the polyfill should provide support. If the\n * polyfill fails to load, the underlying `ensureScopedRegistrySupport()`\n * will throw.\n *\n * @param definitions - Array of [Constructor, tagName] tuples to register\n *\n * @param options - Configuration options (strict is always true after polyfill)\n *\n * @returns Promise resolving to the created registry\n *\n * @throws\n *\n * Error if polyfill loading fails\n *\n * @example\n * ```typescript\n * // Automatically loads polyfill if needed\n * const registry = await createRegistryAsync([\n * [MyButton, 'my-button'],\n * [MyInput, 'my-input'],\n * ]);\n *\n * element.attachShadow({ mode: 'open', customElementRegistry: registry });\n * ```\n *\n * @public\n */\n",
|
|
267
267
|
"excerptTokens": [
|
|
268
268
|
{
|
|
269
269
|
"kind": "Content",
|
|
@@ -359,7 +359,7 @@
|
|
|
359
359
|
{
|
|
360
360
|
"kind": "PropertySignature",
|
|
361
361
|
"canonicalReference": "@lushly-dev/fast-element!CreateRegistryOptions#strict:member",
|
|
362
|
-
"docComment": "/**\n * If true, throw when unsupported instead of falling back to global registry
|
|
362
|
+
"docComment": "/**\n * If true, throw when unsupported instead of falling back to global registry.\n * Default: false (uses global registry fallback)\n */\n",
|
|
363
363
|
"excerptTokens": [
|
|
364
364
|
{
|
|
365
365
|
"kind": "Content",
|
|
@@ -424,7 +424,7 @@
|
|
|
424
424
|
{
|
|
425
425
|
"kind": "TypeAlias",
|
|
426
426
|
"canonicalReference": "@lushly-dev/fast-element!ElementDefinitionMap:type",
|
|
427
|
-
"docComment": "/**\n * Map of element definitions: tag-name to constructor.\n *\n * @remarks\n *\n * Used with ScopedRegistryMixin to define child elements that should be registered in the component's scoped registry.\n *\n * @example\n * ```typescript\n * static elementDefinitions: ElementDefinitionMap = {\n * 'my-button': MyButton,\n * 'my-input': MyInput,\n * };\n * ```\n *\n * @public\n */\n",
|
|
427
|
+
"docComment": "/**\n * Map of element definitions: tag-name to constructor.\n *\n * @remarks\n *\n * Used with ScopedRegistryMixin to define child elements that should\n * be registered in the component's scoped registry.\n *\n * @example\n * ```typescript\n * static elementDefinitions: ElementDefinitionMap = {\n * 'my-button': MyButton,\n * 'my-input': MyInput,\n * };\n * ```\n *\n * @public\n */\n",
|
|
428
428
|
"excerptTokens": [
|
|
429
429
|
{
|
|
430
430
|
"kind": "Content",
|
|
@@ -464,7 +464,7 @@
|
|
|
464
464
|
{
|
|
465
465
|
"kind": "Function",
|
|
466
466
|
"canonicalReference": "@lushly-dev/fast-element!ensureScopedRegistrySupport:function(1)",
|
|
467
|
-
"docComment": "/**\n * Idempotency-safe polyfill loading for Scoped Custom Element Registries.\n *\n * @remarks\n *\n * Safe to call from multiple micro-frontend bundles. Uses a global flag (`window.__scopedRegistryPolyfillApplied`) to prevent double-patching which could corrupt the CustomElementRegistry prototype.\n *\n * If native support is detected, returns immediately without loading the polyfill
|
|
467
|
+
"docComment": "/**\n * Idempotency-safe polyfill loading for Scoped Custom Element Registries.\n *\n * @remarks\n *\n * Safe to call from multiple micro-frontend bundles. Uses a global flag\n * (`window.__scopedRegistryPolyfillApplied`) to prevent double-patching\n * which could corrupt the CustomElementRegistry prototype.\n *\n * If native support is detected, returns immediately without loading the polyfill.\n * On polyfill load failure, the flag is reset to allow retry on subsequent calls.\n *\n * @throws\n *\n * Error if the polyfill fails to load (network error, etc.)\n *\n * @example\n * ```typescript\n * // At app startup\n * await ensureScopedRegistrySupport();\n *\n * // Now safe to use scoped registries\n * const registry = new CustomElementRegistry();\n * ```\n *\n * @public\n */\n",
|
|
468
468
|
"excerptTokens": [
|
|
469
469
|
{
|
|
470
470
|
"kind": "Content",
|
|
@@ -700,7 +700,7 @@
|
|
|
700
700
|
{
|
|
701
701
|
"kind": "Function",
|
|
702
702
|
"canonicalReference": "@lushly-dev/fast-element!ScopedRegistryMixin:function(1)",
|
|
703
|
-
"docComment": "/**\n * Creates a mixin that enables scoped custom element registries for a FASTElement.\n *\n * @remarks\n *\n * The ScopedRegistryMixin provides a way to define child elements that are scoped to the component's shadow root, preventing namespace collisions in micro-frontend scenarios and enabling design system versioning.\n *\n * The mixin adds
|
|
703
|
+
"docComment": "/**\n * Creates a mixin that enables scoped custom element registries for a FASTElement.\n *\n * @remarks\n *\n * The ScopedRegistryMixin provides a way to define child elements that are\n * scoped to the component's shadow root, preventing namespace collisions\n * in micro-frontend scenarios and enabling design system versioning.\n *\n * The mixin adds:\n * - A static `elementDefinitions` property for defining child elements\n * - A static `scopedRegistry` getter that lazily creates the registry\n * - A method to get shadow root options with the scoped registry\n *\n * When scoped registries are not supported by the browser, elements fall back\n * to the global registry with a development warning.\n *\n * @param Base - The FASTElement base class to extend\n *\n * @returns A class that supports scoped element definitions\n *\n * @example\n * ```typescript\n * import { FASTElement, html, css } from '@lushly-dev/fast-element';\n * import { ScopedRegistryMixin } from '@lushly-dev/fast-element/scoped.js';\n *\n * // Children can be plain custom elements. FASTElement children must be composed\n * // first (FASTElementDefinition.compose(MyIcon, { name: 'my-icon' })) so the\n * // registry can reuse their FAST definition; creating an element of an\n * // undefined FASTElement class throws FAST error 1401.\n * class MyButton extends HTMLElement {\n * // Button implementation\n * }\n *\n * class MyCard extends ScopedRegistryMixin(FASTElement) {\n * static elementDefinitions = {\n * 'my-button': MyButton,\n * };\n * }\n *\n * // Attach the scoped registry to the shadow root through getShadowOptions().\n * // The template's <my-button> is created against it and does not need to be\n * // (and here is not) defined in the global registry.\n * await FASTElement.define(MyCard, {\n * name: 'my-card',\n * template: html`<my-button>Click me</my-button>`,\n * shadowOptions: MyCard.getShadowOptions(),\n * });\n * ```\n *\n * @public\n */\n",
|
|
704
704
|
"excerptTokens": [
|
|
705
705
|
{
|
|
706
706
|
"kind": "Content",
|
|
@@ -772,7 +772,7 @@
|
|
|
772
772
|
{
|
|
773
773
|
"kind": "Interface",
|
|
774
774
|
"canonicalReference": "@lushly-dev/fast-element!ScopedShadowRootInit:interface",
|
|
775
|
-
"docComment": "/**\n * Extended ShadowRootInit with registry support.\n *\n * @remarks\n *\n * Extends the standard ShadowRootInit to support scoped custom element registries
|
|
775
|
+
"docComment": "/**\n * Extended ShadowRootInit with registry support.\n *\n * @remarks\n *\n * Extends the standard ShadowRootInit to support scoped custom element registries.\n * The `customElementRegistry` property is the native spec key (Safari 26+, Chrome 133+ OT).\n * The `registry` property is deprecated and will be removed in a future version.\n *\n * @public\n */\n",
|
|
776
776
|
"excerptTokens": [
|
|
777
777
|
{
|
|
778
778
|
"kind": "Content",
|
|
@@ -860,7 +860,7 @@
|
|
|
860
860
|
{
|
|
861
861
|
"kind": "Function",
|
|
862
862
|
"canonicalReference": "@lushly-dev/fast-element!supportsScopedRegistries:function(1)",
|
|
863
|
-
"docComment": "/**\n * Robust feature detection for Scoped Custom Element Registries.\n *\n * @remarks\n *\n * Tests the full API surface, not just the constructor existence
|
|
863
|
+
"docComment": "/**\n * Robust feature detection for Scoped Custom Element Registries.\n *\n * @remarks\n *\n * Tests the full API surface, not just the constructor existence.\n * This ensures the browser actually supports attaching a custom registry\n * to a shadow root, which is the critical functionality.\n *\n * @returns true if the browser supports scoped custom element registries\n *\n * @example\n * ```typescript\n * if (supportsScopedRegistries()) {\n * const registry = new CustomElementRegistry();\n * element.attachShadow({ mode: 'open', customElementRegistry: registry });\n * }\n * ```\n *\n * @public\n */\n",
|
|
864
864
|
"excerptTokens": [
|
|
865
865
|
{
|
|
866
866
|
"kind": "Content",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"metadata": {
|
|
3
3
|
"toolPackage": "@microsoft/api-extractor",
|
|
4
|
-
"toolVersion": "7.
|
|
4
|
+
"toolVersion": "7.60.1",
|
|
5
5
|
"schemaVersion": 1011,
|
|
6
6
|
"oldestForwardsCompatibleVersion": 1001,
|
|
7
7
|
"tsdocConfig": {
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
{
|
|
192
192
|
"kind": "Function",
|
|
193
193
|
"canonicalReference": "@lushly-dev/fast-element!getTrustSignals:function(1)",
|
|
194
|
-
"docComment": "/**\n * Extract trust signals from a CustomEvent
|
|
194
|
+
"docComment": "/**\n * Extract trust signals from a CustomEvent.\n * Returns empty object if no trust signals present.\n *\n * @public\n */\n",
|
|
195
195
|
"excerptTokens": [
|
|
196
196
|
{
|
|
197
197
|
"kind": "Content",
|
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
{
|
|
285
285
|
"kind": "Variable",
|
|
286
286
|
"canonicalReference": "@lushly-dev/fast-element!TRUST_KEY:var",
|
|
287
|
-
"docComment": "/**\n * Property key (the string `\"__trust\"`) under which trust metadata is stored in event detail.\n *\n * @public\n */\n",
|
|
287
|
+
"docComment": "/**\n * Property key (the string `\"__trust\"`) under which trust metadata is stored in\n * event detail.\n *\n * @public\n */\n",
|
|
288
288
|
"excerptTokens": [
|
|
289
289
|
{
|
|
290
290
|
"kind": "Content",
|
|
@@ -468,7 +468,7 @@
|
|
|
468
468
|
{
|
|
469
469
|
"kind": "Interface",
|
|
470
470
|
"canonicalReference": "@lushly-dev/fast-element!Warning:interface",
|
|
471
|
-
"docComment": "/**\n * A non-fatal issue surfaced alongside an event.\n *\n * @remarks\n *\n * Local stub that mirrors the `Warning` type of AFD's `CommandResult`; it can be re-exported from `@lushly-dev/afd-core` once that package is a dependency.\n *\n * @public\n */\n",
|
|
471
|
+
"docComment": "/**\n * A non-fatal issue surfaced alongside an event.\n *\n * @remarks\n *\n * Local stub that mirrors the `Warning` type of AFD's `CommandResult`; it can be\n * re-exported from `@lushly-dev/afd-core` once that package is a dependency.\n *\n * @public\n */\n",
|
|
472
472
|
"excerptTokens": [
|
|
473
473
|
{
|
|
474
474
|
"kind": "Content",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lushly-dev/fast-element",
|
|
3
3
|
"description": "A library for constructing Web Components",
|
|
4
|
-
"version": "3.0.1-preview.
|
|
4
|
+
"version": "3.0.1-preview.2",
|
|
5
5
|
"author": "Lushly Dev (forked from Microsoft FAST)",
|
|
6
6
|
"homepage": "https://github.com/lushly-dev/afd/tree/main/foundations/fast-af/packages/element/packages/fast-element#readme",
|
|
7
7
|
"license": "MIT",
|
|
@@ -175,17 +175,15 @@
|
|
|
175
175
|
"@webcomponents/scoped-custom-element-registry": "^0.0.10"
|
|
176
176
|
},
|
|
177
177
|
"devDependencies": {
|
|
178
|
-
"@ast-grep/cli": "^0.51.
|
|
179
|
-
"@biomejs/biome": "^2.
|
|
180
|
-
"@microsoft/api-extractor": "7.
|
|
181
|
-
"@playwright/test": "1.64.
|
|
182
|
-
"@rollup/plugin-terser": "1.0.
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"tslib": "^2.8.1",
|
|
188
|
-
"typescript": "~5.9.3",
|
|
178
|
+
"@ast-grep/cli": "^0.51.1",
|
|
179
|
+
"@biomejs/biome": "^2.6.6",
|
|
180
|
+
"@microsoft/api-extractor": "7.60.1",
|
|
181
|
+
"@playwright/test": "1.64.1",
|
|
182
|
+
"@rollup/plugin-terser": "1.0.2",
|
|
183
|
+
"concurrently": "10.0.7",
|
|
184
|
+
"esbuild": "0.28.2",
|
|
185
|
+
"rollup": "4.68.0",
|
|
186
|
+
"typescript": "^7.0.2",
|
|
189
187
|
"vite": "8.3.5"
|
|
190
188
|
},
|
|
191
189
|
"files": [
|