@nuucognition/ncm-ui 0.1.1-beta.0 → 0.1.1-beta.1

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/dist/index.js CHANGED
@@ -813,7 +813,8 @@ function ChartBlock({ block, className }) {
813
813
  "data-ncm-chart": "",
814
814
  "data-ncm-chart-type": block.chartType ?? "unknown",
815
815
  className: cn(
816
- "overflow-x-auto rounded-lg border border-border bg-muted p-4 font-mono text-sm",
816
+ // `overflow-y-hidden` pairs with `overflow-x-auto` on purpose — see the note in `lib/defaults.ts`.
817
+ "overflow-x-auto overflow-y-hidden rounded-lg border border-border bg-muted p-4 font-mono text-sm",
817
818
  className
818
819
  ),
819
820
  children: /* @__PURE__ */ jsx("code", { children: block.content })
@@ -993,7 +994,8 @@ function DataviewBlock({ block, className }) {
993
994
  "data-ncm-dataview": "",
994
995
  "data-ncm-query-type": block.queryType,
995
996
  className: cn(
996
- "overflow-x-auto rounded-lg border border-border bg-muted p-4 font-mono text-sm",
997
+ // `overflow-y-hidden` pairs with `overflow-x-auto` on purpose — see the note in `lib/defaults.ts`.
998
+ "overflow-x-auto overflow-y-hidden rounded-lg border border-border bg-muted p-4 font-mono text-sm",
997
999
  className
998
1000
  ),
999
1001
  children: /* @__PURE__ */ jsx("code", { children: block.query })
@@ -1332,7 +1334,8 @@ function HtmlBlock({ block, className }) {
1332
1334
  "data-block-id": block.id,
1333
1335
  "data-ncm-html": "",
1334
1336
  className: cn(
1335
- "overflow-x-auto rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1337
+ // `overflow-y-hidden` pairs with `overflow-x-auto` on purpose — see the note in `lib/defaults.ts`.
1338
+ "overflow-x-auto overflow-y-hidden rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1336
1339
  className
1337
1340
  ),
1338
1341
  children: /* @__PURE__ */ jsx("code", { children: block.content })
@@ -1393,7 +1396,7 @@ function LatexDisplayBlock({ block, className }) {
1393
1396
  "data-ncm-type": block.type,
1394
1397
  "data-block-id": block.id,
1395
1398
  "data-ncm-latex-display": "",
1396
- className: cn("overflow-x-auto", className),
1399
+ className: cn("overflow-x-auto overflow-y-hidden", className),
1397
1400
  dangerouslySetInnerHTML: { __html: html }
1398
1401
  }
1399
1402
  );
@@ -1408,7 +1411,7 @@ function LatexDisplayBlock({ block, className }) {
1408
1411
  "data-ncm-type": block.type,
1409
1412
  "data-block-id": block.id,
1410
1413
  "data-ncm-latex-display": "",
1411
- className: cn("overflow-x-auto rounded-lg border border-border bg-muted p-4 font-mono text-sm", className),
1414
+ className: cn("overflow-x-auto overflow-y-hidden rounded-lg border border-border bg-muted p-4 font-mono text-sm", className),
1412
1415
  children: /* @__PURE__ */ jsx("code", { children: block.content })
1413
1416
  }
1414
1417
  );
@@ -1528,7 +1531,7 @@ function MathBlock({ block, className }) {
1528
1531
  "data-ncm-type": block.type,
1529
1532
  "data-block-id": block.id,
1530
1533
  "data-ncm-math": "",
1531
- className: cn("overflow-x-auto", className),
1534
+ className: cn("overflow-x-auto overflow-y-hidden", className),
1532
1535
  dangerouslySetInnerHTML: { __html: html }
1533
1536
  }
1534
1537
  );
@@ -1544,7 +1547,8 @@ function MathBlock({ block, className }) {
1544
1547
  "data-block-id": block.id,
1545
1548
  "data-ncm-math": "",
1546
1549
  className: cn(
1547
- "overflow-x-auto rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1550
+ // `overflow-y-hidden` pairs with `overflow-x-auto` on purpose — see the note in `lib/defaults.ts`.
1551
+ "overflow-x-auto overflow-y-hidden rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1548
1552
  className
1549
1553
  ),
1550
1554
  children: /* @__PURE__ */ jsx("code", { children: block.content })
@@ -1562,7 +1566,8 @@ function MermaidBlock({ block, className }) {
1562
1566
  "data-ncm-mermaid": "",
1563
1567
  "data-ncm-diagram-type": block.diagramType,
1564
1568
  className: cn(
1565
- "overflow-x-auto rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1569
+ // `overflow-y-hidden` pairs with `overflow-x-auto` on purpose — see the note in `lib/defaults.ts`.
1570
+ "overflow-x-auto overflow-y-hidden rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1566
1571
  className
1567
1572
  ),
1568
1573
  children: /* @__PURE__ */ jsx("code", { children: block.content })
@@ -1623,7 +1628,7 @@ function TableBlock({ block, className }) {
1623
1628
  "data-ncm-type": block.type,
1624
1629
  "data-block-id": block.id,
1625
1630
  "data-ncm-table": "",
1626
- className: cn("w-full overflow-x-auto", className),
1631
+ className: cn("w-full overflow-x-auto overflow-y-hidden", className),
1627
1632
  children: /* @__PURE__ */ jsxs("table", { role: "table", "data-ncm-table-element": "", children: [
1628
1633
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { "data-ncm-table-row": "", children: block.headers.map((header, index) => /* @__PURE__ */ jsx("th", { "data-ncm-table-header": "", children: /* @__PURE__ */ jsx(InlineContent, { content: header }) }, index)) }) }),
1629
1634
  /* @__PURE__ */ jsx("tbody", { children: block.rows.map((row, rowIndex) => {
@@ -1709,7 +1714,7 @@ function FallbackBlock({ block, className }) {
1709
1714
  "data-block-id": block.id,
1710
1715
  "data-ncm-fallback": "",
1711
1716
  className: cn(
1712
- "overflow-x-auto rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1717
+ "overflow-x-auto overflow-y-hidden rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1713
1718
  className
1714
1719
  )
1715
1720
  },
@@ -1765,7 +1770,7 @@ function CustomCodeBlock({ block, className }) {
1765
1770
  "data-block-id": block.id,
1766
1771
  "data-ncm-custom-code": "",
1767
1772
  "data-ncm-language": block.language,
1768
- className: cn("overflow-x-auto", className),
1773
+ className: cn("overflow-x-auto overflow-y-hidden", className),
1769
1774
  children: [
1770
1775
  /* @__PURE__ */ jsx("div", { className: "mb-2 text-xs font-medium text-muted-foreground", children: block.language }),
1771
1776
  /* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsx("code", { children: block.content }) })
@@ -22,7 +22,7 @@ function CustomCodeBlock({ block, className }) {
22
22
  "data-block-id": block.id,
23
23
  "data-ncm-custom-code": "",
24
24
  "data-ncm-language": block.language,
25
- className: cn("overflow-x-auto", className),
25
+ className: cn("overflow-x-auto overflow-y-hidden", className),
26
26
  children: [
27
27
  /* @__PURE__ */ jsx("div", { className: "mb-2 text-xs font-medium text-muted-foreground", children: block.language }),
28
28
  /* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsx("code", { children: block.content }) })
@@ -843,7 +843,8 @@ function ChartBlock({ block, className }) {
843
843
  "data-ncm-chart": "",
844
844
  "data-ncm-chart-type": block.chartType ?? "unknown",
845
845
  className: cn(
846
- "overflow-x-auto rounded-lg border border-border bg-muted p-4 font-mono text-sm",
846
+ // `overflow-y-hidden` pairs with `overflow-x-auto` on purpose — see the note in `lib/defaults.ts`.
847
+ "overflow-x-auto overflow-y-hidden rounded-lg border border-border bg-muted p-4 font-mono text-sm",
847
848
  className
848
849
  ),
849
850
  children: /* @__PURE__ */ jsx("code", { children: block.content })
@@ -1023,7 +1024,8 @@ function DataviewBlock({ block, className }) {
1023
1024
  "data-ncm-dataview": "",
1024
1025
  "data-ncm-query-type": block.queryType,
1025
1026
  className: cn(
1026
- "overflow-x-auto rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1027
+ // `overflow-y-hidden` pairs with `overflow-x-auto` on purpose — see the note in `lib/defaults.ts`.
1028
+ "overflow-x-auto overflow-y-hidden rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1027
1029
  className
1028
1030
  ),
1029
1031
  children: /* @__PURE__ */ jsx("code", { children: block.query })
@@ -1362,7 +1364,8 @@ function HtmlBlock({ block, className }) {
1362
1364
  "data-block-id": block.id,
1363
1365
  "data-ncm-html": "",
1364
1366
  className: cn(
1365
- "overflow-x-auto rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1367
+ // `overflow-y-hidden` pairs with `overflow-x-auto` on purpose — see the note in `lib/defaults.ts`.
1368
+ "overflow-x-auto overflow-y-hidden rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1366
1369
  className
1367
1370
  ),
1368
1371
  children: /* @__PURE__ */ jsx("code", { children: block.content })
@@ -1400,7 +1403,7 @@ function LatexDisplayBlock({ block, className }) {
1400
1403
  "data-ncm-type": block.type,
1401
1404
  "data-block-id": block.id,
1402
1405
  "data-ncm-latex-display": "",
1403
- className: cn("overflow-x-auto", className),
1406
+ className: cn("overflow-x-auto overflow-y-hidden", className),
1404
1407
  dangerouslySetInnerHTML: { __html: html }
1405
1408
  }
1406
1409
  );
@@ -1415,7 +1418,7 @@ function LatexDisplayBlock({ block, className }) {
1415
1418
  "data-ncm-type": block.type,
1416
1419
  "data-block-id": block.id,
1417
1420
  "data-ncm-latex-display": "",
1418
- className: cn("overflow-x-auto rounded-lg border border-border bg-muted p-4 font-mono text-sm", className),
1421
+ className: cn("overflow-x-auto overflow-y-hidden rounded-lg border border-border bg-muted p-4 font-mono text-sm", className),
1419
1422
  children: /* @__PURE__ */ jsx("code", { children: block.content })
1420
1423
  }
1421
1424
  );
@@ -1535,7 +1538,7 @@ function MathBlock({ block, className }) {
1535
1538
  "data-ncm-type": block.type,
1536
1539
  "data-block-id": block.id,
1537
1540
  "data-ncm-math": "",
1538
- className: cn("overflow-x-auto", className),
1541
+ className: cn("overflow-x-auto overflow-y-hidden", className),
1539
1542
  dangerouslySetInnerHTML: { __html: html }
1540
1543
  }
1541
1544
  );
@@ -1551,7 +1554,8 @@ function MathBlock({ block, className }) {
1551
1554
  "data-block-id": block.id,
1552
1555
  "data-ncm-math": "",
1553
1556
  className: cn(
1554
- "overflow-x-auto rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1557
+ // `overflow-y-hidden` pairs with `overflow-x-auto` on purpose — see the note in `lib/defaults.ts`.
1558
+ "overflow-x-auto overflow-y-hidden rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1555
1559
  className
1556
1560
  ),
1557
1561
  children: /* @__PURE__ */ jsx("code", { children: block.content })
@@ -1569,7 +1573,8 @@ function MermaidBlock({ block, className }) {
1569
1573
  "data-ncm-mermaid": "",
1570
1574
  "data-ncm-diagram-type": block.diagramType,
1571
1575
  className: cn(
1572
- "overflow-x-auto rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1576
+ // `overflow-y-hidden` pairs with `overflow-x-auto` on purpose — see the note in `lib/defaults.ts`.
1577
+ "overflow-x-auto overflow-y-hidden rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1573
1578
  className
1574
1579
  ),
1575
1580
  children: /* @__PURE__ */ jsx("code", { children: block.content })
@@ -1630,7 +1635,7 @@ function TableBlock({ block, className }) {
1630
1635
  "data-ncm-type": block.type,
1631
1636
  "data-block-id": block.id,
1632
1637
  "data-ncm-table": "",
1633
- className: cn("w-full overflow-x-auto", className),
1638
+ className: cn("w-full overflow-x-auto overflow-y-hidden", className),
1634
1639
  children: /* @__PURE__ */ jsxs("table", { role: "table", "data-ncm-table-element": "", children: [
1635
1640
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { "data-ncm-table-row": "", children: block.headers.map((header, index) => /* @__PURE__ */ jsx("th", { "data-ncm-table-header": "", children: /* @__PURE__ */ jsx(InlineContent, { content: header }) }, index)) }) }),
1636
1641
  /* @__PURE__ */ jsx("tbody", { children: block.rows.map((row, rowIndex) => {
@@ -1716,7 +1721,7 @@ function FallbackBlock({ block, className }) {
1716
1721
  "data-block-id": block.id,
1717
1722
  "data-ncm-fallback": "",
1718
1723
  className: cn(
1719
- "overflow-x-auto rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1724
+ "overflow-x-auto overflow-y-hidden rounded-lg border border-border bg-muted p-4 font-mono text-sm",
1720
1725
  className
1721
1726
  )
1722
1727
  },
@@ -15,7 +15,7 @@
15
15
  * 1rem body at 1.65, headings 1.75 / 1.56 / 1.39 / 1.24 / 1.1em. Switching
16
16
  * view must not resize a single glyph. Since the flow-block rhythm pass, the
17
17
  * MARGINS are part of the same contract: the editor states this file's block
18
- * gaps (1rem between siblings, per-level rem heading margins, the 1.25rem /
18
+ * gaps (1rem between siblings, per-level rem heading margins, the 1.5rem /
19
19
  * 0.125rem list geometry) per element on its side. If one side of that pair
20
20
  * moves, move the other in the same change.
21
21
  *
@@ -105,13 +105,16 @@
105
105
  }
106
106
 
107
107
  /*
108
- * Callout (admonition) — minimalist: sharp corners, 1px hairline border, a
109
- * 2px colored left edge (the blockquote's own weight), tight padding. The
110
- * type supplies only colors, through the `--ncm-callout-*` hooks; a host
111
- * assigns them per `data-ncm-admonition-type` (Onyx does, from its palette
108
+ * Callout (admonition) — a quiet card: rounded `md` corners (the NUU chrome
109
+ * step, stated as radius × 0.8 so a host's `--radius` carries through), 1px
110
+ * hairline border, a 2px colored left edge (the blockquote's own weight),
111
+ * tight padding. Rounded since (Task) 581, superseding the sharp-corner line
112
+ * of the minimalist pass — everything else from that pass stands. The type
113
+ * supplies only colors, through the `--ncm-callout-*` hooks; a host assigns
114
+ * them per `data-ncm-admonition-type` (Onyx does, from its palette
112
115
  * families). Unset, every hook falls back to the neutral hairline card, so
113
116
  * a host with no callout stylesheet — and any type a host does not cover —
114
- * renders the same minimalist shell with no color.
117
+ * renders the same quiet shell with no color.
115
118
  *
116
119
  * These rules override the component's own rounded-card utilities
117
120
  * (`rounded-lg bg-card p-4`): this file is unlayered and Tailwind utilities
@@ -122,9 +125,18 @@
122
125
  [data-ncm-document].ncm-theme-nuu [data-ncm-admonition] {
123
126
  border: 1px solid var(--ncm-callout-border, var(--border));
124
127
  border-left: 2px solid var(--ncm-callout-edge, var(--border));
125
- border-radius: 0;
128
+ border-radius: calc(var(--radius, 0.625rem) * 0.8);
126
129
  padding: 0.625rem 0.875rem;
127
130
  background-color: var(--ncm-callout-tint, transparent);
131
+ /*
132
+ * An unbroken word must stay inside the card. Hosts lay the title out as a
133
+ * flex row (glyph + text), and a flex item's min-content size is the whole
134
+ * unbreakable word — the text ran past the card edge. `anywhere`, not
135
+ * `break-word`: only `anywhere` lets the break point count toward the
136
+ * min-content size, which is what the flex layout measures. Inherited, so
137
+ * the title and every content paragraph get it. ((Task) 581)
138
+ */
139
+ overflow-wrap: anywhere;
128
140
  }
129
141
 
130
142
  /*
@@ -157,9 +169,14 @@
157
169
  }
158
170
 
159
171
  /* Lists */
172
+ /*
173
+ * 1.5rem is the ONE marker-slot width all three list kinds share — disc,
174
+ * decimal, and the task checkbox (1em box + 0.5rem gap) — so the text column
175
+ * is identical across them at every depth.
176
+ */
160
177
  [data-ncm-document].ncm-theme-nuu [data-ncm-type="list_ordered"],
161
178
  [data-ncm-document].ncm-theme-nuu [data-ncm-type="list_unordered"] {
162
- padding-left: 1.25rem;
179
+ padding-left: 1.5rem;
163
180
  color: var(--foreground);
164
181
  line-height: 1.65;
165
182
  }
@@ -182,7 +199,7 @@
182
199
  [data-ncm-document].ncm-theme-nuu [data-ncm-type="list_unordered"] ol,
183
200
  [data-ncm-document].ncm-theme-nuu [data-ncm-type="list_unordered"] ul {
184
201
  margin-top: 0.125rem;
185
- padding-left: 1.25rem;
202
+ padding-left: 1.5rem;
186
203
  }
187
204
 
188
205
  [data-ncm-document].ncm-theme-nuu [data-ncm-type="list_ordered"] li::marker,
@@ -206,11 +223,14 @@
206
223
  /*
207
224
  * Task list — one spec with the editor's `ul[data-type="taskList"]` block in
208
225
  * `@nuucognition/nuu-editor` (`src/nuu-editor/nuu-editor.scss`): flush-left
209
- * rows 0.125rem apart, a 1em sharp-cornered checkbox drawn from theme tokens
210
- * (border-token box, foreground fill when checked, background-coloured check),
211
- * 0.5rem to the text, checked text dimmed to the muted tone with NO
212
- * strike-through, nested lists indented 1.5rem so they start at the text
213
- * column. If one side of that pair moves, move the other in the same change.
226
+ * rows 0.125rem apart, a 1em checkbox rounded 0.25rem (the nuu-ui Checkbox
227
+ * radius) drawn from theme tokens (border-token box, foreground fill when
228
+ * checked, background-coloured check), 0.5rem to the text — 1em + 0.5rem =
229
+ * the shared 1.5rem marker slot that lines task text up with disc and
230
+ * decimal text. Checked text dims to the muted tone with NO strike-through.
231
+ * A nested task list carries NO indent of its own: the checkbox slot IS the
232
+ * indent, the same 1.5rem step the other list kinds get from padding. If one
233
+ * side of that pair moves, move the other in the same change.
214
234
  *
215
235
  * The checkbox is drawn with `appearance: none` because the native control
216
236
  * neither themes nor matches the editor's; the input stays a real (disabled)
@@ -233,7 +253,9 @@
233
253
  }
234
254
 
235
255
  [data-ncm-document].ncm-theme-nuu [data-ncm-task-list] [data-ncm-list-nested] {
236
- margin-left: 1.5rem;
256
+ /* No margin: the nested row's own checkbox slot (1em + 0.5rem) is the
257
+ 1.5rem indent, the same step disc and decimal get from padding. */
258
+ margin-left: 0;
237
259
  margin-top: 0.125rem;
238
260
  }
239
261
 
@@ -252,7 +274,8 @@
252
274
  height: 1em;
253
275
  margin: 0.375rem 0 0;
254
276
  border: 1px solid var(--border);
255
- border-radius: 0;
277
+ /* nuu-ui's Checkbox radius (rounded-[4px]). */
278
+ border-radius: 0.25rem;
256
279
  background-color: transparent;
257
280
  position: relative;
258
281
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuucognition/ncm-ui",
3
- "version": "0.1.1-beta.0",
3
+ "version": "0.1.1-beta.1",
4
4
  "description": "React renderers for NUU Cognition Markdown (NCM) blocks — a component library that renders parsed NCM Blocks to accessible, themeable markup.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -18,8 +18,7 @@
18
18
  "*.css"
19
19
  ],
20
20
  "publishConfig": {
21
- "access": "public",
22
- "tag": "beta"
21
+ "access": "public"
23
22
  },
24
23
  "main": "./dist/index.js",
25
24
  "module": "./dist/index.js",
@@ -30,7 +29,7 @@
30
29
  "LICENSE"
31
30
  ],
32
31
  "dependencies": {
33
- "@nuucognition/mesh-core": "1.0.1-beta.1",
32
+ "@nuucognition/mesh-core": "1.0.1-beta.2",
34
33
  "clsx": "^2.1.1",
35
34
  "katex": "^0.16.21",
36
35
  "shiki": "^1.29.2",
@@ -46,8 +45,8 @@
46
45
  "tsup": "^8.5.1",
47
46
  "typescript": "^5.9.2",
48
47
  "vitest": "^2.1.9",
49
- "@nuucognition/typescript-config": "0.0.0",
50
- "@nuucognition/eslint-config": "0.0.0"
48
+ "@nuucognition/eslint-config": "0.0.0",
49
+ "@nuucognition/typescript-config": "0.0.0"
51
50
  },
52
51
  "peerDependencies": {
53
52
  "react": "^18.0.0 || ^19.0.0",