Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f53e093
Style them sections
jackmcdade Mar 14, 2023
d247551
wip new tabs
jackmcdade Mar 14, 2023
7a84cce
Get publish tabs working w/ new styles
jackmcdade Mar 15, 2023
cd186d3
Cleanup css and style tab focus-visible state
jackmcdade Mar 15, 2023
cbc63e0
Style Live Preview tabs
jackmcdade Mar 15, 2023
28bcbdb
fix ids and a11y links between tabs and panels
jasonvarga Mar 15, 2023
08e6ce1
bring back class so dragging works again
jasonvarga Mar 15, 2023
440c7cf
full width
jasonvarga Mar 15, 2023
90fd2aa
dont be shy
jasonvarga Mar 15, 2023
018f97f
move tab fields into modal.
jasonvarga Mar 15, 2023
8d4c062
Fix blueprint form tab fade and tweak modal styles slightly
jackmcdade Mar 17, 2023
72ba043
Sticky header for Field Settings
jackmcdade Mar 20, 2023
43d0c94
Field settings can be split into sections
jasonvarga Mar 20, 2023
0a6f985
Split config bard fields into settings as an example
jasonvarga Mar 20, 2023
9ba2bb3
fix
jasonvarga Mar 20, 2023
3921607
write test
jasonvarga Mar 20, 2023
2cc84bf
oops leftover debug
jasonvarga Mar 20, 2023
61cdbb2
wip
jasonvarga Mar 20, 2023
d9aef18
refactor to guard clause
jasonvarga Mar 20, 2023
8048986
avoid map if returning early
jasonvarga Mar 20, 2023
835bed2
New side-by-side layout for config fields
jackmcdade Mar 21, 2023
f128b1e
Prevent list fieldtype from looking derpy when empty
jackmcdade Mar 21, 2023
2e7726d
Fix checkboxes inline-mode
jackmcdade Mar 21, 2023
b575a08
Fix vertical alignment for relationship item icons
jackmcdade Mar 21, 2023
10a2bf2
Improve field settings by grouping into sections and rewriting some h…
jackmcdade Mar 21, 2023
a1e29b5
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
c6992e4
Reorganize Bard configs a little more
jackmcdade Mar 21, 2023
ad29e36
Make sure tabs inside cards fade to white instead of gray
jackmcdade Mar 21, 2023
00b0241
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
65f3be3
fix asset fields not showing up
jasonvarga Mar 21, 2023
6dc7c8f
asset editor uses sections
jasonvarga Mar 21, 2023
15a4fd4
bring back asset editor errors
jasonvarga Mar 21, 2023
116c7ea
fix nav page editor not loading by looking into the section
jasonvarga Mar 21, 2023
3cbbd2a
Don't remove fields if its empty
jasonvarga Mar 21, 2023
b7fcb5d
fix field not moving to new section when dropping over the add sectio…
jasonvarga Mar 21, 2023
895f5a0
Slightly nicer Add Section button
jackmcdade Mar 21, 2023
a4f1d7d
Don't show tab bar at all if you're in single tab mode
jasonvarga Mar 21, 2023
afac0f2
fix grid fields not being draggable
jasonvarga Mar 21, 2023
ac74d8d
fix bard not getting saved because instructions are empty
jasonvarga Mar 21, 2023
091a143
Handle empty tabs state
jackmcdade Mar 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/css/components/blueprints.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@
}

.blueprint-add-section-button {
@apply relative w-full border border-gray-500 border-dashed rounded flex justify-center items-center text-gray-700;
@apply relative w-full border border-gray-500 border-dashed rounded-lg flex justify-center items-center text-gray-700;

&:hover {
@apply border-gray text-gray-950;
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/modal.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,10 @@
MODALS
========================================================================== */

.v--modal {
@apply rounded-lg !important;
}

.v--modal-overlay {
z-index: 10000 !important;
background: hsla(210, 20%, 10%, .15) !important;
Expand Down
10 changes: 0 additions & 10 deletions resources/css/components/preview.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,16 +25,6 @@
z-index: 1;
}

.live-preview .publish-tabs {
@apply bg-gray-300 ml-0 pl-0;
.tab-button {
border-radius: 0;
height: 100%;
min-width: 100px;
border: none;
}
}

.live-preview .tabs-container {
@apply bg-gray-300;
}
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/publish.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,10 @@ code.parent-url {
@apply flex items-center;
}

.publish-section-header {
@apply px-5 pt-4 pb-3 border-b border-gray-400 bg-gray-100 rounded-t-lg;
}

.publish-sidebar {
@apply shrink-0;
margin-left: 20px;
Expand Down
37 changes: 37 additions & 0 deletions resources/css/components/settings.css
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
.config-field {
@apply md:flex border-b border-gray-400 w-full;
@apply p-3 @sm:p-4 m-0;

.field-inner {
@apply w-full md:w-1/2 md:pr-8;
}

.field-inner + div {
@apply w-full md:w-1/2;
}

.help-block {
@apply mb-0;
}

.help-block p:last-child {
@apply mb-0 !important;
}
}

.card .publish-fields .config-field:last-child {
@apply border-b-0;
}

.config-field.full-width-setting {
@apply md:flex-col;
.field-inner {
@apply w-full;
}
.field-inner + div {
@apply w-full;
}
.help-block p:last-child {
@apply mb-4 !important;
}
}
68 changes: 16 additions & 52 deletions resources/css/components/tabs.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,13 +2,8 @@
TABS
========================================================================== */


.tabs-container {
@apply relative mb-5;

&.offset-for-sidebar {
width: calc(100% - 320px);
}
@apply w-full border-b text-md relative flex;

.fade-left, .fade-right {
@apply absolute w-4 inset-y-0 from-gray-300 pointer-events-none z-10;
Expand All@@ -23,49 +18,29 @@
}
}

.tabs {
@apply flex items-end overflow-hidden px-2 -ml-2;
height: 48px;
.card .tabs-container .fade-left, .card .tabs-container .fade-right {
@apply from-white;
}

.tabs {
@apply flex space-x-2 overflow-hidden relative w-full max-w-full;
&-scrolled {
@apply pl-0 ml-0;
}
}

.tab-button {
@apply whitespace-nowrap bg-gray-100 py-1 px-4 shrink-0 leading-tight text-xs w-auto relative flex items-center justify-center rounded-t-md shadow border-b border-gray-300 select-none;
height: 94%;
min-height: 94%;
}

.tab-button:hover {
@apply bg-white;
}
.tab-button:active {
@apply bg-white text-blue;
}

.tab-button:focus {
@apply bg-white text-blue border-b-0 ring-1 ring-inset;
}

.tab-button.active {
@apply bg-white text-blue border-t-2 border-blue relative h-full min-h-full border-b-0 outline-none;
z-index: 1;
.tab-button {
@apply flex items-center px-2 py-2 text-gray-700 select-none border-b-2 border-transparent whitespace-nowrap shrink-0;
&:hover {
@apply text-gray-800;
}

.tab-button:focus {
@apply border-t;
&:focus-visible {
@apply ring-inset ring-2 ring-blue-500 outline-none rounded-t;
}

.tab-button.ghost {
@apply bg-transparent relative h-full min-h-full shadow-none border-none text-gray-500 px-6;
min-width: 0;
&:hover {
@apply text-blue;
}
&.active {
@apply text-blue-500 border-blue-500;
}

.tab-button.has-error {
&.has-error {
@apply text-red-500;

&.active {
Expand All@@ -75,20 +50,9 @@
}


@screen md {
.tabs .tab-button {
min-width: 120px;
}
}


/* Responsive Wangjangling
========================================================================== */

@screen md {
.tabs .tab-button { @apply text-base; }
}

.pill-tab {
@apply text-gray-700 flex items-center focus:outline-none px-2 py-1 rounded;

Expand Down
1 change: 1 addition & 0 deletions resources/css/cp.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,6 +40,7 @@
@import "components/progress";
@import "components/revisions";
@import "components/roles";
@import "components/settings";
@import "components/shortcuts";
@import "components/sortable";
@import "components/stacks";
Expand Down
3 changes: 3 additions & 0 deletions resources/css/elements/forms.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -162,6 +162,9 @@ input.input-text-minimal:read-only,

.option {
@apply mr-4 mb-3;
&:first-child {
@apply mt-3;
}
}
}

Expand Down
23 changes: 12 additions & 11 deletions resources/js/components/assets/Editor/Editor.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -117,7 +117,7 @@
:blueprint="fieldset"
:values="values"
:meta="meta"

:errors="errors"
@updated="values = { ...$event, focus: values.focus }"
>
<div class="w-full sm:p-4 md:pt-px md:w-1/3 md:grow h-1/2 md:h-full overflow-scroll" slot-scope="{ setFieldValue, setFieldMeta }">
Expand All@@ -126,15 +126,14 @@
<loading-graphic text="Saving" />
</div>

<div class="card p-0">
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />
<publish-fields
:fields="fields"
:read-only="readOnly"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>
</div>
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />

<publish-sections
:sections="fieldset.tabs[0].sections"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>

</div>
</publish-container>
</div>
Expand DownExpand Up@@ -307,7 +306,9 @@ export default {

this.fieldset = data.blueprint;
this.fields = _.chain(this.fieldset.tabs)
.map(tab => tab.fields)
.map(tab => tab.sections)
.flatten(true)
.map(section => section.fields)
.flatten(true)
.value();

Expand Down
38 changes: 23 additions & 15 deletions resources/js/components/blueprints/Builder.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,31 +10,39 @@
</header>

<div class="publish-form card p-0 @container" v-if="showTitle">
<div class="form-group">
<label class="block">{{ __('Title') }}</label>
<small class="help-block">{{ __('messages.blueprints_title_instructions') }}</small>
<div v-if="errors.title">
<small class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Title') }}</label>
<p class="help-block">{{ __('messages.blueprints_title_instructions') }}</p>
<div v-if="errors.title">
<p class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
</div>
</div>
<div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>

<div class="form-group">
<label class="block">{{ __('Hidden') }}</label>
<small class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</small>
<div v-if="errors.hidden">
<small class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Hidden') }}</label>
<p class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</p>
<div v-if="errors.hidden">
<p class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
</div>
</div>
<div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
</div>

<div class="content mt-10 mb-4" v-if="useTabs">
<h2>{{ __('Tabs') }}</h2>
<!--<h2>{{ __('Tabs') }}</h2>
<p class="max-w-lg">{{ __('messages.tabs_instructions') }}</p>
<div v-if="errors.tabs">
<small class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>
<p class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>-->
</div>

<tabs
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/blueprints/Sections.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,10 +20,10 @@
@deleted="deleteSection(i)"
/>

<div class="blueprint-add-section-container w-full md:w-1/2">
<div class="blueprint-add-section-container w-full">
<button class="blueprint-add-section-button outline-none" @click="addSection">
<div class="text-center flex items-center leading-none">
<div class="text-2xl mr-1">+</div>
<svg-icon name="micro-plus" class="h-3 w-3 mr-2" />
<div v-text="addSectionText" />
</div>

Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
[4.x] Blueprint UI by jasonvarga · Pull Request #7706 · statamic/cms · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f53e093
Style them sections
jackmcdade Mar 14, 2023
d247551
wip new tabs
jackmcdade Mar 14, 2023
7a84cce
Get publish tabs working w/ new styles
jackmcdade Mar 15, 2023
cd186d3
Cleanup css and style tab focus-visible state
jackmcdade Mar 15, 2023
cbc63e0
Style Live Preview tabs
jackmcdade Mar 15, 2023
28bcbdb
fix ids and a11y links between tabs and panels
jasonvarga Mar 15, 2023
08e6ce1
bring back class so dragging works again
jasonvarga Mar 15, 2023
440c7cf
full width
jasonvarga Mar 15, 2023
90fd2aa
dont be shy
jasonvarga Mar 15, 2023
018f97f
move tab fields into modal.
jasonvarga Mar 15, 2023
8d4c062
Fix blueprint form tab fade and tweak modal styles slightly
jackmcdade Mar 17, 2023
72ba043
Sticky header for Field Settings
jackmcdade Mar 20, 2023
43d0c94
Field settings can be split into sections
jasonvarga Mar 20, 2023
0a6f985
Split config bard fields into settings as an example
jasonvarga Mar 20, 2023
9ba2bb3
fix
jasonvarga Mar 20, 2023
3921607
write test
jasonvarga Mar 20, 2023
2cc84bf
oops leftover debug
jasonvarga Mar 20, 2023
61cdbb2
wip
jasonvarga Mar 20, 2023
d9aef18
refactor to guard clause
jasonvarga Mar 20, 2023
8048986
avoid map if returning early
jasonvarga Mar 20, 2023
835bed2
New side-by-side layout for config fields
jackmcdade Mar 21, 2023
f128b1e
Prevent list fieldtype from looking derpy when empty
jackmcdade Mar 21, 2023
2e7726d
Fix checkboxes inline-mode
jackmcdade Mar 21, 2023
b575a08
Fix vertical alignment for relationship item icons
jackmcdade Mar 21, 2023
10a2bf2
Improve field settings by grouping into sections and rewriting some h…
jackmcdade Mar 21, 2023
a1e29b5
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
c6992e4
Reorganize Bard configs a little more
jackmcdade Mar 21, 2023
ad29e36
Make sure tabs inside cards fade to white instead of gray
jackmcdade Mar 21, 2023
00b0241
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
65f3be3
fix asset fields not showing up
jasonvarga Mar 21, 2023
6dc7c8f
asset editor uses sections
jasonvarga Mar 21, 2023
15a4fd4
bring back asset editor errors
jasonvarga Mar 21, 2023
116c7ea
fix nav page editor not loading by looking into the section
jasonvarga Mar 21, 2023
3cbbd2a
Don't remove fields if its empty
jasonvarga Mar 21, 2023
b7fcb5d
fix field not moving to new section when dropping over the add sectio…
jasonvarga Mar 21, 2023
895f5a0
Slightly nicer Add Section button
jackmcdade Mar 21, 2023
a4f1d7d
Don't show tab bar at all if you're in single tab mode
jasonvarga Mar 21, 2023
afac0f2
fix grid fields not being draggable
jasonvarga Mar 21, 2023
ac74d8d
fix bard not getting saved because instructions are empty
jasonvarga Mar 21, 2023
091a143
Handle empty tabs state
jackmcdade Mar 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/css/components/blueprints.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@
}

.blueprint-add-section-button {
@apply relative w-full border border-gray-500 border-dashed rounded flex justify-center items-center text-gray-700;
@apply relative w-full border border-gray-500 border-dashed rounded-lg flex justify-center items-center text-gray-700;

&:hover {
@apply border-gray text-gray-950;
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/modal.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,10 @@
MODALS
========================================================================== */

.v--modal {
@apply rounded-lg !important;
}

.v--modal-overlay {
z-index: 10000 !important;
background: hsla(210, 20%, 10%, .15) !important;
Expand Down
10 changes: 0 additions & 10 deletions resources/css/components/preview.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,16 +25,6 @@
z-index: 1;
}

.live-preview .publish-tabs {
@apply bg-gray-300 ml-0 pl-0;
.tab-button {
border-radius: 0;
height: 100%;
min-width: 100px;
border: none;
}
}

.live-preview .tabs-container {
@apply bg-gray-300;
}
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/publish.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,10 @@ code.parent-url {
@apply flex items-center;
}

.publish-section-header {
@apply px-5 pt-4 pb-3 border-b border-gray-400 bg-gray-100 rounded-t-lg;
}

.publish-sidebar {
@apply shrink-0;
margin-left: 20px;
Expand Down
37 changes: 37 additions & 0 deletions resources/css/components/settings.css
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
.config-field {
@apply md:flex border-b border-gray-400 w-full;
@apply p-3 @sm:p-4 m-0;

.field-inner {
@apply w-full md:w-1/2 md:pr-8;
}

.field-inner + div {
@apply w-full md:w-1/2;
}

.help-block {
@apply mb-0;
}

.help-block p:last-child {
@apply mb-0 !important;
}
}

.card .publish-fields .config-field:last-child {
@apply border-b-0;
}

.config-field.full-width-setting {
@apply md:flex-col;
.field-inner {
@apply w-full;
}
.field-inner + div {
@apply w-full;
}
.help-block p:last-child {
@apply mb-4 !important;
}
}
68 changes: 16 additions & 52 deletions resources/css/components/tabs.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,13 +2,8 @@
TABS
========================================================================== */


.tabs-container {
@apply relative mb-5;

&.offset-for-sidebar {
width: calc(100% - 320px);
}
@apply w-full border-b text-md relative flex;

.fade-left, .fade-right {
@apply absolute w-4 inset-y-0 from-gray-300 pointer-events-none z-10;
Expand All@@ -23,49 +18,29 @@
}
}

.tabs {
@apply flex items-end overflow-hidden px-2 -ml-2;
height: 48px;
.card .tabs-container .fade-left, .card .tabs-container .fade-right {
@apply from-white;
}

.tabs {
@apply flex space-x-2 overflow-hidden relative w-full max-w-full;
&-scrolled {
@apply pl-0 ml-0;
}
}

.tab-button {
@apply whitespace-nowrap bg-gray-100 py-1 px-4 shrink-0 leading-tight text-xs w-auto relative flex items-center justify-center rounded-t-md shadow border-b border-gray-300 select-none;
height: 94%;
min-height: 94%;
}

.tab-button:hover {
@apply bg-white;
}
.tab-button:active {
@apply bg-white text-blue;
}

.tab-button:focus {
@apply bg-white text-blue border-b-0 ring-1 ring-inset;
}

.tab-button.active {
@apply bg-white text-blue border-t-2 border-blue relative h-full min-h-full border-b-0 outline-none;
z-index: 1;
.tab-button {
@apply flex items-center px-2 py-2 text-gray-700 select-none border-b-2 border-transparent whitespace-nowrap shrink-0;
&:hover {
@apply text-gray-800;
}

.tab-button:focus {
@apply border-t;
&:focus-visible {
@apply ring-inset ring-2 ring-blue-500 outline-none rounded-t;
}

.tab-button.ghost {
@apply bg-transparent relative h-full min-h-full shadow-none border-none text-gray-500 px-6;
min-width: 0;
&:hover {
@apply text-blue;
}
&.active {
@apply text-blue-500 border-blue-500;
}

.tab-button.has-error {
&.has-error {
@apply text-red-500;

&.active {
Expand All@@ -75,20 +50,9 @@
}


@screen md {
.tabs .tab-button {
min-width: 120px;
}
}


/* Responsive Wangjangling
========================================================================== */

@screen md {
.tabs .tab-button { @apply text-base; }
}

.pill-tab {
@apply text-gray-700 flex items-center focus:outline-none px-2 py-1 rounded;

Expand Down
1 change: 1 addition & 0 deletions resources/css/cp.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,6 +40,7 @@
@import "components/progress";
@import "components/revisions";
@import "components/roles";
@import "components/settings";
@import "components/shortcuts";
@import "components/sortable";
@import "components/stacks";
Expand Down
3 changes: 3 additions & 0 deletions resources/css/elements/forms.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -162,6 +162,9 @@ input.input-text-minimal:read-only,

.option {
@apply mr-4 mb-3;
&:first-child {
@apply mt-3;
}
}
}

Expand Down
23 changes: 12 additions & 11 deletions resources/js/components/assets/Editor/Editor.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -117,7 +117,7 @@
:blueprint="fieldset"
:values="values"
:meta="meta"

:errors="errors"
@updated="values = { ...$event, focus: values.focus }"
>
<div class="w-full sm:p-4 md:pt-px md:w-1/3 md:grow h-1/2 md:h-full overflow-scroll" slot-scope="{ setFieldValue, setFieldMeta }">
Expand All@@ -126,15 +126,14 @@
<loading-graphic text="Saving" />
</div>

<div class="card p-0">
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />
<publish-fields
:fields="fields"
:read-only="readOnly"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>
</div>
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />

<publish-sections
:sections="fieldset.tabs[0].sections"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>

</div>
</publish-container>
</div>
Expand DownExpand Up@@ -307,7 +306,9 @@ export default {

this.fieldset = data.blueprint;
this.fields = _.chain(this.fieldset.tabs)
.map(tab => tab.fields)
.map(tab => tab.sections)
.flatten(true)
.map(section => section.fields)
.flatten(true)
.value();

Expand Down
38 changes: 23 additions & 15 deletions resources/js/components/blueprints/Builder.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,31 +10,39 @@
</header>

<div class="publish-form card p-0 @container" v-if="showTitle">
<div class="form-group">
<label class="block">{{ __('Title') }}</label>
<small class="help-block">{{ __('messages.blueprints_title_instructions') }}</small>
<div v-if="errors.title">
<small class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Title') }}</label>
<p class="help-block">{{ __('messages.blueprints_title_instructions') }}</p>
<div v-if="errors.title">
<p class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
</div>
</div>
<div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>

<div class="form-group">
<label class="block">{{ __('Hidden') }}</label>
<small class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</small>
<div v-if="errors.hidden">
<small class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Hidden') }}</label>
<p class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</p>
<div v-if="errors.hidden">
<p class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
</div>
</div>
<div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
</div>

<div class="content mt-10 mb-4" v-if="useTabs">
<h2>{{ __('Tabs') }}</h2>
<!--<h2>{{ __('Tabs') }}</h2>
<p class="max-w-lg">{{ __('messages.tabs_instructions') }}</p>
<div v-if="errors.tabs">
<small class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>
<p class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>-->
</div>

<tabs
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/blueprints/Sections.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,10 +20,10 @@
@deleted="deleteSection(i)"
/>

<div class="blueprint-add-section-container w-full md:w-1/2">
<div class="blueprint-add-section-container w-full">
<button class="blueprint-add-section-button outline-none" @click="addSection">
<div class="text-center flex items-center leading-none">
<div class="text-2xl mr-1">+</div>
<svg-icon name="micro-plus" class="h-3 w-3 mr-2" />
<div v-text="addSectionText" />
</div>

Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' [4.x] Blueprint UI by jasonvarga · Pull Request #7706 · statamic/cms · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f53e093
Style them sections
jackmcdade Mar 14, 2023
d247551
wip new tabs
jackmcdade Mar 14, 2023
7a84cce
Get publish tabs working w/ new styles
jackmcdade Mar 15, 2023
cd186d3
Cleanup css and style tab focus-visible state
jackmcdade Mar 15, 2023
cbc63e0
Style Live Preview tabs
jackmcdade Mar 15, 2023
28bcbdb
fix ids and a11y links between tabs and panels
jasonvarga Mar 15, 2023
08e6ce1
bring back class so dragging works again
jasonvarga Mar 15, 2023
440c7cf
full width
jasonvarga Mar 15, 2023
90fd2aa
dont be shy
jasonvarga Mar 15, 2023
018f97f
move tab fields into modal.
jasonvarga Mar 15, 2023
8d4c062
Fix blueprint form tab fade and tweak modal styles slightly
jackmcdade Mar 17, 2023
72ba043
Sticky header for Field Settings
jackmcdade Mar 20, 2023
43d0c94
Field settings can be split into sections
jasonvarga Mar 20, 2023
0a6f985
Split config bard fields into settings as an example
jasonvarga Mar 20, 2023
9ba2bb3
fix
jasonvarga Mar 20, 2023
3921607
write test
jasonvarga Mar 20, 2023
2cc84bf
oops leftover debug
jasonvarga Mar 20, 2023
61cdbb2
wip
jasonvarga Mar 20, 2023
d9aef18
refactor to guard clause
jasonvarga Mar 20, 2023
8048986
avoid map if returning early
jasonvarga Mar 20, 2023
835bed2
New side-by-side layout for config fields
jackmcdade Mar 21, 2023
f128b1e
Prevent list fieldtype from looking derpy when empty
jackmcdade Mar 21, 2023
2e7726d
Fix checkboxes inline-mode
jackmcdade Mar 21, 2023
b575a08
Fix vertical alignment for relationship item icons
jackmcdade Mar 21, 2023
10a2bf2
Improve field settings by grouping into sections and rewriting some h…
jackmcdade Mar 21, 2023
a1e29b5
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
c6992e4
Reorganize Bard configs a little more
jackmcdade Mar 21, 2023
ad29e36
Make sure tabs inside cards fade to white instead of gray
jackmcdade Mar 21, 2023
00b0241
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
65f3be3
fix asset fields not showing up
jasonvarga Mar 21, 2023
6dc7c8f
asset editor uses sections
jasonvarga Mar 21, 2023
15a4fd4
bring back asset editor errors
jasonvarga Mar 21, 2023
116c7ea
fix nav page editor not loading by looking into the section
jasonvarga Mar 21, 2023
3cbbd2a
Don't remove fields if its empty
jasonvarga Mar 21, 2023
b7fcb5d
fix field not moving to new section when dropping over the add sectio…
jasonvarga Mar 21, 2023
895f5a0
Slightly nicer Add Section button
jackmcdade Mar 21, 2023
a4f1d7d
Don't show tab bar at all if you're in single tab mode
jasonvarga Mar 21, 2023
afac0f2
fix grid fields not being draggable
jasonvarga Mar 21, 2023
ac74d8d
fix bard not getting saved because instructions are empty
jasonvarga Mar 21, 2023
091a143
Handle empty tabs state
jackmcdade Mar 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/css/components/blueprints.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@
}

.blueprint-add-section-button {
@apply relative w-full border border-gray-500 border-dashed rounded flex justify-center items-center text-gray-700;
@apply relative w-full border border-gray-500 border-dashed rounded-lg flex justify-center items-center text-gray-700;

&:hover {
@apply border-gray text-gray-950;
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/modal.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,10 @@
MODALS
========================================================================== */

.v--modal {
@apply rounded-lg !important;
}

.v--modal-overlay {
z-index: 10000 !important;
background: hsla(210, 20%, 10%, .15) !important;
Expand Down
10 changes: 0 additions & 10 deletions resources/css/components/preview.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,16 +25,6 @@
z-index: 1;
}

.live-preview .publish-tabs {
@apply bg-gray-300 ml-0 pl-0;
.tab-button {
border-radius: 0;
height: 100%;
min-width: 100px;
border: none;
}
}

.live-preview .tabs-container {
@apply bg-gray-300;
}
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/publish.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,10 @@ code.parent-url {
@apply flex items-center;
}

.publish-section-header {
@apply px-5 pt-4 pb-3 border-b border-gray-400 bg-gray-100 rounded-t-lg;
}

.publish-sidebar {
@apply shrink-0;
margin-left: 20px;
Expand Down
37 changes: 37 additions & 0 deletions resources/css/components/settings.css
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
.config-field {
@apply md:flex border-b border-gray-400 w-full;
@apply p-3 @sm:p-4 m-0;

.field-inner {
@apply w-full md:w-1/2 md:pr-8;
}

.field-inner + div {
@apply w-full md:w-1/2;
}

.help-block {
@apply mb-0;
}

.help-block p:last-child {
@apply mb-0 !important;
}
}

.card .publish-fields .config-field:last-child {
@apply border-b-0;
}

.config-field.full-width-setting {
@apply md:flex-col;
.field-inner {
@apply w-full;
}
.field-inner + div {
@apply w-full;
}
.help-block p:last-child {
@apply mb-4 !important;
}
}
68 changes: 16 additions & 52 deletions resources/css/components/tabs.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,13 +2,8 @@
TABS
========================================================================== */


.tabs-container {
@apply relative mb-5;

&.offset-for-sidebar {
width: calc(100% - 320px);
}
@apply w-full border-b text-md relative flex;

.fade-left, .fade-right {
@apply absolute w-4 inset-y-0 from-gray-300 pointer-events-none z-10;
Expand All@@ -23,49 +18,29 @@
}
}

.tabs {
@apply flex items-end overflow-hidden px-2 -ml-2;
height: 48px;
.card .tabs-container .fade-left, .card .tabs-container .fade-right {
@apply from-white;
}

.tabs {
@apply flex space-x-2 overflow-hidden relative w-full max-w-full;
&-scrolled {
@apply pl-0 ml-0;
}
}

.tab-button {
@apply whitespace-nowrap bg-gray-100 py-1 px-4 shrink-0 leading-tight text-xs w-auto relative flex items-center justify-center rounded-t-md shadow border-b border-gray-300 select-none;
height: 94%;
min-height: 94%;
}

.tab-button:hover {
@apply bg-white;
}
.tab-button:active {
@apply bg-white text-blue;
}

.tab-button:focus {
@apply bg-white text-blue border-b-0 ring-1 ring-inset;
}

.tab-button.active {
@apply bg-white text-blue border-t-2 border-blue relative h-full min-h-full border-b-0 outline-none;
z-index: 1;
.tab-button {
@apply flex items-center px-2 py-2 text-gray-700 select-none border-b-2 border-transparent whitespace-nowrap shrink-0;
&:hover {
@apply text-gray-800;
}

.tab-button:focus {
@apply border-t;
&:focus-visible {
@apply ring-inset ring-2 ring-blue-500 outline-none rounded-t;
}

.tab-button.ghost {
@apply bg-transparent relative h-full min-h-full shadow-none border-none text-gray-500 px-6;
min-width: 0;
&:hover {
@apply text-blue;
}
&.active {
@apply text-blue-500 border-blue-500;
}

.tab-button.has-error {
&.has-error {
@apply text-red-500;

&.active {
Expand All@@ -75,20 +50,9 @@
}


@screen md {
.tabs .tab-button {
min-width: 120px;
}
}


/* Responsive Wangjangling
========================================================================== */

@screen md {
.tabs .tab-button { @apply text-base; }
}

.pill-tab {
@apply text-gray-700 flex items-center focus:outline-none px-2 py-1 rounded;

Expand Down
1 change: 1 addition & 0 deletions resources/css/cp.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,6 +40,7 @@
@import "components/progress";
@import "components/revisions";
@import "components/roles";
@import "components/settings";
@import "components/shortcuts";
@import "components/sortable";
@import "components/stacks";
Expand Down
3 changes: 3 additions & 0 deletions resources/css/elements/forms.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -162,6 +162,9 @@ input.input-text-minimal:read-only,

.option {
@apply mr-4 mb-3;
&:first-child {
@apply mt-3;
}
}
}

Expand Down
23 changes: 12 additions & 11 deletions resources/js/components/assets/Editor/Editor.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -117,7 +117,7 @@
:blueprint="fieldset"
:values="values"
:meta="meta"

:errors="errors"
@updated="values = { ...$event, focus: values.focus }"
>
<div class="w-full sm:p-4 md:pt-px md:w-1/3 md:grow h-1/2 md:h-full overflow-scroll" slot-scope="{ setFieldValue, setFieldMeta }">
Expand All@@ -126,15 +126,14 @@
<loading-graphic text="Saving" />
</div>

<div class="card p-0">
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />
<publish-fields
:fields="fields"
:read-only="readOnly"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>
</div>
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />

<publish-sections
:sections="fieldset.tabs[0].sections"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>

</div>
</publish-container>
</div>
Expand DownExpand Up@@ -307,7 +306,9 @@ export default {

this.fieldset = data.blueprint;
this.fields = _.chain(this.fieldset.tabs)
.map(tab => tab.fields)
.map(tab => tab.sections)
.flatten(true)
.map(section => section.fields)
.flatten(true)
.value();

Expand Down
38 changes: 23 additions & 15 deletions resources/js/components/blueprints/Builder.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,31 +10,39 @@
</header>

<div class="publish-form card p-0 @container" v-if="showTitle">
<div class="form-group">
<label class="block">{{ __('Title') }}</label>
<small class="help-block">{{ __('messages.blueprints_title_instructions') }}</small>
<div v-if="errors.title">
<small class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Title') }}</label>
<p class="help-block">{{ __('messages.blueprints_title_instructions') }}</p>
<div v-if="errors.title">
<p class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
</div>
</div>
<div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>

<div class="form-group">
<label class="block">{{ __('Hidden') }}</label>
<small class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</small>
<div v-if="errors.hidden">
<small class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Hidden') }}</label>
<p class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</p>
<div v-if="errors.hidden">
<p class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
</div>
</div>
<div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
</div>

<div class="content mt-10 mb-4" v-if="useTabs">
<h2>{{ __('Tabs') }}</h2>
<!--<h2>{{ __('Tabs') }}</h2>
<p class="max-w-lg">{{ __('messages.tabs_instructions') }}</p>
<div v-if="errors.tabs">
<small class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>
<p class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>-->
</div>

<tabs
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/blueprints/Sections.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,10 +20,10 @@
@deleted="deleteSection(i)"
/>

<div class="blueprint-add-section-container w-full md:w-1/2">
<div class="blueprint-add-section-container w-full">
<button class="blueprint-add-section-button outline-none" @click="addSection">
<div class="text-center flex items-center leading-none">
<div class="text-2xl mr-1">+</div>
<svg-icon name="micro-plus" class="h-3 w-3 mr-2" />
<div v-text="addSectionText" />
</div>

Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' [4.x] Blueprint UI by jasonvarga · Pull Request #7706 · statamic/cms · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f53e093
Style them sections
jackmcdade Mar 14, 2023
d247551
wip new tabs
jackmcdade Mar 14, 2023
7a84cce
Get publish tabs working w/ new styles
jackmcdade Mar 15, 2023
cd186d3
Cleanup css and style tab focus-visible state
jackmcdade Mar 15, 2023
cbc63e0
Style Live Preview tabs
jackmcdade Mar 15, 2023
28bcbdb
fix ids and a11y links between tabs and panels
jasonvarga Mar 15, 2023
08e6ce1
bring back class so dragging works again
jasonvarga Mar 15, 2023
440c7cf
full width
jasonvarga Mar 15, 2023
90fd2aa
dont be shy
jasonvarga Mar 15, 2023
018f97f
move tab fields into modal.
jasonvarga Mar 15, 2023
8d4c062
Fix blueprint form tab fade and tweak modal styles slightly
jackmcdade Mar 17, 2023
72ba043
Sticky header for Field Settings
jackmcdade Mar 20, 2023
43d0c94
Field settings can be split into sections
jasonvarga Mar 20, 2023
0a6f985
Split config bard fields into settings as an example
jasonvarga Mar 20, 2023
9ba2bb3
fix
jasonvarga Mar 20, 2023
3921607
write test
jasonvarga Mar 20, 2023
2cc84bf
oops leftover debug
jasonvarga Mar 20, 2023
61cdbb2
wip
jasonvarga Mar 20, 2023
d9aef18
refactor to guard clause
jasonvarga Mar 20, 2023
8048986
avoid map if returning early
jasonvarga Mar 20, 2023
835bed2
New side-by-side layout for config fields
jackmcdade Mar 21, 2023
f128b1e
Prevent list fieldtype from looking derpy when empty
jackmcdade Mar 21, 2023
2e7726d
Fix checkboxes inline-mode
jackmcdade Mar 21, 2023
b575a08
Fix vertical alignment for relationship item icons
jackmcdade Mar 21, 2023
10a2bf2
Improve field settings by grouping into sections and rewriting some h…
jackmcdade Mar 21, 2023
a1e29b5
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
c6992e4
Reorganize Bard configs a little more
jackmcdade Mar 21, 2023
ad29e36
Make sure tabs inside cards fade to white instead of gray
jackmcdade Mar 21, 2023
00b0241
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
65f3be3
fix asset fields not showing up
jasonvarga Mar 21, 2023
6dc7c8f
asset editor uses sections
jasonvarga Mar 21, 2023
15a4fd4
bring back asset editor errors
jasonvarga Mar 21, 2023
116c7ea
fix nav page editor not loading by looking into the section
jasonvarga Mar 21, 2023
3cbbd2a
Don't remove fields if its empty
jasonvarga Mar 21, 2023
b7fcb5d
fix field not moving to new section when dropping over the add sectio…
jasonvarga Mar 21, 2023
895f5a0
Slightly nicer Add Section button
jackmcdade Mar 21, 2023
a4f1d7d
Don't show tab bar at all if you're in single tab mode
jasonvarga Mar 21, 2023
afac0f2
fix grid fields not being draggable
jasonvarga Mar 21, 2023
ac74d8d
fix bard not getting saved because instructions are empty
jasonvarga Mar 21, 2023
091a143
Handle empty tabs state
jackmcdade Mar 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/css/components/blueprints.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@
}

.blueprint-add-section-button {
@apply relative w-full border border-gray-500 border-dashed rounded flex justify-center items-center text-gray-700;
@apply relative w-full border border-gray-500 border-dashed rounded-lg flex justify-center items-center text-gray-700;

&:hover {
@apply border-gray text-gray-950;
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/modal.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,10 @@
MODALS
========================================================================== */

.v--modal {
@apply rounded-lg !important;
}

.v--modal-overlay {
z-index: 10000 !important;
background: hsla(210, 20%, 10%, .15) !important;
Expand Down
10 changes: 0 additions & 10 deletions resources/css/components/preview.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,16 +25,6 @@
z-index: 1;
}

.live-preview .publish-tabs {
@apply bg-gray-300 ml-0 pl-0;
.tab-button {
border-radius: 0;
height: 100%;
min-width: 100px;
border: none;
}
}

.live-preview .tabs-container {
@apply bg-gray-300;
}
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/publish.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,10 @@ code.parent-url {
@apply flex items-center;
}

.publish-section-header {
@apply px-5 pt-4 pb-3 border-b border-gray-400 bg-gray-100 rounded-t-lg;
}

.publish-sidebar {
@apply shrink-0;
margin-left: 20px;
Expand Down
37 changes: 37 additions & 0 deletions resources/css/components/settings.css
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
.config-field {
@apply md:flex border-b border-gray-400 w-full;
@apply p-3 @sm:p-4 m-0;

.field-inner {
@apply w-full md:w-1/2 md:pr-8;
}

.field-inner + div {
@apply w-full md:w-1/2;
}

.help-block {
@apply mb-0;
}

.help-block p:last-child {
@apply mb-0 !important;
}
}

.card .publish-fields .config-field:last-child {
@apply border-b-0;
}

.config-field.full-width-setting {
@apply md:flex-col;
.field-inner {
@apply w-full;
}
.field-inner + div {
@apply w-full;
}
.help-block p:last-child {
@apply mb-4 !important;
}
}
68 changes: 16 additions & 52 deletions resources/css/components/tabs.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,13 +2,8 @@
TABS
========================================================================== */


.tabs-container {
@apply relative mb-5;

&.offset-for-sidebar {
width: calc(100% - 320px);
}
@apply w-full border-b text-md relative flex;

.fade-left, .fade-right {
@apply absolute w-4 inset-y-0 from-gray-300 pointer-events-none z-10;
Expand All@@ -23,49 +18,29 @@
}
}

.tabs {
@apply flex items-end overflow-hidden px-2 -ml-2;
height: 48px;
.card .tabs-container .fade-left, .card .tabs-container .fade-right {
@apply from-white;
}

.tabs {
@apply flex space-x-2 overflow-hidden relative w-full max-w-full;
&-scrolled {
@apply pl-0 ml-0;
}
}

.tab-button {
@apply whitespace-nowrap bg-gray-100 py-1 px-4 shrink-0 leading-tight text-xs w-auto relative flex items-center justify-center rounded-t-md shadow border-b border-gray-300 select-none;
height: 94%;
min-height: 94%;
}

.tab-button:hover {
@apply bg-white;
}
.tab-button:active {
@apply bg-white text-blue;
}

.tab-button:focus {
@apply bg-white text-blue border-b-0 ring-1 ring-inset;
}

.tab-button.active {
@apply bg-white text-blue border-t-2 border-blue relative h-full min-h-full border-b-0 outline-none;
z-index: 1;
.tab-button {
@apply flex items-center px-2 py-2 text-gray-700 select-none border-b-2 border-transparent whitespace-nowrap shrink-0;
&:hover {
@apply text-gray-800;
}

.tab-button:focus {
@apply border-t;
&:focus-visible {
@apply ring-inset ring-2 ring-blue-500 outline-none rounded-t;
}

.tab-button.ghost {
@apply bg-transparent relative h-full min-h-full shadow-none border-none text-gray-500 px-6;
min-width: 0;
&:hover {
@apply text-blue;
}
&.active {
@apply text-blue-500 border-blue-500;
}

.tab-button.has-error {
&.has-error {
@apply text-red-500;

&.active {
Expand All@@ -75,20 +50,9 @@
}


@screen md {
.tabs .tab-button {
min-width: 120px;
}
}


/* Responsive Wangjangling
========================================================================== */

@screen md {
.tabs .tab-button { @apply text-base; }
}

.pill-tab {
@apply text-gray-700 flex items-center focus:outline-none px-2 py-1 rounded;

Expand Down
1 change: 1 addition & 0 deletions resources/css/cp.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,6 +40,7 @@
@import "components/progress";
@import "components/revisions";
@import "components/roles";
@import "components/settings";
@import "components/shortcuts";
@import "components/sortable";
@import "components/stacks";
Expand Down
3 changes: 3 additions & 0 deletions resources/css/elements/forms.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -162,6 +162,9 @@ input.input-text-minimal:read-only,

.option {
@apply mr-4 mb-3;
&:first-child {
@apply mt-3;
}
}
}

Expand Down
23 changes: 12 additions & 11 deletions resources/js/components/assets/Editor/Editor.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -117,7 +117,7 @@
:blueprint="fieldset"
:values="values"
:meta="meta"

:errors="errors"
@updated="values = { ...$event, focus: values.focus }"
>
<div class="w-full sm:p-4 md:pt-px md:w-1/3 md:grow h-1/2 md:h-full overflow-scroll" slot-scope="{ setFieldValue, setFieldMeta }">
Expand All@@ -126,15 +126,14 @@
<loading-graphic text="Saving" />
</div>

<div class="card p-0">
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />
<publish-fields
:fields="fields"
:read-only="readOnly"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>
</div>
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />

<publish-sections
:sections="fieldset.tabs[0].sections"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>

</div>
</publish-container>
</div>
Expand DownExpand Up@@ -307,7 +306,9 @@ export default {

this.fieldset = data.blueprint;
this.fields = _.chain(this.fieldset.tabs)
.map(tab => tab.fields)
.map(tab => tab.sections)
.flatten(true)
.map(section => section.fields)
.flatten(true)
.value();

Expand Down
38 changes: 23 additions & 15 deletions resources/js/components/blueprints/Builder.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,31 +10,39 @@
</header>

<div class="publish-form card p-0 @container" v-if="showTitle">
<div class="form-group">
<label class="block">{{ __('Title') }}</label>
<small class="help-block">{{ __('messages.blueprints_title_instructions') }}</small>
<div v-if="errors.title">
<small class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Title') }}</label>
<p class="help-block">{{ __('messages.blueprints_title_instructions') }}</p>
<div v-if="errors.title">
<p class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
</div>
</div>
<div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>

<div class="form-group">
<label class="block">{{ __('Hidden') }}</label>
<small class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</small>
<div v-if="errors.hidden">
<small class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Hidden') }}</label>
<p class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</p>
<div v-if="errors.hidden">
<p class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
</div>
</div>
<div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
</div>

<div class="content mt-10 mb-4" v-if="useTabs">
<h2>{{ __('Tabs') }}</h2>
<!--<h2>{{ __('Tabs') }}</h2>
<p class="max-w-lg">{{ __('messages.tabs_instructions') }}</p>
<div v-if="errors.tabs">
<small class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>
<p class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>-->
</div>

<tabs
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/blueprints/Sections.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,10 +20,10 @@
@deleted="deleteSection(i)"
/>

<div class="blueprint-add-section-container w-full md:w-1/2">
<div class="blueprint-add-section-container w-full">
<button class="blueprint-add-section-button outline-none" @click="addSection">
<div class="text-center flex items-center leading-none">
<div class="text-2xl mr-1">+</div>
<svg-icon name="micro-plus" class="h-3 w-3 mr-2" />
<div v-text="addSectionText" />
</div>

Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' [4.x] Blueprint UI by jasonvarga · Pull Request #7706 · statamic/cms · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f53e093
Style them sections
jackmcdade Mar 14, 2023
d247551
wip new tabs
jackmcdade Mar 14, 2023
7a84cce
Get publish tabs working w/ new styles
jackmcdade Mar 15, 2023
cd186d3
Cleanup css and style tab focus-visible state
jackmcdade Mar 15, 2023
cbc63e0
Style Live Preview tabs
jackmcdade Mar 15, 2023
28bcbdb
fix ids and a11y links between tabs and panels
jasonvarga Mar 15, 2023
08e6ce1
bring back class so dragging works again
jasonvarga Mar 15, 2023
440c7cf
full width
jasonvarga Mar 15, 2023
90fd2aa
dont be shy
jasonvarga Mar 15, 2023
018f97f
move tab fields into modal.
jasonvarga Mar 15, 2023
8d4c062
Fix blueprint form tab fade and tweak modal styles slightly
jackmcdade Mar 17, 2023
72ba043
Sticky header for Field Settings
jackmcdade Mar 20, 2023
43d0c94
Field settings can be split into sections
jasonvarga Mar 20, 2023
0a6f985
Split config bard fields into settings as an example
jasonvarga Mar 20, 2023
9ba2bb3
fix
jasonvarga Mar 20, 2023
3921607
write test
jasonvarga Mar 20, 2023
2cc84bf
oops leftover debug
jasonvarga Mar 20, 2023
61cdbb2
wip
jasonvarga Mar 20, 2023
d9aef18
refactor to guard clause
jasonvarga Mar 20, 2023
8048986
avoid map if returning early
jasonvarga Mar 20, 2023
835bed2
New side-by-side layout for config fields
jackmcdade Mar 21, 2023
f128b1e
Prevent list fieldtype from looking derpy when empty
jackmcdade Mar 21, 2023
2e7726d
Fix checkboxes inline-mode
jackmcdade Mar 21, 2023
b575a08
Fix vertical alignment for relationship item icons
jackmcdade Mar 21, 2023
10a2bf2
Improve field settings by grouping into sections and rewriting some h…
jackmcdade Mar 21, 2023
a1e29b5
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
c6992e4
Reorganize Bard configs a little more
jackmcdade Mar 21, 2023
ad29e36
Make sure tabs inside cards fade to white instead of gray
jackmcdade Mar 21, 2023
00b0241
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
65f3be3
fix asset fields not showing up
jasonvarga Mar 21, 2023
6dc7c8f
asset editor uses sections
jasonvarga Mar 21, 2023
15a4fd4
bring back asset editor errors
jasonvarga Mar 21, 2023
116c7ea
fix nav page editor not loading by looking into the section
jasonvarga Mar 21, 2023
3cbbd2a
Don't remove fields if its empty
jasonvarga Mar 21, 2023
b7fcb5d
fix field not moving to new section when dropping over the add sectio…
jasonvarga Mar 21, 2023
895f5a0
Slightly nicer Add Section button
jackmcdade Mar 21, 2023
a4f1d7d
Don't show tab bar at all if you're in single tab mode
jasonvarga Mar 21, 2023
afac0f2
fix grid fields not being draggable
jasonvarga Mar 21, 2023
ac74d8d
fix bard not getting saved because instructions are empty
jasonvarga Mar 21, 2023
091a143
Handle empty tabs state
jackmcdade Mar 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/css/components/blueprints.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@
}

.blueprint-add-section-button {
@apply relative w-full border border-gray-500 border-dashed rounded flex justify-center items-center text-gray-700;
@apply relative w-full border border-gray-500 border-dashed rounded-lg flex justify-center items-center text-gray-700;

&:hover {
@apply border-gray text-gray-950;
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/modal.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,10 @@
MODALS
========================================================================== */

.v--modal {
@apply rounded-lg !important;
}

.v--modal-overlay {
z-index: 10000 !important;
background: hsla(210, 20%, 10%, .15) !important;
Expand Down
10 changes: 0 additions & 10 deletions resources/css/components/preview.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,16 +25,6 @@
z-index: 1;
}

.live-preview .publish-tabs {
@apply bg-gray-300 ml-0 pl-0;
.tab-button {
border-radius: 0;
height: 100%;
min-width: 100px;
border: none;
}
}

.live-preview .tabs-container {
@apply bg-gray-300;
}
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/publish.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,10 @@ code.parent-url {
@apply flex items-center;
}

.publish-section-header {
@apply px-5 pt-4 pb-3 border-b border-gray-400 bg-gray-100 rounded-t-lg;
}

.publish-sidebar {
@apply shrink-0;
margin-left: 20px;
Expand Down
37 changes: 37 additions & 0 deletions resources/css/components/settings.css
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
.config-field {
@apply md:flex border-b border-gray-400 w-full;
@apply p-3 @sm:p-4 m-0;

.field-inner {
@apply w-full md:w-1/2 md:pr-8;
}

.field-inner + div {
@apply w-full md:w-1/2;
}

.help-block {
@apply mb-0;
}

.help-block p:last-child {
@apply mb-0 !important;
}
}

.card .publish-fields .config-field:last-child {
@apply border-b-0;
}

.config-field.full-width-setting {
@apply md:flex-col;
.field-inner {
@apply w-full;
}
.field-inner + div {
@apply w-full;
}
.help-block p:last-child {
@apply mb-4 !important;
}
}
68 changes: 16 additions & 52 deletions resources/css/components/tabs.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,13 +2,8 @@
TABS
========================================================================== */


.tabs-container {
@apply relative mb-5;

&.offset-for-sidebar {
width: calc(100% - 320px);
}
@apply w-full border-b text-md relative flex;

.fade-left, .fade-right {
@apply absolute w-4 inset-y-0 from-gray-300 pointer-events-none z-10;
Expand All@@ -23,49 +18,29 @@
}
}

.tabs {
@apply flex items-end overflow-hidden px-2 -ml-2;
height: 48px;
.card .tabs-container .fade-left, .card .tabs-container .fade-right {
@apply from-white;
}

.tabs {
@apply flex space-x-2 overflow-hidden relative w-full max-w-full;
&-scrolled {
@apply pl-0 ml-0;
}
}

.tab-button {
@apply whitespace-nowrap bg-gray-100 py-1 px-4 shrink-0 leading-tight text-xs w-auto relative flex items-center justify-center rounded-t-md shadow border-b border-gray-300 select-none;
height: 94%;
min-height: 94%;
}

.tab-button:hover {
@apply bg-white;
}
.tab-button:active {
@apply bg-white text-blue;
}

.tab-button:focus {
@apply bg-white text-blue border-b-0 ring-1 ring-inset;
}

.tab-button.active {
@apply bg-white text-blue border-t-2 border-blue relative h-full min-h-full border-b-0 outline-none;
z-index: 1;
.tab-button {
@apply flex items-center px-2 py-2 text-gray-700 select-none border-b-2 border-transparent whitespace-nowrap shrink-0;
&:hover {
@apply text-gray-800;
}

.tab-button:focus {
@apply border-t;
&:focus-visible {
@apply ring-inset ring-2 ring-blue-500 outline-none rounded-t;
}

.tab-button.ghost {
@apply bg-transparent relative h-full min-h-full shadow-none border-none text-gray-500 px-6;
min-width: 0;
&:hover {
@apply text-blue;
}
&.active {
@apply text-blue-500 border-blue-500;
}

.tab-button.has-error {
&.has-error {
@apply text-red-500;

&.active {
Expand All@@ -75,20 +50,9 @@
}


@screen md {
.tabs .tab-button {
min-width: 120px;
}
}


/* Responsive Wangjangling
========================================================================== */

@screen md {
.tabs .tab-button { @apply text-base; }
}

.pill-tab {
@apply text-gray-700 flex items-center focus:outline-none px-2 py-1 rounded;

Expand Down
1 change: 1 addition & 0 deletions resources/css/cp.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,6 +40,7 @@
@import "components/progress";
@import "components/revisions";
@import "components/roles";
@import "components/settings";
@import "components/shortcuts";
@import "components/sortable";
@import "components/stacks";
Expand Down
3 changes: 3 additions & 0 deletions resources/css/elements/forms.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -162,6 +162,9 @@ input.input-text-minimal:read-only,

.option {
@apply mr-4 mb-3;
&:first-child {
@apply mt-3;
}
}
}

Expand Down
23 changes: 12 additions & 11 deletions resources/js/components/assets/Editor/Editor.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -117,7 +117,7 @@
:blueprint="fieldset"
:values="values"
:meta="meta"

:errors="errors"
@updated="values = { ...$event, focus: values.focus }"
>
<div class="w-full sm:p-4 md:pt-px md:w-1/3 md:grow h-1/2 md:h-full overflow-scroll" slot-scope="{ setFieldValue, setFieldMeta }">
Expand All@@ -126,15 +126,14 @@
<loading-graphic text="Saving" />
</div>

<div class="card p-0">
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />
<publish-fields
:fields="fields"
:read-only="readOnly"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>
</div>
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />

<publish-sections
:sections="fieldset.tabs[0].sections"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>

</div>
</publish-container>
</div>
Expand DownExpand Up@@ -307,7 +306,9 @@ export default {

this.fieldset = data.blueprint;
this.fields = _.chain(this.fieldset.tabs)
.map(tab => tab.fields)
.map(tab => tab.sections)
.flatten(true)
.map(section => section.fields)
.flatten(true)
.value();

Expand Down
38 changes: 23 additions & 15 deletions resources/js/components/blueprints/Builder.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,31 +10,39 @@
</header>

<div class="publish-form card p-0 @container" v-if="showTitle">
<div class="form-group">
<label class="block">{{ __('Title') }}</label>
<small class="help-block">{{ __('messages.blueprints_title_instructions') }}</small>
<div v-if="errors.title">
<small class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Title') }}</label>
<p class="help-block">{{ __('messages.blueprints_title_instructions') }}</p>
<div v-if="errors.title">
<p class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
</div>
</div>
<div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>

<div class="form-group">
<label class="block">{{ __('Hidden') }}</label>
<small class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</small>
<div v-if="errors.hidden">
<small class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Hidden') }}</label>
<p class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</p>
<div v-if="errors.hidden">
<p class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
</div>
</div>
<div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
</div>

<div class="content mt-10 mb-4" v-if="useTabs">
<h2>{{ __('Tabs') }}</h2>
<!--<h2>{{ __('Tabs') }}</h2>
<p class="max-w-lg">{{ __('messages.tabs_instructions') }}</p>
<div v-if="errors.tabs">
<small class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>
<p class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>-->
</div>

<tabs
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/blueprints/Sections.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,10 +20,10 @@
@deleted="deleteSection(i)"
/>

<div class="blueprint-add-section-container w-full md:w-1/2">
<div class="blueprint-add-section-container w-full">
<button class="blueprint-add-section-button outline-none" @click="addSection">
<div class="text-center flex items-center leading-none">
<div class="text-2xl mr-1">+</div>
<svg-icon name="micro-plus" class="h-3 w-3 mr-2" />
<div v-text="addSectionText" />
</div>

Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' [4.x] Blueprint UI by jasonvarga · Pull Request #7706 · statamic/cms · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f53e093
Style them sections
jackmcdade Mar 14, 2023
d247551
wip new tabs
jackmcdade Mar 14, 2023
7a84cce
Get publish tabs working w/ new styles
jackmcdade Mar 15, 2023
cd186d3
Cleanup css and style tab focus-visible state
jackmcdade Mar 15, 2023
cbc63e0
Style Live Preview tabs
jackmcdade Mar 15, 2023
28bcbdb
fix ids and a11y links between tabs and panels
jasonvarga Mar 15, 2023
08e6ce1
bring back class so dragging works again
jasonvarga Mar 15, 2023
440c7cf
full width
jasonvarga Mar 15, 2023
90fd2aa
dont be shy
jasonvarga Mar 15, 2023
018f97f
move tab fields into modal.
jasonvarga Mar 15, 2023
8d4c062
Fix blueprint form tab fade and tweak modal styles slightly
jackmcdade Mar 17, 2023
72ba043
Sticky header for Field Settings
jackmcdade Mar 20, 2023
43d0c94
Field settings can be split into sections
jasonvarga Mar 20, 2023
0a6f985
Split config bard fields into settings as an example
jasonvarga Mar 20, 2023
9ba2bb3
fix
jasonvarga Mar 20, 2023
3921607
write test
jasonvarga Mar 20, 2023
2cc84bf
oops leftover debug
jasonvarga Mar 20, 2023
61cdbb2
wip
jasonvarga Mar 20, 2023
d9aef18
refactor to guard clause
jasonvarga Mar 20, 2023
8048986
avoid map if returning early
jasonvarga Mar 20, 2023
835bed2
New side-by-side layout for config fields
jackmcdade Mar 21, 2023
f128b1e
Prevent list fieldtype from looking derpy when empty
jackmcdade Mar 21, 2023
2e7726d
Fix checkboxes inline-mode
jackmcdade Mar 21, 2023
b575a08
Fix vertical alignment for relationship item icons
jackmcdade Mar 21, 2023
10a2bf2
Improve field settings by grouping into sections and rewriting some h…
jackmcdade Mar 21, 2023
a1e29b5
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
c6992e4
Reorganize Bard configs a little more
jackmcdade Mar 21, 2023
ad29e36
Make sure tabs inside cards fade to white instead of gray
jackmcdade Mar 21, 2023
00b0241
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
65f3be3
fix asset fields not showing up
jasonvarga Mar 21, 2023
6dc7c8f
asset editor uses sections
jasonvarga Mar 21, 2023
15a4fd4
bring back asset editor errors
jasonvarga Mar 21, 2023
116c7ea
fix nav page editor not loading by looking into the section
jasonvarga Mar 21, 2023
3cbbd2a
Don't remove fields if its empty
jasonvarga Mar 21, 2023
b7fcb5d
fix field not moving to new section when dropping over the add sectio…
jasonvarga Mar 21, 2023
895f5a0
Slightly nicer Add Section button
jackmcdade Mar 21, 2023
a4f1d7d
Don't show tab bar at all if you're in single tab mode
jasonvarga Mar 21, 2023
afac0f2
fix grid fields not being draggable
jasonvarga Mar 21, 2023
ac74d8d
fix bard not getting saved because instructions are empty
jasonvarga Mar 21, 2023
091a143
Handle empty tabs state
jackmcdade Mar 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/css/components/blueprints.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@
}

.blueprint-add-section-button {
@apply relative w-full border border-gray-500 border-dashed rounded flex justify-center items-center text-gray-700;
@apply relative w-full border border-gray-500 border-dashed rounded-lg flex justify-center items-center text-gray-700;

&:hover {
@apply border-gray text-gray-950;
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/modal.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,10 @@
MODALS
========================================================================== */

.v--modal {
@apply rounded-lg !important;
}

.v--modal-overlay {
z-index: 10000 !important;
background: hsla(210, 20%, 10%, .15) !important;
Expand Down
10 changes: 0 additions & 10 deletions resources/css/components/preview.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,16 +25,6 @@
z-index: 1;
}

.live-preview .publish-tabs {
@apply bg-gray-300 ml-0 pl-0;
.tab-button {
border-radius: 0;
height: 100%;
min-width: 100px;
border: none;
}
}

.live-preview .tabs-container {
@apply bg-gray-300;
}
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/publish.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,10 @@ code.parent-url {
@apply flex items-center;
}

.publish-section-header {
@apply px-5 pt-4 pb-3 border-b border-gray-400 bg-gray-100 rounded-t-lg;
}

.publish-sidebar {
@apply shrink-0;
margin-left: 20px;
Expand Down
37 changes: 37 additions & 0 deletions resources/css/components/settings.css
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
.config-field {
@apply md:flex border-b border-gray-400 w-full;
@apply p-3 @sm:p-4 m-0;

.field-inner {
@apply w-full md:w-1/2 md:pr-8;
}

.field-inner + div {
@apply w-full md:w-1/2;
}

.help-block {
@apply mb-0;
}

.help-block p:last-child {
@apply mb-0 !important;
}
}

.card .publish-fields .config-field:last-child {
@apply border-b-0;
}

.config-field.full-width-setting {
@apply md:flex-col;
.field-inner {
@apply w-full;
}
.field-inner + div {
@apply w-full;
}
.help-block p:last-child {
@apply mb-4 !important;
}
}
68 changes: 16 additions & 52 deletions resources/css/components/tabs.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,13 +2,8 @@
TABS
========================================================================== */


.tabs-container {
@apply relative mb-5;

&.offset-for-sidebar {
width: calc(100% - 320px);
}
@apply w-full border-b text-md relative flex;

.fade-left, .fade-right {
@apply absolute w-4 inset-y-0 from-gray-300 pointer-events-none z-10;
Expand All@@ -23,49 +18,29 @@
}
}

.tabs {
@apply flex items-end overflow-hidden px-2 -ml-2;
height: 48px;
.card .tabs-container .fade-left, .card .tabs-container .fade-right {
@apply from-white;
}

.tabs {
@apply flex space-x-2 overflow-hidden relative w-full max-w-full;
&-scrolled {
@apply pl-0 ml-0;
}
}

.tab-button {
@apply whitespace-nowrap bg-gray-100 py-1 px-4 shrink-0 leading-tight text-xs w-auto relative flex items-center justify-center rounded-t-md shadow border-b border-gray-300 select-none;
height: 94%;
min-height: 94%;
}

.tab-button:hover {
@apply bg-white;
}
.tab-button:active {
@apply bg-white text-blue;
}

.tab-button:focus {
@apply bg-white text-blue border-b-0 ring-1 ring-inset;
}

.tab-button.active {
@apply bg-white text-blue border-t-2 border-blue relative h-full min-h-full border-b-0 outline-none;
z-index: 1;
.tab-button {
@apply flex items-center px-2 py-2 text-gray-700 select-none border-b-2 border-transparent whitespace-nowrap shrink-0;
&:hover {
@apply text-gray-800;
}

.tab-button:focus {
@apply border-t;
&:focus-visible {
@apply ring-inset ring-2 ring-blue-500 outline-none rounded-t;
}

.tab-button.ghost {
@apply bg-transparent relative h-full min-h-full shadow-none border-none text-gray-500 px-6;
min-width: 0;
&:hover {
@apply text-blue;
}
&.active {
@apply text-blue-500 border-blue-500;
}

.tab-button.has-error {
&.has-error {
@apply text-red-500;

&.active {
Expand All@@ -75,20 +50,9 @@
}


@screen md {
.tabs .tab-button {
min-width: 120px;
}
}


/* Responsive Wangjangling
========================================================================== */

@screen md {
.tabs .tab-button { @apply text-base; }
}

.pill-tab {
@apply text-gray-700 flex items-center focus:outline-none px-2 py-1 rounded;

Expand Down
1 change: 1 addition & 0 deletions resources/css/cp.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,6 +40,7 @@
@import "components/progress";
@import "components/revisions";
@import "components/roles";
@import "components/settings";
@import "components/shortcuts";
@import "components/sortable";
@import "components/stacks";
Expand Down
3 changes: 3 additions & 0 deletions resources/css/elements/forms.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -162,6 +162,9 @@ input.input-text-minimal:read-only,

.option {
@apply mr-4 mb-3;
&:first-child {
@apply mt-3;
}
}
}

Expand Down
23 changes: 12 additions & 11 deletions resources/js/components/assets/Editor/Editor.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -117,7 +117,7 @@
:blueprint="fieldset"
:values="values"
:meta="meta"

:errors="errors"
@updated="values = { ...$event, focus: values.focus }"
>
<div class="w-full sm:p-4 md:pt-px md:w-1/3 md:grow h-1/2 md:h-full overflow-scroll" slot-scope="{ setFieldValue, setFieldMeta }">
Expand All@@ -126,15 +126,14 @@
<loading-graphic text="Saving" />
</div>

<div class="card p-0">
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />
<publish-fields
:fields="fields"
:read-only="readOnly"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>
</div>
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />

<publish-sections
:sections="fieldset.tabs[0].sections"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>

</div>
</publish-container>
</div>
Expand DownExpand Up@@ -307,7 +306,9 @@ export default {

this.fieldset = data.blueprint;
this.fields = _.chain(this.fieldset.tabs)
.map(tab => tab.fields)
.map(tab => tab.sections)
.flatten(true)
.map(section => section.fields)
.flatten(true)
.value();

Expand Down
38 changes: 23 additions & 15 deletions resources/js/components/blueprints/Builder.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,31 +10,39 @@
</header>

<div class="publish-form card p-0 @container" v-if="showTitle">
<div class="form-group">
<label class="block">{{ __('Title') }}</label>
<small class="help-block">{{ __('messages.blueprints_title_instructions') }}</small>
<div v-if="errors.title">
<small class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Title') }}</label>
<p class="help-block">{{ __('messages.blueprints_title_instructions') }}</p>
<div v-if="errors.title">
<p class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
</div>
</div>
<div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>

<div class="form-group">
<label class="block">{{ __('Hidden') }}</label>
<small class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</small>
<div v-if="errors.hidden">
<small class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Hidden') }}</label>
<p class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</p>
<div v-if="errors.hidden">
<p class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
</div>
</div>
<div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
</div>

<div class="content mt-10 mb-4" v-if="useTabs">
<h2>{{ __('Tabs') }}</h2>
<!--<h2>{{ __('Tabs') }}</h2>
<p class="max-w-lg">{{ __('messages.tabs_instructions') }}</p>
<div v-if="errors.tabs">
<small class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>
<p class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>-->
</div>

<tabs
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/blueprints/Sections.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,10 +20,10 @@
@deleted="deleteSection(i)"
/>

<div class="blueprint-add-section-container w-full md:w-1/2">
<div class="blueprint-add-section-container w-full">
<button class="blueprint-add-section-button outline-none" @click="addSection">
<div class="text-center flex items-center leading-none">
<div class="text-2xl mr-1">+</div>
<svg-icon name="micro-plus" class="h-3 w-3 mr-2" />
<div v-text="addSectionText" />
</div>

Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' [4.x] Blueprint UI by jasonvarga · Pull Request #7706 · statamic/cms · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f53e093
Style them sections
jackmcdade Mar 14, 2023
d247551
wip new tabs
jackmcdade Mar 14, 2023
7a84cce
Get publish tabs working w/ new styles
jackmcdade Mar 15, 2023
cd186d3
Cleanup css and style tab focus-visible state
jackmcdade Mar 15, 2023
cbc63e0
Style Live Preview tabs
jackmcdade Mar 15, 2023
28bcbdb
fix ids and a11y links between tabs and panels
jasonvarga Mar 15, 2023
08e6ce1
bring back class so dragging works again
jasonvarga Mar 15, 2023
440c7cf
full width
jasonvarga Mar 15, 2023
90fd2aa
dont be shy
jasonvarga Mar 15, 2023
018f97f
move tab fields into modal.
jasonvarga Mar 15, 2023
8d4c062
Fix blueprint form tab fade and tweak modal styles slightly
jackmcdade Mar 17, 2023
72ba043
Sticky header for Field Settings
jackmcdade Mar 20, 2023
43d0c94
Field settings can be split into sections
jasonvarga Mar 20, 2023
0a6f985
Split config bard fields into settings as an example
jasonvarga Mar 20, 2023
9ba2bb3
fix
jasonvarga Mar 20, 2023
3921607
write test
jasonvarga Mar 20, 2023
2cc84bf
oops leftover debug
jasonvarga Mar 20, 2023
61cdbb2
wip
jasonvarga Mar 20, 2023
d9aef18
refactor to guard clause
jasonvarga Mar 20, 2023
8048986
avoid map if returning early
jasonvarga Mar 20, 2023
835bed2
New side-by-side layout for config fields
jackmcdade Mar 21, 2023
f128b1e
Prevent list fieldtype from looking derpy when empty
jackmcdade Mar 21, 2023
2e7726d
Fix checkboxes inline-mode
jackmcdade Mar 21, 2023
b575a08
Fix vertical alignment for relationship item icons
jackmcdade Mar 21, 2023
10a2bf2
Improve field settings by grouping into sections and rewriting some h…
jackmcdade Mar 21, 2023
a1e29b5
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
c6992e4
Reorganize Bard configs a little more
jackmcdade Mar 21, 2023
ad29e36
Make sure tabs inside cards fade to white instead of gray
jackmcdade Mar 21, 2023
00b0241
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
65f3be3
fix asset fields not showing up
jasonvarga Mar 21, 2023
6dc7c8f
asset editor uses sections
jasonvarga Mar 21, 2023
15a4fd4
bring back asset editor errors
jasonvarga Mar 21, 2023
116c7ea
fix nav page editor not loading by looking into the section
jasonvarga Mar 21, 2023
3cbbd2a
Don't remove fields if its empty
jasonvarga Mar 21, 2023
b7fcb5d
fix field not moving to new section when dropping over the add sectio…
jasonvarga Mar 21, 2023
895f5a0
Slightly nicer Add Section button
jackmcdade Mar 21, 2023
a4f1d7d
Don't show tab bar at all if you're in single tab mode
jasonvarga Mar 21, 2023
afac0f2
fix grid fields not being draggable
jasonvarga Mar 21, 2023
ac74d8d
fix bard not getting saved because instructions are empty
jasonvarga Mar 21, 2023
091a143
Handle empty tabs state
jackmcdade Mar 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/css/components/blueprints.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@
}

.blueprint-add-section-button {
@apply relative w-full border border-gray-500 border-dashed rounded flex justify-center items-center text-gray-700;
@apply relative w-full border border-gray-500 border-dashed rounded-lg flex justify-center items-center text-gray-700;

&:hover {
@apply border-gray text-gray-950;
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/modal.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,10 @@
MODALS
========================================================================== */

.v--modal {
@apply rounded-lg !important;
}

.v--modal-overlay {
z-index: 10000 !important;
background: hsla(210, 20%, 10%, .15) !important;
Expand Down
10 changes: 0 additions & 10 deletions resources/css/components/preview.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,16 +25,6 @@
z-index: 1;
}

.live-preview .publish-tabs {
@apply bg-gray-300 ml-0 pl-0;
.tab-button {
border-radius: 0;
height: 100%;
min-width: 100px;
border: none;
}
}

.live-preview .tabs-container {
@apply bg-gray-300;
}
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/publish.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,10 @@ code.parent-url {
@apply flex items-center;
}

.publish-section-header {
@apply px-5 pt-4 pb-3 border-b border-gray-400 bg-gray-100 rounded-t-lg;
}

.publish-sidebar {
@apply shrink-0;
margin-left: 20px;
Expand Down
37 changes: 37 additions & 0 deletions resources/css/components/settings.css
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
.config-field {
@apply md:flex border-b border-gray-400 w-full;
@apply p-3 @sm:p-4 m-0;

.field-inner {
@apply w-full md:w-1/2 md:pr-8;
}

.field-inner + div {
@apply w-full md:w-1/2;
}

.help-block {
@apply mb-0;
}

.help-block p:last-child {
@apply mb-0 !important;
}
}

.card .publish-fields .config-field:last-child {
@apply border-b-0;
}

.config-field.full-width-setting {
@apply md:flex-col;
.field-inner {
@apply w-full;
}
.field-inner + div {
@apply w-full;
}
.help-block p:last-child {
@apply mb-4 !important;
}
}
68 changes: 16 additions & 52 deletions resources/css/components/tabs.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,13 +2,8 @@
TABS
========================================================================== */


.tabs-container {
@apply relative mb-5;

&.offset-for-sidebar {
width: calc(100% - 320px);
}
@apply w-full border-b text-md relative flex;

.fade-left, .fade-right {
@apply absolute w-4 inset-y-0 from-gray-300 pointer-events-none z-10;
Expand All@@ -23,49 +18,29 @@
}
}

.tabs {
@apply flex items-end overflow-hidden px-2 -ml-2;
height: 48px;
.card .tabs-container .fade-left, .card .tabs-container .fade-right {
@apply from-white;
}

.tabs {
@apply flex space-x-2 overflow-hidden relative w-full max-w-full;
&-scrolled {
@apply pl-0 ml-0;
}
}

.tab-button {
@apply whitespace-nowrap bg-gray-100 py-1 px-4 shrink-0 leading-tight text-xs w-auto relative flex items-center justify-center rounded-t-md shadow border-b border-gray-300 select-none;
height: 94%;
min-height: 94%;
}

.tab-button:hover {
@apply bg-white;
}
.tab-button:active {
@apply bg-white text-blue;
}

.tab-button:focus {
@apply bg-white text-blue border-b-0 ring-1 ring-inset;
}

.tab-button.active {
@apply bg-white text-blue border-t-2 border-blue relative h-full min-h-full border-b-0 outline-none;
z-index: 1;
.tab-button {
@apply flex items-center px-2 py-2 text-gray-700 select-none border-b-2 border-transparent whitespace-nowrap shrink-0;
&:hover {
@apply text-gray-800;
}

.tab-button:focus {
@apply border-t;
&:focus-visible {
@apply ring-inset ring-2 ring-blue-500 outline-none rounded-t;
}

.tab-button.ghost {
@apply bg-transparent relative h-full min-h-full shadow-none border-none text-gray-500 px-6;
min-width: 0;
&:hover {
@apply text-blue;
}
&.active {
@apply text-blue-500 border-blue-500;
}

.tab-button.has-error {
&.has-error {
@apply text-red-500;

&.active {
Expand All@@ -75,20 +50,9 @@
}


@screen md {
.tabs .tab-button {
min-width: 120px;
}
}


/* Responsive Wangjangling
========================================================================== */

@screen md {
.tabs .tab-button { @apply text-base; }
}

.pill-tab {
@apply text-gray-700 flex items-center focus:outline-none px-2 py-1 rounded;

Expand Down
1 change: 1 addition & 0 deletions resources/css/cp.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,6 +40,7 @@
@import "components/progress";
@import "components/revisions";
@import "components/roles";
@import "components/settings";
@import "components/shortcuts";
@import "components/sortable";
@import "components/stacks";
Expand Down
3 changes: 3 additions & 0 deletions resources/css/elements/forms.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -162,6 +162,9 @@ input.input-text-minimal:read-only,

.option {
@apply mr-4 mb-3;
&:first-child {
@apply mt-3;
}
}
}

Expand Down
23 changes: 12 additions & 11 deletions resources/js/components/assets/Editor/Editor.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -117,7 +117,7 @@
:blueprint="fieldset"
:values="values"
:meta="meta"

:errors="errors"
@updated="values = { ...$event, focus: values.focus }"
>
<div class="w-full sm:p-4 md:pt-px md:w-1/3 md:grow h-1/2 md:h-full overflow-scroll" slot-scope="{ setFieldValue, setFieldMeta }">
Expand All@@ -126,15 +126,14 @@
<loading-graphic text="Saving" />
</div>

<div class="card p-0">
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />
<publish-fields
:fields="fields"
:read-only="readOnly"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>
</div>
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />

<publish-sections
:sections="fieldset.tabs[0].sections"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>

</div>
</publish-container>
</div>
Expand DownExpand Up@@ -307,7 +306,9 @@ export default {

this.fieldset = data.blueprint;
this.fields = _.chain(this.fieldset.tabs)
.map(tab => tab.fields)
.map(tab => tab.sections)
.flatten(true)
.map(section => section.fields)
.flatten(true)
.value();

Expand Down
38 changes: 23 additions & 15 deletions resources/js/components/blueprints/Builder.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,31 +10,39 @@
</header>

<div class="publish-form card p-0 @container" v-if="showTitle">
<div class="form-group">
<label class="block">{{ __('Title') }}</label>
<small class="help-block">{{ __('messages.blueprints_title_instructions') }}</small>
<div v-if="errors.title">
<small class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Title') }}</label>
<p class="help-block">{{ __('messages.blueprints_title_instructions') }}</p>
<div v-if="errors.title">
<p class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
</div>
</div>
<div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>

<div class="form-group">
<label class="block">{{ __('Hidden') }}</label>
<small class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</small>
<div v-if="errors.hidden">
<small class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Hidden') }}</label>
<p class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</p>
<div v-if="errors.hidden">
<p class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
</div>
</div>
<div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
</div>

<div class="content mt-10 mb-4" v-if="useTabs">
<h2>{{ __('Tabs') }}</h2>
<!--<h2>{{ __('Tabs') }}</h2>
<p class="max-w-lg">{{ __('messages.tabs_instructions') }}</p>
<div v-if="errors.tabs">
<small class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>
<p class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>-->
</div>

<tabs
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/blueprints/Sections.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,10 +20,10 @@
@deleted="deleteSection(i)"
/>

<div class="blueprint-add-section-container w-full md:w-1/2">
<div class="blueprint-add-section-container w-full">
<button class="blueprint-add-section-button outline-none" @click="addSection">
<div class="text-center flex items-center leading-none">
<div class="text-2xl mr-1">+</div>
<svg-icon name="micro-plus" class="h-3 w-3 mr-2" />
<div v-text="addSectionText" />
</div>

Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); [4.x] Blueprint UI by jasonvarga · Pull Request #7706 · statamic/cms · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f53e093
Style them sections
jackmcdade Mar 14, 2023
d247551
wip new tabs
jackmcdade Mar 14, 2023
7a84cce
Get publish tabs working w/ new styles
jackmcdade Mar 15, 2023
cd186d3
Cleanup css and style tab focus-visible state
jackmcdade Mar 15, 2023
cbc63e0
Style Live Preview tabs
jackmcdade Mar 15, 2023
28bcbdb
fix ids and a11y links between tabs and panels
jasonvarga Mar 15, 2023
08e6ce1
bring back class so dragging works again
jasonvarga Mar 15, 2023
440c7cf
full width
jasonvarga Mar 15, 2023
90fd2aa
dont be shy
jasonvarga Mar 15, 2023
018f97f
move tab fields into modal.
jasonvarga Mar 15, 2023
8d4c062
Fix blueprint form tab fade and tweak modal styles slightly
jackmcdade Mar 17, 2023
72ba043
Sticky header for Field Settings
jackmcdade Mar 20, 2023
43d0c94
Field settings can be split into sections
jasonvarga Mar 20, 2023
0a6f985
Split config bard fields into settings as an example
jasonvarga Mar 20, 2023
9ba2bb3
fix
jasonvarga Mar 20, 2023
3921607
write test
jasonvarga Mar 20, 2023
2cc84bf
oops leftover debug
jasonvarga Mar 20, 2023
61cdbb2
wip
jasonvarga Mar 20, 2023
d9aef18
refactor to guard clause
jasonvarga Mar 20, 2023
8048986
avoid map if returning early
jasonvarga Mar 20, 2023
835bed2
New side-by-side layout for config fields
jackmcdade Mar 21, 2023
f128b1e
Prevent list fieldtype from looking derpy when empty
jackmcdade Mar 21, 2023
2e7726d
Fix checkboxes inline-mode
jackmcdade Mar 21, 2023
b575a08
Fix vertical alignment for relationship item icons
jackmcdade Mar 21, 2023
10a2bf2
Improve field settings by grouping into sections and rewriting some h…
jackmcdade Mar 21, 2023
a1e29b5
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
c6992e4
Reorganize Bard configs a little more
jackmcdade Mar 21, 2023
ad29e36
Make sure tabs inside cards fade to white instead of gray
jackmcdade Mar 21, 2023
00b0241
Apply fixes from StyleCI
StyleCIBot Mar 21, 2023
65f3be3
fix asset fields not showing up
jasonvarga Mar 21, 2023
6dc7c8f
asset editor uses sections
jasonvarga Mar 21, 2023
15a4fd4
bring back asset editor errors
jasonvarga Mar 21, 2023
116c7ea
fix nav page editor not loading by looking into the section
jasonvarga Mar 21, 2023
3cbbd2a
Don't remove fields if its empty
jasonvarga Mar 21, 2023
b7fcb5d
fix field not moving to new section when dropping over the add sectio…
jasonvarga Mar 21, 2023
895f5a0
Slightly nicer Add Section button
jackmcdade Mar 21, 2023
a4f1d7d
Don't show tab bar at all if you're in single tab mode
jasonvarga Mar 21, 2023
afac0f2
fix grid fields not being draggable
jasonvarga Mar 21, 2023
ac74d8d
fix bard not getting saved because instructions are empty
jasonvarga Mar 21, 2023
091a143
Handle empty tabs state
jackmcdade Mar 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/css/components/blueprints.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@
}

.blueprint-add-section-button {
@apply relative w-full border border-gray-500 border-dashed rounded flex justify-center items-center text-gray-700;
@apply relative w-full border border-gray-500 border-dashed rounded-lg flex justify-center items-center text-gray-700;

&:hover {
@apply border-gray text-gray-950;
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/modal.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,10 @@
MODALS
========================================================================== */

.v--modal {
@apply rounded-lg !important;
}

.v--modal-overlay {
z-index: 10000 !important;
background: hsla(210, 20%, 10%, .15) !important;
Expand Down
10 changes: 0 additions & 10 deletions resources/css/components/preview.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,16 +25,6 @@
z-index: 1;
}

.live-preview .publish-tabs {
@apply bg-gray-300 ml-0 pl-0;
.tab-button {
border-radius: 0;
height: 100%;
min-width: 100px;
border: none;
}
}

.live-preview .tabs-container {
@apply bg-gray-300;
}
Expand Down
4 changes: 4 additions & 0 deletions resources/css/components/publish.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,10 @@ code.parent-url {
@apply flex items-center;
}

.publish-section-header {
@apply px-5 pt-4 pb-3 border-b border-gray-400 bg-gray-100 rounded-t-lg;
}

.publish-sidebar {
@apply shrink-0;
margin-left: 20px;
Expand Down
37 changes: 37 additions & 0 deletions resources/css/components/settings.css
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
.config-field {
@apply md:flex border-b border-gray-400 w-full;
@apply p-3 @sm:p-4 m-0;

.field-inner {
@apply w-full md:w-1/2 md:pr-8;
}

.field-inner + div {
@apply w-full md:w-1/2;
}

.help-block {
@apply mb-0;
}

.help-block p:last-child {
@apply mb-0 !important;
}
}

.card .publish-fields .config-field:last-child {
@apply border-b-0;
}

.config-field.full-width-setting {
@apply md:flex-col;
.field-inner {
@apply w-full;
}
.field-inner + div {
@apply w-full;
}
.help-block p:last-child {
@apply mb-4 !important;
}
}
68 changes: 16 additions & 52 deletions resources/css/components/tabs.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,13 +2,8 @@
TABS
========================================================================== */


.tabs-container {
@apply relative mb-5;

&.offset-for-sidebar {
width: calc(100% - 320px);
}
@apply w-full border-b text-md relative flex;

.fade-left, .fade-right {
@apply absolute w-4 inset-y-0 from-gray-300 pointer-events-none z-10;
Expand All@@ -23,49 +18,29 @@
}
}

.tabs {
@apply flex items-end overflow-hidden px-2 -ml-2;
height: 48px;
.card .tabs-container .fade-left, .card .tabs-container .fade-right {
@apply from-white;
}

.tabs {
@apply flex space-x-2 overflow-hidden relative w-full max-w-full;
&-scrolled {
@apply pl-0 ml-0;
}
}

.tab-button {
@apply whitespace-nowrap bg-gray-100 py-1 px-4 shrink-0 leading-tight text-xs w-auto relative flex items-center justify-center rounded-t-md shadow border-b border-gray-300 select-none;
height: 94%;
min-height: 94%;
}

.tab-button:hover {
@apply bg-white;
}
.tab-button:active {
@apply bg-white text-blue;
}

.tab-button:focus {
@apply bg-white text-blue border-b-0 ring-1 ring-inset;
}

.tab-button.active {
@apply bg-white text-blue border-t-2 border-blue relative h-full min-h-full border-b-0 outline-none;
z-index: 1;
.tab-button {
@apply flex items-center px-2 py-2 text-gray-700 select-none border-b-2 border-transparent whitespace-nowrap shrink-0;
&:hover {
@apply text-gray-800;
}

.tab-button:focus {
@apply border-t;
&:focus-visible {
@apply ring-inset ring-2 ring-blue-500 outline-none rounded-t;
}

.tab-button.ghost {
@apply bg-transparent relative h-full min-h-full shadow-none border-none text-gray-500 px-6;
min-width: 0;
&:hover {
@apply text-blue;
}
&.active {
@apply text-blue-500 border-blue-500;
}

.tab-button.has-error {
&.has-error {
@apply text-red-500;

&.active {
Expand All@@ -75,20 +50,9 @@
}


@screen md {
.tabs .tab-button {
min-width: 120px;
}
}


/* Responsive Wangjangling
========================================================================== */

@screen md {
.tabs .tab-button { @apply text-base; }
}

.pill-tab {
@apply text-gray-700 flex items-center focus:outline-none px-2 py-1 rounded;

Expand Down
1 change: 1 addition & 0 deletions resources/css/cp.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,6 +40,7 @@
@import "components/progress";
@import "components/revisions";
@import "components/roles";
@import "components/settings";
@import "components/shortcuts";
@import "components/sortable";
@import "components/stacks";
Expand Down
3 changes: 3 additions & 0 deletions resources/css/elements/forms.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -162,6 +162,9 @@ input.input-text-minimal:read-only,

.option {
@apply mr-4 mb-3;
&:first-child {
@apply mt-3;
}
}
}

Expand Down
23 changes: 12 additions & 11 deletions resources/js/components/assets/Editor/Editor.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -117,7 +117,7 @@
:blueprint="fieldset"
:values="values"
:meta="meta"

:errors="errors"
@updated="values = { ...$event, focus: values.focus }"
>
<div class="w-full sm:p-4 md:pt-px md:w-1/3 md:grow h-1/2 md:h-full overflow-scroll" slot-scope="{ setFieldValue, setFieldMeta }">
Expand All@@ -126,15 +126,14 @@
<loading-graphic text="Saving" />
</div>

<div class="card p-0">
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />
<publish-fields
:fields="fields"
:read-only="readOnly"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>
</div>
<div v-if="error" class="bg-red-500 text-white p-4 shadow mb-4" v-text="error" />

<publish-sections
:sections="fieldset.tabs[0].sections"
@updated="setFieldValue"
@meta-updated="setFieldMeta"
/>

</div>
</publish-container>
</div>
Expand DownExpand Up@@ -307,7 +306,9 @@ export default {

this.fieldset = data.blueprint;
this.fields = _.chain(this.fieldset.tabs)
.map(tab => tab.fields)
.map(tab => tab.sections)
.flatten(true)
.map(section => section.fields)
.flatten(true)
.value();

Expand Down
38 changes: 23 additions & 15 deletions resources/js/components/blueprints/Builder.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,31 +10,39 @@
</header>

<div class="publish-form card p-0 @container" v-if="showTitle">
<div class="form-group">
<label class="block">{{ __('Title') }}</label>
<small class="help-block">{{ __('messages.blueprints_title_instructions') }}</small>
<div v-if="errors.title">
<small class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Title') }}</label>
<p class="help-block">{{ __('messages.blueprints_title_instructions') }}</p>
<div v-if="errors.title">
<p class="help-block text-red-500" v-for="(error, i) in errors.title" :key="i" v-text="error" />
</div>
</div>
<div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>
<input type="text" name="title" class="input-text" v-model="blueprint.title" autofocus="autofocus">
</div>

<div class="form-group">
<label class="block">{{ __('Hidden') }}</label>
<small class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</small>
<div v-if="errors.hidden">
<small class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
<div class="form-group config-field">
<div class="field-inner">
<label class="block">{{ __('Hidden') }}</label>
<p class="help-block">{{ __('messages.blueprints_hidden_instructions') }}</p>
<div v-if="errors.hidden">
<p class="help-block text-red-500" v-for="(error, i) in errors.hidden" :key="i" v-text="error" />
</div>
</div>
<div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
<toggle-input name="hidden" v-model="blueprint.hidden" />
</div>
</div>

<div class="content mt-10 mb-4" v-if="useTabs">
<h2>{{ __('Tabs') }}</h2>
<!--<h2>{{ __('Tabs') }}</h2>
<p class="max-w-lg">{{ __('messages.tabs_instructions') }}</p>
<div v-if="errors.tabs">
<small class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>
<p class="help-block text-red-500" v-for="(error, i) in errors.tabs" :key="i" v-text="error" />
</div>-->
</div>

<tabs
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/blueprints/Sections.vue
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,10 +20,10 @@
@deleted="deleteSection(i)"
/>

<div class="blueprint-add-section-container w-full md:w-1/2">
<div class="blueprint-add-section-container w-full">
<button class="blueprint-add-section-button outline-none" @click="addSection">
<div class="text-center flex items-center leading-none">
<div class="text-2xl mr-1">+</div>
<svg-icon name="micro-plus" class="h-3 w-3 mr-2" />
<div v-text="addSectionText" />
</div>

Expand Down
Loading