@jacshuo/onyx 2.3.0 → 2.4.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.
@@ -3008,6 +3008,15 @@ export { ratingVariants as ratingVariants_alias_2 }
3008
3008
 
3009
3009
  declare function removeAlert(id: string): void;
3010
3010
 
3011
+ /**
3012
+ * Parse Markdown to sanitised HTML, safe for use with `dangerouslySetInnerHTML`.
3013
+ *
3014
+ * - Uses a local `Marked` instance (does not touch the global singleton).
3015
+ * - Images are wrapped in a `<figure>` with a hidden error-state overlay.
3016
+ * - The output is sanitised with a lightweight allowlist approach.
3017
+ */
3018
+ export declare function renderMarkdown(text: string): string;
3019
+
3011
3020
  export declare const ResizableImage: Node_2<ImageOptions, any>;
3012
3021
 
3013
3022
  export declare const ResizableVideo: Node_2<any, any>;
@@ -4270,7 +4279,7 @@ declare type TreeProps = React_2.HTMLAttributes<HTMLUListElement> & {
4270
4279
  * - Waiting (stream mode, `streaming=true`): blinking cursor after catching up.
4271
4280
  * - Done: cursor fades out.
4272
4281
  */
4273
- declare function TypewriterText({ text, mode, speed, cursor, cursorChar, thinking, streaming, delay, onComplete, as: Tag, className, }: TypewriterTextProps): JSX.Element;
4282
+ declare function TypewriterText({ text, mode, speed, cursor, cursorChar, thinking, streaming, delay, onComplete, as: Tag, className, rich, }: TypewriterTextProps): JSX.Element;
4274
4283
  export { TypewriterText }
4275
4284
  export { TypewriterText as TypewriterText_alias_1 }
4276
4285
  export { TypewriterText as TypewriterText_alias_2 }
@@ -4311,6 +4320,14 @@ declare interface TypewriterTextProps {
4311
4320
  /** HTML element to render as. @default "span" */
4312
4321
  as?: "span" | "div" | "p" | "pre" | "code" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "label" | "li";
4313
4322
  className?: string;
4323
+ /**
4324
+ * Enable Markdown / HTML rendering.
4325
+ * When `true`, the animated text is parsed as Markdown and rendered as HTML.
4326
+ * Images are displayed as `<img>` blocks with a fade-in animation.
4327
+ * The wrapper element is always `<div role="region">`, regardless of the `as` prop.
4328
+ * @default false
4329
+ */
4330
+ rich?: boolean;
4314
4331
  }
4315
4332
  export { TypewriterTextProps }
4316
4333
  export { TypewriterTextProps as TypewriterTextProps_alias_1 }
@@ -3008,6 +3008,15 @@ export { ratingVariants as ratingVariants_alias_2 }
3008
3008
 
3009
3009
  declare function removeAlert(id: string): void;
3010
3010
 
3011
+ /**
3012
+ * Parse Markdown to sanitised HTML, safe for use with `dangerouslySetInnerHTML`.
3013
+ *
3014
+ * - Uses a local `Marked` instance (does not touch the global singleton).
3015
+ * - Images are wrapped in a `<figure>` with a hidden error-state overlay.
3016
+ * - The output is sanitised with a lightweight allowlist approach.
3017
+ */
3018
+ export declare function renderMarkdown(text: string): string;
3019
+
3011
3020
  export declare const ResizableImage: Node_2<ImageOptions, any>;
3012
3021
 
3013
3022
  export declare const ResizableVideo: Node_2<any, any>;
@@ -4270,7 +4279,7 @@ declare type TreeProps = React_2.HTMLAttributes<HTMLUListElement> & {
4270
4279
  * - Waiting (stream mode, `streaming=true`): blinking cursor after catching up.
4271
4280
  * - Done: cursor fades out.
4272
4281
  */
4273
- declare function TypewriterText({ text, mode, speed, cursor, cursorChar, thinking, streaming, delay, onComplete, as: Tag, className, }: TypewriterTextProps): JSX.Element;
4282
+ declare function TypewriterText({ text, mode, speed, cursor, cursorChar, thinking, streaming, delay, onComplete, as: Tag, className, rich, }: TypewriterTextProps): JSX.Element;
4274
4283
  export { TypewriterText }
4275
4284
  export { TypewriterText as TypewriterText_alias_1 }
4276
4285
  export { TypewriterText as TypewriterText_alias_2 }
@@ -4311,6 +4320,14 @@ declare interface TypewriterTextProps {
4311
4320
  /** HTML element to render as. @default "span" */
4312
4321
  as?: "span" | "div" | "p" | "pre" | "code" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "label" | "li";
4313
4322
  className?: string;
4323
+ /**
4324
+ * Enable Markdown / HTML rendering.
4325
+ * When `true`, the animated text is parsed as Markdown and rendered as HTML.
4326
+ * Images are displayed as `<img>` blocks with a fade-in animation.
4327
+ * The wrapper element is always `<div role="region">`, regardless of the `as` prop.
4328
+ * @default false
4329
+ */
4330
+ rich?: boolean;
4314
4331
  }
4315
4332
  export { TypewriterTextProps }
4316
4333
  export { TypewriterTextProps as TypewriterTextProps_alias_1 }