Skip to content

Commit 540ad04

Browse files
janechuCopilot
andcommitted
fix: restore declarative map extension build
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent dbb4d7b commit 540ad04

11 files changed

Lines changed: 110 additions & 98 deletions

packages/fast-element/src/declarative/attribute-map.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { AttributeDefinition } from "../components/attributes.js";
22
import {
33
type FASTElementDefinition,
4+
type FASTElementExtension,
45
trackLateAttributeDefinition,
5-
FASTElementExtension,
66
} from "../components/fast-definitions.js";
77
import { Observable } from "../observation/observable.js";
88
import { setDefinitionElementOptions } from "./definition-options.js";
Lines changed: 15 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,38 @@
11
---
22
id: "fast-element.attributemap"
3-
title: "AttributeMap class"
3+
title: "attributeMap() function"
44
layout: 3x-api
55
eleventyNavigation:
66
key: "declarative.jsapi3xfast-element.attributemap"
77
parent: "@microsoft/fast-element/declarative.js3x"
8-
title: "AttributeMap class"
8+
title: "attributeMap() function"
99
navigationOptions:
1010
activeKey: "declarative.jsapi3xfast-element.attributemap"
1111
---
1212
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
1313

14-
[@microsoft/fast-element/declarative.js](../fast-element/index.html) &gt; [AttributeMap](../fast-element.attributemap/index.html)
14+
[@microsoft/fast-element/declarative.js](../fast-element/index.html) &gt; [attributeMap](../fast-element.attributemap/index.html)
1515

16-
## AttributeMap class
16+
## attributeMap() function
1717

18-
AttributeMap provides functionality for detecting simple (leaf) properties in a generated JSON schema and defining them as properties on a class prototype.
19-
20-
A property is a candidate for when its schema entry has no nested `properties`<!-- -->, no `type`<!-- -->, and no `anyOf` — i.e. it is a plain binding like {<!-- -->{<!-- -->foo<!-- -->}<!-- -->} or id="<!-- -->{<!-- -->{<!-- -->foo-bar<!-- -->}<!-- -->}<!-- -->".
21-
22-
When `attribute-name-strategy` is `"camelCase"` (the default), the binding key is treated as a camelCase property name and the HTML attribute name is derived by converting it to kebab-case (e.g. property `fooBar` → attribute `foo-bar`<!-- -->). This matches the build-time `attribute-name-strategy` option in `@microsoft/fast-build`<!-- -->.
23-
24-
When `attribute-name-strategy` is `"none"`<!-- -->, the binding key is used as both the attribute name and property name — no normalization is applied.
25-
26-
Properties already decorated with `@attr` or `@observable` on the class are left untouched.
18+
Creates a FAST element extension that enables declarative attribute mapping for the resolved definition. When called without arguments, uses the default attribute-mapping behavior.
2719

2820
**Signature:**
2921

3022
```typescript
31-
export declare class AttributeMap
23+
export declare function attributeMap(option?: AttributeMapConfig): FASTElementExtension;
3224
```
3325

34-
## Constructors
26+
## Parameters
3527

3628
<table><thead><tr><th>
3729

38-
Constructor
30+
Parameter
3931

4032

4133
</th><th>
4234

43-
Modifiers
35+
Type
4436

4537

4638
</th><th>
@@ -51,48 +43,22 @@ Description
5143
</th></tr></thead>
5244
<tbody><tr><td>
5345

54-
[(constructor)(classPrototype, schema, definition, config)](../fast-element.attributemap._constructor_/)
46+
option
5547

5648

5749
</td><td>
5850

51+
[AttributeMapConfig](../fast-element.attributemapconfig/)
52+
5953

6054
</td><td>
6155

62-
Constructs a new instance of the `AttributeMap` class
56+
_(Optional)_
6357

6458

6559
</td></tr>
6660
</tbody></table>
6761

68-
## Methods
69-
70-
<table><thead><tr><th>
71-
72-
Method
62+
**Returns:**
7363

74-
75-
</th><th>
76-
77-
Modifiers
78-
79-
80-
</th><th>
81-
82-
Description
83-
84-
85-
</th></tr></thead>
86-
<tbody><tr><td>
87-
88-
[defineProperties()](../fast-element.attributemap.defineproperties/)
89-
90-
91-
</td><td>
92-
93-
94-
</td><td>
95-
96-
97-
</td></tr>
98-
</tbody></table>
64+
[FASTElementExtension](../fast-element.fastelementextension/)

sites/website/src/docs/3.x/api/fast-element/declarative/fast-element.elementoptions.attributemap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ navigationOptions:
1919

2020
```typescript
2121
attributeMap?: AttributeMapConfig;
22-
```
22+
```

sites/website/src/docs/3.x/api/fast-element/declarative/fast-element.elementoptions.observermap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ navigationOptions:
1919

2020
```typescript
2121
observerMap?: ObserverMapConfig;
22-
```
22+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
id: "fast-element.fastelementextension"
3+
title: "FASTElementExtension type"
4+
layout: 3x-api
5+
eleventyNavigation:
6+
key: "declarative.jsapi3xfast-element.fastelementextension"
7+
parent: "@microsoft/fast-element/declarative.js3x"
8+
title: "FASTElementExtension type"
9+
navigationOptions:
10+
activeKey: "declarative.jsapi3xfast-element.fastelementextension"
11+
---
12+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
13+
14+
[@microsoft/fast-element/declarative.js](../fast-element/index.html) &gt; [FASTElementExtension](../fast-element.fastelementextension/index.html)
15+
16+
## FASTElementExtension type
17+
18+
A callback that receives a FASTElementDefinition during element registration. Extensions are invoked before the element is registered with the platform, allowing plugins to inspect or act on the resolved definition.
19+
20+
**Signature:**
21+
22+
```typescript
23+
export type FASTElementExtension = (definition: FASTElementDefinition) => void;
24+
```

sites/website/src/docs/3.x/api/fast-element/declarative/fast-element.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,43 @@ This class is intentionally stateless across invocations — all mutable parsing
9595
The parsing pipeline is fully synchronous — no promises are allocated during template resolution.
9696

9797

98+
</td></tr>
99+
</tbody></table>
100+
101+
## Functions
102+
103+
<table><thead><tr><th>
104+
105+
Function
106+
107+
108+
</th><th>
109+
110+
Description
111+
112+
113+
</th></tr></thead>
114+
<tbody><tr><td>
115+
116+
[attributeMap(option)](../fast-element.attributemap/)
117+
118+
119+
</td><td>
120+
121+
Creates a FAST element extension that enables declarative attribute mapping for the resolved definition. When called without arguments, uses the default attribute-mapping behavior.
122+
123+
124+
</td></tr>
125+
<tr><td>
126+
127+
[observerMap(option)](../fast-element.observermap/)
128+
129+
130+
</td><td>
131+
132+
Creates a FAST element extension that enables declarative observer mapping for the resolved definition. When called without arguments, observes every discovered root property.
133+
134+
98135
</td></tr>
99136
</tbody></table>
100137

@@ -250,6 +287,17 @@ Description
250287
</td><td>
251288

252289

290+
</td></tr>
291+
<tr><td>
292+
293+
[FASTElementExtension](../fast-element.fastelementextension/)
294+
295+
296+
</td><td>
297+
298+
A callback that receives a FASTElementDefinition during element registration. Extensions are invoked before the element is registered with the platform, allowing plugins to inspect or act on the resolved definition.
299+
300+
253301
</td></tr>
254302
<tr><td>
255303

Lines changed: 15 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
---
22
id: "fast-element.observermap"
3-
title: "ObserverMap class"
3+
title: "observerMap() function"
44
layout: 3x-api
55
eleventyNavigation:
66
key: "declarative.jsapi3xfast-element.observermap"
77
parent: "@microsoft/fast-element/declarative.js3x"
8-
title: "ObserverMap class"
8+
title: "observerMap() function"
99
navigationOptions:
1010
activeKey: "declarative.jsapi3xfast-element.observermap"
1111
---
1212
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
1313

14-
[@microsoft/fast-element/declarative.js](../fast-element/index.html) &gt; [ObserverMap](../fast-element.observermap/index.html)
14+
[@microsoft/fast-element/declarative.js](../fast-element/index.html) &gt; [observerMap](../fast-element.observermap/index.html)
1515

16-
## ObserverMap class
16+
## observerMap() function
1717

18-
ObserverMap provides functionality for caching binding paths, extracting root properties, and defining observable properties on class prototypes
18+
Creates a FAST element extension that enables declarative observer mapping for the resolved definition. When called without arguments, observes every discovered root property.
1919

2020
**Signature:**
2121

2222
```typescript
23-
export declare class ObserverMap
23+
export declare function observerMap(option?: ObserverMapConfig): FASTElementExtension;
2424
```
2525

26-
## Constructors
26+
## Parameters
2727

2828
<table><thead><tr><th>
2929

30-
Constructor
30+
Parameter
3131

3232

3333
</th><th>
3434

35-
Modifiers
35+
Type
3636

3737

3838
</th><th>
@@ -43,48 +43,22 @@ Description
4343
</th></tr></thead>
4444
<tbody><tr><td>
4545

46-
[(constructor)(classPrototype, schema, config)](../fast-element.observermap._constructor_/)
46+
option
4747

4848

4949
</td><td>
5050

51+
[ObserverMapConfig](../fast-element.observermapconfig/)
52+
5153

5254
</td><td>
5355

54-
Constructs a new instance of the `ObserverMap` class
56+
_(Optional)_
5557

5658

5759
</td></tr>
5860
</tbody></table>
5961

60-
## Methods
61-
62-
<table><thead><tr><th>
63-
64-
Method
65-
66-
67-
</th><th>
68-
69-
Modifiers
70-
71-
72-
</th><th>
73-
74-
Description
75-
62+
**Returns:**
7663

77-
</th></tr></thead>
78-
<tbody><tr><td>
79-
80-
[defineProperties()](../fast-element.observermap.defineproperties/)
81-
82-
83-
</td><td>
84-
85-
86-
</td><td>
87-
88-
89-
</td></tr>
90-
</tbody></table>
64+
[FASTElementExtension](../fast-element.fastelementextension/)

sites/website/src/docs/3.x/api/fast-element/declarative/fast-element.observermapconfig.properties.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ Per-root-property observation control. Keys are root property names discovered i
2323
properties?: {
2424
[rootProperty: string]: ObserverMapPathEntry;
2525
};
26-
```
26+
```

sites/website/src/docs/3.x/api/fast-element/declarative/fast-element.templateelement.elementoptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ navigationOptions:
1515

1616
## TemplateElement.elementOptions property
1717

18-
A dictionary of custom element options
18+
A dictionary of fallback custom element options
1919

2020
**Signature:**
2121

sites/website/src/docs/3.x/api/fast-element/declarative/fast-element.templateelement.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Description
100100
101101
</td><td>
102102
103-
A dictionary of custom element options
103+
A dictionary of fallback custom element options
104104
105105
106106
</td></tr>
@@ -183,7 +183,7 @@ Configure lifecycle callbacks for hydration events.
183183
184184
</td><td>
185185
186-
Set options for custom elements.
186+
Set fallback options for custom elements.
187187
188188
189189
</td></tr>

0 commit comments

Comments
 (0)