diff --git a/.gitignore b/.gitignore index 21108a637..b7fa43231 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/flyntPremium/ /dist node_modules npm-debug.log diff --git a/Components/GridContentLists/README.md b/Components/GridContentLists/README.md deleted file mode 100644 index f6f65165f..000000000 --- a/Components/GridContentLists/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Title: Grid Content Lists - ---- - -Category: Grid - ---- - -Tags: lists, wysiwyg, links - ---- - -Text: Multiple formatted text boxes with special full-width list styling, typically used for internal site links, or other additional resources. Up to 4 boxes show side by side on desktop, 2 on tablet and 1 on mobile. diff --git a/Components/GridContentLists/_style.scss b/Components/GridContentLists/_style.scss deleted file mode 100644 index e7b267016..000000000 --- a/Components/GridContentLists/_style.scss +++ /dev/null @@ -1,64 +0,0 @@ - -[is='flynt-grid-content-lists'] { - ul { - @include reset-list; - } - - .gridLinkList { - display: flex; - flex-wrap: wrap; - justify-content: center; - margin: -20px -10px 0; - - &-item { - max-width: 400px; - padding: 20px 10px 0; - width: 100%; - - @media (min-width: $breakpoint-tablet) { - width: 50%; - } - - @media (min-width: $breakpoint-tablet-horizontal) { - width: 25%; - } - } - } - - .content { - @include reset-content-margins; - - background-color: $color-background; - color: $color-text; - height: 100%; - - #{$heading-selectors} { - color: $color-headline; - } - - li { - border-bottom: 1px solid rgba(0, 0, 0, 0.06); - color: $color-text; - padding: 5px 0; - - &:last-child { - border-bottom: 0; - } - - > a { - color: $color-text; - position: relative; - text-decoration: none; - transition: color 0.3s cubic-bezier(0.19, 1, 0.22, 1); - - &::after { - content: '\00a0➟'; - } - - &:hover { - color: $color-accent; - } - } - } - } -} diff --git a/Components/GridContentLists/functions.php b/Components/GridContentLists/functions.php deleted file mode 100644 index c6b90c604..000000000 --- a/Components/GridContentLists/functions.php +++ /dev/null @@ -1,73 +0,0 @@ - [ - 'name' => 'GridContentLists', - 'label' => 'Grid: Content Lists', - 'sub_fields' => [ - [ - 'label' => 'General', - 'name' => 'generalTab', - 'type' => 'tab', - 'placement' => 'top', - 'endpoint' => 0 - ], - [ - 'label' => 'Pre-Content', - 'name' => 'preContentHtml', - 'type' => 'wysiwyg', - 'instructions' => 'Want to add a headline? And a paragraph? Go ahead! Or just leave it empty and nothing will be shown.', - 'tabs' => 'visual,text', - 'media_upload' => 0, - 'delay' => 1, - 'wrapper' => [ - 'class' => 'autosize', - ], - ], - [ - 'label' => 'Blocks', - 'type' => 'repeater', - 'name' => 'blocks', - 'collapsed' => '', - 'layout' => 'block', - 'button_label' => 'Add Block', - 'wrapper' => [ - 'width' => '100' - ], - 'sub_fields' => [ - [ - 'label' => 'Content', - 'name' => 'contentHtml', - 'type' => 'wysiwyg', - 'tabs' => 'visual,text', - 'media_upload' => 0, - 'delay' => 1, - 'wrapper' => [ - 'class' => 'autosize', - ], - ] - ] - ], - [ - 'label' => 'Options', - 'name' => 'optionsTab', - 'type' => 'tab', - 'placement' => 'top', - 'endpoint' => 0 - ], - [ - 'label' => '', - 'name' => 'options', - 'type' => 'group', - 'layout' => 'row', - 'sub_fields' => [ - Api::loadFields('FieldVariables', 'theme') - ] - ] - ] - ] -]); diff --git a/Components/GridContentLists/index.twig b/Components/GridContentLists/index.twig deleted file mode 100644 index 8bf74e4d0..000000000 --- a/Components/GridContentLists/index.twig +++ /dev/null @@ -1,18 +0,0 @@ -
diff --git a/Components/GridContentLists/screenshot.png b/Components/GridContentLists/screenshot.png deleted file mode 100644 index 1d5572add..000000000 Binary files a/Components/GridContentLists/screenshot.png and /dev/null differ diff --git a/assets/admin.js b/assets/admin.js index 8f95f8283..012465a52 100644 --- a/assets/admin.js +++ b/assets/admin.js @@ -1,3 +1,4 @@ +/* global PREMIUM_COMPONENTS_EXIST */ import './admin.scss' function importAll (r) { @@ -5,3 +6,6 @@ function importAll (r) { } importAll(require.context('../Components/', true, /admin\.js$/)) +if (PREMIUM_COMPONENTS_EXIST) { + importAll(require.context('../flyntPremium/Components/', true, /admin\.js$/)) +} diff --git a/assets/admin.scss b/assets/admin.scss index 4051b1d25..95e03cd9c 100644 --- a/assets/admin.scss +++ b/assets/admin.scss @@ -4,3 +4,5 @@ // stylelint-disable-next-line scss/at-import-no-partial-leading-underscore, scss/at-import-partial-extension-blacklist @import '../Components/*/_admin.scss'; +// stylelint-disable-next-line scss/at-import-no-partial-leading-underscore, scss/at-import-partial-extension-blacklist +@import '../FlyntPremium/Components/*/_admin.scss'; diff --git a/assets/main.js b/assets/main.js index c52d4a016..cb2711f5b 100644 --- a/assets/main.js +++ b/assets/main.js @@ -1,3 +1,4 @@ +/* global PREMIUM_COMPONENTS_EXIST */ import 'console-polyfill' import 'normalize.css/normalize.css' import './main.scss' @@ -25,3 +26,6 @@ function importAll (r) { } importAll(require.context('../Components/', true, /script\.js$/)) +if (PREMIUM_COMPONENTS_EXIST) { + importAll(require.context('../FlyntPremium/Components/', true, /script\.js$/)) +} diff --git a/assets/main.scss b/assets/main.scss index 16b2ee39b..16817d12c 100644 --- a/assets/main.scss +++ b/assets/main.scss @@ -7,3 +7,5 @@ // stylelint-disable-next-line scss/at-import-no-partial-leading-underscore, scss/at-import-partial-extension-blacklist @import '../Components/*/_style.scss'; +// stylelint-disable-next-line scss/at-import-no-partial-leading-underscore, scss/at-import-partial-extension-blacklist +@import '../FlyntPremium/Components/*/_style.scss'; diff --git a/bs-server.js b/bs-server.js index 02488500c..297d14be5 100644 --- a/bs-server.js +++ b/bs-server.js @@ -33,7 +33,7 @@ bundler.plugin('done', function (bundles) { }) }) -function checkAssets(stats, bundleHashes) { +function checkAssets (stats, bundleHashes) { try { const changedFiles = Object.keys(stats.compilation.assets) .filter(name => { diff --git a/functions.php b/functions.php index 25ee41468..af3b4f1ed 100644 --- a/functions.php +++ b/functions.php @@ -17,4 +17,7 @@ FileLoader::loadPhpFiles('inc'); add_action('after_setup_theme', ['Flynt\Init', 'initTheme']); add_action('after_setup_theme', ['Flynt\Init', 'loadComponents'], 101); + if (file_exists(__DIR__ . '/flyntPremium/functions.php')) { + require_once __DIR__ . '/flyntPremium/functions.php'; + } } diff --git a/inc/fieldGroups/pageComponents.php b/inc/fieldGroups/pageComponents.php index d705ce2ad..d6c6d9d63 100644 --- a/inc/fieldGroups/pageComponents.php +++ b/inc/fieldGroups/pageComponents.php @@ -27,7 +27,6 @@ Api::loadFields('BlockWysiwyg', 'layout'), Api::loadFields('BlockWysiwygTwoCol', 'layout'), Api::loadFields('BlockWysiwygSidebar', 'layout'), - Api::loadFields('GridContentLists', 'layout'), Api::loadFields('GridDownloadPortrait', 'layout'), Api::loadFields('GridImageText', 'layout'), Api::loadFields('GridListSteps', 'layout'), diff --git a/package.json b/package.json index 2bc416ef1..25c2e01d9 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,11 @@ "start": "check-node-version --package -p && $npm_execpath run clean && node bs-server.js", "build": "check-node-version --package -p && $npm_execpath run clean && $npm_execpath run lint && NODE_ENV=production webpack --progress --display=minimal && gulp rev", "lint": "$npm_execpath run lint:scripts && $npm_execpath run lint:styles && $npm_execpath run lint:php", - "lint:scripts": "eslint Components/ assets/", - "lint:styles": "stylelint \"Components/**/*.scss\" \"assets/**/*.scss\"", + "lint:scripts": "eslint '**/*.js'", + "lint:styles": "stylelint '**/*.scss'", "lint:php": "./vendor/bin/phpcs --standard=phpcs.ruleset.xml", - "lint:scripts:fix": "eslint Components/ assets/ --fix", - "lint:styles:fix": "stylelint \"Components/**/*.scss\" \"assets/**/*.scss\" --fix", + "lint:scripts:fix": "eslint '**/*.js' --fix", + "lint:styles:fix": "stylelint '**/*.scss' --fix", "lint:php:fix": "./vendor/bin/phpcbf --standard=phpcs.ruleset.xml", "release": "standard-version -a", "releaseGithub": "conventional-github-releaser -p angular" @@ -104,7 +104,11 @@ "selector-class-pattern": null, "max-nesting-depth": null, "selector-max-compound-selectors": 4 - } + }, + "ignoreFiles": [ + "dist/**", + "vendor/**" + ] }, "engines": { "node": ">=8.0.0" diff --git a/webpack.config.js b/webpack.config.js index 6ae8c3928..d116c757c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,5 @@ const path = require('path') +const fs = require('fs') const webpack = require('webpack') const TerserPlugin = require('terser-webpack-plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin') @@ -109,6 +110,7 @@ const webpackConfig = { } } } +const premiumComponentsExist = fs.existsSync('flyntPremium/Components') webpackConfig.plugins = webpackConfig.plugins || [] if (production) { webpackConfig.plugins.push( @@ -116,7 +118,8 @@ if (production) { PRODUCTION: JSON.stringify(true), 'process.env': { 'NODE_ENV': JSON.stringify('production') - } + }, + PREMIUM_COMPONENTS_EXIST: JSON.stringify(premiumComponentsExist) }) ) webpackConfig.plugins.push(new webpack.optimize.AggressiveMergingPlugin()) @@ -134,7 +137,8 @@ if (production) { PRODUCTION: JSON.stringify(false), 'process.env': { 'NODE_ENV': JSON.stringify('development') - } + }, + PREMIUM_COMPONENTS_EXIST: JSON.stringify(premiumComponentsExist) }) ) } @@ -155,7 +159,7 @@ const multiConfig = Object.keys(config.entry).map(entry => { // both options are optional filename: `${entry}.css`, chunkFilename: `${entry}.css` - }), + }) ] } })