Skip to content

Commit 4f5985c

Browse files
committed
feat: kirby 5 compatibility
1 parent 8bc2c29 commit 4f5985c

File tree

9 files changed

+192
-199
lines changed

9 files changed

+192
-199
lines changed

components/fields.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
return [
66
'pexels' => [
7+
'computed' => [
8+
'pageId' => function (): string {
9+
return $this->model()->id();
10+
}
11+
],
712
'props' => [
813
'downloadSize' => function () {
914
return option('mauricerenck.PexelsImageField.downloadSize', 'large');

composer.lock

Lines changed: 152 additions & 154 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Pexels.vue

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
<template>
22
<div class="k-pexels-field">
33
<k-field :label="label">
4-
<k-input
5-
theme="field"
6-
icon="search"
7-
@input="onInput"
8-
@keyup="onSubmit"
9-
type="text"
10-
name="textfield"
11-
:value="value"
12-
/>
4+
<k-input theme="field" icon="search" @input="onSubmit" type="text" name="textfield" :value="this.keyword" />
135
</k-field>
146

157
<div>
@@ -35,6 +27,7 @@ export default {
3527
label: String,
3628
value: String,
3729
downloadSize: String,
30+
pageId: String,
3831
},
3932
4033
data: function () {
@@ -51,29 +44,24 @@ export default {
5144
}
5245
},
5346
computed: {
54-
pageId() {
55-
return this.$store.getters['content/id']()
56-
},
5747
pages() {
5848
return Math.round(this.totalResults / this.perPage, 10)
5949
},
6050
},
61-
methods: {
62-
onInput(value) {
63-
this.keyword = value
64-
},
6551
52+
methods: {
6653
onSubmit(value) {
54+
this.keyword = value
6755
if (this.timer !== null) {
6856
clearTimeout(this.timer)
6957
}
7058
71-
if (this.keyword.length < 3) {
59+
if (value.length < 3) {
7260
return
7361
}
7462
7563
this.timer = setTimeout(() => {
76-
this.search(this.keyword)
64+
this.search(value)
7765
}, 250)
7866
},
7967
@@ -143,7 +131,7 @@ export default {
143131
const currentText = selectedPhoto.text
144132
selectedPhoto.text = 'Downloading…'
145133
146-
panel.api
134+
this.$api
147135
.post('pexels/download', {
148136
imageId: id,
149137
pageId: this.pageId.split('?')[0],
@@ -154,12 +142,12 @@ export default {
154142
.then(() => {
155143
this.downloaded = false
156144
panel.view.reload()
157-
window.panel.notification.success('Image downloaded');
145+
window.panel.notification.success('Image downloaded')
158146
selectedPhoto.text = currentText
159147
})
160148
.catch(() => {
161149
this.downloaded = false
162-
window.panel.notification.error('Image download failed');
150+
window.panel.notification.error('Image download failed')
163151
selectedPhoto.text = currentText
164152
})
165153
},

vendor/composer/autoload_classmap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
'Doctrine\\Common\\Collections\\Order' => $vendorDir . '/doctrine/collections/src/Order.php',
2222
'Doctrine\\Common\\Collections\\ReadableCollection' => $vendorDir . '/doctrine/collections/src/ReadableCollection.php',
2323
'Doctrine\\Common\\Collections\\Selectable' => $vendorDir . '/doctrine/collections/src/Selectable.php',
24-
'Doctrine\\Deprecations\\Deprecation' => $vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php',
25-
'Doctrine\\Deprecations\\PHPUnit\\VerifyDeprecations' => $vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php',
24+
'Doctrine\\Deprecations\\Deprecation' => $vendorDir . '/doctrine/deprecations/src/Deprecation.php',
25+
'Doctrine\\Deprecations\\PHPUnit\\VerifyDeprecations' => $vendorDir . '/doctrine/deprecations/src/PHPUnit/VerifyDeprecations.php',
2626
'GuzzleHttp\\BodySummarizer' => $vendorDir . '/guzzlehttp/guzzle/src/BodySummarizer.php',
2727
'GuzzleHttp\\BodySummarizerInterface' => $vendorDir . '/guzzlehttp/guzzle/src/BodySummarizerInterface.php',
2828
'GuzzleHttp\\Client' => $vendorDir . '/guzzlehttp/guzzle/src/Client.php',

vendor/composer/autoload_psr4.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@
4242
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
4343
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
4444
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
45-
'Doctrine\\Deprecations\\' => array($vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations'),
45+
'Doctrine\\Deprecations\\' => array($vendorDir . '/doctrine/deprecations/src'),
4646
'Doctrine\\Common\\Collections\\' => array($vendorDir . '/doctrine/collections/src'),
4747
);

vendor/composer/autoload_static.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class ComposerStaticInitd6dab7feb2c0432282fb013bfa43cbe9
223223
),
224224
'Doctrine\\Deprecations\\' =>
225225
array (
226-
0 => __DIR__ . '/..' . '/doctrine/deprecations/lib/Doctrine/Deprecations',
226+
0 => __DIR__ . '/..' . '/doctrine/deprecations/src',
227227
),
228228
'Doctrine\\Common\\Collections\\' =>
229229
array (
@@ -247,8 +247,8 @@ class ComposerStaticInitd6dab7feb2c0432282fb013bfa43cbe9
247247
'Doctrine\\Common\\Collections\\Order' => __DIR__ . '/..' . '/doctrine/collections/src/Order.php',
248248
'Doctrine\\Common\\Collections\\ReadableCollection' => __DIR__ . '/..' . '/doctrine/collections/src/ReadableCollection.php',
249249
'Doctrine\\Common\\Collections\\Selectable' => __DIR__ . '/..' . '/doctrine/collections/src/Selectable.php',
250-
'Doctrine\\Deprecations\\Deprecation' => __DIR__ . '/..' . '/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php',
251-
'Doctrine\\Deprecations\\PHPUnit\\VerifyDeprecations' => __DIR__ . '/..' . '/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php',
250+
'Doctrine\\Deprecations\\Deprecation' => __DIR__ . '/..' . '/doctrine/deprecations/src/Deprecation.php',
251+
'Doctrine\\Deprecations\\PHPUnit\\VerifyDeprecations' => __DIR__ . '/..' . '/doctrine/deprecations/src/PHPUnit/VerifyDeprecations.php',
252252
'GuzzleHttp\\BodySummarizer' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/BodySummarizer.php',
253253
'GuzzleHttp\\BodySummarizerInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/BodySummarizerInterface.php',
254254
'GuzzleHttp\\Client' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Client.php',

vendor/composer/installed.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php return array(
22
'root' => array(
33
'name' => 'mauricerenck/pexelsimagefield',
4-
'pretty_version' => '2.0.1',
5-
'version' => '2.0.1.0',
4+
'pretty_version' => '2.0.2',
5+
'version' => '2.0.2.0',
66
'reference' => NULL,
77
'type' => 'kirby-plugin',
88
'install_path' => __DIR__ . '/../../',
@@ -20,9 +20,9 @@
2020
'dev_requirement' => false,
2121
),
2222
'doctrine/deprecations' => array(
23-
'pretty_version' => '1.1.3',
24-
'version' => '1.1.3.0',
25-
'reference' => 'dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab',
23+
'pretty_version' => '1.1.4',
24+
'version' => '1.1.4.0',
25+
'reference' => '31610dbb31faa98e6b5447b62340826f54fbc4e9',
2626
'type' => 'library',
2727
'install_path' => __DIR__ . '/../doctrine/deprecations',
2828
'aliases' => array(),
@@ -47,9 +47,9 @@
4747
'dev_requirement' => false,
4848
),
4949
'guzzlehttp/promises' => array(
50-
'pretty_version' => '2.0.3',
51-
'version' => '2.0.3.0',
52-
'reference' => '6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8',
50+
'pretty_version' => '2.0.4',
51+
'version' => '2.0.4.0',
52+
'reference' => 'f9c436286ab2892c7db7be8c8da4ef61ccf7b455',
5353
'type' => 'library',
5454
'install_path' => __DIR__ . '/../guzzlehttp/promises',
5555
'aliases' => array(),
@@ -65,8 +65,8 @@
6565
'dev_requirement' => false,
6666
),
6767
'mauricerenck/pexelsimagefield' => array(
68-
'pretty_version' => '2.0.1',
69-
'version' => '2.0.1.0',
68+
'pretty_version' => '2.0.2',
69+
'version' => '2.0.2.0',
7070
'reference' => NULL,
7171
'type' => 'kirby-plugin',
7272
'install_path' => __DIR__ . '/../../',
@@ -137,9 +137,9 @@
137137
'dev_requirement' => false,
138138
),
139139
'symfony/deprecation-contracts' => array(
140-
'pretty_version' => 'v3.5.0',
141-
'version' => '3.5.0.0',
142-
'reference' => '0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1',
140+
'pretty_version' => 'v3.5.1',
141+
'version' => '3.5.1.0',
142+
'reference' => '74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6',
143143
'type' => 'library',
144144
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
145145
'aliases' => array(),
@@ -155,9 +155,9 @@
155155
'dev_requirement' => false,
156156
),
157157
'symfony/yaml' => array(
158-
'pretty_version' => 'v6.4.11',
159-
'version' => '6.4.11.0',
160-
'reference' => 'be37e7f13195e05ab84ca5269365591edd240335',
158+
'pretty_version' => 'v6.4.13',
159+
'version' => '6.4.13.0',
160+
'reference' => 'e99b4e94d124b29ee4cf3140e1b537d2dad8cec9',
161161
'type' => 'library',
162162
'install_path' => __DIR__ . '/../symfony/yaml',
163163
'aliases' => array(),

vendor/guzzlehttp/promises/src/Utils.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ function ($value, $idx) use (&$results): void {
144144
$results[$idx] = $value;
145145
},
146146
function ($reason, $idx, Promise $aggregate): void {
147-
$aggregate->reject($reason);
147+
if (Is::pending($aggregate)) {
148+
$aggregate->reject($reason);
149+
}
148150
}
149151
)->then(function () use (&$results) {
150152
ksort($results);

0 commit comments

Comments
 (0)