@supersoniks/concorde 4.9.0 → 4.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/build-infos.json +1 -1
  2. package/concorde-core.bundle.js +195 -195
  3. package/concorde-core.es.js +3390 -3370
  4. package/dist/concorde-core.bundle.js +195 -195
  5. package/dist/concorde-core.es.js +3390 -3370
  6. package/dist/docs-mock-api-sw.js +3 -1
  7. package/dist/docs-mock-api-sw.js.map +2 -2
  8. package/dist/js/core/decorators/api.js +64 -12
  9. package/dist/js/core/decorators/api.js.map +1 -1
  10. package/dist/js/core/utils/HTML.js +4 -5
  11. package/dist/js/core/utils/HTML.js.map +1 -1
  12. package/dist/robots.txt +15 -1
  13. package/dist/types/core/decorators/api.d.ts +14 -1
  14. package/dist/types/core/decorators/api.d.ts.map +1 -1
  15. package/dist/types/core/utils/HTML.d.ts.map +1 -1
  16. package/docs/assets/{index-t0-i22oI.css → index-Bnp7gVaA.css} +1 -1
  17. package/docs/assets/{index-BEgZEIbv.js → index-hElUgV9_.js} +894 -552
  18. package/docs/crawl/core/components/functional/date/date.html +190 -0
  19. package/docs/crawl/core/components/functional/fetch/fetch.html +109 -0
  20. package/docs/crawl/core/components/functional/if/if.html +27 -0
  21. package/docs/crawl/core/components/functional/list/list.html +70 -0
  22. package/docs/crawl/core/components/functional/mix/mix.html +45 -0
  23. package/docs/crawl/core/components/functional/queue/queue.html +96 -0
  24. package/docs/crawl/core/components/functional/router/router.html +106 -0
  25. package/docs/crawl/core/components/functional/sdui/sdui.html +269 -0
  26. package/docs/crawl/core/components/functional/states/states.html +66 -0
  27. package/docs/crawl/core/components/functional/submit/submit.html +160 -0
  28. package/docs/crawl/core/components/functional/subscriber/subscriber.html +67 -0
  29. package/docs/crawl/core/components/functional/value/value.html +51 -0
  30. package/docs/crawl/core/components/ui/alert/alert.html +110 -0
  31. package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +23 -0
  32. package/docs/crawl/core/components/ui/badge/badge.html +119 -0
  33. package/docs/crawl/core/components/ui/button/button.html +149 -0
  34. package/docs/crawl/core/components/ui/captcha/captcha.html +30 -0
  35. package/docs/crawl/core/components/ui/card/card.html +99 -0
  36. package/docs/crawl/core/components/ui/divider/divider.html +58 -0
  37. package/docs/crawl/core/components/ui/form/checkbox/checkbox.html +73 -0
  38. package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +135 -0
  39. package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +79 -0
  40. package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +62 -0
  41. package/docs/crawl/core/components/ui/form/input/input.html +109 -0
  42. package/docs/crawl/core/components/ui/form/input-autocomplete/input-autocomplete.html +106 -0
  43. package/docs/crawl/core/components/ui/form/radio/radio.html +56 -0
  44. package/docs/crawl/core/components/ui/form/select/select.html +73 -0
  45. package/docs/crawl/core/components/ui/form/switch/switch.html +56 -0
  46. package/docs/crawl/core/components/ui/form/textarea/textarea.html +59 -0
  47. package/docs/crawl/core/components/ui/group/group.html +82 -0
  48. package/docs/crawl/core/components/ui/icon/icon.html +133 -0
  49. package/docs/crawl/core/components/ui/image/image.html +110 -0
  50. package/docs/crawl/core/components/ui/link/link.html +42 -0
  51. package/docs/crawl/core/components/ui/loader/loader.html +50 -0
  52. package/docs/crawl/core/components/ui/menu/menu.html +322 -0
  53. package/docs/crawl/core/components/ui/modal/modal.html +117 -0
  54. package/docs/crawl/core/components/ui/pop/pop.html +102 -0
  55. package/docs/crawl/core/components/ui/progress/progress.html +58 -0
  56. package/docs/crawl/core/components/ui/table/table.html +413 -0
  57. package/docs/crawl/core/components/ui/toast/toast.html +122 -0
  58. package/docs/crawl/core/components/ui/tooltip/tooltip.html +79 -0
  59. package/docs/crawl/docs/_core-concept/dataFlow.html +166 -0
  60. package/docs/crawl/docs/_core-concept/overview.html +66 -0
  61. package/docs/crawl/docs/_core-concept/subscriber.html +75 -0
  62. package/docs/crawl/docs/_decorators/ancestor-attribute.html +116 -0
  63. package/docs/crawl/docs/_decorators/auto-subscribe.html +202 -0
  64. package/docs/crawl/docs/_decorators/bind.html +141 -0
  65. package/docs/crawl/docs/_decorators/get.html +120 -0
  66. package/docs/crawl/docs/_decorators/handle.html +165 -0
  67. package/docs/crawl/docs/_decorators/on-assign.html +355 -0
  68. package/docs/crawl/docs/_decorators/patch.html +52 -0
  69. package/docs/crawl/docs/_decorators/post.html +102 -0
  70. package/docs/crawl/docs/_decorators/publish.html +61 -0
  71. package/docs/crawl/docs/_decorators/put.html +49 -0
  72. package/docs/crawl/docs/_decorators/subscribe.html +109 -0
  73. package/docs/crawl/docs/_decorators/wait-for-ancestors.html +137 -0
  74. package/docs/crawl/docs/_directives/sub.html +93 -0
  75. package/docs/crawl/docs/_getting-started/ai-agents.html +134 -0
  76. package/docs/crawl/docs/_getting-started/concorde-manual-install.html +100 -0
  77. package/docs/crawl/docs/_getting-started/concorde-outside.html +58 -0
  78. package/docs/crawl/docs/_getting-started/create-a-component.html +111 -0
  79. package/docs/crawl/docs/_getting-started/my-first-component.html +189 -0
  80. package/docs/crawl/docs/_getting-started/my-first-subscriber.html +110 -0
  81. package/docs/crawl/docs/_getting-started/pubsub.html +62 -0
  82. package/docs/crawl/docs/_getting-started/start.html +76 -0
  83. package/docs/crawl/docs/_getting-started/theming.html +85 -0
  84. package/docs/crawl/docs/_misc/api-configuration.html +149 -0
  85. package/docs/crawl/docs/_misc/dataProviderKey.html +135 -0
  86. package/docs/crawl/docs/_misc/docs-mock-api.html +146 -0
  87. package/docs/crawl/docs/_misc/dynamic-path.html +180 -0
  88. package/docs/crawl/docs/_misc/endpoint.html +50 -0
  89. package/docs/crawl/docs/_misc/html-integration.html +47 -0
  90. package/docs/crawl/hubs/decorators.html +467 -0
  91. package/docs/crawl/hubs/form-components.html +357 -0
  92. package/docs/crawl/hubs/remote-data.html +374 -0
  93. package/docs/crawl/index.html +99 -0
  94. package/docs/docs-mock-api-sw.js +3 -1
  95. package/docs/docs-mock-api-sw.js.map +2 -2
  96. package/docs/index.html +3 -3
  97. package/docs/llms-full.txt +5423 -0
  98. package/docs/llms.txt +102 -0
  99. package/docs/robots.txt +15 -1
  100. package/docs/sitemap.xml +231 -0
  101. package/docs/src/docs/_decorators/ancestor-attribute.md +56 -8
  102. package/docs/src/docs/_decorators/get.md +47 -1
  103. package/docs/src/docs/search/docs-search.json +92 -2
  104. package/docs/src/tsconfig.declarations.json +22 -0
  105. package/docs/src/tsconfig.emit.json +23 -0
  106. package/docs/src/tsconfig.json +3 -285
  107. package/index.html +1 -0
  108. package/package.json +1 -1
  109. package/public/docs-mock-api-sw.js +3 -1
  110. package/public/docs-mock-api-sw.js.map +2 -2
  111. package/public/robots.txt +15 -1
  112. package/scripts/generate-crawl-docs.mjs +569 -0
  113. package/scripts/post-build-docs.js +18 -14
  114. package/src/core/decorators/api.spec.ts +74 -4
  115. package/src/core/decorators/api.ts +103 -20
  116. package/src/core/decorators/subscriber/ancestorAttribute.spec.ts +42 -0
  117. package/src/core/utils/HTML.ts +4 -5
  118. package/src/docs/_decorators/get.md +47 -1
  119. package/src/docs/components/docs-demo-sources.ts +7 -2
  120. package/src/docs/example/decorators-demo-geo.ts +5 -0
  121. package/src/docs/example/decorators-demo-subscribe-publish-get-demos.ts +72 -31
  122. package/src/docs/mock-api/router.ts +3 -1
  123. package/src/docs/search/docs-search.json +92 -2
@@ -0,0 +1,109 @@
1
+ <!DOCTYPE html>
2
+ <html lang="fr" data-crawl-url="https://concorde.supersoniks.org/crawl/docs/_decorators/subscribe.html" data-doc-id="docs/_decorators/subscribe">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>@subscribe — Concorde</title>
7
+ <meta name="description" content="Keeps a Lit property in sync with a read-only slice of the DataProvider store. You pass a DataProviderKey; when that path changes, the property updates and the component re-renders.">
8
+ <meta name="keywords" content="Concorde, supersoniks, docs/_decorators/subscribe, subscribe, @subscribe, decorator, DataProviderKey, | Shape of the object at that path (, , , , …) |
9
+ | **Key** | , — static path (, ) or dynamic (, (e.g. , ) — often filled via [">
10
+ <meta name="concorde-doc-id" content="docs/_decorators/subscribe">
11
+ <link rel="canonical" href="https://concorde.supersoniks.org/crawl/docs/_decorators/subscribe.html">
12
+ </head>
13
+ <body>
14
+ <header>
15
+ <p><a href="../../index.html">Concorde documentation (crawl)</a> · <a href="https://concorde.supersoniks.org/#docs/_decorators/subscribe.md/subscribe" rel="nofollow">interactive version</a></p>
16
+ </header>
17
+ <main>
18
+ <article>
19
+ <p class="doc-lead" id="doc-summary"><strong>Concorde decorator — @subscribe</strong>. Keeps a Lit property in sync with a read-only slice of the DataProvider store. You pass a DataProviderKey; when that path changes, the property updates and the component re-renders. <span>Doc ID: <code>docs/_decorators/subscribe</code>. Keywords: Concorde, supersoniks, docs/_decorators/subscribe, subscribe, @subscribe, decorator, DataProviderKey, | Shape of the object at that path (, , , , …) |
20
+ | **Key** | , — static path (, ) or dynamic (, (e.g. , ) — often filled via [. URL: <a href="https://concorde.supersoniks.org/crawl/docs/_decorators/subscribe.html">https://concorde.supersoniks.org/crawl/docs/_decorators/subscribe.html</a>.</span></p>
21
+ <h1 id="subscribe">@subscribe</h1>
22
+ <p>Keeps a <strong>Lit property</strong> in sync with a <strong>read-only</strong> slice of the DataProvider store. You pass a <a href="../_misc/dataProviderKey.html#dataProviderKey"><code>DataProviderKey</code></a>; when that path changes, the property updates and the component re-renders.</p>
23
+ <p>Typical setup (same idea as <a href="../_getting-started/my-first-component.html#my-first-component">My first component</a>):</p>
24
+ <table>
25
+ <thead>
26
+ <tr>
27
+ <th>Piece</th>
28
+ <th>Role</th>
29
+ </tr>
30
+ </thead>
31
+ <tbody><tr>
32
+ <td><strong>Type</strong> <code>T</code></td>
33
+ <td>Shape of the object at that path (<code>DocsUserData</code>, <code>{ count: number }</code>, …)</td>
34
+ </tr>
35
+ <tr>
36
+ <td><strong>Key</strong></td>
37
+ <td><code>DataProviderKey&lt;T, U&gt;</code> — static path (<code>&quot;cart&quot;</code>) or dynamic (<code>&quot;users.${userIndex}&quot;</code>, <code>&quot;${dataProvider}&quot;</code>)</td>
38
+ </tr>
39
+ <tr>
40
+ <td><strong>Scope on the host</strong></td>
41
+ <td>Properties listed in <code>U</code> (e.g. <code>dataProvider</code>, <code>userIndex</code>) — often filled via <a href="./ancestor-attribute.html#ancestor-attribute"><code>@ancestorAttribute</code></a></td>
42
+ </tr>
43
+ <tr>
44
+ <td><strong><code>@subscribe(key)</code></strong></td>
45
+ <td>Mirrors the store into <code>@state()</code> (or another property); read-only from the component side</td>
46
+ </tr>
47
+ </tbody></table>
48
+ <p>For <strong>writing</strong> back to the store from component state, use <a href="./publish.html#publish">@publish</a>. In templates, the same paths work with <a href="../_directives/sub.html#sub">sub()</a>.</p>
49
+ <h2 id="import">Import</h2>
50
+ <pre><code class="language-typescript">import { subscribe } from &quot;@supersoniks/concorde/decorators&quot;;
51
+ import { DataProviderKey } from &quot;@supersoniks/concorde/dataProviderKey&quot;;
52
+
53
+ type Data = { count: number };
54
+ const dataKey = new DataProviderKey&amp;lt;Data&amp;gt;(&quot;data&quot;);
55
+
56
+ @subscribe(dataKey.count)
57
+ @state()
58
+ count = 0;
59
+ </code></pre>
60
+ <h2 id="static-path">Static path</h2>
61
+ <p>The key path is fixed. The property type must match <code>T</code> at that segment.</p>
62
+ <pre><code class="language-typescript">const cartKey = new DataProviderKey&amp;lt;{ items: string[] }&amp;gt;(&quot;cart&quot;);
63
+
64
+ @subscribe(cartKey)
65
+ @state()
66
+ cart: { items: string[] } | null = null;
67
+ </code></pre>
68
+ <h2 id="dynamic-path-and-scope">Dynamic path and scope</h2>
69
+ <p>Placeholders <code>${prop}</code> in the key string are resolved from <strong>properties on the same component</strong>. While a value is <code>null</code>/<code>undefined</code>, the subscription is inactive; optional <code>{ skipEmptyPlaceholder: true }</code> also waits on <code>&quot;&quot;</code>. Full rules: <a href="../_misc/dynamic-path.html#dynamic-path">Dynamic path placeholders</a>.</p>
70
+ <p>Declare dynamic props in the key’s second generic so TypeScript expects them on the host:</p>
71
+ <pre><code class="language-typescript">type User = { firstName: string; lastName: string; email: string };
72
+
73
+ @subscribe(new DataProviderKey&amp;lt;User, { userIndex: number }&amp;gt;(&quot;demoUsers.${userIndex}&quot;))
74
+ @state()
75
+ user: User | null = null;
76
+
77
+ @property({ type: Number }) userIndex = 0;
78
+ </code></pre>
79
+ <p>When <code>userIndex</code> changes, <code>@subscribe</code> re-resolves the path and refreshes <code>user</code>.</p>
80
+ <h2 id="row--ancestor-scope">Row / ancestor scope</h2>
81
+ <p>List items (and wrappers like <code>&lt;div dataProvider=&quot;…&quot;&gt;</code>) set which branch the child reads. Pattern from the tutorial:</p>
82
+ <pre><code class="language-typescript">export const rowKey = new DataProviderKey&amp;lt;
83
+ User,
84
+ { dataProvider: string | null }
85
+ &amp;gt;(&quot;${dataProvider}&quot;);
86
+
87
+ @ancestorAttribute(&quot;dataProvider&quot;)
88
+ dataProvider: string | null = null;
89
+
90
+ @subscribe(rowKey)
91
+ @state()
92
+ user: User | null = null;
93
+ </code></pre>
94
+ <h2 id="demo">Demo</h2>
95
+ <pre><code>&lt;docs-demo-sources for=&quot;demo-subscribe-dynamic&quot;&gt;&lt;/docs-demo-sources&gt;
96
+ &lt;demo-subscribe-dynamic&gt;&lt;/demo-subscribe-dynamic&gt;
97
+ </code></pre>
98
+ <h2 id="see-also">See also</h2>
99
+ <ul>
100
+ <li><a href="../_core-concept/dataFlow.html#dataFlow">Data flow</a> — overview</li>
101
+ <li><a href="../_misc/dataProviderKey.html#dataProviderKey">DataProviderKey</a> — paths and host generics</li>
102
+ <li><a href="../_misc/dynamic-path.html#dynamic-path">Dynamic path placeholders</a> — <code>${prop}</code> resolution and <code>skipEmptyPlaceholder</code></li>
103
+ <li><a href="../_directives/sub.html#sub">sub()</a> — same paths inside <code>html</code> templates</li>
104
+ </ul>
105
+
106
+ </article>
107
+ </main>
108
+ </body>
109
+ </html>
@@ -0,0 +1,137 @@
1
+ <!DOCTYPE html>
2
+ <html lang="fr" data-crawl-url="https://concorde.supersoniks.org/crawl/docs/_decorators/wait-for-ancestors.html" data-doc-id="docs/_decorators/wait-for-ancestors">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>@awaitConnectedAncestors and @dispatchConnectedEvent — Concorde</title>
7
+ <meta name="description" content="The @awaitConnectedAncestors and @dispatchConnectedEvent decorators delay a web component's initialization until its matching ancestors have executed their connectedCallback. This is when contextual e">
8
+ <meta name="keywords" content="Concorde, supersoniks, docs/_decorators/wait-for-ancestors, wait-for-ancestors, @awaitConnectedAncestors and @dispatchConnectedEvent, decorator, awaitConnectedAncestors and @dispatchConnectedEvent, @awaitConnectedAncestors, @dispatchConnectedEvent, connectedCallback, sonic-connected, @dispatchConnectedEvent()">
9
+ <meta name="concorde-doc-id" content="docs/_decorators/wait-for-ancestors">
10
+ <link rel="canonical" href="https://concorde.supersoniks.org/crawl/docs/_decorators/wait-for-ancestors.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/wait-for-ancestors.md/wait-for-ancestors" rel="nofollow">interactive version</a></p>
15
+ </header>
16
+ <main>
17
+ <article>
18
+ <p class="doc-lead" id="doc-summary"><strong>Concorde decorator — @awaitConnectedAncestors and @dispatchConnectedEvent</strong>. The @awaitConnectedAncestors and @dispatchConnectedEvent decorators delay a web component's initialization until its matching ancestors have executed their connectedCallback. This is when contextual e <span>Doc ID: <code>docs/_decorators/wait-for-ancestors</code>. Keywords: Concorde, supersoniks, docs/_decorators/wait-for-ancestors, wait-for-ancestors, @awaitConnectedAncestors and @dispatchConnectedEvent, decorator, awaitConnectedAncestors and @dispatchConnectedEvent, @awaitConnectedAncestors, @dispatchConnectedEvent, connectedCallback, sonic-connected, @dispatchConnectedEvent(). URL: <a href="https://concorde.supersoniks.org/crawl/docs/_decorators/wait-for-ancestors.html">https://concorde.supersoniks.org/crawl/docs/_decorators/wait-for-ancestors.html</a>.</span></p>
19
+ <h1 id="awaitconnectedancestors-and-dispatchconnectedevent">@awaitConnectedAncestors and @dispatchConnectedEvent</h1>
20
+ <p>The <code>@awaitConnectedAncestors</code> and <code>@dispatchConnectedEvent</code> decorators delay a web component&#39;s initialization until its matching ancestors have executed their <code>connectedCallback</code>. This is when contextual elements (publisher, dataProvider, etc.) are configured.</p>
21
+ <h2 id="principle">Principle</h2>
22
+ <p>When a child component attaches to the DOM, its ancestors may not yet be initialized (especially if custom element definitions are loaded asynchronously). The <code>@awaitConnectedAncestors</code> decorator delays the component&#39;s <code>connectedCallback</code> until all ancestors matching the provided CSS selectors have executed their <code>connectedCallback</code>.</p>
23
+ <p>The <code>@dispatchConnectedEvent</code> decorator allows ancestors to signal they are ready by dispatching the <code>sonic-connected</code> event at the end of their <code>connectedCallback</code>. The event bubbles, so it can be listened to from anywhere (e.g. <code>document.addEventListener(CONNECTED, handler)</code>).</p>
24
+ <p>Ancestors that are not web components (no hyphen in tag name) are considered connected by default and do not need to emit the event.</p>
25
+ <h2 id="usage">Usage</h2>
26
+ <h3 id="import">Import</h3>
27
+ <pre><code class="language-typescript">import { awaitConnectedAncestors, dispatchConnectedEvent, ancestorAttribute } from &quot;@supersoniks/concorde/decorators&quot;;
28
+ </code></pre>
29
+ <h3 id="basic-example">Basic example</h3>
30
+ <p>An ancestor container decorated with <code>@dispatchConnectedEvent()</code> signals when it is ready. A child component decorated with <code>@awaitConnectedAncestors(&quot;demo-wait-ancestor-container[dataProvider]&quot;)</code> waits for this container to be initialized before initializing itself. Parameters are CSS selectors (<code>element.matches()</code>).</p>
31
+ <p>The parent is registered via <code>customElements.define()</code> (vanilla JS) rather than <code>@customElement</code>, so it can be defined later—e.g. when the user clicks a button. This demonstrates the child waiting until the parent exists.</p>
32
+ <pre><code class="language-typescript">import { html, LitElement } from &quot;lit&quot;;
33
+ import { customElement, state } from &quot;lit/decorators.js&quot;;
34
+
35
+ // Parent: registered later via customElements.define(), not @customElement
36
+ @dispatchConnectedEvent()
37
+ export class DemoWaitAncestorContainer extends LitElement {
38
+ render() {
39
+ return html`&lt;slot&gt;&lt;/slot&gt;`;
40
+ }
41
+ }
42
+
43
+ // Child: waits for parent before initializing
44
+ @customElement(&quot;demo-wait-ancestor-value&quot;)
45
+ @awaitConnectedAncestors(&quot;demo-wait-ancestor-container[dataProvider]&quot;)
46
+ export class DemoWaitAncestorValue extends LitElement {
47
+ @ancestorAttribute(&quot;dataProvider&quot;)
48
+ dataProvider: string | null = null;
49
+
50
+ @state() initializedAt: string = &quot;&quot;;
51
+
52
+ connectedCallback() {
53
+ super.connectedCallback();
54
+ this.initializedAt = new Date().toISOString();
55
+ }
56
+
57
+ render() {
58
+ return html`
59
+ &lt;p&gt;DataProvider from ancestor: &lt;strong&gt;${this.dataProvider || &quot;—&quot;}&lt;/strong&gt;&lt;/p&gt;
60
+ &lt;p&gt;Initialized at: ${this.initializedAt || &quot;(waiting for parent…)&quot;}&lt;/p&gt;
61
+ `;
62
+ }
63
+ }
64
+
65
+ // Demo section: register parent via customElements.define() when user clicks
66
+ @customElement(&quot;demo-wait-ancestors-section&quot;)
67
+ export class DemoWaitAncestorsSection extends LitElement {
68
+ registerParent() {
69
+ if (!customElements.get(&quot;demo-wait-ancestor-container&quot;)) {
70
+ customElements.define(&quot;demo-wait-ancestor-container&quot;, DemoWaitAncestorContainer);
71
+ }
72
+ }
73
+ render() {
74
+ return html`
75
+ &lt;sonic-button @click=${this.registerParent}&gt;Register parent component&lt;/sonic-button&gt;
76
+ &lt;demo-wait-ancestor-container dataProvider=&quot;waitAncestorDemo&quot;&gt;
77
+ &lt;demo-wait-ancestor-value&gt;&lt;/demo-wait-ancestor-value&gt;
78
+ &lt;/demo-wait-ancestor-container&gt;
79
+ `;
80
+ }
81
+ }
82
+ </code></pre>
83
+ <pre><code>&lt;docs-demo-sources for=&quot;demo-wait-ancestors-section&quot;&gt;&lt;/docs-demo-sources&gt;
84
+ &lt;demo-wait-ancestors-section&gt;&lt;/demo-wait-ancestors-section&gt;
85
+ </code></pre>
86
+ <h3 id="multiple-ancestors">Multiple ancestors</h3>
87
+ <p>The child waits for all specified ancestors. Register outer first, then inner — the child initializes only when both are ready.</p>
88
+ <pre><code>&lt;demo-wait-ancestors-multi-section&gt;&lt;/demo-wait-ancestors-multi-section&gt;
89
+ </code></pre>
90
+ <h3 id="ancestors-already-connected">Ancestors already connected</h3>
91
+ <p>When the parent is defined at load and already in the DOM, the child initializes immediately (no delay).</p>
92
+ <p><strong>Static (both in DOM from start):</strong></p>
93
+ <pre><code>&lt;docs-demo-sources for=&quot;demo-wait-ancestors-static-section&quot;&gt;&lt;/docs-demo-sources&gt;
94
+ &lt;demo-wait-ancestors-static-section&gt;&lt;/demo-wait-ancestors-static-section&gt;
95
+ </code></pre>
96
+ <p><strong>Dynamic (child added on button click):</strong></p>
97
+ <pre><code>&lt;docs-demo-sources for=&quot;demo-wait-ancestors-ready-section&quot;&gt;&lt;/docs-demo-sources&gt;
98
+ &lt;demo-wait-ancestors-ready-section&gt;&lt;/demo-wait-ancestors-ready-section&gt;
99
+ </code></pre>
100
+ <h2 id="css-selector-support">CSS selector support</h2>
101
+ <p>Parameters are CSS selectors matched via <code>element.matches()</code> — e.g. <code>&quot;sonic-subscriber&quot;</code>, <code>&quot;sonic-subscriber[dataProvider]&quot;</code>, <code>&quot;.my-container&quot;</code>, or multiple: <code>&quot;sonic-subscriber&quot;, &quot;sonic-sdui&quot;</code>.</p>
102
+ <h2 id="behavior">Behavior</h2>
103
+ <ul>
104
+ <li>Ancestor search uses CSS selectors (<code>element.matches(selector)</code>) — supports tag names, classes, attributes, combinators, etc.</li>
105
+ <li>Traversal includes shadow roots (parentNode / host)</li>
106
+ <li>Non-web components (no hyphen in tag name) are considered connected by default</li>
107
+ <li>For web component ancestors, it waits for <code>customElements.whenDefined(tagName)</code> and the <code>sonic-connected</code> event (or a timeout as fallback)</li>
108
+ <li>If no matching ancestor is found, the original <code>connectedCallback</code> is called immediately</li>
109
+ <li>Ancestors that do not emit <code>sonic-connected</code> trigger the fallback after the timeout (compatibility with existing components)</li>
110
+ </ul>
111
+ <h2 id="use-cases">Use cases</h2>
112
+ <p>These decorators are particularly useful for:</p>
113
+ <ul>
114
+ <li><strong>sonic-value</strong> inside a <strong>sonic-subscriber</strong>: the value waits for the subscriber to configure its publisher</li>
115
+ <li><strong>Components inside sonic-sdui</strong>: wait for the SDUI to load and configure its context</li>
116
+ <li><strong>Any component</strong> depending on context provided by an ancestor custom element</li>
117
+ </ul>
118
+ <h2 id="listening-to-the-connected-event">Listening to the connected event</h2>
119
+ <p>The <code>sonic-connected</code> event bubbles, so you can listen to it from anywhere:</p>
120
+ <pre><code class="language-typescript">import { CONNECTED } from &quot;@supersoniks/concorde/decorators&quot;;
121
+
122
+ someConnectable.addEventListener(CONNECTED, (e) =&gt; {
123
+ console.log(&quot;Component connected:&quot;, e.target);
124
+ });
125
+ </code></pre>
126
+ <h2 id="notes">Notes</h2>
127
+ <ul>
128
+ <li>These decorators apply only to web components (classes extending <code>HTMLElement</code>)</li>
129
+ <li>The fallback timeout ensures compatibility with components that do not yet use <code>@dispatchConnectedEvent</code></li>
130
+ <li>Traversal includes shadow roots</li>
131
+ <li>For a guarantee without relying on the timeout, decorate ancestors (Subscriber, Fetcher, etc.) with <code>@dispatchConnectedEvent</code></li>
132
+ </ul>
133
+
134
+ </article>
135
+ </main>
136
+ </body>
137
+ </html>
@@ -0,0 +1,93 @@
1
+ <!DOCTYPE html>
2
+ <html lang="fr" data-crawl-url="https://concorde.supersoniks.org/crawl/docs/_directives/sub.html" data-doc-id="docs/_directives/sub">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>sub() — Concorde</title>
7
+ <meta name="description" content="Read-only Lit directive: displays the current DataProvider value and updates whenever it is assigned.">
8
+ <meta name="keywords" content="Concorde, supersoniks, docs/_directives/sub, sub, sub(), directive, ${prop}, @subscribe, null, &quot;&quot;, skipEmptyPlaceholder, ${…}, get, set">
9
+ <meta name="concorde-doc-id" content="docs/_directives/sub">
10
+ <link rel="canonical" href="https://concorde.supersoniks.org/crawl/docs/_directives/sub.html">
11
+ </head>
12
+ <body>
13
+ <header>
14
+ <p><a href="../../index.html">Concorde documentation (crawl)</a> · <a href="https://concorde.supersoniks.org/#docs/_directives/sub.md/sub" rel="nofollow">interactive version</a></p>
15
+ </header>
16
+ <main>
17
+ <article>
18
+ <p class="doc-lead" id="doc-summary"><strong>Concorde directive — sub()</strong>. Read-only Lit directive: displays the current DataProvider value and updates whenever it is assigned. <span>Doc ID: <code>docs/_directives/sub</code>. Keywords: Concorde, supersoniks, docs/_directives/sub, sub, sub(), directive, ${prop}, @subscribe, null, &quot;&quot;, skipEmptyPlaceholder, ${…}, get, set. URL: <a href="https://concorde.supersoniks.org/crawl/docs/_directives/sub.html">https://concorde.supersoniks.org/crawl/docs/_directives/sub.html</a>.</span></p>
19
+ <h1 id="sub">sub()</h1>
20
+ <p>Read-only Lit directive: displays the current <strong>DataProvider</strong> value and updates whenever it is assigned.</p>
21
+ <h2 id="import">Import</h2>
22
+ <pre><code class="language-typescript">import { sub } from &quot;@supersoniks/concorde/directives&quot;;
23
+ </code></pre>
24
+ <h2 id="string-path">String path</h2>
25
+ <pre><code class="language-typescript">render() {
26
+ return html`&amp;lt;p&amp;gt;Count: ${sub(&quot;myCounter.count&quot;)}&amp;lt;/p&amp;gt;`;
27
+ }
28
+ </code></pre>
29
+ <h2 id="dataproviderkey-static">DataProviderKey (static)</h2>
30
+ <pre><code class="language-typescript">import { DataProviderKey } from &quot;@supersoniks/concorde/dataProviderKey&quot;;
31
+ import { sub } from &quot;@supersoniks/concorde/directives&quot;;
32
+
33
+ const counterKey = new DataProviderKey&amp;lt;{ count: number }&amp;gt;(&quot;myCounter&quot;);
34
+
35
+ render() {
36
+ return html`&amp;lt;p&amp;gt;${sub(counterKey.count)}&amp;lt;/p&amp;gt;`;
37
+ }
38
+ </code></pre>
39
+ <h2 id="dynamic-dataproviderkey-prop">Dynamic DataProviderKey (<code>${prop}</code>)</h2>
40
+ <p>Like <code>@subscribe</code>: the path is resolved on the template <strong>host component</strong>; the directive re-subscribes when observed props change. Placeholder values (<code>null</code>, <code>&quot;&quot;</code>, <code>0</code>, …): <a href="../_misc/dynamic-path.html#dynamic-path">Dynamic path placeholders</a> (<code>skipEmptyPlaceholder</code> not available on <code>sub()</code> yet).</p>
41
+ <pre><code class="language-typescript">import { DataProviderKey } from &quot;@supersoniks/concorde/dataProviderKey&quot;;
42
+ import { sub } from &quot;@supersoniks/concorde/directives&quot;;
43
+
44
+ type User = { firstName: string; lastName: string; email: string };
45
+ const userKey = new DataProviderKey&amp;lt;User, { userIndex: number }&amp;gt;(
46
+ &quot;demoUsers.${userIndex}&quot;,
47
+ );
48
+
49
+ @customElement(&quot;demo-sub-dynamic&quot;)
50
+ export class DemoSubDynamic extends LitElement {
51
+ @property({ type: Number }) userIndex = 0;
52
+
53
+ render() {
54
+ return html`
55
+ &amp;lt;p&amp;gt;${sub(userKey.email)}&amp;lt;/p&amp;gt;
56
+ `;
57
+ }
58
+ }
59
+ </code></pre>
60
+ <h2 id="demo">Demo</h2>
61
+ <pre><code>&lt;docs-demo-sources for=&quot;demo-sub-template&quot;&gt;&lt;/docs-demo-sources&gt;
62
+ &lt;demo-sub-template&gt;&lt;/demo-sub-template&gt;
63
+ </code></pre>
64
+ <h2 id="concatenation-forms">Concatenation (forms)</h2>
65
+ <pre><code class="language-typescript">html`&amp;lt;span&amp;gt;${sub(this.formDataProvider + &quot;.email&quot;)}&amp;lt;/span&amp;gt;`
66
+ </code></pre>
67
+ <h2 id="sub-vs-get--set--dp">sub() vs get() / set() / dp()</h2>
68
+ <table>
69
+ <thead>
70
+ <tr>
71
+ <th>API</th>
72
+ <th>Context</th>
73
+ <th>Dynamic <code>${…}</code></th>
74
+ </tr>
75
+ </thead>
76
+ <tbody><tr>
77
+ <td><code>sub()</code></td>
78
+ <td>Lit template, reactive</td>
79
+ <td>Yes</td>
80
+ </tr>
81
+ <tr>
82
+ <td><code>get</code> / <code>set</code> / <code>dp</code></td>
83
+ <td>Imperative code</td>
84
+ <td>No</td>
85
+ </tr>
86
+ </tbody></table>
87
+ <p>Do not replace <code>sub(path)</code> with <code>get(path)</code> in a template: <code>get</code> returns a one-time snapshot.</p>
88
+ <p>See <a href="../_misc/dataProviderKey.html#dataProviderKey">DataProviderKey</a>, <a href="../_decorators/subscribe.html#subscribe">@subscribe</a>, and the <code>concorde-get-set-dp</code> migration skill.</p>
89
+
90
+ </article>
91
+ </main>
92
+ </body>
93
+ </html>
@@ -0,0 +1,134 @@
1
+ <!DOCTYPE html>
2
+ <html lang="fr" data-crawl-url="https://concorde.supersoniks.org/crawl/docs/_getting-started/ai-agents.html" data-doc-id="docs/_getting-started/ai-agents">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>AI agents (skills &amp; AGENTS.md) — Concorde</title>
7
+ <meta name="description" content="Concorde ships skills, rules, and a root AGENTS.md so Cursor, JetBrains AI Assistant, and other coding agents follow framework patterns (DataProvider, decorators, short imports, scope, theme, migratio">
8
+ <meta name="keywords" content="Concorde, supersoniks, docs/_getting-started/ai-agents, ai-agents, AI agents (skills &amp; AGENTS.md), guide, AGENTS.md, yarn ai:sync, ai-init, yarn add @supersoniks/concorde, |
9
+ | Concorde repo (contributors) | , --merge-agents, --overlay , --cursor-only">
10
+ <meta name="concorde-doc-id" content="docs/_getting-started/ai-agents">
11
+ <link rel="canonical" href="https://concorde.supersoniks.org/crawl/docs/_getting-started/ai-agents.html">
12
+ </head>
13
+ <body>
14
+ <header>
15
+ <p><a href="../../index.html">Concorde documentation (crawl)</a> · <a href="https://concorde.supersoniks.org/#docs/_getting-started/ai-agents.md/ai-agents" rel="nofollow">interactive version</a></p>
16
+ </header>
17
+ <main>
18
+ <article>
19
+ <p class="doc-lead" id="doc-summary"><strong>Concorde guide — AI agents (skills &amp; AGENTS.md)</strong>. Concorde ships skills, rules, and a root AGENTS.md so Cursor, JetBrains AI Assistant, and other coding agents follow framework patterns (DataProvider, decorators, short imports, scope, theme, migratio <span>Doc ID: <code>docs/_getting-started/ai-agents</code>. Keywords: Concorde, supersoniks, docs/_getting-started/ai-agents, ai-agents, AI agents (skills &amp; AGENTS.md), guide, AGENTS.md, yarn ai:sync, ai-init, yarn add @supersoniks/concorde, |
20
+ | Concorde repo (contributors) | , --merge-agents, --overlay , --cursor-only. URL: <a href="https://concorde.supersoniks.org/crawl/docs/_getting-started/ai-agents.html">https://concorde.supersoniks.org/crawl/docs/_getting-started/ai-agents.html</a>.</span></p>
21
+ <h1 id="ai-agents-skills--agentsmd">AI agents (skills &amp; AGENTS.md)</h1>
22
+ <p>Concorde ships <strong>skills</strong>, <strong>rules</strong>, and a root <strong><code>AGENTS.md</code></strong> so Cursor, JetBrains AI Assistant, and other coding agents follow framework patterns (DataProvider, decorators, short imports, scope, theme, migrations).</p>
23
+ <p>On a <a href="./concorde-outside.html#concorde-outside">starter</a> project, run <code>yarn ai:sync</code> after install. On a <a href="./concorde-manual-install.html#concorde-manual-install">manual / brownfield</a> project, install Concorde first, then use <code>ai-init</code> below.</p>
24
+ <h2 id="dedicated-commands">Dedicated commands</h2>
25
+ <table>
26
+ <thead>
27
+ <tr>
28
+ <th>Context</th>
29
+ <th>Command</th>
30
+ </tr>
31
+ </thead>
32
+ <tbody><tr>
33
+ <td><a href="https://www.npmjs.com/package/@supersoniks/create-concorde-ts-starter">create-concorde-ts-starter</a> project</td>
34
+ <td><code>yarn ai:sync</code></td>
35
+ </tr>
36
+ <tr>
37
+ <td>Any consumer app (after <code>yarn add @supersoniks/concorde</code>)</td>
38
+ <td><code>node node_modules/@supersoniks/concorde/scripts/ai-init.mjs</code></td>
39
+ </tr>
40
+ <tr>
41
+ <td>Concorde repo (contributors)</td>
42
+ <td><code>yarn ai-init</code></td>
43
+ </tr>
44
+ </tbody></table>
45
+ <pre><code class="language-shell"># Starter (from project root)
46
+ yarn ai:sync
47
+
48
+ # Manual / existing project
49
+ node node_modules/@supersoniks/concorde/scripts/ai-init.mjs
50
+ </code></pre>
51
+ <h2 id="useful-flags">Useful flags</h2>
52
+ <table>
53
+ <thead>
54
+ <tr>
55
+ <th>Flag</th>
56
+ <th>Effect</th>
57
+ </tr>
58
+ </thead>
59
+ <tbody><tr>
60
+ <td><code>--merge-agents</code></td>
61
+ <td>Append to an existing <code>AGENTS.md</code> instead of replacing it</td>
62
+ </tr>
63
+ <tr>
64
+ <td><code>--overlay &lt;dir&gt;</code></td>
65
+ <td>Copy extra rules/skills from another layer (e.g. starter kit)</td>
66
+ </tr>
67
+ <tr>
68
+ <td><code>--cursor-only</code></td>
69
+ <td>Install only <code>.cursor/skills</code> and <code>.cursor/rules</code></td>
70
+ </tr>
71
+ <tr>
72
+ <td><code>--jetbrains-only</code></td>
73
+ <td>Install only <code>.aiassistant/rules/</code></td>
74
+ </tr>
75
+ </tbody></table>
76
+ <h2 id="what-gets-installed">What gets installed</h2>
77
+ <table>
78
+ <thead>
79
+ <tr>
80
+ <th>Path</th>
81
+ <th>Role</th>
82
+ </tr>
83
+ </thead>
84
+ <tbody><tr>
85
+ <td><code>AGENTS.md</code></td>
86
+ <td>Project-level guide for agents (Concorde conventions)</td>
87
+ </tr>
88
+ <tr>
89
+ <td><code>.cursor/skills/concorde/</code></td>
90
+ <td>Core Lit + DataProvider patterns</td>
91
+ </tr>
92
+ <tr>
93
+ <td><code>.cursor/skills/concorde-imports/</code></td>
94
+ <td>Short <code>@supersoniks/concorde/…</code> import paths</td>
95
+ </tr>
96
+ <tr>
97
+ <td><code>.cursor/skills/concorde-scope/</code></td>
98
+ <td><code>serviceURL</code>, <code>formDataProvider</code>, API configuration</td>
99
+ </tr>
100
+ <tr>
101
+ <td><code>.cursor/skills/concorde-theme/</code></td>
102
+ <td><code>sonic-theme</code> and <code>--sc-*</code> tokens</td>
103
+ </tr>
104
+ <tr>
105
+ <td><code>.cursor/skills/concorde-menu/</code></td>
106
+ <td><code>sonic-menu</code> navigation</td>
107
+ </tr>
108
+ <tr>
109
+ <td><code>.cursor/skills/concorde-get-set-dp/</code></td>
110
+ <td><code>get</code> / <code>set</code> / <code>dp</code> and <code>DataProviderKey</code> migration</td>
111
+ </tr>
112
+ <tr>
113
+ <td><code>.cursor/rules/concorde.mdc</code></td>
114
+ <td>Cursor rules (always-on patterns)</td>
115
+ </tr>
116
+ <tr>
117
+ <td><code>.aiassistant/rules/concorde.md</code></td>
118
+ <td>JetBrains AI Assistant rules</td>
119
+ </tr>
120
+ </tbody></table>
121
+ <h2 id="workflow">Workflow</h2>
122
+ <ol>
123
+ <li><strong>Starter project:</strong> <a href="./concorde-outside.html#concorde-outside">Installation</a> — <code>yarn ai:sync</code> is wired in the kit.</li>
124
+ <li><strong>Existing / manual Vite project:</strong> <a href="./concorde-manual-install.html#concorde-manual-install">Manual installation</a>, then <strong><code>ai-init</code></strong> after <code>yarn add @supersoniks/concorde</code>.</li>
125
+ <li>Commit <code>AGENTS.md</code>, <code>.cursor/</code>, and <code>.aiassistant/</code> if your team shares agent settings.</li>
126
+ <li>Re-run the same command when you bump <code>@supersoniks/concorde</code> to refresh skills from <code>node_modules/@supersoniks/concorde/ai/</code>.</li>
127
+ <li>In Cursor, skills under <code>.cursor/skills/</code> are picked up automatically; mention a skill in chat for focused tasks (e.g. migration → <code>concorde-get-set-dp</code>).</li>
128
+ </ol>
129
+ <p>Source files in the npm package: <code>node_modules/@supersoniks/concorde/ai/</code> (see also <code>ai/README.md</code> in the <a href="https://github.com/supersoniks/concorde">Concorde repository</a>).</p>
130
+
131
+ </article>
132
+ </main>
133
+ </body>
134
+ </html>
@@ -0,0 +1,100 @@
1
+ <!DOCTYPE html>
2
+ <html lang="fr" data-crawl-url="https://concorde.supersoniks.org/crawl/docs/_getting-started/concorde-manual-install.html" data-doc-id="docs/_getting-started/concorde-manual-install">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Manual installation (Vite) — Concorde</title>
7
+ <meta name="description" content="&gt; Legacy — for brownfield apps or custom stacks. New projects should use the starter.">
8
+ <meta name="keywords" content="Concorde, supersoniks, docs/_getting-started/concorde-manual-install, concorde-manual-install, Manual installation (Vite), guide, tsconfig.json, AGENTS.md, --host, becomes ,
9
+ * , main.ts, my-element.ts">
10
+ <meta name="concorde-doc-id" content="docs/_getting-started/concorde-manual-install">
11
+ <link rel="canonical" href="https://concorde.supersoniks.org/crawl/docs/_getting-started/concorde-manual-install.html">
12
+ </head>
13
+ <body>
14
+ <header>
15
+ <p><a href="../../index.html">Concorde documentation (crawl)</a> · <a href="https://concorde.supersoniks.org/#docs/_getting-started/concorde-manual-install.md/concorde-manual-install" rel="nofollow">interactive version</a></p>
16
+ </header>
17
+ <main>
18
+ <article>
19
+ <p class="doc-lead" id="doc-summary"><strong>Concorde guide — Manual installation (Vite)</strong>. &gt; Legacy — for brownfield apps or custom stacks. New projects should use the starter. <span>Doc ID: <code>docs/_getting-started/concorde-manual-install</code>. Keywords: Concorde, supersoniks, docs/_getting-started/concorde-manual-install, concorde-manual-install, Manual installation (Vite), guide, tsconfig.json, AGENTS.md, --host, becomes ,
20
+ * , main.ts, my-element.ts. URL: <a href="https://concorde.supersoniks.org/crawl/docs/_getting-started/concorde-manual-install.html">https://concorde.supersoniks.org/crawl/docs/_getting-started/concorde-manual-install.html</a>.</span></p>
21
+ <h1 id="manual-installation-vite">Manual installation (Vite)</h1>
22
+ <blockquote>
23
+ <p><strong>Legacy</strong> — for brownfield apps or custom stacks. New projects should use the <a href="./concorde-outside.html#concorde-outside">starter</a>.</p>
24
+ </blockquote>
25
+ <h2 id="brand-new-vite-project">Brand New Vite Project</h2>
26
+ <p>Tailwind configuration is not covered here yet.</p>
27
+ <h3 id="creating-the-project">Creating the Project</h3>
28
+ <pre><code class="language-shell"># Pure JavaScript project
29
+ yarn create vite --template vanilla-js
30
+ # TypeScript project
31
+ # (it is recommended to use this approach, which installs Lit separately if needed, via &quot;yarn add lit&quot;)
32
+ yarn create vite --template vanilla-ts
33
+ # TypeScript + Lit project
34
+ # (creating new web components, for example, to extend the fetch or subscriber mixins)
35
+ yarn create vite --template lit-ts
36
+ </code></pre>
37
+ <p>Using Lit with TypeScript requires the following configuration in the &quot;compilerOptions&quot; section of the <code>tsconfig.json</code> file:</p>
38
+ <pre><code class="language-json">&quot;experimentalDecorators&quot;: true,
39
+ &quot;useDefineForClassFields&quot;: false
40
+ </code></pre>
41
+ <h3 id="installing-concorde">Installing Concorde</h3>
42
+ <p>Navigate to the project folder created and perform the installation:</p>
43
+ <pre><code class="language-shell">yarn add @supersoniks/concorde
44
+ </code></pre>
45
+ <p>Agent skills (<code>AGENTS.md</code>, Cursor / JetBrains): see <a href="./ai-agents.html#ai-agents">AI agents</a> — run <code>node node_modules/@supersoniks/concorde/scripts/ai-init.mjs</code> after install.</p>
46
+ <h3 id="development--build">Development / Build</h3>
47
+ <pre><code class="language-shell"># Development (you can add `--host` after the command chain in package.json&#39;s dev script instead of typing it each time as shown below)
48
+ yarn dev --host
49
+ # Build
50
+ yarn build
51
+ </code></pre>
52
+ <h2 id="shortcut-imports">Shortcut Imports</h2>
53
+ <p>Shortcut imports work by default in JavaScript, but in TypeScript, they are activated by choice as they inject data into <em>tsconfig.json</em>. Here is the command:</p>
54
+ <pre><code class="language-shell">npx concorde enable-short-paths
55
+ </code></pre>
56
+ <p>Shortcut imports replace the actual paths with aliases as follows:</p>
57
+ <ul>
58
+ <li><code>@supersoniks/concorde/core/components/functional_or_ui/component/component</code> becomes <code>@supersoniks/concorde/functional_or_ui/component</code></li>
59
+ <li><code>@supersoniks/concorde/core/mixins_or_utils/class_name</code> becomes <code>@supersoniks/concorde/mixins_or_utils/class_name</code></li>
60
+ </ul>
61
+ <p>The original paths remain accessible. Shortcut imports are used for the examples later in this documentation.</p>
62
+ <h2 id="usage">Usage</h2>
63
+ <h3 id="simple-integration-in-html">Simple Integration in HTML</h3>
64
+ <p>Import needed component in <code>main.ts</code> or wherever you want to use it:</p>
65
+ <pre><code class="language-typescript">import &quot;@supersoniks/concorde/ui/button&quot;;
66
+ </code></pre>
67
+ <p>Then in the render function ofyour component or in the HTML of the web page that includes the compiled JS, use the component as follows:</p>
68
+ <pre><code>&lt;sonic-button variant=&quot;outline&quot;&gt;My button&lt;/sonic-button&gt;
69
+ </code></pre>
70
+ <h3 id="using-a-mixin-to-create-a-new-lit-component">Using a Mixin to Create a New Lit Component</h3>
71
+ <p>For example, create a file <code>my-element.ts</code> at the root:</p>
72
+ <pre><code class="language-typescript">import { html, LitElement } from &quot;lit&quot;;
73
+ import { customElement, property } from &quot;lit/decorators.js&quot;;
74
+ import Fetcher from &quot;@supersoniks/concorde/mixins/Fetcher&quot;;
75
+ import Subscriber from &quot;@supersoniks/concorde/mixins/Subscriber&quot;;
76
+
77
+ @customElement(&quot;my-element&quot;)
78
+ export class SonicComponent extends Fetcher(Subscriber(LitElement)) {
79
+ @property() email = &quot;&quot;;
80
+ @property() first_name = &quot;&quot;;
81
+ @property() last_name = &quot;&quot;;
82
+
83
+ render() {
84
+ return html`&lt;div&gt;
85
+ ${this.first_name} ${this.last_name} : ${this.email}
86
+ &lt;/div&gt;`;
87
+ }
88
+ }
89
+ </code></pre>
90
+ <p>Import component <code>main.ts</code> or <code>main.js</code> or any other component that uses it to be compiled</p>
91
+ <pre><code class="language-typescript">import &quot;./my-element&quot;;
92
+ </code></pre>
93
+ <p>In the HTML of a JS or TS component or in the HTML of the web page containing the compiled JS:</p>
94
+ <pre><code class="language-html">&lt;my-element serviceURL=&quot;/docs-mock-api&quot; dataProvider=&quot;api/users/2&quot; key=&quot;data&quot;&gt;&lt;/my-element&gt;
95
+ </code></pre>
96
+
97
+ </article>
98
+ </main>
99
+ </body>
100
+ </html>