From d260c869412576f356fa50dd561d33d7c23ef279 Mon Sep 17 00:00:00 2001 From: SonyLeo <746591437@qq.com> Date: Wed, 8 Jan 2025 03:57:54 -0800 Subject: [PATCH 1/3] fix: add Page JS alert info. --- packages/plugins/script/src/Main.vue | 37 ++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/packages/plugins/script/src/Main.vue b/packages/plugins/script/src/Main.vue index 12c8356488..27d0cdcfe5 100644 --- a/packages/plugins/script/src/Main.vue +++ b/packages/plugins/script/src/Main.vue @@ -6,13 +6,16 @@
- - 保存 - -
+
+ +
import { onBeforeUnmount } from 'vue' -import { Button } from '@opentiny/vue' +import { Alert } from '@opentiny/vue' import { VueMonaco, CloseIcon, LinkButton } from '@opentiny/tiny-engine-common' import { useHelp } from '@opentiny/tiny-engine-meta-register' import { initCompletion } from '@opentiny/tiny-engine-common/js/completion' @@ -44,9 +47,9 @@ export const api = { export default { components: { MonacoEditor: VueMonaco, - TinyButton: Button, CloseIcon, - LinkButton + LinkButton, + TinyAlert: Alert }, emits: ['close'], setup(props, { emit }) { @@ -181,4 +184,24 @@ export default { margin-left: 5px; } } + +.alert-container { + padding: 0 12px; + + .tiny-alert_custom { + border: 0; + padding: 8px 0; + margin-top: 12px; + margin-bottom: 0; + padding-left: 17px; + border-radius: 4px; + background: rgb(240, 247, 255); + } +} + +:deep(.tiny-alert__description) { + font-weight: 400; + letter-spacing: 0; + text-align: left; +} From 749a97f03f7fc9fbe29c56cda1d3b599635fd50d Mon Sep 17 00:00:00 2001 From: SonyLeo <746591437@qq.com> Date: Sun, 12 Jan 2025 19:55:31 -0800 Subject: [PATCH 2/3] fix: add placeholder info --- packages/common/package.json | 2 +- packages/configurator/package.json | 2 +- packages/design-core/package.json | 2 +- packages/plugins/script/src/Main.vue | 46 ++++++++++------------------ packages/plugins/state/package.json | 2 +- 5 files changed, 20 insertions(+), 34 deletions(-) diff --git a/packages/common/package.json b/packages/common/package.json index 7e11d9acb1..c13115effc 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -41,7 +41,7 @@ "axios": "~0.28.0", "css-tree": "^2.3.1", "eslint-linter-browserify": "8.57.0", - "monaco-editor": "0.33.0", + "monaco-editor": "0.51.0", "prettier": "2.7.1", "vue-draggable-next": "2.1.0" }, diff --git a/packages/configurator/package.json b/packages/configurator/package.json index 1cd793f117..0beabde44a 100644 --- a/packages/configurator/package.json +++ b/packages/configurator/package.json @@ -31,7 +31,7 @@ "@opentiny/tiny-engine-meta-register": "workspace:*", "@opentiny/tiny-engine-utils": "workspace:*", "@vue/shared": "^3.3.4", - "monaco-editor": "0.33.0", + "monaco-editor": "0.51.0", "vue-draggable-next": "2.1.0" }, "publishConfig": { diff --git a/packages/design-core/package.json b/packages/design-core/package.json index cb69bfe9ef..82f425b5f6 100644 --- a/packages/design-core/package.json +++ b/packages/design-core/package.json @@ -96,7 +96,7 @@ "eslint-linter-browserify": "8.57.0", "file-saver": "^2.0.5", "html2canvas": "^1.4.1", - "monaco-editor": "0.33.0", + "monaco-editor": "0.51.0", "prettier": "2.7.1", "sortablejs": "^1.14.0", "vue-i18n": "^9.9.0" diff --git a/packages/plugins/script/src/Main.vue b/packages/plugins/script/src/Main.vue index 27d0cdcfe5..07c4ed33e4 100644 --- a/packages/plugins/script/src/Main.vue +++ b/packages/plugins/script/src/Main.vue @@ -6,16 +6,13 @@
+ + 保存 + +
-
- -
import { onBeforeUnmount } from 'vue' -import { Alert } from '@opentiny/vue' +import { Button } from '@opentiny/vue' import { VueMonaco, CloseIcon, LinkButton } from '@opentiny/tiny-engine-common' import { useHelp } from '@opentiny/tiny-engine-meta-register' import { initCompletion } from '@opentiny/tiny-engine-common/js/completion' @@ -47,9 +44,9 @@ export const api = { export default { components: { MonacoEditor: VueMonaco, + TinyButton: Button, CloseIcon, - LinkButton, - TinyAlert: Alert + LinkButton }, emits: ['close'], setup(props, { emit }) { @@ -61,6 +58,15 @@ export default { minimap: { enabled: false }, + placeholder: `// ✅ 函数声明(可以保存) + \n function topLevelFunction(){ + \n const message = 'hello tiny-engine.' + \n console.log(message) + \n } + \n \n // ❌ 变量声明/表达式(不能保存) \n + // 顶层/常规 变量声明 \n const someVariable = 42 \n + // 表达式 \n const result = someVariable + 10`, + // 禁用滚动条边边一直显示的边框 overviewRulerBorder: false, renderLineHighlightOnlyWhenFocus: true @@ -184,24 +190,4 @@ export default { margin-left: 5px; } } - -.alert-container { - padding: 0 12px; - - .tiny-alert_custom { - border: 0; - padding: 8px 0; - margin-top: 12px; - margin-bottom: 0; - padding-left: 17px; - border-radius: 4px; - background: rgb(240, 247, 255); - } -} - -:deep(.tiny-alert__description) { - font-weight: 400; - letter-spacing: 0; - text-align: left; -} diff --git a/packages/plugins/state/package.json b/packages/plugins/state/package.json index 33e287781d..972346a285 100644 --- a/packages/plugins/state/package.json +++ b/packages/plugins/state/package.json @@ -28,7 +28,7 @@ "@opentiny/tiny-engine-common": "workspace:*", "@opentiny/tiny-engine-meta-register": "workspace:*", "@opentiny/tiny-engine-utils": "workspace:*", - "monaco-editor": "0.33.0" + "monaco-editor": "0.51.0" }, "devDependencies": { "@opentiny/tiny-engine-vite-plugin-meta-comments": "workspace:*", From c27e7dd77671a3008d8badcdbdb61e14c8c8b9cc Mon Sep 17 00:00:00 2001 From: SonyLeo <746591437@qq.com> Date: Mon, 13 Jan 2025 01:30:58 -0800 Subject: [PATCH 3/3] fix: increase code indentation and optimize expression --- packages/plugins/script/src/Main.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/plugins/script/src/Main.vue b/packages/plugins/script/src/Main.vue index 07c4ed33e4..d1b3962f48 100644 --- a/packages/plugins/script/src/Main.vue +++ b/packages/plugins/script/src/Main.vue @@ -58,14 +58,14 @@ export default { minimap: { enabled: false }, - placeholder: `// ✅ 函数声明(可以保存) - \n function topLevelFunction(){ - \n const message = 'hello tiny-engine.' - \n console.log(message) + placeholder: `// ✅ 函数声明可以保存 + \n function topLevelFunction(){ \n + \u200B \u200B const message = 'hello tiny-engine.' \n + \u200B \u200B console.log(message) \n } - \n \n // ❌ 变量声明/表达式(不能保存) \n - // 顶层/常规 变量声明 \n const someVariable = 42 \n - // 表达式 \n const result = someVariable + 10`, + \n + // ❌ 顶层/常规 变量声明 \n const someVariable = 42 \n + // ❌ 表达式 \n const result = someVariable + 10`, // 禁用滚动条边边一直显示的边框 overviewRulerBorder: false,