diff --git a/.assets/css/admin.scss b/.assets/css/admin.scss new file mode 100644 index 0000000..7cb2d22 --- /dev/null +++ b/.assets/css/admin.scss @@ -0,0 +1,2 @@ +@import "../../lib/Lib/assets/css/layout"; +@import "../../lib/Lib/assets/css/card"; diff --git a/assets/src/fonts/.gitkeep b/.assets/images/.gitkeep similarity index 100% rename from assets/src/fonts/.gitkeep rename to .assets/images/.gitkeep diff --git a/assets/src/images/.gitkeep b/.assets/js/.gitkeep similarity index 100% rename from assets/src/images/.gitkeep rename to .assets/js/.gitkeep diff --git a/assets/css/admin.asset.php b/assets/css/admin.asset.php new file mode 100644 index 0000000..fb561b6 --- /dev/null +++ b/assets/css/admin.asset.php @@ -0,0 +1 @@ + array(), 'version' => '4a44ffb22ebd9b0a0ab6'); diff --git a/assets/css/admin.css b/assets/css/admin.css new file mode 100644 index 0000000..213e51a --- /dev/null +++ b/assets/css/admin.css @@ -0,0 +1 @@ +.pev-wrap{margin-left:auto;margin-right:auto;max-width:1400px;padding-right:20px}.pev-navbar{margin:0 0 1em}.pev-navbar+.subsubsub{margin:-8px 0 0}.pev-poststuff{margin-right:340px;margin-top:10px}.pev-poststuff .column-1{float:left;min-width:463px;width:100%}.pev-poststuff .column-2{float:right;margin-right:-340px;width:320px}@media only screen and (max-width:850px){.pev-poststuff{margin-right:0}.pev-poststuff .column-1,.pev-poststuff .column-2{float:none;margin-right:0;min-width:0;width:100%}}.pev-card,.pev-panel{background:#fff;border:1px solid #e1e2e2;box-sizing:border-box;display:block;font-size:13px;line-height:1.5;margin:0 auto 1.5em;max-width:none;min-height:1px;min-width:auto;position:relative;width:100%}.pev-card [class*=pev],.pev-panel [class*=pev]{box-sizing:inherit}.pev-card:after,.pev-card:before,.pev-panel:after,.pev-panel:before{box-sizing:inherit;content:"";display:table}.pev-card h2,.pev-card h3,.pev-card h4,.pev-card h5,.pev-card h6,.pev-panel h2,.pev-panel h3,.pev-panel h4,.pev-panel h5,.pev-panel h6{margin-top:0;padding-top:0}.pev-card ol li,.pev-card ul li,.pev-panel ol li,.pev-panel ul li{line-height:1.7;margin-bottom:.5em}.pev-card>.pev-card__body,.pev-panel{color:#555;position:relative}.pev-card>.pev-card__body h2,.pev-card>.pev-card__body h3,.pev-card>.pev-card__body h4,.pev-panel h2,.pev-panel h3,.pev-panel h4{color:inherit}.pev-card>.pev-card__body>:first-child,.pev-panel>:first-child{margin-top:0}.pev-card>.pev-card__body table:not(.widefat),.pev-panel table:not(.widefat){width:100%}.pev-card>.pev-card__body table:not(.widefat) td,.pev-card>.pev-card__body table:not(.widefat) th,.pev-panel table:not(.widefat) td,.pev-panel table:not(.widefat) th{text-align:left;vertical-align:top}.pev-card>.pev-card__body table:not(.widefat) th,.pev-panel table:not(.widefat) th{padding:0 6px 6px 0}.pev-card>.pev-card__body table:not(.widefat) td,.pev-panel table:not(.widefat) td{padding:0 0 6px}.pev-card>.pev-card__body a:active,.pev-card>.pev-card__body a:focus,.pev-panel a:active,.pev-panel a:focus{box-shadow:none;outline:none}.pev-card__group,.pev-panel__group{align-items:center;box-sizing:border-box;display:flex;flex-wrap:nowrap;gap:10px;justify-content:space-between;margin-bottom:1em;min-height:25px}.pev-card__group>.icon,.pev-card__group>img,.pev-panel__group>.icon,.pev-panel__group>img{border-radius:6px;height:54px;object-fit:cover;width:54px}.pev-card__group>.icon,.pev-panel__group>.icon{align-items:center;background-color:#f5f5f5;color:#777;display:flex;font-size:50px;justify-content:center;line-height:54px}.pev-card__group>div,.pev-panel__group>div{align-items:center;display:flex;gap:10px}.pev-card h2,.pev-card h3,.pev-card__title{color:inherit;font-size:14px;font-weight:600;margin:0;padding:0}.pev-card__subtitle{color:#777;font-size:13px;font-weight:400}.pev-card>.pev-card__footer,.pev-card>.pev-card__header{align-items:center;display:flex;flex-direction:row;justify-content:space-between}.pev-card>.pev-card__footer h2,.pev-card>.pev-card__footer h3,.pev-card>.pev-card__footer p,.pev-card>.pev-card__header h2,.pev-card>.pev-card__header h3,.pev-card>.pev-card__header p{margin:0;padding:0}.pev-card>.pev-card__footer .select2,.pev-card>.pev-card__footer button,.pev-card>.pev-card__footer input,.pev-card>.pev-card__footer select,.pev-card>.pev-card__header .select2,.pev-card>.pev-card__header button,.pev-card>.pev-card__header input,.pev-card>.pev-card__header select{margin-right:5px}.pev-card>.pev-card__footer .select2:last-child,.pev-card>.pev-card__footer button:last-child,.pev-card>.pev-card__footer input:last-child,.pev-card>.pev-card__footer select:last-child,.pev-card>.pev-card__header .select2:last-child,.pev-card>.pev-card__header button:last-child,.pev-card>.pev-card__header input:last-child,.pev-card>.pev-card__header select:last-child{margin-right:0}.pev-card>[class*=pev-card]:not([class*=wide]){padding:8px 10px}.pev-card>[class*=pev-card__]:not(:last-child){border-bottom:1px solid #e1e2e2}.pev-panel{padding:8px 10px}.pev-panel__title{font-size:18px;line-height:1.2;padding:0}.pev-panel__subtitle,.pev-panel__title{font-family:HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,sans-serif;font-weight:400;margin:0}.pev-panel__subtitle{color:#777;font-size:13px;line-height:1.6em}.pev-panel__legend{background-color:rgba(0,0,0,0);border-bottom-left-radius:8px;border-color:rgba(0,0,0,0) rgba(0,0,0,0) #e5e5e5 #e5e5e5;border-style:solid;border-width:1px;color:#aaa;font-size:11px;line-height:1em;padding:3px 2px 4px 7px;position:absolute;right:-1px;top:-1px;z-index:11}.promo-panel .pev-panel__legend{border-color:rgba(0,0,0,0) rgba(0,0,0,0) currentColor currentColor;color:#fff}.pev-panel:has(.pev-panel__legend){padding-top:20px}.pev-panel.promo-panel{background-color:#482ac9;border-color:#482ac9;color:#fff}.pev-panel.promo-panel a:not(.button){color:#fff}.pev-panel.promo-panel .button{color:#482ac9;display:block;font-weight:700;margin-top:20px;text-align:center;text-transform:uppercase} diff --git a/assets/src/css/admin.scss b/assets/src/css/admin.scss deleted file mode 100644 index 3c0a8ec..0000000 --- a/assets/src/css/admin.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import "../../../lib/Lib/assets/css/layout"; -@import "../../../lib/Lib/assets/css/card"; diff --git a/assets/src/js/.gitkeep b/assets/src/js/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/webpack.config.js b/webpack.config.js index 2bdaa3a..3efba82 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,6 @@ const defaultConfig = require('@wordpress/scripts/config/webpack.config'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); +const path = require('path'); const RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts'); module.exports = [ @@ -6,19 +8,52 @@ module.exports = [ ...defaultConfig, entry: { ...defaultConfig.entry(), - 'css/admin': './assets/src/css/admin.scss', + 'css/admin': './.assets/css/admin.scss', }, output: { ...defaultConfig.output, filename: '[name].js', - path: __dirname + '/assets/dist/', + path: __dirname + '/assets/', }, - plugins: [ - ...defaultConfig.plugins, - new RemoveEmptyScriptsPlugin({ - stage: RemoveEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS, - remove: /\.(js)$/, - }), - ], - }, + module: { + rules: [ + ...defaultConfig.module.rules, + { + test: /\.svg$/, + issuer: /\.(j|t)sx?$/, + use: ['@svgr/webpack', 'url-loader'], + type: 'javascript/auto', + }, + { + test: /\.svg$/, + issuer: /\.(sc|sa|c)ss$/, + type: 'asset/inline', + }, + { + test: /\.(bmp|png|jpe?g|gif)$/i, + type: 'asset/resource', + generator: { + filename: 'images/[name].[hash:8][ext]', + }, + }, + ], + }, + plugins: [ + ...defaultConfig.plugins, + // Copy images to the build folder. + // new CopyWebpackPlugin({ + // patterns: [ + // { + // from: path.resolve(__dirname, '.assets/images'), + // to: path.resolve(__dirname, 'assets/images'), + // } + // ] + // }), + + new RemoveEmptyScriptsPlugin({ + stage: RemoveEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS, + remove: /\.(js)$/, + }), + ], + }, ];