@uniweb/core 0.5.19 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. 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.19",
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": {
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