@uniweb/core 0.34.0 → 0.35.0

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 +2 -2
  2. package/src/block.js +7 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/core",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
5
5
  "type": "module",
6
6
  "exports": {
@@ -48,7 +48,7 @@
48
48
  "vitest": "^4.1.7"
49
49
  },
50
50
  "dependencies": {
51
- "@uniweb/theming": "^0.1.16",
51
+ "@uniweb/theming": "^0.2.0",
52
52
  "@uniweb/semantic-parser": "^1.4.1"
53
53
  },
54
54
  "scripts": {
package/src/block.js CHANGED
@@ -81,20 +81,13 @@ export default class Block {
81
81
  // once for every renderer, and a component NEVER receives one as a param [Diego,
82
82
  // 2026-09-28]. It reads them from the block, or through kit. ⛔ Until then a component
83
83
  // also received `theme` (the mode), `background` and `vars` as params, and nothing read
84
- // them there. `standardOptions` and `properties` are the older editor envelopes.
85
- const own = blockConfig.properties || blockConfig
86
- const setting = (name) => (blockConfig[name] !== undefined ? blockConfig[name] : own[name])
87
- const rawTheme = setting('theme')
88
- const rawBg = setting('background')
89
- const gridParam = setting('grid')
90
- const varsParam = setting('vars')
91
- const fetchParam = setting('fetch')
92
- const standardOptions = blockConfig.standardOptions
84
+ // them there. ⛔ An editor's older envelope — `params.standardOptions` and `params.properties`
85
+ // — is no longer read (2026-09-28): an editor's preview sends a section's params as stored,
86
+ // and no store publishes the envelope. Either name is an ordinary param now.
93
87
  const {
94
- theme: _theme, background: _background, grid: _grid, vars: _vars, fetch: _fetch,
95
- standardOptions: _standardOptions, properties: _properties,
88
+ theme: rawTheme, background: rawBg, grid: gridParam, vars: varsParam, fetch: fetchParam,
96
89
  ...componentParams
97
- } = own
90
+ } = blockConfig
98
91
  this.properties = componentParams
99
92
 
100
93
  // The section's theme: `theme.yml`'s own keys scoped to the section — `colors`,
@@ -115,18 +108,10 @@ export default class Block {
115
108
  // them inline on the section, and a neighbour reads them through `getBlockInfo()`.
116
109
  this.contextOverrides = theme.effectiveTokens
117
110
 
118
- // ⚠️ The older editor envelope: `colors` (a section palette, and tokens per context) and
119
- // `foundationStyles`, read by the page stylesheet until an editor writes the section's
120
- // `theme` instead (uwx-format.md § A page section's fields). Nothing else reads it.
121
- this.standardOptions = standardOptions || {}
122
-
123
111
  // What the runtime draws behind the section — normalized once (its shape, and store-held
124
112
  // assets resolved to URLs) for every renderer, and for a component that draws it itself
125
- // (`background: 'self'` in `meta.js`, with kit's `SectionBackground`). An editor's preview
126
- // may still send it inside the older envelope, which wins while it does.
127
- this.background =
128
- this.standardOptions.background ||
129
- (rawBg ? Block.normalizeBackground(rawBg, this.parseOptions()) : null)
113
+ // (`background: 'self'` in `meta.js`, with kit's `SectionBackground`).
114
+ this.background = rawBg ? Block.normalizeBackground(rawBg, this.parseOptions()) : null
130
115
 
131
116
  // Values for the CSS variables the component declares in `meta.js` `vars:` — merged into
132
117
  // `componentVars` when the component is known (`initComponent`).