diff --git a/web/app/mu-plugins/juniper-commands.php b/web/app/mu-plugins/juniper-commands.php index be5cc62be..2be234948 100644 --- a/web/app/mu-plugins/juniper-commands.php +++ b/web/app/mu-plugins/juniper-commands.php @@ -208,10 +208,10 @@ public function block( $args, $assoc_args ) { $php = "get( 'Version' );\n" . "\t\$theme_path = get_template_directory_uri();\n\n" . - "\t\twp_enqueue_style('$slug_name-css', \$theme_path . '/dist/blocks/$slug_name/style.css', array(), \$time, 'all');\n" . - "\t\twp_enqueue_script('$slug_name-js', \$theme_path . '/dist/blocks/$slug_name/script.js', array(), \$time, true);\n" . + "\t\twp_enqueue_style('$slug_name-css', \$theme_path . '/dist/blocks/$slug_name/style.css', array(), \$version, 'all');\n" . + "\t\twp_enqueue_script('$slug_name-js', \$theme_path . '/dist/blocks/$slug_name/script.js', array(), \$version, true);\n" . "\t}\n" . "});\n\n" . "add_action('admin_init', function() {\n" . diff --git a/web/app/themes/juniper-theme/.bootstraprc b/web/app/themes/juniper-theme/.bootstraprc deleted file mode 100644 index 6d666cce4..000000000 --- a/web/app/themes/juniper-theme/.bootstraprc +++ /dev/null @@ -1,125 +0,0 @@ ---- -# Output debugging info -# loglevel: debug - -# Major version of Bootstrap: 3 or 4 -bootstrapVersion: 3 - -# If Bootstrap version 3 is used - turn on/off custom icon font path -useCustomIconFontPath: false - -# Webpack loaders, order matters -styleLoaders: - - style-loader - - css-loader - - sass-loader - -# Extract styles to stand-alone css file -# Different settings for different environments can be used, -# It depends on value of NODE_ENV environment variable -# This param can also be set in webpack config: -# entry: 'bootstrap-loader/extractStyles' -extractStyles: false -# env: -# development: -# extractStyles: false -# production: -# extractStyles: true - -# Customize Bootstrap variables that get imported before the original Bootstrap variables. -# Thus original Bootstrap variables can depend on values from here. All the bootstrap -# variables are configured with !default, and thus, if you define the variable here, then -# that value is used, rather than the default. However, many bootstrap variables are derived -# from other bootstrap variables, and thus, you want to set this up before we load the -# official bootstrap versions. -# For example, _variables.scss contains: -# $input-color: $gray !default; -# This means you can define $input-color before we load _variables.scss -preBootstrapCustomizations: ./src/style/bootstrap/pre-customizations.scss - -# This gets loaded after bootstrap/variables is loaded and before bootstrap is loaded. -# A good example of this is when you want to override a bootstrap variable to be based -# on the default value of bootstrap. This is pretty specialized case. Thus, you normally -# just override bootrap variables in preBootstrapCustomizations so that derived -# variables will use your definition. -# -# For example, in _variables.scss: -# $input-height: (($font-size-base * $line-height) + ($input-padding-y * 2) + ($border-width * 2)) !default; -# This means that you could define this yourself in preBootstrapCustomizations. Or you can do -# this in bootstrapCustomizations to make the input height 10% bigger than the default calculation. -# Thus you can leverage the default calculations. -# $input-height: $input-height * 1.10; -# bootstrapCustomizations: ./app/styles/bootstrap/customizations.scss - -# Import your custom styles here. You have access to all the bootstrap variables. If you require -# your sass files separately, you will not have access to the bootstrap variables, mixins, clases, etc. -# Usually this endpoint-file contains list of @imports of your application styles. -# appStyles: ./app/styles/app.scss - -### Bootstrap styles -styles: - - # Mixins - mixins: true - - # Reset and dependencies - normalize: true - print: true - glyphicons: false - - # Core CSS - scaffolding: true - type: true - code: false - grid: true - tables: false - forms: true - buttons: false - - # Components - component-animations: true - dropdowns: true - button-groups: true - input-groups: false - navs: true - navbar: true - breadcrumbs: false - pagination: false - pager: false - labels: false - badges: false - jumbotron: false - thumbnails: false - alerts: false - progress-bars: false - media: true - list-group: false - panels: false - wells: false - responsive-embed: true - close: false - - # Components w/ JavaScript - modals: true - tooltip: false - popovers: false - carousel: true - - # Utility classes - utilities: true - responsive-utilities: true - -### Bootstrap scripts -scripts: - transition: true - alert: false - button: false - carousel: false - collapse: false - dropdown: true - modal: false - tooltip: false - popover: false - scrollspy: false - tab: false - affix: false \ No newline at end of file diff --git a/web/app/themes/juniper-theme/blocks/cta/functions.php b/web/app/themes/juniper-theme/blocks/cta/functions.php index 9a1928b9e..b66f61347 100644 --- a/web/app/themes/juniper-theme/blocks/cta/functions.php +++ b/web/app/themes/juniper-theme/blocks/cta/functions.php @@ -4,11 +4,11 @@ 'wp_enqueue_scripts', function() { if ( has_block( 'acf/cta' ) ) { - $time = time(); + $version = wp_get_theme()->get( 'Version' ); $theme_path = get_template_directory_uri(); - wp_enqueue_style( 'cta-css', $theme_path . '/dist/blocks/cta/style.css', array(), $time, 'all' ); - wp_enqueue_script( 'cta-js', $theme_path . '/dist/blocks/cta/script.js', array(), $time, true ); + wp_enqueue_style( 'cta-css', $theme_path . '/dist/blocks/cta/style.css', array(), $version, 'all' ); + wp_enqueue_script( 'cta-js', $theme_path . '/dist/blocks/cta/script.js', array(), $version, true ); } } ); diff --git a/web/app/themes/juniper-theme/blocks/filteringposts/functions.php b/web/app/themes/juniper-theme/blocks/filteringposts/functions.php index 9c72df606..beb1bfe06 100644 --- a/web/app/themes/juniper-theme/blocks/filteringposts/functions.php +++ b/web/app/themes/juniper-theme/blocks/filteringposts/functions.php @@ -4,15 +4,27 @@ 'wp_enqueue_scripts', function() { if ( has_block( 'acf/filteringposts' ) ) { - wp_enqueue_style( 'filteringposts-css', get_template_directory_uri() . '/dist/blocks/filteringposts/style.css', array(), time(), 'all' ); - wp_enqueue_script( 'filteringposts-js', get_template_directory_uri() . '/dist/blocks/filteringposts/script.js', array(), time(), true ); + $version = wp_get_theme()->get( 'Version' ); + $theme_path = get_template_directory_uri(); + + wp_enqueue_style( 'filteringposts-css', $theme_path . '/dist/blocks/filteringposts/style.css', array(), $version, 'all' ); + wp_enqueue_script( 'filteringposts-js', $theme_path . '/dist/blocks/filteringposts/script.js', array(), $version, true ); } } ); +add_action( + 'admin_init', + function() { + add_editor_style( '/dist/blocks/filteringposts/style.css' ); + } +); + add_filter( 'timber/acf-gutenberg-blocks-data/filteringposts', - function( $context ) {} + function( $context ) { + return $context; + } ); $block_name = 'filteringposts'; diff --git a/web/app/themes/juniper-theme/composer.json b/web/app/themes/juniper-theme/composer.json index 2b0f62937..b5fdb3d69 100644 --- a/web/app/themes/juniper-theme/composer.json +++ b/web/app/themes/juniper-theme/composer.json @@ -15,7 +15,7 @@ "require": { "php": ">=8.1", "timber/timber": "^2.0", - "bartnovak/timber-acf-wp-blocks": "^0.1.0" + "bartnovak/timber-acf-wp-blocks": "^0.2.0" }, "config": { "optimize-autoloader": true, diff --git a/web/app/themes/juniper-theme/functions.php b/web/app/themes/juniper-theme/functions.php index f75d611f0..7fb6fff9c 100644 --- a/web/app/themes/juniper-theme/functions.php +++ b/web/app/themes/juniper-theme/functions.php @@ -23,11 +23,11 @@ require_once 'inc/include.php'; function juniper_theme_enqueue() { - $refresh_cache_time = time(); + $version = wp_get_theme()->get( 'Version' ); $template_directory_uri = get_template_directory_uri(); - wp_enqueue_style( 'app-css', $template_directory_uri . '/dist/src/css/_app.css', array(), $refresh_cache_time ); - wp_enqueue_script( 'app-js', $template_directory_uri . '/dist/src/js/_app.js', array(), $refresh_cache_time, true ); + wp_enqueue_style( 'app-css', $template_directory_uri . '/dist/src/css/_app.css', array(), $version ); + wp_enqueue_script( 'app-js', $template_directory_uri . '/dist/src/js/_app.js', array(), $version, true ); } add_action( 'wp_enqueue_scripts', 'juniper_theme_enqueue' ); diff --git a/web/app/themes/juniper-theme/package.json b/web/app/themes/juniper-theme/package.json index 8afb231ee..da3394c8d 100644 --- a/web/app/themes/juniper-theme/package.json +++ b/web/app/themes/juniper-theme/package.json @@ -2,13 +2,7 @@ "name": "parcel-juniper-theme", "version": "1.0.0", "dependencies": { - "@barba/core": "^2.10", - "@barba/prefetch": "^2.2", - "bootstrap": "^5.3", "cypress": "^15.6", - "gsap": "^3.13.0", - "imagesloaded": "^5.0", - "jquery": "^3.7", "postcss": "^8.5" }, "devDependencies": { @@ -16,8 +10,6 @@ "browserslist": "^4.28", "eslint": "^8.56", "eslint-config-airbnb-base": "^15.0", - "husky": "^9.1", - "litepicker": "^2.0", "parcel": "^2.16", "sass": "^1.94" }, diff --git a/web/app/themes/juniper-theme/patterns/cta.php b/web/app/themes/juniper-theme/patterns/cta.php index 3063b9673..757341f98 100644 --- a/web/app/themes/juniper-theme/patterns/cta.php +++ b/web/app/themes/juniper-theme/patterns/cta.php @@ -10,7 +10,7 @@