@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,356 +0,0 @@
1
- # SDUI
2
-
3
- ## What is SDUI?
4
-
5
- SDUI stands for `Server Driven User Interfaces`.
6
- Basically, it generates a user interface based on a JSON SDUI Descriptor.
7
-
8
- ### Subscriber extension:
9
-
10
- SDUI extends the mixin [Subscriber](#docs/_core-concept/subscriber.md/subscriber).
11
- This means that you must set a dataProvider with an id pointing to the publisher that will hold your SDUI Descriptor.
12
- This also means that it has a reactive property named `props` that you can set with the JSON SDUI Descriptor in order to configure it.
13
-
14
- ### Fetcher extension:
15
-
16
- SDUI extends the mixin Fetcher as [Fetch](#core/components/functional/fetch/fetch.md/fetch) and [List](#core/components/functional/list/list.md/list).
17
-
18
- In this case, it will parse the JSON coming from the request.
19
- The JSON must comply with the SDUI descriptor format.
20
-
21
- As a fetcher, invalidating the publisher or updating the endpoint will trigger a new fetch and update accordingly.
22
-
23
- ### Rendering:
24
-
25
- It has no shadowdom, and its display style is set to `contents`, so an empty SDUI has the fewest impact on the layout.
26
-
27
- ## SDUI descriptor
28
-
29
- ### TypeScript definition:
30
- <sonic-code language="typescript">
31
- <template>
32
- export type SDUIDescriptor = {
33
- js?: Array&lt;string&gt;;
34
- css?: Array&lt;string&gt;;
35
- library?: Record&lt;string, SDUINode&gt;;
36
- nodes?: Array&lt;SDUINode&gt;;
37
- };
38
- </template>
39
- </sonic-code>
40
-
41
- ### Meaning of the keys:
42
-
43
- * **js**: An array of URLs pointing to JavaScript files to load.
44
- * **css**: An array of URLs pointing to CSS files to load.
45
- * **library**: A record of SDUINode definitions intended to be used as a model for other nodes. The keys of the record can be used as the libraryKey of the node. This node will then specialize the model with its own descriptor.
46
- * **nodes**: An array of SDUINode descriptors. Each SDUINode will result in an HTMLElement added to the root of the component.
47
-
48
- ## SDUINode
49
-
50
- ### Descriptor
51
-
52
- An SDUINode represents an HTMLElement.
53
-
54
- TypeScript definition:
55
-
56
- <sonic-code language="typescript">
57
- <template>
58
- export type SDUINode = {
59
- markup?: string;
60
- tagName?: string;
61
- attributes?: Record&lt;string, string&gt;;
62
- nodes?: Array&lt;SDUINode&gt;;
63
- innerHTML?: string;
64
- prefix?: string;
65
- suffix?: string;
66
- libraryKey?: string;
67
- contentElementSelector?: string;
68
- parentElementSelector?: string;
69
- };
70
- </template>
71
- </sonic-code>
72
-
73
- Summary of properties:
74
- * **markup**: Use it if you prefer to define your node entirely using an HTML string.
75
- * **tagName**: The tag name of the HTML element.
76
- * **attributes**: A string key/value pair storing each attribute name/value of the HTML element created.
77
- * **nodes**: An array of SDUINode descriptors. The children of the HTMLElement are created this way.
78
- * **innerHTML**: The inner HTML of the current node is defined here if needed.
79
- * **prefix**: Use it if you want to wrap the component with some HTML string in conjunction with the suffix.
80
- * **suffix**: Use it if you want to wrap the component with some HTML string in conjunction with the prefix.
81
- * **libraryKey**: An identifier that points to an SDUINode to be used as a model for this node.
82
- * **contentElementSelector**: For SDUINodes defined in the library only. It is a CSS selector that defines where child nodes are added.
83
- * **parentElementSelector**: If the current node, as a future child, has a `parentElementSelector` attribute, it is added to the node corresponding to the associated CSS selector rather than directly to the element.
84
-
85
- ### Markup
86
- Use it if you prefer to define your node entirely using an HTML string.
87
-
88
- <sonic-code>
89
- <template>
90
- <sonic-sdui
91
- dataProvider="sdui-markup-example"
92
- props='{
93
- "nodes":[
94
- {
95
- "markup":"keep shouting <sonic-badge>foo</sonic-badge> <sonic-badge>bar</sonic-badge> !"
96
- }
97
- ]}'
98
- ></sonic-sdui>
99
- </template>
100
- </sonic-code>
101
-
102
- ### Tag name
103
- Here we use the field `tagName` of SDUINode to create an element with tag name `sonic-input`.
104
-
105
- <sonic-code>
106
- <template>
107
- <sonic-sdui
108
- dataProvider="sdui-tagName-example"
109
- props='{
110
- "nodes":[
111
- {
112
- "tagName":"sonic-input"
113
- }
114
- ]}'
115
- ></sonic-sdui>
116
- </template>
117
- </sonic-code>
118
-
119
- ### Attributes
120
- A string key/value pair storing each attribute name/value of the HTML element created.
121
- As no tag name is defined, a div element is created.
122
- Here we define the style attribute to create a tiny red square.
123
-
124
- <sonic-code>
125
- <template>
126
- <sonic-sdui
127
- dataProvider="sdui-attributes-example"
128
- props='{
129
- "nodes":[{
130
- "attributes":{
131
- "style":"width:50px;height:10px;background:red;"
132
- }
133
- }]
134
- }'
135
- ></sonic-sdui>
136
- </template>
137
- </sonic-code>
138
-
139
- ### Nodes
140
- Children of the current node can be added using the field `nodes` recursively.
141
-
142
- <sonic-code>
143
- <template>
144
- <sonic-sdui
145
- dataProvider="sdui-nodes-example"
146
- props='{
147
- "nodes":[{
148
- "nodes":[
149
- {"innerHTML":"A"},
150
- {
151
- "prefix":"B",
152
- "nodes":[
153
- {"innerHTML":"👉 B.1"},
154
- {"innerHTML":"👉 B.2"}
155
- ]
156
- }
157
- ]
158
- }]
159
- }'
160
- ></sonic-sdui>
161
- </template>
162
- </sonic-code>
163
-
164
- ### InnerHTML
165
- As no tag name is defined, a div element is created, and then we use `innerHTML` to add content to it.
166
-
167
- <sonic-code>
168
- <template>
169
- <sonic-sdui
170
- dataProvider="sdui-html-example"
171
- props='{
172
- "nodes":[{
173
- "innerHTML":"keep shouting <sonic-badge>foo</sonic-badge> <sonic-badge>bar</sonic-badge> !"
174
- }]
175
- }'
176
- ></sonic-sdui>
177
- </template>
178
- </sonic-code>
179
-
180
- ### Prefix and suffix
181
- Use them if you want to wrap the component with some HTML string.
182
-
183
- <sonic-code>
184
- <template>
185
- <sonic-sdui
186
- dataProvider="sdui-prefixSuffix-example"
187
- props='{
188
- "nodes":[{
189
- "prefix":"👇",
190
- "suffix":"☝️",
191
- "innerHTML":"The node content"
192
- }]
193
- }'
194
- ></sonic-sdui>
195
- </template>
196
- </sonic-code>
197
-
198
- ### Library key and contentElementSelector
199
- The libraryKey of SDUINode is an identifier that points to an SDUINode description in the library to be used as a model for this node.
200
-
201
- Note that the SDUI has a default library containing some basic component definitions useful for form declaration (see default-library.json).
202
-
203
- This example uses the library key `submit` which points to a `sonic-submit` containing a button also coming from the library.
204
-
205
- The element named `button` in the library is a `sonic-button` of type `success` containing a check icon as a prefix.
206
-
207
- Since the `submit` library element contains an attribute `contentElementSelector` with the value `sonic-button`, the "injected content" is put inside the button.
208
-
209
- We used `innerHTML` for the sake of simplicity, but you can use nodes to add any complex content.
210
-
211
- <sonic-code>
212
- <template>
213
- <sonic-sdui dataProvider="sdui-library-example" props='
214
- {
215
- "nodes":[
216
- {
217
- "libraryKey":"submit",
218
- "innerHTML":"Injected content"
219
- }
220
- ]
221
- }
222
- '></sonic-sdui>
223
- </template>
224
- </sonic-code>
225
-
226
- ### parentElementSelector
227
-
228
- This special field lets you inject the content at any place in the HTML flow already set inside the parent SDUI component by using a CSS selector.
229
-
230
- ⚠️ Note that it doesn't work with top-level nodes.
231
-
232
- <sonic-code>
233
- <template>
234
- <sonic-sdui dataProvider="sdui-parentElementSelector-example" props='
235
- {
236
- "nodes":[
237
- {
238
- "nodes":[
239
- {
240
- "prefix":"👇 Selected parent element",
241
- "suffix":"☝️ End of selected parent element",
242
- "tagName":"span"
243
- },
244
- {
245
- "parentElementSelector":"span",
246
- "innerHTML":"Content having a parentElementSelector attribute"
247
- }
248
- ]
249
- }
250
- ]
251
- }
252
- '></sonic-sdui>
253
- </template>
254
- </sonic-code>
255
-
256
- ### Fetch example:
257
-
258
- <sonic-code>
259
- <template>
260
- <sonic-sdui dataProvider="sdui-fetch-example" endPoint="/src/core/components/functional/sdui/example.json"></sonic-sdui>
261
- </template>
262
- </sonic-code>
263
-
264
- ## Transformers:
265
-
266
- The transformers let you transform the structure of the SDUI Descriptor into a new one before parsing and rendering it.
267
-
268
- To enable it, you must fill the `transformation` attribute of the component with a URL pointing to a Transform descriptor.
269
-
270
- <sonic-code language="typescript">
271
- <template>
272
- export type SDUITransformDescription = {
273
- library?: Record&lt;string, SDUINode&gt;;
274
- transforms: Array&lt;SDUITransformAction&gt;;
275
- };
276
- </template>
277
- </sonic-code>
278
-
279
- ### The library:
280
-
281
- Each key of the library will be merged with the current library in the SDUI Descriptor, by replacing or creating items library key by key.
282
-
283
- ### The transform actions:
284
-
285
- Each transform represents an action that will be done on the SDUI descriptor before the creation of the entire UI.
286
-
287
- <sonic-code language="typescript">
288
- <template>
289
- export type SDUITransformAction = {
290
- action: SDUITransformActionName;
291
- patterns?: Array&lt;SDUINode&gt;;
292
- after?: SDUINode;
293
- before?: SDUINode;
294
- in?: SDUINode;
295
- ui?: SDUINode;
296
- };
297
- </template>
298
- </sonic-code>
299
-
300
- The action that will be done is a verb:
301
-
302
- <sonic-code language="typescript">
303
- <template>
304
- export type SDUITransformActionName = "remap" | "unwrap" | "wrap" | "delete" | "insert" | "move";
305
- </template>
306
- </sonic-code>
307
-
308
- * **remap**: The properties (tagName, innerHTML, etc.) of the targeted SDUINode will be created/changed according to their presence in the `ui` (SDUINode) property of the transformAction.
309
- * **unwrap**: Replaces the targeted SDUINode in place with its children.
310
- * **wrap**: Groups all SDUINodes targeted by the patterns into the new SDUINode described in the `ui` prop of the transformAction.
311
- * **delete**: Deletes the targeted item.
312
- * **insert**: Inserts a new SDUINode described by the `ui` prop into the flow. The position of insertion depends on the presence of the attributes `before`, `after`, `in`, which is a pattern to target an existing SDUINode.
313
-
314
- ## Misc Tricks:
315
-
316
- ### sduiKey
317
-
318
- This is an HTML attribute to set on the component if needed. In this case, the component will not treat its props value directly as an SDUI descriptor. Internally, it will basically extract the SDUIDescriptor by doing something like this: `const sduiDescriptor = this.props[this.sduikey]`.
319
-
320
- ### messageKey
321
-
322
- This is an HTML attribute to set on the component if needed. In this case, the component will automatically create a `sonic-toast-message-subscriber` component. The data found in `props[messageKey]` will be treated as the data expected by the `sonic-toast-message-subscriber`. So, by respecting the format of data supported by this component, you will be able to show multiple toasts in the result of a request.
323
-
324
- Example of JSON with `messageKey`=`messages`:
325
- <sonic-code language="typescript">
326
- <template>
327
- {
328
- "messages": [{
329
- "content": "The product has been added to your cart",
330
- "status": "success",
331
- "type": "public"
332
- }]
333
- }
334
- </template>
335
- </sonic-code>
336
-
337
- ### library
338
-
339
- This is an HTML attribute to set on the component if needed. You can set a URL pointing to a JSON describing a library with the same structure as the library in the SDUIDescriptor. The component will simply override its library with the given one.
340
-
341
- ## Playground
342
-
343
- Here is a little playground to let you test some simple tricks.
344
-
345
- <sonic-code>
346
- <template>
347
- <sonic-textarea
348
- rows="10"
349
- onChange="SonicPublisherManager.get('sdui-playground').set(JSON.parse(this.value))"
350
- value='{"nodes":[{"tagName":"div", "innerHTML":"test"}]}'
351
- >
352
- </sonic-textarea>
353
- <sonic-sdui dataProvider="sdui-playground" props='{"nodes":[{"tagName":"div", "innerHTML":"test"}]}'>
354
- </sonic-sdui>
355
- </template>
356
- </sonic-code>
@@ -1,87 +0,0 @@
1
- # States
2
-
3
- ### sonic-states displays different states depending on the value of a sub-property of its dataProvider (data-path attribute in dot notation):
4
- * It loops over its child templates and tests if the regexp contained in the *data-value* attribute matches the value of the property
5
- * If so, the content of the corresponding template is displayed as a state.
6
- * If the attribute dataProviderExpression is provided the content is surrounded by a div:
7
- * The "dataProvider" attribute of this div is the result of calling the replace function on the property value with the regexp and dataproviderExpression as parameters.
8
- * The subscribers/fetch... of the template will refer to this dataProvider
9
- * You can also use url-pattern expressions for the route parameters, see the examples
10
- *
11
- **Examples**
12
- * With ma.property= 2 :
13
- * RegExp data-value = (\d+) and dataproviderExpression = /user/$1 the dataProvider attribute will be "/user/2"
14
- * url-pattern data-value = :id and dataproviderExpression = /user/:id the dataProvider attribute will be "/user/2
15
-
16
- ## Basic
17
-
18
- <sonic-code>
19
- <template>
20
- <div class="flex gap-2 items-center" formDataProvider="states-basic-example">
21
- <sonic-button radio name="selection" value="#home" checked size="xs">Home</sonic-button>
22
- <sonic-button radio name="selection" value="#about" size="xs">About</sonic-button>
23
- <sonic-button radio name="selection" value="#work" size="xs">Work</sonic-button>
24
- <sonic-button radio name="selection" value="#contact" size="xs">Contact</sonic-button>
25
- </div>
26
- <div class="text-center text-neutral-700 border rounded text-4xl my-6 p-3 ">
27
- <sonic-states dataProvider="states-basic-example" data-path="selection">
28
- <template data-value="#home">Home</template>
29
- <template data-value="#about">About</template>
30
- <template data-value="#work">Work</template>
31
- <template data-value="#contact">Contact</template>
32
- </sonic-states>
33
- </div>
34
- </template>
35
- </sonic-code>
36
-
37
- ## Regexp
38
-
39
- When using **capturing groups ()** the stored values are accessible via the **dataProviderExpression**
40
- **e.g.**, data-value="#couleur_<b class="text-danger">(\d+)</b>" => dataProviderExpression="api/unknown/<b class="text-danger">$1</b>"
41
-
42
- <sonic-code>
43
- <template>
44
- <div serviceURL="/docs-mock-api">
45
- <sonic-list formDataProvider="states-regexp-example" fetch dataProvider="api/unknown" key="data" class="flex gap-2 items-center" >
46
- <template>
47
- <sonic-button radio size="xs" name="selection" data-bind ::value="#couleur_$id">
48
- <span data-bind ::inner-html="ucFirst|$name"></span>
49
- </sonic-button>
50
- </template>
51
- </sonic-list>
52
- <sonic-states dataProvider="states-regexp-example" data-path="selection">
53
- <template data-value="#couleur_(\d+)" dataProviderExpression="api/unknown/$1">
54
- <sonic-fetch>
55
- <input type="color" disabled data-bind ::value="$data.color" class=" w-full h-10 my-3" />
56
- </sonic-fetch>
57
- </template>
58
- </sonic-states>
59
- </div>
60
- </template>
61
- </sonic-code>
62
-
63
- ## Url-pattern
64
-
65
- Same as RegExp but using <a href="https://www.npmjs.com/package/url-pattern" target="_blank">url patterns</a>
66
- **e.g.**, data-value="#couleur_<b class="text-danger">:id</b>" => dataProviderExpression="api/unknown/<b class="text-danger">:id</b>"
67
-
68
- <sonic-code>
69
- <template>
70
- <div serviceURL="/docs-mock-api">
71
- <sonic-list formDataProvider="states-regexp-example" fetch dataProvider="api/unknown" key="data" class="flex gap-2 items-center" >
72
- <template>
73
- <sonic-button radio size="xs" name="selection" data-bind ::value="#couleur_$id">
74
- <span data-bind ::inner-html="ucFirst|$name"></span>
75
- </sonic-button>
76
- </template>
77
- </sonic-list>
78
- <sonic-states dataProvider="states-regexp-example" data-path="selection">
79
- <template data-value="#couleur_:id" dataProviderExpression="api/unknown/:id">
80
- <sonic-fetch>
81
- <input type="color" disabled data-bind ::value="$data.color" class=" w-full h-10 my-3" />
82
- </sonic-fetch>
83
- </template>
84
- </sonic-states>
85
- </div>
86
- </template>
87
- </sonic-code>
@@ -1,114 +0,0 @@
1
- # Submit
2
-
3
- > **Live demos:** `<docs-lit-demo>` + `src/docs/example/docs-submit-demos.ts`. Use [Local API demos](#docs/_misc/docs-mock-api.md/docs-mock-api) (`serviceURL="/docs-mock-api"`).
4
-
5
- ## Overview
6
-
7
- **sonic-submit** sends the **formDataProvider** publisher to a REST endpoint (same configuration model as [fetch](#core/components/functional/fetch/fetch.md/fetch): `serviceURL` on an ancestor, path via `dataProvider` or `endPoint`).
8
-
9
- | Trigger | Attribute |
10
- |---------|-----------|
11
- | Click inside the slot | `onClick` |
12
- | Enter in a focused field inside the slot | `onEnterKey` |
13
-
14
- | Data / API | Attribute / property | Notes |
15
- |------------|----------------------|--------|
16
- | Form fields | `formDataProvider` on ancestor | Filled by `sonic-input`, `sonic-select`, etc. via `name` |
17
- | Result after call | `submitResultDataProvider` on ancestor | Whole result object (after optional `submit-result-key`) |
18
- | Slice of JSON result | `submit-result-key` on **sonic-submit** | Dot path, e.g. `data` when the API returns `{ data: { … } }` |
19
- | HTTP verb | `method` on **sonic-submit** | `post` (default), `put`, `patch`, `delete`, `get` — not inherited from `sonic-scope` |
20
- | Path override | `endPoint` on **sonic-submit** | Wins over ancestor `dataProvider` |
21
- | JSON vs multipart | `sendAsFormData` on **sonic-submit** | `FormData` body, still expects JSON response |
22
- | Reset publishers | `clearedDataOnSuccess` on ancestor | Space-separated `DataProviderKey.path` values; runs when a **result object** is returned (including error payloads with `messages`) |
23
- | Browser form POST | `native` on **sonic-submit** | See [Native HTML form](#native-html-form) |
24
- | Result event | — | Bubbles `submit` `CustomEvent` with `detail` = result |
25
- | Credential Management API | `usernameKey`, `passwordKey` on **sonic-submit** | After a **successful** HTTP response, stores login if those keys exist in the payload (defaults: `username`, `password`) |
26
- | ALTCHA / captcha | `needsCaptchaValidation` on form/header publisher | Defers send until token is set — see [Captcha](#core/components/ui/captcha/captcha.md/captcha) |
27
-
28
- While a REST submit runs, the slot is wrapped with `data-disabled` (faded, no pointer events). With **`native`**, validation and loader still run, then the browser performs a normal form submission.
29
-
30
- ## Form and result handling
31
-
32
- POST to mock `api/register`; result publisher `submit-example-result`.
33
-
34
- <docs-lit-demo for="docs-submit-demo"></docs-lit-demo>
35
-
36
- ## Native HTML form
37
-
38
- With **`native`**, Concorde does **not** call `fetch`. After form validation it:
39
-
40
- 1. Copies **formDataProvider** values into matching `<input>` / `<select>` / `<textarea>` inside the closest **`<form>`** (creates hidden inputs if needed).
41
- 2. Programmatically clicks a hidden native `type="submit"` control (`name` / `value` on **sonic-submit** if you need them).
42
-
43
- Use a real `<form action="…" method="post">` ancestor. For SPAs, a named **`target`** (e.g. iframe) avoids leaving the doc page.
44
-
45
- <docs-lit-demo for="docs-submit-native-demo"></docs-lit-demo>
46
-
47
- ## sendAsFormData
48
-
49
- Sends fields as **`multipart/form-data`** instead of `application/json` (response is still parsed as JSON).
50
-
51
- <docs-lit-demo for="docs-submit-formdata-demo"></docs-lit-demo>
52
-
53
- ## submit-result-key
54
-
55
- When the API wraps the payload (e.g. `{ data: { id, token } }`), set **`submit-result-key="data"`** on **sonic-submit** so **submitResultDataProvider** receives only the inner object.
56
-
57
- <docs-lit-demo for="docs-submit-result-key-demo"></docs-lit-demo>
58
-
59
- Mock endpoint: `POST /docs-mock-api/api/register/nested`.
60
-
61
- ## clearedDataOnSuccess
62
-
63
- Lists one or more publisher ids (space-separated). After the API returns a result object, each is set to `{}` — useful to reset the form publisher.
64
-
65
- <docs-lit-demo for="docs-submit-clear-demo"></docs-lit-demo>
66
-
67
- ## Custom `submit` event
68
-
69
- Listen for the bubbling **`submit`** event; **`event.detail`** is the same result written to **submitResultDataProvider** (if configured).
70
-
71
- <docs-lit-demo for="docs-submit-event-demo"></docs-lit-demo>
72
-
73
- ## endPoint vs dataProvider
74
-
75
- Ancestor **`dataProvider`** is the default path; **`endPoint`** on **sonic-submit** overrides it for that button only.
76
-
77
- <docs-lit-demo for="docs-submit-endpoint-demo"></docs-lit-demo>
78
-
79
- ## method="get"
80
-
81
- Appends publisher fields as a query string on the endpoint, then performs a GET. The mock route `api/register/echo` returns the query for inspection.
82
-
83
- <docs-lit-demo for="docs-submit-get-demo"></docs-lit-demo>
84
-
85
- ## dot notation (formDataProvider shape)
86
-
87
- You can use dot notation in **`name`** on form controls; the publisher stores nested objects:
88
-
89
- <sonic-code>
90
- <template>
91
- <sonic-scope formDataProvider="submit-example-dot-notation">
92
- <div class="grid grid-cols-2 gap-4 mb-4 ">
93
- <sonic-input required name="email.value" type="email" value="eve.holt@reqres.in"></sonic-input>
94
- <sonic-input required type="password" name="details.password.value" value="pistol"></sonic-input>
95
- </div>
96
- </sonic-scope>
97
- </template>
98
- </sonic-code>
99
-
100
- Stored shape:
101
-
102
- <sonic-code language="typescript">
103
- <template>
104
- {
105
- email: { value: "eve.holt@reqres.in" },
106
- details: { password: { value: "pistol" } }
107
- }
108
- </template>
109
- </sonic-code>
110
-
111
- ## Related
112
-
113
- - [Captcha](#core/components/ui/captcha/captcha.md/captcha) — submit waits for `captchaToken` when validation is required.
114
- - [HTML integration](#docs/_misc/html-integration.md/html-integration) — legacy `data-bind` result blocks; prefer **submitResultDataProvider** + `@subscribe` in Lit demos.
@@ -1,91 +0,0 @@
1
- # Subscriber
2
-
3
- La mixin Subscriber permet lier un composant à un publisher.
4
- La liaison à un publisher se fait via l'attribut *dataProvider* du composant qui représente ce que l'on obtient en appellant PublisherManager.get(dataProvider).
5
-
6
- Les propriétés du composant sont automatiquement remplies avec les propriétés du même nom dans les données du publisher.
7
-
8
- Le composant est automatiquement mis à jour lorsque les données du publisher sont mises à jour.
9
-
10
- ## DataProvider
11
-
12
- **Id** of the dataProvider that the component will **subscribe** to
13
-
14
- <sonic-code>
15
- <template>
16
- <sonic-subscriber dataProvider="id_that_the_subsriber_will_subscribe_to" debug>
17
- <sonic-button> custom dataProvider id</sonic-button>
18
- </sonic-subscriber>
19
- <sonic-subscriber debug>
20
- <sonic-button> default id : pageHTML</sonic-button>
21
- </sonic-subscriber>
22
- </template>
23
- </sonic-code>
24
-
25
- ## Props
26
-
27
- Data object (json) that will be passed to the dataProvider
28
-
29
- <sonic-code>
30
- <template>
31
- <sonic-subscriber props='{"data":"Hello world"}' debug>
32
- <sonic-button> Hover to see the data</sonic-button>
33
- </sonic-subscriber>
34
- </template>
35
- </sonic-code>
36
-
37
-
38
- ## Debug
39
-
40
- **Helper**, display the data held by the dataProvider in a floating div
41
-
42
- <sonic-code>
43
- <template>
44
- <sonic-subscriber debug>
45
- <sonic-button> see the dataProvider'data </sonic-button>
46
- </sonic-subscriber>
47
- </template>
48
- </sonic-code>
49
-
50
-
51
- ## NoAutofill
52
-
53
- <sonic-alert status="info">Docs coming soon</sonic-alert>
54
-
55
- ## PropertyMap
56
-
57
- <sonic-alert status="info">Docs coming soon</sonic-alert>
58
-
59
- Permet de mapper un nom de propriété de donnée source vers une propriété du subscriber à la volée
60
-
61
- ## BindPublisher
62
-
63
- <sonic-alert status="info">Docs coming soon</sonic-alert>
64
-
65
- On peut utiliser cette fonction pour lier un publisher spécifique au composant si besoin.
66
-
67
- ## instanceCounter
68
-
69
- <sonic-alert status="info">Docs coming soon</sonic-alert>
70
-
71
- ## Publisher
72
-
73
- <sonic-alert status="info">Docs coming soon</sonic-alert>
74
-
75
- ## Args
76
-
77
- <sonic-alert status="info">Docs coming soon</sonic-alert>
78
-
79
- ## NoShadowDom
80
-
81
- Par défaut on crée un shadow dom mais on peut demander à ne pas en avoir via cette propriété et un attribut associé.
82
- Cela se fait à l'initialisation uniquement et n'est pas modifiable lors de la vie du composant.
83
-
84
-
85
- ## Other attributes gathered from subscriber.stories.ts
86
-
87
- styles ??
88
- title ??
89
- _props ??
90
- onAssign ??
91
- defferedDebug ??
@@ -1,35 +0,0 @@
1
- # Value
2
-
3
- Simply shows a value from a data provider.
4
- You can target sub data value using dot syntax.
5
- The value reacts to changes.
6
-
7
- * Below is a form that helps you to set a value for the field "preference" in the data target with id "value-example"
8
- <sonic-code>
9
- <template>
10
- <div formDataProvider="value-example">
11
- which one do you prefer ?
12
- <sonic-radio name="preference" checked value="dogs"> Dogs</sonic-radio>
13
- <sonic-radio name="preference" value="cats"> Cats</sonic-radio>
14
- </div>
15
- </template>
16
- </sonic-code>
17
- * Then you can see live value of the preference using this code :
18
- <sonic-code>
19
- <template>
20
- I prefer <sonic-value dataProvider="value-example" key="preference"></sonic-value>
21
- </template>
22
- </sonic-code>
23
- * If you have more complex data like this
24
- <sonic-code>
25
- <template>
26
- <sonic-subscriber dataProvider="value-example-2" props='{"my":{"complex":[{"data":"👋 Hi There"}]}}'></sonic-subscriber>
27
- </template>
28
- </sonic-code>
29
- * You can target it with the dot syntax
30
- <sonic-code>
31
- <template>
32
- <sonic-value dataProvider="value-example-2" key="my.complex.0.data"></sonic-value>
33
- </template>
34
- </sonic-code>
35
-