@uniweb/core 0.5.18 → 0.5.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 +3 -3
- package/src/block.js +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/core",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.20",
|
|
4
4
|
"description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"jest": "^29.7.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@uniweb/
|
|
34
|
-
"@uniweb/
|
|
33
|
+
"@uniweb/semantic-parser": "1.1.9",
|
|
34
|
+
"@uniweb/theming": "0.1.3"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
package/src/block.js
CHANGED
|
@@ -167,6 +167,15 @@ export default class Block {
|
|
|
167
167
|
return this.page.getNavRoute()
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
/**
|
|
171
|
+
* Unique key for this block across all pages.
|
|
172
|
+
* Combines the page route with the block's positional id.
|
|
173
|
+
* Use as a React key when cross-page uniqueness matters.
|
|
174
|
+
*/
|
|
175
|
+
get key() {
|
|
176
|
+
return `${this.path}-${this.id}`
|
|
177
|
+
}
|
|
178
|
+
|
|
170
179
|
/**
|
|
171
180
|
* The parent page's URL path, one level up from the current page.
|
|
172
181
|
* Use this for "Back" links in detail pages: /blog/1 → /blog
|