Skip to content

Commit e9c3939

Browse files
authored
Merge branch 'statamic:6.x' into feature/taxonomy-sort-field-direction
2 parents a3f95ad + 638b54d commit e9c3939

26 files changed

Lines changed: 357 additions & 61 deletions

File tree

lang/en/permissions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
'assign_user_groups' => 'Assign groups to users',
8989
'assign_roles' => 'Assign roles to users',
9090
'impersonate_users' => 'Impersonate users',
91+
'impersonate_users_desc' => 'Allows logging in as any user, including super admins. Grant this permission with caution.',
9192

9293
'group_updates' => 'Updates',
9394
'view_updates' => 'View updates',

resources/js/components/assets/Editor/Editor.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@
157157
</ui-badge>
158158
</div>
159159
<div class="flex items-center space-x-3 rtl:space-x-reverse">
160-
<ui-button icon="chevron-left" @click="navigateToPreviousAsset" v-tooltip="__('Previous Asset')" />
161-
<ui-button icon="chevron-right" @click="navigateToNextAsset" v-tooltip="__('Next Asset')" />
160+
<ui-button v-if="showNavigation" icon="chevron-left" @click="navigateToPreviousAsset" v-tooltip="__('Previous Asset')" />
161+
<ui-button v-if="showNavigation" icon="chevron-right" @click="navigateToNextAsset" v-tooltip="__('Next Asset')" />
162162
<ui-button variant="primary" icon="save" @click="saveAndClose" v-if="!readOnly" :text="__('Save')" />
163163
</div>
164164
</div>
@@ -239,6 +239,10 @@ export default {
239239
type: Boolean,
240240
default: true,
241241
},
242+
showNavigation: {
243+
type: Boolean,
244+
default: true,
245+
},
242246
allowDeleting: {
243247
type: Boolean,
244248
default() {

resources/js/components/blueprints/Section.vue

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,18 @@
5454
class="font-mono text-sm"
5555
v-model="editingSection.handle"
5656
@input="handleSyncedWithDisplay = false"
57-
/>
57+
>
58+
<template #append>
59+
<ui-button
60+
icon="sync"
61+
size="sm"
62+
variant="ghost"
63+
:aria-label="__('Regenerate from: :field', { field: __('Display') })"
64+
@click="regenerateHandle"
65+
v-tooltip="__('Regenerate from: :field', { field: __('Display') })"
66+
/>
67+
</template>
68+
</ui-input>
5869
</ui-field>
5970
<ui-field :label="__('Instructions')">
6071
<ui-input type="text" v-model="editingSection.instructions" />
@@ -219,15 +230,15 @@ export default {
219230
},
220231
},
221232
222-
created() {
223-
// This logic isn't ideal, but it was better than passing along a 'isNew' boolean and having
224-
// to deal with stripping it out and making it not new, etc. Good enough for a quick win.
225-
if (!this.section.handle || this.section.handle == 'new_section' || this.section.handle == 'new_set') {
226-
this.handleSyncedWithDisplay = true;
227-
}
228-
},
229-
230233
methods: {
234+
regenerateHandle() {
235+
if (!this.editingSection) {
236+
return;
237+
}
238+
239+
this.editingSection.handle = snake_case(this.editingSection.display);
240+
},
241+
231242
fieldLinked(field) {
232243
this.section.fields.push(field);
233244
this.$toast.success(__('Field added'));
@@ -250,6 +261,7 @@ export default {
250261
},
251262
252263
edit() {
264+
this.handleSyncedWithDisplay = !this.section.handle || ['new_section', 'new_set'].includes(this.section.handle);
253265
this.editingSection = {
254266
display: this.section.display,
255267
handle: this.section.handle,

resources/js/components/blueprints/Tab.vue

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,18 @@
3232
<Input ref="title" :model-value="display" @update:model-value="fieldUpdated('display', $event)" />
3333
</Field>
3434
<Field :label="__('Handle')" class="form-group field-w-100">
35-
<Input class="font-mono" :model-value="handle" @update:model-value="fieldUpdated('handle', $event)" />
35+
<Input class="font-mono" :model-value="handle" @update:model-value="fieldUpdated('handle', $event)">
36+
<template #append>
37+
<Button
38+
icon="sync"
39+
size="sm"
40+
variant="ghost"
41+
:aria-label="__('Regenerate from: :field', { field: __('Title') })"
42+
@click="regenerateHandle"
43+
v-tooltip="__('Regenerate from: :field', { field: __('Title') })"
44+
/>
45+
</template>
46+
</Input>
3647
</Field>
3748
<Field v-if="showInstructions" :label="__('Instructions')" class="form-group field-w-100">
3849
<Input :model-value="instructions" @update:model-value="fieldUpdated('instructions', $event)" />
@@ -103,14 +114,6 @@ export default {
103114
};
104115
},
105116
106-
created() {
107-
// This logic isn't ideal, but it was better than passing along a 'isNew' boolean and having
108-
// to deal with stripping it out and making it not new, etc. Good enough for a quick win.
109-
if (!this.handle || this.handle == 'new_tab' || this.handle == 'new_set_group') {
110-
this.handleSyncedWithDisplay = true;
111-
}
112-
},
113-
114117
computed: {
115118
isActive() {
116119
return this.currentTab === this.tab._id;
@@ -149,7 +152,16 @@ export default {
149152
},
150153
151154
methods: {
155+
regenerateHandle() {
156+
this.handle = snake_case(this.display);
157+
},
158+
152159
edit() {
160+
this.display = this.tab.display;
161+
this.handle = this.tab.handle;
162+
this.instructions = this.tab.instructions;
163+
this.icon = this.tab.icon;
164+
this.handleSyncedWithDisplay = !this.tab.handle || ['new_tab', 'new_set_group'].includes(this.tab.handle);
153165
this.editing = true;
154166
},
155167

resources/js/components/fieldtypes/assets/Asset.js

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,16 @@ export default {
1616
type: Boolean,
1717
default: true,
1818
},
19+
siblings: {
20+
type: Array,
21+
default: () => [],
22+
},
1923
},
2024

2125
data() {
2226
return {
2327
editing: false,
28+
editingId: null,
2429
};
2530
},
2631

@@ -73,9 +78,10 @@ export default {
7378

7479
edit() {
7580
if (this.readOnly) return;
76-
if (this.asset.invalid) return;
81+
if (this.asset?.invalid) return;
7782

7883
this.editing = true;
84+
this.editingId = this.asset?.id ?? null;
7985
},
8086

8187
remove() {
@@ -98,6 +104,7 @@ export default {
98104

99105
closeEditor() {
100106
this.editing = false;
107+
this.editingId = null;
101108
},
102109

103110
assetSaved(asset) {
@@ -108,10 +115,28 @@ export default {
108115
actionCompleted(successful, response) {
109116
if (successful === false) return;
110117
const id = response.ids[0] || null;
111-
if (id && id !== this.asset.id) {
112-
this.$emit('id-changed', id);
118+
if (id && id !== this.editingId) {
119+
this.$emit('id-changed', this.editingId, id);
113120
}
114121
this.closeEditor();
115122
},
123+
124+
navigateToPrevious() {
125+
const index = this.siblings.findIndex((asset) => asset.id === this.editingId);
126+
if (index <= 0) return;
127+
128+
const previousId = this.siblings[index - 1].id;
129+
this.editingId = null;
130+
this.$nextTick(() => (this.editingId = previousId));
131+
},
132+
133+
navigateToNext() {
134+
const index = this.siblings.findIndex((asset) => asset.id === this.editingId);
135+
if (index === -1 || index >= this.siblings.length - 1) return;
136+
137+
const nextId = this.siblings[index + 1].id;
138+
this.editingId = null;
139+
this.$nextTick(() => (this.editingId = nextId));
140+
},
116141
},
117142
};

resources/js/components/fieldtypes/assets/AssetRow.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@
5757
/>
5858

5959
<asset-editor
60-
v-if="editing"
61-
:id="asset.id"
60+
v-if="editingId"
61+
:id="editingId"
6262
:allow-deleting="false"
63+
:show-navigation="siblings.length > 1"
64+
@previous="navigateToPrevious"
65+
@next="navigateToNext"
6366
@closed="closeEditor"
6467
@saved="assetSaved"
6568
@action-completed="actionCompleted"

resources/js/components/fieldtypes/assets/AssetTile.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
:title="asset.invalid ? invalidLabel : label"
1010
>
1111
<asset-editor
12-
v-if="editing"
13-
:id="asset.id"
12+
v-if="editingId"
13+
:id="editingId"
1414
:allow-deleting="false"
15+
:show-navigation="siblings.length > 1"
16+
@previous="navigateToPrevious"
17+
@next="navigateToNext"
1518
@closed="closeEditor"
1619
@saved="assetSaved"
1720
@action-completed="actionCompleted"

resources/js/components/fieldtypes/assets/AssetsFieldtype.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,14 @@
116116
v-for="asset in assets"
117117
:key="asset.id"
118118
:asset="asset"
119+
:siblings="assets"
119120
:read-only="isReadOnly"
120121
:show-filename="config.show_filename"
121122
:show-set-alt="showSetAlt"
122123
:checkerboard-mode="checkerboardMode"
123124
@updated="assetUpdated"
124125
@removed="assetRemoved"
125-
@id-changed="idChanged(asset.id, $event)"
126+
@id-changed="idChanged"
126127
>
127128
</asset-tile>
128129
</div>
@@ -156,12 +157,13 @@
156157
v-for="asset in assets"
157158
:key="asset.id"
158159
:asset="asset"
160+
:siblings="assets"
159161
:read-only="isReadOnly"
160162
:show-filename="config.show_filename"
161163
:show-set-alt="showSetAlt"
162164
@updated="assetUpdated"
163165
@removed="assetRemoved"
164-
@id-changed="idChanged(asset.id, $event)"
166+
@id-changed="idChanged"
165167
/>
166168
</tbody>
167169
</sortable-list>

resources/js/components/fieldtypes/bard/Image.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
:id="assetId"
5656
:showToolbar="false"
5757
:allow-deleting="false"
58+
:show-navigation="false"
5859
@closed="closeEditor"
5960
@saved="editorAssetSaved"
6061
@actionCompleted="actionCompleted"

resources/views/graphql/graphiql.blade.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
</style>
2424
<link
2525
rel="stylesheet"
26-
href="https://esm.sh/graphiql/dist/style.css"
26+
href="https://esm.sh/graphiql@5.2.2/dist/style.css"
2727
>
2828
<link
2929
rel="stylesheet"
30-
href="https://esm.sh/@graphiql/plugin-explorer/dist/style.css"
30+
href="https://esm.sh/@graphiql/plugin-explorer@5.1.1/dist/style.css"
3131
>
3232

3333
@if (!$introspection)
@@ -39,19 +39,19 @@
3939
<script type="importmap">
4040
{
4141
"imports": {
42-
"react": "https://esm.sh/react@19.1.0",
43-
"react/": "https://esm.sh/react@19.1.0/",
42+
"react": "https://esm.sh/react@19.2.5",
43+
"react/": "https://esm.sh/react@19.2.5/",
4444
45-
"react-dom": "https://esm.sh/react-dom@19.1.0",
46-
"react-dom/": "https://esm.sh/react-dom@19.1.0/",
45+
"react-dom": "https://esm.sh/react-dom@19.2.5",
46+
"react-dom/": "https://esm.sh/react-dom@19.2.5/",
4747
48-
"graphiql": "https://esm.sh/graphiql?standalone&external=react,react-dom,@graphiql/react,graphql",
49-
"graphiql/": "https://esm.sh/graphiql/",
50-
"@graphiql/plugin-explorer": "https://esm.sh/@graphiql/plugin-explorer?standalone&external=react,@graphiql/react,graphql",
51-
"@graphiql/react": "https://esm.sh/@graphiql/react?standalone&external=react,react-dom,graphql,@graphiql/toolkit,@emotion/is-prop-valid",
48+
"graphiql": "https://esm.sh/graphiql@5.2.2?standalone&external=react,react-dom,@graphiql/react,graphql",
49+
"graphiql/": "https://esm.sh/graphiql@5.2.2/",
50+
"@graphiql/plugin-explorer": "https://esm.sh/@graphiql/plugin-explorer@5.1.1?standalone&external=react,@graphiql/react,graphql",
51+
"@graphiql/react": "https://esm.sh/@graphiql/react@0.37.3?standalone&external=react,react-dom,graphql,@graphiql/toolkit,@emotion/is-prop-valid",
5252
53-
"@graphiql/toolkit": "https://esm.sh/@graphiql/toolkit?standalone&external=graphql",
54-
"graphql": "https://esm.sh/graphql@16.11.0",
53+
"@graphiql/toolkit": "https://esm.sh/@graphiql/toolkit@0.11.3?standalone&external=graphql",
54+
"graphql": "https://esm.sh/graphql@16.13.2",
5555
"@emotion/is-prop-valid": "data:text/javascript,"
5656
}
5757
}

0 commit comments

Comments
 (0)