@ray-js/code-sandbox 0.0.7-beta-7 → 0.0.7-beta-10
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/lib/decoder/index.d.ts
CHANGED
package/lib/decoder/index.js
CHANGED
|
@@ -8,13 +8,15 @@ export const Decoder = _ref => {
|
|
|
8
8
|
children,
|
|
9
9
|
loadingText,
|
|
10
10
|
grammarErrText,
|
|
11
|
-
refreshButtonText
|
|
11
|
+
refreshButtonText,
|
|
12
|
+
channel
|
|
12
13
|
} = _ref;
|
|
13
14
|
return /*#__PURE__*/React.createElement(CatchError, {
|
|
14
15
|
loadingText: loadingText,
|
|
15
16
|
grammarErrText: grammarErrText,
|
|
16
17
|
refreshButtonText: refreshButtonText
|
|
17
18
|
}, /*#__PURE__*/React.createElement(Channel, {
|
|
19
|
+
channel: channel,
|
|
18
20
|
binddata: event => {
|
|
19
21
|
const code = Bases64.decode(event.detail);
|
|
20
22
|
onCodeChange(code);
|
package/lib/listener/index.d.ts
CHANGED
package/lib/listener/index.js
CHANGED
package/lib/listener/index.sjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
init(newVal, oldVal, ownerInstance) {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const eventName = newVal || 'sandbox-jsrun';
|
|
4
|
+
ownerInstance.eventChannel.on(eventName, event => {
|
|
5
|
+
console.log(`[sandbox] trigger `, eventName, event);
|
|
5
6
|
ownerInstance.triggerEvent('data', event);
|
|
6
7
|
});
|
|
7
8
|
},
|
package/lib/listener/index.tyml
CHANGED
|
@@ -63,7 +63,7 @@ export const CodeSandbox = _ref => {
|
|
|
63
63
|
},
|
|
64
64
|
show: show,
|
|
65
65
|
title: title,
|
|
66
|
-
fileName:
|
|
66
|
+
fileName: `${txpCode || 'main'}.less`,
|
|
67
67
|
code: cssCode,
|
|
68
68
|
onChange: newCode => {
|
|
69
69
|
postStyleCode(newCode);
|
|
@@ -73,6 +73,7 @@ export const CodeSandbox = _ref => {
|
|
|
73
73
|
isZhLanguage: isZhLanguage,
|
|
74
74
|
baseUri: baseUri,
|
|
75
75
|
txpCode: txpCode,
|
|
76
|
+
fileName: `${txpCode || 'main'}.tsx`,
|
|
76
77
|
height: "calc(90vh - 103px + 48px)",
|
|
77
78
|
style: {
|
|
78
79
|
width: '50%'
|