From b645a78a3ba0e19dc7ed0d51889f77b6035f545c Mon Sep 17 00:00:00 2001 From: Stephen Cameron Date: Thu, 3 Dec 2020 20:48:15 +0100 Subject: [PATCH] WIP #4064 @7 --- .../cube/src/Elementor/Widgets/TextBlock.php | 2 +- web/app/mu-plugins/typerocket-loader.php | 10 ++ web/app/mu-plugins/typerocket/config/app.php | 152 ++++++++++++++++++ .../typerocket/config/components.php | 23 +++ .../mu-plugins/typerocket/config/external.php | 18 +++ .../mu-plugins/typerocket/config/galaxy.php | 28 ++++ .../mu-plugins/typerocket/config/paths.php | 124 ++++++++++++++ web/app/mu-plugins/typerocket/config/urls.php | 32 ++++ .../assets/styles/common/layout.styl | 3 + .../assets/styles/widgets/text-block.styl | 9 -- 10 files changed, 391 insertions(+), 10 deletions(-) create mode 100644 web/app/mu-plugins/typerocket-loader.php create mode 100644 web/app/mu-plugins/typerocket/config/app.php create mode 100644 web/app/mu-plugins/typerocket/config/components.php create mode 100644 web/app/mu-plugins/typerocket/config/external.php create mode 100644 web/app/mu-plugins/typerocket/config/galaxy.php create mode 100644 web/app/mu-plugins/typerocket/config/paths.php create mode 100644 web/app/mu-plugins/typerocket/config/urls.php diff --git a/web/app/mu-plugins/cube/src/Elementor/Widgets/TextBlock.php b/web/app/mu-plugins/cube/src/Elementor/Widgets/TextBlock.php index 952aa63..d42e2a6 100644 --- a/web/app/mu-plugins/cube/src/Elementor/Widgets/TextBlock.php +++ b/web/app/mu-plugins/cube/src/Elementor/Widgets/TextBlock.php @@ -269,7 +269,7 @@ class TextBlock extends _Base { // CSS Classes for elements $this->add_render_attribute('title', 'class', ["text-block-title $title_size"]); $this->add_render_attribute('body', 'class', ['text-block-body']); - $this->add_render_attribute('cta_text', 'class', ['text-block-cta btn']); + $this->add_render_attribute('cta_text', 'class', ['text-block-cta btn inline-block bg-red text-white py-2 px-4 rounded-full hover:bg-blue hover:text-white']); // Rendered content echo '
'; diff --git a/web/app/mu-plugins/typerocket-loader.php b/web/app/mu-plugins/typerocket-loader.php new file mode 100644 index 0000000..470e13f --- /dev/null +++ b/web/app/mu-plugins/typerocket-loader.php @@ -0,0 +1,10 @@ + [ + '\TypeRocket\Extensions\TypeRocketUI', + '\TypeRocket\Extensions\PostMessages', + '\TypeRocket\Extensions\PageBuilder', + ], + + /* + |-------------------------------------------------------------------------- + | Services + |-------------------------------------------------------------------------- + | + | Services you want loaded into the container as singletons. You can also + | create your own services. TypeRocket some with the following builtin: + | + | - \App\Services\AuthService + | + */ + 'services' => [ + /* + * TypeRocket Service Providers... + */ + '\TypeRocket\Services\ErrorService', + '\TypeRocket\Services\MailerService', + + /* + * Application Service Providers... + */ + '\App\Services\AuthService', + ], + + /* + |-------------------------------------------------------------------------- + | Front-end + |-------------------------------------------------------------------------- + | + | Require TypeRocket on the front-end. + | + */ + 'frontend' => false, + + /* + |-------------------------------------------------------------------------- + | Debug + |-------------------------------------------------------------------------- + | + | Turn on Debugging for TypeRocket. Set to false to disable. + | + */ + 'debug' => typerocket_env('WP_DEBUG', true), + + /* + |-------------------------------------------------------------------------- + | Seed + |-------------------------------------------------------------------------- + | + | A 'random' string of text to help with security from time to time. + | + */ + 'seed' => 'seed_5fc916da61d44', + + /* + |-------------------------------------------------------------------------- + | Class Overrides + |-------------------------------------------------------------------------- + | + | Set the classes to use as the default for helper functions. + | + */ + 'class' => [ + 'form' => '\App\Elements\Form', + 'error' => '\TypeRocket\Utility\ExceptionReport' + ], + + /* + |-------------------------------------------------------------------------- + | Template Engine + |-------------------------------------------------------------------------- + | + | The template engine used to build views for the front-end and admin. + | + | Pro Only: + | - \TypeRocketPro\Template\TachyonTemplateEngine + | - \TypeRocketPro\Template\TwigTemplateEngine + | + */ + 'templates' => [ + 'views' => '\TypeRocket\Template\TemplateEngine', + ], + + /* + |-------------------------------------------------------------------------- + | Rooting + |-------------------------------------------------------------------------- + | + | The templates to use for the TypeRocket theme. Must be using TypeRocket + | as root for this feature to work. + | + */ + 'root' => [ + 'wordpress' => 'wordpress', + 'themes' => [ + 'override' => true, + 'flush' => false, + 'theme' => 'templates', + 'stylesheet' => 'theme/theme.css', + ] + ], + + /* + |-------------------------------------------------------------------------- + | Error Handling + |-------------------------------------------------------------------------- + */ + 'errors' => [ + /* + |-------------------------------------------------------------------------- + | Pro Only - Whoops PHP + |-------------------------------------------------------------------------- + | + | Use Whoops PHP when TypeRocket debugging is enabled. + | + */ + 'whoops' => true, + + /* + |-------------------------------------------------------------------------- + | Throw Errors + |-------------------------------------------------------------------------- + | + | TypeRocket defines an error handler function that throws \ErrorException. + | You can disable this functionality but it may impact the template error + | system that allows you to define 500.php theme templates. + | + | @link https://www.php.net/manual/en/function.set-error-handler.php + | + | Recommended Levels: `E_ALL` or `E_ERROR | E_PARSE` + | + */ + 'throw' => true, + 'level' => E_ERROR | E_PARSE + ] +]; diff --git a/web/app/mu-plugins/typerocket/config/components.php b/web/app/mu-plugins/typerocket/config/components.php new file mode 100644 index 0000000..a0e0733 --- /dev/null +++ b/web/app/mu-plugins/typerocket/config/components.php @@ -0,0 +1,23 @@ + [ + 'content' => \App\Components\ContentComponent::class, + ], + + /* + |-------------------------------------------------------------------------- + | Builder + |-------------------------------------------------------------------------- + | + | List of components you want included for the builder group. + | + */ + 'builder' => [ + 'content', + ] +]; \ No newline at end of file diff --git a/web/app/mu-plugins/typerocket/config/external.php b/web/app/mu-plugins/typerocket/config/external.php new file mode 100644 index 0000000..cf7f705 --- /dev/null +++ b/web/app/mu-plugins/typerocket/config/external.php @@ -0,0 +1,18 @@ + [ + 'api_key' => typerocket_env('TYPEROCKET_GOOGLE_MAPS_API_KEY'), + 'map_zoom' => 15, + 'ui' => false + ] +]; \ No newline at end of file diff --git a/web/app/mu-plugins/typerocket/config/galaxy.php b/web/app/mu-plugins/typerocket/config/galaxy.php new file mode 100644 index 0000000..d3a9f93 --- /dev/null +++ b/web/app/mu-plugins/typerocket/config/galaxy.php @@ -0,0 +1,28 @@ + \TypeRocket\Utility\Helper::wordPressRootPath(), + 'wordpress' => realpath(__DIR__ .'/../../../../wp'), + + /* + |-------------------------------------------------------------------------- + | Commands + |-------------------------------------------------------------------------- + | + | Add your custom commands for Galaxy. TypeRocket commands use Symfony + | framework see http://symfony.com/doc/current/console.html + | + */ + 'commands' => [ + ] +]; diff --git a/web/app/mu-plugins/typerocket/config/paths.php b/web/app/mu-plugins/typerocket/config/paths.php new file mode 100644 index 0000000..56cb6c4 --- /dev/null +++ b/web/app/mu-plugins/typerocket/config/paths.php @@ -0,0 +1,124 @@ + TYPEROCKET_APP_ROOT_PATH . '/app', + + /* + |-------------------------------------------------------------------------- + | Storage + |-------------------------------------------------------------------------- + | + | The PATH where files are to be stored. + | + */ + 'storage' => TYPEROCKET_ALT_PATH . '/storage', + + /* + |-------------------------------------------------------------------------- + | Cache + |-------------------------------------------------------------------------- + | + | The PATH where files are to be cached. + | + */ + 'cache' => TYPEROCKET_ALT_PATH . '/storage/cache', + + /* + |-------------------------------------------------------------------------- + | Resources + |-------------------------------------------------------------------------- + | + | The PATH were resources can be found. + | + */ + 'resources' => TYPEROCKET_ALT_PATH . '/resources', + + /* + |-------------------------------------------------------------------------- + | Views + |-------------------------------------------------------------------------- + | + | The PATH were front-end views can be found. + | + */ + 'views' => TYPEROCKET_ALT_PATH . '/resources/views', + + /* + |-------------------------------------------------------------------------- + | Themes + |-------------------------------------------------------------------------- + | + | The PATH were theme templates can be found. Used if you install + | TypeRocket as root. + | + */ + 'themes' => TYPEROCKET_ALT_PATH . '/resources/themes', + + /* + |-------------------------------------------------------------------------- + | Routes + |-------------------------------------------------------------------------- + | + | The PATH were theme templates can be found. Used if you install + | TypeRocket as root. + | + */ + 'routes' => TYPEROCKET_ALT_PATH . '/routes', + + /* + |-------------------------------------------------------------------------- + | Migrations + |-------------------------------------------------------------------------- + | + | The PATHs for migrations and run migrations. + | + */ + 'migrations' => TYPEROCKET_ALT_PATH . '/database/migrations', + + /* + |-------------------------------------------------------------------------- + | Composer Vendor + |-------------------------------------------------------------------------- + | + | The PATH were composer vendor files are located. + | + */ + 'vendor' => TYPEROCKET_PATH . '/vendor', + + /* + |-------------------------------------------------------------------------- + | Core + |-------------------------------------------------------------------------- + | + | The PATH were composer vendor files are located. + | + */ + 'core' => TYPEROCKET_PATH . '/vendor/typerocket/core', + + /* + |-------------------------------------------------------------------------- + | Pro Core + |-------------------------------------------------------------------------- + | + | The PATH were pro composer vendor files are located. + | + */ + 'pro' => TYPEROCKET_PATH . '/vendor/typerocket/professional', + + /* + |-------------------------------------------------------------------------- + | Assets + |-------------------------------------------------------------------------- + | + | The PATH where TypeRocket theme and build assets are located. + | + */ + 'assets' => TYPEROCKET_PATH . '/wordpress/assets', +]; diff --git a/web/app/mu-plugins/typerocket/config/urls.php b/web/app/mu-plugins/typerocket/config/urls.php new file mode 100644 index 0000000..babdc4e --- /dev/null +++ b/web/app/mu-plugins/typerocket/config/urls.php @@ -0,0 +1,32 @@ + \TypeRocket\Utility\Helper::assetsUrlBuild(), + + /* + |-------------------------------------------------------------------------- + | Components + |-------------------------------------------------------------------------- + | + | The URL where TypeRocket component assets are found. + | + */ + 'components' => \TypeRocket\Utility\Helper::assetsUrlBuild( '/components' ), + + /* + |-------------------------------------------------------------------------- + | Typerocket Assets + |-------------------------------------------------------------------------- + | + | The URL where TypeRocket Core assets are found. + | + */ + 'typerocket' => \TypeRocket\Utility\Helper::assetsUrlBuild( '/typerocket' ), +]; diff --git a/web/app/themes/Usines/resources/assets/styles/common/layout.styl b/web/app/themes/Usines/resources/assets/styles/common/layout.styl index eb21f4e..b842935 100644 --- a/web/app/themes/Usines/resources/assets/styles/common/layout.styl +++ b/web/app/themes/Usines/resources/assets/styles/common/layout.styl @@ -16,6 +16,9 @@ padding-left: 0 padding-right: 0 +//.elementor-section-wrap > .elementor-section +// vertical-spacing() + // Override default spacing between widgets .elementor-widget-wrap .elementor-widget:not(:last-child) constrain(margin-bottom, $vertical-gutter) // Set margin bottom to standard gutter diff --git a/web/app/themes/Usines/resources/assets/styles/widgets/text-block.styl b/web/app/themes/Usines/resources/assets/styles/widgets/text-block.styl index c5bc21e..5643b43 100644 --- a/web/app/themes/Usines/resources/assets/styles/widgets/text-block.styl +++ b/web/app/themes/Usines/resources/assets/styles/widgets/text-block.styl @@ -17,15 +17,6 @@ &-title white-space: pre-line - &-cta - @apply antialiased - margin-top: r(30px) - - // If the CTA is the first child, it means it is the only element - // in the text block so we don't want the top margin... - &:first-child - margin-top: 0 - // Not nested so that we can share these styles with TinyMCE .text-block-body, #tinymce font-weight: 300 -- 2.39.5