@thienvu18/designable-react-sandbox 2.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/LICENSE.md +20 -0
- package/README.md +1 -0
- package/esm/index.d.ts +12 -0
- package/esm/index.js +149 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.js +180 -0
- package/package.json +52 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015-present, Alibaba Group Holding Limited. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @thienvu18/designable-react-sandbox
|
package/esm/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ISandboxProps extends React.IframeHTMLAttributes<HTMLIFrameElement> {
|
|
3
|
+
style?: React.CSSProperties;
|
|
4
|
+
cssAssets?: string[];
|
|
5
|
+
jsAssets?: string[];
|
|
6
|
+
scope?: any;
|
|
7
|
+
}
|
|
8
|
+
export declare const useSandbox: (props: React.PropsWithChildren<ISandboxProps>) => React.RefObject<HTMLIFrameElement>;
|
|
9
|
+
export declare const unmountSandboxContent: () => void;
|
|
10
|
+
export declare const useSandboxScope: () => any;
|
|
11
|
+
export declare const renderSandboxContent: (render: (scope?: any) => React.ReactNode) => void;
|
|
12
|
+
export declare const Sandbox: React.FC<ISandboxProps>;
|
package/esm/index.js
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import React, { useRef, useEffect } from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
import { isFn, globalThisPolyfill } from '@thienvu18/designable-shared';
|
|
4
|
+
import { useDesigner, useWorkspace, useLayout, usePrefix, } from '@thienvu18/designable-react';
|
|
5
|
+
const ROOT_INSTANCE_KEY = '__DESIGNABLE_SANDBOX_ROOT_INSTANCE__';
|
|
6
|
+
const ROOT_CONTAINER_KEY = '__DESIGNABLE_SANDBOX_ROOT_CONTAINER__';
|
|
7
|
+
const UNMOUNT_KEY = '__DESIGNABLE_SANDBOX_UNMOUNT__';
|
|
8
|
+
export const useSandbox = (props) => {
|
|
9
|
+
const ref = useRef(null);
|
|
10
|
+
const appCls = usePrefix('app');
|
|
11
|
+
const designer = useDesigner();
|
|
12
|
+
const workspace = useWorkspace();
|
|
13
|
+
const layout = useLayout();
|
|
14
|
+
const cssAssets = props.cssAssets || [];
|
|
15
|
+
const jsAssets = props.jsAssets || [];
|
|
16
|
+
const getCSSVar = (name) => {
|
|
17
|
+
const el = document.querySelector(`.${appCls}`);
|
|
18
|
+
return el ? getComputedStyle(el).getPropertyValue(name) : '';
|
|
19
|
+
};
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (ref.current && workspace) {
|
|
22
|
+
const styles = cssAssets
|
|
23
|
+
?.map?.((css) => {
|
|
24
|
+
return `<link media="all" rel="stylesheet" href="${css}" />`;
|
|
25
|
+
})
|
|
26
|
+
.join('\n');
|
|
27
|
+
const scripts = jsAssets
|
|
28
|
+
?.map?.((js) => {
|
|
29
|
+
return `<script src="${js}" type="text/javascript" ></script>`;
|
|
30
|
+
})
|
|
31
|
+
.join('\n');
|
|
32
|
+
const contentWindow = ref.current.contentWindow;
|
|
33
|
+
const contentDocument = ref.current.contentDocument;
|
|
34
|
+
if (contentWindow && contentDocument) {
|
|
35
|
+
contentWindow[UNMOUNT_KEY]?.();
|
|
36
|
+
contentWindow['__DESIGNABLE_SANDBOX_SCOPE__'] = props.scope;
|
|
37
|
+
contentWindow['__DESIGNABLE_LAYOUT__'] = layout;
|
|
38
|
+
contentWindow['__DESIGNABLE_ENGINE__'] = designer;
|
|
39
|
+
contentWindow['__DESIGNABLE_WORKSPACE__'] = workspace;
|
|
40
|
+
contentWindow['Formily'] = globalThisPolyfill['Formily'];
|
|
41
|
+
contentWindow['Designable'] = globalThisPolyfill['Designable'];
|
|
42
|
+
contentDocument.open();
|
|
43
|
+
contentDocument.write(`
|
|
44
|
+
<!DOCTYPE html>
|
|
45
|
+
<head>
|
|
46
|
+
${styles}
|
|
47
|
+
</head>
|
|
48
|
+
<style>
|
|
49
|
+
html{
|
|
50
|
+
overflow: overlay;
|
|
51
|
+
}
|
|
52
|
+
::-webkit-scrollbar {
|
|
53
|
+
width: 5px;
|
|
54
|
+
height: 5px;
|
|
55
|
+
}
|
|
56
|
+
::-webkit-scrollbar-thumb {
|
|
57
|
+
background-color:${getCSSVar('--dn-scrollbar-color')};
|
|
58
|
+
border-radius: 0;
|
|
59
|
+
transition: all .25s ease-in-out;
|
|
60
|
+
}
|
|
61
|
+
::-webkit-scrollbar-thumb:hover {
|
|
62
|
+
background-color: ${getCSSVar('--dn-scrollbar-hover-color')};
|
|
63
|
+
}
|
|
64
|
+
body{
|
|
65
|
+
margin:0;
|
|
66
|
+
padding:0;
|
|
67
|
+
overflow-anchor: none;
|
|
68
|
+
user-select:none;
|
|
69
|
+
background-color:${layout?.theme === 'light' ? '#fff' : 'transparent'} !important;
|
|
70
|
+
}
|
|
71
|
+
html{
|
|
72
|
+
overflow-anchor: none;
|
|
73
|
+
}
|
|
74
|
+
.inherit-cusor * {
|
|
75
|
+
cursor: inherit !important;
|
|
76
|
+
}
|
|
77
|
+
</style>
|
|
78
|
+
<body>
|
|
79
|
+
<div id="__SANDBOX_ROOT__"></div>
|
|
80
|
+
${scripts}
|
|
81
|
+
</body>
|
|
82
|
+
</html>
|
|
83
|
+
`);
|
|
84
|
+
contentDocument.close();
|
|
85
|
+
return () => {
|
|
86
|
+
contentWindow[UNMOUNT_KEY]?.();
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}, [workspace, layout, props.scope, cssAssets, jsAssets, designer]);
|
|
91
|
+
return ref;
|
|
92
|
+
};
|
|
93
|
+
export const unmountSandboxContent = () => {
|
|
94
|
+
const root = globalThisPolyfill[ROOT_INSTANCE_KEY];
|
|
95
|
+
if (!root || typeof root.unmount !== 'function')
|
|
96
|
+
return;
|
|
97
|
+
// Clear the references first so repeated unload events remain idempotent.
|
|
98
|
+
globalThisPolyfill[ROOT_INSTANCE_KEY] = undefined;
|
|
99
|
+
globalThisPolyfill[ROOT_CONTAINER_KEY] = undefined;
|
|
100
|
+
root.unmount();
|
|
101
|
+
};
|
|
102
|
+
if (globalThisPolyfill.frameElement) {
|
|
103
|
+
globalThisPolyfill.addEventListener('unload', () => {
|
|
104
|
+
unmountSandboxContent();
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
globalThisPolyfill[UNMOUNT_KEY] = unmountSandboxContent;
|
|
108
|
+
export const useSandboxScope = () => {
|
|
109
|
+
return globalThisPolyfill['__DESIGNABLE_SANDBOX_SCOPE__'];
|
|
110
|
+
};
|
|
111
|
+
export const renderSandboxContent = (render) => {
|
|
112
|
+
if (isFn(render)) {
|
|
113
|
+
const container = document.getElementById('__SANDBOX_ROOT__');
|
|
114
|
+
if (!container)
|
|
115
|
+
return;
|
|
116
|
+
let root = globalThisPolyfill[ROOT_INSTANCE_KEY];
|
|
117
|
+
const rootContainer = globalThisPolyfill[ROOT_CONTAINER_KEY];
|
|
118
|
+
if (root && rootContainer !== container) {
|
|
119
|
+
unmountSandboxContent();
|
|
120
|
+
root = undefined;
|
|
121
|
+
}
|
|
122
|
+
if (!root) {
|
|
123
|
+
root = createRoot(container);
|
|
124
|
+
globalThisPolyfill[ROOT_INSTANCE_KEY] = root;
|
|
125
|
+
globalThisPolyfill[ROOT_CONTAINER_KEY] = container;
|
|
126
|
+
}
|
|
127
|
+
root.render(render(useSandboxScope()));
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
export const Sandbox = (props) => {
|
|
131
|
+
const { style } = props;
|
|
132
|
+
const iframeProps = { ...props };
|
|
133
|
+
delete iframeProps.cssAssets;
|
|
134
|
+
delete iframeProps.jsAssets;
|
|
135
|
+
delete iframeProps.scope;
|
|
136
|
+
delete iframeProps.style;
|
|
137
|
+
const ref = useSandbox(props);
|
|
138
|
+
return React.createElement('iframe', {
|
|
139
|
+
...iframeProps,
|
|
140
|
+
ref,
|
|
141
|
+
style: {
|
|
142
|
+
height: '100%',
|
|
143
|
+
width: '100%',
|
|
144
|
+
border: 'none',
|
|
145
|
+
display: 'block',
|
|
146
|
+
...style,
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
};
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ISandboxProps extends React.IframeHTMLAttributes<HTMLIFrameElement> {
|
|
3
|
+
style?: React.CSSProperties;
|
|
4
|
+
cssAssets?: string[];
|
|
5
|
+
jsAssets?: string[];
|
|
6
|
+
scope?: any;
|
|
7
|
+
}
|
|
8
|
+
export declare const useSandbox: (props: React.PropsWithChildren<ISandboxProps>) => React.RefObject<HTMLIFrameElement>;
|
|
9
|
+
export declare const unmountSandboxContent: () => void;
|
|
10
|
+
export declare const useSandboxScope: () => any;
|
|
11
|
+
export declare const renderSandboxContent: (render: (scope?: any) => React.ReactNode) => void;
|
|
12
|
+
export declare const Sandbox: React.FC<ISandboxProps>;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Sandbox = exports.renderSandboxContent = exports.useSandboxScope = exports.unmountSandboxContent = exports.useSandbox = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const client_1 = require("react-dom/client");
|
|
29
|
+
const designable_shared_1 = require("@thienvu18/designable-shared");
|
|
30
|
+
const designable_react_1 = require("@thienvu18/designable-react");
|
|
31
|
+
const ROOT_INSTANCE_KEY = '__DESIGNABLE_SANDBOX_ROOT_INSTANCE__';
|
|
32
|
+
const ROOT_CONTAINER_KEY = '__DESIGNABLE_SANDBOX_ROOT_CONTAINER__';
|
|
33
|
+
const UNMOUNT_KEY = '__DESIGNABLE_SANDBOX_UNMOUNT__';
|
|
34
|
+
const useSandbox = (props) => {
|
|
35
|
+
const ref = (0, react_1.useRef)(null);
|
|
36
|
+
const appCls = (0, designable_react_1.usePrefix)('app');
|
|
37
|
+
const designer = (0, designable_react_1.useDesigner)();
|
|
38
|
+
const workspace = (0, designable_react_1.useWorkspace)();
|
|
39
|
+
const layout = (0, designable_react_1.useLayout)();
|
|
40
|
+
const cssAssets = props.cssAssets || [];
|
|
41
|
+
const jsAssets = props.jsAssets || [];
|
|
42
|
+
const getCSSVar = (name) => {
|
|
43
|
+
const el = document.querySelector(`.${appCls}`);
|
|
44
|
+
return el ? getComputedStyle(el).getPropertyValue(name) : '';
|
|
45
|
+
};
|
|
46
|
+
(0, react_1.useEffect)(() => {
|
|
47
|
+
if (ref.current && workspace) {
|
|
48
|
+
const styles = cssAssets
|
|
49
|
+
?.map?.((css) => {
|
|
50
|
+
return `<link media="all" rel="stylesheet" href="${css}" />`;
|
|
51
|
+
})
|
|
52
|
+
.join('\n');
|
|
53
|
+
const scripts = jsAssets
|
|
54
|
+
?.map?.((js) => {
|
|
55
|
+
return `<script src="${js}" type="text/javascript" ></script>`;
|
|
56
|
+
})
|
|
57
|
+
.join('\n');
|
|
58
|
+
const contentWindow = ref.current.contentWindow;
|
|
59
|
+
const contentDocument = ref.current.contentDocument;
|
|
60
|
+
if (contentWindow && contentDocument) {
|
|
61
|
+
contentWindow[UNMOUNT_KEY]?.();
|
|
62
|
+
contentWindow['__DESIGNABLE_SANDBOX_SCOPE__'] = props.scope;
|
|
63
|
+
contentWindow['__DESIGNABLE_LAYOUT__'] = layout;
|
|
64
|
+
contentWindow['__DESIGNABLE_ENGINE__'] = designer;
|
|
65
|
+
contentWindow['__DESIGNABLE_WORKSPACE__'] = workspace;
|
|
66
|
+
contentWindow['Formily'] = designable_shared_1.globalThisPolyfill['Formily'];
|
|
67
|
+
contentWindow['Designable'] = designable_shared_1.globalThisPolyfill['Designable'];
|
|
68
|
+
contentDocument.open();
|
|
69
|
+
contentDocument.write(`
|
|
70
|
+
<!DOCTYPE html>
|
|
71
|
+
<head>
|
|
72
|
+
${styles}
|
|
73
|
+
</head>
|
|
74
|
+
<style>
|
|
75
|
+
html{
|
|
76
|
+
overflow: overlay;
|
|
77
|
+
}
|
|
78
|
+
::-webkit-scrollbar {
|
|
79
|
+
width: 5px;
|
|
80
|
+
height: 5px;
|
|
81
|
+
}
|
|
82
|
+
::-webkit-scrollbar-thumb {
|
|
83
|
+
background-color:${getCSSVar('--dn-scrollbar-color')};
|
|
84
|
+
border-radius: 0;
|
|
85
|
+
transition: all .25s ease-in-out;
|
|
86
|
+
}
|
|
87
|
+
::-webkit-scrollbar-thumb:hover {
|
|
88
|
+
background-color: ${getCSSVar('--dn-scrollbar-hover-color')};
|
|
89
|
+
}
|
|
90
|
+
body{
|
|
91
|
+
margin:0;
|
|
92
|
+
padding:0;
|
|
93
|
+
overflow-anchor: none;
|
|
94
|
+
user-select:none;
|
|
95
|
+
background-color:${layout?.theme === 'light' ? '#fff' : 'transparent'} !important;
|
|
96
|
+
}
|
|
97
|
+
html{
|
|
98
|
+
overflow-anchor: none;
|
|
99
|
+
}
|
|
100
|
+
.inherit-cusor * {
|
|
101
|
+
cursor: inherit !important;
|
|
102
|
+
}
|
|
103
|
+
</style>
|
|
104
|
+
<body>
|
|
105
|
+
<div id="__SANDBOX_ROOT__"></div>
|
|
106
|
+
${scripts}
|
|
107
|
+
</body>
|
|
108
|
+
</html>
|
|
109
|
+
`);
|
|
110
|
+
contentDocument.close();
|
|
111
|
+
return () => {
|
|
112
|
+
contentWindow[UNMOUNT_KEY]?.();
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}, [workspace, layout, props.scope, cssAssets, jsAssets, designer]);
|
|
117
|
+
return ref;
|
|
118
|
+
};
|
|
119
|
+
exports.useSandbox = useSandbox;
|
|
120
|
+
const unmountSandboxContent = () => {
|
|
121
|
+
const root = designable_shared_1.globalThisPolyfill[ROOT_INSTANCE_KEY];
|
|
122
|
+
if (!root || typeof root.unmount !== 'function')
|
|
123
|
+
return;
|
|
124
|
+
// Clear the references first so repeated unload events remain idempotent.
|
|
125
|
+
designable_shared_1.globalThisPolyfill[ROOT_INSTANCE_KEY] = undefined;
|
|
126
|
+
designable_shared_1.globalThisPolyfill[ROOT_CONTAINER_KEY] = undefined;
|
|
127
|
+
root.unmount();
|
|
128
|
+
};
|
|
129
|
+
exports.unmountSandboxContent = unmountSandboxContent;
|
|
130
|
+
if (designable_shared_1.globalThisPolyfill.frameElement) {
|
|
131
|
+
designable_shared_1.globalThisPolyfill.addEventListener('unload', () => {
|
|
132
|
+
(0, exports.unmountSandboxContent)();
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
designable_shared_1.globalThisPolyfill[UNMOUNT_KEY] = exports.unmountSandboxContent;
|
|
136
|
+
const useSandboxScope = () => {
|
|
137
|
+
return designable_shared_1.globalThisPolyfill['__DESIGNABLE_SANDBOX_SCOPE__'];
|
|
138
|
+
};
|
|
139
|
+
exports.useSandboxScope = useSandboxScope;
|
|
140
|
+
const renderSandboxContent = (render) => {
|
|
141
|
+
if ((0, designable_shared_1.isFn)(render)) {
|
|
142
|
+
const container = document.getElementById('__SANDBOX_ROOT__');
|
|
143
|
+
if (!container)
|
|
144
|
+
return;
|
|
145
|
+
let root = designable_shared_1.globalThisPolyfill[ROOT_INSTANCE_KEY];
|
|
146
|
+
const rootContainer = designable_shared_1.globalThisPolyfill[ROOT_CONTAINER_KEY];
|
|
147
|
+
if (root && rootContainer !== container) {
|
|
148
|
+
(0, exports.unmountSandboxContent)();
|
|
149
|
+
root = undefined;
|
|
150
|
+
}
|
|
151
|
+
if (!root) {
|
|
152
|
+
root = (0, client_1.createRoot)(container);
|
|
153
|
+
designable_shared_1.globalThisPolyfill[ROOT_INSTANCE_KEY] = root;
|
|
154
|
+
designable_shared_1.globalThisPolyfill[ROOT_CONTAINER_KEY] = container;
|
|
155
|
+
}
|
|
156
|
+
root.render(render((0, exports.useSandboxScope)()));
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
exports.renderSandboxContent = renderSandboxContent;
|
|
160
|
+
const Sandbox = (props) => {
|
|
161
|
+
const { style } = props;
|
|
162
|
+
const iframeProps = { ...props };
|
|
163
|
+
delete iframeProps.cssAssets;
|
|
164
|
+
delete iframeProps.jsAssets;
|
|
165
|
+
delete iframeProps.scope;
|
|
166
|
+
delete iframeProps.style;
|
|
167
|
+
const ref = (0, exports.useSandbox)(props);
|
|
168
|
+
return react_1.default.createElement('iframe', {
|
|
169
|
+
...iframeProps,
|
|
170
|
+
ref,
|
|
171
|
+
style: {
|
|
172
|
+
height: '100%',
|
|
173
|
+
width: '100%',
|
|
174
|
+
border: 'none',
|
|
175
|
+
display: 'block',
|
|
176
|
+
...style,
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
exports.Sandbox = Sandbox;
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@thienvu18/designable-react-sandbox",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"module": "esm/index.js",
|
|
7
|
+
"types": "esm/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"lib",
|
|
10
|
+
"esm",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE.md"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=20 <25"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/thienvu18/designable.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/thienvu18/designable/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/thienvu18/designable#readme",
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "rimraf -rf lib esm && npm run build:cjs && npm run build:esm",
|
|
27
|
+
"build:cjs": "tsc --project tsconfig.build.json --outDir lib",
|
|
28
|
+
"build:esm": "tsc --project tsconfig.build.json --module es2020 --outDir esm"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"react": ">=19 <20",
|
|
32
|
+
"react-dom": ">=19 <20"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@thienvu18/designable-react": "2.0.0",
|
|
36
|
+
"@thienvu18/designable-shared": "2.0.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@formily/json-schema": "^2.3.7",
|
|
40
|
+
"@formily/path": "^2.3.7",
|
|
41
|
+
"@formily/reactive": "^2.3.7",
|
|
42
|
+
"@formily/reactive-react": "^2.3.7",
|
|
43
|
+
"antd": "^6.6.3",
|
|
44
|
+
"react": "^19.2.8",
|
|
45
|
+
"react-dom": "^19.2.8",
|
|
46
|
+
"react-is": "^19.2.8",
|
|
47
|
+
"typescript": "5.2.2"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
}
|
|
52
|
+
}
|