@supersoniks/concorde 5.0.5 → 5.1.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.
Files changed (282) hide show
  1. package/.claude/launch.json +15 -0
  2. package/.claude/vite.http.config.mjs +7 -0
  3. package/.taste-skill/after/desktop-fold.jpg +0 -0
  4. package/.taste-skill/after/desktop-page-01.jpg +0 -0
  5. package/.taste-skill/after/desktop-page-02.jpg +0 -0
  6. package/.taste-skill/after/desktop-page-03.jpg +0 -0
  7. package/.taste-skill/after/mobile-fold.jpg +0 -0
  8. package/.taste-skill/after/mobile-page-01.jpg +0 -0
  9. package/.taste-skill/after/report.json +4103 -0
  10. package/.taste-skill/after/tablet-fold.jpg +0 -0
  11. package/.taste-skill/after/tablet-page-01.jpg +0 -0
  12. package/.taste-skill/after/tablet-page-02.jpg +0 -0
  13. package/.taste-skill/before/desktop-fold.jpg +0 -0
  14. package/.taste-skill/before/desktop-page-01.jpg +0 -0
  15. package/.taste-skill/before/desktop-page-02.jpg +0 -0
  16. package/.taste-skill/before/mobile-fold.jpg +0 -0
  17. package/.taste-skill/before/mobile-page-01.jpg +0 -0
  18. package/.taste-skill/before/report.json +2556 -0
  19. package/.taste-skill/before/tablet-fold.jpg +0 -0
  20. package/.taste-skill/before/tablet-page-01.jpg +0 -0
  21. package/.taste-skill/direction.json +510 -0
  22. package/.taste-skill/notes.md +84 -0
  23. package/.taste-skill/prod/desktop-fold.jpg +0 -0
  24. package/.taste-skill/prod/desktop-page-01.jpg +0 -0
  25. package/.taste-skill/prod/desktop-page-02.jpg +0 -0
  26. package/.taste-skill/prod/desktop-page-03.jpg +0 -0
  27. package/.taste-skill/prod/mobile-fold.jpg +0 -0
  28. package/.taste-skill/prod/mobile-page-01.jpg +0 -0
  29. package/.taste-skill/prod/mobile-page-02.jpg +0 -0
  30. package/.taste-skill/prod/report.json +1973 -0
  31. package/.taste-skill/prod/tablet-fold.jpg +0 -0
  32. package/.taste-skill/prod/tablet-page-01.jpg +0 -0
  33. package/.taste-skill/prod/tablet-page-02.jpg +0 -0
  34. package/.tmp-cem/custom-elements.json +13705 -0
  35. package/AUDIT.md +228 -0
  36. package/PLAN-AMELIORATION.md +220 -0
  37. package/build-infos.json +1 -1
  38. package/concorde-core.bundle.js +196 -196
  39. package/concorde-core.es.js +3854 -3572
  40. package/custom-elements-manifest.config.mjs +14 -0
  41. package/dist/concorde-core.bundle.js +196 -196
  42. package/dist/concorde-core.es.js +3854 -3572
  43. package/dist/img/archive/concorde-001-2cv.webp +0 -0
  44. package/dist/img/archive/concorde-red-arrows-2002-poster.jpg +0 -0
  45. package/dist/img/archive/concorde-red-arrows-2002.webm +0 -0
  46. package/dist/img/archive/credits.json +28 -0
  47. package/docs/assets/index-Bb-_LRyY.js +12280 -0
  48. package/docs/index.html +1 -1
  49. package/index.html +27 -63
  50. package/package.json +44 -3
  51. package/public/img/archive/concorde-001-2cv.webp +0 -0
  52. package/public/img/archive/concorde-red-arrows-2002-poster.jpg +0 -0
  53. package/public/img/archive/concorde-red-arrows-2002.webm +0 -0
  54. package/public/img/archive/credits.json +28 -0
  55. package/scripts/generate-sdui-catalog.mjs +250 -0
  56. package/scripts/generate-sdui-catalog.spec.ts +91 -0
  57. package/scripts/pre-build.mjs +15 -0
  58. package/src/core/components/functional/fetch/fetch.md +2 -2
  59. package/src/core/components/functional/sdui/SDUIDescriptorTransformer.ts +5 -5
  60. package/src/core/components/functional/sdui/__fixtures__/descriptors.ts +251 -0
  61. package/src/core/components/functional/sdui/__snapshots__/sdui-action.spec.ts.snap +73 -0
  62. package/src/core/components/functional/sdui/__snapshots__/sdui-incremental.spec.ts.snap +50 -0
  63. package/src/core/components/functional/sdui/__snapshots__/sdui-partial.spec.ts.snap +50 -0
  64. package/src/core/components/functional/sdui/__snapshots__/sdui.regression.spec.ts.snap +461 -0
  65. package/src/core/components/functional/sdui/component-catalog.gaps.json +511 -0
  66. package/src/core/components/functional/sdui/component-catalog.json +3103 -0
  67. package/src/core/components/functional/sdui/component-catalog.spec.ts +23 -0
  68. package/src/core/components/functional/sdui/sdui-action.spec.ts +99 -0
  69. package/src/core/components/functional/sdui/sdui-dom-snapshot.ts +61 -0
  70. package/src/core/components/functional/sdui/sdui-extension-points.md +94 -0
  71. package/src/core/components/functional/sdui/sdui-incremental.spec.ts +137 -0
  72. package/src/core/components/functional/sdui/sdui-partial.spec.ts +83 -0
  73. package/src/core/components/functional/sdui/sdui-partial.ts +19 -0
  74. package/src/core/components/functional/sdui/sdui-safe.spec.ts +188 -0
  75. package/src/core/components/functional/sdui/sdui-safe.ts +100 -0
  76. package/src/core/components/functional/sdui/sdui.md +122 -0
  77. package/src/core/components/functional/sdui/sdui.regression.spec.ts +64 -0
  78. package/src/core/components/functional/sdui/sdui.ts +442 -34
  79. package/src/core/components/functional/sdui/types.ts +49 -0
  80. package/src/core/components/ui/modal/modal.ts +14 -11
  81. package/src/docs/_getting-started/components.md +5 -0
  82. package/src/docs/_getting-started/theming.md +2 -2
  83. package/src/docs/code.ts +88 -75
  84. package/src/docs/components/docs-demo-sources.ts +16 -8
  85. package/src/docs/components/docs-lit-demo.ts +19 -37
  86. package/src/docs/docs.ts +5 -0
  87. package/src/docs/example/docs-boarding-pass-demo.ts +134 -0
  88. package/src/docs/example/docs-provider-keys.ts +12 -0
  89. package/src/docs/header/header.ts +233 -69
  90. package/src/docs/home/catalog.ts +44 -0
  91. package/src/docs/home/home.ts +513 -0
  92. package/src/docs/home/mach-stage.ts +389 -0
  93. package/src/docs/layout.ts +3 -1
  94. package/src/docs/navigation/components-index.ts +56 -0
  95. package/src/docs/navigation/navigation.ts +240 -232
  96. package/src/docs/navigation/pager.ts +67 -0
  97. package/src/docs/navigation/toc.ts +98 -0
  98. package/src/docs/search/docs-search.json +330 -20
  99. package/src/docs/search/markdown-renderer.ts +11 -3
  100. package/src/docs/shiki/index.ts +109 -0
  101. package/src/docs/tailwind/css/base/scrollbar.css +22 -0
  102. package/src/docs/tailwind/css/base/theme.css +96 -0
  103. package/src/docs/tailwind/css/base/typography.css +4 -0
  104. package/src/docs/tailwind/css/docs/boarding-pass.css +65 -0
  105. package/src/docs/tailwind/css/docs/content.css +32 -0
  106. package/src/docs/tailwind/css/docs/page.css +10 -0
  107. package/src/docs/tailwind/css/docs.css +9 -0
  108. package/src/docs/tailwind/css/home/hero.css +210 -0
  109. package/src/docs/tailwind/css/home/motion.css +84 -0
  110. package/src/docs/tailwind/css/home/sections.css +416 -0
  111. package/src/docs/tailwind/css/tailwind.css +7 -185
  112. package/src/tsconfig.json +113 -2
  113. package/src/tsconfig.tsbuildinfo +1 -1
  114. package/tailwind.config.js +8 -4
  115. package/docs/assets/index-wVZpLVYW.js +0 -12122
  116. package/docs/crawl/core/components/functional/date/date.html +0 -190
  117. package/docs/crawl/core/components/functional/fetch/fetch.html +0 -109
  118. package/docs/crawl/core/components/functional/if/if.html +0 -27
  119. package/docs/crawl/core/components/functional/jsonata/jsonata.html +0 -79
  120. package/docs/crawl/core/components/functional/list/list.html +0 -70
  121. package/docs/crawl/core/components/functional/mix/mix.html +0 -45
  122. package/docs/crawl/core/components/functional/queue/queue.html +0 -96
  123. package/docs/crawl/core/components/functional/router/router.html +0 -106
  124. package/docs/crawl/core/components/functional/sdui/sdui.html +0 -269
  125. package/docs/crawl/core/components/functional/states/states.html +0 -66
  126. package/docs/crawl/core/components/functional/submit/submit.html +0 -160
  127. package/docs/crawl/core/components/functional/subscriber/subscriber.html +0 -67
  128. package/docs/crawl/core/components/functional/value/value.html +0 -51
  129. package/docs/crawl/core/components/ui/alert/alert.html +0 -211
  130. package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +0 -131
  131. package/docs/crawl/core/components/ui/badge/badge.html +0 -197
  132. package/docs/crawl/core/components/ui/button/button.html +0 -150
  133. package/docs/crawl/core/components/ui/captcha/captcha.html +0 -112
  134. package/docs/crawl/core/components/ui/card/card.html +0 -253
  135. package/docs/crawl/core/components/ui/divider/divider.html +0 -144
  136. package/docs/crawl/core/components/ui/form/checkbox/checkbox.html +0 -73
  137. package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +0 -266
  138. package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +0 -122
  139. package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +0 -121
  140. package/docs/crawl/core/components/ui/form/input/input.html +0 -109
  141. package/docs/crawl/core/components/ui/form/input-autocomplete/input-autocomplete.html +0 -38
  142. package/docs/crawl/core/components/ui/form/radio/radio.html +0 -56
  143. package/docs/crawl/core/components/ui/form/select/select.html +0 -73
  144. package/docs/crawl/core/components/ui/form/switch/switch.html +0 -56
  145. package/docs/crawl/core/components/ui/form/textarea/textarea.html +0 -59
  146. package/docs/crawl/core/components/ui/group/group.html +0 -104
  147. package/docs/crawl/core/components/ui/icon/icon.html +0 -222
  148. package/docs/crawl/core/components/ui/image/image.html +0 -298
  149. package/docs/crawl/core/components/ui/link/link.html +0 -100
  150. package/docs/crawl/core/components/ui/loader/loader.html +0 -124
  151. package/docs/crawl/core/components/ui/menu/menu.html +0 -394
  152. package/docs/crawl/core/components/ui/modal/modal.html +0 -342
  153. package/docs/crawl/core/components/ui/pop/pop.html +0 -296
  154. package/docs/crawl/core/components/ui/progress/progress.html +0 -131
  155. package/docs/crawl/core/components/ui/table/table.html +0 -545
  156. package/docs/crawl/core/components/ui/theme/theme.html +0 -131
  157. package/docs/crawl/core/components/ui/toast/toast.html +0 -233
  158. package/docs/crawl/core/components/ui/tooltip/tooltip.html +0 -140
  159. package/docs/crawl/docs/_core-concept/dataFlow.html +0 -177
  160. package/docs/crawl/docs/_core-concept/overview.html +0 -66
  161. package/docs/crawl/docs/_core-concept/subscriber.html +0 -75
  162. package/docs/crawl/docs/_decorators/ancestor-attribute.html +0 -117
  163. package/docs/crawl/docs/_decorators/auto-subscribe.html +0 -202
  164. package/docs/crawl/docs/_decorators/bind.html +0 -141
  165. package/docs/crawl/docs/_decorators/get.html +0 -149
  166. package/docs/crawl/docs/_decorators/handle.html +0 -165
  167. package/docs/crawl/docs/_decorators/on-assign.html +0 -355
  168. package/docs/crawl/docs/_decorators/patch.html +0 -78
  169. package/docs/crawl/docs/_decorators/post.html +0 -139
  170. package/docs/crawl/docs/_decorators/publish.html +0 -61
  171. package/docs/crawl/docs/_decorators/put.html +0 -78
  172. package/docs/crawl/docs/_decorators/subscribe.html +0 -109
  173. package/docs/crawl/docs/_decorators/wait-for-ancestors.html +0 -137
  174. package/docs/crawl/docs/_directives/sub.html +0 -93
  175. package/docs/crawl/docs/_getting-started/ai-agents.html +0 -173
  176. package/docs/crawl/docs/_getting-started/concorde-manual-install.html +0 -100
  177. package/docs/crawl/docs/_getting-started/concorde-outside.html +0 -58
  178. package/docs/crawl/docs/_getting-started/create-a-component.html +0 -111
  179. package/docs/crawl/docs/_getting-started/my-first-component.html +0 -189
  180. package/docs/crawl/docs/_getting-started/my-first-subscriber.html +0 -110
  181. package/docs/crawl/docs/_getting-started/pubsub.html +0 -62
  182. package/docs/crawl/docs/_getting-started/start.html +0 -76
  183. package/docs/crawl/docs/_getting-started/theming.html +0 -333
  184. package/docs/crawl/docs/_misc/api-configuration.html +0 -149
  185. package/docs/crawl/docs/_misc/dataProviderKey.html +0 -135
  186. package/docs/crawl/docs/_misc/docs-mock-api.html +0 -158
  187. package/docs/crawl/docs/_misc/dynamic-path.html +0 -180
  188. package/docs/crawl/docs/_misc/endpoint.html +0 -50
  189. package/docs/crawl/docs/_misc/formelement-subscriber-removal.html +0 -138
  190. package/docs/crawl/docs/_misc/html-integration.html +0 -48
  191. package/docs/crawl/hubs/decorators.html +0 -547
  192. package/docs/crawl/hubs/form-components.html +0 -381
  193. package/docs/crawl/hubs/remote-data.html +0 -452
  194. package/docs/crawl/index.html +0 -102
  195. package/docs/llms-full.txt +0 -7008
  196. package/docs/llms.txt +0 -97
  197. package/docs/sitemap.xml +0 -240
  198. package/docs/src/core/components/functional/date/date.md +0 -290
  199. package/docs/src/core/components/functional/fetch/fetch.md +0 -125
  200. package/docs/src/core/components/functional/if/if.md +0 -9
  201. package/docs/src/core/components/functional/jsonata/jsonata.md +0 -56
  202. package/docs/src/core/components/functional/list/list.md +0 -65
  203. package/docs/src/core/components/functional/mix/mix.md +0 -41
  204. package/docs/src/core/components/functional/queue/queue.md +0 -72
  205. package/docs/src/core/components/functional/router/router.md +0 -94
  206. package/docs/src/core/components/functional/sdui/default-library.json +0 -108
  207. package/docs/src/core/components/functional/sdui/example.json +0 -99
  208. package/docs/src/core/components/functional/sdui/sdui.md +0 -356
  209. package/docs/src/core/components/functional/states/states.md +0 -87
  210. package/docs/src/core/components/functional/submit/submit.md +0 -114
  211. package/docs/src/core/components/functional/subscriber/subscriber.md +0 -91
  212. package/docs/src/core/components/functional/value/value.md +0 -35
  213. package/docs/src/core/components/ui/alert/alert.md +0 -196
  214. package/docs/src/core/components/ui/alert-messages/alert-messages.md +0 -85
  215. package/docs/src/core/components/ui/badge/badge.md +0 -188
  216. package/docs/src/core/components/ui/button/button.md +0 -183
  217. package/docs/src/core/components/ui/captcha/captcha.md +0 -71
  218. package/docs/src/core/components/ui/card/card.md +0 -215
  219. package/docs/src/core/components/ui/divider/divider.md +0 -129
  220. package/docs/src/core/components/ui/form/checkbox/checkbox.md +0 -77
  221. package/docs/src/core/components/ui/form/fieldset/fieldset.md +0 -205
  222. package/docs/src/core/components/ui/form/form-actions/form-actions.md +0 -100
  223. package/docs/src/core/components/ui/form/form-layout/form-layout.md +0 -119
  224. package/docs/src/core/components/ui/form/input/input.md +0 -142
  225. package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +0 -29
  226. package/docs/src/core/components/ui/form/radio/radio.md +0 -57
  227. package/docs/src/core/components/ui/form/select/select.md +0 -71
  228. package/docs/src/core/components/ui/form/switch/switch.md +0 -57
  229. package/docs/src/core/components/ui/form/textarea/textarea.md +0 -65
  230. package/docs/src/core/components/ui/group/group.md +0 -75
  231. package/docs/src/core/components/ui/icon/icon.md +0 -214
  232. package/docs/src/core/components/ui/icon/icons.json +0 -1
  233. package/docs/src/core/components/ui/image/image.md +0 -233
  234. package/docs/src/core/components/ui/link/link.md +0 -81
  235. package/docs/src/core/components/ui/loader/loader.md +0 -112
  236. package/docs/src/core/components/ui/menu/menu.md +0 -370
  237. package/docs/src/core/components/ui/modal/modal.md +0 -235
  238. package/docs/src/core/components/ui/pop/pop.md +0 -294
  239. package/docs/src/core/components/ui/progress/progress.md +0 -109
  240. package/docs/src/core/components/ui/table/table.md +0 -431
  241. package/docs/src/core/components/ui/theme/theme.md +0 -122
  242. package/docs/src/core/components/ui/toast/toast.md +0 -216
  243. package/docs/src/core/components/ui/tooltip/tooltip.md +0 -124
  244. package/docs/src/docs/_core-concept/dataFlow.md +0 -88
  245. package/docs/src/docs/_core-concept/overview.md +0 -57
  246. package/docs/src/docs/_core-concept/subscriber.md +0 -75
  247. package/docs/src/docs/_decorators/ancestor-attribute.md +0 -128
  248. package/docs/src/docs/_decorators/auto-subscribe.md +0 -202
  249. package/docs/src/docs/_decorators/bind.md +0 -167
  250. package/docs/src/docs/_decorators/get.md +0 -162
  251. package/docs/src/docs/_decorators/handle.md +0 -175
  252. package/docs/src/docs/_decorators/on-assign.md +0 -390
  253. package/docs/src/docs/_decorators/patch.md +0 -70
  254. package/docs/src/docs/_decorators/post.md +0 -146
  255. package/docs/src/docs/_decorators/publish.md +0 -55
  256. package/docs/src/docs/_decorators/put.md +0 -70
  257. package/docs/src/docs/_decorators/subscribe.md +0 -100
  258. package/docs/src/docs/_decorators/wait-for-ancestors.md +0 -163
  259. package/docs/src/docs/_directives/sub.md +0 -91
  260. package/docs/src/docs/_getting-started/ai-agents.md +0 -76
  261. package/docs/src/docs/_getting-started/concorde-manual-install.md +0 -133
  262. package/docs/src/docs/_getting-started/concorde-outside.md +0 -33
  263. package/docs/src/docs/_getting-started/create-a-component.md +0 -139
  264. package/docs/src/docs/_getting-started/my-first-component.md +0 -236
  265. package/docs/src/docs/_getting-started/my-first-subscriber.md +0 -120
  266. package/docs/src/docs/_getting-started/pubsub.md +0 -37
  267. package/docs/src/docs/_getting-started/start.md +0 -47
  268. package/docs/src/docs/_getting-started/theming.md +0 -253
  269. package/docs/src/docs/_misc/api-configuration.md +0 -81
  270. package/docs/src/docs/_misc/dataProviderKey.md +0 -168
  271. package/docs/src/docs/_misc/docs-mock-api.md +0 -63
  272. package/docs/src/docs/_misc/dynamic-path.md +0 -71
  273. package/docs/src/docs/_misc/endpoint.md +0 -45
  274. package/docs/src/docs/_misc/formelement-subscriber-removal.md +0 -115
  275. package/docs/src/docs/_misc/html-integration.md +0 -15
  276. package/docs/src/docs/search/docs-search.json +0 -12242
  277. package/docs/src/tag-list.json +0 -1
  278. package/docs/src/tsconfig-model.json +0 -23
  279. package/docs/src/tsconfig.json +0 -1242
  280. package/src/docs/prism/index.ts +0 -6
  281. package/src/docs/prism/prism.css +0 -158
  282. package/src/docs/prism/prism.js +0 -1022
@@ -1,177 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="fr" data-crawl-url="https://concorde.supersoniks.org/crawl/docs/_core-concept/dataFlow.html" data-doc-id="docs/_core-concept/dataFlow">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Data flow — Concorde</title>
7
- <meta name="description" content="Recommended patterns for new Concorde apps (Lit + TypeScript). Under the hood, data lives in a DataProvider store (legacy Publisher API: Legacy: Sharing data).">
8
- <meta name="keywords" content="Concorde, supersoniks, docs/_core-concept/dataFlow, dataFlow, Data flow, concept, DataProvider, get, set, dp, DataProviderKey, sub(key), @subscribe, @state, @ancestorAttribute">
9
- <meta name="concorde-doc-id" content="docs/_core-concept/dataFlow">
10
- <link rel="canonical" href="https://concorde.supersoniks.org/crawl/docs/_core-concept/dataFlow.html">
11
- </head>
12
- <body>
13
- <header>
14
- <p><a href="../../index.html">Concorde documentation (crawl)</a> · <a href="https://concorde.supersoniks.org/#docs/_core-concept/dataFlow.md/dataFlow" rel="nofollow">interactive version</a></p>
15
- </header>
16
- <main>
17
- <article>
18
- <p class="doc-lead" id="doc-summary"><strong>Concorde concept — Data flow</strong>. Recommended patterns for new Concorde apps (Lit + TypeScript). Under the hood, data lives in a DataProvider store (legacy Publisher API: Legacy: Sharing data). <span>Doc ID: <code>docs/_core-concept/dataFlow</code>. Keywords: Concorde, supersoniks, docs/_core-concept/dataFlow, dataFlow, Data flow, concept, DataProvider, get, set, dp, DataProviderKey, sub(key), @subscribe, @state, @ancestorAttribute. URL: <a href="https://concorde.supersoniks.org/crawl/docs/_core-concept/dataFlow.html">https://concorde.supersoniks.org/crawl/docs/_core-concept/dataFlow.html</a>.</span></p>
19
- <h1 id="data-flow">Data flow</h1>
20
- <p>Recommended patterns for new Concorde apps (Lit + TypeScript). Under the hood, data lives in a <strong>DataProvider</strong> store (legacy <strong>Publisher</strong> API: <a href="../_getting-started/pubsub.html#pubsub">Legacy: Sharing data</a>).</p>
21
- <h2 id="quick-map">Quick map</h2>
22
- <table>
23
- <thead>
24
- <tr>
25
- <th>Need</th>
26
- <th>Use</th>
27
- </tr>
28
- </thead>
29
- <tbody><tr>
30
- <td>Read/write in code</td>
31
- <td><code>get</code> / <code>set</code> / <code>dp</code> + <code>DataProviderKey</code> (static paths only)</td>
32
- </tr>
33
- <tr>
34
- <td>Reactive Lit template</td>
35
- <td><code>sub(key)</code> or <code>@subscribe</code></td>
36
- </tr>
37
- <tr>
38
- <td>Read component state from store</td>
39
- <td><code>@subscribe</code> + <code>DataProviderKey&lt;T, U&gt;</code> + <code>@state</code></td>
40
- </tr>
41
- <tr>
42
- <td>Inherit ancestor attributes</td>
43
- <td><code>@ancestorAttribute</code></td>
44
- </tr>
45
- <tr>
46
- <td>Write from component state</td>
47
- <td><code>@publish</code></td>
48
- </tr>
49
- <tr>
50
- <td>React to assignments</td>
51
- <td><code>@handle</code></td>
52
- </tr>
53
- <tr>
54
- <td>HTTP GET</td>
55
- <td><code>@get</code> + <code>Endpoint</code>, or <code>sonic-list</code> / <code>sonic-queue</code> with <code>fetch</code></td>
56
- </tr>
57
- <tr>
58
- <td>HTTP POST (body from store)</td>
59
- <td><code>@post</code> + <code>Endpoint</code> + body <code>DataProviderKey</code></td>
60
- </tr>
61
- <tr>
62
- <td>HTTP PUT / PATCH (body from store)</td>
63
- <td><code>@put</code> / <code>@patch</code> — same model as <code>@post</code></td>
64
- </tr>
65
- <tr>
66
- <td>Forms</td>
67
- <td><code>formDataProvider</code> + <code>name</code> on fields (no Subscriber on form elements)</td>
68
- </tr>
69
- <tr>
70
- <td>Derived / aggregate (JSONata)</td>
71
- <td><code>derive()</code> or <code>sonic-jsonata</code> — <a href="../../core/components/functional/jsonata/jsonata.html#jsonata">Jsonata</a></td>
72
- </tr>
73
- <tr>
74
- <td>Offline doc demos</td>
75
- <td><code>serviceURL=&quot;/docs-mock-api&quot;</code> — <a href="../_misc/docs-mock-api.html#docs-mock-api">Local API demos</a></td>
76
- </tr>
77
- </tbody></table>
78
- <p>Skill: <code>concorde-get-set-dp</code> in the package <code>ai/</code> folder.</p>
79
- <h2 id="dataproviderkey">DataProviderKey</h2>
80
- <pre><code class="language-typescript">import { DataProviderKey } from &quot;@supersoniks/concorde/dataProviderKey&quot;;
81
- import { dp, get, set } from &quot;@supersoniks/concorde/utils&quot;;
82
-
83
- const cartKey = new DataProviderKey&amp;lt;{ items: string[] }&amp;gt;(&quot;cart&quot;);
84
-
85
- set(cartKey, { items: [] });
86
- dp(cartKey.items).set([&quot;a&quot;, &quot;b&quot;]);
87
- get(cartKey);
88
- </code></pre>
89
- <p>Dynamic paths (<code>users.${userId}</code>) → decorators or <code>sub()</code> — not <code>get(&quot;users.${id}&quot;)</code> in imperative code. Resolution rules: <a href="../_misc/dynamic-path.html#dynamic-path">Dynamic path placeholders</a>.</p>
90
- <p><a href="../_misc/dataProviderKey.html#dataProviderKey">DataProviderKey</a></p>
91
- <h2 id="decorators">Decorators</h2>
92
- <table>
93
- <thead>
94
- <tr>
95
- <th>Decorator</th>
96
- <th>Role</th>
97
- </tr>
98
- </thead>
99
- <tbody><tr>
100
- <td><code>@subscribe</code></td>
101
- <td>Read-only property from store — <a href="../_getting-started/my-first-component.html#my-first-component">data configuration</a> (type + key + scope)</td>
102
- </tr>
103
- <tr>
104
- <td><code>@publish</code></td>
105
- <td>Push property writes to store</td>
106
- </tr>
107
- <tr>
108
- <td><code>@handle</code></td>
109
- <td>Method called on assignment</td>
110
- </tr>
111
- <tr>
112
- <td><code>@ancestorAttribute</code></td>
113
- <td>Copy ancestor HTML attribute onto property</td>
114
- </tr>
115
- <tr>
116
- <td><code>@get</code></td>
117
- <td>HTTP GET into <code>ApiResult&amp;lt;T&amp;gt;</code></td>
118
- </tr>
119
- <tr>
120
- <td><code>@post</code></td>
121
- <td>HTTP POST into <code>ApiResult&amp;lt;T&amp;gt;</code> (body from a publisher)</td>
122
- </tr>
123
- <tr>
124
- <td><code>@put</code> / <code>@patch</code></td>
125
- <td>HTTP PUT / PATCH into <code>ApiResult&amp;lt;T&amp;gt;</code></td>
126
- </tr>
127
- </tbody></table>
128
- <p>Walkthrough: <a href="../_getting-started/my-first-component.html#my-first-component">My first component</a></p>
129
- <h2 id="http-and-lists">HTTP and lists</h2>
130
- <ul>
131
- <li><a href="../_decorators/get.html#get">@get</a> — single GET on a component</li>
132
- <li><a href="../_decorators/post.html#post">@post</a> — POST with body read from a <code>DataProviderKey</code></li>
133
- <li><a href="../_decorators/put.html#put">@put</a> · <a href="../_decorators/patch.html#patch">@patch</a> — PUT / PATCH (same options as <code>@post</code>)</li>
134
- <li><a href="../../core/components/functional/list/list.html#list">List</a> — <code>fetch</code> + <code>key=&quot;data&quot;</code> + <code>/docs-mock-api/api/users</code></li>
135
- <li><a href="../../core/components/functional/queue/queue.html#queue">Queue</a> — lazy <code>offset=$offset&amp;per_page=$limit</code> + optional <code>dataFilterProvider</code> (form → query)</li>
136
- </ul>
137
- <h2 id="starter-kit">Starter kit</h2>
138
- <pre><code class="language-bash">npx @supersoniks/create-concorde-ts-starter my-app
139
- </code></pre>
140
- <p>Interactive routes mirror these patterns (<code>/concepts/*</code>, <code>/demo/*</code>).</p>
141
- <h2 id="derived-data-derive--sonic-jsonata">Derived data (<code>derive</code> / <code>sonic-jsonata</code>)</h2>
142
- <p>Use when you need <strong>client-side aggregations</strong> (groupby, top N, chart shapes) from existing DataProviders — without inline app JS in SDUI.</p>
143
- <ul>
144
- <li>Primitive: <code>derive({ inputs, compute, output, variables? })</code> from <code>@supersoniks/concorde/utils</code> (read-only output, debounce, generation, cycle detection, <code>{output}/_state_</code>).</li>
145
- <li>SDUI adapter: <a href="../../core/components/functional/jsonata/jsonata.html#jsonata"><code>sonic-jsonata</code></a> (<code>inputProvider</code> → <code>expression</code> → <code>outputProvider</code>, optional <code>formDataProvider</code>).</li>
146
- <li>vs <a href="../../core/components/functional/mix/mix.html#mix"><code>sonic-mix</code></a>: mix composes bidirectionally; jsonata <strong>computes</strong> unidirectionally.</li>
147
- </ul>
148
- <h2 id="legacy-integration">Legacy integration</h2>
149
- <table>
150
- <thead>
151
- <tr>
152
- <th>Topic</th>
153
- <th>Page</th>
154
- </tr>
155
- </thead>
156
- <tbody><tr>
157
- <td><code>Subscriber</code> / <code>Fetcher</code> mixins on app code</td>
158
- <td><a href="./subscriber.html#subscriber">Legacy: Subscriber mixin</a>, <a href="../_getting-started/my-first-subscriber.html#my-first-subscriber">Legacy: My first subscriber</a></td>
159
- </tr>
160
- <tr>
161
- <td><code>data-bind</code> HTML (plain HTML hosts)</td>
162
- <td><a href="../_misc/html-integration.html#html-integration">HTML integration</a> — doc demos use Lit in <code>src/docs/example/</code></td>
163
- </tr>
164
- <tr>
165
- <td><code>@onAssign</code></td>
166
- <td><a href="../_decorators/on-assign.html#on-assign">@onAssign</a> (prefer <code>@handle</code>)</td>
167
- </tr>
168
- <tr>
169
- <td><code>sonic-fetch</code> alone</td>
170
- <td><a href="../../core/components/functional/fetch/fetch.html#fetch">Fetch</a></td>
171
- </tr>
172
- </tbody></table>
173
-
174
- </article>
175
- </main>
176
- </body>
177
- </html>
@@ -1,66 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="fr" data-crawl-url="https://concorde.supersoniks.org/crawl/docs/_core-concept/overview.html" data-doc-id="docs/_core-concept/overview">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>lit + tailwind + vite — Concorde</title>
7
- <meta name="description" content="Some notes for an overview of Concorde's functioning">
8
- <meta name="keywords" content="Concorde, supersoniks, docs/_core-concept/overview, overview, lit + tailwind + vite, concept, DataProvider, custom elements, reactive properties">
9
- <meta name="concorde-doc-id" content="docs/_core-concept/overview">
10
- <link rel="canonical" href="https://concorde.supersoniks.org/crawl/docs/_core-concept/overview.html">
11
- </head>
12
- <body>
13
- <header>
14
- <p><a href="../../index.html">Concorde documentation (crawl)</a> · <a href="https://concorde.supersoniks.org/#docs/_core-concept/overview.md/overview" rel="nofollow">interactive version</a></p>
15
- </header>
16
- <main>
17
- <article>
18
- <p class="doc-lead" id="doc-summary"><strong>Concorde concept — lit + tailwind + vite</strong>. Some notes for an overview of Concorde's functioning <span>Doc ID: <code>docs/_core-concept/overview</code>. Keywords: Concorde, supersoniks, docs/_core-concept/overview, overview, lit + tailwind + vite, concept, DataProvider, custom elements, reactive properties. URL: <a href="https://concorde.supersoniks.org/crawl/docs/_core-concept/overview.html">https://concorde.supersoniks.org/crawl/docs/_core-concept/overview.html</a>.</span></p>
19
- <h1 id="lit--tailwind--vite">lit + tailwind + vite</h1>
20
- <p><strong>Some notes for an overview of Concorde&#39;s functioning</strong></p>
21
- <h2 id="standard-web-components">Standard Web components</h2>
22
- <p>A web component is simply a <strong>custom HTML element</strong> created using web standards:</p>
23
- <p><strong>web component</strong> = <a href="https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements">Custom Elements</a> + <a href="https://developer.mozilla.org/fr/docs/Web/Web_Components/Using_shadow_DOM">shadowDom</a> + <a href="https://developer.mozilla.org/fr/docs/Web/HTML/Element/template">HTML templates</a></p>
24
- <h2 id="lit-library">Lit Library</h2>
25
- <p>Concorde components are written using the lightweight Lit library: <a href="https://lit.dev/">https://lit.dev/</a>.</p>
26
- <p>A good portion of the elements documented on the Lit website are standard JavaScript concepts (e.g., <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#mix-ins">mixins</a>, <a href="https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Template_literals#gabarits_%C3%A9tiquet%C3%A9s">tagged template literals</a>).</p>
27
- <p>The <strong>library simplifies the writing of web components</strong> by automating certain tasks:</p>
28
- <ul>
29
- <li>Creation of an <strong>open mode shadow DOM</strong> (the component is accessible from the outside via its shadow root property).</li>
30
- <li><a href="https://lit.dev/docs/components/rendering/">Rendering function</a> based on <a href="https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Template_literals#gabarits_%C3%A9tiquet%C3%A9s">tagged template literals</a></li>
31
- <li><a href="https://lit.dev/docs/components/properties/">Reactive properties</a> that trigger rendering when modified.</li>
32
- </ul>
33
- <p>Our use of Lit rarely goes beyond this <a href="https://lit.dev/playground/#sample=examples/hello-world">hello world</a></p>
34
- <h2 id="typescript-language">Typescript Language</h2>
35
- <p>We write the components in <a href="https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html">TypeScript</a>, which is then compiled into JS.</p>
36
- <p>Static and inferred typing provides stronger validation of the program&#39;s functioning during compilation.
37
- However, we often use the &quot;any&quot; type due to time constraints.</p>
38
- <p>Lit uses TypeScript to simplify development through metadata:</p>
39
- <ul>
40
- <li>Simplified declaration of <code>custom elements</code> via @customElement</li>
41
- <li>Generation of <code>reactive properties</code> via @property.</li>
42
- </ul>
43
- <p>☢️<strong>Warning</strong>:</p>
44
- <ul>
45
- <li>During development, we operate in interpreted mode, which is faster but allows errors that won&#39;t pass during the build.</li>
46
- <li>It is important to <strong>build a distribution before pushing the code</strong> to ensure everything is fine.</li>
47
- </ul>
48
- <h2 id="compatibility-with-classic-js-libraries">Compatibility with Classic JS Libraries</h2>
49
- <p>Compatibility issues may arise when using JS libraries, particularly regarding DOM traversal.
50
- This is because these libraries are blocked from traversing the DOM due to the presence of the shadow DOM.
51
- Here are some examples of things that may cause problems:</p>
52
- <ul>
53
- <li>Latest FontAwesome in SVG mode, icons are not replaced</li>
54
- <li>Libraries associated with jQuery</li>
55
- <li>document.getElementById</li>
56
- <li>...</li>
57
- </ul>
58
- <h2 id="topics-to-explore-for-further-learning">Topics to Explore for Further Learning</h2>
59
- <p><a href="../_getting-started/create-a-component.html#create-a-component">🧱 Creating components</a></p>
60
- <p><a href="../_getting-started/theming.html#theming">🎨 Adding styles</a></p>
61
- <p><a href="../_getting-started/pubsub.html#pubsub">🥨 Sharing data</a></p>
62
-
63
- </article>
64
- </main>
65
- </body>
66
- </html>
@@ -1,75 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="fr" data-crawl-url="https://concorde.supersoniks.org/crawl/docs/_core-concept/subscriber.html" data-doc-id="docs/_core-concept/subscriber">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Legacy: Subscriber mixin — Concorde</title>
7
- <meta name="description" content="&gt; New app components: My first component and Data flow — extend LitElement with decorators (@subscribe, @ancestorAttribute, …). This mixin remains in core components (sonic-list, sonic-fetch, …) and l">
8
- <meta name="keywords" content="Concorde, supersoniks, docs/_core-concept/subscriber, subscriber, Legacy: Subscriber mixin, concept, DataProvider, LitElement, @subscribe, @ancestorAttribute, sonic-list, sonic-fetch, dataProvider, subDataProvider = 'address.of.my.data', props">
9
- <meta name="concorde-doc-id" content="docs/_core-concept/subscriber">
10
- <link rel="canonical" href="https://concorde.supersoniks.org/crawl/docs/_core-concept/subscriber.html">
11
- </head>
12
- <body>
13
- <header>
14
- <p><a href="../../index.html">Concorde documentation (crawl)</a> · <a href="https://concorde.supersoniks.org/#docs/_core-concept/subscriber.md/subscriber" rel="nofollow">interactive version</a></p>
15
- </header>
16
- <main>
17
- <article>
18
- <p class="doc-lead" id="doc-summary"><strong>Concorde concept — Legacy: Subscriber mixin</strong>. &gt; New app components: My first component and Data flow — extend LitElement with decorators (@subscribe, @ancestorAttribute, …). This mixin remains in core components (sonic-list, sonic-fetch, …) and l <span>Doc ID: <code>docs/_core-concept/subscriber</code>. Keywords: Concorde, supersoniks, docs/_core-concept/subscriber, subscriber, Legacy: Subscriber mixin, concept, DataProvider, LitElement, @subscribe, @ancestorAttribute, sonic-list, sonic-fetch, dataProvider, subDataProvider = 'address.of.my.data', props. URL: <a href="https://concorde.supersoniks.org/crawl/docs/_core-concept/subscriber.html">https://concorde.supersoniks.org/crawl/docs/_core-concept/subscriber.html</a>.</span></p>
19
- <h1 id="legacy-subscriber-mixin">Legacy: Subscriber mixin</h1>
20
- <blockquote>
21
- <p><strong>New app components:</strong> <a href="../_getting-started/my-first-component.html#my-first-component">My first component</a> and <a href="./dataFlow.html#dataFlow">Data flow</a> — extend <code>LitElement</code> with decorators (<code>@subscribe</code>, <code>@ancestorAttribute</code>, …). This mixin remains in <strong>core</strong> components (<code>sonic-list</code>, <code>sonic-fetch</code>, …) and <a href="../_getting-started/my-first-subscriber.html#my-first-subscriber">legacy tutorials</a>.</p>
22
- </blockquote>
23
- <p>The Subscriber mixin was commonly extended by Concorde core components and older destination components. Pure UI components usually don&#39;t extend it, especially those outside of form components.</p>
24
- <h2 id="dataprovider-attribute-automatic-filling-of-subscriber-properties">DataProvider Attribute: Automatic Filling of Subscriber Properties</h2>
25
- <p>Upon being added to the DOM (connectedCallback), subscribers search for the first occurrence of the <code>dataProvider</code> attribute in their parent&#39;s HTML structure.</p>
26
- <p>The value of this attribute is the DataProvider path (see <a href="./dataFlow.html#dataFlow">Data flow</a> and <a href="../_misc/dataProviderKey.html#dataProviderKey">DataProviderKey</a>; legacy API: <a href="../_getting-started/pubsub.html#pubsub">Sharing Data</a>).</p>
27
- <p>The subscriber then subscribes to the publisher as a data template to be filled.</p>
28
- <p>The reactive properties of the component reflect in real-time the properties with the same name in the publisher.</p>
29
- <p>This functionality is commonly used in the generic components <a href="../../core/components/functional/fetch/fetch.html#fetch">fetch</a>, <a href="../../core/components/functional/queue/queue.html#queue">queue</a>, and <a href="../../core/components/functional/list/list.html#list">list</a>.</p>
30
- <p>If the subscriber is inside another subscriber, it can subscribe to a data of its parent using the attribute <code>subDataProvider = &#39;address.of.my.data&#39;</code> instead of the parent&#39;s data. This allows for dynamic behavior.</p>
31
- <h2 id="automated-translation">Automated Translation</h2>
32
- <p>In a similar manner, searching for ancestor attributes can be used to configure automatic translation for any property starting with &quot;wording&quot; and ending with a label identifier recognized by the wordingProvider API.</p>
33
- <p>Normally, this API is globally configured and not within the component. Therefore, remember to prefix translatable label identifiers present in the ticketing system, for example, with &quot;wording&quot;.</p>
34
- <h2 id="reactive-property-props">Reactive Property <code>props</code></h2>
35
- <p>The value of this property can be provided as a JSON object or any other value. This value is then assigned to the associated publisher via the <code>dataProvider</code> attribute. As a result, the reactive properties of all subscribers associated with the same <code>dataProvider</code> are filled as mentioned above.</p>
36
- <h2 id="disabling-automatic-filling-of-reactive-properties">Disabling Automatic Filling of Reactive Properties</h2>
37
- <p>It is possible to disable the automatic filling of reactive properties in a particular component. To do so, set the variable <code>noAutoFill = true</code> in the component&#39;s class. However, the reactive property <code>props</code> will still be updated.</p>
38
- <p>For example, <code>sonic-subscriber</code> and <code>sonic-fetch</code> have this attribute because they do not have reactive properties.</p>
39
- <p><strong>☢ CAUTION:</strong> When creating an object of type Subscriber or Fetcher, make sure to use the mixins and not directly extend the concrete fetch component (<code>sonic-fetch</code>) and subscriber component (<code>sonic-subscriber</code>). This is because the <code>noAutofill = true</code> attribute is set in those components.</p>
40
- <p><strong>TIPS:</strong>
41
- If you disable automatic filling, you will likely make the rendering dynamic by writing expressions like <code>this.props.my.subproperty</code>. If <code>props</code> is updated, the rendering will be triggered. However, if <code>this.props.my.subproperty</code> is directly modified, the rendering will not be triggered. To achieve more reactivity, you can enable rendering when any subproperty is modified. Simply set the variable <code>renderOnPropsInternalChange = true</code> in the class that implements the corresponding mixin.</p>
42
- <h2 id="data-binding">Data Binding</h2>
43
- <p>Suppose that:</p>
44
- <ul>
45
- <li>You have a subscriber subscribed to a publisher via its <code>dataProvider</code> attribute.</li>
46
- <li>The published data has the following structure:</li>
47
- </ul>
48
- <pre><code class="language-javascript">{&quot;img&quot;: { &quot;avatar&quot;: &quot;my-avatar.jpg&quot;, &quot;caption&quot;: &quot;look at my smile&quot; }, &quot;email&quot;: &quot;an.email@example.com&quot; }
49
- </code></pre>
50
- <ul>
51
- <li>We want to keep the display of an image and its <code>title</code> attribute up to date, as well as a &quot;contact&quot; button to email the person in the photo. The content of the subscriber could be as follows:</li>
52
- </ul>
53
- <p>In a <strong>Lit</strong> app, use the same data with <a href="../_getting-started/my-first-component.html#my-first-component">data configuration</a> (<code>@subscribe</code> + <code>DataProviderKey</code>) on a small row component — see <code>docs-user</code> in <code>src/docs/example/users.ts</code>.</p>
54
- <p>For <strong>HTML-only</strong> embedding (no Lit), attribute binding is described in <a href="../_misc/html-integration.html#html-integration">HTML integration</a> and in the Legacy <a href="./subscriber.html#subscriber">Subscriber mixin</a> pages.</p>
55
- <p>This pattern also illustrates:</p>
56
- <ul>
57
- <li>Binding to subproperties using dot syntax, as done for the <code>src</code> attribute of the <code>img</code> tag.</li>
58
- <li>Using a simple expression to include the property within a string, as in creating a <code>mailto</code> link.</li>
59
- <li>Using formatting functions, as in the <code>title</code> attribute of the <code>img</code> tag. You can find (and add) formatting functions in the <code>core/utils/Format.ts</code> file.</li>
60
- <li>Writing for properties that are in camel case. Convert everything to lowercase and add hyphens. Note that <code>innerHTML</code> (or <code>outerHTML</code>) is a special case where no hyphens are added between each letter.</li>
61
- </ul>
62
- <p><strong>Note:</strong> Data binding implies that updating the <code>img.src</code> data via the publisher will change the photo without any additional calls.</p>
63
- <p><strong>Special Variables:</strong></p>
64
- <ul>
65
- <li><code>_self_</code> targets the root of the data. This is useful, for example, when the data is a pure string.</li>
66
- <li><code>_parent_</code> targets the parent publisher of the current publisher, if any. For example, the subscribers of lists have the complete data of the list as their parent.</li>
67
- <li><code>_metadata_</code> is only used in the case of <em>sonic-list</em> at the moment. In a simple list, <code>_metadata_</code> see the (list)[] component for further details</li>
68
- </ul>
69
- <p><strong>Disabling this functionality:</strong>
70
- You can disable data binding if it is not needed by calling <code>DataBinding.disable()</code>.</p>
71
-
72
- </article>
73
- </main>
74
- </body>
75
- </html>
@@ -1,117 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="fr" data-crawl-url="https://concorde.supersoniks.org/crawl/docs/_decorators/ancestor-attribute.html" data-doc-id="docs/_decorators/ancestor-attribute">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>@ancestorAttribute — Concorde</title>
7
- <meta name="description" content="The @ancestorAttribute decorator automatically injects the value of an ancestor's attribute into a class property at the time of connectedCallback.">
8
- <meta name="keywords" content="Concorde, supersoniks, docs/_decorators/ancestor-attribute, ancestor-attribute, @ancestorAttribute, decorator, ancestorAttribute, connectedCallback, HTML.getAncestorAttributeValue, dataProvider, testAttribute, dynamic: false, formDataProvider, wordingProvider">
9
- <meta name="concorde-doc-id" content="docs/_decorators/ancestor-attribute">
10
- <link rel="canonical" href="https://concorde.supersoniks.org/crawl/docs/_decorators/ancestor-attribute.html">
11
- </head>
12
- <body>
13
- <header>
14
- <p><a href="../../index.html">Concorde documentation (crawl)</a> · <a href="https://concorde.supersoniks.org/#docs/_decorators/ancestor-attribute.md/ancestor-attribute" rel="nofollow">interactive version</a></p>
15
- </header>
16
- <main>
17
- <article>
18
- <p class="doc-lead" id="doc-summary"><strong>Concorde decorator — @ancestorAttribute</strong>. The @ancestorAttribute decorator automatically injects the value of an ancestor's attribute into a class property at the time of connectedCallback. <span>Doc ID: <code>docs/_decorators/ancestor-attribute</code>. Keywords: Concorde, supersoniks, docs/_decorators/ancestor-attribute, ancestor-attribute, @ancestorAttribute, decorator, ancestorAttribute, connectedCallback, HTML.getAncestorAttributeValue, dataProvider, testAttribute, dynamic: false, formDataProvider, wordingProvider. URL: <a href="https://concorde.supersoniks.org/crawl/docs/_decorators/ancestor-attribute.html">https://concorde.supersoniks.org/crawl/docs/_decorators/ancestor-attribute.html</a>.</span></p>
19
- <h1 id="ancestorattribute">@ancestorAttribute</h1>
20
- <p>The <code>@ancestorAttribute</code> decorator automatically injects the value of an ancestor&#39;s attribute into a class property at the time of <code>connectedCallback</code>.</p>
21
- <h2 id="principle">Principle</h2>
22
- <p>This decorator uses <code>HTML.getAncestorAttributeValue</code> 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.</p>
23
- <h2 id="usage">Usage</h2>
24
- <h3 id="import">Import</h3>
25
- <pre><code class="language-typescript">import { ancestorAttribute } from &quot;@supersoniks/concorde/decorators&quot;;
26
- </code></pre>
27
- <h3 id="basic-example">Basic example</h3>
28
- <p>The component reads <code>dataProvider</code> and <code>testAttribute</code> from its ancestor wrapper. By default (<code>dynamic: false</code>), values are read once at connect.</p>
29
- <pre><code class="language-typescript">import { html, LitElement } from &quot;lit&quot;;
30
- import { customElement } from &quot;lit/decorators.js&quot;;
31
- import { ancestorAttribute } from &quot;@supersoniks/concorde/decorators&quot;;
32
-
33
- @customElement(&quot;demo-ancestor-attribute&quot;)
34
- export class DemoAncestorAttribute extends LitElement {
35
- @ancestorAttribute(&quot;dataProvider&quot;)
36
- dataProvider: string | null = null;
37
-
38
- @ancestorAttribute(&quot;testAttribute&quot;)
39
- testAttribute: string | null = null;
40
-
41
- render() {
42
- return html`
43
- &lt;p&gt;dataProvider: &lt;strong&gt;${this.dataProvider ?? &quot;null&quot;}&lt;/strong&gt;&lt;/p&gt;
44
- &lt;p&gt;testAttribute: &lt;strong&gt;${this.testAttribute ?? &quot;null&quot;}&lt;/strong&gt;&lt;/p&gt;
45
- `;
46
- }
47
- }
48
- </code></pre>
49
- <pre><code>&lt;div dataProvider=&quot;demoDataProvider&quot; testAttribute=&quot;test-value-123&quot;&gt;
50
- &lt;docs-demo-sources for=&quot;demo-ancestor-attribute&quot;&gt;&lt;/docs-demo-sources&gt;
51
- &lt;demo-ancestor-attribute&gt;&lt;/demo-ancestor-attribute&gt;
52
- &lt;/div&gt;
53
- </code></pre>
54
- <h2 id="use-cases">Use cases</h2>
55
- <p>This decorator is particularly useful for:</p>
56
- <ul>
57
- <li><strong>Retrieving the <code>dataProvider</code></strong> from an ancestor without having to pass it explicitly</li>
58
- <li><strong>Retrieving the <code>formDataProvider</code></strong> in form components</li>
59
- <li><strong>Retrieving the <code>wordingProvider</code></strong> for translation</li>
60
- <li><strong>Retrieving any other attribute</strong> defined on an ancestor</li>
61
- </ul>
62
- <h2 id="behavior">Behavior</h2>
63
- <ul>
64
- <li>The search starts from the current element and traverses up the DOM tree</li>
65
- <li>The injection happens automatically at the time of <code>connectedCallback</code></li>
66
- <li>By default (<code>dynamic: false</code>), the value is read once at connect time and is not updated afterward</li>
67
- <li>With <code>{ dynamic: true }</code>, the property stays in sync when:<ul>
68
- <li>an ancestor <strong>changes</strong> the attribute value</li>
69
- <li>a <strong>closer</strong> ancestor <strong>gains</strong> / <strong>loses</strong> the attribute (fallback / <code>null</code>)</li>
70
- <li>the component is <strong>reparented</strong> (no extra opt-in) — parent <code>childList</code> only reacts if <em>this</em> node moves</li>
71
- </ul>
72
- </li>
73
- <li>Observers are <strong>shared</strong> (one per ancestor attribute / one per parent) so large lists of <code>sonic-icon</code> stay cheap on Firefox.</li>
74
- <li>When <code>dynamic</code> is enabled, updates also propagate to <code>@subscribe</code> / <code>@bind</code> paths that depend on the decorated property (e.g. <code>${dataProvider}</code>)</li>
75
- </ul>
76
- <h3 id="dynamic-mode">Dynamic mode</h3>
77
- <p>Use <code>{ dynamic: true }</code> when the decorated property must follow the DOM. With Lit, add <strong><code>@state()</code></strong> on the same property so template updates are visible when the observer assigns a new value.</p>
78
- <p>The live demo below shows only the resolved attribute value — no store, no reparenting.</p>
79
- <pre><code class="language-typescript">@customElement(&quot;demo-ancestor-attribute-dynamic&quot;)
80
- export class DemoAncestorAttributeDynamic extends LitElement {
81
- @ancestorAttribute(&quot;dataProvider&quot;, { dynamic: true })
82
- @state()
83
- dataProvider: string | null = null;
84
-
85
- render() {
86
- return html`
87
- &amp;lt;p&amp;gt;Nearest ancestor: &amp;lt;strong&amp;gt;${this.dataProvider ?? &quot;null&quot;}&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;
88
- `;
89
- }
90
- }
91
- </code></pre>
92
- <p>Try in the demo:</p>
93
- <ul>
94
- <li><strong>parent-a</strong> / <strong>parent-b</strong> — change the value on the direct parent</li>
95
- <li><strong>Remove parent attr</strong> — falls back to <strong>outer</strong></li>
96
- <li><strong>Add closer</strong> — a wrapper with <code>from-closer</code> becomes the nearest ancestor</li>
97
- <li><strong>Remove closer</strong> — back to parent or outer</li>
98
- <li><strong>Remove outer attr</strong> — if parent has no attribute either, the child shows <code>null</code></li>
99
- </ul>
100
- <pre><code>&lt;docs-demo-sources for=&quot;demo-ancestor-attribute-dynamic-section&quot;&gt;&lt;/docs-demo-sources&gt;
101
- &lt;demo-ancestor-attribute-dynamic-section&gt;&lt;/demo-ancestor-attribute-dynamic-section&gt;
102
- </code></pre>
103
- <p>Static mode (default) — read once at connect, no observer:</p>
104
- <pre><code class="language-typescript">@ancestorAttribute(&quot;dataProvider&quot;)
105
- dataProvider: string | null = null;
106
- </code></pre>
107
- <h2 id="notes">Notes</h2>
108
- <ul>
109
- <li>This decorator works with any component that has a <code>connectedCallback</code> method (such as <code>LitElement</code> or components extending <code>Subscriber</code>)</li>
110
- <li>The search also traverses Shadow DOM if necessary</li>
111
- <li>If multiple ancestors have the attribute, the closest one will be used</li>
112
- </ul>
113
-
114
- </article>
115
- </main>
116
- </body>
117
- </html>