uniweb 1.5.0 → 1.6.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniweb",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Create structured Vite + React sites with content/code separation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,15 +41,15 @@
41
41
  "js-yaml": "^4.1.0",
42
42
  "prompts": "^2.4.2",
43
43
  "tar": "^7.0.0",
44
- "@uniweb/content-writer": "~1.1.1",
45
- "@uniweb/core": "~1.2.1",
46
- "@uniweb/schemas": "~1.2.1",
47
- "@uniweb/semantic-parser": "~1.7.0"
44
+ "@uniweb/content-writer": "~1.1.2",
45
+ "@uniweb/semantic-parser": "~1.8.0",
46
+ "@uniweb/schemas": "~1.3.0",
47
+ "@uniweb/core": "~1.2.2"
48
48
  },
49
49
  "peerDependencies": {
50
- "@uniweb/build": "~1.3.1",
51
- "@uniweb/semantic-parser": "~1.7.0",
52
- "@uniweb/content-reader": "~1.3.1"
50
+ "@uniweb/content-reader": "~1.3.2",
51
+ "@uniweb/semantic-parser": "~1.8.0",
52
+ "@uniweb/build": "~1.3.3"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "@uniweb/build": {
@@ -2515,11 +2515,16 @@ component that never needed one.
2515
2515
  ### Reading
2516
2516
 
2517
2517
  ```jsx
2518
- const { status, records } = useRecords({ schema: '@/track' }) // summaries: record.brief, no items
2519
- const { entity } = useEntity({ schema: '@/track', uuid: record.uuid })
2518
+ const { status, records } = useRecords({ schema: '@acme/track' }) // summaries: record.brief, no items
2519
+ const { entity } = useEntity({ schema: '@acme/track', uuid: record.uuid })
2520
2520
  const sessions = entity?.hydrated?.items.filter((item) => item.section === 'sessions')
2521
2521
  ```
2522
2522
 
2523
+ ⛔ **Name a type by its full name, `@scope/name`** — the scope your foundation registered
2524
+ under (`@acme/track`). `@/track` is right in `meta.js` and `queries.yml`, where the build and
2525
+ `push` qualify it for you, but a `schema` you hand `@uniweb/api` goes to the backend as written,
2526
+ and the backend matches the exact name: `@/track` is a `404`.
2527
+
2523
2528
  ⛔ **What a member wrote is text.** Render a field as `{record.brief.name}` or `<PlainText text={…} />` — never `<P text>`, `<H1>`–`<H6>` or `SafeHtml`, which render HTML: a member who typed `<img src=x onerror=…>` would run it as whoever views the page. A rich-text field (a ProseMirror document) renders through kit's `Render`, which escapes its text.
2524
2529
 
2525
2530
  ⛔ **A listed record is a summary, not the entity.** `record.brief` holds the brief
@@ -2538,7 +2543,7 @@ for the first tells a visitor their content is gone when it was never requested.
2538
2543
  ### Writing
2539
2544
 
2540
2545
  ```jsx
2541
- const writer = useEntityWriter({ schema: '@/track', uuid: track.uuid })
2546
+ const writer = useEntityWriter({ schema: '@acme/track', uuid: track.uuid })
2542
2547
 
2543
2548
  await writer.create({ title: 'Keynote' }, { section: 'sessions', position: 'last' })
2544
2549
  await writer.update(itemId, { ...item.data, room: 'Hall A' }) // whole-data replace
@@ -2677,6 +2682,43 @@ sent to an account comes with no link to follow. `unit_name` may be `null`.
2677
2682
  waits — answered in another tab, or withdrawn — is refused with `kind: 'rule'` and
2678
2683
  leaves the list; its `detail` is for people, so branch on `kind`.
2679
2684
 
2685
+ ### Access to an entry
2686
+
2687
+ Whoever administers an entry — its owner, someone given `admin` on it, or a role that
2688
+ reaches it while the session is elevated — gives other people `read`, `edit` or `admin` on
2689
+ it, and takes it back. An instructor enrolling students in a course is this; name it as
2690
+ your solution does ("enrolled", "course staff"):
2691
+
2692
+ ```jsx
2693
+ const { status, grants, grant, revoke, working } = useAccess({ schema: '@/course', uuid: course.uuid })
2694
+ // status 'ready' for whoever administers it; 'forbidden' for everyone else — draw nothing
2695
+ // grants: [{ account_id, permission, account: { handle, uuid, … }, … }]
2696
+ await grant({ handle: 'sam' }, 'read') // or an account id: a candidate, a grant's account, an owner_id
2697
+ await grant([12, 15, 21], 'read') // many by account id, each on its own: { results }
2698
+ await revoke(grants[0])
2699
+ ```
2700
+
2701
+ - ⛔ **Not a grant per entry from your code** — giving access is a person's decision, made
2702
+ through your UI. For "the course's staff read every submission", declare it on the schema
2703
+ (`readable_with`, above) instead of granting each submission as it is created.
2704
+ - Giving again replaces: `read` after `edit` lowers it. On a site's backend an entry is
2705
+ given only to the site's members, so an address with no account is refused.
2706
+ - An entry given to the viewer lists for them with `via: 'grant'`; they can give it up with
2707
+ `leaveAccess({ schema, uuid })`.
2708
+
2709
+ ### Where a create lands
2710
+
2711
+ Everything a member creates lands at the root of the organization the site's backend is
2712
+ founded with — unless the create names one of its units, a department or a course, that the
2713
+ viewer is placed in:
2714
+
2715
+ ```jsx
2716
+ const { units } = useUnits() // [{ unit, id, handle?, name?, parent?, depth, primary }]
2717
+ await createEntity({ schema: '@/submission', unit: course.unit, items: [...] })
2718
+ ```
2719
+
2720
+ Landing decides where an entry is, not who may open it.
2721
+
2680
2722
  ### A backend on your machine
2681
2723
 
2682
2724
  You do not need a live backend to build against one. In `site.yml`:
@@ -2701,8 +2743,9 @@ may edit an entry and `append_only`, so a permission you are relying on fails on
2701
2743
  machine rather than in front of a user. The mail it would send is printed in the dev
2702
2744
  server's terminal, its link on your site's root — follow it to try your page. Seed
2703
2745
  `offers: [{ email, invitations: 1 }]` to try an invitation: mailed to an address no
2704
- account holds, or waiting at once for the seeded account whose address it is. State is
2705
- in memory; restart to reset.
2746
+ account holds, or waiting at once for the seeded account whose address it is. A seeded
2747
+ entity takes `grants: { member: 'read' }`, and `units: [{ handle, parent?, members, floor? }]`
2748
+ gives a create somewhere to land. State is in memory; restart to reset.
2706
2749
 
2707
2750
  `uniweb create my-event --template conference` is a worked example of all of this.
2708
2751
 
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-10-15T14:10:08.789Z",
3
+ "generatedAt": "2026-10-15T21:06:42.969Z",
4
4
  "packages": {
5
5
  "@uniweb/api": {
6
- "version": "1.2.3"
6
+ "version": "1.2.5"
7
7
  },
8
8
  "@uniweb/build": {
9
- "version": "1.3.1"
9
+ "version": "1.3.3"
10
10
  },
11
11
  "@uniweb/content-reader": {
12
- "version": "1.3.1"
12
+ "version": "1.3.2"
13
13
  },
14
14
  "@uniweb/content-writer": {
15
- "version": "1.1.1"
15
+ "version": "1.1.2"
16
16
  },
17
17
  "@uniweb/core": {
18
- "version": "1.2.1"
18
+ "version": "1.2.2"
19
19
  },
20
20
  "@uniweb/frame-bridge": {
21
21
  "version": "1.0.2"
@@ -24,7 +24,7 @@
24
24
  "version": "1.0.3"
25
25
  },
26
26
  "@uniweb/kit": {
27
- "version": "1.2.2"
27
+ "version": "1.2.4"
28
28
  },
29
29
  "@uniweb/loom": {
30
30
  "version": "1.1.0"
@@ -36,19 +36,19 @@
36
36
  "version": "1.1.1"
37
37
  },
38
38
  "@uniweb/runtime": {
39
- "version": "1.1.2"
39
+ "version": "1.1.3"
40
40
  },
41
41
  "@uniweb/scene": {
42
42
  "version": "1.0.1"
43
43
  },
44
44
  "@uniweb/schemas": {
45
- "version": "1.2.1"
45
+ "version": "1.3.0"
46
46
  },
47
47
  "@uniweb/scholar": {
48
48
  "version": "1.1.0"
49
49
  },
50
50
  "@uniweb/semantic-parser": {
51
- "version": "1.7.0"
51
+ "version": "1.8.0"
52
52
  },
53
53
  "@uniweb/snapshot": {
54
54
  "version": "1.1.0"
@@ -60,7 +60,7 @@
60
60
  "version": "1.2.0"
61
61
  },
62
62
  "@uniweb/unipress": {
63
- "version": "1.1.3"
63
+ "version": "1.1.4"
64
64
  }
65
65
  },
66
66
  "templates": {