Skip to content

Commit 5f50da4

Browse files
committed
fix: improved UI for block link popup (#869ak4k6x)
1 parent 6606f3d commit 5f50da4

3 files changed

Lines changed: 34 additions & 4 deletions

File tree

app/back-end/builddata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"version": "0.46.5",
3-
"build": 17284
3+
"build": 17290
44
}

app/src/components/block-editor/components/BlockLinkPopup.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
{{ $t('file.file') }}
3838
</div>
3939
</div>
40+
4041
<vue-select
4142
v-if="linkType === 'post'"
4243
slot="field"
@@ -47,6 +48,7 @@
4748
:close-on-select="true"
4849
:show-labels="false"
4950
:placeholder="$t('post.selectPostPage')"></vue-select>
51+
5052
<vue-select
5153
v-if="linkType === 'page'"
5254
slot="field"
@@ -57,6 +59,7 @@
5759
:close-on-select="true"
5860
:show-labels="false"
5961
:placeholder="$t('page.selectPage')"></vue-select>
62+
6063
<vue-select
6164
v-if="linkType === 'tag'"
6265
slot="field"
@@ -67,6 +70,7 @@
6770
:close-on-select="true"
6871
:show-labels="false"
6972
:placeholder="$t('tag.selectTagPage')"></vue-select>
73+
7074
<vue-select
7175
v-if="linkType === 'author'"
7276
slot="field"
@@ -77,6 +81,7 @@
7781
:close-on-select="true"
7882
:show-labels="false"
7983
:placeholder="$t('author.selectAuthorPage')"></vue-select>
84+
8085
<vue-select
8186
v-if="linkType === 'file'"
8287
slot="field"
@@ -86,6 +91,7 @@
8691
:close-on-select="true"
8792
:show-labels="false"
8893
:placeholder="$t('file.selectFileFromFileManager')"></vue-select>
94+
8995
<input
9096
v-if="linkType === 'external'"
9197
type="text"
@@ -94,6 +100,7 @@
94100
:spellcheck="false"
95101
placeholder="https://example.com"
96102
@keyup.enter="save()" />
103+
97104
<field
98105
:label="$t('link.linkTitleAttribute')">
99106
<input
@@ -103,6 +110,7 @@
103110
v-model="link.title"
104111
:spellcheck="false" />
105112
</field>
113+
106114
<field
107115
:label="$t('link.linkClassAttribute')">
108116
<input
@@ -112,13 +120,15 @@
112120
v-model="link.cssClass"
113121
:spellcheck="false" />
114122
</field>
123+
115124
<field
116125
:label="$t('link.linkTarget')">
117126
<switcher
118127
slot="field"
119128
:label="$t('link.openInNewTab')"
120129
v-model="link.targetBlank" />
121130
</field>
131+
122132
<field
123133
v-if="linkType === 'file'"
124134
:label="$t('link.downloadAttribute')">
@@ -133,10 +143,12 @@
133143
slot="field"
134144
label="nofollow"
135145
v-model="link.noFollow" />
146+
136147
<switcher
137148
slot="field"
138149
label="sponsored"
139150
v-model="link.sponsored"/>
151+
140152
<switcher
141153
slot="field"
142154
label="ugc"

app/src/components/block-editor/components/elements/Switcher.vue

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<template>
2-
<span
3-
:class="cssClasses"
4-
@click="toggle"></span>
2+
<span :class="{
3+
'switcher-wrapper': true,
4+
'has-label': !!label
5+
}">
6+
<span
7+
:class="cssClasses"
8+
@click="toggle"></span>
9+
{{ label }}
10+
</span>
511
</template>
612

713
<script>
@@ -23,6 +29,10 @@ export default {
2329
default: () => false,
2430
type: Function
2531
},
32+
label: {
33+
default: '',
34+
type: String
35+
},
2636
disabled: {
2737
default: false,
2838
type: Boolean
@@ -87,6 +97,14 @@ export default {
8797
width: 32px;
8898
z-index: 1;
8999
100+
&-wrapper {
101+
display: inline-flex;
102+
103+
&.has-label {
104+
padding-right: 1rem;
105+
}
106+
}
107+
90108
&.lower-zindex {
91109
z-index: 0;
92110
}

0 commit comments

Comments
 (0)