@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.
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +195 -195
- package/concorde-core.es.js +3390 -3370
- package/dist/concorde-core.bundle.js +195 -195
- package/dist/concorde-core.es.js +3390 -3370
- package/dist/docs-mock-api-sw.js +3 -1
- package/dist/docs-mock-api-sw.js.map +2 -2
- package/dist/js/core/decorators/api.js +64 -12
- package/dist/js/core/decorators/api.js.map +1 -1
- package/dist/js/core/utils/HTML.js +4 -5
- package/dist/js/core/utils/HTML.js.map +1 -1
- package/dist/robots.txt +15 -1
- package/dist/types/core/decorators/api.d.ts +14 -1
- package/dist/types/core/decorators/api.d.ts.map +1 -1
- package/dist/types/core/utils/HTML.d.ts.map +1 -1
- package/docs/assets/{index-t0-i22oI.css → index-Bnp7gVaA.css} +1 -1
- package/docs/assets/{index-BEgZEIbv.js → index-hElUgV9_.js} +894 -552
- package/docs/crawl/core/components/functional/date/date.html +190 -0
- package/docs/crawl/core/components/functional/fetch/fetch.html +109 -0
- package/docs/crawl/core/components/functional/if/if.html +27 -0
- package/docs/crawl/core/components/functional/list/list.html +70 -0
- package/docs/crawl/core/components/functional/mix/mix.html +45 -0
- package/docs/crawl/core/components/functional/queue/queue.html +96 -0
- package/docs/crawl/core/components/functional/router/router.html +106 -0
- package/docs/crawl/core/components/functional/sdui/sdui.html +269 -0
- package/docs/crawl/core/components/functional/states/states.html +66 -0
- package/docs/crawl/core/components/functional/submit/submit.html +160 -0
- package/docs/crawl/core/components/functional/subscriber/subscriber.html +67 -0
- package/docs/crawl/core/components/functional/value/value.html +51 -0
- package/docs/crawl/core/components/ui/alert/alert.html +110 -0
- package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +23 -0
- package/docs/crawl/core/components/ui/badge/badge.html +119 -0
- package/docs/crawl/core/components/ui/button/button.html +149 -0
- package/docs/crawl/core/components/ui/captcha/captcha.html +30 -0
- package/docs/crawl/core/components/ui/card/card.html +99 -0
- package/docs/crawl/core/components/ui/divider/divider.html +58 -0
- package/docs/crawl/core/components/ui/form/checkbox/checkbox.html +73 -0
- package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +135 -0
- package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +79 -0
- package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +62 -0
- package/docs/crawl/core/components/ui/form/input/input.html +109 -0
- package/docs/crawl/core/components/ui/form/input-autocomplete/input-autocomplete.html +106 -0
- package/docs/crawl/core/components/ui/form/radio/radio.html +56 -0
- package/docs/crawl/core/components/ui/form/select/select.html +73 -0
- package/docs/crawl/core/components/ui/form/switch/switch.html +56 -0
- package/docs/crawl/core/components/ui/form/textarea/textarea.html +59 -0
- package/docs/crawl/core/components/ui/group/group.html +82 -0
- package/docs/crawl/core/components/ui/icon/icon.html +133 -0
- package/docs/crawl/core/components/ui/image/image.html +110 -0
- package/docs/crawl/core/components/ui/link/link.html +42 -0
- package/docs/crawl/core/components/ui/loader/loader.html +50 -0
- package/docs/crawl/core/components/ui/menu/menu.html +322 -0
- package/docs/crawl/core/components/ui/modal/modal.html +117 -0
- package/docs/crawl/core/components/ui/pop/pop.html +102 -0
- package/docs/crawl/core/components/ui/progress/progress.html +58 -0
- package/docs/crawl/core/components/ui/table/table.html +413 -0
- package/docs/crawl/core/components/ui/toast/toast.html +122 -0
- package/docs/crawl/core/components/ui/tooltip/tooltip.html +79 -0
- package/docs/crawl/docs/_core-concept/dataFlow.html +166 -0
- package/docs/crawl/docs/_core-concept/overview.html +66 -0
- package/docs/crawl/docs/_core-concept/subscriber.html +75 -0
- package/docs/crawl/docs/_decorators/ancestor-attribute.html +116 -0
- package/docs/crawl/docs/_decorators/auto-subscribe.html +202 -0
- package/docs/crawl/docs/_decorators/bind.html +141 -0
- package/docs/crawl/docs/_decorators/get.html +120 -0
- package/docs/crawl/docs/_decorators/handle.html +165 -0
- package/docs/crawl/docs/_decorators/on-assign.html +355 -0
- package/docs/crawl/docs/_decorators/patch.html +52 -0
- package/docs/crawl/docs/_decorators/post.html +102 -0
- package/docs/crawl/docs/_decorators/publish.html +61 -0
- package/docs/crawl/docs/_decorators/put.html +49 -0
- package/docs/crawl/docs/_decorators/subscribe.html +109 -0
- package/docs/crawl/docs/_decorators/wait-for-ancestors.html +137 -0
- package/docs/crawl/docs/_directives/sub.html +93 -0
- package/docs/crawl/docs/_getting-started/ai-agents.html +134 -0
- package/docs/crawl/docs/_getting-started/concorde-manual-install.html +100 -0
- package/docs/crawl/docs/_getting-started/concorde-outside.html +58 -0
- package/docs/crawl/docs/_getting-started/create-a-component.html +111 -0
- package/docs/crawl/docs/_getting-started/my-first-component.html +189 -0
- package/docs/crawl/docs/_getting-started/my-first-subscriber.html +110 -0
- package/docs/crawl/docs/_getting-started/pubsub.html +62 -0
- package/docs/crawl/docs/_getting-started/start.html +76 -0
- package/docs/crawl/docs/_getting-started/theming.html +85 -0
- package/docs/crawl/docs/_misc/api-configuration.html +149 -0
- package/docs/crawl/docs/_misc/dataProviderKey.html +135 -0
- package/docs/crawl/docs/_misc/docs-mock-api.html +146 -0
- package/docs/crawl/docs/_misc/dynamic-path.html +180 -0
- package/docs/crawl/docs/_misc/endpoint.html +50 -0
- package/docs/crawl/docs/_misc/html-integration.html +47 -0
- package/docs/crawl/hubs/decorators.html +467 -0
- package/docs/crawl/hubs/form-components.html +357 -0
- package/docs/crawl/hubs/remote-data.html +374 -0
- package/docs/crawl/index.html +99 -0
- package/docs/docs-mock-api-sw.js +3 -1
- package/docs/docs-mock-api-sw.js.map +2 -2
- package/docs/index.html +3 -3
- package/docs/llms-full.txt +5423 -0
- package/docs/llms.txt +102 -0
- package/docs/robots.txt +15 -1
- package/docs/sitemap.xml +231 -0
- package/docs/src/docs/_decorators/ancestor-attribute.md +56 -8
- package/docs/src/docs/_decorators/get.md +47 -1
- package/docs/src/docs/search/docs-search.json +92 -2
- package/docs/src/tsconfig.declarations.json +22 -0
- package/docs/src/tsconfig.emit.json +23 -0
- package/docs/src/tsconfig.json +3 -285
- package/index.html +1 -0
- package/package.json +1 -1
- package/public/docs-mock-api-sw.js +3 -1
- package/public/docs-mock-api-sw.js.map +2 -2
- package/public/robots.txt +15 -1
- package/scripts/generate-crawl-docs.mjs +569 -0
- package/scripts/post-build-docs.js +18 -14
- package/src/core/decorators/api.spec.ts +74 -4
- package/src/core/decorators/api.ts +103 -20
- package/src/core/decorators/subscriber/ancestorAttribute.spec.ts +42 -0
- package/src/core/utils/HTML.ts +4 -5
- package/src/docs/_decorators/get.md +47 -1
- package/src/docs/components/docs-demo-sources.ts +7 -2
- package/src/docs/example/decorators-demo-geo.ts +5 -0
- package/src/docs/example/decorators-demo-subscribe-publish-get-demos.ts +72 -31
- package/src/docs/mock-api/router.ts +3 -1
- package/src/docs/search/docs-search.json +92 -2
package/docs/llms.txt
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Concorde
|
|
2
|
+
|
|
3
|
+
> Web components framework (Lit, DataProvider, decorators).
|
|
4
|
+
|
|
5
|
+
Documentation for AI indexers lives under `/crawl/` as **HTML** (`.html`), not Markdown.
|
|
6
|
+
Example: https://concorde.supersoniks.org/crawl/docs/_decorators/post.html
|
|
7
|
+
Do not fetch `/crawl/**/*.md` (does not exist) nor `/src/docs/**/*.md` (SPA source only).
|
|
8
|
+
|
|
9
|
+
Full text: https://concorde.supersoniks.org/llms-full.txt
|
|
10
|
+
|
|
11
|
+
## Topic hubs (start here for RAG)
|
|
12
|
+
|
|
13
|
+
- [Concorde decorators reference](https://concorde.supersoniks.org/crawl/hubs/decorators.html) (hubs/decorators, 12 pages)
|
|
14
|
+
- [Fetching remote data in Concorde](https://concorde.supersoniks.org/crawl/hubs/remote-data.html) (hubs/remote-data, 11 pages)
|
|
15
|
+
- [Concorde form components](https://concorde.supersoniks.org/crawl/hubs/form-components.html) (hubs/form-components, 10 pages)
|
|
16
|
+
|
|
17
|
+
## Docs
|
|
18
|
+
|
|
19
|
+
- [Date](https://concorde.supersoniks.org/crawl/core/components/functional/date/date.html) (core/components/functional/date/date): Nothing is displayed.
|
|
20
|
+
- [Fetch](https://concorde.supersoniks.org/crawl/core/components/functional/fetch/fetch.html) (core/components/functional/fetch/fetch): > New apps: prefer @get for a typed GET on a component, or List / Queue with fetch for collections. Use Local API demos (serviceURL="/docs-mock-api") to try examples offline.
|
|
21
|
+
- [if](https://concorde.supersoniks.org/crawl/core/components/functional/if/if.html) (core/components/functional/if/if): The sonic-if component shows its slot when .condition is true. In Lit, bind .condition from store-driven state (@subscribe on a formDataProvider field) — live preview and TypeScript source are the sam
|
|
22
|
+
- [List](https://concorde.supersoniks.org/crawl/core/components/functional/list/list.html) (core/components/functional/list/list): > Try offline: serviceURL="/docs-mock-api" and dataProvider="api/users" with key="data" — see Local API demos. Recommended patterns: Data flow.
|
|
23
|
+
- [Mix](https://concorde.supersoniks.org/crawl/core/components/functional/mix/mix.html) (core/components/functional/mix/mix): Mix allows you to mix several subsets of dataProvider in a new key/value structure which is itself associated with a new dataProvider. The data update is then bidirectional.
|
|
24
|
+
- [Queue](https://concorde.supersoniks.org/crawl/core/components/functional/queue/queue.html) (core/components/functional/queue/queue): > Try offline: serviceURL="/docs-mock-api" — see Local API demos. Row rendering: Data flow (.items property binding).
|
|
25
|
+
- [Router](https://concorde.supersoniks.org/crawl/core/components/functional/router/router.html) (core/components/functional/router/router): sonic-router watches document.location (pathname + hash) and renders the matching view.
|
|
26
|
+
- [SDUI](https://concorde.supersoniks.org/crawl/core/components/functional/sdui/sdui.html) (core/components/functional/sdui/sdui): SDUI stands for Server Driven User Interfaces.
|
|
27
|
+
- [States](https://concorde.supersoniks.org/crawl/core/components/functional/states/states.html) (core/components/functional/states/states): * It loops over its child templates and tests if the regexp contained in the *data-value* attribute matches the value of the property
|
|
28
|
+
- [Submit](https://concorde.supersoniks.org/crawl/core/components/functional/submit/submit.html) (core/components/functional/submit/submit): > Live demos: <docs-lit-demo> + src/docs/example/docs-submit-demos.ts. Use Local API demos (serviceURL="/docs-mock-api").
|
|
29
|
+
- [Subscriber](https://concorde.supersoniks.org/crawl/core/components/functional/subscriber/subscriber.html) (core/components/functional/subscriber/subscriber): La mixin Subscriber permet lier un composant à un publisher.
|
|
30
|
+
- [Value](https://concorde.supersoniks.org/crawl/core/components/functional/value/value.html) (core/components/functional/value/value): Simply shows a value from a data provider.
|
|
31
|
+
- [Concorde](https://concorde.supersoniks.org/crawl/core/components/ui/alert-messages/alert-messages.html) (core/components/ui/alert-messages/alert-messages): Concorde documentation: Concorde
|
|
32
|
+
- [Alert](https://concorde.supersoniks.org/crawl/core/components/ui/alert/alert.html) (core/components/ui/alert/alert): This address is already in use. Lorem ipsum dolor sit amet.
|
|
33
|
+
- [Badge](https://concorde.supersoniks.org/crawl/core/components/ui/badge/badge.html) (core/components/ui/badge/badge): Messages <sonic-badge slot="suffix" type="danger" size="xs">5</sonic-badge>
|
|
34
|
+
- [Button](https://concorde.supersoniks.org/crawl/core/components/ui/button/button.html) (core/components/ui/button/button): The length of the button depends on the size of its content
|
|
35
|
+
- [Captcha](https://concorde.supersoniks.org/crawl/core/components/ui/captcha/captcha.html) (core/components/ui/captcha/captcha): Captcha: Submit with captcha
|
|
36
|
+
- [Card](https://concorde.supersoniks.org/crawl/core/components/ui/card/card.html) (core/components/ui/card/card): Suffix
|
|
37
|
+
- [Divider](https://concorde.supersoniks.org/crawl/core/components/ui/divider/divider.html) (core/components/ui/divider/divider): Default
|
|
38
|
+
|
|
39
|
+
Align
|
|
40
|
+
|
|
41
|
+
Size
|
|
42
|
+
|
|
43
|
+
Custom
|
|
44
|
+
|
|
45
|
+
Lorem ipsum dolor sit amet +25
|
|
46
|
+
- [Checkbox](https://concorde.supersoniks.org/crawl/core/components/ui/form/checkbox/checkbox.html) (core/components/ui/form/checkbox/checkbox): >Already checked checkbox
|
|
47
|
+
- [Fieldset](https://concorde.supersoniks.org/crawl/core/components/ui/form/fieldset/fieldset.html) (core/components/ui/form/fieldset/fieldset): Default
|
|
48
|
+
- [Form-actions](https://concorde.supersoniks.org/crawl/core/components/ui/form/form-actions/form-actions.html) (core/components/ui/form/form-actions/form-actions): Left seats
|
|
49
|
+
- [Form-layout](https://concorde.supersoniks.org/crawl/core/components/ui/form/form-layout/form-layout.html) (core/components/ui/form/form-layout/form-layout): autocomplete="email"
|
|
50
|
+
- [Input-autocomplete](https://concorde.supersoniks.org/crawl/core/components/ui/form/input-autocomplete/input-autocomplete.html) (core/components/ui/form/input-autocomplete/input-autocomplete): The input-autocomplete component brings input and queue together in order to create a suggest behavior. This is why this component is partially configured as a form input and as a queue.
|
|
51
|
+
- [Input](https://concorde.supersoniks.org/crawl/core/components/ui/form/input/input.html) (core/components/ui/form/input/input): Native attibutes list
|
|
52
|
+
- [Radio](https://concorde.supersoniks.org/crawl/core/components/ui/form/radio/radio.html) (core/components/ui/form/radio/radio): >Already checked radio
|
|
53
|
+
- [Select](https://concorde.supersoniks.org/crawl/core/components/ui/form/select/select.html) (core/components/ui/form/select/select): {"value":"dark", "wording":"dark (set by \"attribute\")", "selected" : "true"}, {"value":"auto", "wording":"auto"}
|
|
54
|
+
- [Switch](https://concorde.supersoniks.org/crawl/core/components/ui/form/switch/switch.html) (core/components/ui/form/switch/switch): >Already checked switch
|
|
55
|
+
- [Textarea](https://concorde.supersoniks.org/crawl/core/components/ui/form/textarea/textarea.html) (core/components/ui/form/textarea/textarea): Native attibutes list
|
|
56
|
+
- [Group](https://concorde.supersoniks.org/crawl/core/components/ui/group/group.html) (core/components/ui/group/group): Group: 😎 Standard ⭐ Premium 💎 Diamond
|
|
57
|
+
- [Icon](https://concorde.supersoniks.org/crawl/core/components/ui/icon/icon.html) (core/components/ui/icon/icon): customIconDefaultPrefix="regular">
|
|
58
|
+
- [Image](https://concorde.supersoniks.org/crawl/core/components/ui/image/image.html) (core/components/ui/image/image): src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
59
|
+
- [Link](https://concorde.supersoniks.org/crawl/core/components/ui/link/link.html) (core/components/ui/link/link): Link: Basic link with href attibute
|
|
60
|
+
- [Loader](https://concorde.supersoniks.org/crawl/core/components/ui/loader/loader.html) (core/components/ui/loader/loader): import {Loader} from "@supersoniks/concorde/core/components/ui/loader/loader";
|
|
61
|
+
- [Menu](https://concorde.supersoniks.org/crawl/core/components/ui/menu/menu.html) (core/components/ui/menu/menu): Row
|
|
62
|
+
- [Concorde](https://concorde.supersoniks.org/crawl/core/components/ui/modal/modal.html) (core/components/ui/modal/modal): Concorde: Simple modal Lorem ipsum dolor sit amet +33 Donec sed vestibulum augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget quam eu mi luctus faucibus. Click don't close Confir
|
|
63
|
+
- [Pop](https://concorde.supersoniks.org/crawl/core/components/ui/pop/pop.html) (core/components/ui/pop/pop): Click to open pop
|
|
64
|
+
- [Progress bar](https://concorde.supersoniks.org/crawl/core/components/ui/progress/progress.html) (core/components/ui/progress/progress): Displays an indicator showing the completion progress of a task.
|
|
65
|
+
- [Table](https://concorde.supersoniks.org/crawl/core/components/ui/table/table.html) (core/components/ui/table/table): Values available : primary, info, success, warning, danger
|
|
66
|
+
- [Toast](https://concorde.supersoniks.org/crawl/core/components/ui/toast/toast.html) (core/components/ui/toast/toast): Afficher un toast
|
|
67
|
+
- [Tooltip](https://concorde.supersoniks.org/crawl/core/components/ui/tooltip/tooltip.html) (core/components/ui/tooltip/tooltip): By default, tooltip is centered next to its content
|
|
68
|
+
- [Data flow](https://concorde.supersoniks.org/crawl/docs/_core-concept/dataFlow.html) (docs/_core-concept/dataFlow): Recommended patterns for new Concorde apps (Lit + TypeScript). Under the hood, data lives in a DataProvider store (legacy Publisher API: Legacy: Sharing data).
|
|
69
|
+
- [lit + tailwind + vite](https://concorde.supersoniks.org/crawl/docs/_core-concept/overview.html) (docs/_core-concept/overview): Some notes for an overview of Concorde's functioning
|
|
70
|
+
- [Legacy: Subscriber mixin](https://concorde.supersoniks.org/crawl/docs/_core-concept/subscriber.html) (docs/_core-concept/subscriber): > 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
|
|
71
|
+
- [@ancestorAttribute](https://concorde.supersoniks.org/crawl/docs/_decorators/ancestor-attribute.html) (docs/_decorators/ancestor-attribute): The @ancestorAttribute decorator automatically injects the value of an ancestor's attribute into a class property at the time of connectedCallback.
|
|
72
|
+
- [@autoSubscribe](https://concorde.supersoniks.org/crawl/docs/_decorators/auto-subscribe.html) (docs/_decorators/auto-subscribe): > Legacy: prefer @subscribe + DataProviderKey. Examples below may still show PublisherManager for existing codebases.
|
|
73
|
+
- [@bind](https://concorde.supersoniks.org/crawl/docs/_decorators/bind.html) (docs/_decorators/bind): Binds a class property to a path in a publisher. The property updates when publisher data changes.
|
|
74
|
+
- [@get](https://concorde.supersoniks.org/crawl/docs/_decorators/get.html) (docs/_decorators/get): Loads data through API.getDetailed. The decorated property is ApiResult<T> | null: request, response (or null for dataProvider(...) resolution without HTTP), and typed result.
|
|
75
|
+
- [@handle](https://concorde.supersoniks.org/crawl/docs/_decorators/handle.html) (docs/_decorators/handle): Typed callback on one or more DataProviderKey<T> paths: invokes the decorated method when a publisher assigns a value (calculations, side effects, updating other @state properties, etc.).
|
|
76
|
+
- [@onAssign](https://concorde.supersoniks.org/crawl/docs/_decorators/on-assign.html) (docs/_decorators/on-assign): > New apps: use @handle with DataProviderKey (Data flow). @onAssign uses untyped string paths; it remains documented for existing codebases — see Migrating to @handle below.
|
|
77
|
+
- [@patch](https://concorde.supersoniks.org/crawl/docs/_decorators/patch.html) (docs/_decorators/patch): Sends data through API.patchDetailed. Same model as @post: decorated property is ApiResult<T> | null (request, response, result).
|
|
78
|
+
- [@post](https://concorde.supersoniks.org/crawl/docs/_decorators/post.html) (docs/_decorators/post): Sends data through API.postDetailed. The decorated property is ApiResult<T> | null: request, response, and typed result.
|
|
79
|
+
- [@publish](https://concorde.supersoniks.org/crawl/docs/_decorators/publish.html) (docs/_decorators/publish): Write-only binding: assigning to the property publishes to the DataProviderKey path. No read subscription (inverse of @subscribe).
|
|
80
|
+
- [@put](https://concorde.supersoniks.org/crawl/docs/_decorators/put.html) (docs/_decorators/put): Sends data through API.putDetailed. Same model as @post: decorated property is ApiResult<T> | null (request, response, result).
|
|
81
|
+
- [@subscribe](https://concorde.supersoniks.org/crawl/docs/_decorators/subscribe.html) (docs/_decorators/subscribe): 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.
|
|
82
|
+
- [@awaitConnectedAncestors and @dispatchConnectedEvent](https://concorde.supersoniks.org/crawl/docs/_decorators/wait-for-ancestors.html) (docs/_decorators/wait-for-ancestors): The @awaitConnectedAncestors and @dispatchConnectedEvent decorators delay a web component's initialization until its matching ancestors have executed their connectedCallback. This is when contextual e
|
|
83
|
+
- [sub()](https://concorde.supersoniks.org/crawl/docs/_directives/sub.html) (docs/_directives/sub): Read-only Lit directive: displays the current DataProvider value and updates whenever it is assigned.
|
|
84
|
+
- [AI agents (skills & AGENTS.md)](https://concorde.supersoniks.org/crawl/docs/_getting-started/ai-agents.html) (docs/_getting-started/ai-agents): 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
|
|
85
|
+
- [Manual installation (Vite)](https://concorde.supersoniks.org/crawl/docs/_getting-started/concorde-manual-install.html) (docs/_getting-started/concorde-manual-install): > Legacy — for brownfield apps or custom stacks. New projects should use the starter.
|
|
86
|
+
- [Installation](https://concorde.supersoniks.org/crawl/docs/_getting-started/concorde-outside.html) (docs/_getting-started/concorde-outside): The following command creates a new Vite project in TypeScript mode with Tailwind and an example component to get started.
|
|
87
|
+
- [Creating components](https://concorde.supersoniks.org/crawl/docs/_getting-started/create-a-component.html) (docs/_getting-started/create-a-component): > New app components: start with My first component and Data flow. The Subscriber mixin below is legacy.
|
|
88
|
+
- [My first component](https://concorde.supersoniks.org/crawl/docs/_getting-started/my-first-component.html) (docs/_getting-started/my-first-component): Build a Lit user card with Tailwind and Concorde UI, then connect it to the DataProvider store: declare the data configuration (type, key, scope), and let @subscribe keep the card in sync.
|
|
89
|
+
- [Legacy: My first subscriber component](https://concorde.supersoniks.org/crawl/docs/_getting-started/my-first-subscriber.html) (docs/_getting-started/my-first-subscriber): > New projects: use My first component (@ancestorAttribute, @subscribe + DataProviderKey, .items on lists) and Data flow. This page documents the Subscriber mixin used by older apps and core component
|
|
90
|
+
- [Legacy: Sharing data](https://concorde.supersoniks.org/crawl/docs/_getting-started/pubsub.html) (docs/_getting-started/pubsub): > New apps: Data flow (get / set / DataProviderKey, decorators). This page documents the historical Publisher proxy API (PublisherManager, publisher.set, onAssign, …).
|
|
91
|
+
- [Introduction](https://concorde.supersoniks.org/crawl/docs/_getting-started/start.html) (docs/_getting-started/start): Based on lit.dev, Concorde is a collection of web components for shared apps and websites.
|
|
92
|
+
- [Adding styles](https://concorde.supersoniks.org/crawl/docs/_getting-started/theming.html) (docs/_getting-started/theming): No style crosses the shadow root of a component, except for inheritable properties (which have the "inherit" property possible) and CSS variables.
|
|
93
|
+
- [API configuration](https://concorde.supersoniks.org/crawl/docs/_misc/api-configuration.html) (docs/_misc/api-configuration): APIConfiguration is the object built by HTML.getApiConfiguration from ancestor attributes on the DOM (or from a typed publisher — see @get / @post configuration key). It is passed to API by fetchers,
|
|
94
|
+
- [DataProviderKey](https://concorde.supersoniks.org/crawl/docs/_misc/dataProviderKey.html) (docs/_misc/dataProviderKey): The DataProviderKey<T> utility provides type-safe navigation through composite data structures. Each property or index access extends the path, and the final key can be retrieved via toString() or the
|
|
95
|
+
- [Local API demos (offline)](https://concorde.supersoniks.org/crawl/docs/_misc/docs-mock-api.html) (docs/_misc/docs-mock-api): The Concorde doc site does not call fragile third-party APIs during yarn dev. A Service Worker and the Vite dev middleware serve /docs-mock-api/* on the same origin.
|
|
96
|
+
- [Dynamic path placeholders](https://concorde.supersoniks.org/crawl/docs/_misc/dynamic-path.html) (docs/_misc/dynamic-path): Decorators and DataProviderKey paths can include placeholders resolved on the host component at runtime:
|
|
97
|
+
- [Endpoint](https://concorde.supersoniks.org/crawl/docs/_misc/endpoint.html) (docs/_misc/endpoint): Endpoint<T, U> describes a single HTTP path (or a path accepted by API.get) and carries the expected response type T. Unlike DataProviderKey, there is no dot-navigation: the path is one string.
|
|
98
|
+
- [HTML integration (no Lit)](https://concorde.supersoniks.org/crawl/docs/_misc/html-integration.html) (docs/_misc/html-integration): Some hosts (legacy PHP pages, static HTML) embed Concorde components without a Lit build step. They can use HTML attributes such as data-bind, dataProvider, and formDataProvider on tags directly in th
|
|
99
|
+
|
|
100
|
+
## Optional
|
|
101
|
+
|
|
102
|
+
- [Full index](https://concorde.supersoniks.org/crawl/index.html)
|
package/docs/robots.txt
CHANGED
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
# Block major search engines (SPA uses noindex as well).
|
|
2
|
+
User-agent: Googlebot
|
|
3
|
+
Disallow: /
|
|
4
|
+
|
|
5
|
+
User-agent: Bingbot
|
|
2
6
|
Disallow: /
|
|
7
|
+
|
|
8
|
+
# Crawlers: index /crawl/*.html only; /src/docs/*.md is for the interactive SPA runtime.
|
|
9
|
+
User-agent: *
|
|
10
|
+
Allow: /crawl/
|
|
11
|
+
Allow: /sitemap.xml
|
|
12
|
+
Allow: /llms.txt
|
|
13
|
+
Allow: /llms-full.txt
|
|
14
|
+
Disallow: /src/docs/
|
|
15
|
+
|
|
16
|
+
Sitemap: https://concorde.supersoniks.org/sitemap.xml
|
package/docs/sitemap.xml
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
3
|
+
<url>
|
|
4
|
+
<loc>https://concorde.supersoniks.org/crawl/index.html</loc>
|
|
5
|
+
</url>
|
|
6
|
+
<url>
|
|
7
|
+
<loc>https://concorde.supersoniks.org/crawl/hubs/decorators.html</loc>
|
|
8
|
+
</url>
|
|
9
|
+
<url>
|
|
10
|
+
<loc>https://concorde.supersoniks.org/crawl/hubs/remote-data.html</loc>
|
|
11
|
+
</url>
|
|
12
|
+
<url>
|
|
13
|
+
<loc>https://concorde.supersoniks.org/crawl/hubs/form-components.html</loc>
|
|
14
|
+
</url>
|
|
15
|
+
<url>
|
|
16
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/functional/date/date.html</loc>
|
|
17
|
+
</url>
|
|
18
|
+
<url>
|
|
19
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/functional/fetch/fetch.html</loc>
|
|
20
|
+
</url>
|
|
21
|
+
<url>
|
|
22
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/functional/if/if.html</loc>
|
|
23
|
+
</url>
|
|
24
|
+
<url>
|
|
25
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/functional/list/list.html</loc>
|
|
26
|
+
</url>
|
|
27
|
+
<url>
|
|
28
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/functional/mix/mix.html</loc>
|
|
29
|
+
</url>
|
|
30
|
+
<url>
|
|
31
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/functional/queue/queue.html</loc>
|
|
32
|
+
</url>
|
|
33
|
+
<url>
|
|
34
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/functional/router/router.html</loc>
|
|
35
|
+
</url>
|
|
36
|
+
<url>
|
|
37
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/functional/sdui/sdui.html</loc>
|
|
38
|
+
</url>
|
|
39
|
+
<url>
|
|
40
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/functional/states/states.html</loc>
|
|
41
|
+
</url>
|
|
42
|
+
<url>
|
|
43
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/functional/submit/submit.html</loc>
|
|
44
|
+
</url>
|
|
45
|
+
<url>
|
|
46
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/functional/subscriber/subscriber.html</loc>
|
|
47
|
+
</url>
|
|
48
|
+
<url>
|
|
49
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/functional/value/value.html</loc>
|
|
50
|
+
</url>
|
|
51
|
+
<url>
|
|
52
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/alert-messages/alert-messages.html</loc>
|
|
53
|
+
</url>
|
|
54
|
+
<url>
|
|
55
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/alert/alert.html</loc>
|
|
56
|
+
</url>
|
|
57
|
+
<url>
|
|
58
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/badge/badge.html</loc>
|
|
59
|
+
</url>
|
|
60
|
+
<url>
|
|
61
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/button/button.html</loc>
|
|
62
|
+
</url>
|
|
63
|
+
<url>
|
|
64
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/captcha/captcha.html</loc>
|
|
65
|
+
</url>
|
|
66
|
+
<url>
|
|
67
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/card/card.html</loc>
|
|
68
|
+
</url>
|
|
69
|
+
<url>
|
|
70
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/divider/divider.html</loc>
|
|
71
|
+
</url>
|
|
72
|
+
<url>
|
|
73
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/form/checkbox/checkbox.html</loc>
|
|
74
|
+
</url>
|
|
75
|
+
<url>
|
|
76
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/form/fieldset/fieldset.html</loc>
|
|
77
|
+
</url>
|
|
78
|
+
<url>
|
|
79
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/form/form-actions/form-actions.html</loc>
|
|
80
|
+
</url>
|
|
81
|
+
<url>
|
|
82
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/form/form-layout/form-layout.html</loc>
|
|
83
|
+
</url>
|
|
84
|
+
<url>
|
|
85
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/form/input-autocomplete/input-autocomplete.html</loc>
|
|
86
|
+
</url>
|
|
87
|
+
<url>
|
|
88
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/form/input/input.html</loc>
|
|
89
|
+
</url>
|
|
90
|
+
<url>
|
|
91
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/form/radio/radio.html</loc>
|
|
92
|
+
</url>
|
|
93
|
+
<url>
|
|
94
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/form/select/select.html</loc>
|
|
95
|
+
</url>
|
|
96
|
+
<url>
|
|
97
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/form/switch/switch.html</loc>
|
|
98
|
+
</url>
|
|
99
|
+
<url>
|
|
100
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/form/textarea/textarea.html</loc>
|
|
101
|
+
</url>
|
|
102
|
+
<url>
|
|
103
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/group/group.html</loc>
|
|
104
|
+
</url>
|
|
105
|
+
<url>
|
|
106
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/icon/icon.html</loc>
|
|
107
|
+
</url>
|
|
108
|
+
<url>
|
|
109
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/image/image.html</loc>
|
|
110
|
+
</url>
|
|
111
|
+
<url>
|
|
112
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/link/link.html</loc>
|
|
113
|
+
</url>
|
|
114
|
+
<url>
|
|
115
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/loader/loader.html</loc>
|
|
116
|
+
</url>
|
|
117
|
+
<url>
|
|
118
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/menu/menu.html</loc>
|
|
119
|
+
</url>
|
|
120
|
+
<url>
|
|
121
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/modal/modal.html</loc>
|
|
122
|
+
</url>
|
|
123
|
+
<url>
|
|
124
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/pop/pop.html</loc>
|
|
125
|
+
</url>
|
|
126
|
+
<url>
|
|
127
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/progress/progress.html</loc>
|
|
128
|
+
</url>
|
|
129
|
+
<url>
|
|
130
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/table/table.html</loc>
|
|
131
|
+
</url>
|
|
132
|
+
<url>
|
|
133
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/toast/toast.html</loc>
|
|
134
|
+
</url>
|
|
135
|
+
<url>
|
|
136
|
+
<loc>https://concorde.supersoniks.org/crawl/core/components/ui/tooltip/tooltip.html</loc>
|
|
137
|
+
</url>
|
|
138
|
+
<url>
|
|
139
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_core-concept/dataFlow.html</loc>
|
|
140
|
+
</url>
|
|
141
|
+
<url>
|
|
142
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_core-concept/overview.html</loc>
|
|
143
|
+
</url>
|
|
144
|
+
<url>
|
|
145
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_core-concept/subscriber.html</loc>
|
|
146
|
+
</url>
|
|
147
|
+
<url>
|
|
148
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_decorators/ancestor-attribute.html</loc>
|
|
149
|
+
</url>
|
|
150
|
+
<url>
|
|
151
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_decorators/auto-subscribe.html</loc>
|
|
152
|
+
</url>
|
|
153
|
+
<url>
|
|
154
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_decorators/bind.html</loc>
|
|
155
|
+
</url>
|
|
156
|
+
<url>
|
|
157
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_decorators/get.html</loc>
|
|
158
|
+
</url>
|
|
159
|
+
<url>
|
|
160
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_decorators/handle.html</loc>
|
|
161
|
+
</url>
|
|
162
|
+
<url>
|
|
163
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_decorators/on-assign.html</loc>
|
|
164
|
+
</url>
|
|
165
|
+
<url>
|
|
166
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_decorators/patch.html</loc>
|
|
167
|
+
</url>
|
|
168
|
+
<url>
|
|
169
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_decorators/post.html</loc>
|
|
170
|
+
</url>
|
|
171
|
+
<url>
|
|
172
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_decorators/publish.html</loc>
|
|
173
|
+
</url>
|
|
174
|
+
<url>
|
|
175
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_decorators/put.html</loc>
|
|
176
|
+
</url>
|
|
177
|
+
<url>
|
|
178
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_decorators/subscribe.html</loc>
|
|
179
|
+
</url>
|
|
180
|
+
<url>
|
|
181
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_decorators/wait-for-ancestors.html</loc>
|
|
182
|
+
</url>
|
|
183
|
+
<url>
|
|
184
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_directives/sub.html</loc>
|
|
185
|
+
</url>
|
|
186
|
+
<url>
|
|
187
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_getting-started/ai-agents.html</loc>
|
|
188
|
+
</url>
|
|
189
|
+
<url>
|
|
190
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_getting-started/concorde-manual-install.html</loc>
|
|
191
|
+
</url>
|
|
192
|
+
<url>
|
|
193
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_getting-started/concorde-outside.html</loc>
|
|
194
|
+
</url>
|
|
195
|
+
<url>
|
|
196
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_getting-started/create-a-component.html</loc>
|
|
197
|
+
</url>
|
|
198
|
+
<url>
|
|
199
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_getting-started/my-first-component.html</loc>
|
|
200
|
+
</url>
|
|
201
|
+
<url>
|
|
202
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_getting-started/my-first-subscriber.html</loc>
|
|
203
|
+
</url>
|
|
204
|
+
<url>
|
|
205
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_getting-started/pubsub.html</loc>
|
|
206
|
+
</url>
|
|
207
|
+
<url>
|
|
208
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_getting-started/start.html</loc>
|
|
209
|
+
</url>
|
|
210
|
+
<url>
|
|
211
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_getting-started/theming.html</loc>
|
|
212
|
+
</url>
|
|
213
|
+
<url>
|
|
214
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_misc/api-configuration.html</loc>
|
|
215
|
+
</url>
|
|
216
|
+
<url>
|
|
217
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_misc/dataProviderKey.html</loc>
|
|
218
|
+
</url>
|
|
219
|
+
<url>
|
|
220
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_misc/docs-mock-api.html</loc>
|
|
221
|
+
</url>
|
|
222
|
+
<url>
|
|
223
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_misc/dynamic-path.html</loc>
|
|
224
|
+
</url>
|
|
225
|
+
<url>
|
|
226
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_misc/endpoint.html</loc>
|
|
227
|
+
</url>
|
|
228
|
+
<url>
|
|
229
|
+
<loc>https://concorde.supersoniks.org/crawl/docs/_misc/html-integration.html</loc>
|
|
230
|
+
</url>
|
|
231
|
+
</urlset>
|
|
@@ -18,7 +18,7 @@ import { ancestorAttribute } from "@supersoniks/concorde/decorators";
|
|
|
18
18
|
|
|
19
19
|
### Basic example
|
|
20
20
|
|
|
21
|
-
The component reads `dataProvider` and `testAttribute` from its ancestor wrapper.
|
|
21
|
+
The component reads `dataProvider` and `testAttribute` from its ancestor wrapper. By default (`dynamic: false`), values are read once at connect.
|
|
22
22
|
|
|
23
23
|
<sonic-code language="typescript">
|
|
24
24
|
<template>
|
|
@@ -36,10 +36,8 @@ export class DemoAncestorAttribute extends LitElement {
|
|
|
36
36
|
|
|
37
37
|
render() {
|
|
38
38
|
return html`
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
<p>testAttribute: <strong>${this.testAttribute || "null"}</strong></p>
|
|
42
|
-
</section>
|
|
39
|
+
<p>dataProvider: <strong>${this.dataProvider ?? "null"}</strong></p>
|
|
40
|
+
<p>testAttribute: <strong>${this.testAttribute ?? "null"}</strong></p>
|
|
43
41
|
`;
|
|
44
42
|
}
|
|
45
43
|
}
|
|
@@ -55,7 +53,6 @@ export class DemoAncestorAttribute extends LitElement {
|
|
|
55
53
|
</template>
|
|
56
54
|
</sonic-code>
|
|
57
55
|
|
|
58
|
-
|
|
59
56
|
## Use cases
|
|
60
57
|
|
|
61
58
|
This decorator is particularly useful for:
|
|
@@ -68,9 +65,60 @@ This decorator is particularly useful for:
|
|
|
68
65
|
## Behavior
|
|
69
66
|
|
|
70
67
|
- The search starts from the current element and traverses up the DOM tree
|
|
71
|
-
- If the attribute is not found, the property will be assigned `null`
|
|
72
68
|
- The injection happens automatically at the time of `connectedCallback`
|
|
73
|
-
-
|
|
69
|
+
- By default (`dynamic: false`), the value is read once at connect time and is not updated afterward
|
|
70
|
+
- With `{ dynamic: true }`, the property stays in sync when:
|
|
71
|
+
- an ancestor **changes** the attribute value
|
|
72
|
+
- a **closer** ancestor **gains** the attribute (that value wins)
|
|
73
|
+
- the **nearest** ancestor **loses** the attribute (falls back to the next one up, or `null`)
|
|
74
|
+
- When `dynamic` is enabled, updates also propagate to `@subscribe` / `@bind` paths that depend on the decorated property (e.g. `${dataProvider}`)
|
|
75
|
+
|
|
76
|
+
### Dynamic mode
|
|
77
|
+
|
|
78
|
+
Use `{ dynamic: true }` when the decorated property must follow the DOM. With Lit, add **`@state()`** on the same property so template updates are visible when the observer assigns a new value.
|
|
79
|
+
|
|
80
|
+
The live demo below shows only the resolved attribute value — no store, no reparenting.
|
|
81
|
+
|
|
82
|
+
<sonic-code language="typescript">
|
|
83
|
+
<template>
|
|
84
|
+
@customElement("demo-ancestor-attribute-dynamic")
|
|
85
|
+
export class DemoAncestorAttributeDynamic extends LitElement {
|
|
86
|
+
@ancestorAttribute("dataProvider", { dynamic: true })
|
|
87
|
+
@state()
|
|
88
|
+
dataProvider: string | null = null;
|
|
89
|
+
|
|
90
|
+
render() {
|
|
91
|
+
return html`
|
|
92
|
+
<p>Nearest ancestor: <strong>${this.dataProvider ?? "null"}</strong></p>
|
|
93
|
+
`;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
</template>
|
|
97
|
+
</sonic-code>
|
|
98
|
+
|
|
99
|
+
Try in the demo:
|
|
100
|
+
|
|
101
|
+
- **parent-a** / **parent-b** — change the value on the direct parent
|
|
102
|
+
- **Remove parent attr** — falls back to **outer**
|
|
103
|
+
- **Add closer** — a wrapper with `from-closer` becomes the nearest ancestor
|
|
104
|
+
- **Remove closer** — back to parent or outer
|
|
105
|
+
- **Remove outer attr** — if parent has no attribute either, the child shows `null`
|
|
106
|
+
|
|
107
|
+
<sonic-code>
|
|
108
|
+
<template>
|
|
109
|
+
<docs-demo-sources for="demo-ancestor-attribute-dynamic-section"></docs-demo-sources>
|
|
110
|
+
<demo-ancestor-attribute-dynamic-section></demo-ancestor-attribute-dynamic-section>
|
|
111
|
+
</template>
|
|
112
|
+
</sonic-code>
|
|
113
|
+
|
|
114
|
+
Static mode (default) — read once at connect, no observer:
|
|
115
|
+
|
|
116
|
+
<sonic-code language="typescript">
|
|
117
|
+
<template>
|
|
118
|
+
@ancestorAttribute("dataProvider")
|
|
119
|
+
dataProvider: string | null = null;
|
|
120
|
+
</template>
|
|
121
|
+
</sonic-code>
|
|
74
122
|
|
|
75
123
|
## Notes
|
|
76
124
|
|
|
@@ -13,10 +13,53 @@ Pass an [`Endpoint<T>`](#docs/_misc/endpoint.md/endpoint) as the first argument.
|
|
|
13
13
|
|
|
14
14
|
`${prop}` on the endpoint or config key is resolved on the host. While a placeholder is `null` or `undefined`, no GET runs. Optional `skipEmptyPlaceholder: true` also blocks `""` (empty string only). Details: [Dynamic path placeholders](#docs/_misc/dynamic-path.md/dynamic-path).
|
|
15
15
|
|
|
16
|
+
## Options (`GetOptions`)
|
|
17
|
+
|
|
18
|
+
Pass as the **second** argument (scoped config) or **third** (with a configuration key). Same shape as send decorators where applicable:
|
|
19
|
+
|
|
20
|
+
| Option | Description |
|
|
21
|
+
|--------|-------------|
|
|
22
|
+
| `skipEmptyPlaceholder` | Treat `""` as not ready (see [Dynamic path](#docs/_misc/dynamic-path.md/dynamic-path)). |
|
|
23
|
+
| `refetchEveryMs` | Automatic polling interval (ms). `0` or omitted = no polling. |
|
|
24
|
+
| `triggerKey` | `DataProviderKey` — `PublisherManager.get(...).invalidate()` on that publisher re-runs the GET. |
|
|
25
|
+
|
|
26
|
+
### Manual refetch (`triggerKey`)
|
|
27
|
+
|
|
28
|
+
Same pattern as [@post](#docs/_decorators/post.md/post): a publisher acts as a **signal**, independent of the response payload.
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { get, type ApiResult } from "@supersoniks/concorde/decorators";
|
|
32
|
+
import { Endpoint } from "@supersoniks/concorde/utils/endpoint";
|
|
33
|
+
import { DataProviderKey } from "@supersoniks/concorde/dataProviderKey";
|
|
34
|
+
import { dp } from "@supersoniks/concorde/core/utils/PublisherProxy";
|
|
35
|
+
|
|
36
|
+
const geoCommunesEndpoint = new Endpoint<GeoCommuneRow[]>(
|
|
37
|
+
"communes?limit=5&fields=nom,code",
|
|
38
|
+
);
|
|
39
|
+
const geoCommunesRefreshKey = new DataProviderKey<void>(
|
|
40
|
+
"docsDemoGeoCommunesRefresh",
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
@get(geoCommunesEndpoint, apiConfigurationKey, {
|
|
44
|
+
triggerKey: geoCommunesRefreshKey,
|
|
45
|
+
})
|
|
46
|
+
@state()
|
|
47
|
+
payload: ApiResult<GeoCommuneRow[]> | null = null;
|
|
48
|
+
|
|
49
|
+
// Same component or anywhere else:
|
|
50
|
+
dp(geoCommunesRefreshKey).invalidate();
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Prefer `triggerKey` over mutating the API configuration publisher when you only want to **reload the same URL** — no need to touch `serviceURL`, tokens, etc.
|
|
54
|
+
|
|
55
|
+
The docs mock adds an **`X-Fetched-At`** response header on `/docs-mock-api/geo/communes` so live demos can show when the last fetch happened (`response.headers.get("X-Fetched-At")`).
|
|
56
|
+
|
|
16
57
|
## When the GET runs again
|
|
17
58
|
|
|
18
59
|
- A referenced Lit property changes (endpoint path and/or config key contains `${...}`).
|
|
19
60
|
- `set` on the active configuration publisher (`onInternalMutation`).
|
|
61
|
+
- `triggerKey` publisher `invalidate()`.
|
|
62
|
+
- `refetchEveryMs` polling (after each successful fetch).
|
|
20
63
|
|
|
21
64
|
## Import
|
|
22
65
|
|
|
@@ -42,6 +85,8 @@ payload: ApiResult<User> | null = null;
|
|
|
42
85
|
|
|
43
86
|
## Live demos
|
|
44
87
|
|
|
88
|
+
`@get` with **`triggerKey`** — refresh button + `X-Fetched-At` timestamp in the UI:
|
|
89
|
+
|
|
45
90
|
<sonic-code>
|
|
46
91
|
<template>
|
|
47
92
|
<docs-demo-sources for="demo-api-get"></docs-demo-sources>
|
|
@@ -49,12 +94,13 @@ payload: ApiResult<User> | null = null;
|
|
|
49
94
|
</template>
|
|
50
95
|
</sonic-code>
|
|
51
96
|
|
|
52
|
-
Dynamic config and endpoint path (`
|
|
97
|
+
Dynamic config and endpoint path. Manual refetch is triggered **from a separate component** (same `triggerKey` publisher):
|
|
53
98
|
|
|
54
99
|
<sonic-code>
|
|
55
100
|
<template>
|
|
56
101
|
<docs-demo-sources for="demo-api-get-configuration-key"></docs-demo-sources>
|
|
57
102
|
<demo-api-get-configuration-key></demo-api-get-configuration-key>
|
|
103
|
+
<demo-api-get-refresh-remote></demo-api-get-refresh-remote>
|
|
58
104
|
</template>
|
|
59
105
|
</sonic-code>
|
|
60
106
|
|