Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ COPY ghost/api-framework/package.json ghost/api-framework/package.json
COPY ghost/constants/package.json ghost/constants/package.json
COPY ghost/core/package.json ghost/core/package.json
COPY ghost/custom-fonts/package.json ghost/custom-fonts/package.json
COPY ghost/custom-theme-settings-service/package.json ghost/custom-theme-settings-service/package.json
COPY ghost/domain-events/package.json ghost/domain-events/package.json
COPY ghost/donations/package.json ghost/donations/package.json
COPY ghost/email-addresses/package.json ghost/email-addresses/package.json
Expand Down
4 changes: 3 additions & 1 deletion .docker/development.entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash

yarn nx reset

# Execute the CMD
exec "$@"
exec "$@"
2 changes: 1 addition & 1 deletion apps/admin-x-activitypub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@testing-library/react": "14.3.1",
"@types/jest": "29.5.14",
"@types/react": "18.3.20",
"@types/react-dom": "18.3.6",
"@types/react-dom": "18.3.7",
"jest": "29.7.0",
"ts-jest": "29.3.2"
},
Expand Down
5 changes: 5 additions & 0 deletions apps/admin-x-design-system/src/assets/icons/line-dashed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions apps/admin-x-design-system/src/assets/icons/line-dotted.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions apps/admin-x-design-system/src/assets/icons/line-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions apps/admin-x-design-system/src/assets/icons/text-bold.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions apps/admin-x-design-system/src/assets/icons/text-regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/admin-x-design-system/src/assets/images/ghost-orb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions apps/admin-x-design-system/src/global/ButtonGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import React from 'react';
import Button, {ButtonSize} from './Button';
import Tooltip from './Tooltip';

import {ButtonProps} from './Button';
import clsx from 'clsx';

export interface ButtonGroupButtonProps extends ButtonProps {
tooltip?: string | React.ReactNode;
}

export interface ButtonGroupProps {
size?: ButtonSize;
buttons: Array<ButtonProps>;
buttons: Array<ButtonGroupButtonProps>;
link?: boolean;
linkWithPadding?: boolean;
clearBg?: boolean;
Expand Down Expand Up @@ -49,7 +54,12 @@ const ButtonGroup: React.FC<ButtonGroupProps> = ({size = 'md', buttons, link, li
}

return (
<Button key={key} link={link} linkWithPadding={linkWithPadding} size={size} {...buttonProps} />
(props.tooltip ?
<Tooltip key={key} content={props.tooltip}>
<Button key={`btn-${key}`} link={link} linkWithPadding={linkWithPadding} size={size} {...buttonProps} />
</Tooltip> :
<Button key={key} link={link} linkWithPadding={linkWithPadding} size={size} {...buttonProps} />
)
);
})}
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/admin-x-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@tryghost/admin-x-design-system": "0.0.0",
"@tryghost/shade": "0.0.0",
"@types/react": "18.3.20",
"@types/react-dom": "18.3.6",
"@types/react-dom": "18.3.7",
"@vitejs/plugin-react": "4.4.1",
"react": "18.3.1",
"react-dom": "18.3.1",
Expand Down
2 changes: 2 additions & 0 deletions apps/admin-x-framework/src/api/newsletters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export type Newsletter = {
divider_color: string | null;
button_corners: string | null;
button_style: string | null;
link_style: string | null;
divider_style: string | null;
created_at: string;
updated_at: string;
count?: {
Expand Down
23 changes: 23 additions & 0 deletions apps/admin-x-framework/src/api/stats.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {Meta, createQuery} from '../utils/api/hooks';

// Types

export type TopContentItem = {
pathname: string;
visits: number;
title?: string;
}

export type TopContentResponseType = {
stats: TopContentItem[];
meta: Meta;
}

// Requests

const dataType = 'TopContentResponseType';

export const useTopContent = createQuery<TopContentResponseType>({
dataType,
path: '/stats/top-content/'
});
4 changes: 4 additions & 0 deletions apps/admin-x-framework/src/test/responses/newsletters.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"button_style": "fill",
"button_corners": null,
"link_color": null,
"link_style": null,
"divider_style": null,
"title_color": null,
"divider_color": null,
"created_at": "2023-05-05T00:55:16.000Z",
Expand Down Expand Up @@ -80,6 +82,8 @@
"button_style": "fill",
"button_corners": null,
"link_color": null,
"link_style": null,
"divider_style": null,
"title_color": null,
"divider_color": null,
"created_at": "2023-08-03T16:39:36.000Z",
Expand Down
2 changes: 1 addition & 1 deletion apps/admin-x-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@tryghost/admin-x-framework": "0.0.0",
"@tryghost/custom-fonts": "0.0.0",
"@types/react": "18.3.20",
"@types/react-dom": "18.3.6",
"@types/react-dom": "18.3.7",
"@types/validator": "13.15.0",
"@vitejs/plugin-react": "4.4.1",
"eslint-plugin-react-hooks": "4.6.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,24 +381,20 @@ const Sidebar: React.FC<{
contents:
<>
<Form className='mt-6' gap='xs' margins='lg' title='Typography'>
<div className="w-full">
<Select
disabled={!newsletter.show_post_title_section}
options={fontOptions}
selectedOption={fontOptions.find(option => option.value === newsletter.title_font_category)}
title='Heading font'
onSelect={option => updateNewsletter({title_font_category: option?.value})}
/>
</div>
<div className='w-full'>
<Select
disabled={!newsletter.show_post_title_section}
options={fontWeightOptions}
selectedOption={fontWeightOptions.find(option => option.value === newsletter.title_font_weight)}
title='Heading weight'
onSelect={option => updateNewsletter({title_font_weight: option?.value})}
/>
</div>
<Select
disabled={!newsletter.show_post_title_section}
options={fontOptions}
selectedOption={fontOptions.find(option => option.value === newsletter.title_font_category)}
title='Heading font'
onSelect={option => updateNewsletter({title_font_category: option?.value})}
/>
<Select
disabled={!newsletter.show_post_title_section}
options={fontWeightOptions}
selectedOption={fontWeightOptions.find(option => option.value === newsletter.title_font_weight)}
title='Heading weight'
onSelect={option => updateNewsletter({title_font_weight: option?.value})}
/>
<Select
options={fontOptions}
selectedOption={fontOptions.find(option => option.value === newsletter.body_font_category)}
Expand Down Expand Up @@ -527,6 +523,7 @@ const Sidebar: React.FC<{
key: 'left',
icon: 'align-left',
label: 'Align left',
tooltip: 'Left',
hideLabel: true,
link: false,
size: 'sm',
Expand All @@ -537,6 +534,7 @@ const Sidebar: React.FC<{
key: 'center',
icon: 'align-center',
label: 'Align center',
tooltip: 'Center',
hideLabel: true,
link: false,
size: 'sm',
Expand All @@ -552,6 +550,7 @@ const Sidebar: React.FC<{
key: 'fill',
icon: 'squircle-fill',
label: 'Fill',
tooltip: 'Fill',
hideLabel: true,
link: false,
size: 'sm',
Expand All @@ -561,6 +560,7 @@ const Sidebar: React.FC<{
key: 'outline',
icon: 'squircle',
label: 'Outline',
tooltip: 'Outline',
hideLabel: true,
link: false,
size: 'sm',
Expand All @@ -575,6 +575,7 @@ const Sidebar: React.FC<{
key: 'square',
icon: 'square',
label: 'Square',
tooltip: 'Squared',
hideLabel: true,
link: false,
size: 'sm',
Expand All @@ -584,6 +585,7 @@ const Sidebar: React.FC<{
key: 'squircle',
icon: 'squircle',
label: 'Squircle',
tooltip: 'Slightly rounded',
hideLabel: true,
link: false,
size: 'sm',
Expand All @@ -593,15 +595,84 @@ const Sidebar: React.FC<{
key: 'rounded',
icon: 'circle',
label: 'Rounded',
tooltip: 'Fully rounded',
hideLabel: true,
link: false,
size: 'sm',
onClick: () => updateNewsletter({button_corners: 'rounded'})
}
]} clearBg={false} />
</div>
<div>Link style</div>
<div>Divider style</div>
<div className='flex w-full justify-between'>
<div>Link style</div>
<ButtonGroup activeKey={newsletter.link_style || 'underline'} buttons={[
{
key: 'underline',
icon: 'text-underline',
label: 'Underline',
tooltip: 'Underline',
hideLabel: true,
link: false,
size: 'sm',
onClick: () => updateNewsletter({link_style: 'underline'})
},
{
key: 'regular',
icon: 'text-regular',
label: 'Regular',
tooltip: 'Regular',
hideLabel: true,
link: false,
size: 'sm',
onClick: () => updateNewsletter({link_style: 'regular'})
},
{
key: 'bold',
icon: 'text-bold',
label: 'Bold',
tooltip: 'Bold',
hideLabel: true,
link: false,
size: 'sm',
onClick: () => updateNewsletter({link_style: 'bold'})
}
]} clearBg={false} />
</div>
<div className='flex w-full justify-between'>
<div>Divider style</div>
<ButtonGroup activeKey={newsletter.divider_style || 'solid'} buttons={[
{
key: 'solid',
icon: 'line-solid',
label: 'Solid',
tooltip: 'Solid',
hideLabel: true,
link: false,
size: 'sm',
onClick: () => updateNewsletter({divider_style: 'solid'})
},
{
key: 'dashed',
icon: 'line-dashed',
label: 'Dashed',
tooltip: 'Dashed',
hideLabel: true,
link: false,
size: 'sm',
onClick: () => updateNewsletter({divider_style: 'dashed'})
},
{
key: 'dotted',
icon: 'line-dotted',
label: 'Dotted',
tooltip: 'Dotted',
hideLabel: true,
link: false,
size: 'sm',
onClick: () => updateNewsletter({divider_style: 'dotted'})
}
]} clearBg={false} />
</div>
</Form>
</>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,13 @@ const NewsletterPreview: React.FC<{newsletter: Newsletter}> = ({newsletter}) =>
bodyFontCategory={newsletter.body_font_category}
buttonCorners={newsletter.button_corners || 'squircle'}
buttonStyle={newsletter.button_style || 'fill'}
dividerStyle={newsletter.divider_style || 'solid'}
footerContent={newsletter.footer_content}
headerIcon={newsletter.show_header_icon ? icon : undefined}
headerImage={newsletter.header_image}
headerSubtitle={headerSubtitle}
headerTitle={headerTitle}
linkStyle={newsletter.link_style || 'underline'}
senderEmail={renderSenderEmail(newsletter, config, defaultEmailAddress)}
senderName={newsletter.sender_name || title}
senderReplyTo={renderReplyToEmail(newsletter, config, supportEmailAddress, defaultEmailAddress)}
Expand Down
Loading