Skip to content

Commit d849dc5

Browse files
Merge branch 'develop' of https://github.com/gambitph/Stackable into develop
2 parents c89125a + f2005dc commit d849dc5

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

src/components/style-guide-popover/index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { Popover, Button } from '@wordpress/components'
1818
import {
1919
Icon, close as closeIcon, download as downloadIcon,
2020
} from '@wordpress/icons'
21-
import { useDesignSystem } from '~stackable/hooks'
2221

2322
const StyleGuidePopover = props => {
2423
const { onClose } = props
@@ -32,8 +31,6 @@ const StyleGuidePopover = props => {
3231
return [ el, el?.offsetWidth, el?.offsetHeight ]
3332
}, [] )
3433

35-
const designSystem = useDesignSystem()
36-
3734
// Lazy load the StyleGuide component
3835
useEffect( () => {
3936
const loadStyleGuide = async () => {
@@ -42,7 +39,7 @@ const StyleGuidePopover = props => {
4239
const { default: StyleGuideComponent } = await import(
4340
/* webpackChunkName: "style-guide" */
4441
/* webpackMode: "lazy" */
45-
'../../lazy-components/style-guide'
42+
'../../lazy-components/style-guide/editor-style-guide'
4643
)
4744
setStyleGuide( () => StyleGuideComponent )
4845
} catch ( err ) {
@@ -85,7 +82,7 @@ const StyleGuidePopover = props => {
8582
{ __( 'Loading style guide…', i18n ) }
8683
</div>
8784
) : StyleGuide ? (
88-
<StyleGuide { ...props } designSystem={ designSystem } contentRef={ styleGuideRef } />
85+
<StyleGuide { ...props } contentRef={ styleGuideRef } />
8986
) : (
9087
<div className="ugb-style-guide__error">
9188
{ __( 'Failed to load style guide', i18n ) }

src/hooks/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ export * from './use-global-block-layout-defaults'
2121
export * from './use-block-color-schemes'
2222
export * from './use-preset-controls'
2323
export * from './use-block-style-context'
24-
export * from './use-design-system'
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { default as StyleGuide } from '.'
2+
import { useDesignSystem } from './use-design-system'
3+
4+
const EditorStyleGuide = props => {
5+
const designSystem = useDesignSystem()
6+
7+
return <StyleGuide { ...props } designSystem={ designSystem } />
8+
}
9+
10+
export default EditorStyleGuide

src/hooks/use-design-system.js renamed to src/lazy-components/style-guide/use-design-system.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { useBlockColorSchemes } from './use-block-color-schemes'
2-
import { useBlockLayoutDefaults } from './use-global-block-layout-defaults'
1+
import { useBlockColorSchemes } from '../../hooks/use-block-color-schemes'
2+
import { useBlockLayoutDefaults } from '../../hooks/use-global-block-layout-defaults'
33

44
import { settings } from 'stackable'
55
import { generateStyles } from '~stackable/block-components'
66
import { createTypographyStyles } from '~stackable/util/typography/styles'
77
import { createTypographyDescription } from '~stackable/util/typography/description'
8-
import { renderGlobalBlockLayoutStyles } from '~stackable/plugins/global-settings/utils'
8+
import { renderGlobalBlockLayoutStyles } from '~stackable/plugins/global-settings/utils/use-block-layout-editor-loader'
99
import { renderGlobalBlockStyleStyles } from '~stackable/plugins/global-settings/block-styles/editor-loader'
1010
import { renderGlobalColorSchemeStyles } from '~stackable/plugins/global-settings/color-schemes/editor-loader'
1111
import classnames from 'classnames'

0 commit comments

Comments
 (0)