Skip to content

Commit

Permalink
Merge branch '5.x' of https://github.com/statamic/cms into starter-ki…
Browse files Browse the repository at this point in the history
…t-export-package-folder
  • Loading branch information
jesseleite committed Nov 26, 2024
2 parents 47a84ee + 79f00e6 commit 46a8ed1
Show file tree
Hide file tree
Showing 105 changed files with 2,193 additions and 770 deletions.
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Release Notes

## 5.39.0 (2024-11-22)

### What's new
- Field actions [#10352](https://github.com/statamic/cms/issues/10352) by @jacksleight
- Field action modals [#11129](https://github.com/statamic/cms/issues/11129) by @jacksleight
- Add ArrayableString to Blade value helper [#11041](https://github.com/statamic/cms/issues/11041) by @ajnsn
- Add `always_augment_to_query` option [#11086](https://github.com/statamic/cms/issues/11086) by @jacksleight

### What's fixed
- Fix multisite command not moving directories [#11105](https://github.com/statamic/cms/issues/11105) by @duncanmcclean
- Fix asset folder sort across pages [#11130](https://github.com/statamic/cms/issues/11130) by @daun
- Avoid creation of duplicate terms in typeahead input [#11060](https://github.com/statamic/cms/issues/11060) by @daun
- Fix error when using user ID as folder name for avatar asset field in non-admin context [#11141](https://github.com/statamic/cms/issues/11141) by @jonasemde
- Fix incorrect namespaces in tests [#11149](https://github.com/statamic/cms/issues/11149) by @duncanmcclean
- Prevent `str_replace` warning when using Debugbar [#11148](https://github.com/statamic/cms/issues/11148) by @duncanmcclean



## 5.38.1 (2024-11-19)

### What's fixed
- Fix issue when preprocessing dictionary config [#11133](https://github.com/statamic/cms/issues/11133) by @duncanmcclean
- Prevent unnecessary requests to the Outpost when PHP version is different [#11137](https://github.com/statamic/cms/issues/11137) by @duncanmcclean
- Fix bard text trimming when CP is on root URL [#11127](https://github.com/statamic/cms/issues/11127) by @jacksleight
- Hide "Localizable" button in asset blueprints [#11118](https://github.com/statamic/cms/issues/11118) by @duncanmcclean
- Add upload path traversal tests [#11139](https://github.com/statamic/cms/issues/11139) by @jasonvarga
- Prevent asset folder path traversal [#11136](https://github.com/statamic/cms/issues/11136) by @jasonvarga
- More path traversal fixes [#11140](https://github.com/statamic/cms/issues/11140) by @jasonvarga
- Italian translations [#11145](https://github.com/statamic/cms/issues/11145) by @gioppy



## 5.38.0 (2024-11-12)

### What's new
Expand Down
13 changes: 13 additions & 0 deletions config/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,19 @@

'update_references' => true,

/*
|--------------------------------------------------------------------------
| Always Augment to Query
|--------------------------------------------------------------------------
|
| By default, Statamic will augment relationship fields with max_items: 1
| to the result of a query, for example an Entry instance. Setting this
| to true will augment to the query builder instead of the result.
|
*/

'always_augment_to_query' => false,

/*
|--------------------------------------------------------------------------
| Row ID handle
Expand Down
2 changes: 1 addition & 1 deletion resources/css/components/fieldtypes/bard.css
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
========================================================================== */

.bard-fullscreen {
@apply fixed bg-gray-200 dark:bg-dark-700 inset-0 min-h-screen overflow-scroll rounded-none pt-16;
@apply fixed bg-gray-200 dark:bg-dark-700 inset-0 min-h-screen overflow-scroll rounded-none pt-14;

& > .bard-editor {
@apply bg-white dark:bg-dark-800 shadow dark:shadow-dark max-w-xl mx-auto rounded relative my-6 px-8;
Expand Down
5 changes: 3 additions & 2 deletions resources/css/components/fieldtypes/code.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
}
}

.code-fieldtype-toolbar select {
.code-fieldtype-toolbar select,
.code-fieldtype-toolbar-fullscreen select {
@apply h-8 text-sm leading-none;
}


.code-fieldtype-container.code-fullscreen {
@apply fixed bg-gray-200 dark:bg-dark-600 inset-0 min-h-screen overflow-scroll rounded-none pt-12;
@apply fixed bg-gray-200 dark:bg-dark-600 inset-0 min-h-screen overflow-scroll rounded-none pt-14;

.code-fieldtype-toolbar {
@apply fixed z-2 top-0 w-full px-6 py-2 h-12 shadow dark:shadow-dark text-base rounded-none bg-gradient-to-b from-white to-gray-100 dark:from-dark-550 dark:to-dark-600;
Expand Down
5 changes: 2 additions & 3 deletions resources/css/components/fieldtypes/markdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,12 @@
}

.markdown-fieldtype-wrapper.markdown-fullscreen {
@apply fixed bg-gray-200 inset-0 min-h-screen overflow-scroll rounded-none pt-16;
@apply fixed bg-gray-200 inset-0 min-h-screen overflow-scroll rounded-none pt-14 border-0;
/* padding-top: 52px; offset the nav */
will-change: transform;

.markdown-toolbar {
@apply fixed top-0 w-full px-6 py-2 h-12 shadow text-base flex items-center justify-between;
@apply bg-gradient-to-b from-white to-gray-100;
@apply border-0;
}

.mode-wrap {
Expand Down
14 changes: 14 additions & 0 deletions resources/css/components/publish.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@ code.parent-url {
@apply absolute inset-0 cursor-not-allowed bg-white/25;
z-index: 100;
}

.has-field-dropdown {
.field-inner {
@apply pr-6;
}
.field-dropdown {
@apply block absolute bottom-[-3px] right-0;
}
&:not(.has-field-label) {
.field-inner {
@apply min-h-[19.5px] mb-2;
}
}
}
}

.publish-field {
Expand Down
13 changes: 13 additions & 0 deletions resources/css/elements/buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,19 @@ td .btn-icon {
}
}

.btn-quick-action {
@apply text-center p-0 text-xl text-gray-600 dark:text-dark-150 rounded-full w-8 h-8 outline-none shrink-0 leading-none inline-flex items-center justify-center;

&:hover {
@apply bg-gray-400 dark:bg-dark-700;
}

&:active, &:focus:hover {
outline: none;
@apply bg-gray-500 dark:bg-dark-750;
}
}

.super-btn {
@apply p-4 flex items-start hover:bg-gray-200 border border-transparent rounded-md space-x-4 rtl:space-x-reverse;
@apply dark:hover:bg-dark-575 dark:hover:border-dark-400;
Expand Down
40 changes: 40 additions & 0 deletions resources/css/elements/dropdowns.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,44 @@
.align-left & {
right: auto ; [dir="rtl"] & { right: auto ; left: auto ; }
}

}

.quick-list {

@apply relative;

.quick-list-content {
@apply absolute top-1/2 right-full mr-[8px] -translate-y-1/2 min-w-max transition origin-right flex bg-white dark:bg-dark-550 shadow-quick rounded-full p-0.5;
&::before {
content: '';
position: absolute;
inset: -8px -8px -8px -20px;
z-index: -1;
}
button, a {
@apply rounded-full p-1.5 text-gray-800 dark:text-dark-100 flex shrink-0;
&:hover {
@apply bg-blue text-white;
}
}
&:empty {
@apply hidden;
}
}

button.warning, a.warning {
@apply text-red-500;

&:hover {
@apply bg-red-500 text-white;
}
}

&:not(:hover) {
.quick-list-content {
@apply opacity-0 pointer-events-none scale-[0.85];
}
}

}
2 changes: 1 addition & 1 deletion resources/css/vendors/codemirror.css
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@


.CodeMirror-fullscreen {
@apply fixed h-auto inset-0 top-12 rounded-none;
@apply fixed h-auto inset-0 pt-14 rounded-none;
}

.CodeMirror-rulers {
Expand Down
1 change: 1 addition & 0 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Vue.prototype.$echo = Statamic.$echo;
Vue.prototype.$bard = Statamic.$bard;
Vue.prototype.$keys = Statamic.$keys;
Vue.prototype.$reveal = Statamic.$reveal;
Vue.prototype.$fieldActions = Statamic.$fieldActions;
Vue.prototype.$slug = Statamic.$slug;

import Moment from 'moment';
Expand Down
6 changes: 6 additions & 0 deletions resources/js/bootstrap/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import PublishForm from '../components/publish/PublishForm.vue';
import Fields from '../components/publish/Fields.vue';
import FieldsContainer from '../components/publish/FieldsContainer.vue'; // deprecated
import Field from '../components/publish/Field.vue';
import FullscreenHeader from '../components/publish/FullscreenHeader.vue';
import FieldMeta from '../components/publish/FieldMeta.vue';
import FieldActions from '../components/field-actions/FieldActions.vue';
import ConfigureTabs from '../components/configure/Tabs.vue';
import PublishTabs from '../components/publish/Tabs.vue';
import PublishSections from '../components/publish/Sections.vue';
Expand Down Expand Up @@ -56,6 +58,7 @@ import Modal from '../components/Modal.vue';
import ConfirmationModal from '../components/modals/ConfirmationModal.vue';
import FavoriteCreator from '../components/FavoriteCreator.vue';
import KeyboardShortcutsModal from '../components/modals/KeyboardShortcutsModal.vue';
import FieldActionModal from '../components/field-actions/FieldActionModal.vue';
import ResourceDeleter from '../components/ResourceDeleter.vue';
import Stack from '../components/stacks/Stack.vue';
import StackTest from '../components/stacks/StackTest.vue';
Expand All @@ -77,6 +80,8 @@ Vue.component('publish-fields', Fields);
Vue.component('publish-fields-container', FieldsContainer);
Vue.component('publish-field', Field);
Vue.component('publish-field-meta', FieldMeta);
Vue.component('publish-field-actions', FieldActions);
Vue.component('publish-field-fullscreen-header', FullscreenHeader);
Vue.component('configure-tabs', ConfigureTabs);
Vue.component('publish-tabs', PublishTabs);
Vue.component('publish-sections', PublishSections);
Expand Down Expand Up @@ -140,6 +145,7 @@ Vue.component('confirmation-modal', ConfirmationModal);
Vue.component('favorite-creator', FavoriteCreator);
Vue.component('keyboard-shortcuts-modal', KeyboardShortcutsModal);
Vue.component('resource-deleter', ResourceDeleter);
Vue.component('field-action-modal', FieldActionModal);

Vue.component('stack', Stack);
Vue.component('stack-test', StackTest);
Expand Down
10 changes: 7 additions & 3 deletions resources/js/components/DropdownList.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<popover class="dropdown-list" :disabled="disabled" :placement="placement" :autoclose="autoclose" @opened="$emit('opened')" @closed="$emit('closed')">
<popover class="dropdown-list" :disabled="disabled" :placement="placement" :autoclose="autoclose" :offset="offset" @opened="$emit('opened')" @closed="$emit('closed')">
<template #trigger>
<slot name="trigger">
<button class="rotating-dots-button" :aria-label="__('Open Dropdown')">
<button class="rotating-dots-button" :aria-label="__('Open Dropdown')" type="button">
<svg class="rotating-dots fill-current" width="12" viewBox="0 0 24 24"><circle cx="3" cy="12" r="3"/><circle cx="12" cy="12" r="3"/><circle cx="21" cy="12" r="3"/></svg>
</button>
</slot>
Expand All @@ -25,7 +25,11 @@ export default {
autoclose: {
type: Boolean,
default: false
}
},
offset: {
type: Array,
default: () => [10, 0]
},
},
computed: {
strategy() {
Expand Down
6 changes: 6 additions & 0 deletions resources/js/components/Statamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Echo from './Echo';
import Bard from './Bard';
import Keys from './keys/Keys';
import Hooks from './Hooks';
import FieldActions from './field-actions/FieldActions';
import Reveal from './Reveal';
import Components from './Components';
import FieldConditions from './FieldConditions';
Expand All @@ -12,6 +13,7 @@ const echo = new Echo;
const bard = new Bard;
const keys = new Keys;
const hooks = new Hooks;
const fieldActions = new FieldActions;
const reveal = new Reveal;
const components = new Components;
const conditions = new FieldConditions;
Expand Down Expand Up @@ -54,6 +56,10 @@ export default new Vue({
return hooks;
},

$fieldActions() {
return fieldActions;
},

$reveal() {
return reveal;
},
Expand Down
28 changes: 28 additions & 0 deletions resources/js/components/field-actions/DropdownActions.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<div>
<button
v-for="action in actions"
@click="run(action)"
v-text="action.title" />
</div>
</template>

<script>
export default {
props: ['actions'],
inject: ['popover'],
methods: {
run(action) {
action.run();
this.popover.vm.close();
},
}
}
</script>
67 changes: 67 additions & 0 deletions resources/js/components/field-actions/FieldAction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import modal from './modal';

export default class FieldAction {
#payload;
#run;
#visible;
#visibleWhenReadOnly;
#icon;
#quick;
#confirm;

constructor(action, payload) {
this.#payload = payload;
this.#run = action.run;
this.#confirm = action.confirm;
this.#visible = action.visible ?? true;
this.#visibleWhenReadOnly = action.visibleWhenReadOnly ?? false;
this.#icon = action.icon ?? 'image';
this.#quick = action.quick ?? false;
this.title = action.title;
}

get visible() {
if (this.#payload.isReadOnly && !this.#visibleWhenReadOnly) {
return false;
}

return typeof this.#visible === 'function' ? this.#visible(this.#payload) : this.#visible;
}

get quick() {
return typeof this.#quick === 'function' ? this.#quick(this.#payload) : this.#quick;
}

get icon() {
return typeof this.#icon === 'function' ? this.#icon(this.#payload) : this.#icon;
}

async run() {
let payload = {...this.#payload};

if (this.#confirm) {
const confirmation = await modal(this.#modalProps());
if (!confirmation.confirmed) return;
payload = {...payload, confirmation};
}

const response = this.#run(payload);

if (response instanceof Promise) {
const progress = this.#payload.vm.$progress;
const name = this.#payload.fieldPathPrefix ?? this.#payload.handle;
progress.loading(name, true);
response.finally(() => progress.loading(name, false));
}
}

#modalProps() {
let props = this.#confirm === true ? {} : {...this.#confirm};

if (! props.title) {
props.title = this.title;
}

return props;
}
}
Loading

0 comments on commit 46a8ed1

Please sign in to comment.