@uniweb/core 1.6.7 → 1.6.8
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 +22 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/core",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.8",
|
|
4
4
|
"description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"vitest": "^4.1.7"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@uniweb/
|
|
57
|
-
"@uniweb/
|
|
56
|
+
"@uniweb/theming": "~1.3.2",
|
|
57
|
+
"@uniweb/semantic-parser": "~1.13.2"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"test": "vitest run"
|
package/src/block.js
CHANGED
|
@@ -661,12 +661,31 @@ export default class Block {
|
|
|
661
661
|
contextOverrides: this.contextOverrides,
|
|
662
662
|
state: this.state,
|
|
663
663
|
context: this.context,
|
|
664
|
-
// Whether the header lies over this section
|
|
665
|
-
// next block, the page's first section, to paint itself see-through.
|
|
666
|
-
underHeader: this.
|
|
664
|
+
// Whether the header lies over this section on its page (`liesUnderHeader`): a header reads
|
|
665
|
+
// it on its next block, the page's first section, to paint itself see-through.
|
|
666
|
+
underHeader: this.liesUnderHeader()
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
669
|
|
|
670
|
+
/**
|
|
671
|
+
* Whether the header lies over this section on its page: the section asks (`underHeader`, its
|
|
672
|
+
* author's setting or its type's default), it opens the page, and the page has a header — its
|
|
673
|
+
* layout's area named `header`, holding sections. One rule for the runtime, which lays the
|
|
674
|
+
* header over the section, and for a header, which reads it on its next block
|
|
675
|
+
* (`getBlockInfo().underHeader`) to paint itself see-through.
|
|
676
|
+
*
|
|
677
|
+
* ⛔ Until 2026-11-06 a header read the section's setting alone, so a header in an area named
|
|
678
|
+
* otherwise, which the runtime never lays over anything, painted itself see-through in the flow.
|
|
679
|
+
*
|
|
680
|
+
* @returns {boolean}
|
|
681
|
+
*/
|
|
682
|
+
liesUnderHeader() {
|
|
683
|
+
const page = this.page
|
|
684
|
+
if (!this.underHeader || !page || page.getBodyBlocks?.()?.[0] !== this) return false
|
|
685
|
+
const header = page.getLayoutAreas?.()?.header
|
|
686
|
+
return Array.isArray(header) && header.length > 0
|
|
687
|
+
}
|
|
688
|
+
|
|
670
689
|
/**
|
|
671
690
|
* Get information about the next block in the page.
|
|
672
691
|
* Commonly used by headers/navbars to adapt to the first content section.
|