@ai-matrx/rich-content 0.2.49 → 0.2.51

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.51
4
+
5
+ - A list holding a checklist item keeps its bullets and indent: remark-gfm's `contains-task-list` class is merged into the list's own classes instead of replacing them (prose renderer and the configurable chat renderer). Checklist items show only their checkbox (`list-none`). Live: notes Split showed `- item a` beside `- [ ] todo` as plain lines.
6
+
7
+ Consumer action: none.
8
+
9
+ ## 0.2.50
10
+
11
+ - `utils/client-lazy` re-exports `@ai-matrx/kit/client-lazy` (`clientLazy`, `useIsClient`) — one home
12
+ for the host-neutral lazy loader; chat's identical copy points there too (architecture step 3).
13
+
14
+ Consumer action: none. Needs `@ai-matrx/kit` ≥ 0.38.0.
15
+
3
16
  ## 0.2.49
4
17
 
5
18
  - The code block's HTML "Preview" button opens the `html` canvas kind with the source
@@ -364,7 +364,7 @@ const ConfigurableMarkdownContentBody = ({
364
364
  );
365
365
  }),
366
366
  // ---- ul ----
367
- ul: componentOverrides?.ul ?? (({ node, children, ...props }) => {
367
+ ul: componentOverrides?.ul ?? (({ node, children, className, ...props }) => {
368
368
  const listText = extractText(children);
369
369
  const listDirection = detectTextDirection(listText);
370
370
  return /* @__PURE__ */ jsx(
@@ -377,7 +377,9 @@ const ConfigurableMarkdownContentBody = ({
377
377
  typography.leading,
378
378
  getFontSize(listDirection),
379
379
  spacing.listPl,
380
- getDirectionClasses(listDirection)
380
+ getDirectionClasses(listDirection),
381
+ // remark-gfm's `contains-task-list`: merged, never spread over ours.
382
+ className
381
383
  ),
382
384
  dir: listDirection,
383
385
  ...props,
@@ -386,7 +388,7 @@ const ConfigurableMarkdownContentBody = ({
386
388
  );
387
389
  }),
388
390
  // ---- ol ----
389
- ol: componentOverrides?.ol ?? (({ node, children, ...props }) => {
391
+ ol: componentOverrides?.ol ?? (({ node, children, className, ...props }) => {
390
392
  const listText = extractText(children);
391
393
  const listDirection = detectTextDirection(listText);
392
394
  return /* @__PURE__ */ jsx(
@@ -399,7 +401,9 @@ const ConfigurableMarkdownContentBody = ({
399
401
  typography.leading,
400
402
  getFontSize(listDirection),
401
403
  spacing.listPl,
402
- getDirectionClasses(listDirection)
404
+ getDirectionClasses(listDirection),
405
+ // remark-gfm's `contains-task-list`: merged, never spread over ours.
406
+ className
403
407
  ),
404
408
  dir: listDirection,
405
409
  ...props,
@@ -419,7 +423,7 @@ const ConfigurableMarkdownContentBody = ({
419
423
  {
420
424
  className: cn(
421
425
  spacing.listItemMb,
422
- "flex items-center",
426
+ "flex items-center list-none",
423
427
  getFontSize(itemDirection),
424
428
  getDirectionClasses(itemDirection)
425
429
  ),
@@ -20,7 +20,7 @@ const ListItemComponent = ({ children, node, id, value }) => {
20
20
  {
21
21
  id,
22
22
  value,
23
- className: `mb-1 ${getDirectionFontSize(itemDirection)} ${getDirectionClasses(itemDirection)}`,
23
+ className: `task-list-item mb-1 list-none ${getDirectionFontSize(itemDirection)} ${getDirectionClasses(itemDirection)}`,
24
24
  dir: itemDirection,
25
25
  children
26
26
  }
@@ -113,26 +113,29 @@ const PROSE_BLOCK_ELEMENTS = {
113
113
  }
114
114
  );
115
115
  },
116
- ul: ({ node, children, ...props }) => {
116
+ // remark-gfm marks a list holding a checklist item `contains-task-list` — MERGED into our
117
+ // classes, never spread over them (it used to replace them: a list mixing bullets and
118
+ // tasks lost its bullets and indent, notes Split 2026-10-07).
119
+ ul: ({ node, children, className, ...props }) => {
117
120
  const listText = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
118
121
  const listDirection = detectTextDirection(listText);
119
122
  return /* @__PURE__ */ jsx(
120
123
  "ul",
121
124
  {
122
- className: `matrx-md-ul mb-3 leading-relaxed ${getDirectionFontSize(listDirection)} pl-6 ${getDirectionClasses(listDirection)}`,
125
+ className: `matrx-md-ul mb-3 leading-relaxed ${getDirectionFontSize(listDirection)} pl-6 ${getDirectionClasses(listDirection)}${className ? ` ${className}` : ""}`,
123
126
  dir: listDirection,
124
127
  ...props,
125
128
  children
126
129
  }
127
130
  );
128
131
  },
129
- ol: ({ node, children, ...props }) => {
132
+ ol: ({ node, children, className, ...props }) => {
130
133
  const listText = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
131
134
  const listDirection = detectTextDirection(listText);
132
135
  return /* @__PURE__ */ jsx(
133
136
  "ol",
134
137
  {
135
- className: `matrx-md-ol mb-3 leading-relaxed ${getDirectionFontSize(listDirection)} pl-6 ${getDirectionClasses(listDirection)}`,
138
+ className: `matrx-md-ol mb-3 leading-relaxed ${getDirectionFontSize(listDirection)} pl-6 ${getDirectionClasses(listDirection)}${className ? ` ${className}` : ""}`,
136
139
  dir: listDirection,
137
140
  ...props,
138
141
  children
@@ -1,13 +1 @@
1
- /**
2
- * `clientLazy` — the package's replacement for `next/dynamic(..., { ssr: false })`: a lazily
3
- * loaded component that renders only on the client. On the server and during hydration it
4
- * renders `loading` (hydration-safe through `useSyncExternalStore`); on the client it renders
5
- * the loaded component inside a Suspense boundary with the same `loading` as the fallback.
6
- */
7
- import { type ComponentType } from "react";
8
- export declare function useIsClient(): boolean;
9
- export declare function clientLazy<P extends object>(load: () => Promise<{
10
- default: ComponentType<P>;
11
- } | ComponentType<P>>, options?: {
12
- loading?: ComponentType;
13
- }): ComponentType<P>;
1
+ export { clientLazy, useIsClient } from "@ai-matrx/kit/client-lazy";
@@ -1,26 +1,5 @@
1
1
  "use client";
2
- import { createElement, lazy, Suspense, useSyncExternalStore } from "react";
3
- const subscribe = () => () => {
4
- };
5
- const onClient = () => true;
6
- const onServer = () => false;
7
- function useIsClient() {
8
- return useSyncExternalStore(subscribe, onClient, onServer);
9
- }
10
- function clientLazy(load, options = {}) {
11
- const Lazy = lazy(async () => {
12
- const m = await load();
13
- return typeof m === "function" || !("default" in m) ? { default: m } : m;
14
- });
15
- const Loading = options.loading;
16
- function ClientLazy(props) {
17
- const client = useIsClient();
18
- const fallback = Loading ? createElement(Loading) : null;
19
- if (!client) return fallback;
20
- return createElement(Suspense, { fallback }, createElement(Lazy, props));
21
- }
22
- return ClientLazy;
23
- }
2
+ import { clientLazy, useIsClient } from "@ai-matrx/kit/client-lazy";
24
3
  export {
25
4
  clientLazy,
26
5
  useIsClient
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/rich-content",
3
- "version": "0.2.49",
3
+ "version": "0.2.51",
4
4
  "description": "The AI Matrx formatted-text engine: the one markdown renderer, streaming markdown, the block splitter and renderer, the generic blocks, <RichContent> levels, the rich-document action registry and menus, copy, and the selection toolbar — as portable React.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -136,15 +136,15 @@
136
136
  "@ai-matrx/content-ir": "latest",
137
137
  "@ai-matrx/content-ir-react": "latest",
138
138
  "@ai-matrx/data": "latest",
139
- "@ai-matrx/design-system": "latest",
140
139
  "@ai-matrx/diff": "latest",
140
+ "@ai-matrx/design-system": "latest",
141
+ "@ai-matrx/kit": "latest",
141
142
  "@ai-matrx/icons": "latest",
142
143
  "@ai-matrx/media": "latest",
143
144
  "@ai-matrx/print": "latest",
144
145
  "@ai-matrx/records": "latest",
145
146
  "@ai-matrx/records-ui": "latest",
146
- "@ai-matrx/tap-target": "latest",
147
- "@ai-matrx/kit": "latest"
147
+ "@ai-matrx/tap-target": "latest"
148
148
  },
149
149
  "peerDependencies": {
150
150
  "react": ">=19.0.0",