Skip to content

Commit e7dc970

Browse files
authored
Merge pull request #699 from craftcms/releases/craft-5.7
Craft 5.7
2 parents 3df6066 + a10a35e commit e7dc970

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+871
-160
lines changed

docs/.vuepress/components/Block.vue

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1+
<template>
2+
<div class="custom-block">
3+
<div v-if="label" class="banner">
4+
<span class="label">{{ label }}</span>
5+
</div>
6+
<div class="content">
7+
<slot />
8+
</div>
9+
</div>
10+
</template>
11+
112
<script>
213
export default {
3-
functional: true,
414
props: {
515
label: String,
616
},
7-
render(h, { props, slots }) {
8-
const content = [h('div', { class: 'content' }, slots().default)];
9-
10-
if (props.label) {
11-
content.unshift(h(
12-
'div',
13-
{
14-
class: 'banner',
15-
},
16-
[h('span', { class: 'label' }, props.label)]
17-
));
18-
}
19-
20-
return h('div', { class: 'custom-block' }, content);
21-
},
2217
};
2318
</script>
2419

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<template>
2+
<span class="placeholder" :title="help"><slot /></span>
3+
</template>
4+
5+
<script>
6+
export default {
7+
props: {
8+
help: {
9+
type: String,
10+
required: false,
11+
},
12+
},
13+
};
14+
</script>
15+
16+
17+
<style lang="postcss" scoped>
18+
.placeholder {
19+
@apply border border-dashed px-1;
20+
21+
font-size: 0.95em;
22+
cursor: help;
23+
}
24+
</style>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<template>
2+
<div :class="['status-label', getSlug()]">
3+
<div class="status-label-pip" :style="{ backgroundColor: getColor() }"></div>
4+
<div class="status-label-text">
5+
{{ label }}
6+
</div>
7+
</div>
8+
</template>
9+
10+
<script>
11+
export default {
12+
props: {
13+
label: {
14+
type: String,
15+
default: 'live',
16+
},
17+
color: {
18+
type: String,
19+
default: null,
20+
},
21+
},
22+
methods: {
23+
getSlug() {
24+
return this.label.toLowerCase().replace(/[^a-z]/, '-');
25+
},
26+
getColor() {
27+
if (!this.color) {
28+
return null;
29+
}
30+
31+
if (this.color.indexOf('#') !== 0) {
32+
return null;
33+
}
34+
35+
return this.color;
36+
},
37+
},
38+
};
39+
</script>
40+
41+
<style lang="postcss" scoped>
42+
.status-label {
43+
align-items: center;
44+
border-radius: 1em;
45+
display: inline-flex;
46+
height: 20px;
47+
padding: 0 10px 0 5px;
48+
49+
&.live {
50+
background-color: theme('colors.craft.green');
51+
}
52+
53+
&.pending {
54+
background-color: theme('colors.craft.orange');
55+
}
56+
}
57+
58+
.status-label-pip {
59+
background-color: white;
60+
border-radius: 100%;
61+
height: 12px;
62+
margin-right: 5px;
63+
width: 12px;
64+
}
65+
66+
.status-label-text {
67+
color: white;
68+
font-size: 0.7em;
69+
font-weight: 600;
70+
letter-spacing: 0.05em;
71+
text-transform: uppercase;
72+
}
73+
</style>

docs/.vuepress/sets/craft-cms.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ module.exports = {
4444
children: [
4545
"field-types/addresses",
4646
"field-types/assets",
47+
"field-types/button-group",
4748
"field-types/categories",
4849
"field-types/checkboxes",
4950
"field-types/color",
@@ -52,6 +53,7 @@ module.exports = {
5253
"field-types/dropdown",
5354
"field-types/email",
5455
"field-types/entries",
56+
"field-types/json",
5557
"field-types/icon",
5658
"field-types/lightswitch",
5759
"field-types/link",

docs/5.x/extend/element-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Add native-feeling content types to empower content authors and adm
44

55
# Element Types
66

7-
[Elements](../system/elements.md) underpin Craft’s flexible and extensible content modeling features. You can supplement Craft’s eight [built-in element types](../system/elements.md#element-types) with your own, from a plugin or module.
7+
[Elements](../system/elements.md) underpin Craft’s flexible and extensible content modeling features. You can supplement Craft’s seven [built-in element types](../system/elements.md#element-types) with your own, from a plugin or module.
88

99
As you implement common element features like [titles](#titles), [sources](#sources), or [statuses](#statuses), the built-in element classes will be an invaluable resource—both as templates for basic functionality and evidence of the flexibility of elements.
1010

docs/5.x/extend/field-types.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ class Plugin extends \craft\base\Plugin
5252

5353
If you used the generator to scaffold the field type, it ought to have inserted this, automatically. You may register as many field types as you wish, from one `EVENT_REGISTER_FIELD_TYPES` event handler.
5454

55-
###
56-
5755
### Missing Fields
5856

5957
If your field class ever goes missing (say, because a developer uninstalls your plugin or removes the package), Craft will use an instance of <craft5:craft\fields\MissingField>, and display a message in any field layouts it was present in. This ensures the control panel doesn’t become inoperable, but doesn’t prevent front-end templates from breaking.

docs/5.x/images/elements-statuses.png

51.4 KB
Loading
98.8 KB
Loading
70.7 KB
Loading
46.4 KB
Loading

0 commit comments

Comments
 (0)