Skip to content
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
dcbd7f4
feat: allow enabling, disabling and hiding of blocks
Arukuen Sep 3, 2024
e03a884
feat: add enable settings to toolbar features
Arukuen Sep 10, 2024
4920cb4
feat: add settings store for tracking changes
Arukuen Sep 23, 2024
1439e8f
feat: settings content organizaiont
Arukuen Sep 23, 2024
81cd300
feat: style for sidenav
Arukuen Sep 23, 2024
a494402
feat: sidenav, organization, disabling blocks, and save changes
Arukuen Sep 23, 2024
4087625
fix: change blockstate from 0-2 to 1-3 to avoid nfalsy 0
Arukuen Sep 23, 2024
39ce02b
feat: add min height to sidenav
Arukuen Sep 30, 2024
a18971e
feat: remove template since we will use react instead
Arukuen Sep 30, 2024
7b842c2
feat: use react approach for cleaner and more efficient code
Arukuen Sep 30, 2024
3e8b25d
feat: admin notice when settings are saved
Arukuen Oct 1, 2024
8e76a0a
feat: integrate pro-related settings
Arukuen Oct 1, 2024
233e05f
fix: conditional lazy loading of pro settings
Arukuen Oct 3, 2024
c8b74a7
feat: integrate missing settings such as icon, pro notice, tooltip
Arukuen Oct 5, 2024
c3adc23
feat: add stackable global settings
Arukuen Oct 5, 2024
5ed2b62
Merge branch 'develop' into feat-granular-plugin-setting
Arukuen Oct 5, 2024
d151983
fix: indentation from merge conflict
Arukuen Oct 5, 2024
14c6d7f
feat: apply global settings by conditional registering
Arukuen Oct 6, 2024
7f9bf2f
feat: search functionality integration
Arukuen Oct 14, 2024
5859c58
feat: application of search highlight through conditional classes
Arukuen Oct 14, 2024
7469539
feat: search highlight style
Arukuen Oct 14, 2024
22818bb
feat: admin toolbar setting
Arukuen Oct 15, 2024
ce74380
feat: util function for substituting to disabled blocks
Arukuen Oct 16, 2024
ffbea73
fix: disabling and hiding block variations
Arukuen Oct 21, 2024
343b20a
feat: disable/enable confirmation, disable/enable/hide all blocks
Arukuen Oct 24, 2024
1354cb9
feat: removeChildIfDisabled
Arukuen Oct 24, 2024
56551e1
feat: first batch of core substitution and removal integration
Arukuen Oct 24, 2024
fadc1a4
fix: blockname typo
Arukuen Oct 24, 2024
6243f42
Revert "feat: first batch of core substitution and removal integration"
Arukuen Oct 25, 2024
c9175f9
feat: piggyback on the filter instead of manual change in variations,…
Arukuen Oct 26, 2024
f6a8104
feat: special integration for blocks with no variation/neet to remove
Arukuen Oct 26, 2024
c92aa4f
feat: integrate card default-2 with social-links
Arukuen Oct 26, 2024
2cdc940
fix: styles and media queries, spinner on saved
Arukuen Oct 28, 2024
b3abf67
Merge branch 'develop' into feat-granular-plugin-setting
Nov 5, 2024
0770bf6
adjusted styling, removed javascript for fixed position
Nov 5, 2024
18962a0
fade out the non-highlighted tabs
Nov 5, 2024
60296f6
additional settings tweaking
Nov 6, 2024
5aea34d
fix: grayed out button when there are unsaved changes
Arukuen Nov 7, 2024
c361ef6
chore: remove emojis fom headings
Arukuen Nov 7, 2024
70783ca
fix: line separator only between settings group
Arukuen Nov 8, 2024
c0848cf
feat: resturcture with settings group, created a centralized search t…
Arukuen Nov 14, 2024
052d5ef
feat: migration from from disabled blocks array to block states object
Arukuen Nov 19, 2024
e0f6cb4
fix: run the migration script, old disabled block represents hidden
Arukuen Nov 19, 2024
12a6818
fix: typo on accessing search tree
Arukuen Nov 26, 2024
ebe913b
fix: typo on setting name
Arukuen Nov 26, 2024
3005a03
feat: integrate v2 settings to new settings
Arukuen Nov 28, 2024
6944eab
feat: change block name to title in dialog
Arukuen Nov 28, 2024
4fd12af
fix: disallow disabling of columns block
Arukuen Nov 28, 2024
4a2964e
feat: add popup on unsaved changes
Arukuen Nov 28, 2024
5359f2e
Merge branch 'develop' into feat-granular-plugin-setting
Jan 16, 2025
a0fc8ce
style tweaks
Jan 20, 2025
a0bab10
Fixed issue where blocks do not appear in the editor
Jan 20, 2025
7fa798e
enhanced styling of block toggle
Jan 21, 2025
8061849
simplified modal
Jan 21, 2025
ae79319
updated text and buttons
Jan 21, 2025
be0f257
tweaked subtitles
Jan 21, 2025
853278a
inverted box shadows
Jan 21, 2025
8e3ae0f
tweaked wording
Jan 21, 2025
4843f0f
fix: restucture block dependencies, storing them on individual block.…
Arukuen Jan 23, 2025
59c436d
fix: restructure substitition whitelist to individual blocks
Arukuen Jan 23, 2025
4d421ca
fix: added additional blocks to substitute
Arukuen Jan 23, 2025
fab452e
fix: remove substituteIfDisabledFunction
Arukuen Jan 23, 2025
5315a15
fix: change content of save button after saving
Arukuen Jan 24, 2025
35b766b
feat: if no settings in current tab, display message
Arukuen Jan 24, 2025
486a19a
fix: only show dependent children/parents when needed
Arukuen Jan 24, 2025
2ebbfda
chore: rename block dependecies to stk-required-blocks
Arukuen Jan 24, 2025
aca4c8f
fix: restructure block dependency
Arukuen Jan 24, 2025
a442c52
chore: rename to required blocks
Arukuen Jan 24, 2025
40862e2
fix: move disabling of block outside the registration
Arukuen Jan 24, 2025
d86aaaf
moved deprecated code to new file in deprecated folder
Jan 24, 2025
79ab801
Merge branch 'develop' into feat-granular-plugin-setting
Jan 24, 2025
6563a0a
added missing file
Jan 24, 2025
fd72772
fix: if a block cannot be disabled, default to hidden when disabling all
Arukuen Jan 25, 2025
e1ea223
Merge branch 'feat-granular-plugin-setting' of https://github.com/gam…
Arukuen Jan 25, 2025
76e9075
feat: restructured substitute transform to separate files per block
Arukuen Jan 27, 2025
ddf8c37
fix: import substitution rules and apply
Arukuen Jan 27, 2025
a48421e
fix: access substitutionRules directly for blocks that uses TEMPLATE
Arukuen Jan 27, 2025
93b3a13
fix: ensure there are default blocks if not disabled
Arukuen Jan 27, 2025
2ed9e67
fix: remove removeIfDisabled, make icon required for notification
Arukuen Jan 27, 2025
f27d809
feat: allow substitution of core blocks, console error for blocks wit…
Arukuen Jan 27, 2025
9f1c2dd
fix: add alignment attribute to heading, text substitute
Arukuen Jan 27, 2025
362a805
fix: UI changes
Arukuen Jan 27, 2025
21c8e79
Merge branch 'develop' into feat-granular-plugin-setting
Jan 27, 2025
17127ec
fix: FontAwesome notice alignment in free version
Arukuen Jan 28, 2025
359a374
Merge branch 'feat-granular-plugin-setting' of https://github.com/gam…
Arukuen Jan 28, 2025
7b2697f
feat: warn what disabled blocks are needed in design library
Arukuen Jan 28, 2025
5fa5fb7
align the font awesome notice with the field label
Jan 30, 2025
a9de828
fix: use stk-available-states instead, if cannot be change into a sta…
Arukuen Jan 30, 2025
ab38887
Merge branch 'feat-granular-plugin-setting' of https://github.com/gam…
Arukuen Jan 30, 2025
bf63341
fixed alignment of custom fields and role manager settings
Jan 30, 2025
ce117fb
Merge branch 'feat-granular-plugin-setting' of https://github.com/gam…
Jan 30, 2025
9d257ed
updated font awesome field styles
Jan 30, 2025
c87955d
added price and icon label substitution
Jan 30, 2025
a13591f
disallow disabling of design library block
Jan 30, 2025
80d7123
substitute divider with separator + allow no transform function
Jan 30, 2025
dc5bee1
updated some substitutions
Jan 30, 2025
2d63b48
added fix for blocks undefined when inserting new design library entry
Jan 30, 2025
00adbdf
added more substitutions
Jan 30, 2025
0fce075
added accordion and cta
Jan 30, 2025
00db456
added card substitute
Jan 30, 2025
0391659
added substitutions
Jan 30, 2025
b282f50
added more substitutions
Jan 30, 2025
2e33a46
fix old design library entries will encounter an error when being add…
Jan 30, 2025
73e20c7
fix: cascade by repeatedly checking if disabled
Arukuen Jan 30, 2025
75f7fc4
fix: refactor, fix some substitutions
Arukuen Jan 30, 2025
f277554
Merge branch 'feat-granular-plugin-setting' of https://github.com/gam…
Arukuen Jan 30, 2025
f20e9b5
fix: do a preorder traversal to ensure parent is processed first
Arukuen Jan 31, 2025
f4a8059
feat: add alert when substitution has been made
Arukuen Jan 31, 2025
2a6518d
fix: substitute from the root, fixes CTA and feature design
Arukuen Jan 31, 2025
fcf481d
fix: refactor, add oldAttributes to mimic previous design (batch 1)
Arukuen Jan 31, 2025
1bd276b
substitute: hero, icon, imageBox, pricingBox
Arukuen Jan 31, 2025
1119662
substitute: spacer, toc, testimonial, videoPopup
Arukuen Jan 31, 2025
8cc86ba
substitute: icon-box, transform to column then let it cascade
Arukuen Jan 31, 2025
7c74a00
substitute: icon-list, generic for now since issue with the design
Arukuen Jan 31, 2025
9f65930
fix: change dummy text for iconlist
Arukuen Jan 31, 2025
4e55017
substitute(non-design): separator, tabs, timeline
Arukuen Jan 31, 2025
bb1e848
fix old issue with migrating old colors
Jan 31, 2025
263b93f
after saving, the substituted image blocks encounter an error
Jan 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/block/card/variations.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ImageFaded from './images/faded.svg'
* External dependencies
*/
import { i18n, isPro } from 'stackable'
import { substituteIfDisabled } from '~stackable/util'

/**
* WordPress dependencies
Expand Down Expand Up @@ -105,7 +106,7 @@ const variations = applyFilters(
bottom: 0,
left: 0,
},
}, [
}, [ substituteIfDisabled( [ 'stackable/button-group|social-buttons', 'stackable/button-group|icon-button' ],
[ 'stackable/button-group', {
columnSpacing: {
top: 0,
Expand All @@ -132,6 +133,15 @@ const variations = applyFilters(
className: 'is-style-plain',
} ],
] ],
[ 'core/social-links',
{
align: 'right',
},
[
[ 'core/social-link', { service: 'facebook' } ],
[ 'core/social-link', { service: 'twitter' } ],
],
] ),
] ],
] ],
],
Expand Down
5 changes: 3 additions & 2 deletions src/block/icon-box/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
import {
withBlockAttributeContext, withBlockWrapperIsHovered, withQueryLoopContext,
} from '~stackable/higher-order'
import { substituteCoreIfDisabled } from '~stackable/util'

/**
* WordPress dependencies
Expand All @@ -49,9 +50,9 @@ export const TEMPLATE = [
text: __( 'Icon Box', i18n ), hasP: true, textTag: 'h4',
} ],
] ],
[ 'stackable/text', {
substituteCoreIfDisabled( 'stackable/text', {
text: 'Description for this block. Use this space for describing your block.',
} ],
} ),
]

const Edit = props => {
Expand Down
9 changes: 5 additions & 4 deletions src/block/notification/variations.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* External dependencies
*/
import { i18n, isPro } from 'stackable'
import { removeChildIfDisabled } from '~stackable/util'

/**
* WordPress dependencies
Expand Down Expand Up @@ -37,7 +38,7 @@ const variations = applyFilters(
pickerTitle: __( 'Default', i18n ),
pickerIcon: ImageDefault,
isActive: [ 'className' ],
innerBlocks: [
innerBlocks: removeChildIfDisabled( 'stackable/icon', [
[ 'stackable/icon', {
icon: '<svg data-prefix="fas" data-icon="exclamation-triangle" class="svg-inline--fa fa-exclamation-triangle fa-w-18" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" aria-hidden="true" width="32" height="32"><path fill="currentColor" d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"></path></svg>',
iconColor1: '#FFFFFF',
Expand All @@ -62,7 +63,7 @@ const variations = applyFilters(
},
} ],
] ],
],
] ),
scope: [ 'block' ],
},
{
Expand All @@ -83,7 +84,7 @@ const variations = applyFilters(
pickerTitle: __( 'Plain', i18n ),
pickerIcon: ImagePlain,
isActive: [ 'className' ],
innerBlocks: [
innerBlocks: removeChildIfDisabled( 'stackable/icon', [
[ 'stackable/icon', {
icon: '<svg data-prefix="fas" data-icon="exclamation-triangle" class="svg-inline--fa fa-exclamation-triangle fa-w-18" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" aria-hidden="true" width="32" height="32"><path fill="currentColor" d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"></path></svg>',
iconColor1: 'var(--stk-container-background-color, #40ba7b)',
Expand Down Expand Up @@ -111,7 +112,7 @@ const variations = applyFilters(
},
} ],
] ],
],
] ),
scope: [ 'block' ],
},
{
Expand Down
19 changes: 17 additions & 2 deletions src/block/team-member/variations.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Internal dependencies
*/
import { i18n, isPro } from 'stackable'
import { substituteIfDisabled } from '~stackable/util'

/**
* WordPress dependencies
Expand Down Expand Up @@ -53,6 +54,14 @@ import ImageCover from './images/cover.svg'
],
]

const socialLinksInnerBlocks = [
[ 'core/social-link', { service: 'facebook' } ],
[ 'core/social-link', { service: 'twitter' } ],
[ 'core/social-link', { service: 'instagram' } ],
[ 'core/social-link', { service: 'youtube' } ],
[ 'core/social-link', { service: 'linkedin' } ],
]

const variations = applyFilters(
'stackable.team-member.variations',
[
Expand All @@ -77,7 +86,10 @@ const variations = applyFilters(
text: __( 'Position', i18n ),
} ],
[ 'stackable/text', { text: _x( 'Description for this block. Use this space for describing your block. Any text will do. Description for this block. You can use this space for describing your block.', 'Content placeholder', i18n ) } ],
[ 'stackable/button-group', {}, buttonGroupInnerBlocks ],
substituteIfDisabled( [ 'stackable/button-group|social-buttons', 'stackable/button-group|icon-button' ],
[ 'stackable/button-group', {}, buttonGroupInnerBlocks ],
[ 'core/social-links', { align: 'center' }, socialLinksInnerBlocks ],
),
],
scope: [ 'block' ],
},
Expand All @@ -98,7 +110,10 @@ const variations = applyFilters(
[ 'stackable/subtitle', {
text: __( 'Position', i18n ),
} ],
[ 'stackable/button-group', {}, buttonGroupInnerBlocks ],
substituteIfDisabled( [ 'stackable/button-group|social-buttons', 'stackable/button-group|icon-button' ],
[ 'stackable/button-group', {}, buttonGroupInnerBlocks ],
[ 'core/social-links', { align: 'center' }, socialLinksInnerBlocks ],
),
],
scope: [ 'block' ],
},
Expand Down
5 changes: 3 additions & 2 deletions src/block/timeline/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
withQueryLoopContext,
} from '~stackable/higher-order'
import { range } from 'lodash'
import { substituteCoreIfDisabled } from '~stackable/util'

/**
* WordPress dependencies
Expand All @@ -68,9 +69,9 @@ const TEMPLATE = [
left: 0,
},
}, [
[ 'stackable/text', {
substituteCoreIfDisabled( 'stackable/text', {
text: _x( 'Description for this block. Use this space for describing your block. Any text will do.', 'Content placeholder', i18n ),
} ],
} ),
] ],
]

Expand Down
7 changes: 5 additions & 2 deletions src/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import './disabled-blocks'
* External dependencies
*/
import { i18n } from 'stackable'
import { addStackableBlockCategory, registerBlockType } from '~stackable/util'
import {
addStackableBlockCategory,
registerBlockType,
} from '~stackable/util'
import { withVisualGuideContext } from '~stackable/higher-order'

/**
Expand Down Expand Up @@ -45,7 +48,7 @@ const importAllAndRegister = r => {
settings.keywords = settings.keywords.map( keyword => __( keyword, i18n ) ) // eslint-disable-line @wordpress/i18n-no-variables
}

// Register the block.
// Register the block if it's not already registered and not disabled.
if ( ! getBlockType( name ) ) {
registerBlockType( name, settings )
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/admin-base-setting/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ let i = 1

const AdminBaseSetting = props => {
const [ uid ] = useState( `ugb-admin-setting-${ i++ }` )
const isSearched = props.searchTerm && props.label.toLowerCase().includes( props.searchTerm )
const mainClasses = classnames( [
'ugb-admin-setting',
props.className,
], {
[ `ugb-admin-setting--${ props.size }` ]: props.size,
'ugb-admin-setting--highlight': isSearched,
'ugb-admin-setting--not-highlight': props.searchTerm && ! isSearched,
} )

return (
Expand Down
14 changes: 14 additions & 0 deletions src/components/admin-toolbar-setting/editor.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.ugb-admin-toolbar-setting__wrapper {
display: flex;
a {
margin-right: 10px;
width: 80px;
}
.ugb-admin-toolbar-setting {
display: flex;
.ugb-button-component {
padding: 14px;
width: 100%;
}
}
}
74 changes: 74 additions & 0 deletions src/components/admin-toolbar-setting/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import AdminBaseSetting from '../admin-base-setting'
import Button from '../button'
import { ButtonGroup } from '@wordpress/components'
import { __ } from '@wordpress/i18n'
import { i18n } from 'stackable'

const AdminToolbarSetting = props => {
return (
<AdminBaseSetting { ...props }>
<div className="ugb-admin-toolbar-setting__wrapper">
<a
href={ props.demoLink }
target="_blank"
rel="noopener noreferrer"
onClick={ ev => ev.stopPropagation() }
>
{ __( 'view demo', i18n ) }
</a>
<ButtonGroup
children={
props.controls.map( option => {
const isSelected = props.value ? props.value === option.value : props.placeholder === option.value
const tabindex = isSelected ? '0' : '-1'

return <Button
style={ option.selectedColor && isSelected ? { backgroundColor: option.selectedColor } : {} }
isPrimary={ ! option.selectedColor && isSelected }
key={ option.value }
label={ option.title || props.label }
tabIndex={ tabindex }
aria-pressed={ isSelected }
isSmall={ props.isSmall }
onClick={ () => {
if ( option.value === props.value ) {
return
}
props.onChange( option.value )
} }
onKeyDown={ e => {
const el = e.target
if ( el ) {
// On right, select the next value or loop to first.
if ( e.keyCode === 39 ) {
const nextEl = el.nextElementSibling || el.parentElement.firstElementChild
nextEl.focus()
nextEl.click()

// Trigger click on the previous option or loop to last.
} else if ( e.keyCode === 37 ) {
const prevEl = el.previousElementSibling || el.parentElement.lastElementChild
prevEl.focus()
prevEl.click()
}
}
} }
children={ <span className="ugb-admin-toolbar-setting__option">{ option.title }</span> }
/>
} )
}
className="ugb-admin-toolbar-setting"
/>
</div>
</AdminBaseSetting>
)
}

AdminToolbarSetting.defaultProps = {
controls: [],
label: '',
value: '',
onChange: () => {},
}

export default AdminToolbarSetting
Loading
Loading