uniweb 0.9.6 → 0.10.0
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/package.json +6 -6
- package/partials/agents.md +32 -0
- package/src/framework-index.json +21 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uniweb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Create structured Vite + React sites with content/code separation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"js-yaml": "^4.1.0",
|
|
42
42
|
"prompts": "^2.4.2",
|
|
43
43
|
"tar": "^7.0.0",
|
|
44
|
-
"@uniweb/
|
|
45
|
-
"@uniweb/
|
|
46
|
-
"@uniweb/
|
|
44
|
+
"@uniweb/core": "0.7.0",
|
|
45
|
+
"@uniweb/kit": "0.9.0",
|
|
46
|
+
"@uniweb/runtime": "0.8.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@uniweb/build": "0.9.4",
|
|
50
49
|
"@uniweb/content-reader": "1.1.4",
|
|
51
|
-
"@uniweb/semantic-parser": "1.1.9"
|
|
50
|
+
"@uniweb/semantic-parser": "1.1.9",
|
|
51
|
+
"@uniweb/build": "0.10.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependenciesMeta": {
|
|
54
54
|
"@uniweb/build": {
|
package/partials/agents.md
CHANGED
|
@@ -865,6 +865,38 @@ function MyComponent({ content, params, block }) {
|
|
|
865
865
|
|
|
866
866
|
All non-reserved frontmatter fields become `params`. Reserved: `type`, `preset`, `input`, `data`, `id`, `background`, `theme`, `source`, `where`. Everything else flows to the component.
|
|
867
867
|
|
|
868
|
+
### Data
|
|
869
|
+
|
|
870
|
+
A component on a page with a `data:` or `fetch:` declaration automatically receives that data in `content.data.{schema}`. No opt-in required in `meta.js`. On a template page (`[slug]/`), the matched item is also delivered as `content.data.{singular}` (e.g. `content.data.article` when the parent declares `data: articles`).
|
|
871
|
+
|
|
872
|
+
```jsx
|
|
873
|
+
function Article({ content, block }) {
|
|
874
|
+
if (block.dataLoading) return <DataPlaceholder />
|
|
875
|
+
const article = content.data.article
|
|
876
|
+
if (!article) return <NotFound />
|
|
877
|
+
return <ArticleView article={article} />
|
|
878
|
+
}
|
|
879
|
+
```
|
|
880
|
+
|
|
881
|
+
Components can ignore keys in `content.data` they don't need — the same way unused `params` are ignored. For declarative shape hints consumed by the editor and `prepare-props`, add `data: { entity: 'articles' }` to `meta.js`. For an explicit opt-out (rare), set `data: false`.
|
|
882
|
+
|
|
883
|
+
**Authoring queries.** Fetch declarations (`fetch:` or the `data:` shorthand) accept query operators that describe which records you want, in what order, how many: `where:` (a where-object predicate), `sort:` (e.g. `date desc`), `limit:` (first N records). Whether the source evaluates them or the framework applies them as a runtime fallback is a transport detail controlled by the site's `fetcher.supports:` declaration.
|
|
884
|
+
|
|
885
|
+
```yaml
|
|
886
|
+
# pages/blog/page.yml
|
|
887
|
+
fetch:
|
|
888
|
+
collection: articles
|
|
889
|
+
where: { published: true, tags: featured }
|
|
890
|
+
sort: date desc
|
|
891
|
+
limit: 3
|
|
892
|
+
```
|
|
893
|
+
|
|
894
|
+
**Lean lists with `deferred:`.** Collections with heavy fields (article bodies, large nested arrays) can declare `deferred: [body]` in `site.yml`. The cascade payload omits those fields; per-record full files are emitted at `/data/<name>/<slug>.json`. On dynamic-route pages the focused entity's full record is delivered automatically; elsewhere components fetch on demand via the `useEntityDetail` kit hook.
|
|
895
|
+
|
|
896
|
+
**Component-side fetching.** When a component genuinely needs to fetch something on its own (a search box, a "load more" button, a popover that lazy-loads), use the kit hooks (`useFetched`, `useCacheEntry`, `useEntityDetail`). They share the framework's cache and dispatcher with declarative fetches; same-key requests dedupe automatically.
|
|
897
|
+
|
|
898
|
+
See [Data Fetching](https://github.com/uniweb/docs/blob/main/reference/data-fetching.md) for the full model and [Predicates](https://github.com/uniweb/docs/blob/main/authoring/predicates.md) for the where-object format with examples.
|
|
899
|
+
|
|
868
900
|
### block properties
|
|
869
901
|
|
|
870
902
|
| Property | Type | Description |
|
package/src/framework-index.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-04-
|
|
3
|
+
"generatedAt": "2026-04-19T01:29:37.432Z",
|
|
4
4
|
"packages": {
|
|
5
5
|
"@uniweb/build": {
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.10.0",
|
|
7
7
|
"path": "framework/build",
|
|
8
8
|
"deps": [
|
|
9
9
|
"@uniweb/content-reader",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"deps": []
|
|
25
25
|
},
|
|
26
26
|
"@uniweb/core": {
|
|
27
|
-
"version": "0.
|
|
27
|
+
"version": "0.7.0",
|
|
28
28
|
"path": "framework/core",
|
|
29
29
|
"deps": [
|
|
30
30
|
"@uniweb/semantic-parser",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"deps": []
|
|
43
43
|
},
|
|
44
44
|
"@uniweb/kit": {
|
|
45
|
-
"version": "0.
|
|
45
|
+
"version": "0.9.0",
|
|
46
46
|
"path": "framework/kit",
|
|
47
47
|
"deps": [
|
|
48
48
|
"@uniweb/core"
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"deps": []
|
|
55
55
|
},
|
|
56
56
|
"@uniweb/press": {
|
|
57
|
-
"version": "0.2.
|
|
57
|
+
"version": "0.2.8",
|
|
58
58
|
"path": "framework/press",
|
|
59
59
|
"deps": []
|
|
60
60
|
},
|
|
61
61
|
"@uniweb/runtime": {
|
|
62
|
-
"version": "0.
|
|
62
|
+
"version": "0.8.0",
|
|
63
63
|
"path": "framework/runtime",
|
|
64
64
|
"deps": [
|
|
65
65
|
"@uniweb/core",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"deps": []
|
|
83
83
|
},
|
|
84
84
|
"@uniweb/templates": {
|
|
85
|
-
"version": "0.7.
|
|
85
|
+
"version": "0.7.31",
|
|
86
86
|
"path": "framework/templates",
|
|
87
87
|
"deps": []
|
|
88
88
|
},
|
|
@@ -199,6 +199,20 @@
|
|
|
199
199
|
"tables",
|
|
200
200
|
"bibliography"
|
|
201
201
|
]
|
|
202
|
+
},
|
|
203
|
+
"academic-metrics": {
|
|
204
|
+
"name": "Academic Metrics (xlsx showcase)",
|
|
205
|
+
"description": "A docusite whose content is also a downloadable Excel workbook. Aggregates academic metrics (publications, funding, supervisions) across multiple members of a university unit. Rich web previews + flat tabular xlsx sheets from the same data. Ships with three 19th-century naturalists as sample members.",
|
|
206
|
+
"tags": [
|
|
207
|
+
"academic-metrics",
|
|
208
|
+
"docusite",
|
|
209
|
+
"press",
|
|
210
|
+
"xlsx",
|
|
211
|
+
"report",
|
|
212
|
+
"members",
|
|
213
|
+
"aggregate",
|
|
214
|
+
"academic"
|
|
215
|
+
]
|
|
202
216
|
}
|
|
203
217
|
}
|
|
204
218
|
}
|