@supersoniks/concorde 4.9.1 → 4.9.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.
Files changed (106) hide show
  1. package/build-infos.json +1 -1
  2. package/concorde-core.bundle.js +106 -106
  3. package/concorde-core.es.js +4 -7
  4. package/dist/concorde-core.bundle.js +106 -106
  5. package/dist/concorde-core.es.js +4 -7
  6. package/dist/docs-mock-api-sw.js +1 -0
  7. package/dist/js/core/utils/HTML.js +4 -5
  8. package/dist/js/core/utils/HTML.js.map +1 -1
  9. package/dist/robots.txt +15 -1
  10. package/dist/types/core/utils/HTML.d.ts.map +1 -1
  11. package/docs/assets/{index-CZLTFws2.css → index-Bnp7gVaA.css} +1 -1
  12. package/docs/assets/{index-nkkwC13U.js → index-hElUgV9_.js} +505 -438
  13. package/docs/crawl/core/components/functional/date/date.html +190 -0
  14. package/docs/crawl/core/components/functional/fetch/fetch.html +109 -0
  15. package/docs/crawl/core/components/functional/if/if.html +27 -0
  16. package/docs/crawl/core/components/functional/list/list.html +70 -0
  17. package/docs/crawl/core/components/functional/mix/mix.html +45 -0
  18. package/docs/crawl/core/components/functional/queue/queue.html +96 -0
  19. package/docs/crawl/core/components/functional/router/router.html +106 -0
  20. package/docs/crawl/core/components/functional/sdui/sdui.html +269 -0
  21. package/docs/crawl/core/components/functional/states/states.html +66 -0
  22. package/docs/crawl/core/components/functional/submit/submit.html +160 -0
  23. package/docs/crawl/core/components/functional/subscriber/subscriber.html +67 -0
  24. package/docs/crawl/core/components/functional/value/value.html +51 -0
  25. package/docs/crawl/core/components/ui/alert/alert.html +110 -0
  26. package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +23 -0
  27. package/docs/crawl/core/components/ui/badge/badge.html +119 -0
  28. package/docs/crawl/core/components/ui/button/button.html +149 -0
  29. package/docs/crawl/core/components/ui/captcha/captcha.html +30 -0
  30. package/docs/crawl/core/components/ui/card/card.html +99 -0
  31. package/docs/crawl/core/components/ui/divider/divider.html +58 -0
  32. package/docs/crawl/core/components/ui/form/checkbox/checkbox.html +73 -0
  33. package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +135 -0
  34. package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +79 -0
  35. package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +62 -0
  36. package/docs/crawl/core/components/ui/form/input/input.html +109 -0
  37. package/docs/crawl/core/components/ui/form/input-autocomplete/input-autocomplete.html +106 -0
  38. package/docs/crawl/core/components/ui/form/radio/radio.html +56 -0
  39. package/docs/crawl/core/components/ui/form/select/select.html +73 -0
  40. package/docs/crawl/core/components/ui/form/switch/switch.html +56 -0
  41. package/docs/crawl/core/components/ui/form/textarea/textarea.html +59 -0
  42. package/docs/crawl/core/components/ui/group/group.html +82 -0
  43. package/docs/crawl/core/components/ui/icon/icon.html +133 -0
  44. package/docs/crawl/core/components/ui/image/image.html +110 -0
  45. package/docs/crawl/core/components/ui/link/link.html +42 -0
  46. package/docs/crawl/core/components/ui/loader/loader.html +50 -0
  47. package/docs/crawl/core/components/ui/menu/menu.html +322 -0
  48. package/docs/crawl/core/components/ui/modal/modal.html +117 -0
  49. package/docs/crawl/core/components/ui/pop/pop.html +102 -0
  50. package/docs/crawl/core/components/ui/progress/progress.html +58 -0
  51. package/docs/crawl/core/components/ui/table/table.html +413 -0
  52. package/docs/crawl/core/components/ui/toast/toast.html +122 -0
  53. package/docs/crawl/core/components/ui/tooltip/tooltip.html +79 -0
  54. package/docs/crawl/docs/_core-concept/dataFlow.html +166 -0
  55. package/docs/crawl/docs/_core-concept/overview.html +66 -0
  56. package/docs/crawl/docs/_core-concept/subscriber.html +75 -0
  57. package/docs/crawl/docs/_decorators/ancestor-attribute.html +116 -0
  58. package/docs/crawl/docs/_decorators/auto-subscribe.html +202 -0
  59. package/docs/crawl/docs/_decorators/bind.html +141 -0
  60. package/docs/crawl/docs/_decorators/get.html +120 -0
  61. package/docs/crawl/docs/_decorators/handle.html +165 -0
  62. package/docs/crawl/docs/_decorators/on-assign.html +355 -0
  63. package/docs/crawl/docs/_decorators/patch.html +52 -0
  64. package/docs/crawl/docs/_decorators/post.html +102 -0
  65. package/docs/crawl/docs/_decorators/publish.html +61 -0
  66. package/docs/crawl/docs/_decorators/put.html +49 -0
  67. package/docs/crawl/docs/_decorators/subscribe.html +109 -0
  68. package/docs/crawl/docs/_decorators/wait-for-ancestors.html +137 -0
  69. package/docs/crawl/docs/_directives/sub.html +93 -0
  70. package/docs/crawl/docs/_getting-started/ai-agents.html +134 -0
  71. package/docs/crawl/docs/_getting-started/concorde-manual-install.html +100 -0
  72. package/docs/crawl/docs/_getting-started/concorde-outside.html +58 -0
  73. package/docs/crawl/docs/_getting-started/create-a-component.html +111 -0
  74. package/docs/crawl/docs/_getting-started/my-first-component.html +189 -0
  75. package/docs/crawl/docs/_getting-started/my-first-subscriber.html +110 -0
  76. package/docs/crawl/docs/_getting-started/pubsub.html +62 -0
  77. package/docs/crawl/docs/_getting-started/start.html +76 -0
  78. package/docs/crawl/docs/_getting-started/theming.html +85 -0
  79. package/docs/crawl/docs/_misc/api-configuration.html +149 -0
  80. package/docs/crawl/docs/_misc/dataProviderKey.html +135 -0
  81. package/docs/crawl/docs/_misc/docs-mock-api.html +146 -0
  82. package/docs/crawl/docs/_misc/dynamic-path.html +180 -0
  83. package/docs/crawl/docs/_misc/endpoint.html +50 -0
  84. package/docs/crawl/docs/_misc/html-integration.html +47 -0
  85. package/docs/crawl/hubs/decorators.html +467 -0
  86. package/docs/crawl/hubs/form-components.html +357 -0
  87. package/docs/crawl/hubs/remote-data.html +374 -0
  88. package/docs/crawl/index.html +99 -0
  89. package/docs/docs-mock-api-sw.js +3 -1
  90. package/docs/docs-mock-api-sw.js.map +2 -2
  91. package/docs/index.html +3 -2
  92. package/docs/llms-full.txt +5423 -0
  93. package/docs/llms.txt +102 -0
  94. package/docs/robots.txt +15 -1
  95. package/docs/sitemap.xml +231 -0
  96. package/docs/src/docs/_decorators/get.md +47 -1
  97. package/docs/src/docs/search/docs-search.json +31 -1
  98. package/index.html +1 -0
  99. package/package.json +1 -1
  100. package/public/docs-mock-api-sw.js +1 -0
  101. package/public/robots.txt +15 -1
  102. package/scripts/generate-crawl-docs.mjs +569 -0
  103. package/scripts/post-build-docs.js +18 -14
  104. package/src/core/decorators/subscriber/ancestorAttribute.spec.ts +42 -0
  105. package/src/core/utils/HTML.ts +4 -5
  106. package/src/docs/search/docs-search.json +61 -1
@@ -0,0 +1,467 @@
1
+ <!DOCTYPE html>
2
+ <html lang="fr" data-crawl-url="https://concorde.supersoniks.org/crawl/hubs/decorators.html" data-doc-id="hubs/decorators">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Concorde decorators reference — Concorde</title>
7
+ <meta name="description" content="Hub for all Concorde Lit decorators: @get @post @put @patch @subscribe @publish @bind @handle and related. Use this page when asking about any decorator.">
8
+ <meta name="keywords" content="decorator, @get, @post, @put, @patch, @subscribe, @publish, @bind, @handle, ApiResult, Endpoint, DataProviderKey">
9
+ <meta name="concorde-doc-id" content="hubs/decorators">
10
+ <link rel="canonical" href="https://concorde.supersoniks.org/crawl/hubs/decorators.html">
11
+ </head>
12
+ <body>
13
+ <header>
14
+ <p><a href="../index.html">Concorde documentation (crawl)</a></p>
15
+ </header>
16
+ <main>
17
+ <article>
18
+ <p class="doc-lead" id="doc-summary"><strong>Concorde documentation — Concorde decorators reference</strong>. Hub for all Concorde Lit decorators: @get @post @put @patch @subscribe @publish @bind @handle and related. Use this page when asking about any decorator. <span>Doc ID: <code>hubs/decorators</code>. Keywords: decorator, @get, @post, @put, @patch, @subscribe, @publish, @bind, @handle, ApiResult, Endpoint, DataProviderKey. URL: <a href="https://concorde.supersoniks.org/crawl/hubs/decorators.html">https://concorde.supersoniks.org/crawl/hubs/decorators.html</a>.</span></p>
19
+ <section id="docs-_decorators-ancestor-attribute" data-doc-id="docs/_decorators/ancestor-attribute">
20
+ <h2><a href="../docs/_decorators/ancestor-attribute.html">@ancestorAttribute</a></h2>
21
+ <p><strong>Doc ID:</strong> <code>docs/_decorators/ancestor-attribute</code> · <a href="../docs/_decorators/ancestor-attribute.html">full page</a></p>
22
+ <p>The @ancestorAttribute decorator automatically injects the value of an ancestor's attribute into a class property at the time of connectedCallback.</p>
23
+ <pre class="doc-excerpt">@ancestorAttribute
24
+
25
+ The @ancestorAttribute decorator automatically injects the value of an ancestor's attribute into a class property at the time of connectedCallback.
26
+
27
+ Principle
28
+
29
+ This decorator uses HTML.getAncestorAttributeValue to traverse up the DOM tree from the current element and find the first ancestor that has the specified attribute. The value of this attribute is then assigned to the decorated property.
30
+
31
+ Usage
32
+
33
+ Import
34
+
35
+ import { ancestorAttribute } from &quot;@supersoniks/concorde/decorators&quot;;
36
+
37
+ Basic example
38
+
39
+ The component reads dataProvider and testAttribute from its ancestor wrapper. By default (dynamic: false), values are read once at connect.
40
+
41
+ import { html, LitElement } from &quot;lit&quot;;
42
+ import { customElement } from &quot;lit/decorators.js&quot;;
43
+ import { ancestorAttribute } from &quot;@supersoniks/concorde/decorators&quot;;
44
+
45
+ @customElement(&quot;demo-ancestor-attribute&quot;)
46
+ export class DemoAncestorAttribute extends LitElement {
47
+ @ancestorAttribute(&quot;dataProvider&quot;)
48
+ dataProvider: string | null = null;
49
+
50
+ @ancestorAttribute(&quot;testAttribute&quot;)
51
+ testAttribute: string | null = null;
52
+
53
+ render() {
54
+ return html
55
+ dataProvider: ${this.dataProvider ?? &quot;null&quot;}
56
+ testAttribute: ${this.testAttribute</pre>
57
+ </section>
58
+ <section id="docs-_decorators-auto-subscribe" data-doc-id="docs/_decorators/auto-subscribe">
59
+ <h2><a href="../docs/_decorators/auto-subscribe.html">@autoSubscribe</a></h2>
60
+ <p><strong>Doc ID:</strong> <code>docs/_decorators/auto-subscribe</code> · <a href="../docs/_decorators/auto-subscribe.html">full page</a></p>
61
+ <p>&gt; Legacy: prefer @subscribe + DataProviderKey. Examples below may still show PublisherManager for existing codebases.</p>
62
+ <pre class="doc-excerpt">@autoSubscribe
63
+
64
+ &gt; Legacy: prefer @subscribe + DataProviderKey. Examples below may still show PublisherManager for existing codebases.
65
+
66
+ The @autoSubscribe decorator automatically detects which publishers are accessed within a method and subscribes to them. When any of these publishers change, the method is automatically re-executed.
67
+
68
+ Principle
69
+
70
+ This decorator wraps a method to track which publishers are accessed during its execution. It then subscribes to all accessed publishers, and when any of them change, the method is re-executed. This provides automatic reactivity without manually managing subscriptions.
71
+
72
+ Usage
73
+
74
+ Import
75
+
76
+ import { autoSubscribe } from &quot;@supersoniks/concorde/decorators&quot;;
77
+
78
+ Basic example
79
+
80
+ @customElement(&quot;demo-auto-subscribe&quot;)
81
+ export class DemoAutoSubscribe extends LitElement {
82
+ static styles = [tailwind];
83
+
84
+ @state() displayText: string = &quot;&quot;;
85
+ @state() computedValue: number = 0;
86
+
87
+ @autoSubscribe()
88
+ updateDisplay() {
89
+ const value1 = PublisherManager.get(&quot;autoValue1&quot;).get() || 0;
90
+ const value2 = PublisherManager.get(&quot;autoValue2&quot;).get() || 0;
91
+ this.computedValue = value1 + value2;
92
+ this.displayText = ${value1} + ${value2} = ${this.computedValue};
93
+ }
94
+
95
+ </pre>
96
+ </section>
97
+ <section id="docs-_decorators-bind" data-doc-id="docs/_decorators/bind">
98
+ <h2><a href="../docs/_decorators/bind.html">@bind</a></h2>
99
+ <p><strong>Doc ID:</strong> <code>docs/_decorators/bind</code> · <a href="../docs/_decorators/bind.html">full page</a></p>
100
+ <p>Binds a class property to a path in a publisher. The property updates when publisher data changes.</p>
101
+ <pre class="doc-excerpt">@bind
102
+
103
+ Binds a class property to a path in a publisher. The property updates when publisher data changes.
104
+
105
+ For Lit re-renders, also add @state() on the same property.
106
+
107
+ See also: @subscribe, @handle, @publish, @get, @post, @put, @patch.
108
+
109
+ Principle
110
+
111
+ The decorator subscribes to the DataProvider store using dot notation or a DataProviderKey. Updates flow into the decorated property (Data flow).
112
+
113
+ Import
114
+
115
+ import { bind } from &quot;@supersoniks/concorde/decorators&quot;;
116
+
117
+ Example
118
+
119
+ @customElement(&quot;demo-bind&quot;)
120
+ export class DemoBind extends LitElement {
121
+ static styles = [tailwind];
122
+
123
+ @bind(&quot;demoData.firstName&quot;)
124
+ @state()
125
+ firstName = &quot;&quot;;
126
+
127
+ @bind(&quot;demoData.lastName&quot;)
128
+ @state()
129
+ lastName: string = &quot;&quot;;
130
+
131
+ @bind(&quot;demoData.count&quot;)
132
+ @state()
133
+ count: number = 0;
134
+
135
+ render() {
136
+ return //......
137
+ }
138
+
139
+ updateData() {
140
+ set(demoDataKey, { ...get(demoDataKey), count: get(demoDataKey).count + 1 });
141
+ // see demo-bind in src/docs/example/decorators-demo-bind-demos.ts
142
+ const randomIndex = Math.floor(Math.random() demoUsers.get().length);
143
+ const randomUser = demoUsers.get()[randomIndex];
144
+ demoData.set({
145
+ firstName: randomUser.firstName,
146
+ lastName: randomUser.lastName,
147
+ count:</pre>
148
+ </section>
149
+ <section id="docs-_decorators-get" data-doc-id="docs/_decorators/get">
150
+ <h2><a href="../docs/_decorators/get.html">@get</a></h2>
151
+ <p><strong>Doc ID:</strong> <code>docs/_decorators/get</code> · <a href="../docs/_decorators/get.html">full page</a></p>
152
+ <p>Loads data through API.getDetailed. The decorated property is ApiResult&lt;T&gt; | null: request, response (or null for dataProvider(...) resolution without HTTP), and typed result.</p>
153
+ <pre class="doc-excerpt">@get
154
+
155
+ Loads data through API.getDetailed. The decorated property is ApiResult | null: request, response (or null for dataProvider(...) resolution without HTTP), and typed result.
156
+
157
+ Pass an Endpoint as the first argument. Import get and ApiResult from @supersoniks/concorde/decorators, and Endpoint from @supersoniks/concorde/utils/endpoint.
158
+
159
+ Configuration
160
+
161
+ - Default: HTML.getApiConfiguration(host) (ancestor serviceURL, etc.).
162
+ - Second argument: DataProviderKey — config is read from the publisher at the resolved path; internal mutations trigger another GET. See API configuration for mock demos.
163
+
164
+ Dynamic path
165
+
166
+ ${prop} on the endpoint or config key is resolved on the host. While a placeholder is null or undefined, no GET runs. Optional skipEmptyPlaceholder: true also blocks &quot;&quot; (empty string only). Details: Dynamic path placeholders.
167
+
168
+ Options (GetOptions)
169
+
170
+ Pass as the second argument (scoped config) or third (with a configuration key). Same shape as send decorators where applicable:
171
+
172
+ | Option | Description |
173
+ |--------|-------------|
174
+ | skipEmptyPlaceholder | Treat &quot;&quot; as not ready (see Dynamic path). |
175
+ | refetchEveryMs | Automatic polling interval (ms). 0 or omitted = no polling. |
176
+ | tri</pre>
177
+ </section>
178
+ <section id="docs-_decorators-handle" data-doc-id="docs/_decorators/handle">
179
+ <h2><a href="../docs/_decorators/handle.html">@handle</a></h2>
180
+ <p><strong>Doc ID:</strong> <code>docs/_decorators/handle</code> · <a href="../docs/_decorators/handle.html">full page</a></p>
181
+ <p>Typed callback on one or more DataProviderKey&lt;T&gt; paths: invokes the decorated method when a publisher assigns a value (calculations, side effects, updating other @state properties, etc.).</p>
182
+ <pre class="doc-excerpt">@handle
183
+
184
+ Typed callback on one or more DataProviderKey paths: invokes the decorated method when a publisher assigns a value (calculations, side effects, updating other @state properties, etc.).
185
+
186
+ Unlike @subscribe, nothing is bound to the decorated member — only your method runs. @handle is typed and accepts up to 3 keys plus an optional trailing HandleOptions object. It supersedes the string-based @onAssign.
187
+
188
+ By default the method is called on every assignment, even when the value is null / undefined. Use the options below to restrict that.
189
+
190
+ Import
191
+
192
+ import { handle, Skip } from &quot;@supersoniks/concorde/decorators&quot;;
193
+ import { DataProviderKey } from &quot;@supersoniks/concorde/dataProviderKey&quot;;
194
+ import { get, set } from &quot;@supersoniks/concorde/utils&quot;;
195
+
196
+ Basic example
197
+
198
+ type DemoCounterData = { count: number };
199
+ const demoDataKey = new DataProviderKey&amp;lt;DemoCounterData&amp;gt;(&quot;demoData&quot;);
200
+
201
+ @customElement(&quot;demo-handle&quot;)
202
+ export class DemoHandle extends LitElement {
203
+ @state() doubled = 0;
204
+ @state() lastUpdate = &quot;&quot;;
205
+
206
+ @handle(demoDataKey.count)
207
+ onCountChange(count: number) {
208
+ this.doubled = count 2;
209
+ this.lastUpdate = new Date().toLocaleTimeString();
210
+ }
211
+
212
+ incrementCount() {
213
+ const data</pre>
214
+ </section>
215
+ <section id="docs-_decorators-on-assign" data-doc-id="docs/_decorators/on-assign">
216
+ <h2><a href="../docs/_decorators/on-assign.html">@onAssign</a></h2>
217
+ <p><strong>Doc ID:</strong> <code>docs/_decorators/on-assign</code> · <a href="../docs/_decorators/on-assign.html">full page</a></p>
218
+ <p>&gt; New apps: use @handle with DataProviderKey (Data flow). @onAssign uses untyped string paths; it remains documented for existing codebases — see Migrating to @handle below.</p>
219
+ <pre class="doc-excerpt">@onAssign
220
+
221
+ &gt; New apps: use @handle with DataProviderKey (Data flow). @onAssign uses untyped string paths; it remains documented for existing codebases — see Migrating to @handle below.
222
+
223
+ The @onAssign decorator allows you to execute a method when one or more publishers are updated. The method is called only when all specified publishers have been assigned values.
224
+
225
+ For a typed equivalent (recommended), use @handle.
226
+
227
+ Principle
228
+
229
+ This decorator subscribes to one or more publishers by string path (legacy). When all specified publishers have been assigned values (via set), the decorated method is called with all the values as arguments. Prefer @handle + DataProviderKey and get / set from Data flow.
230
+
231
+ This is particularly useful when you need to wait for multiple data sources to be ready before executing logic.
232
+
233
+ Usage
234
+
235
+ Import
236
+
237
+ import { onAssign } from &quot;@supersoniks/concorde/decorators&quot;;
238
+
239
+ Basic example
240
+
241
+ //...
242
+ @customElement(&quot;demo-on-assign&quot;)
243
+ export class DemoOnAssign extends LitElement {
244
+ static styles = [tailwind];
245
+
246
+ @state() userWithSettings: any = null;
247
+ @state() isReady: boolean = false;
248
+ @state() lastUpdate: string = &quot;&quot;;
249
+
250
+ @onAssign(&quot;demoUser&quot;, &quot;demoUserSettings&quot;)
251
+ handleDataReady</pre>
252
+ </section>
253
+ <section id="docs-_decorators-patch" data-doc-id="docs/_decorators/patch">
254
+ <h2><a href="../docs/_decorators/patch.html">@patch</a></h2>
255
+ <p><strong>Doc ID:</strong> <code>docs/_decorators/patch</code> · <a href="../docs/_decorators/patch.html">full page</a></p>
256
+ <p>Sends data through API.patchDetailed. Same model as @post: decorated property is ApiResult&lt;T&gt; | null (request, response, result).</p>
257
+ <pre class="doc-excerpt">@patch
258
+
259
+ Sends data through API.patchDetailed. Same model as @post: decorated property is ApiResult | null (request, response, result).
260
+
261
+ Pass an Endpoint and a DataProviderKey for the request body. Import patch and ApiResult from @supersoniks/concorde/decorators.
262
+
263
+ Configuration
264
+
265
+ Same as @post / @get: scoped HTML.getApiConfiguration(host) or DataProviderKey as third argument.
266
+
267
+ Options (PatchOptions)
268
+
269
+ Same shape as PostOptions on @post (ApiSendOptions): refetchEveryMs, skipIfBodyMissing, autoPostOnBodyMutation, triggerKey, skipEmptyPlaceholder. See Dynamic path placeholders for ${sessionId} and empty-string behaviour.
270
+
271
+ Import
272
+
273
+ import { patch, type ApiResult } from &quot;@supersoniks/concorde/decorators&quot;;
274
+ import { Endpoint } from &quot;@supersoniks/concorde/utils/endpoint&quot;;
275
+ import { DataProviderKey } from &quot;@supersoniks/concorde/dataProviderKey&quot;;
276
+
277
+ Example
278
+
279
+ const patchBodyKey = new DataProviderKey&amp;lt;Partial&amp;lt;Resource&amp;gt;&amp;gt;(&quot;resourcePatch&quot;);
280
+
281
+ @patch(
282
+ new Endpoint&amp;lt;Resource, { resourceId: string }&amp;gt;(&quot;resources/${resourceId}&quot;),
283
+ patchBodyKey,
284
+ { skipEmptyPlaceholder: true },
285
+ )
286
+ @state()
287
+ payload?: ApiResult&amp;lt;Resource&amp;gt; | null;
288
+
289
+ See also
290
+
291
+ - @post — POST (live demos)
292
+ - @put — full rep</pre>
293
+ </section>
294
+ <section id="docs-_decorators-post" data-doc-id="docs/_decorators/post">
295
+ <h2><a href="../docs/_decorators/post.html">@post</a></h2>
296
+ <p><strong>Doc ID:</strong> <code>docs/_decorators/post</code> · <a href="../docs/_decorators/post.html">full page</a></p>
297
+ <p>Sends data through API.postDetailed. The decorated property is ApiResult&lt;T&gt; | null: request, response, and typed result.</p>
298
+ <pre class="doc-excerpt">@post
299
+
300
+ Sends data through API.postDetailed. The decorated property is ApiResult | null: request, response, and typed result.
301
+
302
+ Pass an Endpoint as the first argument and a DataProviderKey for the request body as the second. Import post and ApiResult from @supersoniks/concorde/decorators, and Endpoint from @supersoniks/concorde/utils/endpoint.
303
+
304
+ Configuration
305
+
306
+ Same as @get: scoped HTML.getApiConfiguration(host) by default, or DataProviderKey as third argument. See API configuration for mock demos.
307
+
308
+ Optional PostOptions (third or fourth argument)
309
+
310
+ | Option | Description |
311
+ |--------|-------------|
312
+ | refetchEveryMs | Re-post on an interval (ms). |
313
+ | skipIfBodyMissing | Skip when body publisher is null/undefined (default: true). |
314
+ | autoPostOnBodyMutation | Re-post when the body publisher mutates (default: true). false = manual via triggerKey.invalidate(). |
315
+ | skipEmptyPlaceholder | If true, a placeholder resolved to '' blocks the request (empty string only — not 0 or false). See Dynamic paths. |
316
+ | triggerKey | DataProviderKey — invalidate() re-runs the POST with the current body. |
317
+
318
+ When the POST runs again
319
+
320
+ - Body publisher onInternalMutation when autoPostOnBodyMutation is true (defa</pre>
321
+ </section>
322
+ <section id="docs-_decorators-publish" data-doc-id="docs/_decorators/publish">
323
+ <h2><a href="../docs/_decorators/publish.html">@publish</a></h2>
324
+ <p><strong>Doc ID:</strong> <code>docs/_decorators/publish</code> · <a href="../docs/_decorators/publish.html">full page</a></p>
325
+ <p>Write-only binding: assigning to the property publishes to the DataProviderKey path. No read subscription (inverse of @subscribe).</p>
326
+ <pre class="doc-excerpt">@publish
327
+
328
+ Write-only binding: assigning to the property publishes to the DataProviderKey path. No read subscription (inverse of @subscribe).
329
+
330
+ Similar to the “reflect” half of @bind without listening to the publisher.
331
+
332
+ Import
333
+
334
+ import { publish } from &quot;@supersoniks/concorde/decorators&quot;;
335
+ import { sub } from &quot;@supersoniks/concorde/directives&quot;;
336
+ import { DataProviderKey } from &quot;@supersoniks/concorde/dataProviderKey&quot;;
337
+
338
+ Example
339
+
340
+ type PublishDemoData = { email: string; message: string };
341
+ const publishDemoKey = new DataProviderKey (&quot;publishDemo&quot;);
342
+ //
343
+ @customElement(&quot;demo-publish&quot;)
344
+ export class DemoPublish extends LitElement {
345
+ @publish(publishDemoKey.email)
346
+ @state()
347
+ email = &quot;&quot;;
348
+ //
349
+ @publish(publishDemoKey.message)
350
+ @state()
351
+ message = &quot;&quot;;
352
+ //
353
+ render() {
354
+ return html
355
+ (this.email = (e.target as HTMLInputElement).value)}
356
+ label=&quot;Email&quot;
357
+ &gt;
358
+ ${sub(publishDemoKey.email)}
359
+ ;
360
+ }
361
+ }
362
+
363
+ Dynamic paths use the same placeholder rules as @bind / @subscribe. Resolution and skipEmptyPlaceholder: Dynamic path placeholders.</pre>
364
+ </section>
365
+ <section id="docs-_decorators-put" data-doc-id="docs/_decorators/put">
366
+ <h2><a href="../docs/_decorators/put.html">@put</a></h2>
367
+ <p><strong>Doc ID:</strong> <code>docs/_decorators/put</code> · <a href="../docs/_decorators/put.html">full page</a></p>
368
+ <p>Sends data through API.putDetailed. Same model as @post: decorated property is ApiResult&lt;T&gt; | null (request, response, result).</p>
369
+ <pre class="doc-excerpt">@put
370
+
371
+ Sends data through API.putDetailed. Same model as @post: decorated property is ApiResult | null (request, response, result).
372
+
373
+ Pass an Endpoint and a DataProviderKey for the request body. Import put and ApiResult from @supersoniks/concorde/decorators.
374
+
375
+ Configuration
376
+
377
+ Same as @post / @get: scoped HTML.getApiConfiguration(host) or DataProviderKey as third argument.
378
+
379
+ Options (PutOptions)
380
+
381
+ Same shape as PostOptions on @post (ApiSendOptions): refetchEveryMs, skipIfBodyMissing, autoPostOnBodyMutation, triggerKey, skipEmptyPlaceholder. See Dynamic path placeholders for ${sessionId} and empty-string behaviour.
382
+
383
+ Import
384
+
385
+ import { put, type ApiResult } from &quot;@supersoniks/concorde/decorators&quot;;
386
+ import { Endpoint } from &quot;@supersoniks/concorde/utils/endpoint&quot;;
387
+ import { DataProviderKey } from &quot;@supersoniks/concorde/dataProviderKey&quot;;
388
+
389
+ Example
390
+
391
+ const bodyKey = new DataProviderKey&amp;lt;UpdatePayload&amp;gt;(&quot;resourceBody&quot;);
392
+
393
+ @put(new Endpoint&amp;lt;Resource, { resourceId: string }&amp;gt;(&quot;resources/${resourceId}&quot;), bodyKey)
394
+ @state()
395
+ payload?: ApiResult&amp;lt;Resource&amp;gt; | null;
396
+
397
+ Changing resourceId on the host re-runs the PUT when the path becomes ready — see Dynamic path placeholders.
398
+
399
+ See also
400
+
401
+ - @post —</pre>
402
+ </section>
403
+ <section id="docs-_decorators-subscribe" data-doc-id="docs/_decorators/subscribe">
404
+ <h2><a href="../docs/_decorators/subscribe.html">@subscribe</a></h2>
405
+ <p><strong>Doc ID:</strong> <code>docs/_decorators/subscribe</code> · <a href="../docs/_decorators/subscribe.html">full page</a></p>
406
+ <p>Keeps a Lit property in sync with a read-only slice of the DataProvider store. You pass a DataProviderKey; when that path changes, the property updates and the component re-renders.</p>
407
+ <pre class="doc-excerpt">@subscribe
408
+
409
+ Keeps a Lit property in sync with a read-only slice of the DataProvider store. You pass a DataProviderKey; when that path changes, the property updates and the component re-renders.
410
+
411
+ Typical setup (same idea as My first component):
412
+
413
+ | Piece | Role |
414
+ |-------|------|
415
+ | Type T | Shape of the object at that path (DocsUserData, { count: number }, …) |
416
+ | Key | DataProviderKey — static path (&quot;cart&quot;) or dynamic (&quot;users.${userIndex}&quot;, &quot;${dataProvider}&quot;) |
417
+ | Scope on the host | Properties listed in U (e.g. dataProvider, userIndex) — often filled via @ancestorAttribute |
418
+ | @subscribe(key) | Mirrors the store into @state() (or another property); read-only from the component side |
419
+
420
+ For writing back to the store from component state, use @publish. In templates, the same paths work with sub().
421
+
422
+ Import
423
+
424
+ import { subscribe } from &quot;@supersoniks/concorde/decorators&quot;;
425
+ import { DataProviderKey } from &quot;@supersoniks/concorde/dataProviderKey&quot;;
426
+
427
+ type Data = { count: number };
428
+ const dataKey = new DataProviderKey&amp;lt;Data&amp;gt;(&quot;data&quot;);
429
+
430
+ @subscribe(dataKey.count)
431
+ @state()
432
+ count = 0;
433
+
434
+ Static path
435
+
436
+ The key path is fixed. The property type must match T at that segment.
437
+
438
+ const cartKey = new DataProvi</pre>
439
+ </section>
440
+ <section id="docs-_decorators-wait-for-ancestors" data-doc-id="docs/_decorators/wait-for-ancestors">
441
+ <h2><a href="../docs/_decorators/wait-for-ancestors.html">@awaitConnectedAncestors and @dispatchConnectedEvent</a></h2>
442
+ <p><strong>Doc ID:</strong> <code>docs/_decorators/wait-for-ancestors</code> · <a href="../docs/_decorators/wait-for-ancestors.html">full page</a></p>
443
+ <p>The @awaitConnectedAncestors and @dispatchConnectedEvent decorators delay a web component's initialization until its matching ancestors have executed their connectedCallback. This is when contextual e</p>
444
+ <pre class="doc-excerpt">@awaitConnectedAncestors and @dispatchConnectedEvent
445
+
446
+ The @awaitConnectedAncestors and @dispatchConnectedEvent decorators delay a web component's initialization until its matching ancestors have executed their connectedCallback. This is when contextual elements (publisher, dataProvider, etc.) are configured.
447
+
448
+ Principle
449
+
450
+ When a child component attaches to the DOM, its ancestors may not yet be initialized (especially if custom element definitions are loaded asynchronously). The @awaitConnectedAncestors decorator delays the component's connectedCallback until all ancestors matching the provided CSS selectors have executed their connectedCallback.
451
+
452
+ The @dispatchConnectedEvent decorator allows ancestors to signal they are ready by dispatching the sonic-connected event at the end of their connectedCallback. The event bubbles, so it can be listened to from anywhere (e.g. document.addEventListener(CONNECTED, handler)).
453
+
454
+ Ancestors that are not web components (no hyphen in tag name) are considered connected by default and do not need to emit the event.
455
+
456
+ Usage
457
+
458
+ Import
459
+
460
+ import { awaitConnectedAncestors, dispatchConnectedEvent, ancestorAttribute } from &quot;@supersoniks/concorde/decorators&quot;;
461
+
462
+ Basic</pre>
463
+ </section>
464
+ </article>
465
+ </main>
466
+ </body>
467
+ </html>