@uniweb/kit 0.10.18 → 0.10.20

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/kit",
3
- "version": "0.10.18",
3
+ "version": "0.10.20",
4
4
  "description": "Standard component library for Uniweb foundations",
5
5
  "type": "module",
6
6
  "exports": {
@@ -43,9 +43,9 @@
43
43
  "fuse.js": "^7.0.0",
44
44
  "shiki": "^3.0.0",
45
45
  "tailwind-merge": "^3.6.0",
46
- "@uniweb/scene": "0.1.2",
47
- "@uniweb/core": "0.8.2",
48
- "@uniweb/semantic-parser": "1.2.1"
46
+ "@uniweb/scene": "0.1.3",
47
+ "@uniweb/semantic-parser": "1.2.1",
48
+ "@uniweb/core": "0.8.2"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "react": "^19.0.0",
@@ -126,7 +126,27 @@ export function createEndpointProvider(website, options = {}) {
126
126
  })
127
127
 
128
128
  if (!response.ok) {
129
- throw new Error(`Search endpoint returned ${response.status}`)
129
+ // An endpoint that declines usually explains why, in words meant for a
130
+ // visitor rather than a status code — "Search is not available on this
131
+ // site." Read it and carry it, the same way `submitForm` does with a
132
+ // rejected submission.
133
+ //
134
+ // This does not change the degradation: a failed search still falls
135
+ // back to the local index, because a failed READ should degrade and
136
+ // that guarantee is older than this. What changes is that when there is
137
+ // no index to fall back to, the error a foundation can surface says
138
+ // something a person understands instead of a number.
139
+ let declined
140
+ try {
141
+ declined = (await response.json())?.error
142
+ } catch {
143
+ /* not JSON — the status is all there is */
144
+ }
145
+ throw new Error(
146
+ typeof declined === 'string' && declined.trim()
147
+ ? declined.trim()
148
+ : `Search endpoint returned ${response.status}`
149
+ )
130
150
  }
131
151
 
132
152
  const results = extractResults(await response.json()).map(normalize)