jsx-repl 0.0.4 → 0.0.5

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.
@@ -11,7 +11,50 @@ declare const _default: (__props: typeof __ctx.props & {
11
11
  expose: (exposed: Record<string, any>) => void;
12
12
  attrs: Record<string, any>;
13
13
  };
14
- render: JSX.Element;
14
+ render: globalThis.VNode<import("vue").RendererNode, import("vue").RendererElement, {
15
+ [key: string]: any;
16
+ }> | import("vue").VaporRenderResult<import("vue").Block>[] | import("vue").VaporComponentInstance<Readonly<import("vue").TransitionProps & {}>, {}, {
17
+ [x: string]: (...args: any[]) => import("vue").Block;
18
+ }, Record<string, any>, Node, Record<string, any>> | import("vue").VaporComponentInstance<Readonly<import("vue").TransitionProps & {}>, {}, {
19
+ [x: string]: (...args: any[]) => import("vue").Block;
20
+ }, Record<string, any>, import("vue").VaporFragment<import("vue").Block>, Record<string, any>> | import("vue").VaporComponentInstance<Readonly<import("vue").TransitionProps & {}>, {}, {
21
+ [x: string]: (...args: any[]) => import("vue").Block;
22
+ }, Record<string, any>, {
23
+ anchor: Node;
24
+ scope: import("vue").EffectScope | undefined;
25
+ current?: (...args: any[]) => import("vue").Block;
26
+ pending?: {
27
+ render?: (...args: any[]) => import("vue").Block;
28
+ key: any;
29
+ };
30
+ fallback?: (...args: any[]) => import("vue").Block;
31
+ anchorLabel?: string;
32
+ keyed?: boolean;
33
+ attrs?: Record<string, any>;
34
+ setAsyncRef?: (instance: import("vue").VaporComponentInstance) => void;
35
+ getScope?: (key: any) => import("vue").EffectScope | undefined;
36
+ onBeforeTeardown?: ((oldKey: any, nodes: import("vue").Block, scope: import("vue").EffectScope) => boolean)[];
37
+ onBeforeMount?: ((newKey: any, nodes: import("vue").Block, scope: import("vue").EffectScope) => void)[];
38
+ slotOwner: import("vue").VaporComponentInstance | null;
39
+ update(render?: (...args: any[]) => import("vue").Block, key?: any): void;
40
+ renderBranch(render: ((...args: any[]) => import("vue").Block) | undefined, transition: import("vue").VaporTransitionHooks | undefined, parent: ParentNode | null, instance: import("vue").GenericComponentInstance | null): void;
41
+ hydrate: (isEmpty?: boolean) => void;
42
+ $key?: any;
43
+ $transition?: import("vue").VaporTransitionHooks | undefined;
44
+ nodes: import("vue").Block;
45
+ vnode?: VNode | null;
46
+ parentComponent?: import("vue").GenericComponentInstance | null;
47
+ insert?: (parent: ParentNode, anchor: Node | null, transitionHooks?: import("vue").TransitionHooks) => void;
48
+ remove?: (parent?: ParentNode, transitionHooks?: import("vue").TransitionHooks) => void;
49
+ setRef?: (instance: import("vue").VaporComponentInstance, ref: string | globalThis.Ref<any, any> | ((ref: Element | import("vue").VaporComponentInstance, refs: Record<string, any>) => void), refFor: boolean, refKey: string | undefined) => void;
50
+ onUpdated?: ((nodes?: import("vue").Block) => void)[];
51
+ }, Record<string, any>> | import("vue").VaporComponentInstance<Readonly<import("vue").TransitionProps & {}>, {}, {
52
+ [x: string]: (...args: any[]) => import("vue").Block;
53
+ }, Record<string, any>, import("vue").VaporComponentInstance<{}, {}, {
54
+ [x: string]: (...args: any[]) => import("vue").Block;
55
+ }, Record<string, any>, import("vue").Block, Record<string, any>>, Record<string, any>> | import("vue").VaporComponentInstance<Readonly<import("vue").TransitionProps & {}>, {}, {
56
+ [x: string]: (...args: any[]) => import("vue").Block;
57
+ }, Record<string, any>, import("vue").Block[], Record<string, any>>;
15
58
  }) => typeof __ctx.render & {
16
59
  __ctx?: {
17
60
  props: typeof __ctx.props;
@@ -12,7 +12,9 @@ export interface Props {
12
12
  clearConsole?: boolean;
13
13
  store?: Store;
14
14
  layout?: 'horizontal' | 'vertical';
15
+ slim?: boolean;
15
16
  ssr?: boolean;
17
+ theme?: 'dark' | 'light';
16
18
  previewOptions?: {
17
19
  headHTML?: string;
18
20
  bodyHTML?: string;
@@ -36,8 +38,11 @@ export interface Props {
36
38
  outputTogglerText?: string;
37
39
  };
38
40
  }
39
- export declare const Repl: (__props: typeof __ctx.props & Props, __context?: typeof __ctx.context, __ctx?: Awaited<ReturnType<typeof __fn>>, __fn?: ({ previewTheme, autoResize, showCompileOutput, clearConsole, ssr, autoSave, layout, previewOptions, editorOptions, splitPaneOptions, editor, ...props }: Props) => {
40
- props: {};
41
+ export declare const Repl: (__props: typeof __ctx.props & Props, __context?: typeof __ctx.context, __ctx?: Awaited<ReturnType<typeof __fn>>, __fn?: ({ previewTheme, autoResize, showCompileOutput, clearConsole, ssr, autoSave, layout, previewOptions, editorOptions, splitPaneOptions, editor, slim, theme, }: Props) => {
42
+ props: {
43
+ modelValue: import("vue").UnwrapRef<import("vue").ModelRef<string, string, string, string>>;
44
+ "onUpdate:modelValue"?: ($event: import("vue").UnwrapRef<import("vue").ModelRef<string, string, string, string>>) => any;
45
+ };
41
46
  context: {
42
47
  slots: {};
43
48
  expose: (exposed: {
@@ -45,7 +50,7 @@ export declare const Repl: (__props: typeof __ctx.props & Props, __context?: typ
45
50
  }) => void;
46
51
  attrs: Record<string, any>;
47
52
  };
48
- render: JSX.Element;
53
+ render: HTMLDivElement;
49
54
  }) => typeof __ctx.render & {
50
55
  __ctx?: {
51
56
  props: typeof __ctx.props;
@@ -15,7 +15,7 @@ declare const _default: (__props: typeof __ctx.props & {
15
15
  expose: (exposed: Record<string, any>) => void;
16
16
  attrs: Record<string, any>;
17
17
  };
18
- render: JSX.Element;
18
+ render: HTMLDivElement;
19
19
  }) => typeof __ctx.render & {
20
20
  __ctx?: {
21
21
  props: typeof __ctx.props;
@@ -14,7 +14,7 @@ declare const _default: (__props: typeof __ctx.props & {
14
14
  expose: (exposed: Record<string, any>) => void;
15
15
  attrs: Record<string, any>;
16
16
  };
17
- render: JSX.Element;
17
+ render: HTMLDivElement;
18
18
  }) => typeof __ctx.render & {
19
19
  __ctx?: {
20
20
  props: typeof __ctx.props;
@@ -11,7 +11,7 @@ declare const _default: (__props: typeof __ctx.props & {}, __context?: typeof __
11
11
  expose: (exposed: Record<string, any>) => void;
12
12
  attrs: Record<string, any>;
13
13
  };
14
- render: JSX.Element;
14
+ render: HTMLDivElement;
15
15
  }) => typeof __ctx.render & {
16
16
  __ctx?: {
17
17
  props: typeof __ctx.props;
@@ -1,6 +1,8 @@
1
+ import 'uno.css';
1
2
  export { Repl } from './Repl';
2
3
  export { default as Preview } from './output/Preview';
3
4
  export { useStore, ReplFile, type StoreState, type Store, type ReplStore, type ImportMap, } from './store';
4
5
  export { compileFile } from './transform';
5
6
  export type { Props as ReplProps } from './Repl';
6
7
  export type { OutputModes } from './types';
8
+ export { serialize } from './utils';
@@ -21,7 +21,7 @@ declare const _default: (__props: typeof __ctx.props & {}, __context?: typeof __
21
21
  }) => void;
22
22
  attrs: Record<string, any>;
23
23
  };
24
- render: JSX.Element;
24
+ render: HTMLDivElement;
25
25
  }) => typeof __ctx.render & {
26
26
  __ctx?: {
27
27
  props: typeof __ctx.props;
@@ -1,6 +1,6 @@
1
1
  declare const _default: (__props: typeof __ctx.props & {}, __context?: typeof __ctx.context, __ctx?: Awaited<ReturnType<typeof __fn>>, __fn?: ({ previewContainer, theme, }: {
2
2
  previewContainer?: HTMLDivElement | null | undefined;
3
- theme?: "light" | "dark" | undefined;
3
+ theme?: "dark" | "light" | undefined;
4
4
  }) => {
5
5
  props: {
6
6
  previewContainer?: typeof previewContainer;
@@ -11,7 +11,7 @@ declare const _default: (__props: typeof __ctx.props & {}, __context?: typeof __
11
11
  expose: (exposed: Record<string, any>) => void;
12
12
  attrs: Record<string, any>;
13
13
  };
14
- render: JSX.Element;
14
+ render: HTMLDivElement;
15
15
  }) => typeof __ctx.render & {
16
16
  __ctx?: {
17
17
  props: typeof __ctx.props;
@@ -0,0 +1,2 @@
1
+ import type { Store } from '../store';
2
+ export declare function downloadProject(store: Store): Promise<void>;
@@ -5,7 +5,7 @@ declare const _default: (__props: typeof __ctx.props & {}, __context?: typeof __
5
5
  expose: (exposed: Record<string, any>) => void;
6
6
  attrs: Record<string, any>;
7
7
  };
8
- render: JSX.Element;
8
+ render: HTMLDivElement;
9
9
  }) => typeof __ctx.render & {
10
10
  __ctx?: {
11
11
  props: typeof __ctx.props;
@@ -6,7 +6,7 @@ import type { SourceMapInput } from '@ampproject/remapping';
6
6
  import type { Mapping } from '@volar/monaco/worker';
7
7
  export { packageFile, tsconfigFile, viteConfigFile, tsMacroConfigFile, indexHtmlFile, appFile, };
8
8
  export declare const configFileNames: string[];
9
- export declare function useStore({ files, activeFilename, activeConfigFilename, errors, showOutput, outputMode, theme, loading, locale, typescriptVersion, reloadLanguageTools, preset, presets, slim, }?: Partial<StoreState>, serializedState?: string): ReplStore;
9
+ export declare function useStore({ files, activeFilename, activeConfigFilename, errors, showOutput, outputMode, theme, loading, locale, typescriptVersion, reloadLanguageTools, preset, presets, slim, }?: Partial<StoreState>): ReplStore;
10
10
  export type ImportMap = Record<string, string>;
11
11
  export type Template = {
12
12
  [indexHtmlFile]: ReplFile;
@@ -82,11 +82,8 @@ export interface ReplStore extends UnwrapRef<StoreState> {
82
82
  getTsConfig(): Record<string, any>;
83
83
  getTsMacroConfig(): Promise<string>;
84
84
  serialize(): string;
85
- getFiles(): Record<string, {
86
- code: string;
87
- hidden?: boolean;
88
- }>;
89
- setFiles(newFiles: Record<string, ReplFile>): Promise<void>;
85
+ getFiles(): Record<string, string>;
86
+ setFiles(newFiles: Record<string, string>): Promise<void>;
90
87
  updateProject(): void;
91
88
  }
92
89
  export type Store = Pick<ReplStore, 'editor' | 'outputEditor' | 'organization' | 'organizations' | 'userName' | 'user' | 'project' | 'files' | 'serialize' | 'fileCaches' | 'activeFile' | 'activeConfigFile' | 'errors' | 'showOutput' | 'outputMode' | 'locale' | 'typescriptVersion' | 'dependencies' | 'reloadLanguageTools' | 'init' | 'setActive' | 'addFile' | 'deleteFile' | 'renameFile' | 'getTsConfig' | 'viteConfig' | 'getTsMacroConfig' | 'updateProject' | 'preset' | 'presets' | 'importMap' | 'theme' | 'loading' | 'slim'>;
@@ -1,7 +1,9 @@
1
1
  export declare function debounce(fn: Function, n?: number): (...args: any[]) => void;
2
2
  export declare function utoa(data: string): string;
3
+ export declare function serialize(files: Record<string, string>): string;
3
4
  export declare function atou(base64: string): string;
4
5
  import type { ImportMap } from './store';
5
6
  export declare function useRouteQuery<T extends string | boolean>(name: string, defaultValue?: T, reload?: boolean): Ref<T>;
6
- export declare function useRoutePath<T extends string | boolean>(defaultValue?: T, reload?: boolean): Ref<T>;
7
+ export declare function useRoutePath<T extends string>(defaultValue?: T, reload?: boolean): Ref<T>;
7
8
  export declare function addEsmPrefix(code: string, importMap: ImportMap): string;
9
+ export declare function useDark(defaultTheme?: 'dark' | 'light'): globalThis.Ref<"dark" | "light", "dark" | "light">;
@@ -1 +1 @@
1
- import 'uno.css';
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsx-repl",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "JSX REPL",
5
5
  "type": "module",
6
6
  "main": "dist/ssr-stub.js",
@@ -50,8 +50,7 @@
50
50
  "homepage": "https://github.com/vuejs/repl#readme",
51
51
  "devDependencies": {
52
52
  "@ampproject/remapping": "^2.3.0",
53
- "@babel/parser": "^7.28.4",
54
- "@babel/types": "^7.28.4",
53
+ "@babel/types": "^7.28.6",
55
54
  "@eslint/js": "^9.35.0",
56
55
  "@iconify-json/carbon": "^1.2.13",
57
56
  "@prisma/client": "^6.15.0",
@@ -74,12 +73,14 @@
74
73
  "fflate": "^0.8.2",
75
74
  "floating-vue": "^5.2.2",
76
75
  "globby": "^14.1.0",
76
+ "jszip": "^3.10.1",
77
77
  "lint-staged": "^16.1.6",
78
78
  "magic-string": "^0.30.18",
79
79
  "monaco-editor-core": "^0.52.2",
80
80
  "nitropack": "^2.12.5",
81
81
  "ofetch": "^1.4.1",
82
82
  "path-browserify": "^1.0.1",
83
+ "perfect-debounce": "^2.1.0",
83
84
  "postcss": "^8.5.6",
84
85
  "postcss-modules": "^6.0.1",
85
86
  "prettier": "^3.6.2",
@@ -109,6 +110,8 @@
109
110
  },
110
111
  "scripts": {
111
112
  "dev": "vite",
113
+ "dev:lib": "vite build -c vite.lib.config.ts --watch",
114
+ "play": "pnpm run -C ./playground dev",
112
115
  "server:dev": "nitro dev",
113
116
  "server:build": "prisma generate --no-engine && prisma migrate deploy && nitro build",
114
117
  "vercel:build": "pnpm server:build && pnpm build",