@uniweb/projections 0.1.1 → 0.1.3

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/projections",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Projections of a Uniweb site's content — agent index, per-page markdown, search index. Pure JS, runs anywhere.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -31,12 +31,12 @@
31
31
  "node": ">=20.19"
32
32
  },
33
33
  "dependencies": {
34
- "@uniweb/core": "0.7.30",
35
- "@uniweb/content-writer": "0.2.8"
34
+ "@uniweb/core": "0.7.32",
35
+ "@uniweb/content-writer": "0.2.9"
36
36
  },
37
37
  "devDependencies": {
38
38
  "vitest": "^4.1.7",
39
- "@uniweb/content-reader": "1.1.16"
39
+ "@uniweb/content-reader": "1.1.17"
40
40
  },
41
41
  "scripts": {
42
42
  "test": "vitest run"
@@ -5,6 +5,11 @@
5
5
  * for search indexing. Reuses patterns from i18n extraction.
6
6
  */
7
7
 
8
+ // Leaf subpath, not the bare `@uniweb/core` entry: this package's environment
9
+ // contract forbids the package root (it pulls semantic-parser + theming).
10
+ // Enforced by tests/environment.test.js.
11
+ import { sectionDomId } from '@uniweb/core/section-id'
12
+
8
13
  /**
9
14
  * Extract all searchable content from site
10
15
  * @param {Object} siteContent - Parsed site-content.json
@@ -157,7 +162,12 @@ function extractFromSection(section, page, options) {
157
162
  type: 'section',
158
163
  route: page.route,
159
164
  sectionId,
160
- anchor: `Section${sectionId}`,
165
+ // The anchor MUST equal the id the renderer writes, or the result links
166
+ // to a fragment that does not exist — it lands on the page without
167
+ // scrolling, and does nothing at all when the target is the current
168
+ // page. Derived by the shared rule rather than spelled out here,
169
+ // because that is exactly how the two drifted apart before.
170
+ anchor: sectionDomId(section),
161
171
  component,
162
172
  title: sectionTitle,
163
173
  pageTitle: page.title || '',