Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full width horizontal scroll #656

Open
wants to merge 42 commits into
base: 1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c8d7478
horizontal scroll basic set up
xIrusux Oct 18, 2024
038ff7f
build full scroll and use in workflow menu
xIrusux Oct 18, 2024
1b50e8a
allow using tab keys to navigate
xIrusux Oct 21, 2024
390220b
Apply eslint-fixer changes
xIrusux Oct 21, 2024
8fd5707
Automatic frontend build
xIrusux Oct 21, 2024
f866f03
merge
xIrusux Oct 21, 2024
f212157
Apply eslint-fixer changes
xIrusux Oct 21, 2024
59cf79b
Automatic frontend build
xIrusux Oct 21, 2024
38a5d3b
changes
xIrusux Oct 22, 2024
7157beb
resize observer
xIrusux Oct 22, 2024
8a8ee8c
wip
vin0401 Oct 22, 2024
574090c
Merge branch 'wip-horizontal-scroll' of github.com:pimcore/studio-ui-…
vin0401 Oct 22, 2024
e8433fa
wip
vin0401 Oct 22, 2024
3d74dc2
hide scroll element when there is not enough space and remove vertica…
xIrusux Oct 23, 2024
84fd6bf
give scroll max width
xIrusux Oct 23, 2024
fa24146
merge
xIrusux Oct 23, 2024
74a54e5
Apply eslint-fixer changes
xIrusux Oct 23, 2024
84c2be0
Automatic frontend build
xIrusux Oct 23, 2024
893704b
add story to show resizing in action
xIrusux Oct 23, 2024
b63c2d6
merge
xIrusux Oct 23, 2024
d5e704e
Apply eslint-fixer changes
xIrusux Oct 23, 2024
ebda30c
Automatic frontend build
xIrusux Oct 23, 2024
b32da37
feedback changes
xIrusux Oct 24, 2024
9b85197
Merge branch 'horizontal-scroll' of github.com:pimcore/studio-ui-bund…
xIrusux Oct 24, 2024
542395c
merge with main
xIrusux Oct 24, 2024
ffcb1e4
add absolute positioned buttons to control horizontal scroll bar
xIrusux Oct 28, 2024
760089a
only change width and show absolute buttons on resizing
xIrusux Oct 28, 2024
83b5eaf
final for now
xIrusux Oct 28, 2024
30055a2
Automatic frontend build
xIrusux Oct 28, 2024
35de4e5
implement on higher level so it affects toolbars in more places inclu…
xIrusux Oct 29, 2024
8567d3f
styling not the perfect solution
xIrusux Oct 29, 2024
dad40e0
story update
xIrusux Oct 29, 2024
d21c8df
merge
xIrusux Oct 29, 2024
e9f9795
Automatic frontend build
xIrusux Oct 29, 2024
c77020c
merge
xIrusux Oct 29, 2024
4ee3897
Apply eslint-fixer changes
xIrusux Oct 29, 2024
233a752
merge
xIrusux Oct 29, 2024
3aa97a6
merge
xIrusux Oct 29, 2024
37457a3
Automatic frontend build
xIrusux Oct 29, 2024
ff536a7
Merge branch 'full-width-horizontal-scroll' of github.com:pimcore/stu…
xIrusux Oct 29, 2024
70d85fb
Apply eslint-fixer changes
xIrusux Oct 29, 2024
ebe372c
Automatic frontend build
xIrusux Oct 29, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@ export const useStyles = createStyles(({ token, css }) => {
border-top: 1px solid ${token.colorBorderTertiary};
grid-column: 1 / 2;
grid-row: 2 / 3;
position: sticky;
position: relative;
overflow-x: auto;
overflow-y: clip;
bottom: 0;
height: ${token.sizeXXL}px;
&::-webkit-scrollbar {
display: none;
}
}
.content-toolbar-sidebar-layout__sidebar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import React, { memo, type ReactNode } from 'react'
import { useStyles } from './content-toolbar-sidebar-layout.styles'
import { Content } from '../content/content'
import { HorizontalScroll } from '@Pimcore/components/horizontal-scroll/horizontal-scroll'

interface ContentToolbarViewProps {
children: ReactNode
Expand All @@ -36,15 +37,17 @@ const Component = (props: ContentToolbarViewProps): React.JSX.Element => {
</Content>

{ props.renderToolbar !== undefined && (
<div className='content-toolbar-sidebar-layout__toolbar'>
<div className='content-toolbar-sidebar-layout__toolbar'>
<HorizontalScroll>
{props.renderToolbar}
</div>
</HorizontalScroll>
</div>
)}

{ props.renderSidebar !== undefined && (
<div className='content-toolbar-sidebar-layout__sidebar'>
{props.renderSidebar}
</div>
{props.renderSidebar !== undefined && (
<div className='content-toolbar-sidebar-layout__sidebar'>
{props.renderSidebar}
</div>
)}
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,7 @@ const exampleLargeTagList: TagProps[][] = [
{ children: 'Tag 6' }
]
]

const exampleSmallTagList: TagProps[][] = [
[
{ children: 'Tag 1' },
{ children: 'Tag 2' },
{ children: 'Tag 3' }
]
]
export const _default = {
args: {
children: <TagList
itemGap={ 'extra-small' }
list={ exampleLargeTagList }
wrap={ false }
/>
}
}

export const resizeable = {
args: {
children: <TagList
itemGap={ 'extra-small' }
Expand Down Expand Up @@ -91,13 +73,3 @@ export const resizeable = {
/>
)
}
export const ScrollNotRequired = {
args: {
children: <TagList
itemGap={ 'extra-small' }
list={ exampleSmallTagList }
wrap={ false }
/>,
scrollWidth: 150
}
}
7 changes: 2 additions & 5 deletions assets/js/src/core/components/toolbar/toolbar.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ export const useStyles = createStyles(({ token, css }) => {
return {
toolbar: css`
width: 100%;
height: 48px;
border-top: 1px solid ${token.colorBorder};

height: 48px;
padding: ${token.paddingXS}px;

&.toolbar--theme-primary {
// @todo: use token
background-color: #F5F3FA;
background-color: ${token.colorBgToolbar};
}

&.toolbar--theme-secondary {
Expand Down
27 changes: 14 additions & 13 deletions assets/js/src/core/modules/asset/editor/toolbar/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,22 @@ export const Toolbar = (): React.JSX.Element => {

return (
<ToolbarView>
<ContextMenu />
<Flex
className='overflow-x-auto'
style={ { height: '32px' } }
vertical={ false }
justify={ 'space-between' }
style={ { width: '100%' } }
>
<EditorToolbarWorkflowMenu />
<Button
disabled={ !hasChanges || isLoading || isSchedulesLoading }
loading={ isLoading || isSchedulesLoading }
onClick={ onSaveClick }
type="primary"
>
{t('toolbar.save-and-publish')}
</Button>
<ContextMenu />
<Flex>
<EditorToolbarWorkflowMenu />
<Button
disabled={ !hasChanges || isLoading || isSchedulesLoading }
loading={ isLoading || isSchedulesLoading }
onClick={ onSaveClick }
type="primary"
>
{t('toolbar.save-and-publish')}
</Button>
</Flex>
</Flex>
</ToolbarView>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { Dropdown, type DropdownMenuProps, type ItemType } from '@Pimcore/compon
import { DropdownButton } from '@Pimcore/components/dropdown-button/dropdown-button'
import { Icon } from '@Pimcore/components/icon/icon'
import { useTranslation } from 'react-i18next'
import { HorizontalScroll } from '@Pimcore/components/horizontal-scroll/horizontal-scroll'

export const EditorToolbarWorkflowMenu = (): React.JSX.Element => {
const { t } = useTranslation()
Expand Down Expand Up @@ -88,17 +87,14 @@ export const EditorToolbarWorkflowMenu = (): React.JSX.Element => {
return (
<Flex
align={ 'center' }
className='overflow-x-auto'
justify={ 'flex-end' }
>
{!isLoading && (
<HorizontalScroll>
<TagList
itemGap={ 'extra-small' }
list={ getVisibleWorkflowStatus() }
wrap={ false }
/>
</HorizontalScroll>
<TagList
itemGap={ 'extra-small' }
list={ getVisibleWorkflowStatus() }
wrap={ false }
/>
)}
<Dropdown
menu={ { items } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ export const useStyles = createStyles(({ token, css }) => {

.tabs-toolbar-layout__toolbar {
display: flex;
overflow: hidden;
position: relative;
overflow-y: clip;
height: ${token.sizeXXL}px;
background-color: ${token.colorBgToolbar};
border-top: 1px solid ${token.colorBorder};
width: 100%;
}
`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import React, { type ReactNode } from 'react'
import { useStyles } from './tabs-toolbar-view.styles'
import { HorizontalScroll } from '@Pimcore/components/horizontal-scroll/horizontal-scroll'

export interface TabbarToolbarViewProps {
renderTabbar: ReactNode
Expand All @@ -28,8 +29,10 @@ const TabsToolbarView = (props: TabbarToolbarViewProps): React.JSX.Element => {
{props.renderTabbar}
</div>

<div className='tabs-toolbar-layout__toolbar'>
{props.renderToolbar}
<div className={ 'tabs-toolbar-layout__toolbar' }>
<HorizontalScroll>
{props.renderToolbar}
</HorizontalScroll>
</div>
</div>
)
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"entrypoints": {
"main": {
"js": [
"/bundles/pimcorestudioui/build/8042aa5e-6795-4392-96cb-00c3542c9d8e/main.js"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"bundles/pimcorestudioui/build/8042aa5e-6795-4392-96cb-00c3542c9d8e/main.js": "/bundles/pimcorestudioui/build/8042aa5e-6795-4392-96cb-00c3542c9d8e/main.js"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"entrypoints": {
"vendor": {
"js": [
"/bundles/pimcorestudioui/build/ace8b035-44fc-463f-9505-ee77cbbf5957/vendor.js"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"bundles/pimcorestudioui/build/ace8b035-44fc-463f-9505-ee77cbbf5957/vendor.js": "/bundles/pimcorestudioui/build/ace8b035-44fc-463f-9505-ee77cbbf5957/vendor.js"
}
12 changes: 0 additions & 12 deletions public/build/b5ba10b9-1d4b-4c71-9b5f-2dae281aa35c/entrypoints.json

This file was deleted.

This file was deleted.

This file was deleted.

Loading