@aseity/markup 0.0.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.
@@ -0,0 +1,492 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as react from 'react';
3
+ import react__default, { SVGProps, JSX, ComponentType, HTMLAttributes, ComponentProps } from 'react';
4
+ import { MermaidConfig } from 'mermaid';
5
+ import { RemendOptions } from 'remend';
6
+ import { Pluggable, PluggableList } from 'unified';
7
+ import { Element, Parents } from 'hast';
8
+ import { Options as Options$1 } from 'remark-rehype';
9
+ import { BundledTheme, ThemeRegistrationAny, BundledLanguage } from 'shiki';
10
+ export { BundledLanguage, BundledTheme, ThemeRegistrationAny } from 'shiki';
11
+
12
+ interface AnimatePlugin {
13
+ /**
14
+ * Returns the total HAST text node character count from the last
15
+ * rehype run, then resets to 0. Use this value as the argument to
16
+ * setPrevContentLength on the next render.
17
+ */
18
+ getLastRenderCharCount: () => number;
19
+ name: "animate";
20
+ rehypePlugin: Pluggable;
21
+ /**
22
+ * Set the number of HAST text characters from a previous render.
23
+ * Characters up to this count will get duration=0ms, preventing
24
+ * re-animation of already-visible content during streaming updates.
25
+ */
26
+ setPrevContentLength: (length: number) => void;
27
+ type: "animate";
28
+ }
29
+ interface AnimateOptions {
30
+ animation?: "fadeIn" | "blurIn" | "slideUp" | (string & {});
31
+ duration?: number;
32
+ easing?: string;
33
+ sep?: "word" | "char";
34
+ stagger?: number;
35
+ }
36
+ declare function createAnimatePlugin(options?: AnimateOptions): AnimatePlugin;
37
+
38
+ type IconComponent = React.ComponentType<SVGProps<SVGSVGElement> & {
39
+ size?: number;
40
+ }>;
41
+ interface IconMap {
42
+ CheckIcon: IconComponent;
43
+ CopyIcon: IconComponent;
44
+ DownloadIcon: IconComponent;
45
+ ExternalLinkIcon: IconComponent;
46
+ Loader2Icon: IconComponent;
47
+ Maximize2Icon: IconComponent;
48
+ RotateCcwIcon: IconComponent;
49
+ XIcon: IconComponent;
50
+ ZoomInIcon: IconComponent;
51
+ ZoomOutIcon: IconComponent;
52
+ }
53
+
54
+ interface ExtraProps {
55
+ node?: Element | undefined;
56
+ }
57
+ type AllowElement = (element: Readonly<Element>, index: number, parent: Readonly<Parents> | undefined) => boolean | null | undefined;
58
+ type UrlTransform = (url: string, key: string, node: Readonly<Element>) => string | null | undefined;
59
+ type Components = {
60
+ [Key in keyof JSX.IntrinsicElements]?: ComponentType<JSX.IntrinsicElements[Key] & ExtraProps> | keyof JSX.IntrinsicElements;
61
+ } & {
62
+ inlineCode?: ComponentType<JSX.IntrinsicElements["code"] & ExtraProps>;
63
+ [key: string]: ComponentType<Record<string, unknown> & ExtraProps> | keyof JSX.IntrinsicElements | undefined;
64
+ };
65
+ interface Options {
66
+ allowElement?: AllowElement;
67
+ allowedElements?: readonly string[];
68
+ children?: string;
69
+ components?: Components;
70
+ disallowedElements?: readonly string[];
71
+ rehypePlugins?: PluggableList;
72
+ remarkPlugins?: PluggableList;
73
+ remarkRehypeOptions?: Readonly<Options$1>;
74
+ skipHtml?: boolean;
75
+ unwrapDisallowed?: boolean;
76
+ urlTransform?: UrlTransform;
77
+ }
78
+ declare const defaultUrlTransform: UrlTransform;
79
+
80
+ type ThemeInput = BundledTheme | ThemeRegistrationAny;
81
+ /**
82
+ * A single token in a highlighted line
83
+ */
84
+ interface HighlightToken {
85
+ bgColor?: string;
86
+ color?: string;
87
+ content: string;
88
+ htmlAttrs?: Record<string, string>;
89
+ htmlStyle?: Record<string, string>;
90
+ offset?: number;
91
+ }
92
+ /**
93
+ * Result from code highlighting (compatible with shiki's TokensResult)
94
+ */
95
+ interface HighlightResult {
96
+ bg?: string;
97
+ fg?: string;
98
+ rootStyle?: string | false;
99
+ tokens: HighlightToken[][];
100
+ }
101
+ /**
102
+ * Options for highlighting code
103
+ */
104
+ interface HighlightOptions {
105
+ code: string;
106
+ language: BundledLanguage;
107
+ themes: [ThemeInput, ThemeInput];
108
+ }
109
+ /**
110
+ * Plugin for code syntax highlighting (Shiki)
111
+ */
112
+ interface CodeHighlighterPlugin {
113
+ /**
114
+ * Get list of supported languages
115
+ */
116
+ getSupportedLanguages: () => BundledLanguage[];
117
+ /**
118
+ * Get the configured themes
119
+ */
120
+ getThemes: () => [ThemeInput, ThemeInput];
121
+ /**
122
+ * Highlight code and return tokens
123
+ * Returns null if highlighting not ready yet (async loading)
124
+ * Use callback for async result
125
+ */
126
+ highlight: (options: HighlightOptions, callback?: (result: HighlightResult) => void) => HighlightResult | null;
127
+ name: "shiki";
128
+ /**
129
+ * Check if language is supported
130
+ */
131
+ supportsLanguage: (language: BundledLanguage) => boolean;
132
+ type: "code-highlighter";
133
+ }
134
+ /**
135
+ * Mermaid instance interface
136
+ */
137
+ interface MermaidInstance {
138
+ initialize: (config: MermaidConfig) => void;
139
+ render: (id: string, source: string) => Promise<{
140
+ svg: string;
141
+ }>;
142
+ }
143
+ /**
144
+ * Plugin for diagram rendering (Mermaid)
145
+ */
146
+ interface DiagramPlugin {
147
+ /**
148
+ * Get the mermaid instance (initialized with optional config)
149
+ */
150
+ getMermaid: (config?: MermaidConfig) => MermaidInstance;
151
+ /**
152
+ * Language identifier for code blocks
153
+ */
154
+ language: string;
155
+ name: "mermaid";
156
+ type: "diagram";
157
+ }
158
+ /**
159
+ * Plugin for math rendering (KaTeX)
160
+ */
161
+ interface MathPlugin {
162
+ /**
163
+ * Get CSS styles for math rendering (injected into head)
164
+ */
165
+ getStyles?: () => string;
166
+ name: "katex";
167
+ /**
168
+ * Get rehype plugin for rendering math
169
+ */
170
+ rehypePlugin: Pluggable;
171
+ /**
172
+ * Get remark plugin for parsing math syntax
173
+ */
174
+ remarkPlugin: Pluggable;
175
+ type: "math";
176
+ }
177
+ /**
178
+ * Plugin for CJK text handling
179
+ */
180
+ interface CjkPlugin {
181
+ name: "cjk";
182
+ /**
183
+ * @deprecated Use remarkPluginsBefore and remarkPluginsAfter instead
184
+ * All remark plugins (for backwards compatibility)
185
+ */
186
+ remarkPlugins: Pluggable[];
187
+ /**
188
+ * Remark plugins that must run AFTER remarkGfm
189
+ * (e.g., autolink boundary splitting, strikethrough enhancements)
190
+ */
191
+ remarkPluginsAfter: Pluggable[];
192
+ /**
193
+ * Remark plugins that must run BEFORE remarkGfm
194
+ * (e.g., remark-cjk-friendly which modifies emphasis handling)
195
+ */
196
+ remarkPluginsBefore: Pluggable[];
197
+ type: "cjk";
198
+ }
199
+ interface CustomRendererProps {
200
+ code: string;
201
+ isIncomplete: boolean;
202
+ language: string;
203
+ /** Raw metastring from the code fence (everything after the language identifier).
204
+ * e.g. ```rust {1} title="foo" → meta = '{1} title="foo"'
205
+ * Undefined when no metastring is present. */
206
+ meta?: string;
207
+ }
208
+ interface CustomRenderer {
209
+ component: react__default.ComponentType<CustomRendererProps>;
210
+ language: string | string[];
211
+ }
212
+ /**
213
+ * Plugin configuration passed to Streamdown
214
+ */
215
+ interface PluginConfig {
216
+ cjk?: CjkPlugin;
217
+ code?: CodeHighlighterPlugin;
218
+ math?: MathPlugin;
219
+ mermaid?: DiagramPlugin;
220
+ renderers?: CustomRenderer[];
221
+ }
222
+
223
+ interface StreamdownTranslations {
224
+ close: string;
225
+ copied: string;
226
+ copyCode: string;
227
+ copyLink: string;
228
+ copyTable: string;
229
+ copyTableAsCsv: string;
230
+ copyTableAsMarkdown: string;
231
+ copyTableAsTsv: string;
232
+ downloadDiagram: string;
233
+ downloadDiagramAsMmd: string;
234
+ downloadDiagramAsPng: string;
235
+ downloadDiagramAsSvg: string;
236
+ downloadFile: string;
237
+ downloadImage: string;
238
+ downloadTable: string;
239
+ downloadTableAsCsv: string;
240
+ downloadTableAsMarkdown: string;
241
+ exitFullscreen: string;
242
+ externalLinkWarning: string;
243
+ imageNotAvailable: string;
244
+ mermaidFormatMmd: string;
245
+ mermaidFormatPng: string;
246
+ mermaidFormatSvg: string;
247
+ openExternalLink: string;
248
+ openLink: string;
249
+ tableFormatCsv: string;
250
+ tableFormatMarkdown: string;
251
+ tableFormatTsv: string;
252
+ viewFullscreen: string;
253
+ }
254
+ declare const defaultTranslations: StreamdownTranslations;
255
+
256
+ /**
257
+ * Hook to check if the current block has an incomplete (unclosed) code fence.
258
+ *
259
+ * Returns `true` when the code fence in this block is still being streamed.
260
+ * Useful for deferring expensive renders (syntax highlighting, Mermaid diagrams)
261
+ * until the code block is complete.
262
+ */
263
+ declare const useIsCodeFenceIncomplete: () => boolean;
264
+
265
+ type CodeBlockProps = HTMLAttributes<HTMLDivElement> & {
266
+ code: string;
267
+ language: string;
268
+ /** Whether the code block is still being streamed (incomplete) */
269
+ isIncomplete?: boolean;
270
+ /** Custom starting line number for line numbering (default: 1) */
271
+ startLine?: number;
272
+ /** Show line numbers in code blocks. @default true */
273
+ lineNumbers?: boolean;
274
+ };
275
+ declare const CodeBlock: ({ code, language, className, children, isIncomplete, startLine, lineNumbers, ...rest }: CodeBlockProps) => react_jsx_runtime.JSX.Element;
276
+
277
+ type CodeBlockContainerProps = ComponentProps<"div"> & {
278
+ language: string;
279
+ /** Whether the code block is still being streamed (incomplete) */
280
+ isIncomplete?: boolean;
281
+ };
282
+ declare const CodeBlockContainer: ({ className, language, style, isIncomplete, ...props }: CodeBlockContainerProps) => react_jsx_runtime.JSX.Element;
283
+
284
+ type CodeBlockCopyButtonProps = ComponentProps<"button"> & {
285
+ onCopy?: () => void;
286
+ onError?: (error: Error) => void;
287
+ timeout?: number;
288
+ };
289
+ declare const CodeBlockCopyButton: ({ onCopy, onError, timeout, children, className, code: propCode, ...props }: CodeBlockCopyButtonProps & {
290
+ code?: string;
291
+ }) => react_jsx_runtime.JSX.Element;
292
+
293
+ type CodeBlockDownloadButtonProps = ComponentProps<"button"> & {
294
+ onDownload?: () => void;
295
+ onError?: (error: Error) => void;
296
+ };
297
+ declare const CodeBlockDownloadButton: ({ onDownload, onError, language, children, className, code: propCode, ...props }: CodeBlockDownloadButtonProps & {
298
+ code?: string;
299
+ language?: string;
300
+ }) => react_jsx_runtime.JSX.Element;
301
+
302
+ interface CodeBlockHeaderProps {
303
+ language: string;
304
+ }
305
+ declare const CodeBlockHeader: ({ language }: CodeBlockHeaderProps) => react_jsx_runtime.JSX.Element;
306
+
307
+ declare const CodeBlockSkeleton: () => react_jsx_runtime.JSX.Element;
308
+
309
+ /**
310
+ * Detect text direction using the "first strong character" algorithm.
311
+ * Strips common markdown syntax then finds the first Unicode letter
312
+ * with strong directionality.
313
+ *
314
+ * Note: markdown stripping is best-effort — nested formatting,
315
+ * multi-line fenced code blocks, and raw HTML are not fully handled.
316
+ * This is acceptable since the algorithm only needs to reach the first
317
+ * strong character, which is almost always in plain prose.
318
+ *
319
+ * @returns "rtl" if first strong char is RTL, "ltr" otherwise
320
+ */
321
+ declare function detectTextDirection(text: string): "ltr" | "rtl";
322
+
323
+ declare const parseMarkdownIntoBlocks: (markdown: string) => string[];
324
+
325
+ interface TableCopyDropdownProps {
326
+ children?: React.ReactNode;
327
+ className?: string;
328
+ onCopy?: (format: "csv" | "tsv" | "md") => void;
329
+ onError?: (error: Error) => void;
330
+ timeout?: number;
331
+ }
332
+ declare const TableCopyDropdown: ({ children, className, onCopy, onError, timeout, }: TableCopyDropdownProps) => react_jsx_runtime.JSX.Element;
333
+
334
+ interface TableDownloadButtonProps {
335
+ children?: React.ReactNode;
336
+ className?: string;
337
+ filename?: string;
338
+ format?: "csv" | "markdown";
339
+ onDownload?: () => void;
340
+ onError?: (error: Error) => void;
341
+ }
342
+ declare const TableDownloadButton: ({ children, className, onDownload, onError, format, filename, }: TableDownloadButtonProps) => react_jsx_runtime.JSX.Element;
343
+ interface TableDownloadDropdownProps {
344
+ children?: React.ReactNode;
345
+ className?: string;
346
+ onDownload?: (format: "csv" | "markdown") => void;
347
+ onError?: (error: Error) => void;
348
+ }
349
+ declare const TableDownloadDropdown: ({ children, className, onDownload, onError, }: TableDownloadDropdownProps) => react_jsx_runtime.JSX.Element;
350
+
351
+ interface TableData {
352
+ headers: string[];
353
+ rows: string[][];
354
+ }
355
+ declare const extractTableDataFromElement: (tableElement: HTMLElement) => TableData;
356
+ declare const tableDataToCSV: (data: TableData) => string;
357
+ declare const tableDataToTSV: (data: TableData) => string;
358
+ declare const escapeMarkdownTableCell: (cell: string) => string;
359
+ declare const tableDataToMarkdown: (data: TableData) => string;
360
+
361
+ /**
362
+ * Normalizes indentation in HTML blocks to prevent Markdown parsers from
363
+ * treating indented HTML tags as code blocks (4+ spaces = code in Markdown).
364
+ *
365
+ * Useful when rendering AI-generated HTML content with nested tags that
366
+ * are indented for readability.
367
+ *
368
+ * @param content - The raw HTML/Markdown string to normalize
369
+ * @returns The normalized string with reduced indentation before HTML tags
370
+ */
371
+ declare const normalizeHtmlIndentation: (content: string) => string;
372
+ type ControlsConfig = boolean | {
373
+ table?: boolean | {
374
+ copy?: boolean;
375
+ download?: boolean;
376
+ fullscreen?: boolean;
377
+ };
378
+ code?: boolean | {
379
+ copy?: boolean;
380
+ download?: boolean;
381
+ };
382
+ mermaid?: boolean | {
383
+ download?: boolean;
384
+ copy?: boolean;
385
+ fullscreen?: boolean;
386
+ panZoom?: boolean;
387
+ };
388
+ };
389
+ interface LinkSafetyModalProps {
390
+ isOpen: boolean;
391
+ onClose: () => void;
392
+ onConfirm: () => void;
393
+ url: string;
394
+ }
395
+ interface LinkSafetyConfig {
396
+ enabled: boolean;
397
+ onLinkCheck?: (url: string) => Promise<boolean> | boolean;
398
+ renderModal?: (props: LinkSafetyModalProps) => React.ReactNode;
399
+ }
400
+ interface MermaidErrorComponentProps {
401
+ chart: string;
402
+ error: string;
403
+ retry: () => void;
404
+ }
405
+ interface MermaidOptions {
406
+ config?: MermaidConfig;
407
+ errorComponent?: React.ComponentType<MermaidErrorComponentProps>;
408
+ }
409
+ type AllowedTags = Record<string, string[]>;
410
+ type StreamdownProps = Options & {
411
+ mode?: "static" | "streaming";
412
+ /** Text direction for blocks. "auto" detects per-block using first strong character algorithm. */
413
+ dir?: "auto" | "ltr" | "rtl";
414
+ BlockComponent?: React.ComponentType<BlockProps>;
415
+ parseMarkdownIntoBlocksFn?: (markdown: string) => string[];
416
+ parseIncompleteMarkdown?: boolean;
417
+ /** Normalize HTML block indentation to prevent 4+ spaces being treated as code blocks. @default false */
418
+ normalizeHtmlIndentation?: boolean;
419
+ className?: string;
420
+ shikiTheme?: [ThemeInput, ThemeInput];
421
+ mermaid?: MermaidOptions;
422
+ controls?: ControlsConfig;
423
+ isAnimating?: boolean;
424
+ animated?: boolean | AnimateOptions;
425
+ caret?: keyof typeof carets;
426
+ plugins?: PluginConfig;
427
+ remend?: RemendOptions;
428
+ linkSafety?: LinkSafetyConfig;
429
+ /** Custom tags to allow through sanitization with their permitted attributes */
430
+ allowedTags?: AllowedTags;
431
+ /**
432
+ * Tags whose children should be treated as plain text (no markdown parsing).
433
+ * Useful for mention/entity tags in AI UIs where child content is a data
434
+ * label rather than prose. Requires the tag to also be listed in `allowedTags`.
435
+ *
436
+ * @example
437
+ * ```tsx
438
+ * <Streamdown
439
+ * allowedTags={{ mention: ['user_id'] }}
440
+ * literalTagContent={['mention']}
441
+ * >
442
+ * {`<mention user_id="123">@_some_username_</mention>`}
443
+ * </Streamdown>
444
+ * ```
445
+ */
446
+ literalTagContent?: string[];
447
+ /** Override UI strings for i18n / custom labels */
448
+ translations?: Partial<StreamdownTranslations>;
449
+ /** Custom icons to override the default icons used in controls */
450
+ icons?: Partial<IconMap>;
451
+ /** Tailwind CSS prefix to prepend to all utility classes (e.g. `"tw"` produces `tw:flex` instead of `flex`). Enables Tailwind v4's `prefix()` support. Note: user-supplied `className` values are also prefixed. */
452
+ prefix?: string;
453
+ /** Show line numbers in code blocks. @default true */
454
+ lineNumbers?: boolean;
455
+ /** Called when isAnimating transitions from false to true. Suppressed in mode="static". */
456
+ onAnimationStart?: () => void;
457
+ /** Called when isAnimating transitions from true to false. Suppressed in mode="static". */
458
+ onAnimationEnd?: () => void;
459
+ };
460
+ declare const defaultRehypePlugins: Record<string, Pluggable>;
461
+ declare const defaultRemarkPlugins: Record<string, Pluggable>;
462
+ declare const carets: {
463
+ block: string;
464
+ circle: string;
465
+ };
466
+ interface StreamdownContextType {
467
+ controls: ControlsConfig;
468
+ isAnimating: boolean;
469
+ /** Show line numbers in code blocks. @default true */
470
+ lineNumbers: boolean;
471
+ linkSafety?: LinkSafetyConfig;
472
+ mermaid?: MermaidOptions;
473
+ mode: "static" | "streaming";
474
+ shikiTheme: [ThemeInput, ThemeInput];
475
+ }
476
+ declare const StreamdownContext: react.Context<StreamdownContextType>;
477
+ type BlockProps = Options & {
478
+ content: string;
479
+ shouldParseIncompleteMarkdown: boolean;
480
+ shouldNormalizeHtmlIndentation: boolean;
481
+ index: number;
482
+ /** Whether this block is incomplete (still being streamed) */
483
+ isIncomplete: boolean;
484
+ /** Resolved text direction for this block */
485
+ dir?: "ltr" | "rtl";
486
+ /** Animate plugin instance for tracking previous content length */
487
+ animatePlugin?: AnimatePlugin | null;
488
+ };
489
+ declare const Block: react.MemoExoticComponent<({ content, shouldParseIncompleteMarkdown: _, shouldNormalizeHtmlIndentation, index: __, isIncomplete, dir, animatePlugin: animatePluginProp, ...props }: BlockProps) => react_jsx_runtime.JSX.Element>;
490
+ declare const Markup: react.MemoExoticComponent<({ children, mode, dir, parseIncompleteMarkdown: shouldParseIncompleteMarkdown, normalizeHtmlIndentation: shouldNormalizeHtmlIndentation, components, rehypePlugins, remarkPlugins, className, shikiTheme, mermaid, controls, isAnimating, animated, BlockComponent, parseMarkdownIntoBlocksFn, caret, plugins, remend: remendOptions, linkSafety, lineNumbers, allowedTags, literalTagContent, translations, icons: iconOverrides, prefix, onAnimationStart, onAnimationEnd, ...props }: StreamdownProps) => react_jsx_runtime.JSX.Element>;
491
+
492
+ export { type AllowElement, type AllowedTags, type AnimateOptions, Block, type BlockProps, type CjkPlugin, CodeBlock, CodeBlockContainer, CodeBlockCopyButton, CodeBlockDownloadButton, CodeBlockHeader, CodeBlockSkeleton, type CodeHighlighterPlugin, type Components, type ControlsConfig, type CustomRenderer, type CustomRendererProps, type DiagramPlugin, type ExtraProps, type HighlightOptions, type IconMap, type LinkSafetyConfig, type LinkSafetyModalProps, Markup, type MathPlugin, type MermaidErrorComponentProps, type MermaidOptions, type PluginConfig, StreamdownContext, type StreamdownContextType, type StreamdownProps, type StreamdownTranslations, TableCopyDropdown, type TableCopyDropdownProps, type TableData, TableDownloadButton, type TableDownloadButtonProps, TableDownloadDropdown, type TableDownloadDropdownProps, type ThemeInput, type UrlTransform, createAnimatePlugin, defaultRehypePlugins, defaultRemarkPlugins, defaultTranslations, defaultUrlTransform, detectTextDirection, escapeMarkdownTableCell, extractTableDataFromElement, normalizeHtmlIndentation, parseMarkdownIntoBlocks, tableDataToCSV, tableDataToMarkdown, tableDataToTSV, useIsCodeFenceIncomplete };
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export{B as Block,g as CodeBlock,d as CodeBlockContainer,i as CodeBlockCopyButton,j as CodeBlockDownloadButton,e as CodeBlockHeader,k as CodeBlockSkeleton,C as Markup,A as StreamdownContext,r as TableCopyDropdown,s as TableDownloadButton,t as TableDownloadDropdown,a as createAnimatePlugin,y as defaultRehypePlugins,z as defaultRemarkPlugins,h as defaultTranslations,v as defaultUrlTransform,u as detectTextDirection,p as escapeMarkdownTableCell,m as extractTableDataFromElement,x as normalizeHtmlIndentation,w as parseMarkdownIntoBlocks,n as tableDataToCSV,q as tableDataToMarkdown,o as tableDataToTSV,b as useIsCodeFenceIncomplete}from'./chunk-4FHCAHL6.js';
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export{l as Mermaid}from'./chunk-SNWYG344.js';
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export{l as Mermaid}from'./chunk-BO2N2NFS.js';
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export{l as Mermaid}from'./chunk-F5GST4HF.js';
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export{l as Mermaid}from'./chunk-4FHCAHL6.js';
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export{l as Mermaid}from'./chunk-ZDVVXL46.js';
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@aseity/markup",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./styles.css": "./styles.css"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "styles.css",
18
+ "README.md"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsup",
22
+ "postbuild": "node scripts/postbuild.js",
23
+ "test": "vitest run",
24
+ "test:ui": "vitest --ui run",
25
+ "test:coverage": "vitest --coverage run",
26
+ "bench": "vitest bench --run > results.txt",
27
+ "bench:ui": "vitest bench --ui --run",
28
+ "size": "node scripts/bundle-size.js"
29
+ },
30
+ "devDependencies": {
31
+ "@streamdown/cjk": "workspace:*",
32
+ "@streamdown/math": "workspace:*",
33
+ "@streamdown/mermaid": "workspace:*",
34
+ "@testing-library/jest-dom": "^6.9.1",
35
+ "@testing-library/react": "^16.3.0",
36
+ "@types/hast": "^3.0.4",
37
+ "@types/react": "^19.2.7",
38
+ "@types/react-dom": "^19.2.3",
39
+ "react-dom": "^19.2.3",
40
+ "@vitejs/plugin-react": "^5.1.2",
41
+ "@vitest/coverage-v8": "^4.0.15",
42
+ "jsdom": "^27.3.0",
43
+ "react-markdown": "^10.1.0",
44
+ "rehype-parse": "^9.0.1",
45
+ "rehype-stringify": "^10.0.1",
46
+ "shiki": "^3.19.0",
47
+ "tsup": "^8.5.1",
48
+ "vitest": "^4.0.15"
49
+ },
50
+ "peerDependencies": {
51
+ "react": "^18.0.0 || ^19.0.0",
52
+ "react-dom": "^18.0.0 || ^19.0.0"
53
+ },
54
+ "dependencies": {
55
+ "clsx": "^2.1.1",
56
+ "hast-util-to-jsx-runtime": "^2.3.6",
57
+ "html-url-attributes": "^3.0.1",
58
+ "marked": "^17.0.1",
59
+ "rehype-harden": "^1.1.8",
60
+ "rehype-raw": "^7.0.0",
61
+ "rehype-sanitize": "^6.0.0",
62
+ "remark-gfm": "^4.0.1",
63
+ "remark-parse": "^11.0.0",
64
+ "remark-rehype": "^11.1.2",
65
+ "remend": "workspace:*",
66
+ "tailwind-merge": "^3.4.0",
67
+ "unified": "^11.0.5",
68
+ "mermaid": "^11.12.2",
69
+ "unist-util-visit": "^5.0.0",
70
+ "unist-util-visit-parents": "^6.0.0"
71
+ }
72
+ }
package/styles.css ADDED
@@ -0,0 +1,35 @@
1
+ @keyframes sd-fadeIn {
2
+ from {
3
+ opacity: 0;
4
+ }
5
+ to {
6
+ opacity: 1;
7
+ }
8
+ }
9
+
10
+ @keyframes sd-blurIn {
11
+ from {
12
+ opacity: 0;
13
+ filter: blur(4px);
14
+ }
15
+ to {
16
+ opacity: 1;
17
+ filter: blur(0);
18
+ }
19
+ }
20
+
21
+ @keyframes sd-slideUp {
22
+ from {
23
+ opacity: 0;
24
+ transform: translateY(4px);
25
+ }
26
+ to {
27
+ opacity: 1;
28
+ transform: translateY(0);
29
+ }
30
+ }
31
+
32
+ [data-sd-animate] {
33
+ animation: var(--sd-animation, sd-fadeIn) var(--sd-duration, 150ms)
34
+ var(--sd-easing, ease) var(--sd-delay, 0ms) both;
35
+ }