@depup/react-live 4.1.8-depup.0 → 5.0.0-depup.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/README.md CHANGED
@@ -13,17 +13,10 @@ npm install @depup/react-live
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [react-live](https://www.npmjs.com/package/react-live) @ 4.1.8 |
17
- | Processed | 2026-03-18 |
18
- | Smoke test | failed |
19
- | Deps updated | 2 |
20
-
21
- ## Dependency Changes
22
-
23
- | Dependency | From | To |
24
- |------------|------|-----|
25
- | prism-react-renderer | ^2.4.0 | ^2.4.1 |
26
- | sucrase | ^3.35.0 | ^3.35.1 |
16
+ | Original | [react-live](https://www.npmjs.com/package/react-live) @ 5.0.0 |
17
+ | Processed | 2026-09-27 |
18
+ | Smoke test | passed |
19
+ | Deps updated | 0 |
27
20
 
28
21
  ---
29
22
 
package/changes.json CHANGED
@@ -1,14 +1,5 @@
1
1
  {
2
- "bumped": {
3
- "prism-react-renderer": {
4
- "from": "^2.4.0",
5
- "to": "^2.4.1"
6
- },
7
- "sucrase": {
8
- "from": "^3.35.0",
9
- "to": "^3.35.1"
10
- }
11
- },
12
- "timestamp": "2026-03-18T23:30:47.259Z",
13
- "totalUpdated": 2
2
+ "bumped": {},
3
+ "timestamp": "2026-09-27T01:02:02.585Z",
4
+ "totalUpdated": 0
14
5
  }
@@ -0,0 +1,166 @@
1
+ import { Prism, themes } from "prism-react-renderer";
2
+ import React, { CSSProperties, ComponentType, PropsWithChildren } from "react";
3
+ //#region src/components/Editor/index.d.ts
4
+ type Props$3 = {
5
+ className?: string;
6
+ code: string;
7
+ disabled?: boolean;
8
+ language: string;
9
+ prism?: typeof Prism;
10
+ style?: CSSProperties;
11
+ tabMode?: "focus" | "indentation";
12
+ theme?: typeof themes.nightOwl;
13
+ onChange?(value: string): void;
14
+ };
15
+ declare const CodeEditor: (props: Props$3) => import("react").JSX.Element;
16
+ //#endregion
17
+ //#region src/components/Live/LiveProvider.d.ts
18
+ type Props$2 = {
19
+ code?: string;
20
+ disabled?: boolean;
21
+ enableTypeScript?: boolean;
22
+ language?: string;
23
+ noInline?: boolean;
24
+ scope?: Record<string, unknown>;
25
+ theme?: typeof themes.nightOwl;
26
+ transformCode?(code: string): void;
27
+ };
28
+ declare function LiveProvider({ children, code, language, theme, enableTypeScript, disabled, scope, transformCode, noInline }: PropsWithChildren<Props$2>): import("react").JSX.Element;
29
+ //#endregion
30
+ //#region src/components/Live/LiveEditor.d.ts
31
+ declare function LiveEditor(props: Partial<Props$3>): React.JSX.Element;
32
+ //#endregion
33
+ //#region src/components/Live/LiveError.d.ts
34
+ declare function LiveError<T extends Record<string, unknown>>(props: T): React.JSX.Element | null;
35
+ //#endregion
36
+ //#region src/components/Live/LivePreview.d.ts
37
+ type Props$1<T extends React.ElementType = React.ElementType> = {
38
+ Component?: T;
39
+ } & React.ComponentPropsWithoutRef<T>;
40
+ declare function LivePreview<T extends keyof React.JSX.IntrinsicElements>(props: Props$1<T>): React.JSX.Element;
41
+ declare function LivePreview<T extends React.ElementType>(props: Props$1<T>): React.JSX.Element;
42
+ //#endregion
43
+ //#region src/components/Live/LiveContext.d.ts
44
+ type LiveContextValue = {
45
+ error?: string;
46
+ element?: ComponentType | null;
47
+ code: string;
48
+ newCode?: string;
49
+ disabled: boolean;
50
+ language: string;
51
+ theme?: typeof themes.nightOwl;
52
+ onError(error: Error): void;
53
+ onChange(value: string): void;
54
+ };
55
+ declare const LiveContext: import("react").Context<LiveContextValue>;
56
+ //#endregion
57
+ //#region src/hoc/withLive.d.ts
58
+ type Props = {
59
+ live: LiveContextValue;
60
+ };
61
+ declare function withLive<T>(WrappedComponent: ComponentType<T & Props>): {
62
+ (props: T): React.JSX.Element;
63
+ displayName: string;
64
+ };
65
+ //#endregion
66
+ //#region src/utils/transpile/index.d.ts
67
+ type GenerateOptions = {
68
+ code: string;
69
+ scope?: Record<string, unknown>;
70
+ enableTypeScript: boolean;
71
+ };
72
+ export declare const generateElement: ({ code, scope, enableTypeScript }: GenerateOptions, errorCallback: (error: Error) => void) => {
73
+ new (props: Record<string, never>): {
74
+ state: {
75
+ hasError: boolean;
76
+ };
77
+ componentDidCatch(error: Error): void;
78
+ render(): React.JSX.Element | null;
79
+ context: unknown;
80
+ setState<K extends "hasError">(state: Pick<{
81
+ hasError: boolean;
82
+ }, K> | ((prevState: Readonly<{
83
+ hasError: boolean;
84
+ }>, props: Readonly<Record<string, never>>) => Pick<{
85
+ hasError: boolean;
86
+ }, K> | {
87
+ hasError: boolean;
88
+ } | null) | {
89
+ hasError: boolean;
90
+ } | null, callback?: (() => void) | undefined): void;
91
+ forceUpdate(callback?: (() => void) | undefined): void;
92
+ readonly props: Readonly<Record<string, never>>;
93
+ componentDidMount?(): void;
94
+ shouldComponentUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
95
+ hasError: boolean;
96
+ }>, nextContext: any): boolean;
97
+ componentWillUnmount?(): void;
98
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
99
+ hasError: boolean;
100
+ }>): any;
101
+ componentDidUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
102
+ hasError: boolean;
103
+ }>, snapshot?: any): void;
104
+ componentWillMount?(): void;
105
+ UNSAFE_componentWillMount?(): void;
106
+ componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
107
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
108
+ componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
109
+ hasError: boolean;
110
+ }>, nextContext: any): void;
111
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
112
+ hasError: boolean;
113
+ }>, nextContext: any): void;
114
+ };
115
+ new (props: Record<string, never>, context: any): {
116
+ state: {
117
+ hasError: boolean;
118
+ };
119
+ componentDidCatch(error: Error): void;
120
+ render(): React.JSX.Element | null;
121
+ context: unknown;
122
+ setState<K extends "hasError">(state: Pick<{
123
+ hasError: boolean;
124
+ }, K> | ((prevState: Readonly<{
125
+ hasError: boolean;
126
+ }>, props: Readonly<Record<string, never>>) => Pick<{
127
+ hasError: boolean;
128
+ }, K> | {
129
+ hasError: boolean;
130
+ } | null) | {
131
+ hasError: boolean;
132
+ } | null, callback?: (() => void) | undefined): void;
133
+ forceUpdate(callback?: (() => void) | undefined): void;
134
+ readonly props: Readonly<Record<string, never>>;
135
+ componentDidMount?(): void;
136
+ shouldComponentUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
137
+ hasError: boolean;
138
+ }>, nextContext: any): boolean;
139
+ componentWillUnmount?(): void;
140
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
141
+ hasError: boolean;
142
+ }>): any;
143
+ componentDidUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
144
+ hasError: boolean;
145
+ }>, snapshot?: any): void;
146
+ componentWillMount?(): void;
147
+ UNSAFE_componentWillMount?(): void;
148
+ componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
149
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
150
+ componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
151
+ hasError: boolean;
152
+ }>, nextContext: any): void;
153
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
154
+ hasError: boolean;
155
+ }>, nextContext: any): void;
156
+ };
157
+ getDerivedStateFromError(): {
158
+ hasError: boolean;
159
+ };
160
+ contextType?: React.Context<any> | undefined;
161
+ propTypes?: any;
162
+ };
163
+ export declare const renderElementAsync: ({ code, scope, enableTypeScript }: GenerateOptions, resultCallback: (sender: ComponentType) => void, errorCallback: (error: Error) => void) => void;
164
+ //#endregion
165
+ export { CodeEditor as Editor, LiveContext, LiveEditor, LiveError, LivePreview, LiveProvider, withLive };
166
+ //# sourceMappingURL=index.d.mts.map
package/dist/index.d.ts CHANGED
@@ -1,117 +1,166 @@
1
- import { Prism, themes } from 'prism-react-renderer';
2
- import * as React from 'react';
3
- import React__default, { CSSProperties, PropsWithChildren, ComponentType } from 'react';
4
-
1
+ import { Prism, themes } from "prism-react-renderer";
2
+ import React, { CSSProperties, ComponentType, PropsWithChildren } from "react";
3
+ //#region src/components/Editor/index.d.ts
5
4
  type Props$3 = {
6
- className?: string;
7
- code: string;
8
- disabled?: boolean;
9
- language: string;
10
- prism?: typeof Prism;
11
- style?: CSSProperties;
12
- tabMode?: "focus" | "indentation";
13
- theme?: typeof themes.nightOwl;
14
- onChange?(value: string): void;
5
+ className?: string;
6
+ code: string;
7
+ disabled?: boolean;
8
+ language: string;
9
+ prism?: typeof Prism;
10
+ style?: CSSProperties;
11
+ tabMode?: "focus" | "indentation";
12
+ theme?: typeof themes.nightOwl;
13
+ onChange?(value: string): void;
15
14
  };
16
- declare const CodeEditor: (props: Props$3) => JSX.Element;
17
-
15
+ declare const CodeEditor: (props: Props$3) => import("react").JSX.Element;
16
+ //#endregion
17
+ //#region src/components/Live/LiveProvider.d.ts
18
18
  type Props$2 = {
19
- code?: string;
20
- disabled?: boolean;
21
- enableTypeScript?: boolean;
22
- language?: string;
23
- noInline?: boolean;
24
- scope?: Record<string, unknown>;
25
- theme?: typeof themes.nightOwl;
26
- transformCode?(code: string): void;
19
+ code?: string;
20
+ disabled?: boolean;
21
+ enableTypeScript?: boolean;
22
+ language?: string;
23
+ noInline?: boolean;
24
+ scope?: Record<string, unknown>;
25
+ theme?: typeof themes.nightOwl;
26
+ transformCode?(code: string): void;
27
27
  };
28
- declare function LiveProvider({ children, code, language, theme, enableTypeScript, disabled, scope, transformCode, noInline, }: PropsWithChildren<Props$2>): JSX.Element;
29
-
30
- declare function LiveEditor(props: Partial<Props$3>): JSX.Element;
31
-
32
- declare function LiveError<T extends Record<string, unknown>>(props: T): JSX.Element | null;
33
-
34
- type Props$1<T extends React__default.ElementType = React__default.ElementType> = {
35
- Component?: T;
36
- } & React__default.ComponentPropsWithoutRef<T>;
37
- declare function LivePreview<T extends keyof JSX.IntrinsicElements>(props: Props$1<T>): JSX.Element;
38
- declare function LivePreview<T extends React__default.ElementType>(props: Props$1<T>): JSX.Element;
39
-
40
- type ContextValue = {
41
- error?: string;
42
- element?: ComponentType | null;
43
- code: string;
44
- newCode?: string;
45
- disabled: boolean;
46
- language: string;
47
- theme?: typeof themes.nightOwl;
48
- onError(error: Error): void;
49
- onChange(value: string): void;
28
+ declare function LiveProvider({ children, code, language, theme, enableTypeScript, disabled, scope, transformCode, noInline }: PropsWithChildren<Props$2>): import("react").JSX.Element;
29
+ //#endregion
30
+ //#region src/components/Live/LiveEditor.d.ts
31
+ declare function LiveEditor(props: Partial<Props$3>): React.JSX.Element;
32
+ //#endregion
33
+ //#region src/components/Live/LiveError.d.ts
34
+ declare function LiveError<T extends Record<string, unknown>>(props: T): React.JSX.Element | null;
35
+ //#endregion
36
+ //#region src/components/Live/LivePreview.d.ts
37
+ type Props$1<T extends React.ElementType = React.ElementType> = {
38
+ Component?: T;
39
+ } & React.ComponentPropsWithoutRef<T>;
40
+ declare function LivePreview<T extends keyof React.JSX.IntrinsicElements>(props: Props$1<T>): React.JSX.Element;
41
+ declare function LivePreview<T extends React.ElementType>(props: Props$1<T>): React.JSX.Element;
42
+ //#endregion
43
+ //#region src/components/Live/LiveContext.d.ts
44
+ type LiveContextValue = {
45
+ error?: string;
46
+ element?: ComponentType | null;
47
+ code: string;
48
+ newCode?: string;
49
+ disabled: boolean;
50
+ language: string;
51
+ theme?: typeof themes.nightOwl;
52
+ onError(error: Error): void;
53
+ onChange(value: string): void;
50
54
  };
51
- declare const LiveContext: React.Context<ContextValue>;
52
-
55
+ declare const LiveContext: import("react").Context<LiveContextValue>;
56
+ //#endregion
57
+ //#region src/hoc/withLive.d.ts
53
58
  type Props = {
54
- live: Record<string, unknown>;
59
+ live: LiveContextValue;
55
60
  };
56
61
  declare function withLive<T>(WrappedComponent: ComponentType<T & Props>): {
57
- (props: T): JSX.Element;
58
- displayName: string;
62
+ (props: T): React.JSX.Element;
63
+ displayName: string;
59
64
  };
60
-
65
+ //#endregion
66
+ //#region src/utils/transpile/index.d.ts
61
67
  type GenerateOptions = {
62
- code: string;
63
- scope?: Record<string, unknown>;
64
- enableTypeScript: boolean;
68
+ code: string;
69
+ scope?: Record<string, unknown>;
70
+ enableTypeScript: boolean;
65
71
  };
66
- declare const generateElement: ({ code, scope, enableTypeScript }: GenerateOptions, errorCallback: (error: Error) => void) => {
67
- new (props: {} | Readonly<{}>): {
68
- componentDidCatch(error: Error): void;
69
- render(): JSX.Element | null;
70
- context: unknown;
71
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
72
- forceUpdate(callback?: (() => void) | undefined): void;
73
- readonly props: Readonly<{}>;
74
- state: Readonly<{}>;
75
- refs: {
76
- [key: string]: React__default.ReactInstance;
77
- };
78
- componentDidMount?(): void;
79
- shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
80
- componentWillUnmount?(): void;
81
- getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
82
- componentDidUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>, snapshot?: any): void;
83
- componentWillMount?(): void;
84
- UNSAFE_componentWillMount?(): void;
85
- componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
86
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
87
- componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
88
- UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
72
+ export declare const generateElement: ({ code, scope, enableTypeScript }: GenerateOptions, errorCallback: (error: Error) => void) => {
73
+ new (props: Record<string, never>): {
74
+ state: {
75
+ hasError: boolean;
89
76
  };
90
- new (props: {}, context: any): {
91
- componentDidCatch(error: Error): void;
92
- render(): JSX.Element | null;
93
- context: unknown;
94
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
95
- forceUpdate(callback?: (() => void) | undefined): void;
96
- readonly props: Readonly<{}>;
97
- state: Readonly<{}>;
98
- refs: {
99
- [key: string]: React__default.ReactInstance;
100
- };
101
- componentDidMount?(): void;
102
- shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
103
- componentWillUnmount?(): void;
104
- getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
105
- componentDidUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>, snapshot?: any): void;
106
- componentWillMount?(): void;
107
- UNSAFE_componentWillMount?(): void;
108
- componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
109
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
110
- componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
111
- UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
77
+ componentDidCatch(error: Error): void;
78
+ render(): React.JSX.Element | null;
79
+ context: unknown;
80
+ setState<K extends "hasError">(state: Pick<{
81
+ hasError: boolean;
82
+ }, K> | ((prevState: Readonly<{
83
+ hasError: boolean;
84
+ }>, props: Readonly<Record<string, never>>) => Pick<{
85
+ hasError: boolean;
86
+ }, K> | {
87
+ hasError: boolean;
88
+ } | null) | {
89
+ hasError: boolean;
90
+ } | null, callback?: (() => void) | undefined): void;
91
+ forceUpdate(callback?: (() => void) | undefined): void;
92
+ readonly props: Readonly<Record<string, never>>;
93
+ componentDidMount?(): void;
94
+ shouldComponentUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
95
+ hasError: boolean;
96
+ }>, nextContext: any): boolean;
97
+ componentWillUnmount?(): void;
98
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
99
+ hasError: boolean;
100
+ }>): any;
101
+ componentDidUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
102
+ hasError: boolean;
103
+ }>, snapshot?: any): void;
104
+ componentWillMount?(): void;
105
+ UNSAFE_componentWillMount?(): void;
106
+ componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
107
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
108
+ componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
109
+ hasError: boolean;
110
+ }>, nextContext: any): void;
111
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
112
+ hasError: boolean;
113
+ }>, nextContext: any): void;
114
+ };
115
+ new (props: Record<string, never>, context: any): {
116
+ state: {
117
+ hasError: boolean;
112
118
  };
113
- contextType?: React__default.Context<any> | undefined;
119
+ componentDidCatch(error: Error): void;
120
+ render(): React.JSX.Element | null;
121
+ context: unknown;
122
+ setState<K extends "hasError">(state: Pick<{
123
+ hasError: boolean;
124
+ }, K> | ((prevState: Readonly<{
125
+ hasError: boolean;
126
+ }>, props: Readonly<Record<string, never>>) => Pick<{
127
+ hasError: boolean;
128
+ }, K> | {
129
+ hasError: boolean;
130
+ } | null) | {
131
+ hasError: boolean;
132
+ } | null, callback?: (() => void) | undefined): void;
133
+ forceUpdate(callback?: (() => void) | undefined): void;
134
+ readonly props: Readonly<Record<string, never>>;
135
+ componentDidMount?(): void;
136
+ shouldComponentUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
137
+ hasError: boolean;
138
+ }>, nextContext: any): boolean;
139
+ componentWillUnmount?(): void;
140
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
141
+ hasError: boolean;
142
+ }>): any;
143
+ componentDidUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
144
+ hasError: boolean;
145
+ }>, snapshot?: any): void;
146
+ componentWillMount?(): void;
147
+ UNSAFE_componentWillMount?(): void;
148
+ componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
149
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
150
+ componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
151
+ hasError: boolean;
152
+ }>, nextContext: any): void;
153
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
154
+ hasError: boolean;
155
+ }>, nextContext: any): void;
156
+ };
157
+ getDerivedStateFromError(): {
158
+ hasError: boolean;
159
+ };
160
+ contextType?: React.Context<any> | undefined;
161
+ propTypes?: any;
114
162
  };
115
- declare const renderElementAsync: ({ code, scope, enableTypeScript }: GenerateOptions, resultCallback: (sender: ComponentType) => void, errorCallback: (error: Error) => void) => void;
116
-
117
- export { CodeEditor as Editor, LiveContext, LiveEditor, LiveError, LivePreview, LiveProvider, generateElement, renderElementAsync, withLive };
163
+ export declare const renderElementAsync: ({ code, scope, enableTypeScript }: GenerateOptions, resultCallback: (sender: ComponentType) => void, errorCallback: (error: Error) => void) => void;
164
+ //#endregion
165
+ export { CodeEditor as Editor, LiveContext, LiveEditor, LiveError, LivePreview, LiveProvider, withLive };
166
+ //# sourceMappingURL=index.d.ts.map