diff --git a/package.json b/package.json index 1aebb425..5861dfc1 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,22 @@ "version": "2.0.0", "description": "A React editor written in TS with slate.js for lego-webapp", "type": "module", - "main": "dist/lego-editor.js", + "main": "./dist/lego-editor.umd.cjs", + "module": "./dist/lego-editor.js", + "style": "dist/style.css", "files": [ - "dist/**/*" + "dist" ], + "exports": { + ".": { + "import": "./dist/lego-editor.js", + "require": "./dist/lego-editor.umd.cjs" + }, + "./dist/style.css": { + "import": "./dist/style.css", + "require": "./dist/style.css" + } + }, "types": "dist/index.d.ts", "scripts": { "prepublish": "yarn ts && yarn build", diff --git a/src/components/Toolbar.css b/src/components/Toolbar.css index 22e1ccda..9368b13d 100644 --- a/src/components/Toolbar.css +++ b/src/components/Toolbar.css @@ -1,6 +1,7 @@ @import '../variables.css'; ._legoEditor_Toolbar_root { + z-index: 2; border-bottom: 1px solid var(--color-mono-gray-4); padding-left: 10px; position: sticky; diff --git a/vite.config.ts b/vite.config.ts index ffe80cdc..a5655f8c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,7 +7,7 @@ export default defineConfig({ build: { lib: { entry: resolve(__dirname, 'src/index.tsx'), - formats: ['es'], + name: 'lego-editor', }, sourcemap: true, rollupOptions: {