@ray-js/code-sandbox 0.0.3-beta-2 → 0.0.3-beta-4
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.
|
@@ -7,7 +7,7 @@ export interface CodeEditorProps {
|
|
|
7
7
|
height: string;
|
|
8
8
|
txpCode: string;
|
|
9
9
|
baseUri: string;
|
|
10
|
-
isZhLanguage
|
|
10
|
+
isZhLanguage: boolean;
|
|
11
11
|
}
|
|
12
12
|
export declare const CodeEditor: React.ForwardRefExoticComponent<CodeEditorProps & React.RefAttributes<{
|
|
13
13
|
monaco: typeof import("monaco-editor");
|
|
@@ -8,6 +8,7 @@ export interface CodeSandboxProps {
|
|
|
8
8
|
baseUri: string;
|
|
9
9
|
langKey?: string;
|
|
10
10
|
emptyText?: string;
|
|
11
|
+
isZhLanguage?: boolean;
|
|
11
12
|
}
|
|
12
13
|
export declare const CodeSandbox: React.FC<CodeSandboxProps>;
|
|
13
14
|
export declare const checkShowCodeSandbox: (code: string) => boolean;
|
|
@@ -20,4 +21,5 @@ export declare const CodeSandboxButton: React.FC<{
|
|
|
20
21
|
baseUri: string;
|
|
21
22
|
langKey?: string;
|
|
22
23
|
emptyText?: string;
|
|
24
|
+
isZhLanguage?: boolean;
|
|
23
25
|
}>;
|
|
@@ -15,7 +15,8 @@ export const CodeSandbox = _ref => {
|
|
|
15
15
|
pageName = 'playground',
|
|
16
16
|
baseUri,
|
|
17
17
|
langKey,
|
|
18
|
-
emptyText
|
|
18
|
+
emptyText,
|
|
19
|
+
isZhLanguage
|
|
19
20
|
} = _ref;
|
|
20
21
|
const iframeRef = useRef();
|
|
21
22
|
const [ts, setTs] = useState(Date.now());
|
|
@@ -39,6 +40,7 @@ export const CodeSandbox = _ref => {
|
|
|
39
40
|
}
|
|
40
41
|
}, 500), [show]);
|
|
41
42
|
return /*#__PURE__*/React.createElement(Contain, null, /*#__PURE__*/React.createElement(Content, null, /*#__PURE__*/React.createElement(Main, null, /*#__PURE__*/React.createElement(CodeEditor, {
|
|
43
|
+
isZhLanguage: isZhLanguage,
|
|
42
44
|
baseUri: baseUri,
|
|
43
45
|
txpCode: txpCode,
|
|
44
46
|
height: `calc(90vh - 103px + 48px)`,
|
|
@@ -78,7 +80,8 @@ export const CodeSandboxButton = _ref2 => {
|
|
|
78
80
|
pageName,
|
|
79
81
|
baseUri,
|
|
80
82
|
emptyText,
|
|
81
|
-
langKey
|
|
83
|
+
langKey,
|
|
84
|
+
isZhLanguage
|
|
82
85
|
} = _ref2;
|
|
83
86
|
const [show, setShow] = useState(false);
|
|
84
87
|
const ref = useRef();
|
|
@@ -117,6 +120,7 @@ export const CodeSandboxButton = _ref2 => {
|
|
|
117
120
|
setShow(false);
|
|
118
121
|
}
|
|
119
122
|
}, /*#__PURE__*/React.createElement(CodeSandbox, {
|
|
123
|
+
isZhLanguage: isZhLanguage,
|
|
120
124
|
emptyText: emptyText,
|
|
121
125
|
langKey: langKey,
|
|
122
126
|
baseUri: baseUri,
|
package/lib/txp/demo/index.js
CHANGED
|
@@ -16,7 +16,7 @@ export const Demo = /*#__PURE__*/React.forwardRef((_ref, parentRef) => {
|
|
|
16
16
|
emptyText
|
|
17
17
|
} = _ref;
|
|
18
18
|
let path = `${createCompnentUri(baseUri, txpCode, `index.html`)}?t=${ts || Date.now()}`;
|
|
19
|
-
path += `#!/pages/${comId}/index
|
|
19
|
+
path += `#!/pages/${comId}/index?langKey=${langKey}`;
|
|
20
20
|
const ref = useRef();
|
|
21
21
|
useImperativeHandle(parentRef, () => ({
|
|
22
22
|
postMsg: data => {
|