Skip to content

Commit 6606f3d

Browse files
committed
feat: restyle popup link in Block Editor
1 parent d6d179b commit 6606f3d

3 files changed

Lines changed: 52 additions & 31 deletions

File tree

app/default-files/default-languages/en-gb/translations.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@
381381
"linkInvalidMsg": "Sorry! This link seems to be invalid.",
382382
"linkRelAttribute": "Link \"rel\" attribute",
383383
"linkTitleAttribute": "Link \"title\" attribute",
384-
"linkClassAttribute": "Link \"class\" attribute",
384+
"linkClassAttribute": "CSS class",
385+
"linkTarget": "Link target",
385386
"openInNewTab": "Open in new tab",
386387
"previewLinkInBrowser": "Preview this link in browser",
387388
"previewOnlyExternalLinksMsg": "You can only preview external links in the post editor",

app/default-files/default-languages/pl/translations.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,8 @@
380380
"linkInvalidMsg": "Przepraszamy! Ten link wydaje się być nieprawidłowy.",
381381
"linkRelAttribute": "Atrybut \"rel\" linka",
382382
"linkTitleAttribute": "Atrybut \"title\" linka",
383-
"linkClassAttribute": "Atrybut \"class\" linka",
383+
"linkClassAttribute": "Klasa CSS",
384+
"linkTarget": "Target linka",
384385
"openInNewTab": "Otwórz w nowej zakładce",
385386
"previewLinkInBrowser": "Wyświetl podgląd tego linku w przeglądarce",
386387
"previewOnlyExternalLinksMsg": "W edytorze wpisów możesz wyświetlić podgląd tylko linków zewnętrznych",

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

Lines changed: 48 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -94,35 +94,54 @@
9494
:spellcheck="false"
9595
placeholder="https://example.com"
9696
@keyup.enter="save()" />
97-
<input
98-
type="text"
99-
class="block-link-popup-link-title"
100-
v-model="link.title"
101-
:spellcheck="false"
102-
placeholder="Title" />
103-
<input
104-
type="text"
105-
class="block-link-popup-link-css-class"
106-
v-model="link.cssClass"
107-
:spellcheck="false"
108-
placeholder="CSS class" />
109-
<div class="block-link-popup-link-switcher">
110-
<switcher
111-
v-model="link.targetBlank" />
112-
{{ $t('link.openInNewTab') }}
113-
</div>
114-
115-
<div
116-
v-if="linkType === 'file'"
117-
class="block-link-popup-link-switcher">
118-
<switcher v-model="link.download" /> {{ $t('link.addDownloadAttr') }}
119-
</div>
120-
121-
<div class="block-link-popup-link-switcher">
122-
<switcher v-model="link.noFollow" /> {{ $t('link.addNofollow') }}
123-
<switcher v-model="link.sponsored"/> rel="sponsored"
124-
<switcher v-model="link.ugc" /> rel="ugc"
125-
</div>
97+
<field
98+
:label="$t('link.linkTitleAttribute')">
99+
<input
100+
slot="field"
101+
type="text"
102+
class="block-link-popup-link-title"
103+
v-model="link.title"
104+
:spellcheck="false" />
105+
</field>
106+
<field
107+
:label="$t('link.linkClassAttribute')">
108+
<input
109+
slot="field"
110+
type="text"
111+
class="block-link-popup-link-css-class"
112+
v-model="link.cssClass"
113+
:spellcheck="false" />
114+
</field>
115+
<field
116+
:label="$t('link.linkTarget')">
117+
<switcher
118+
slot="field"
119+
:label="$t('link.openInNewTab')"
120+
v-model="link.targetBlank" />
121+
</field>
122+
<field
123+
v-if="linkType === 'file'"
124+
:label="$t('link.downloadAttribute')">
125+
<switcher
126+
slot="field"
127+
v-model="link.download" />
128+
</field>
129+
130+
<field
131+
:label="$t('link.linkRelAttribute')">
132+
<switcher
133+
slot="field"
134+
label="nofollow"
135+
v-model="link.noFollow" />
136+
<switcher
137+
slot="field"
138+
label="sponsored"
139+
v-model="link.sponsored"/>
140+
<switcher
141+
slot="field"
142+
label="ugc"
143+
v-model="link.ugc" />
144+
</field>
126145

127146
<div class="block-link-popup-buttons">
128147
<button @click.stop="save()">

0 commit comments

Comments
 (0)