@illuma-ai/codeviz 1.0.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.
- package/dist/CodeViz.d.ts +17 -0
- package/dist/CodeViz.d.ts.map +1 -0
- package/dist/EditorPane.d.ts +25 -0
- package/dist/EditorPane.d.ts.map +1 -0
- package/dist/Loader.d.ts +11 -0
- package/dist/Loader.d.ts.map +1 -0
- package/dist/PreviewPane.d.ts +27 -0
- package/dist/PreviewPane.d.ts.map +1 -0
- package/dist/StatusBar.d.ts +16 -0
- package/dist/StatusBar.d.ts.map +1 -0
- package/dist/Toolbar.d.ts +28 -0
- package/dist/Toolbar.d.ts.map +1 -0
- package/dist/agentContext.d.ts +71 -0
- package/dist/agentContext.d.ts.map +1 -0
- package/dist/importMap.d.ts +27 -0
- package/dist/importMap.d.ts.map +1 -0
- package/dist/index.cjs +1699 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20791 -0
- package/dist/index.js.map +1 -0
- package/dist/previewTemplate.d.ts +19 -0
- package/dist/previewTemplate.d.ts.map +1 -0
- package/dist/templates.d.ts +36 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/transpiler.d.ts +25 -0
- package/dist/transpiler.d.ts.map +1 -0
- package/dist/types.d.ts +170 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ImportMap, PreviewTemplate } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Generate the srcdoc HTML for the preview iframe.
|
|
5
|
+
*
|
|
6
|
+
* For React templates: sets up import map, injects transpiled code as a module,
|
|
7
|
+
* mounts the default export into #root.
|
|
8
|
+
*
|
|
9
|
+
* For HTML templates: renders raw HTML directly.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildPreviewHtml(options: {
|
|
12
|
+
transpiledCode: string;
|
|
13
|
+
template: PreviewTemplate;
|
|
14
|
+
importMap: ImportMap;
|
|
15
|
+
tailwindCdn?: string | false;
|
|
16
|
+
externalResources?: string[];
|
|
17
|
+
extraFiles?: Record<string, string>;
|
|
18
|
+
}): string;
|
|
19
|
+
//# sourceMappingURL=previewTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"previewTemplate.d.ts","sourceRoot":"","sources":["../src/previewTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAK1D;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC,GAAG,MAAM,CA6CT"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pre-built starter templates for Ranger's LLM agent.
|
|
3
|
+
*
|
|
4
|
+
* KEY DESIGN: Every template includes the FULL dependency preamble (even unused
|
|
5
|
+
* imports). This means the agent NEVER hits missing-dep errors — it just
|
|
6
|
+
* uses whatever it needs from the imports already present. Unused imports
|
|
7
|
+
* are tree-shaken by the browser (never fetched if not used).
|
|
8
|
+
*
|
|
9
|
+
* The agent picks a template based on user query, then edits the body.
|
|
10
|
+
* The preamble + structure stays intact, saving hundreds of tokens.
|
|
11
|
+
*/
|
|
12
|
+
export interface Template {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
/** Keywords that help the agent pick this template from a user query */
|
|
17
|
+
keywords: string[];
|
|
18
|
+
code: string;
|
|
19
|
+
type: 'react-ts' | 'html' | 'markdown' | 'mermaid' | 'svg' | 'csv' | 'json';
|
|
20
|
+
language: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const templates: Record<string, Template>;
|
|
23
|
+
/** Get a template by ID */
|
|
24
|
+
export declare function getTemplate(id: string): Template | undefined;
|
|
25
|
+
/** Get all template IDs */
|
|
26
|
+
export declare function getTemplateIds(): string[];
|
|
27
|
+
/**
|
|
28
|
+
* Returns a summary of all templates for agent system prompts.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getTemplateSummary(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Pick the best template based on user query keywords.
|
|
33
|
+
* Returns the template ID, or 'blank' if no strong match.
|
|
34
|
+
*/
|
|
35
|
+
export declare function pickTemplate(query: string): string;
|
|
36
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAC5E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAyCD,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAiyB9C,CAAC;AAEF,2BAA2B;AAC3B,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAE5D;AAED,2BAA2B;AAC3B,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAEzC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAI3C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAiBlD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PreviewError } from './types';
|
|
2
|
+
|
|
3
|
+
export interface TranspileResult {
|
|
4
|
+
code: string;
|
|
5
|
+
error: PreviewError | null;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Transpile TSX/JSX source code to plain JavaScript using Sucrase.
|
|
9
|
+
*
|
|
10
|
+
* Sucrase is ~20x faster than Babel and handles JSX/TypeScript
|
|
11
|
+
* without a full bundler. The output uses ES module imports which
|
|
12
|
+
* are resolved by the browser via import maps.
|
|
13
|
+
*
|
|
14
|
+
* Returns structured errors with line/column for agent consumption.
|
|
15
|
+
*/
|
|
16
|
+
export declare function transpile(source: string, options?: {
|
|
17
|
+
filename?: string;
|
|
18
|
+
isTypeScript?: boolean;
|
|
19
|
+
isJSX?: boolean;
|
|
20
|
+
}): TranspileResult;
|
|
21
|
+
/**
|
|
22
|
+
* Transpile multiple files and return a map of filename → transpiled code
|
|
23
|
+
*/
|
|
24
|
+
export declare function transpileFiles(files: Record<string, string>): Record<string, TranspileResult>;
|
|
25
|
+
//# sourceMappingURL=transpiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transpiler.d.ts","sourceRoot":"","sources":["../src/transpiler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;CAC5B;AAID;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACZ,GACL,eAAe,CA0BjB;AAwDD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC5B,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAMjC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { editor } from 'monaco-editor';
|
|
2
|
+
|
|
3
|
+
/** Supported preview template types */
|
|
4
|
+
export type PreviewTemplate = 'react' | 'react-ts' | 'html' | 'markdown' | 'mermaid' | 'svg' | 'csv' | 'json';
|
|
5
|
+
/** Import map structure for the preview iframe */
|
|
6
|
+
export interface ImportMap {
|
|
7
|
+
imports: Record<string, string>;
|
|
8
|
+
scopes?: Record<string, Record<string, string>>;
|
|
9
|
+
}
|
|
10
|
+
/** Categories of errors that can occur in the preview */
|
|
11
|
+
export type PreviewErrorCategory = 'transpilation' | 'runtime' | 'import' | 'console-error' | 'unhandled-rejection';
|
|
12
|
+
export type PreviewErrorSeverity = 'error' | 'warning' | 'info';
|
|
13
|
+
/**
|
|
14
|
+
* Structured error emitted by the preview.
|
|
15
|
+
*
|
|
16
|
+
* Designed for AI agent consumption — includes enough context for
|
|
17
|
+
* the agent to construct a targeted fix prompt.
|
|
18
|
+
*/
|
|
19
|
+
export interface PreviewError {
|
|
20
|
+
/** Unique ID for deduplication */
|
|
21
|
+
id: string;
|
|
22
|
+
/** Error category */
|
|
23
|
+
category: PreviewErrorCategory;
|
|
24
|
+
/** Severity level */
|
|
25
|
+
severity: PreviewErrorSeverity;
|
|
26
|
+
/** Human-readable error message */
|
|
27
|
+
message: string;
|
|
28
|
+
/** Full stack trace if available */
|
|
29
|
+
stack?: string;
|
|
30
|
+
/** Line number (1-indexed) */
|
|
31
|
+
line?: number;
|
|
32
|
+
/** Column number (1-indexed) */
|
|
33
|
+
column?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Surrounding source lines for context.
|
|
36
|
+
* Format: "lineNum: content" per line.
|
|
37
|
+
*/
|
|
38
|
+
sourceContext?: string;
|
|
39
|
+
/** ISO 8601 timestamp */
|
|
40
|
+
timestamp: string;
|
|
41
|
+
}
|
|
42
|
+
/** Configuration for the CodeViz component */
|
|
43
|
+
export interface CodeVizProps {
|
|
44
|
+
/** Initial source code to display */
|
|
45
|
+
code?: string;
|
|
46
|
+
/** Language for the editor (tsx, jsx, html, css, etc.) */
|
|
47
|
+
language?: string;
|
|
48
|
+
/** Preview template type — determines how code is rendered */
|
|
49
|
+
template?: PreviewTemplate;
|
|
50
|
+
/** Template ID from built-in templates (overrides code/language/template) */
|
|
51
|
+
templateId?: string;
|
|
52
|
+
/** Custom import map overrides — merged with defaults */
|
|
53
|
+
importMap?: ImportMap;
|
|
54
|
+
/** Custom dependencies to add to the import map (package → CDN URL) */
|
|
55
|
+
dependencies?: Record<string, string>;
|
|
56
|
+
/** CDN base URL for resolving bare imports (default: https://esm.sh) */
|
|
57
|
+
cdnBase?: string;
|
|
58
|
+
/** External resources (CSS/JS URLs) to inject into the preview iframe */
|
|
59
|
+
externalResources?: string[];
|
|
60
|
+
/** Tailwind CSS CDN URL — set to false to disable */
|
|
61
|
+
tailwindCdn?: string | false;
|
|
62
|
+
/** Called when code changes in the editor */
|
|
63
|
+
onChange?: (code: string) => void;
|
|
64
|
+
/** Called when a structured error occurs in the preview */
|
|
65
|
+
onError?: (error: PreviewError) => void;
|
|
66
|
+
/** Called when preview finishes loading */
|
|
67
|
+
onLoad?: () => void;
|
|
68
|
+
/** Show/hide the editor pane */
|
|
69
|
+
showEditor?: boolean;
|
|
70
|
+
/** Show/hide the preview pane */
|
|
71
|
+
showPreview?: boolean;
|
|
72
|
+
/** Initial view mode */
|
|
73
|
+
defaultView?: 'split' | 'code' | 'preview';
|
|
74
|
+
/** Monaco editor options override */
|
|
75
|
+
editorOptions?: editor.IStandaloneEditorConstructionOptions;
|
|
76
|
+
/** Custom class name for the root container */
|
|
77
|
+
className?: string;
|
|
78
|
+
/** Height of the component (default: 100%) */
|
|
79
|
+
height?: string | number;
|
|
80
|
+
/** Width of the component (default: 100%) */
|
|
81
|
+
width?: string | number;
|
|
82
|
+
/** Theme for editor and preview */
|
|
83
|
+
theme?: 'light' | 'dark';
|
|
84
|
+
/** Read-only mode — disables editing */
|
|
85
|
+
readOnly?: boolean;
|
|
86
|
+
/** Whether to show the loading overlay (default: true) */
|
|
87
|
+
showLoader?: boolean;
|
|
88
|
+
/** Custom loader component */
|
|
89
|
+
loader?: React.ReactNode;
|
|
90
|
+
/** Show/hide the toolbar (default: true) */
|
|
91
|
+
showToolbar?: boolean;
|
|
92
|
+
/** Show/hide the status bar (default: true) */
|
|
93
|
+
showStatusBar?: boolean;
|
|
94
|
+
/** Called when the close button is clicked — Ranger can unmount or hide the preview */
|
|
95
|
+
onClose?: () => void;
|
|
96
|
+
/** Called when fullscreen state changes */
|
|
97
|
+
onFullscreenChange?: (isFullscreen: boolean) => void;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Imperative handle exposed by CodeViz via React.forwardRef.
|
|
101
|
+
*
|
|
102
|
+
* This is the primary API for Ranger to control the preview programmatically.
|
|
103
|
+
* Matches CodeSandboxHandle patterns where applicable.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```tsx
|
|
107
|
+
* const ref = useRef<CodeVizHandle>(null);
|
|
108
|
+
*
|
|
109
|
+
* // Stream code token-by-token during LLM generation
|
|
110
|
+
* ref.current?.streamCode('export default function App() {');
|
|
111
|
+
* ref.current?.streamCode('export default function App() {\n return <h1>Hello</h1>');
|
|
112
|
+
* ref.current?.commitCode(); // final — triggers preview rebuild
|
|
113
|
+
*
|
|
114
|
+
* // Or update entire code at once
|
|
115
|
+
* ref.current?.setCode(fullCode);
|
|
116
|
+
*
|
|
117
|
+
* // Read errors for agent feedback
|
|
118
|
+
* const errors = ref.current?.getErrors();
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export interface CodeVizHandle {
|
|
122
|
+
/** Get current code from the editor */
|
|
123
|
+
getCode: () => string;
|
|
124
|
+
/** Set code programmatically (full replace, triggers preview) */
|
|
125
|
+
setCode: (code: string) => void;
|
|
126
|
+
/**
|
|
127
|
+
* Stream partial code to the editor without triggering preview rebuild.
|
|
128
|
+
* Call this on each LLM token/chunk. The editor updates live but the
|
|
129
|
+
* preview iframe only rebuilds on commitCode() or after debounce.
|
|
130
|
+
*
|
|
131
|
+
* @param code - The full accumulated code so far (not a delta)
|
|
132
|
+
*/
|
|
133
|
+
streamCode: (code: string) => void;
|
|
134
|
+
/**
|
|
135
|
+
* Commit the streamed code — triggers transpilation + preview rebuild.
|
|
136
|
+
* Call this when the LLM finishes generating.
|
|
137
|
+
*/
|
|
138
|
+
commitCode: () => void;
|
|
139
|
+
/** Force refresh the preview iframe */
|
|
140
|
+
refresh: () => void;
|
|
141
|
+
/** Switch view mode */
|
|
142
|
+
setView: (view: 'split' | 'code' | 'preview') => void;
|
|
143
|
+
/**
|
|
144
|
+
* Apply a surgical string replacement to the current code.
|
|
145
|
+
* Returns true if the replacement was found and applied.
|
|
146
|
+
*
|
|
147
|
+
* @param oldStr - Exact string to find in the current code
|
|
148
|
+
* @param newStr - Replacement string
|
|
149
|
+
*/
|
|
150
|
+
editCode: (oldStr: string, newStr: string) => boolean;
|
|
151
|
+
/** Get all structured errors */
|
|
152
|
+
getErrors: () => PreviewError[];
|
|
153
|
+
/** Clear all errors */
|
|
154
|
+
clearErrors: () => void;
|
|
155
|
+
/** Whether the preview is currently loading */
|
|
156
|
+
isLoading: () => boolean;
|
|
157
|
+
}
|
|
158
|
+
/** Message sent from iframe to parent for error reporting */
|
|
159
|
+
export interface IframeMessage {
|
|
160
|
+
type: 'codeviz';
|
|
161
|
+
action: 'ready' | 'error' | 'console';
|
|
162
|
+
payload?: {
|
|
163
|
+
message?: string;
|
|
164
|
+
level?: string;
|
|
165
|
+
stack?: string;
|
|
166
|
+
line?: number;
|
|
167
|
+
column?: number;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAM5C,uCAAuC;AACvC,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;AAE9G,kDAAkD;AAClD,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjD;AAMD,yDAAyD;AACzD,MAAM,MAAM,oBAAoB,GAC5B,eAAe,GACf,SAAS,GACT,QAAQ,GACR,eAAe,GACf,qBAAqB,CAAC;AAE1B,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,qBAAqB;IACrB,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,qBAAqB;IACrB,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB;AAM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AI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IACtC,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH"}
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@illuma-ai/codeviz",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Multi-format code & content preview — Monaco editor, live React/HTML/Markdown/SVG/CSV/JSON rendering, streaming API, zoom/pan, download",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.cjs",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./styles.css": "./dist/styles.css"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"dev": "vite serve demo",
|
|
22
|
+
"build": "vite build",
|
|
23
|
+
"build:demo": "vite build --config vite.demo.config.ts",
|
|
24
|
+
"preview": "vite preview",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"prepublishOnly": "npm run build"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"react": ">=17.0.0",
|
|
30
|
+
"react-dom": ">=17.0.0"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@monaco-editor/react": "^4.6.0",
|
|
34
|
+
"monaco-editor": "^0.47.0",
|
|
35
|
+
"sucrase": "^3.35.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/react": "^18.2.0",
|
|
39
|
+
"@types/react-dom": "^18.2.0",
|
|
40
|
+
"@vitejs/plugin-react": "^4.2.0",
|
|
41
|
+
"react": "^18.2.0",
|
|
42
|
+
"react-dom": "^18.2.0",
|
|
43
|
+
"typescript": "^5.3.0",
|
|
44
|
+
"vite": "^5.4.0",
|
|
45
|
+
"vite-plugin-css-injected-by-js": "^3.5.0",
|
|
46
|
+
"vite-plugin-dts": "^3.9.0"
|
|
47
|
+
},
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "https://github.com/illuma-ai/codeviz"
|
|
51
|
+
},
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"keywords": [
|
|
54
|
+
"react",
|
|
55
|
+
"preview",
|
|
56
|
+
"monaco",
|
|
57
|
+
"editor",
|
|
58
|
+
"codeviz",
|
|
59
|
+
"artifact",
|
|
60
|
+
"sandbox",
|
|
61
|
+
"markdown",
|
|
62
|
+
"mermaid",
|
|
63
|
+
"svg",
|
|
64
|
+
"csv",
|
|
65
|
+
"json",
|
|
66
|
+
"streaming",
|
|
67
|
+
"llm"
|
|
68
|
+
]
|
|
69
|
+
}
|