diff --git a/services/web/frontend/js/features/editor-navigation-toolbar/components/layout-dropdown-button.tsx b/services/web/frontend/js/features/editor-navigation-toolbar/components/layout-dropdown-button.tsx
index b580fa5cf8..2a41641df4 100644
--- a/services/web/frontend/js/features/editor-navigation-toolbar/components/layout-dropdown-button.tsx
+++ b/services/web/frontend/js/features/editor-navigation-toolbar/components/layout-dropdown-button.tsx
@@ -10,6 +10,7 @@ import {
DropdownItem,
DropdownMenu,
DropdownToggle,
+ DropdownToggleCustom,
} from '@/features/ui/components/bootstrap-5/dropdown-menu'
import { Trans, useTranslation } from 'react-i18next'
import Tooltip from '../../../shared/components/tooltip'
@@ -136,7 +137,7 @@ const LayoutDropdownToggleButton = forwardRef<
onClick(e)
}
- return
+ return
})
LayoutDropdownToggleButton.displayName = 'LayoutDropdownToggleButton'
diff --git a/services/web/frontend/js/features/pdf-preview/components/detach-compile-button.tsx b/services/web/frontend/js/features/pdf-preview/components/detach-compile-button.tsx
index b9f4046f72..fa7f8d0f60 100644
--- a/services/web/frontend/js/features/pdf-preview/components/detach-compile-button.tsx
+++ b/services/web/frontend/js/features/pdf-preview/components/detach-compile-button.tsx
@@ -46,7 +46,7 @@ function DetachCompileButton() {
size="sm"
isLoading={compiling}
bs3Props={{
- loading: (
+ loading: compiling && (
<>
@@ -58,11 +58,14 @@ function DetachCompileButton() {
>
- {compileButtonLabel}
-
+ <>
+
+
+ {compileButtonLabel}
+
+ >
}
- bs5={compileButtonLabel}
+ bs5={t('recompile')}
/>
diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-compile-button.tsx b/services/web/frontend/js/features/pdf-preview/components/pdf-compile-button.tsx
index 33eff04e57..0297205148 100644
--- a/services/web/frontend/js/features/pdf-preview/components/pdf-compile-button.tsx
+++ b/services/web/frontend/js/features/pdf-preview/components/pdf-compile-button.tsx
@@ -9,6 +9,7 @@ import * as eventTracking from '../../../infrastructure/event-tracking'
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
import OLTooltip from '@/features/ui/components/ol/ol-tooltip'
import {
+ DropdownToggleCustom,
Dropdown,
DropdownDivider,
DropdownHeader,
@@ -18,7 +19,7 @@ import {
} from '@/features/ui/components/bootstrap-5/dropdown-menu'
import OLButton from '@/features/ui/components/ol/ol-button'
import OLButtonGroup from '@/features/ui/components/ol/ol-button-group'
-import { bsVersion } from '@/features/utils/bootstrap-5'
+import { bsVersion, isBootstrap5 } from '@/features/utils/bootstrap-5'
import { useLayoutContext } from '@/shared/context/layout-context'
const modifierKey = /Mac/i.test(navigator.platform) ? 'Cmd' : 'Ctrl'
@@ -78,15 +79,18 @@ function PdfCompileButton() {
{
'detach-compile-button-animate': animateCompileDropdownArrow,
'btn-striped-animated': hasChanges,
- 'no-left-border': true,
},
+ 'no-left-border',
bsVersion({ bs5: 'dropdown-button-toggle' })
)
- const buttonClassName = classNames({
- 'btn-striped-animated': hasChanges,
- 'no-left-radius': true,
- })
+ const buttonClassName = classNames(
+ {
+ 'btn-striped-animated': hasChanges,
+ 'align-items-center py-0': isBootstrap5(),
+ },
+ 'no-left-radius px-3'
+ )
return (
}
bs5={
-
+
startCompile()}
@@ -230,6 +237,7 @@ function PdfCompileButton() {
(
+ ({ children, className, ...props }, ref) => (
+
+ {children}
+
+
+ )
+)
+DropdownToggleCustom.displayName = 'CustomCaret'
+
export const DropdownToggle = forwardRef<
typeof BS5DropdownToggle,
DropdownToggleProps
diff --git a/services/web/frontend/stories/editor/pdf-compile-button.stories.tsx b/services/web/frontend/stories/editor/pdf-compile-button.stories.tsx
new file mode 100644
index 0000000000..360c2c12b3
--- /dev/null
+++ b/services/web/frontend/stories/editor/pdf-compile-button.stories.tsx
@@ -0,0 +1,56 @@
+import { FC } from 'react'
+import type { Meta } from '@storybook/react'
+import PdfCompileButton from '@/features/pdf-preview/components/pdf-compile-button'
+import { ScopeDecorator } from '../decorators/scope'
+import { CompileContext } from '@/shared/context/local-compile-context'
+import { DetachCompileContext } from '@/shared/context/detach-compile-context'
+import { bsVersionDecorator } from '../../../.storybook/utils/with-bootstrap-switcher'
+
+export const CompileButton: FC = (props: CompileContext) => (
+
+
+
+)
+
+const args: Partial = {
+ autoCompile: false,
+ compiling: false,
+ draft: false,
+ hasChanges: false,
+ stopOnFirstError: false,
+ stopOnValidationError: false,
+ animateCompileDropdownArrow: false,
+}
+
+const meta: Meta = {
+ title: 'Editor / Toolbar / Compile Button',
+ component: CompileButton,
+ // @ts-ignore
+ decorators: [ScopeDecorator],
+ argTypes: {
+ ...bsVersionDecorator.argTypes,
+ startCompile: { action: 'startCompile' },
+ setAutoCompile: { action: 'setAutoCompile' },
+ setCompiling: { action: 'setCompiling' },
+ setDraft: { action: 'setDraft' },
+ setStopOnFirstError: { action: 'setStopOnFirstError' },
+ setError: { action: 'setError' },
+ setHasLintingError: { action: 'setHasLintingError' },
+ setPosition: { action: 'setPosition' },
+ setStopOnValidationError: { action: 'setStopOnValidationError' },
+ recompileFromScratch: { action: 'recompileFromScratch' },
+ stopCompile: { action: 'stopCompile' },
+ setAnimateCompileDropdownArrow: {
+ action: 'setAnimateCompileDropdownArrow',
+ },
+ },
+ args,
+}
+
+export default meta
diff --git a/services/web/frontend/stylesheets/bootstrap-5/components/dropdown-menu.scss b/services/web/frontend/stylesheets/bootstrap-5/components/dropdown-menu.scss
index 042251c9a7..d64e699fd7 100644
--- a/services/web/frontend/stylesheets/bootstrap-5/components/dropdown-menu.scss
+++ b/services/web/frontend/stylesheets/bootstrap-5/components/dropdown-menu.scss
@@ -1,5 +1,20 @@
.dropdown {
display: inline-flex;
+
+ .no-left-border {
+ border-left: none;
+ }
+
+ .custom-toggle {
+ &::after {
+ content: none !important;
+ }
+
+ padding-left: var(--spacing-04);
+ padding-right: var(--spacing-05);
+ display: flex;
+ align-items: center;
+ }
}
.dropdown-header {
diff --git a/services/web/frontend/stylesheets/bootstrap-5/pages/editor/compile-button.scss b/services/web/frontend/stylesheets/bootstrap-5/pages/editor/compile-button.scss
index fd29d70acf..db5395cd2c 100644
--- a/services/web/frontend/stylesheets/bootstrap-5/pages/editor/compile-button.scss
+++ b/services/web/frontend/stylesheets/bootstrap-5/pages/editor/compile-button.scss
@@ -29,3 +29,43 @@ $stripe-width: 20px;
cursor: not-allowed;
}
}
+
+@keyframes compile-button-flash {
+ 0%,
+ 100% {
+ background: rgb(0 0 0 / 0%);
+ }
+
+ 25%,
+ 75% {
+ background: rgb(0 0 0 / 20%);
+ }
+}
+
+@keyframes compile-button-bounce {
+ 0%,
+ 50%,
+ 100% {
+ transform: translateY(0);
+ }
+
+ 25%,
+ 75% {
+ transform: translateY(2px);
+ }
+}
+
+.detach-compile-button-animate {
+ animation-duration: 1.2s;
+ animation-fill-mode: both;
+ animation-timing-function: ease-in-out;
+ animation-name: compile-button-flash;
+}
+
+.detach-compile-button-animate .material-symbols {
+ animation-duration: 0.6s;
+ animation-delay: 0.4s;
+ animation-fill-mode: both;
+ animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
+ animation-name: compile-button-bounce;
+}
diff --git a/services/web/frontend/stylesheets/bootstrap-5/pages/editor/pdf.scss b/services/web/frontend/stylesheets/bootstrap-5/pages/editor/pdf.scss
index 8a83ffb48c..e7bc249144 100644
--- a/services/web/frontend/stylesheets/bootstrap-5/pages/editor/pdf.scss
+++ b/services/web/frontend/stylesheets/bootstrap-5/pages/editor/pdf.scss
@@ -26,6 +26,17 @@
.toolbar-pdf-left {
gap: var(--spacing-02);
+ .compile-button-group {
+ height: 28px;
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+ background-color: var(--bg-accent-01);
+
+ .btn-primary:hover {
+ z-index: auto; // prevents border from being hidden
+ }
+ }
+
.dropdown > .btn {
border-top-left-radius: 0;
border-bottom-left-radius: 0;