Skip to content

Commit 540c77a

Browse files
committed
Merge branch 'develop' into feat/getting-started-onboarding
# Conflicts: # src/plugins/global-settings/block-styles/index.js
2 parents 6aa5445 + 7210e8c commit 540c77a

File tree

18 files changed

+173
-312
lines changed

18 files changed

+173
-312
lines changed

plugin.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,27 @@
1717
exit;
1818
}
1919

20+
if ( ! function_exists( 'stackable_multiple_plugins_check' ) ) {
21+
// Prevent multiple Stackable plugin versions from being active simultaneously.
22+
function stackable_multiple_plugins_check() {
23+
if ( is_plugin_active( $GLOBALS['OTHER_STACKABLE_FILE'] ) ) {
24+
deactivate_plugins( $GLOBALS['OTHER_STACKABLE_FILE'] );
25+
}
26+
}
27+
}
28+
29+
if ( defined('STACKABLE_FILE') && STACKABLE_FILE !== __FILE__ && ! isset( $GLOBALS['OTHER_STACKABLE_FILE'] ) ) {
30+
// Get relative file path of the other Stackable version.
31+
$GLOBALS['OTHER_STACKABLE_FILE'] = plugin_basename( STACKABLE_FILE );
32+
33+
// Use a temporary option to store the other Stackable Plugin info needed for the admin notice. This will be deleted later.
34+
// Note: We cannot use add_action in the register_activation_hook callback so we use this temporary option.
35+
// See https://developer.wordpress.org/reference/functions/register_activation_hook/#process-flow for more info.
36+
add_option( 'stackable_other_stackable_plugin_info', [ 'BUILD' => STACKABLE_BUILD, 'VERSION' => STACKABLE_VERSION ] );
37+
38+
register_activation_hook( __FILE__, 'stackable_multiple_plugins_check' );
39+
}
40+
2041
// Freemius SDK: Auto deactivate the free version when activating the paid one.
2142
if ( function_exists( 'sugb_fs' ) ) {
2243
sugb_fs()->set_basename( true, __FILE__ );
@@ -158,6 +179,28 @@ function stackable_notice_gutenberg_plugin_ignore() {
158179
add_action( 'wp_ajax_stackable_notice_gutenberg_plugin_ignore', 'stackable_notice_gutenberg_plugin_ignore' );
159180
}
160181

182+
/**
183+
* Show notice if another Stackable plugin has been deactivated.
184+
*
185+
* @since 3.18.1
186+
*/
187+
if ( ! function_exists( 'stackable_notice_other_stackable_plugin_deactivated' ) ) {
188+
function stackable_notice_other_stackable_plugin_deactivated() {
189+
$OTHER_STACKABLE_INFO = get_option( 'stackable_other_stackable_plugin_info', false );
190+
if ( $OTHER_STACKABLE_INFO ) {
191+
printf(
192+
'<div class="notice notice-info is-dismissible stackable_notice_gutenberg_plugin"><p>%s</p></div>',
193+
sprintf( esc_html__( '%sStackable Notice%s: The Stackable plugin (%s version %s) has been deactivated. Only one active Stackable plugin is needed.', STACKABLE_I18N ), '<strong>', '</strong>', $OTHER_STACKABLE_INFO['BUILD'], $OTHER_STACKABLE_INFO['VERSION'] )
194+
);
195+
delete_option( 'stackable_other_stackable_plugin_info' );
196+
}
197+
}
198+
199+
if ( get_option( 'stackable_other_stackable_plugin_info', false ) ) {
200+
add_action( 'admin_notices', 'stackable_notice_other_stackable_plugin_deactivated' );
201+
}
202+
}
203+
161204
/********************************************************************************************
162205
* END Activation & PHP version checks.
163206
********************************************************************************************/

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Custom Blocks that transform your WordPress Block Editor into a page builder
1818

1919
> [Try our live demo](https://wpstackable.com/demo/?utm_source=wp-repo&utm_campaign=readme&utm_medium=link) | [Join the Facebook Community](https://www.facebook.com/groups/wpstackable/)
2020

21-
[youtube https://www.youtube.com/watch?v=xAOWZHAkG3E]
21+
[youtube https://www.youtube.com/watch?v=ZSo3t1l5tHQ]
2222

2323
## Transform Gutenberg into a Page Builder.
2424

@@ -322,6 +322,9 @@ Nope. Stackable only works with Gutenberg, the new WordPress editor.
322322
* Fixed: Added support for CSS optimizers that strip out the "px" from "0px" #3564
323323
* Fixed: Added some missing string translations #3414
324324

325+
= 3.17.3 =
326+
* Fixed: Stopped design library from being registered as patterns
327+
325328
= 3.17.2 =
326329
* Fixed: Design Library - Updated CDN URL
327330
* Fixed: If using non-English locale, Google Fonts may not load properly in the editor

src/components/block-styles-control/editor.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484

8585
.ugb-block-styles-controls__popover {
8686
.components-popover__content {
87-
width: 350px !important;
87+
width: 370px !important;
8888
}
8989
.components-button {
9090
width: 100%;
@@ -109,6 +109,9 @@
109109
overflow: hidden !important;
110110
min-height: 0 !important;
111111
max-height: 0 !important;
112+
opacity: 0 !important;
113+
margin: 0 !important;
114+
padding: 0 !important;
112115
}
113116

114117
.components-panel__body-description {

src/components/block-styles-control/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,15 +340,15 @@ const SaveUpdateButtons = props => {
340340
const ActionButtons = applyFilters( 'stackable.global-settings.global-block-styles.action-buttons', Fragment )
341341

342342
return ( <>
343-
<Flex style={ { marginTop: '24px' } }>
343+
<Flex style={ { marginTop: '24px', justifyContent: 'flex-end' } }>
344344
<ActionButtons { ...propsToPass } />
345345
<FlexItem style={ ! props.blockStyle || ! props.inOptions ? { marginLeft: 'auto' } : {} }>
346346
<Button
347347
variant="primary"
348348
onClick={ () => onAddBlockStyle() }
349349
size="small"
350350
>
351-
{ __( 'Save as New Style', i18n ) }
351+
{ __( 'Save New Block Style', i18n ) }
352352
{ ! isPro && <span className="stk-pulsating-circle" role="presentation" /> }
353353
</Button>
354354
</FlexItem>

src/components/design-library-list/editor.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.ugb-design-library-items {
22
page-break-inside: avoid;
33
break-inside: avoid;
4-
gap: 40px;
4+
gap: 30px;
55
display: grid;
66
grid-template-columns: 1fr 1fr 1fr;
77
align-items: center;
@@ -24,6 +24,7 @@
2424
}
2525
.ugb-modal-design-library__designs {
2626
overflow: auto;
27+
background: #f4f4f5;
2728
}
2829
.ugb-design-library-item {
2930
display: grid;
@@ -122,7 +123,7 @@
122123
// Toggle mode
123124
&.ugb-design-library-item--toggle footer {
124125
position: relative;
125-
padding: 16px 16px 24px;
126+
padding: 16px;
126127
display: flex;
127128
justify-content: space-between;
128129
> div {

src/components/design-library-list/util.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/* eslint-disable no-console */
22
import DEFAULT from './default.json'
3-
import { settings, isPro } from 'stackable'
3+
import {
4+
settings, isPro, cdnUrl,
5+
} from 'stackable'
46
import { parse, serialize } from '@wordpress/blocks'
57

68
const DEFAULT_CONTENT = { ...DEFAULT }
@@ -199,7 +201,7 @@ export const parseDisabledBlocks = parsedBlock => {
199201
return { block, blocksForSubstitution }
200202
}
201203

202-
const IMAGE_STORAGE = 'https://stackable-files.pages.dev/library-v4/images/'
204+
const IMAGE_STORAGE = cdnUrl.replace( /\/$/, '' ) + '/library-v4/images/'
203205

204206
export const addPlaceholderForPostsBlock = ( content, postsPlaceholder, defaultValues ) => {
205207
const remainingPosts = [ ...postsPlaceholder ]

src/components/pro-control-button/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const ProControlButton = props => {
2424
} )
2525

2626
return (
27-
<div className="components-base-control">
27+
<div className="components-base-control ugb-pro-control-button">
2828
<button className="ugb-pro-control-more-dots" onClick={ () => setIsOpen( v => ! v ) }>
2929
<div className="ugb-pro-control-more-dots__dot stk-pulsating-circle"></div>
3030
<div className="ugb-pro-control-more-dots__dot stk-pulsating-circle"></div>

src/components/pro-control/index.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,32 +120,34 @@ const LABELS = {
120120
'font-pairs': {
121121
title: __( 'Premium Typography', i18n ),
122122
description: <ul>
123-
<li>{ __( 'Access to 90+ curated font pairs', i18n ) }</li>
124-
<li>{ __( 'Create your own custom font pairs', i18n ) }</li>
123+
<li>{ __( 'Apply beautiful typography combinations instantly', i18n ) }</li>
124+
<li>{ __( 'Access to 90+ curated font pairs for professional designs', i18n ) }</li>
125+
<li>{ __( 'Create custom font combinations for your brand', i18n ) }</li>
125126
</ul>,
126127
},
127128
'color-schemes': {
128129
title: __( 'Premium Color Schemes', i18n ),
129130
description: <ul>
131+
<li>{ __( 'Define site-wide colors that apply to all blocks automatically', i18n ) }</li>
130132
<li>{ __( 'Access to 50+ curated color scheme presets', i18n ) }</li>
131-
<li>{ __( 'Create your own color schemes', i18n ) }</li>
132-
<li>{ __( 'Set default color schemes for blocks and sections', i18n ) }</li>
133-
<li>{ __( 'Streamline your design workflow', i18n ) }</li>
133+
<li>{ __( 'Create custom color schemes for backgrounds, containers, and buttons', i18n ) }</li>
134134
</ul>,
135135
},
136136
'preset-controls': {
137137
title: __( 'Premium Preset Controls', i18n ),
138138
description: <ul>
139139
<li>{ __( 'Customize your own presets like small, medium, large & x-large', i18n ) }</li>
140+
<li>{ __( 'Maintain structured, well-balanced designs effortlessly', i18n ) }</li>
140141
<li>{ __( 'Use Global Typography sizes as presets', i18n ) }</li>
141142
</ul>,
142143
},
143144
'global-block-styles': {
144145
title: __( 'Global Block Styles', i18n ),
145146
description: <ul>
146-
<li>{ __( 'Create and use your own block styles', i18n ) }</li>
147-
<li>{ __( 'Update your block styles', i18n ) }</li>
148-
<li>{ __( 'Organize your custom block styles', i18n ) }</li>
147+
<li>{ __( 'Design once, apply everywhere - no more copy-paste', i18n ) }</li>
148+
<li>{ __( 'Class-based styling for leaner, faster websites', i18n ) }</li>
149+
<li>{ __( 'Sync changes across all blocks instantly', i18n ) }</li>
150+
<li>{ __( 'Override styles while keeping them synced', i18n ) }</li>
149151
</ul>,
150152
},
151153
}

src/deprecated/block-defaults/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { settings as stackableSettings } from 'stackable'
22

33
// Conditionally import scripts
44
if ( stackableSettings.stackable_enable_block_defaults ) {
5-
import( './save-block' )
6-
import( './global-settings' )
5+
// Use require instead of dynamic import to avoid code splitting
6+
require( './save-block' )
7+
require( './global-settings' )
78
}

src/deprecated/v2/design-library/init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function get_block_designs( $request ) {
119119
$designs = json_decode( $content, true );
120120

121121
// Cache results.
122-
set_transient( 'stackable_get_block_designs_v2_' . $block, $designs, DAY_IN_SECONDS );
122+
set_transient( 'stackable_get_block_designs_v2_' . $block, $designs, 7 * DAY_IN_SECONDS );
123123
}
124124

125125
$designs = apply_filters( 'stackable_block_design_v2_' . $block, $designs );

0 commit comments

Comments
 (0)