wip image templates

This commit is contained in:
2026-05-14 19:24:25 +03:00
parent 0725366dd5
commit ef29e4d261
9 changed files with 195 additions and 443 deletions
+3 -3
View File
@@ -9,10 +9,10 @@
"ext-imagick": "*",
"ext-pdo": "*",
"php": "^8.4",
"intervention/image": "^2.7",
"phpoption/phpoption": "^1.9",
"spatie/image-optimizer": "^1.6",
"staudenmeir/laravel-cte": "^1.0"
"spatie/image-optimizer": "^1.8",
"staudenmeir/laravel-cte": "^1.0",
"intervention/image": "^4.0"
},
"require-dev": {
"phpstan/phpstan": "^1.8",
Generated
+131 -340
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5d4ad76e414375923116e6a9324bd6b6",
"content-hash": "b2f189b5c64498c6190267db27e55494",
"packages": [
{
"name": "brick/math",
@@ -641,123 +641,6 @@
],
"time": "2025-12-27T19:43:20+00:00"
},
{
"name": "guzzlehttp/psr7",
"version": "2.9.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/7d0ed42f28e42d61352a7a79de682e5e67fec884",
"reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884",
"shasum": ""
},
"require": {
"php": "^7.2.5 || ^8.0",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.1 || ^2.0",
"ralouphie/getallheaders": "^3.0"
},
"provide": {
"psr/http-factory-implementation": "1.0",
"psr/http-message-implementation": "1.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
"http-interop/http-factory-tests": "0.9.0",
"jshttp/mime-db": "1.54.0.1",
"phpunit/phpunit": "^8.5.44 || ^9.6.25"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
},
"type": "library",
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": false
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
},
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "George Mponos",
"email": "gmponos@gmail.com",
"homepage": "https://github.com/gmponos"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
},
{
"name": "Márk Sági-Kazár",
"email": "mark.sagikazar@gmail.com",
"homepage": "https://github.com/sagikazarmark"
},
{
"name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
},
{
"name": "Márk Sági-Kazár",
"email": "mark.sagikazar@gmail.com",
"homepage": "https://sagikazarmark.hu"
}
],
"description": "PSR-7 message implementation that also provides common utility methods",
"keywords": [
"http",
"message",
"psr-7",
"request",
"response",
"stream",
"uri",
"url"
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/2.9.0"
},
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://github.com/Nyholm",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7",
"type": "tidelift"
}
],
"time": "2026-03-10T16:41:02+00:00"
},
{
"name": "guzzlehttp/uri-template",
"version": "v1.0.5",
@@ -845,50 +728,32 @@
"time": "2025-08-22T14:27:06+00:00"
},
{
"name": "intervention/image",
"version": "2.7.2",
"name": "intervention/gif",
"version": "5.0.1",
"source": {
"type": "git",
"url": "https://github.com/Intervention/image.git",
"reference": "04be355f8d6734c826045d02a1079ad658322dad"
"url": "https://github.com/Intervention/gif.git",
"reference": "bb395af960deffe64d70c976b4df9283f68e762d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Intervention/image/zipball/04be355f8d6734c826045d02a1079ad658322dad",
"reference": "04be355f8d6734c826045d02a1079ad658322dad",
"url": "https://api.github.com/repos/Intervention/gif/zipball/bb395af960deffe64d70c976b4df9283f68e762d",
"reference": "bb395af960deffe64d70c976b4df9283f68e762d",
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
"guzzlehttp/psr7": "~1.1 || ^2.0",
"php": ">=5.4.0"
"php": "^8.3"
},
"require-dev": {
"mockery/mockery": "~0.9.2",
"phpunit/phpunit": "^4.8 || ^5.7 || ^7.5.15"
},
"suggest": {
"ext-gd": "to use GD library based image processing.",
"ext-imagick": "to use Imagick based image processing.",
"intervention/imagecache": "Caching extension for the Intervention Image library"
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^12.0",
"slevomat/coding-standard": "~8.0",
"squizlabs/php_codesniffer": "^4"
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"Image": "Intervention\\Image\\Facades\\Image"
},
"providers": [
"Intervention\\Image\\ImageServiceProvider"
]
},
"branch-alias": {
"dev-master": "2.4-dev"
}
},
"autoload": {
"psr-4": {
"Intervention\\Image\\": "src/Intervention/Image"
"Intervention\\Gif\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -902,19 +767,17 @@
"homepage": "https://intervention.io/"
}
],
"description": "Image handling and manipulation library with support for Laravel integration",
"homepage": "http://image.intervention.io/",
"description": "PHP GIF Encoder/Decoder",
"homepage": "https://github.com/intervention/gif",
"keywords": [
"animation",
"gd",
"image",
"imagick",
"laravel",
"thumbnail",
"watermark"
"gif",
"image"
],
"support": {
"issues": "https://github.com/Intervention/image/issues",
"source": "https://github.com/Intervention/image/tree/2.7.2"
"issues": "https://github.com/Intervention/gif/issues",
"source": "https://github.com/Intervention/gif/tree/5.0.1"
},
"funding": [
{
@@ -924,9 +787,89 @@
{
"url": "https://github.com/Intervention",
"type": "github"
},
{
"url": "https://ko-fi.com/interventionphp",
"type": "ko_fi"
}
],
"time": "2022-05-21T17:30:32+00:00"
"time": "2026-05-03T06:04:47+00:00"
},
{
"name": "intervention/image",
"version": "4.0.4",
"source": {
"type": "git",
"url": "https://github.com/Intervention/image.git",
"reference": "f58d379b1f13c036b2ef5c3c26eb4b0c88b647ed"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Intervention/image/zipball/f58d379b1f13c036b2ef5c3c26eb4b0c88b647ed",
"reference": "f58d379b1f13c036b2ef5c3c26eb4b0c88b647ed",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"intervention/gif": "^5",
"php": "^8.3"
},
"require-dev": {
"mockery/mockery": "^1.6",
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^12.0",
"slevomat/coding-standard": "~8.0",
"squizlabs/php_codesniffer": "^4"
},
"suggest": {
"ext-exif": "Recommended to be able to read EXIF data properly."
},
"type": "library",
"autoload": {
"psr-4": {
"Intervention\\Image\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Oliver Vogel",
"email": "oliver@intervention.io",
"homepage": "https://intervention.io"
}
],
"description": "PHP Image Processing",
"homepage": "https://image.intervention.io",
"keywords": [
"gd",
"image",
"imagick",
"resize",
"thumbnail",
"watermark"
],
"support": {
"issues": "https://github.com/Intervention/image/issues",
"source": "https://github.com/Intervention/image/tree/4.0.4"
},
"funding": [
{
"url": "https://paypal.me/interventionio",
"type": "custom"
},
{
"url": "https://github.com/Intervention",
"type": "github"
},
{
"url": "https://ko-fi.com/interventionphp",
"type": "ko_fi"
}
],
"time": "2026-05-03T04:47:13+00:00"
},
{
"name": "laravel/framework",
@@ -1446,16 +1389,16 @@
},
{
"name": "league/flysystem",
"version": "3.33.0",
"version": "3.34.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "570b8871e0ce693764434b29154c54b434905350"
"reference": "2daaac3b0d4c83ea7ed5d8586e786f5d00f3540e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/570b8871e0ce693764434b29154c54b434905350",
"reference": "570b8871e0ce693764434b29154c54b434905350",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/2daaac3b0d4c83ea7ed5d8586e786f5d00f3540e",
"reference": "2daaac3b0d4c83ea7ed5d8586e786f5d00f3540e",
"shasum": ""
},
"require": {
@@ -1523,9 +1466,9 @@
],
"support": {
"issues": "https://github.com/thephpleague/flysystem/issues",
"source": "https://github.com/thephpleague/flysystem/tree/3.33.0"
"source": "https://github.com/thephpleague/flysystem/tree/3.34.0"
},
"time": "2026-03-25T07:59:30+00:00"
"time": "2026-05-14T10:28:08+00:00"
},
{
"name": "league/flysystem-local",
@@ -2311,114 +2254,6 @@
},
"time": "2019-01-08T18:20:26+00:00"
},
{
"name": "psr/http-factory",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-factory.git",
"reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
"reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
"shasum": ""
},
"require": {
"php": ">=7.1",
"psr/http-message": "^1.0 || ^2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "PSR-17: Common interfaces for PSR-7 HTTP message factories",
"keywords": [
"factory",
"http",
"message",
"psr",
"psr-17",
"psr-7",
"request",
"response"
],
"support": {
"source": "https://github.com/php-fig/http-factory"
},
"time": "2024-04-15T12:06:14+00:00"
},
{
"name": "psr/http-message",
"version": "2.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"support": {
"source": "https://github.com/php-fig/http-message/tree/2.0"
},
"time": "2023-04-04T09:54:51+00:00"
},
{
"name": "psr/log",
"version": "3.0.2",
@@ -2520,50 +2355,6 @@
},
"time": "2021-10-29T13:26:27+00:00"
},
{
"name": "ralouphie/getallheaders",
"version": "3.0.3",
"source": {
"type": "git",
"url": "https://github.com/ralouphie/getallheaders.git",
"reference": "120b605dfeb996808c31b6477290a714d356e822"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
"reference": "120b605dfeb996808c31b6477290a714d356e822",
"shasum": ""
},
"require": {
"php": ">=5.6"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.1",
"phpunit/phpunit": "^5 || ^6.5"
},
"type": "library",
"autoload": {
"files": [
"src/getallheaders.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ralph Khattar",
"email": "ralph.khattar@gmail.com"
}
],
"description": "A polyfill for getallheaders.",
"support": {
"issues": "https://github.com/ralouphie/getallheaders/issues",
"source": "https://github.com/ralouphie/getallheaders/tree/develop"
},
"time": "2019-03-08T08:55:37+00:00"
},
{
"name": "ramsey/collection",
"version": "2.1.1",
@@ -2836,16 +2627,16 @@
},
{
"name": "symfony/console",
"version": "v6.4.37",
"version": "v6.4.39",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "7bbcaf3fdb1e18fa42a7f0b84a10d091c10548f5"
"reference": "c132f1215fe4aa45b70173cc00ce9a755dd31ec5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/7bbcaf3fdb1e18fa42a7f0b84a10d091c10548f5",
"reference": "7bbcaf3fdb1e18fa42a7f0b84a10d091c10548f5",
"url": "https://api.github.com/repos/symfony/console/zipball/c132f1215fe4aa45b70173cc00ce9a755dd31ec5",
"reference": "c132f1215fe4aa45b70173cc00ce9a755dd31ec5",
"shasum": ""
},
"require": {
@@ -2910,7 +2701,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v6.4.37"
"source": "https://github.com/symfony/console/tree/v6.4.39"
},
"funding": [
{
@@ -2930,7 +2721,7 @@
"type": "tidelift"
}
],
"time": "2026-04-13T15:27:04+00:00"
"time": "2026-05-12T06:50:03+00:00"
},
{
"name": "symfony/css-selector",
@@ -3467,16 +3258,16 @@
},
{
"name": "symfony/http-kernel",
"version": "v6.4.38",
"version": "v6.4.39",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "769c1ee766d6c327176f4e3bdaad58f521193abd"
"reference": "79329748e3d8a9cd02ec1caedbf92601b269fe39"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/769c1ee766d6c327176f4e3bdaad58f521193abd",
"reference": "769c1ee766d6c327176f4e3bdaad58f521193abd",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/79329748e3d8a9cd02ec1caedbf92601b269fe39",
"reference": "79329748e3d8a9cd02ec1caedbf92601b269fe39",
"shasum": ""
},
"require": {
@@ -3561,7 +3352,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-kernel/tree/v6.4.38"
"source": "https://github.com/symfony/http-kernel/tree/v6.4.39"
},
"funding": [
{
@@ -3581,7 +3372,7 @@
"type": "tidelift"
}
],
"time": "2026-05-06T13:04:40+00:00"
"time": "2026-05-13T17:49:58+00:00"
},
{
"name": "symfony/mailer",
@@ -4427,16 +4218,16 @@
},
{
"name": "symfony/process",
"version": "v6.4.33",
"version": "v6.4.39",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "c46e854e79b52d07666e43924a20cb6dc546644e"
"reference": "6c93071cb8c91dce5a41960d125e019e64ef6cb5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/c46e854e79b52d07666e43924a20cb6dc546644e",
"reference": "c46e854e79b52d07666e43924a20cb6dc546644e",
"url": "https://api.github.com/repos/symfony/process/zipball/6c93071cb8c91dce5a41960d125e019e64ef6cb5",
"reference": "6c93071cb8c91dce5a41960d125e019e64ef6cb5",
"shasum": ""
},
"require": {
@@ -4468,7 +4259,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/process/tree/v6.4.33"
"source": "https://github.com/symfony/process/tree/v6.4.39"
},
"funding": [
{
@@ -4488,7 +4279,7 @@
"type": "tidelift"
}
],
"time": "2026-01-23T16:02:12+00:00"
"time": "2026-05-11T16:53:15+00:00"
},
{
"name": "symfony/routing",
@@ -4666,16 +4457,16 @@
},
{
"name": "symfony/string",
"version": "v7.4.8",
"version": "v7.4.11",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "114ac57257d75df748eda23dd003878080b8e688"
"reference": "965f7306a43383d02c6aca1e3f3bd2f0ea5dee15"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/114ac57257d75df748eda23dd003878080b8e688",
"reference": "114ac57257d75df748eda23dd003878080b8e688",
"url": "https://api.github.com/repos/symfony/string/zipball/965f7306a43383d02c6aca1e3f3bd2f0ea5dee15",
"reference": "965f7306a43383d02c6aca1e3f3bd2f0ea5dee15",
"shasum": ""
},
"require": {
@@ -4733,7 +4524,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v7.4.8"
"source": "https://github.com/symfony/string/tree/v7.4.11"
},
"funding": [
{
@@ -4753,7 +4544,7 @@
"type": "tidelift"
}
],
"time": "2026-03-24T13:12:05+00:00"
"time": "2026-05-13T12:04:42+00:00"
},
{
"name": "symfony/translation",
+2
View File
@@ -10,6 +10,8 @@
<div class="top-nav">
{#if channel.auth == "lucent"}
<a class="top-nav-item" href="{channel.lucentUrl}/members">Members</a>
{:else}
<a href="/lunar">Store admin</a>
{/if}
{#if channel.commands.length > 0}
<Dropdown>
-3
View File
@@ -86,11 +86,8 @@
{:else if field.info.name === "rich"}
<RichEditor
bind:value={data[field.name]}
{schema}
{field}
{validationErrors}
{isCreateMode}
bind:graph
{record}
/>
{:else if field.info.name === "markdown"}
@@ -3,7 +3,6 @@
import { getErrorMessage } from "./errorMessage";
import RichEditorFiles from "./RichEditorFiles.svelte";
export let value;
export let field;
export let graph;
@@ -14,24 +13,24 @@
$: errorMessage = getErrorMessage(validationErrors, field.name);
let editor;
function insertMedia(e){
editor.insertMedia(e.detail)
function insertMedia(e) {
editor.insertMedia(e.detail);
}
</script>
<div class="mb-3">
<Codemirror bind:this={editor} bind:value editable={!field.readonly || isCreateMode} />
{#if field.collections.length > 0}
<RichEditorFiles
bind:graph
{record}
{field}
{validationErrors}
on:editor-insert={insertMedia}
>
</RichEditorFiles>
{/if}
<Codemirror
bind:this={editor}
bind:value
editable={!field.readonly || isCreateMode}
/>
<RichEditorFiles
bind:graph
{record}
{field}
{validationErrors}
on:editor-insert={insertMedia}
></RichEditorFiles>
{#if errorMessage}
<div class="invalid-feedback d-block">
{errorMessage}
@@ -5,17 +5,12 @@
export let value;
export let field;
export let isCreateMode;
export let graph;
export let record;
export let validationErrors;
let editor;
$: errorMessage = getErrorMessage(validationErrors, field.name);
let additionalConfig = {
readonly: field.readonly && !isCreateMode,
};
function insertMedia(e) {
editor.insertMedia(e.detail);
@@ -24,16 +19,12 @@
<div class="mb-0">
<Trix {field} bind:this={editor} bind:value></Trix>
<!-- <Tinymce bind:this={editor} bind:value {additionalConfig}/>-->
{#if field.collections.length > 0}
<RichEditorFiles
bind:graph
{record}
{field}
{validationErrors}
on:editor-insert={insertMedia}
></RichEditorFiles>
{/if}
<RichEditorFiles
{record}
{field}
{validationErrors}
on:editor-insert={insertMedia}
></RichEditorFiles>
{#if errorMessage}
<div class="invalid-feedback d-block">
@@ -2,75 +2,45 @@
import PreviewFile from "../previews/PreviewFile.svelte";
import Dropdown from "../../common/Dropdown.svelte";
import Dialog from "../../dialog/Dialog.svelte";
import {insertEdges} from "./reference.js";
import {getContext} from "svelte";
import { insertEdges } from "./reference.js";
import { getContext } from "svelte";
import FileDialog from "../../dialog/FileDialog.svelte";
import Uploader from "../../files/Uploader.svelte";
const channel = getContext("channel");
export let field;
export let record;
export let graph
let browseModal;
$: references = graph?.edges
.filter((edge) => edge.field === field.name)
.map((edge) => {
return graph.records.find((increc) => increc.id === edge.target && record.id === edge.source);
}).filter((rec) => (rec?.id ? true : false)) ?? [];
let collections = channel.schemas.filter((aschema) =>
field.collections.includes(aschema.name)
);
function removeReference(e) {
function openBrowseModal(e) {
e.preventDefault();
graph.edges = graph.edges.filter(
(edge) => !(edge.target === e.detail && edge.field === field.name)
);
browseModal.open(record.id);
}
function openBrowseModal(e, schema) {
e.preventDefault();
browseModal.open(schema);
}
function insert(e) {
function insertFiles(e) {
e.preventDefault();
browseModal.close();
graph = insertEdges(graph, record, e.detail.records, field.name, e.detail.action);
}
function replaceFiles(e) {
e.preventDefault();
browseModal.close();
}
function uploadComplete(e) {}
</script>
<div class="mb-3">
<label class="mt-4 mb-3">Rich editor files</label>
{#if field.collections.length === 1}
<button
class="button"
on:click={(e) => openBrowseModal(e, collections[0].name)}
>
Browse
</button>
{:else}
<Dropdown>
<div slot="button">
Browse
</div>
{#each collections as collection}
<!-- {`${channelurl}/content/${collection.name}?parent=${record.id}&parentfield=${field.name}`} -->
<a
class="dropdown-item"
on:click={(e) => openBrowseModal(e, collection.name)}
href="/">{collection.label}</a
>
{/each}
</Dropdown>
{/if}
<button class="button" on:click={openBrowseModal}> Browse </button>
<div>
<Uploader recordId={record.id} on:uploadComplete={uploadComplete} />
</div>
</div>
{#if references.length > 0}
{#each references as reference (reference.id)}
<!--This div helps the sorting thing-->
<div>
<PreviewFile record={reference} hasDelete={true} hasInsert={true} on:remove={removeReference}
on:editor-insert></PreviewFile>
</div>
{/each}
{/if}
<Dialog bind:this={browseModal} on:insert={insert}></Dialog>
<FileDialog
bind:this={browseModal}
on:insert_files={insertFiles}
on:replace_files={replaceFiles}
></FileDialog>
@@ -4,6 +4,7 @@
import { createEventDispatcher, getContext } from "svelte";
import Preview from "../../files/Preview.svelte";
import Dropdown from "../../common/Dropdown.svelte";
import { htmlurl } from "../../files/imageserver";
const dispatch = createEventDispatcher();
const channel = getContext("channel");
@@ -20,16 +21,16 @@
function insert(e, preset) {
e.preventDefault();
// let html = htmlurl(channel, record, preset);
// let url = !preset
// ? `/${record._file.path}`
// : `/templates/${preset}/${record._file.path}`;
// dispatch("editor-insert", {
// html: html,
// url: channel.filesUrl + url,
// originalUrl: channel.filesUrl + "/" + record._file.path,
// record: record,
// });
let html = htmlurl(channel, record, preset);
let url = !preset
? `/${record._file.path}`
: `/templates/${preset}/${record._file.path}`;
dispatch("editor-insert", {
html: html,
url: channel.filesUrl + url,
originalUrl: channel.filesUrl + "/" + record._file.path,
record: record,
});
}
</script>
+3 -2
View File
@@ -128,10 +128,11 @@ class FileService
$originalImage = $this->imageManager->make(
$this->loadPublicDisk()->get("lucent/" . $path),
);
foreach (config("lucent.imageFilters") as $preset => $filterClass) {
foreach (config("lucent.imageFilters") as $filterClass) {
$imageClone = clone $originalImage;
$image = $imageClone->filter(new $filterClass());
$templateUri = "lucent/templates/" . $preset . "/" . $path;
$templateUri =
"lucent/templates/" . $filterClass->name() . "/" . $path;
$disk->put($templateUri, $image->encode("webp", 75));
}