@uniweb/core 0.36.0 → 0.37.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/core",
3
- "version": "0.36.0",
3
+ "version": "0.37.0",
4
4
  "description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
5
5
  "type": "module",
6
6
  "exports": {
package/src/index.js CHANGED
@@ -93,7 +93,10 @@ export {
93
93
  landingRoute,
94
94
  RESOLUTION_STATUS,
95
95
  } from './resolve-route.js'
96
- export { isRichSchema } from './schemas.js'
96
+ // ⛔ No `isRichSchema` (removed 2026-10-05). It told a form-shaped `data:` value from a field
97
+ // map for the runtime's field defaults and the build's runtime schema; both went when the
98
+ // runtime stopped filling field defaults. A registered schema says it outright — `kind: 'form'`
99
+ // in format 3 (`@uniweb/schemas/foundation`) — and the editor, its last reader, reads that.
97
100
  // ⛔ `Tracker` is NOT on the package entry. It is a FEATURE, not part of the
98
101
  // object graph this package exists to define, and putting it here made every
99
102
  // consumer of core carry 1,576 gzip of it -- press, unipress, `@uniweb/api`
package/src/website.js CHANGED
@@ -755,7 +755,7 @@ export default class Website {
755
755
  /**
756
756
  * Get layout metadata from foundation config
757
757
  * @param {string} layoutName - Layout name
758
- * @returns {Object|null} Layout meta { areas, transitions, defaults }
758
+ * @returns {Object|null} Layout meta { transitions, layers, scroll, defaults } — a page's areas are its site's `layout/` folder (`getLayoutAreas`)
759
759
  */
760
760
  getLayoutMeta(layoutName) {
761
761
  return findLayoutEntry(globalThis.uniweb?.foundationConfig?.layoutMeta, layoutName) || null
package/src/schemas.js DELETED
@@ -1,45 +0,0 @@
1
- /**
2
- * The rich-form-schema predicate. One function, and deliberately only one.
3
- *
4
- * Rich schemas live under `data.schemas` in a component's meta.js. They drive
5
- * two author input paths that both land at `content.data[schema-id]`: tagged
6
- * markdown blocks (``` ```yaml:<id> ``` ```) and the editor's FormBlock widget.
7
- *
8
- * `isRichSchema` is a **dispatch** predicate — "is this already the rich shape?"
9
- * — and it is read at render by `runtime/src/prepare-props.js` (`applySchemas`)
10
- * and at build by `build/src/runtime-schema.js`. Both are on the hot path of
11
- * every site, which is what earns it a place in this package.
12
- *
13
- * ⛔ **Do not add editor-side schema code here.** `normalizeSchema` — "can this
14
- * be edited, and as what?" — sat beside this function until 2026-09-01 purely
15
- * because the two were adjacent; it never called `isRichSchema` and had no
16
- * consumer outside the editor. `@uniweb/core` loads on every site in every lane
17
- * and is not tree-shaken on the hosted one, so an editor-only function on its
18
- * entry is paid for by every visitor of every site. It now lives in the
19
- * zero-dependency leaf that owns what a data-schema *means*:
20
- * **`@uniweb/schemas/editor-form`**.
21
- *
22
- * Conditional field visibility (a rich-schema feature) is likewise editor-only
23
- * and is not implemented here — the editor owns its own evaluator.
24
- */
25
-
26
- /**
27
- * Does a `data.schemas` entry look like a rich form schema?
28
- *
29
- * Rich schemas have an ordered `fields` array (composite arrays and
30
- * nested objects), distinct from simple keyed-object schemas used for
31
- * tagged blocks. Markers (any of):
32
- * - `fields` is an array
33
- * - `isComposite: true`
34
- * - `childSchema` present
35
- *
36
- * @param {*} schema - Schema value to inspect.
37
- * @returns {boolean}
38
- */
39
- export function isRichSchema(schema) {
40
- if (!schema || typeof schema !== 'object') return false
41
- if (Array.isArray(schema.fields)) return true
42
- if (schema.isComposite === true) return true
43
- if (schema.childSchema && typeof schema.childSchema === 'object') return true
44
- return false
45
- }