Skip to content

Commit

Permalink
Merge branch '5.x' of https://github.com/statamic/cms into fix/cp-nav…
Browse files Browse the repository at this point in the history
…-custom-section-reordering
  • Loading branch information
jesseleite committed Nov 5, 2024
2 parents 35bab0a + ba04ca4 commit dc39566
Show file tree
Hide file tree
Showing 287 changed files with 23,555 additions and 4,258 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Release Notes

## 5.36.0 (2024-10-31)

### What's new
- New Blade syntax for using Tags [#10967](https://github.com/statamic/cms/issues/10967) by @JohnathonKoster
- Add support for avif image format [#11016](https://github.com/statamic/cms/issues/11016) by @daun
- Allow setting tag pair content from fluent tags [#11018](https://github.com/statamic/cms/issues/11018) by @daun

### What's fixed
- Fix Filesystem AbstractAdapter put method return [#11032](https://github.com/statamic/cms/issues/11032) by @godismyjudge95
- Fix color fieldtype's collapsed state showing plain HTML [#11031](https://github.com/statamic/cms/issues/11031) by @jackmcdade
- Fix helpBlock error with custom js validation rule [#11023](https://github.com/statamic/cms/issues/11023) by @irfandumanx



## 5.35.0 (2024-10-28)

### What's new
- Drag and drop folders into the asset browser [#10583](https://github.com/statamic/cms/issues/10583) by @daun
- Include Algolia highlights and snippets [#11008](https://github.com/statamic/cms/issues/11008) by @jacksleight
- Introduce additional form tag hooks [#11010](https://github.com/statamic/cms/issues/11010) by @leewillis77
- Add `allowed_extensions` option to Files fieldtype [#10998](https://github.com/statamic/cms/issues/10998) by @duncanmcclean

### What's fixed
- Support unions in addon event listener discovery [#11015](https://github.com/statamic/cms/issues/11015) by @jasonvarga
- Support auto-registering of listeners using __invoke() not handle [#11009](https://github.com/statamic/cms/issues/11009) by @leewillis77
- French translations [#10995](https://github.com/statamic/cms/issues/10995) by @ebeauchamps



## 5.34.0 (2024-10-24)

### What's new
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"spatie/blink": "^1.3",
"spatie/ignition": "^1.12",
"statamic/stringy": "^3.1.2",
"stillat/blade-parser": "^1.10.1",
"symfony/lock": "^6.4",
"symfony/var-exporter": "^6.0",
"symfony/yaml": "^6.0 || ^7.0",
Expand Down Expand Up @@ -80,7 +81,8 @@
},
"files": [
"src/helpers.php",
"src/namespaced_helpers.php"
"src/namespaced_helpers.php",
"src/View/Blade/helpers.php"
]
},
"autoload-dev": {
Expand Down
11 changes: 11 additions & 0 deletions config/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,15 @@

'fake_sql_queries' => config('app.debug'),

/*
|--------------------------------------------------------------------------
| Layout
|--------------------------------------------------------------------------
|
| Define the default layout that will be used by views.
|
*/

'layout' => env('STATAMIC_LAYOUT', 'layout'),

];
11 changes: 6 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 @@ -52,7 +52,7 @@
"codemirror": "^5.58.2",
"cookies-js": "^1.2.2",
"floating-vue": "^1.0.0-beta.19",
"fuse.js": "^3.4.6",
"fuse.js": "^7.0.0",
"highlight.js": "^11.7.0",
"imask": "^6.6.0-alpha.0",
"laravel-echo": "^1.16.0",
Expand Down
2 changes: 2 additions & 0 deletions resources/js/components/FileIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export default {
return 'video';
case 'xml':
return 'xml';
case 'avif':
case 'bmp':
case 'gif':
case 'ico':
Expand All @@ -90,6 +91,7 @@ export default {
case 'raw':
case 'nef':
case 'tiff':
case 'webp':
return 'image';
default:
return 'generic';
Expand Down
97 changes: 75 additions & 22 deletions resources/js/components/assets/Uploader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ export default {
},
container: String,
path: String,
url: { type: String, default: () => cp_url('assets') }
url: { type: String, default: () => cp_url('assets') },
extraData: {
type: Object,
default: () => ({})
}
},
Expand All @@ -44,19 +48,6 @@ export default {
},
computed: {
extraData() {
return {
container: this.container,
folder: this.path,
_token: Statamic.$config.get('csrfToken')
};
}
},
mounted() {
this.$refs.nativeFileField.addEventListener('change', this.addNativeFileFieldSelections);
},
Expand Down Expand Up @@ -112,11 +103,62 @@ export default {
e.preventDefault();
this.dragging = false;
for (let i = 0; i < e.dataTransfer.files.length; i++) {
this.addFile(e.dataTransfer.files[i]);
const { files, items } = e.dataTransfer;
// Handle DataTransferItems if browser supports dropping of folders
if (items && items.length && items[0].webkitGetAsEntry) {
this.addFilesFromDataTransferItems(items);
} else {
this.addFilesFromFileList(files);
}
},
addFilesFromFileList(files) {
for (let i = 0; i < files.length; i++) {
this.addFile(files[i]);
}
},
addFilesFromDataTransferItems(items) {
for (let i = 0; i < items.length; i++) {
let item = items[i];
if (item.webkitGetAsEntry) {
const entry = item.webkitGetAsEntry();
if (entry?.isFile) {
this.addFile(item.getAsFile());
} else if (entry?.isDirectory) {
this.addFilesFromDirectory(entry, entry.name);
}
} else if (item.getAsFile) {
if (item.kind === "file" || ! item.kind) {
this.addFile(item.getAsFile());
}
}
}
},
addFilesFromDirectory(directory, path) {
const reader = directory.createReader();
const readEntries = () => reader.readEntries((entries) => {
if (!entries.length) return;
for (let entry of entries) {
if (entry.isFile) {
entry.file((file) => {
if (! file.name.startsWith('.')) {
file.relativePath = path;
this.addFile(file);
}
});
} else if (entry.isDirectory) {
this.addFilesFromDirectory(entry, `${path}/${entry.name}`);
}
}
// Handle directories with more than 100 files in Chrome
readEntries();
}, console.error);
return readEntries();
},
addFile(file, data = {}) {
if (! this.enabled) return;
Expand Down Expand Up @@ -164,8 +206,20 @@ export default {
form.append('file', file);
for (let key in this.extraData) {
form.append(key, this.extraData[key]);
// Pass along the relative path of files uploaded as a directory
if (file.relativePath) {
form.append('relativePath', file.relativePath);
}
let parameters = {
...this.extraData,
container: this.container,
folder: this.path,
_token: Statamic.$config.get('csrfToken')
}
for (let key in parameters) {
form.append(key, parameters[key]);
}
for (let key in data) {
Expand All @@ -176,11 +230,10 @@ export default {
},
processUploadQueue() {
const uploads = this.uploads.filter(u => !u.errorMessage);
if (uploads.length === 0) return;
// Make sure we're not grabbing a running or failed upload
const upload = this.uploads.find(u => u.instance.state === 'new' && !u.errorMessage);
if (!upload) return;
const upload = uploads[0];
const id = upload.id;
upload.instance.upload().then(response => {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/data-list/DataList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default {
keys: this.searchableColumns,
});
return fuse.search(this.searchQuery);
return fuse.search(this.searchQuery).map(result => result.item);
},
sortRows(rows) {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/field-validation/Builder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export default {
return false;
}
let rule = _.chain(RULES)
let rule = _.chain(this.allRules)
.filter(rule => rule.value === this.selectedLaravelRule)
.first()
.value();
Expand Down
11 changes: 7 additions & 4 deletions resources/js/components/fields/FieldtypeSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default {
if (!this.fieldtypesLoaded) return [];
let options = this.fieldtypes.map(fieldtype => {
return {text: fieldtype.title, value: fieldtype.handle, categories: fieldtype.categories, icon: fieldtype.icon};
return {text: fieldtype.title, value: fieldtype.handle, categories: fieldtype.categories, keywords: fieldtype.keywords, icon: fieldtype.icon};
});
if (this.allowDate) options.unshift({text: __('Publish Date'), value: 'date', categories: ['system'], isMeta: true, icon: 'date'});
Expand Down Expand Up @@ -131,11 +131,14 @@ export default {
const fuse = new Fuse(options, {
findAllMatches: true,
threshold: 0.1,
minMatchCharLength: 2,
keys: ['text'],
keys: [
{name: 'text', weight: 1},
{name: 'categories', weight: 0.1},
{name: 'keywords', weight: 0.4},
],
});
options = fuse.search(this.search);
options = fuse.search(this.search).map(result => result.item);
}
return options;
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/fieldtypes/ColorFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default {
if (! this.showFieldPreviews || ! this.config.replicator_preview) return;
return this.value
? `<span class="little-dot" style="background-color:${this.value}"></span>`
? replicatorPreviewHtml(`<span class="little-dot" style="background-color:${this.value}"></span>`)
: null;
}
Expand Down
7 changes: 7 additions & 0 deletions resources/js/components/fieldtypes/FilesFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<uploader
ref="uploader"
:url="meta.uploadUrl"
:extra-data="{ config: configParameter }"
:container="config.container"
@updated="uploadsUpdated"
@upload-complete="uploadComplete"
Expand Down Expand Up @@ -87,6 +88,12 @@ export default {
}
},
computed: {
configParameter() {
return utf8btoa(JSON.stringify(this.config));
},
},
methods: {
/**
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/fieldtypes/assets/Asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default {
},

canBeTransparent() {
return ['png', 'svg'].includes(this.asset.extension)
return ['png', 'svg', 'webp', 'avif'].includes(this.asset.extension)
},

canDownload() {
Expand Down
Loading

0 comments on commit dc39566

Please sign in to comment.