From 8e7c5df1b9ec07445f372bdbf3272d76295405cd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Aug 2026 13:43:41 +0000 Subject: [PATCH] chore: sync funkycommerce-headless from monorepo Source: coded-letter/coded-letter-monorepo@85e3fb0fe8ae963804a546effc243d1359feff2b --- .monorepo-source.json | 2 +- assets/video-hero-block.js | 2 ++ functions.php | 6 ++++-- inc/control-center.php | 33 ++++++++++++++++++++++++++++----- inc/multilingual-content.php | 16 ++++++++++++++++ inc/native-shortcodes.php | 6 ++++-- inc/navigation-commerce.php | 2 ++ package-lock.json | 4 ++-- package.json | 2 +- readme.txt | 7 ++++++- style.css | 2 +- 11 files changed, 67 insertions(+), 15 deletions(-) diff --git a/.monorepo-source.json b/.monorepo-source.json index 4a9da44..c1dea3a 100644 --- a/.monorepo-source.json +++ b/.monorepo-source.json @@ -1,7 +1,7 @@ { "productId": "funkycommerce-headless", "repository": "coded-letter/superfunky-theme", - "source": "coded-letter/coded-letter-monorepo@d16d4008f1dc5c092d4866337e74d458994039a0", + "source": "coded-letter/coded-letter-monorepo@85e3fb0fe8ae963804a546effc243d1359feff2b", "sourcePath": "workspace/backend/wordpress/themes/free/funkycommerce-headless", "installSlug": "funkycommerce-headless", "kind": "theme", diff --git a/assets/video-hero-block.js b/assets/video-hero-block.js index 1c305b9..acbbb1e 100644 --- a/assets/video-hero-block.js +++ b/assets/video-hero-block.js @@ -18,6 +18,7 @@ poster: { type: 'string', default: '' }, kicker: { type: 'string', default: '' }, title: { type: 'string', default: 'Video hero' }, + headingLevel: { type: 'string', default: 'h2' }, description: { type: 'string', default: '' }, primaryCtaLabel: { type: 'string', default: '' }, primaryCtaHref: { type: 'string', default: '' }, @@ -52,6 +53,7 @@ el( SelectControl, { label: i18n.__( 'View', 'funkycommerce-headless' ), value: a.variant, options: [ { label: 'Full bleed', value: 'fullbleed' }, { label: 'Atmospheric glow', value: 'glow' }, { label: 'Split media/content', value: 'split' }, { label: 'Minimal editorial', value: 'minimal' }, { label: 'Compact strip', value: 'strip' } ], onChange: field( 'variant' ) } ), el( TextControl, { label: i18n.__( 'Kicker', 'funkycommerce-headless' ), value: a.kicker, onChange: field( 'kicker' ) } ), el( TextControl, { label: i18n.__( 'Heading', 'funkycommerce-headless' ), value: a.title, onChange: field( 'title' ) } ), + el( SelectControl, { label: i18n.__( 'Heading level', 'funkycommerce-headless' ), value: a.headingLevel, options: [ { label: 'H1', value: 'h1' }, { label: 'H2', value: 'h2' }, { label: 'H3', value: 'h3' }, { label: 'H4', value: 'h4' }, { label: 'H5', value: 'h5' }, { label: 'H6', value: 'h6' } ], onChange: field( 'headingLevel' ) } ), el( TextareaControl, { label: i18n.__( 'Description', 'funkycommerce-headless' ), value: a.description, onChange: field( 'description' ) } ), el( TextControl, { label: i18n.__( 'Primary button label', 'funkycommerce-headless' ), value: a.primaryCtaLabel, onChange: field( 'primaryCtaLabel' ) } ), el( TextControl, { label: i18n.__( 'Primary button URL', 'funkycommerce-headless' ), value: a.primaryCtaHref, onChange: field( 'primaryCtaHref' ) } ), diff --git a/functions.php b/functions.php index f947bd2..f485c83 100644 --- a/functions.php +++ b/functions.php @@ -9,7 +9,7 @@ exit; } -define( 'FUNKYCOMMERCE_HEADLESS_VERSION', '1.2.15' ); +define( 'FUNKYCOMMERCE_HEADLESS_VERSION', '1.2.16' ); /** * Whether Superfunky Pro is active and licensed. @@ -424,6 +424,7 @@ function funkycommerce_content_shortcode_schemas() { 'poster' => array( 'default' => '', 'type' => 'url' ), 'kicker' => array( 'default' => '' ), 'title' => array( 'default' => __( 'Video hero', 'funkycommerce-headless' ) ), + 'heading_level' => array( 'default' => 'h2', 'enum' => array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ) ), 'description' => array( 'default' => '' ), 'primary_cta_label' => array( 'default' => '' ), 'primary_cta_href' => array( 'default' => '', 'type' => 'url-path' ), @@ -917,6 +918,7 @@ function funkycommerce_register_video_hero_block() { 'attributes' => array( 'src' => array( 'type' => 'string', 'default' => '' ), 'variant' => array( 'type' => 'string', 'default' => 'fullbleed' ), 'poster' => array( 'type' => 'string', 'default' => '' ), 'kicker' => array( 'type' => 'string', 'default' => '' ), 'title' => array( 'type' => 'string', 'default' => 'Video hero' ), + 'headingLevel' => array( 'type' => 'string', 'default' => 'h2' ), 'description' => array( 'type' => 'string', 'default' => '' ), 'primaryCtaLabel' => array( 'type' => 'string', 'default' => '' ), 'primaryCtaHref' => array( 'type' => 'string', 'default' => '' ), 'secondaryCtaLabel' => array( 'type' => 'string', 'default' => '' ), 'secondaryCtaHref' => array( 'type' => 'string', 'default' => '' ), 'align' => array( 'type' => 'string', 'default' => 'left' ), @@ -932,7 +934,7 @@ function funkycommerce_register_video_hero_block() { function funkycommerce_render_video_hero_block( $attributes ) { $map = array( - 'src' => 'src', 'variant' => 'variant', 'poster' => 'poster', 'kicker' => 'kicker', 'title' => 'title', 'description' => 'description', + 'src' => 'src', 'variant' => 'variant', 'poster' => 'poster', 'kicker' => 'kicker', 'title' => 'title', 'headingLevel' => 'heading_level', 'description' => 'description', 'primaryCtaLabel' => 'primary_cta_label', 'primaryCtaHref' => 'primary_cta_href', 'secondaryCtaLabel' => 'secondary_cta_label', 'secondaryCtaHref' => 'secondary_cta_href', 'align' => 'align', 'height' => 'height', 'overlayOpacity' => 'overlay_opacity', diff --git a/inc/control-center.php b/inc/control-center.php index b0f8ba4..2763492 100644 --- a/inc/control-center.php +++ b/inc/control-center.php @@ -508,7 +508,7 @@ function funkycommerce_sanitize_control_center( $input ) { $output['backend_noindex_acknowledged'] = $previous['backend_noindex_acknowledged'] ?? 'no'; } - $languages = function_exists( 'funkycommerce_available_language_slugs' ) ? funkycommerce_available_language_slugs() : array(); + $languages = funkycommerce_control_center_language_slugs(); foreach ( $languages as $language ) { $tagline_key = 'store_tagline_' . $language; $promo_key = 'promo_text_' . $language; @@ -533,6 +533,22 @@ function funkycommerce_sanitize_control_center( $input ) { return $output; } +/** + * Return Polylang languages or the site's default language for editable UI strings. + */ +function funkycommerce_control_center_language_slugs() { + $languages = function_exists( 'funkycommerce_available_language_slugs' ) ? funkycommerce_available_language_slugs() : array(); + if ( $languages ) { + return $languages; + } + if ( function_exists( 'funkycommerce_site_default_language_slug' ) ) { + return array( funkycommerce_site_default_language_slug() ); + } + $locale = (string) get_option( 'WPLANG', '' ); + $slug = sanitize_key( strtolower( strtok( $locale ?: 'en_US', '_-' ) ) ); + return array( $slug ?: 'en' ); +} + /** * Keep old option consumers working while the rest of the backend is migrated. */ @@ -762,6 +778,7 @@ function funkycommerce_storefront_control_settings( $language = '' ) { 'quietSeconds' => max( 2, min( 300, (int) ( $settings['recent_orders_quiet_seconds'] ?? 8 ) ) ), 'openLinksInNewTab' => 'yes' === ( $settings['recent_orders_links_new_tab'] ?? 'yes' ), ), + 'soundsEnabled' => 'yes' === ( $settings['sounds_enabled'] ?? 'no' ), 'loading' => array( 'enabled' => 'yes' === ( $settings['loader_enabled'] ?? 'yes' ), 'customUrl' => esc_url_raw( $settings['loader_custom_url'] ?? '' ), @@ -1378,16 +1395,22 @@ function funkycommerce_render_control_center() { $field ) : funkycommerce_render_control_field( $key, $field, $settings[ $key ] ?? ( $field['default'] ?? '' ) ); endforeach; ?> - +