diff --git a/package.json b/package.json index 17f95b6..3d8d867 100644 --- a/package.json +++ b/package.json @@ -33,5 +33,8 @@ "style-loader": "^1.2.1", "webpack": "^4.43.0", "webpack-cli": "^3.3.11" + }, + "dependencies": { + "@codexteam/icons": "^0.0.6" } } diff --git a/src/assets/underline.svg b/src/assets/underline.svg deleted file mode 100644 index f977ac3..0000000 --- a/src/assets/underline.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/index.js b/src/index.js index 9558464..f76f225 100644 --- a/src/index.js +++ b/src/index.js @@ -1,14 +1,15 @@ /** * Build styles */ -require('./index.css').toString(); + import './index.css'; + import { IconUnderline } from '@codexteam/icons' -/** + /** * Underline Tool for the Editor.js * * Allows to wrap inline fragment and style it somehow. */ -class Underline { +export default class Underline { /** * Class name for term-tag * @@ -169,7 +170,7 @@ class Underline { * @returns {string} */ get toolboxIcon() { - return require('./assets/underline.svg').default; + return IconUnderline; } /** @@ -185,5 +186,3 @@ class Underline { }; } } - -module.exports = Underline; diff --git a/webpack.config.js b/webpack.config.js index 6d6f59a..5273f3e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -36,6 +36,7 @@ module.exports = { publicPath: '/', filename: 'bundle.js', library: 'Underline', - libraryTarget: 'umd' + libraryTarget: 'umd', + libraryExport: 'default' } }; diff --git a/yarn.lock b/yarn.lock index 5a80414..5dff0e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -701,6 +701,11 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@codexteam/icons@^0.0.6": + version "0.0.6" + resolved "https://registry.yarnpkg.com/@codexteam/icons/-/icons-0.0.6.tgz#5553ada48dddf5940851ccc142cfe17835c36ad3" + integrity sha512-L7Q5PET8PjKcBT5wp7VR+FCjwCi5PUp7rd/XjsgQ0CI5FJz0DphyHGRILMuDUdCW2MQT9NHbVr4QP31vwAkS/A== + "@types/json-schema@^7.0.4": version "7.0.4" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339"