@@ -116,7 +116,7 @@ const Edit = props => {
116116 const spacingSize = ! presetMarks || ! Array . isArray ( presetMarks ) ? 120 : presetMarks [ presetMarks . length - 2 ] . value
117117
118118 // Replaces the current block with a block made out of attributes.
119- const createBlockWithAttributes = async ( category , blockName , attributes , innerBlocks , substituteBlocks , parentClientId ) => {
119+ const createBlockWithAttributes = async ( category , blockName , attributes , innerBlocks , substituteBlocks , parentClientId , type ) => {
120120 const disabledBlocks = settings . stackable_block_states || { } // eslint-disable-line camelcase
121121
122122 // Recursively substitute core blocks to disabled Stackable blocks
@@ -207,7 +207,7 @@ const Edit = props => {
207207 innerBlocks = block [ 0 ] . innerBlocks
208208
209209 const isDesignLibraryDevMode = devMode && localStorage . getItem ( 'stk__design_library__dev_mode' ) === '1'
210- if ( ! isDesignLibraryDevMode ) {
210+ if ( ! isDesignLibraryDevMode && type !== 'saved' ) {
211211 if ( category !== 'Header' ) {
212212 if ( ! parentClientId && attributes . hasBackground ) {
213213 attributes . blockMargin = {
@@ -255,14 +255,16 @@ const Edit = props => {
255255 const blocks = [ ]
256256
257257 for ( const blockDesign of designs ) {
258- const { designData, category } = blockDesign
258+ const {
259+ designData, category, type,
260+ } = blockDesign
259261
260262 for ( const patterns of designData ) {
261263 const {
262264 name, attributes, innerBlocks,
263265 } = patterns
264266 if ( name && attributes ) {
265- const block = await createBlockWithAttributes ( category , name , applyFilters ( 'stackable.design-library.attributes' , attributes ) , innerBlocks || [ ] , substituteBlocks , parentClientId )
267+ const block = await createBlockWithAttributes ( category , name , applyFilters ( 'stackable.design-library.attributes' , attributes ) , innerBlocks || [ ] , substituteBlocks , parentClientId , type )
266268 blocks . push ( block )
267269 } else {
268270 console . error ( 'Design library selection failed: No block data found' ) // eslint-disable-line no-console
@@ -336,14 +338,16 @@ const Edit = props => {
336338
337339 _designs . forEach ( design => {
338340 const {
339- designData, blocksForSubstitution, category,
341+ designData, blocksForSubstitution, category, type : designType ,
340342 } = design
341343
342344 if ( blocksForSubstitution . size ) {
343345 disabledBlocks = disabledBlocks . union ( blocksForSubstitution )
344346 }
345347
346- designs . push ( { designData, category } )
348+ designs . push ( {
349+ designData, category, type : designType ,
350+ } )
347351 } )
348352
349353 designsRef . current = designs
0 commit comments