diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 123df87a..175c5065 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -18,8 +18,6 @@ import App from './App'; -import './resetcss.css'; - export * from './events'; export { default as Env } from './Env'; diff --git a/packages/utils/package.json b/packages/utils/package.json index 1680dd1d..10229955 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -9,6 +9,10 @@ ".": { "import": "./dist/tmagic-utils.js", "require": "./dist/tmagic-utils.umd.cjs" + }, + "./resetcss.css": { + "import": "./src/resetcss.css", + "require": "./src/resetcss.css" } }, "license": "Apache-2.0", diff --git a/packages/core/src/resetcss.css b/packages/utils/src/resetcss.css similarity index 100% rename from packages/core/src/resetcss.css rename to packages/utils/src/resetcss.css diff --git a/playground/src/pages/Editor.vue b/playground/src/pages/Editor.vue index f6596054..06f6f5d1 100644 --- a/playground/src/pages/Editor.vue +++ b/playground/src/pages/Editor.vue @@ -30,6 +30,7 @@ v-if="previewVisible" ref="iframe" width="100%" + style="border: none" :height="stageRect && stageRect.height" :src="previewUrl" > diff --git a/runtime/react/dev.vite.config.ts b/runtime/react/dev.vite.config.ts index 2b17a3bd..e1e2cf09 100644 --- a/runtime/react/dev.vite.config.ts +++ b/runtime/react/dev.vite.config.ts @@ -28,6 +28,7 @@ export default defineConfig({ alias: [ { find: /^react$/, replacement: path.join(__dirname, 'node_modules/react/index.js') }, { find: /^react-dom$/, replacement: path.join(__dirname, 'node_modules/react-dom/index.js') }, + { find: /^@tmagic\/utils\/resetcss.css/, replacement: path.join(__dirname, '../../packages/utils') }, { find: /^@tmagic\/utils/, replacement: path.join(__dirname, '../../packages/utils/src/index.ts') }, { find: /^@tmagic\/core/, replacement: path.join(__dirname, '../../packages/core/src/index.ts') }, { find: /^@tmagic\/schema/, replacement: path.join(__dirname, '../../packages/schema/src/index.ts') }, diff --git a/runtime/react/page/main.tsx b/runtime/react/page/main.tsx index fcdf22fd..9b93b285 100644 --- a/runtime/react/page/main.tsx +++ b/runtime/react/page/main.tsx @@ -15,7 +15,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - import React from 'react'; import ReactDOM from 'react-dom'; @@ -28,6 +27,8 @@ import components from '../.tmagic/comp-entry'; import plugins from '../.tmagic/plugin-entry'; import App from './App'; + +import '@tmagic/utils/resetcss.css'; declare global { interface Window { magicDSL: MApp[]; diff --git a/runtime/react/playground/main.tsx b/runtime/react/playground/main.tsx index 0fed0888..e236b5db 100644 --- a/runtime/react/playground/main.tsx +++ b/runtime/react/playground/main.tsx @@ -31,6 +31,8 @@ import plugins from '../.tmagic/plugin-entry'; import App from './App'; +import '@tmagic/utils/resetcss.css'; + declare global { interface Window { appInstance: Core; diff --git a/runtime/vue2/dev.vite.config.ts b/runtime/vue2/dev.vite.config.ts index 1b09f04c..a86d5941 100644 --- a/runtime/vue2/dev.vite.config.ts +++ b/runtime/vue2/dev.vite.config.ts @@ -27,6 +27,7 @@ export default defineConfig({ resolve: { alias: [ { find: /^vue$/, replacement: path.join(__dirname, 'node_modules/vue/dist/vue.esm.js') }, + { find: /^@tmagic\/utils\/resetcss.css/, replacement: path.join(__dirname, '../../packages/utils') }, { find: /^@tmagic\/utils/, replacement: path.join(__dirname, '../../packages/utils/src/index.ts') }, { find: /^@tmagic\/core/, replacement: path.join(__dirname, '../../packages/core/src/index.ts') }, { find: /^@data-source/, replacement: path.join(__dirname, '../../packages/data-source/src') }, diff --git a/runtime/vue2/page/main.ts b/runtime/vue2/page/main.ts index a3d1d1a4..7330793c 100644 --- a/runtime/vue2/page/main.ts +++ b/runtime/vue2/page/main.ts @@ -28,6 +28,8 @@ import request from './utils/request'; import AppComponent from './App.vue'; import { getLocalConfig } from './utils'; +import '@tmagic/utils/resetcss.css'; + Vue.use(request); const app = new Core({ diff --git a/runtime/vue2/playground/main.ts b/runtime/vue2/playground/main.ts index 27431c71..9c657d59 100644 --- a/runtime/vue2/playground/main.ts +++ b/runtime/vue2/playground/main.ts @@ -22,6 +22,8 @@ import Core from '@tmagic/core'; import App from './App.vue'; +import '@tmagic/utils/resetcss.css'; + Promise.all([import('../.tmagic/comp-entry'), import('../.tmagic/plugin-entry')]).then(([components, plugins]) => { Object.entries(components.default).forEach(([type, component]: [string, any]) => { Vue.component(`magic-ui-${type}`, component); diff --git a/runtime/vue3/dev.vite.config.ts b/runtime/vue3/dev.vite.config.ts index 16a1c371..e2002780 100644 --- a/runtime/vue3/dev.vite.config.ts +++ b/runtime/vue3/dev.vite.config.ts @@ -28,6 +28,7 @@ export default defineConfig({ resolve: { alias: [ { find: /^vue$/, replacement: path.join(__dirname, 'node_modules/vue/dist/vue.esm-bundler.js') }, + { find: /^@tmagic\/utils\/resetcss.css/, replacement: path.join(__dirname, '../../packages/utils') }, { find: /^@tmagic\/utils/, replacement: path.join(__dirname, '../../packages/utils/src/index.ts') }, { find: /^@tmagic\/core/, replacement: path.join(__dirname, '../../packages/core/src/index.ts') }, { find: /^@tmagic\/data-source/, replacement: path.join(__dirname, '../../packages/data-source/src/index.ts') }, diff --git a/runtime/vue3/page/main.ts b/runtime/vue3/page/main.ts index 92668477..f810da01 100644 --- a/runtime/vue3/page/main.ts +++ b/runtime/vue3/page/main.ts @@ -28,6 +28,8 @@ import request from './utils/request'; import AppComponent from './App.vue'; import { getLocalConfig } from './utils'; +import '@tmagic/utils/resetcss.css'; + const magicApp = createApp(AppComponent); magicApp.use(request); diff --git a/runtime/vue3/playground/main.ts b/runtime/vue3/playground/main.ts index 4f950fc1..aab3017d 100644 --- a/runtime/vue3/playground/main.ts +++ b/runtime/vue3/playground/main.ts @@ -22,6 +22,8 @@ import Core from '@tmagic/core'; import App from './App.vue'; +import '@tmagic/utils/resetcss.css'; + Promise.all([import('../.tmagic/comp-entry'), import('../.tmagic/plugin-entry')]).then(([components, plugins]) => { const magicApp = createApp(App);