@uniweb/core 1.6.7 → 1.6.9
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 +2 -2
- package/src/block.js +22 -3
- package/src/index.js +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/core",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.9",
|
|
4
4
|
"description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@uniweb/semantic-parser": "~1.13.2",
|
|
57
|
-
"@uniweb/theming": "~1.3.
|
|
57
|
+
"@uniweb/theming": "~1.3.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.
|
package/src/index.js
CHANGED
|
@@ -111,6 +111,13 @@ export { resolveService, resolveServiceUrl, readServiceOptions } from './service
|
|
|
111
111
|
export { applyBasePath } from './base-path.js'
|
|
112
112
|
// A site's address and the absolute URLs stated on it — also the leaf `@uniweb/core/site-address`.
|
|
113
113
|
export { siteAddress, pageUrl, absoluteUrl } from './site-address.js'
|
|
114
|
+
// The content parser and its sanitizer, for code a foundation BUNDLES (kit's `Render`, `Icon`,
|
|
115
|
+
// `Scene`). A foundation leaves `@uniweb/core` for the runtime to supply, so what it takes from
|
|
116
|
+
// here is the runtime's copy, the one Block parses every section with, never a second copy frozen
|
|
117
|
+
// at the foundation's build. A foundation imports these by name and a published one never
|
|
118
|
+
// changes, so none of them may leave this entry.
|
|
119
|
+
export { parseContent } from '@uniweb/semantic-parser'
|
|
120
|
+
export { sanitizeSVG, isStyleName } from '@uniweb/semantic-parser/sanitize'
|
|
114
121
|
|
|
115
122
|
/**
|
|
116
123
|
* The singleton Uniweb instance.
|