@ray-js/code-sandbox 0.0.7-beta-6 → 0.0.7-beta-9

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.
@@ -33,7 +33,6 @@ export interface UseCodeSandboxDrawerOps {
33
33
  editorApi?: EditorAPI;
34
34
  cssCode?: string;
35
35
  styMap?: any;
36
- fileName?: string;
37
36
  cssParse?: (css: string) => Promise<string>;
38
37
  }
39
38
  export declare const useCodeSandboxDrawer: ({ getContainer, title, height, placement, isZhLanguage, pageName, txpCode, emptyText, langKey, baseUri, code, editorApi, cssCode, styMap, cssParse, }: UseCodeSandboxDrawerOps) => {
@@ -53,4 +52,7 @@ export declare const CodeSandboxButton: React.FC<{
53
52
  isZhLanguage?: boolean;
54
53
  editorApi?: EditorAPI;
55
54
  buttonProps?: ButtonProps;
55
+ cssCode?: string;
56
+ styMap?: any;
57
+ cssParse?: (css: string) => Promise<string>;
56
58
  }>;
@@ -57,13 +57,13 @@ export const CodeSandbox = _ref => {
57
57
  isZhLanguage: isZhLanguage,
58
58
  baseUri: baseUri,
59
59
  txpCode: txpCode,
60
- height: `calc(90vh - 103px + 48px)`,
60
+ height: "calc(90vh - 103px + 48px)",
61
61
  style: {
62
62
  width: '50%'
63
63
  },
64
64
  show: show,
65
65
  title: title,
66
- fileName: "main.less",
66
+ fileName: `${txpCode || 'main'}.less`,
67
67
  code: cssCode,
68
68
  onChange: newCode => {
69
69
  postStyleCode(newCode);
@@ -73,7 +73,8 @@ export const CodeSandbox = _ref => {
73
73
  isZhLanguage: isZhLanguage,
74
74
  baseUri: baseUri,
75
75
  txpCode: txpCode,
76
- height: `calc(90vh - 103px + 48px)`,
76
+ fileName: `${txpCode || 'main'}.tsx`,
77
+ height: "calc(90vh - 103px + 48px)",
77
78
  style: {
78
79
  width: '50%'
79
80
  },
@@ -88,7 +89,7 @@ export const CodeSandbox = _ref => {
88
89
  isZhLanguage: isZhLanguage,
89
90
  baseUri: baseUri,
90
91
  txpCode: txpCode,
91
- height: `calc(90vh - 103px + 48px)`,
92
+ height: "calc(90vh - 103px + 48px)",
92
93
  ref: apiRef,
93
94
  show: show,
94
95
  title: title,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/code-sandbox",
3
- "version": "0.0.7-beta-6",
3
+ "version": "0.0.7-beta-9",
4
4
  "description": "小程序 CodeSandbox 容器",
5
5
  "main": "lib/index",
6
6
  "files": [
@@ -27,7 +27,8 @@
27
27
  "start:tuya": "ray start ./example",
28
28
  "start:wechat": "ray start ./example -t wechat --verbose",
29
29
  "start:web": "ray start ./example -t web",
30
- "release-it": "standard-version"
30
+ "release-it": "standard-version",
31
+ "prepublishOnly": "yarn build"
31
32
  },
32
33
  "peerDependencies": {
33
34
  "@ray-js/ray": "^1.4.9"