Skip to content

Commit

Permalink
Merge branch '5.x' into feature/static-recache-without-deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell authored Sep 11, 2024
2 parents 15b077a + ee380ae commit 34815b6
Show file tree
Hide file tree
Showing 416 changed files with 13,462 additions and 2,123 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Please take 30 seconds to read the following so we can be as efficient as possib

2️⃣ Please make sure to create a new branch for your PR.

3️⃣ Typically you should target the branch of the most current release, e.g. `4.x`, unless your PR includes a breaking change, in which case you should target the `master` branch for the next major release.
3️⃣ Typically you should target the branch of the most current release, e.g. `5.x`, unless your PR includes a breaking change, in which case you should target the `master` branch for the next major release.

4️⃣ We _really_ appreciate it if your PR includes tests. This makes it much easier for us to review, merge, and release. A PR with tests is usually reviewed and merged 5x-10x faster.

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
uses: tj-actions/changed-files@v44
with:
files: |
**.{js,vue,ts}
**/*.{js,vue,ts}
package.json
.github/workflows/tests.yml
Expand Down
231 changes: 231 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ While working to identify potential security vulnerabilities in Statamic, we ask
- Provide a quality report with precise explanations and concrete attack scenarios.

## Scope
We are only interested in vulnerabilities that affect Statamic itself, tested against **your own local installation** of the software, running the latest version. You can install a local copy of Statamic by following these [installation instructions](https://statamic.dev/installing). Do not test against any Statamic installation that you don’t own, including [statamic.com](https:/statamic.com) or [statamic.dev](https://statamic.dev).
We are only interested in vulnerabilities that affect Statamic itself, tested against **your own local installation** of the software, running the latest version. You can install a local copy of Statamic by following these [installation instructions](https://statamic.dev/installing). Do not test against any Statamic installation that you don’t own, including [statamic.com](https:/statamic.com), [statamic.dev](https://statamic.dev), and [demo.statamic.com](https://demo.statamic.com).

### Potentially Qualifying Vulnerabilities

Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"james-heinrich/getid3": "^1.9.21",
"laravel/framework": "^10.40 || ^11.0",
"laravel/prompts": "^0.1.16",
"league/commonmark": ">=2.2 <2.5",
"league/commonmark": "^2.2",
"league/csv": "^9.0",
"league/glide": "^2.3",
"maennchen/zipstream-php": "^3.1",
Expand All @@ -31,7 +31,7 @@
"symfony/lock": "^6.4",
"symfony/var-exporter": "^6.0",
"symfony/yaml": "^6.0 || ^7.0",
"ueberdosis/tiptap-php": "^1.1",
"ueberdosis/tiptap-php": "^1.4",
"voku/portable-ascii": "^2.0",
"wilderborn/partyline": "^1.0"
},
Expand All @@ -42,7 +42,8 @@
"laravel/pint": "1.16.0",
"mockery/mockery": "^1.3.3",
"orchestra/testbench": "^8.14 || ^9.0",
"phpunit/phpunit": "^10.0"
"phpunit/phpunit": "^10.0",
"spatie/laravel-ray": "^1.37"
},
"config": {
"optimize-autoloader": true,
Expand Down
23 changes: 23 additions & 0 deletions config/static_caching.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,29 @@

'ignore_query_strings' => false,

'allowed_query_strings' => [
//
],

'disallowed_query_strings' => [
//
],

/*
|--------------------------------------------------------------------------
| Nocache
|--------------------------------------------------------------------------
|
| Here you may define where the nocache data is stored.
|
| https://statamic.dev/tags/nocache#database
|
| Supported drivers: "cache", "database"
|
*/

'nocache' => 'cache',

/*
|--------------------------------------------------------------------------
| Replacers
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@tiptap/vue-2": "^2.0.2",
"alpinejs": "^3.1.1",
"autosize": "~3.0.12",
"axios": "^1.6.0",
"axios": "^1.7.4",
"body-scroll-lock": "^4.0.0-beta.0",
"codemirror": "^5.58.2",
"cookies-js": "^1.2.2",
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/assets.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@

}

.assets-fieldtype-picker + .asset-table-listing {
@apply rounded-t-none;
}

.asset-listing .actions {
margin-bottom: 15px;
display: flex;
Expand Down
18 changes: 17 additions & 1 deletion resources/css/components/fieldtypes/bard.css
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,23 @@
h1, h2, h3, h4, h5, h6 {
margin-top: 1.275em;
margin-bottom: .85em;
font-weight: 700
font-weight: 700;

b,
strong {
font-weight: 900;
}

a {
@apply text-blue dark:text-dark-blue-100 underline break-words;
}

a:active,
a:focus,
a:hover {
outline: 0;
text-decoration: underline;
}
}

h1 { font-size: 2em }
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/fieldtypes/datetime.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
@apply border-none bg-none;
}

.vc-container.vc-is-dark {
@apply dark:bg-transparent;
}

/* Time Field
========================================================================== */

Expand Down
20 changes: 20 additions & 0 deletions resources/css/components/fieldtypes/dictionary-fields.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.dictionary_fields-fieldtype {
@apply p-0;

.publish-fields {
@apply w-full;
}

.config-field {
@apply md:flex flex-wrap border-b border-gray-400 dark:border-dark-900 w-full;
@apply p-3 @sm:p-4 m-0;

.field-inner {
@apply w-full md:w-1/2 rtl:md:pl-8 ltr:md:pr-8;
}

.field-inner + div {
@apply w-full md:w-1/2;
}
}
}
1 change: 1 addition & 0 deletions resources/css/cp.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
@import "components/fieldtypes/checkboxes";
@import "components/fieldtypes/code";
@import "components/fieldtypes/datetime";
@import "components/fieldtypes/dictionary-fields";
@import "components/fieldtypes/environment";
@import "components/fieldtypes/grid";
@import "components/fieldtypes/hidden";
Expand Down
4 changes: 2 additions & 2 deletions resources/css/elements/buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ button {

/* Earth isn't flat but these buttons are */
.btn-flat {
@apply text-white text-gray-800 dark:text-dark-150 bg-gray-300 dark:bg-dark-700 flex items-center;
@apply text-gray-800 dark:text-dark-150 bg-gray-300 dark:bg-dark-700 flex items-center;
position: inherit;

&:hover:not(:disabled), &:active:not(:disabled), &.active {
Expand Down Expand Up @@ -296,7 +296,7 @@ td .btn-icon {
@apply dark:hover:bg-dark-575 dark:hover:border-dark-400;

svg {
@apply h-8 w-8 text-gray-800 dark:text-dark-175;
@apply h-8 w-8 text-gray-800 dark:text-dark-200;
}

h3 {
Expand Down
2 changes: 1 addition & 1 deletion resources/css/elements/icons.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ svg {
flex-shrink: 0;

&.published { @apply bg-green-600 }
&.draft, &.expired { @apply bg-gray-600 }
&.draft, &.expired { @apply bg-gray-600 dark:bg-dark-200 }
&.scheduled, &.hollow { @apply bg-transparent border border-gray-600 }
}

Expand Down
6 changes: 6 additions & 0 deletions resources/css/vendors/vue-select.css
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@

&.sortable-item { @apply !cursor-grab; }

&.invalid {
@apply border-red-300 dark:border-dark-red bg-red-100 dark:bg-red-400 text-red-500 dark:text-red-950;
background-image: none;

.vs__deselect { @apply text-red-500 dark:text-red-950 }
}
}

.vs__deselect {
Expand Down
8 changes: 6 additions & 2 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ Statamic.app({
showBanner: true,
portals: [],
appendedComponents: [],
isLicensingBannerSnoozed: localStorage.getItem(`statamic.snooze_license_banner`) > new Date().valueOf(),
copyToClipboardModalUrl: null,
},

computed: {
Expand Down Expand Up @@ -242,12 +244,13 @@ Statamic.app({

this.fixAutofocus();

this.showBanner = Statamic.$config.get('hasLicenseBanner');
this.showBanner = !this.isLicensingBannerSnoozed && Statamic.$config.get('hasLicenseBanner');

this.$toast.intercept();
},

created() {
const app = this;
const state = localStorage.getItem('statamic.nav') || 'open';
this.navOpen = state === 'open';

Expand All @@ -256,7 +259,7 @@ Statamic.app({
await navigator.clipboard.writeText(url);
Statamic.$toast.success(__('Copied to clipboard'));
} catch (err) {
await alert(url);
app.copyToClipboardModalUrl = url;
}
});

Expand Down Expand Up @@ -292,6 +295,7 @@ Statamic.app({

hideBanner() {
this.showBanner = false;
localStorage.setItem(`statamic.snooze_license_banner`, new Date(Date.now() + 5 * 60 * 1000).valueOf());
},

fixAutofocus() {
Expand Down
3 changes: 3 additions & 0 deletions resources/js/bootstrap/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import ResourceDeleter from '../components/ResourceDeleter.vue';
import Stack from '../components/stacks/Stack.vue';
import StackTest from '../components/stacks/StackTest.vue';
import CodeBlock from '../components/CodeBlock.vue';
import BlueprintResetter from '../components/blueprints/BlueprintResetter.vue';

// Third Party
Vue.component('v-select', vSelect)
Expand Down Expand Up @@ -142,3 +143,5 @@ Vue.component('resource-deleter', ResourceDeleter);

Vue.component('stack', Stack);
Vue.component('stack-test', StackTest);

Vue.component('blueprint-resetter', BlueprintResetter);
4 changes: 4 additions & 0 deletions resources/js/bootstrap/fieldtypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import Routes from '../components/collections/Routes.vue';
import TitleFormats from '../components/collections/TitleFormats.vue';
import ColorFieldtype from '../components/fieldtypes/ColorFieldtype.vue';
import DateFieldtype from '../components/fieldtypes/DateFieldtype.vue';
import DictionaryFieldtype from "../components/fieldtypes/DictionaryFieldtype.vue";
import DictionaryFields from "../components/fieldtypes/DictionaryFields.vue";
import FieldDisplayFieldtype from '../components/fieldtypes/FieldDisplayFieldtype.vue';
import FieldsFieldtype from '../components/fieldtypes/grid/FieldsFieldtype.vue';
import FilesFieldtype from '../components/fieldtypes/FilesFieldtype.vue';
Expand Down Expand Up @@ -86,6 +88,8 @@ Vue.component('collection_routes-fieldtype', Routes);
Vue.component('collection_title_formats-fieldtype', TitleFormats);
Vue.component('color-fieldtype', ColorFieldtype);
Vue.component('date-fieldtype', DateFieldtype);
Vue.component('dictionary-fieldtype', DictionaryFieldtype);
Vue.component('dictionary_fields-fieldtype', DictionaryFields);
Vue.component('field_display-fieldtype', FieldDisplayFieldtype);
Vue.component('fields-fieldtype', FieldsFieldtype);
Vue.component('files-fieldtype', FilesFieldtype);
Expand Down
25 changes: 19 additions & 6 deletions resources/js/components/AddonDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
</template>
<template v-else>
<p v-text="`${__('messages.addon_install_command')}:`" />
<code-block copyable :text="`composer require ${package}`" />
<code-block copyable :text="installCommand" />
</template>
<p>{{ __('Learn more about') }} <a href="https://statamic.dev/addons">{{ __('Addons') }}</a>.</p>
<p v-html="link"></p>
</div>
</confirmation-modal>
<div>
Expand Down Expand Up @@ -69,10 +69,6 @@ import AddonEditions from './addons/Editions.vue';
},
computed: {
toEleven() {
return {timeout: Statamic.$config.get('ajaxTimeout')};
},
package() {
return this.addon.package;
},
Expand All @@ -87,6 +83,23 @@ import AddonEditions from './addons/Editions.vue';
high = high ? `$${high}` : __('Free');
return (low == high) ? low : `${low} - ${high}`;
},
link() {
return __('Learn more about :link', { link: `<a href="https://statamic.dev/addons" target="_blank">${__('Addons')}</a>`}) + '.';
},
installCommand() {
switch (this.package) {
case 'statamic/collaboration':
return 'php please install:collaboration';
case 'statamic/eloquent-driver':
return 'php please install:eloquent-driver';
case 'statamic/ssg':
return 'php please install:ssg';
default:
return `composer require ${this.package}`;
}
},
},
created() {
Expand Down
6 changes: 3 additions & 3 deletions resources/js/components/SessionExpiry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

<modal name="session-timeout-login" v-if="isShowingLogin" height="auto" width="500px" :adaptive="true">
<div class="-max-h-screen-px">
<div class="flex items-center p-6 bg-gray-200 dark:bg-dark-700 border-b dark:border-dark-900 text-center">
<div class="text-lg font-semibold px-5 py-3 bg-gray-200 dark:bg-dark-550 rounded-t-lg flex items-center justify-between border-b dark:border-dark-900">
{{ __('Resume Your Session') }}
</div>

<div v-if="isUsingOauth" class="p-6">
<div v-if="isUsingOauth" class="p-5">
<a :href="oauthProvider.loginUrl" target="_blank" class="btn-primary">
{{ __('Log in with :provider', {provider: oauthProvider.label}) }}
</a>
Expand All @@ -19,7 +19,7 @@
</div>
</div>

<div v-if="!isUsingOauth" class="publish-fields">
<div v-if="!isUsingOauth" class="publish-fields p-2">
<div class="form-group w-full">
<label v-text="__('messages.session_expiry_enter_password')" />
<small
Expand Down
Loading

0 comments on commit 34815b6

Please sign in to comment.