@uniweb/kit 0.9.7 → 0.9.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/kit",
3
- "version": "0.9.7",
3
+ "version": "0.9.8",
4
4
  "description": "Standard component library for Uniweb foundations",
5
5
  "type": "module",
6
6
  "exports": {
@@ -39,7 +39,7 @@
39
39
  "fuse.js": "^7.0.0",
40
40
  "shiki": "^3.0.0",
41
41
  "tailwind-merge": "^2.6.0",
42
- "@uniweb/core": "0.7.7"
42
+ "@uniweb/core": "0.7.8"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": "^18.0.0 || ^19.0.0",
@@ -133,15 +133,20 @@ function SequenceElement({ element, block }) {
133
133
  case 'dataBlock':
134
134
  return null
135
135
 
136
- case 'math_display': {
137
- // Block math from $$...$$ on its own line or ```math fence.
138
- // The mathml string is pre-compiled at parse time; the browser
139
- // renders real MathML natively. Foundations that want to style
140
- // errors can target .temml-error inside this wrapper.
136
+ case 'math': {
137
+ // Math from $$...$$ on its own line, ```math fence, or inline
138
+ // $...$ (the inline form doesn't reach the sequence walker — it
139
+ // rides inside paragraph HTML but render the same way for
140
+ // safety in case a future caller surfaces it here). Mathml is
141
+ // pre-compiled at parse time; the browser renders real MathML
142
+ // natively. Foundations that want to style errors can target
143
+ // .temml-error inside this wrapper.
141
144
  if (!element.mathml) return null
145
+ const display = element.display !== false
146
+ const Tag = display ? 'div' : 'span'
142
147
  return (
143
- <div
144
- className="math-display"
148
+ <Tag
149
+ className={display ? 'math-display' : 'math-inline'}
145
150
  dangerouslySetInnerHTML={{ __html: element.mathml }}
146
151
  />
147
152
  )
@@ -16,7 +16,7 @@
16
16
  * Built-in kinds:
17
17
  * - heading → 'section' (hierarchical: 1, 1.1, 1.1.1, 2, …)
18
18
  * - image → 'figure' (flat arabic counter)
19
- * - math_display → 'equation' (flat arabic counter)
19
+ * - math → 'equation' (flat arabic counter; display:true only)
20
20
  * - table → 'table' (flat arabic counter)
21
21
  *
22
22
  * Foundation extensions: foundations that need additional kinds (e.g.
@@ -57,7 +57,7 @@
57
57
  const KIND_BY_TYPE = {
58
58
  heading: 'section',
59
59
  image: 'figure',
60
- math_display: 'equation',
60
+ math: 'equation',
61
61
  table: 'table',
62
62
  }
63
63
 
@@ -133,9 +133,9 @@ export function buildXrefRegistry(website, options = {}) {
133
133
  }
134
134
 
135
135
  // Sequence elements expose `id` differently per element type. Most
136
- // (heading, image, table) carry it under `attrs`; math_display
137
- // promotes it to a top-level field (per @uniweb/semantic-parser's
138
- // sequence builder). Read both.
136
+ // (heading, image, table) carry it under `attrs`; math promotes it
137
+ // to a top-level field (per @uniweb/semantic-parser's sequence
138
+ // builder). Read both.
139
139
  function readId(el) {
140
140
  return el.attrs?.id ?? el.id ?? null
141
141
  }
@@ -173,7 +173,7 @@ export function buildXrefRegistry(website, options = {}) {
173
173
  if (el.type === 'heading' && el.text) {
174
174
  entry.text = String(el.text)
175
175
  }
176
- if (el.type === 'math_display' && el.latex) {
176
+ if (el.type === 'math' && el.latex) {
177
177
  entry.latex = String(el.latex)
178
178
  }
179
179
  entries[id] = entry
@@ -182,9 +182,9 @@ export function buildXrefRegistry(website, options = {}) {
182
182
  // Walk the Website's object graph: pages → bodyBlocks. Each Block's
183
183
  // `parsedContent.sequence` is a flat document-order array of
184
184
  // semantic elements (heading, paragraph, image, list, blockquote,
185
- // codeBlock, table, math_display, divider, …). Iterating the
186
- // sequence is enough — the registry's id-bearing kinds (heading,
187
- // image, math_display, table) all live at sequence level.
185
+ // codeBlock, table, math, divider, …). Iterating the sequence is
186
+ // enough — the registry's id-bearing kinds (heading, image,
187
+ // math (display:true), table) all live at sequence level.
188
188
  //
189
189
  // Website.pages, Page.bodyBlocks, and Block.parsedContent.sequence
190
190
  // are framework invariants — always arrays. No defensive guards.