Skip to content

Commit

Permalink
merge branch v2 (release 2.0.0-alpha.10)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcantondahmen committed Nov 24, 2024
2 parents c6118ae + 746af6f commit cc8976c
Show file tree
Hide file tree
Showing 38 changed files with 380 additions and 114 deletions.
34 changes: 23 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
# Changelog

## [v2.0.0-alpha.9](https://github.com/marcantondahmen/automad/commit/b0bebc0ddb73807dd5a217daa22989d003faf359)
## [v2.0.0-alpha.10](https://github.com/marcantondahmen/automad/commit/9f07136e84fce6fc7306b57f479b5f625703e60c)

Sat, 9 Nov 2024 14:00:18 +0100
Sun, 24 Nov 2024 11:58:06 +0100

### New Features

- add download link to file cards ([461ece5e4](https://github.com/marcantondahmen/automad/commit/461ece5e4a39e3d038c56fbdc69d00129e9fcec9))
- add option to define the order of fields inside the dashboard in the theme.json file ([55d93ec1a](https://github.com/marcantondahmen/automad/commit/55d93ec1a0164c6c7ba51bcd88488e6c8bac0350))
- make sure that block ids are always unique in rendered html ([9f07136e8](https://github.com/marcantondahmen/automad/commit/9f07136e84fce6fc7306b57f479b5f625703e60c))

### Bugfixes

- **ui**: fix button text overflow breaking card layouts ([2bdfe5fa3](https://github.com/marcantondahmen/automad/commit/2bdfe5fa30b8876812b9c2494233df4109aadc21))
- **ui**: fix datetime input field style on ios ([166e1dc7b](https://github.com/marcantondahmen/automad/commit/166e1dc7b434bf41fbdc5c3ce0f6a5ac74f224f5))
- fix download links in file info modal ([0b81320a4](https://github.com/marcantondahmen/automad/commit/0b81320a4b774e7055d1de5d0b5df5a27437d88d))
- fix navbar spacing in inpage edit form ([0fd31f749](https://github.com/marcantondahmen/automad/commit/0fd31f749ffccf14be8377d69db167dc75ae539f))
- fix position of inpage edit overlay in dom ([486a455ed](https://github.com/marcantondahmen/automad/commit/486a455ed3688fb0b5195c9307136a71c4889c8b))
- fix processing email addresses inside of markdown blocks ([af569f032](https://github.com/marcantondahmen/automad/commit/af569f032ff0ef47eef5a073042c4ace06ed2c26))
- fix small display alert being copied with editor content ([cb7a6c73a](https://github.com/marcantondahmen/automad/commit/cb7a6c73a387d12b126f2547361120fc1d42a58c))
- fix template name display in page data form ([451101ded](https://github.com/marcantondahmen/automad/commit/451101ded3cb4aa8b3e35467e300882b6d2f31b8))

## [v2.0.0-alpha.9](https://github.com/marcantondahmen/automad/commit/c6118ae98545f0d2e2783f2894d1a6da00d57121)

Sat, 9 Nov 2024 19:24:22 +0100

### New Features

Expand Down Expand Up @@ -421,12 +442,3 @@ Sun, 8 Aug 2021 22:25:34 +0200
### Bugfixes

- **themes**: fix thumbnail visibility ([45ed2eee5](https://github.com/marcantondahmen/automad/commit/45ed2eee5f1cf0b81148678820b6a796bf4791e2))

## [v1.8.1](https://github.com/marcantondahmen/automad/commit/8be976c0215c549d3ac27016b8c9fee02c052cca)

Sat, 7 Aug 2021 23:06:36 +0200

### Bugfixes

- **ui**: fix breadcrumbs position in safari ([0ed10e20d](https://github.com/marcantondahmen/automad/commit/0ed10e20d8d32f963be4d76c84d79bcf967b77c0))
- **ui**: fix status badge for outdated packages ([8b53a821f](https://github.com/marcantondahmen/automad/commit/8b53a821fa0d9cdc57af25f0eb122dc0dd312050))
2 changes: 1 addition & 1 deletion automad/lang/english.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"feedEnabled": "The RSS feed is enabled",
"fetchingDataError": "Error fetching data from API!",
"fieldsContent": "Content",
"fieldsCustomize": "Customize",
"fieldsCustomizations": "Customizations",
"fieldsSettings": "Settings",
"file": "File",
"fileName": "Filename",
Expand Down
12 changes: 1 addition & 11 deletions automad/src/client/admin/components/EditorJS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import { DragDrop } from '@/admin/editor/plugins/DragDrop';
import { LayoutTune } from '@/admin/editor/tunes/Layout';
import { EditorOutputData, KeyValueMap } from '@/admin/types';
import EditorJS, { EditorConfig, I18nDictionary } from 'automad-editorjs';
import { App, Attr, create, CSS } from '@/admin/core';
import { App, CSS } from '@/admin/core';
import { Delimiter } from '@/admin/editor/blocks/Delimiter';
import { ImageBlock } from '@/admin/editor/blocks/Image';
import { NestedListBlock } from '@/admin/editor/blocks/NestedList';
Expand Down Expand Up @@ -118,16 +118,6 @@ export class EditorJSComponent extends BaseComponent {
this.style.position = 'relative';
this.classList.add(CSS.contents);

create(
'am-alert',
[CSS.displaySmall],
{
[Attr.icon]: 'window',
[Attr.text]: 'editorSmallDisplayAlert',
},
this
);

this.editor = new EditorJS(
Object.assign(
{
Expand Down
16 changes: 15 additions & 1 deletion automad/src/client/admin/components/Fields/EditorField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@

import {
App,
Attr,
create,
createEditor,
CSS,
debounce,
FieldTag,
fire,
Expand Down Expand Up @@ -80,8 +82,20 @@ class EditorFieldComponent extends BaseFieldComponent {
this.setAttribute('name', name);
this.value = value as EditorOutputData;

const wrapper = create('div', [], { id }, this);

create(
'am-alert',
[CSS.displaySmall],
{
[Attr.icon]: 'window',
[Attr.text]: 'editorSmallDisplayAlert',
},
wrapper
);

this.editorJS = createEditor(
create('div', [], { id }, this),
wrapper,
{ blocks: this.value.blocks },
{
onChange: async (api: API) => {
Expand Down
3 changes: 2 additions & 1 deletion automad/src/client/admin/components/Fields/SelectField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class SelectFieldComponent extends BaseFieldComponent {
`${value}`,
this,
name,
id
id,
'<i class="bi bi-ui-radios"></i> '
);
}
}
Expand Down
10 changes: 10 additions & 0 deletions automad/src/client/admin/components/File/FileCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,16 @@ class FileCardComponent extends BaseComponent {
${Attr.text}="${App.text('copyUrlClipboard')}"
></am-icon-text>
</am-copy>
<a
href="${App.baseURL}${file.url}"
class="${CSS.dropdownLink}"
target="_blank"
>
<am-icon-text
${Attr.icon}="box-arrow-down"
${Attr.text}="${App.text('downloadFile')}"
></am-icon-text>
</a>
</div>
</am-dropdown>
`;
Expand Down
4 changes: 2 additions & 2 deletions automad/src/client/admin/components/File/FileInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ export class FileInfoComponent extends BaseComponent {
</am-modal-body>
<am-modal-footer>
<a
href="${file.url}"
href="${App.baseURL}${file.url}"
class="${CSS.button}"
download="$${file.basename}"
target="_blank"
>
${App.text('downloadFile')}
</a>
Expand Down
1 change: 1 addition & 0 deletions automad/src/client/admin/components/Forms/PageDataForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ export class PageDataFormComponent extends FormComponent {
fields: fieldGroups[item],
tooltips,
themeOptions,
renderEmptyAlert: item != 'customizations',
shared,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ export class SharedDataFormComponent extends FormComponent {
fields: fieldGroups[item],
tooltips,
themeOptions,
renderEmptyAlert: item != 'customizations',
});
});
}
Expand Down
8 changes: 4 additions & 4 deletions automad/src/client/admin/components/Pages/Page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ const renderMenu = (): string => {
</am-switcher-link>
<am-switcher-link
class="${CSS.menuItem}"
${Attr.section}="${Section.customize}"
${Attr.section}="${Section.customizations}"
>
${App.text('fieldsCustomize')}
${App.text('fieldsCustomizations')}
</am-switcher-link>
<am-switcher-link
class="${CSS.menuItem}"
Expand Down Expand Up @@ -232,9 +232,9 @@ const renderMenu = (): string => {
</am-switcher-link>
<am-switcher-link
class="${CSS.dropdownLink}"
${Attr.section}="${Section.customize}"
${Attr.section}="${Section.customizations}"
>
${App.text('fieldsCustomize')}
${App.text('fieldsCustomizations')}
</am-switcher-link>
<am-switcher-link
class="${CSS.dropdownLink}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const renderUsersSection = (): string => {
class="${CSS.button}"
${Attr.modal}="#am-add-user-modal"
>
${App.text('systemUsersAdd')}
<span>${App.text('systemUsersAdd')}</span>
</am-modal-toggle>
<am-modal-toggle
class="${CSS.button}"
Expand Down
8 changes: 4 additions & 4 deletions automad/src/client/admin/components/Pages/Shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ const renderMenu = (): string => {
</am-switcher-link>
<am-switcher-link
class="${CSS.menuItem}"
${Attr.section}="${Section.customize}"
${Attr.section}="${Section.customizations}"
>
${App.text('fieldsCustomize')}
${App.text('fieldsCustomizations')}
</am-switcher-link>
<am-switcher-link
class="${CSS.menuItem}"
Expand Down Expand Up @@ -104,9 +104,9 @@ const renderMenu = (): string => {
</am-switcher-link>
<am-switcher-link
class="${CSS.dropdownLink}"
${Attr.section}="${Section.customize}"
${Attr.section}="${Section.customizations}"
>
${App.text('fieldsCustomize')}
${App.text('fieldsCustomizations')}
</am-switcher-link>
<am-switcher-link
class="${CSS.dropdownLink}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,24 @@ export const inPage = ({ main }: Partials): string => {
<span
class="${CSS.flex} ${CSS.flexGap} ${CSS.flexAlignCenter}"
>
<am-undo-buttons></am-undo-buttons>
<span class="${CSS.navbarItem}">
<span class="${CSS.navbarGroup}">
<am-undo-buttons></am-undo-buttons>
<am-submit
class="${CSS.button}"
${Attr.form}="${InPageController.edit}"
disabled
>
${App.text('save')}
</am-submit>
<am-link
href="${App.baseIndex || '/'}"
class="${CSS.navbarItem}"
${Attr.bind}="inPageReturnUrl"
${Attr.bindTo}="${Attr.external}"
>
<i class="bi bi-x"></i>
</am-link>
</span>
<am-link
href="${App.baseIndex || '/'}"
class="${CSS.navbarItem}"
${Attr.bind}="inPageReturnUrl"
${Attr.bindTo}="${Attr.external}"
>
<i class="bi bi-x"></i>
</am-link>
</span>
</nav>
</div>
Expand Down
2 changes: 1 addition & 1 deletion automad/src/client/admin/core/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export const createFieldSections = (
const sections: FieldSectionCollection = {
settings: createSection(Section.settings),
text: createSection(Section.text),
customize: createSection(Section.customize),
customizations: createSection(Section.customizations),
};

return sections;
Expand Down
19 changes: 10 additions & 9 deletions automad/src/client/admin/core/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,35 +149,35 @@ export const createCustomizationFields = (
};
};

create('p', [], {}, sections.customize, App.text('customization'));
create('p', [], {}, sections.customizations, App.text('customization'));

createField(
FieldTag.code,
sections.customize,
sections.customizations,
buildFieldProps('CUSTOM_HTML_HEAD', App.text('customHTMLHead'))
);

createField(
FieldTag.code,
sections.customize,
sections.customizations,
buildFieldProps('CUSTOM_HTML_BODY_END', App.text('customHTMLBodyEnd'))
);

createField(
FieldTag.code,
sections.customize,
sections.customizations,
buildFieldProps('CUSTOM_JS_HEAD', App.text('customJSHead'))
);

createField(
FieldTag.code,
sections.customize,
sections.customizations,
buildFieldProps('CUSTOM_JS_BODY_END', App.text('customJSBodyEnd'))
);

createField(
FieldTag.code,
sections.customize,
sections.customizations,
buildFieldProps('CUSTOM_CSS', App.text('customCSS'))
);
};
Expand Down Expand Up @@ -215,9 +215,10 @@ export const fieldGroup = ({
fields,
tooltips,
themeOptions,
renderEmptyAlert,
shared,
}: FieldGroupData): void => {
if (Object.values(fields).length == 0) {
if (Object.values(fields).length == 0 && renderEmptyAlert) {
create(
'am-alert',
[],
Expand Down Expand Up @@ -333,7 +334,7 @@ export const prepareFieldGroups = (fields: KeyValueMap): FieldGroups => {
const groups: FieldGroups = {
settings: {},
text: {},
customize: {},
customizations: {},
};

Object.keys(fields).forEach((name) => {
Expand All @@ -345,7 +346,7 @@ export const prepareFieldGroups = (fields: KeyValueMap): FieldGroups => {
groups.text[name] = fields[name];
break;
case 'color':
groups.customize[name] = fields[name];
groups.customizations[name] = fields[name];
break;
default:
groups.settings[name] = fields[name];
Expand Down
2 changes: 1 addition & 1 deletion automad/src/client/admin/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export const titleCase = (str: string): string => {
return str
.replace(/\//g, ' / ')
.replace(/(?!^)([A-Z]+)/g, ' $1')
.replace('_', ' ')
.replace(/_/g, ' ')
.split(' ')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
Expand Down
14 changes: 3 additions & 11 deletions automad/src/client/admin/styles/components/card.less
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,9 @@
}

&-buttons {
display: flex;
gap: @am-card-padding;

* + & {
margin-top: @am-card-padding;
}

& > * {
flex: 1;
min-width: 0;
}
display: grid;
grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
gap: @am-flex-gap;
}
}

Expand Down
3 changes: 2 additions & 1 deletion automad/src/client/admin/styles/elements/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@

& p {
margin: 0;
max-width: 46rem;
max-width: @am-main-width-narrow;
color: hsl(var(--am-clr-text-paragraph));
text-wrap: balance;

&:not(:last-child) {
margin-bottom: @am-base-margin-y;
Expand Down
1 change: 1 addition & 0 deletions automad/src/client/admin/styles/elements/button.less
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
border-color: hsl(var(--border-hover));
}

&,
& > * {
overflow: hidden;
white-space: nowrap;
Expand Down
Loading

0 comments on commit cc8976c

Please sign in to comment.