uniweb 1.27.3 → 1.27.5

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.27.3",
3
+ "version": "1.27.5",
4
4
  "description": "Create structured Vite + React sites with content/code separation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -47,7 +47,7 @@
47
47
  "@uniweb/semantic-parser": "~1.13.2"
48
48
  },
49
49
  "peerDependencies": {
50
- "@uniweb/build": "~1.16.1",
50
+ "@uniweb/build": "~1.16.3",
51
51
  "@uniweb/content-reader": "~1.5.9",
52
52
  "@uniweb/semantic-parser": "~1.13.2"
53
53
  },
@@ -76,7 +76,7 @@ const { submit, status, error, canSubmit } = useFormSubmit({
76
76
  if (!canSubmit) return null // check at render, not on the button press
77
77
  ```
78
78
 
79
- `status`: `idle → submitting → success | error`; a non-2xx becomes a thrown `Error` carrying the endpoint's `error` message. File fields: pass `files`; the endpoint replies with `uploadUrls`, and bytes never ride inside the JSON. `submitForm()` / `resolveSubmitTarget(website)` are the same without React. A host that protects its address names a `challenge` beside `endpoint`; the hook then solves an ALTCHA v1 puzzle and sends `X-Proof` itself, so a form needs no change (`sendWithProof` + `resolveServiceAddress(website, name, 'challenge')` for any other service). A failed read leaves its key `null`, with the message on `block.dataError[key]`; a write that 404s loses what a person typed, so it gets no silent fallback.
79
+ `status`: `idle → submitting → success | error`; a non-2xx becomes a thrown `Error` carrying the endpoint's `error` message. File fields: pass `files`; the endpoint replies with `uploadUrls`, and bytes never ride inside the JSON. `submitForm()` / `resolveSubmitTarget(website)` are the same without React. A host that protects its address names a `challenge` beside `endpoint`; the hook solves an ALTCHA v1 puzzle and sends `X-Proof` itself, so a form needs no change; `<form onFocus={prepare}>` (from the hook) solves it while the visitor types — never on mount, since puzzle fetches share the host's per-visitor send limit. Any other service: `prepareProof(challenge)` on first focus, then `sendWithProof`, with `resolveServiceAddress(website, name, 'challenge')`. A failed read leaves its key `null`, with the message on `block.dataError[key]`; a write that 404s loses what a person typed, so it gets no silent fallback.
80
80
 
81
81
  **Rendering an author-designed form** (`yaml:form` at `content.data.form`): you don't declare the fields, you receive them. `useFormValues` owns what's identical in every such component:
82
82
 
@@ -2893,6 +2893,15 @@ export async function pushSyncPackages({
2893
2893
  })
2894
2894
  })
2895
2895
  }
2896
+ // ⭐ WHAT A PULL HELD ENDS WHEN A PUSH SENDS THE FILES' VERSION. A push that left nothing out
2897
+ // (`heldLeftOut`) either held nothing or was forced, and then sent each held page's files over
2898
+ // the app's version: the site holds the files' version now, so nothing is left to keep out of the
2899
+ // next push, and the next pull records afresh what it holds. ⛔ Until 2026-11-05 a forced push left
2900
+ // `heldUnits` as the pull wrote them while banking a version for each page it sent, and the next
2901
+ // plain push left those pages out with their versions: a deletion.
2902
+ if (!(pkg.heldLeftOut || []).length && Object.keys(readHeldUnits(siteDir, client.origin)).length) {
2903
+ writeHeldUnits(siteDir, client.origin, {}, [])
2904
+ }
2896
2905
  // Re-base the page attribution: our emitted document and the backend's post-write
2897
2906
  // copy of it are the two sides' new agreed state.
2898
2907
  const patch = {}
@@ -742,7 +742,7 @@ export function checkDefaultSection({ foundationName, folderName, foundationDir,
742
742
  const message = `defaultSection names '${named}', which is not a section type of this foundation`
743
743
  issues.push({ id, type: 'warn', foundation: foundationName, message, ...(suggestion ? { suggested: suggestion } : {}) })
744
744
  warn(`[${id}] ${folderName}: ${message}`)
745
- log(` A section that names no type shows "Component not found" where an author composes it.`)
745
+ log(` A section that names no type shows "Component not found" where an author composes it, unless an extension the site adds provides ${named}.`)
746
746
  if (proposal) log(` ${colors.blue}${proposal}${colors.reset}`)
747
747
  return { type: null, declared, exists }
748
748
  }
@@ -773,9 +773,11 @@ export function checkDefaultSection({ foundationName, folderName, foundationDir,
773
773
  export function checkAreaTypes({ foundationName, folderName, foundationDir, issues }) {
774
774
  const schema = loadSchemaJson(foundationDir)
775
775
  if (!schema) return []
776
+ // The areas its layouts declare, and with no default layout (`_self.defaultLayout`) the header and the
777
+ // footer the runtime's built-in layout draws, which a page that names no layout renders with.
776
778
  const layouts = Object.values(schema._layouts || {})
777
779
  const declared = layouts.length > 0 && layouts.every((layout) => Array.isArray(layout?.areas))
778
- ? new Set(layouts.flatMap((layout) => layout.areas))
780
+ ? new Set([...layouts.flatMap((layout) => layout.areas), ...(schema._self?.defaultLayout ? [] : ['header', 'footer'])])
779
781
  : null
780
782
  const suggested = Object.entries(schema)
781
783
  .filter(([key, entry]) => !key.startsWith('_') && key !== 'dataSchemas' && entry && typeof entry === 'object')
@@ -1275,7 +1275,10 @@ export async function pull(args = [], deps = {}) {
1275
1275
  dataModel,
1276
1276
  sectionType,
1277
1277
  // The mounts it may write into, each one the site declares writable (above).
1278
- writableMounts: mounts.writable
1278
+ writableMounts: mounts.writable,
1279
+ // Where each page was before this pull, read before its identity merged the pulled document's
1280
+ // in (`writeItemUuids`, above): a page the app moved is found where the files keep it.
1281
+ priorItems
1279
1282
  })
1280
1283
  wrote.push(...report.pages, ...report.sections, ...report.layout)
1281
1284
  removed.push(
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-11-05T20:23:08.274Z",
3
+ "generatedAt": "2026-11-05T23:51:31.551Z",
4
4
  "packages": {
5
5
  "@uniweb/api": {
6
6
  "version": "1.6.9"
7
7
  },
8
8
  "@uniweb/build": {
9
- "version": "1.16.1"
9
+ "version": "1.16.3"
10
10
  },
11
11
  "@uniweb/content-reader": {
12
12
  "version": "1.5.9"
@@ -24,7 +24,7 @@
24
24
  "version": "1.0.8"
25
25
  },
26
26
  "@uniweb/kit": {
27
- "version": "1.7.9"
27
+ "version": "1.7.10"
28
28
  },
29
29
  "@uniweb/loom": {
30
30
  "version": "1.1.3"