Files
payloadcms/packages/richtext-lexical/src/features/upload/client/component/index.scss
Alessio Gravili 319d3355de feat: improve turbopack compatibility (#11376)
This PR introduces a few changes to improve turbopack compatibility and
ensure e2e tests pass with turbopack enabled

## Changes to improve turbopack compatibility
- Use correct sideEffects configuration to fix scss issues
- Import scss directly instead of duplicating our scss rules
- Fix some scss rules that are not supported by turbopack
- Bump Next.js and all other dependencies used to build payload

## Changes to get tests to pass

For an unknown reason, flaky tests flake a lot more often in turbopack.
This PR does the following to get them to pass:
- add more `wait`s
- fix actual flakes by ensuring previous operations are properly awaited

## Blocking turbopack bugs
- [X] https://github.com/vercel/next.js/issues/76464
  - Fix PR: https://github.com/vercel/next.js/pull/76545
  - Once fixed: change `"sideEffectsDisabled":` back to `"sideEffects":`
  
## Non-blocking turbopack bugs
- [ ] https://github.com/vercel/next.js/issues/76956

## Related PRs

https://github.com/payloadcms/payload/pull/12653
https://github.com/payloadcms/payload/pull/12652
2025-06-02 22:01:07 +00:00

148 lines
2.9 KiB
SCSS

@import '~@payloadcms/ui/scss';
@layer payload-default {
.lexical-upload {
@extend %body;
@include shadow-sm;
max-width: calc(var(--base) * 15);
display: flex;
align-items: center;
background: var(--theme-input-bg);
border-radius: $style-radius-m;
border: 1px solid var(--theme-elevation-100);
position: relative;
font-family: var(--font-body);
margin-block: base(0.5);
.btn {
margin: 0;
}
&:hover {
border: 1px solid var(--theme-elevation-150);
}
&__card {
@include soft-shadow-bottom;
display: flex;
flex-direction: column;
width: 100%;
}
&__topRow {
display: flex;
}
&__thumbnail {
width: calc(var(--base) * 3.25);
height: auto;
position: relative;
overflow: hidden;
flex-shrink: 0;
border-top-left-radius: $style-radius-m;
img,
svg {
position: absolute;
object-fit: cover;
width: 100%;
height: 100%;
background-color: var(--theme-elevation-800);
}
}
&__topRowRightPanel {
flex-grow: 1;
display: flex;
align-items: center;
padding: calc(var(--base) * 0.75);
justify-content: space-between;
max-width: calc(100% - #{calc(var(--base) * 3.25)});
}
&__actions {
display: flex;
align-items: center;
flex-shrink: 0;
margin-left: calc(var(--base) * 0.5);
.lexical-upload__doc-drawer-toggler {
pointer-events: all;
}
& > *:not(:last-child) {
margin-right: calc(var(--base) * 0.25);
}
}
&__removeButton {
margin: 0;
line {
stroke-width: $style-stroke-width-m;
}
&:disabled {
color: var(--theme-elevation-300);
pointer-events: none;
}
}
&__upload-drawer-toggler {
background-color: transparent;
border: none;
padding: 0;
margin: 0;
outline: none;
line-height: inherit;
}
&__doc-drawer-toggler {
text-decoration: underline;
}
&__doc-drawer-toggler,
&__list-drawer-toggler,
&__upload-drawer-toggler {
& > * {
margin: 0;
}
&:disabled {
color: var(--theme-elevation-300);
pointer-events: none;
}
}
&__collectionLabel {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&__bottomRow {
padding: calc(var(--base) * 0.5);
border-top: 1px solid var(--theme-elevation-100);
}
h5 {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
&__wrap {
padding: calc(var(--base) * 0.5) calc(var(--base) * 0.5) calc(var(--base) * 0.5) var(--base);
text-align: left;
overflow: hidden;
text-overflow: ellipsis;
}
@include small-break {
&__topRowRightPanel {
padding: calc(var(--base) * 0.75) calc(var(--base) * 0.5);
}
}
}
}