Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Grid Editor sorting directive #13391

Merged
merged 99 commits into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from 90 commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
c6beb5f
make sure area border is on top of block views.
nielslyngsoe Oct 24, 2022
3faa8c5
rename class to avoid confusion
nielslyngsoe Oct 24, 2022
adbde42
change witch UI goes on top on hover
nielslyngsoe Oct 24, 2022
b95be09
Description informing all blocks are allowed when none is configured.
nielslyngsoe Oct 25, 2022
cf0bd2c
add 'When empty'
nielslyngsoe Oct 25, 2022
61b8c7e
Sort mode
nielslyngsoe Oct 25, 2022
bffc4ab
ability to switch out property actions
nielslyngsoe Oct 26, 2022
21f56c1
enter and exit sortmode from property actions
nielslyngsoe Oct 26, 2022
1483ab3
gridsortblock
nielslyngsoe Oct 26, 2022
263ffba
rename block class to use sortblock
nielslyngsoe Oct 26, 2022
d9ec19a
Sort mode styling
nielslyngsoe Oct 26, 2022
4067442
remove unused css selector
nielslyngsoe Oct 26, 2022
ec8efb7
fixing style for inline-creat button to appear above and not when hov…
nielslyngsoe Oct 26, 2022
cfb4a8f
work on block grid inline editor
nielslyngsoe Oct 26, 2022
65843b6
use uui-button + enable installing demo blocks when its not the first…
nielslyngsoe Oct 26, 2022
ca96b55
improvements to inline editing POC
nielslyngsoe Oct 27, 2022
991cae5
update title of area config overlay editor
nielslyngsoe Oct 27, 2022
57269ba
reset columnSpan if no column span options is defined.
nielslyngsoe Oct 27, 2022
813b71f
Inline editing
nielslyngsoe Oct 31, 2022
ba6f5fc
remove html comment
nielslyngsoe Oct 31, 2022
2ed1a51
remove code for transfer of stylesheets
nielslyngsoe Nov 1, 2022
847a960
ability to hide label from directive
nielslyngsoe Nov 1, 2022
cfe4340
inline editing using slots to render the umb-property in light dom
nielslyngsoe Nov 1, 2022
7903d6e
remove property editor proxies when moving a block to a new area/bloc…
nielslyngsoe Nov 1, 2022
d03d8e5
minor adjustments to custom views
nielslyngsoe Nov 4, 2022
f1f367e
use individual slots for each area.
nielslyngsoe Nov 4, 2022
f0cf0ca
Inline editing
nielslyngsoe Nov 4, 2022
9f185c8
a little smaller rte min-height
nielslyngsoe Nov 4, 2022
7edfa0a
fire Custom focus/blur event for Block Grid Editor to catch for focus…
nielslyngsoe Nov 4, 2022
0d2aea8
disable inline editing prevalue field when custom view is set
nielslyngsoe Nov 4, 2022
89e81a3
Fix scroll parent block into view
nielslyngsoe Nov 4, 2022
8e66516
initial work on sorter directive
nielslyngsoe Nov 7, 2022
a720219
Merge remote-tracking branch 'origin/v10/dev' into v10/feature/block-…
nielslyngsoe Nov 14, 2022
6ff110a
remove mediaBlock controller
nielslyngsoe Nov 14, 2022
7a4421f
initial notes and structure
nielslyngsoe Nov 14, 2022
0eac79f
further concept work
nielslyngsoe Nov 14, 2022
62a7224
remove consol log
nielslyngsoe Nov 14, 2022
12add15
CSS for getting bigger areas
nielslyngsoe Nov 15, 2022
ba95d21
removal of the forceLeft/forceRight code
nielslyngsoe Nov 15, 2022
dadaa2d
Merge remote-tracking branch 'origin/v10/feature/block-grid-editor-re…
nielslyngsoe Nov 15, 2022
3014bf6
proven concept
nielslyngsoe Nov 15, 2022
4999e4b
fix grid space detection. vertical/horizontal
nielslyngsoe Nov 15, 2022
5869af3
clean up and notes
nielslyngsoe Nov 15, 2022
9097cee
move into inner containers as well
nielslyngsoe Nov 15, 2022
19e9136
use last available index pr default
nielslyngsoe Nov 15, 2022
d27f976
boundary selector, for improved choise of dropping into an area
nielslyngsoe Nov 16, 2022
4ad2506
hide last inline create button when dragging around
nielslyngsoe Nov 16, 2022
34578cf
remove console.log
nielslyngsoe Nov 16, 2022
9fc41d2
removal of forced placement in css
nielslyngsoe Nov 16, 2022
6f6699b
Merge branch 'v10/feature/block-grid-editor-remove-force-placement-fe…
nielslyngsoe Nov 16, 2022
9ca274e
default config and clean up
nielslyngsoe Nov 16, 2022
798141a
notes
nielslyngsoe Nov 16, 2022
57d1be2
bring back removed code
nielslyngsoe Nov 16, 2022
fe04df9
Merge remote-tracking branch 'origin/v10/feature/block-grid-editor-re…
nielslyngsoe Nov 16, 2022
eba172f
show area ui when in dragging mode
nielslyngsoe Nov 16, 2022
cf7e2be
more specific selector
nielslyngsoe Nov 16, 2022
53e8405
drop allowance + clean up
nielslyngsoe Nov 16, 2022
e4cd8af
notes and clean up
nielslyngsoe Nov 16, 2022
2583496
auto scroll
nielslyngsoe Nov 16, 2022
95d74b3
turn --umb-block-grid--dragging-mode into conditional CSS Custom Prop…
nielslyngsoe Nov 16, 2022
48c0234
auto scroll
nielslyngsoe Nov 16, 2022
95bf845
refactoring
nielslyngsoe Nov 16, 2022
0cbad63
fix condition mistake
nielslyngsoe Nov 16, 2022
dccf56e
scope.config.resolveVerticalDirection
nielslyngsoe Nov 16, 2022
3fe9f38
wrap up simple setDragImage solution
nielslyngsoe Nov 16, 2022
1a64632
bring back vm.notifyVisualUpdate and clean up
nielslyngsoe Nov 16, 2022
b7e8c9b
make draggableSelector optional, fallback to element
nielslyngsoe Nov 16, 2022
b5183a5
implement umb-block-grid-sorter for Area PreValue editor
nielslyngsoe Nov 16, 2022
c04c62d
remove sortableJS dependency
nielslyngsoe Nov 16, 2022
fc8d700
remove sortableJs from dependencies
nielslyngsoe Nov 16, 2022
3152ec0
wups, bring back the comma
nielslyngsoe Nov 16, 2022
d2e671e
removed sortablejs from package-lock
nielslyngsoe Nov 16, 2022
77f2639
finished implementation of sorter for PreValue Block Areas
nielslyngsoe Nov 16, 2022
f6af785
Merge remote-tracking branch 'origin/v10/dev' into v10/feature/block-…
nielslyngsoe Nov 17, 2022
13afafa
fix for FireFox shadowDom issue, contains temprorary code.
nielslyngsoe Nov 17, 2022
6bf3aea
stop auto scroll
nielslyngsoe Nov 17, 2022
a64ed62
make full thing dragable
nielslyngsoe Nov 17, 2022
e163ad7
Merge remote-tracking branch 'origin/v10/dev' into v10/feature/block-…
nielslyngsoe Nov 17, 2022
567d34f
fix firefox issue (applying translateZ)
nielslyngsoe Nov 17, 2022
e2d2f8c
comment
nielslyngsoe Nov 18, 2022
fc0e503
make block fit in context columns
nielslyngsoe Nov 18, 2022
c805c7b
revert element to where it came from if sync could not succeed + clea…
nielslyngsoe Nov 18, 2022
468f154
ensure block does not push the amount of columns, this occourse when …
nielslyngsoe Nov 18, 2022
f143215
take horizontalPlaceAfter into account
nielslyngsoe Nov 18, 2022
96fa80e
implement horizontalPlaceAfter in Areas Prevalue editor
nielslyngsoe Nov 18, 2022
118210e
clean up dependencies
nielslyngsoe Nov 18, 2022
d10dc25
Shift related el to first in row or last in row when there is no hori…
nielslyngsoe Nov 18, 2022
585ae6e
clean up and correct calculation
nielslyngsoe Nov 18, 2022
d555db3
remove unused attribute
nielslyngsoe Nov 18, 2022
0f9f05d
revert to using el.getBoundingClientRect(), as the config.draggableSe…
nielslyngsoe Nov 18, 2022
3b8d2a8
bind model via dedicated binding to ensure it stay connected with the…
nielslyngsoe Nov 18, 2022
3615115
Update src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/…
nielslyngsoe Nov 18, 2022
658415c
Merge branch 'v10/feature/block-grid-editor-sorting-directive' of htt…
nielslyngsoe Nov 18, 2022
9d35d08
fix eslint issues
nielslyngsoe Nov 18, 2022
524e60c
ensure missingColumnWidth is above 0
nielslyngsoe Nov 18, 2022
aaff0df
Do not allow dragging something thats not found in the model.
nielslyngsoe Nov 18, 2022
7dad74b
remove as this is not an error.
nielslyngsoe Nov 18, 2022
e9c6816
update to Flexbox solution
nielslyngsoe Nov 18, 2022
1ab1ddc
as the complex model does not change we can use single way binding
nielslyngsoe Nov 18, 2022
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
5 changes: 0 additions & 5 deletions src/Umbraco.Web.UI.Client/gulp/tasks/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,6 @@ function dependencies() {
"./node_modules/@umbraco-ui/uui-css/dist/uui-text.css"
],
"base": "./node_modules/@umbraco-ui"
},
{
"name": "sortablejs",
"src": ["./node_modules/sortablejs/Sortable.min.js"],
"base": "./node_modules/sortablejs"
}
];

Expand Down
11 changes: 0 additions & 11 deletions src/Umbraco.Web.UI.Client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/Umbraco.Web.UI.Client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"moment": "2.29.4",
"ng-file-upload": "12.2.13",
"nouislider": "15.6.1",
"sortablejs": "1.15.0",
"spectrum-colorpicker2": "2.0.9",
"tinymce": "4.9.11",
"typeahead.js": "0.11.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@
min-height: 48px;
height: auto;
}


.blockelement-gridinlineblock-editor > slot {
--umb-block-grid--inline-editor--pointer-events--condition: var(--umb-block-grid--dragging-mode) none;
pointer-events: var(--umb-block-grid--inline-editor--pointer-events--condition, auto);
}

</style>

Expand Down Expand Up @@ -100,6 +104,6 @@

<slot name="{{vm.propertySlotName}}"></slot>

<umb-block-grid-render-area-slots></umb-block-grid-render-area-slots>
<umb-block-grid-render-area-slots ng-if="block.layout.areas.length > 0"></umb-block-grid-render-area-slots>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ ng-form.ng-invalid-val-server-match-content > .umb-block-grid__block:not(.--acti
&.--active {

/** Avoid displaying hover when dragging-mode */
--umb-block-grid--block-ui-opacity: calc(1 - var(--umb-block-grid--dragging-mode, 0));
--umb-block-grid--block-ui-opacity--condition: var(--umb-block-grid--dragging-mode) 0;
--umb-block-grid--block-ui-opacity: var(--umb-block-grid--block-ui-opacity--code, 1);

> .umb-block-grid__block--context {
opacity: var(--umb-block-grid--block-ui-opacity);
Expand Down Expand Up @@ -412,15 +413,17 @@ ng-form.ng-invalid > .umb-block-grid__block:not(.--active) > .umb-block-grid__bl
z-index: 1; /** overwritten for the first one of an area. */

/** Avoid showing inline-create in dragging-mode */
opacity: calc(1 - var(--umb-block-grid--dragging-mode, 0));

--umb-block-grid__block--inline-create-button-display--condition: var(--umb-block-grid--dragging-mode) none;
display: var(--umb-block-grid__block--inline-create-button-display--condition);
}
.umb-block-grid__block--inline-create-button.--above {
left: 0;
width: 100%;

top: calc(var(--umb-block-grid--row-gap, 0px) * -0.5);
}
.umb-block-grid__layout-item:first-of-type .umb-block-grid__block--inline-create-button.--above {
.umb-block-grid__layout-item:first-of-type > .umb-block-grid__block--inline-create-button.--above {
/* Do not use row-gap if the first one. */
top: 0;
}
Expand Down Expand Up @@ -454,6 +457,10 @@ ng-form.ng-invalid > .umb-block-grid__block:not(.--active) > .umb-block-grid__bl
/* Move inline create button slightly up, to avoid collision with others*/
margin-bottom: -7px;
margin-top: -13px;

/** Avoid showing last-inline-create in dragging-mode */
--umb-block-grid__block--last-inline-create-button-display--condition: var(--umb-block-grid--dragging-mode) none;
display: var(--umb-block-grid__block--last-inline-create-button-display--condition);
}


Expand Down Expand Up @@ -553,6 +560,7 @@ ng-form.ng-invalid > .umb-block-grid__block:not(.--active) > .umb-block-grid__bl

.umb-block-grid__area-actions {
grid-column: span var(--umb-block-grid--area-column-span);
flex-grow: 1;
opacity: calc(var(--umb-block-grid--hint-area-ui, 0) * .5 + var(--umb-block-grid--show-area-ui, 0));
transition: opacity 120ms;

Expand Down Expand Up @@ -590,34 +598,40 @@ ng-form.ng-invalid > .umb-block-grid__block:not(.--active) > .umb-block-grid__bl
}
}


.umb-block-grid__layout-item-placeholder {
background: transparent;
border-radius: 3px;

box-sizing: border-box;
border: solid 1px;
border-color: rgba(@blueDark, .5);
border-radius: 3px;

height: 100%;
}


.umb-block-grid__layout-item-placeholder > * {
display: none;
}

.umb-block-grid__layout-item-placeholder::before {
content: '';
position:absolute;
z-index:1;
inset: 0;
border-radius: 3px;
background-color: white;
pointer-events:none;
}
.umb-block-grid__layout-item-placeholder::after {
content: '';
position:absolute;
z-index:1;
inset: 0;
border-radius: 3px;
pointer-events:none;

transition: background-color 240ms ease-in;
animation: umb-block-grid__placeholder__pulse 400ms ease-in-out alternate infinite;
Expand All @@ -627,10 +641,14 @@ ng-form.ng-invalid > .umb-block-grid__block:not(.--active) > .umb-block-grid__bl
}
}


.umb-block-grid__area {
position: relative;
--umb-block-grid--show-area-ui: 0;
height: 100%;
display: flex;
flex-direction: column;

--umb-block-grid__area--show-area-ui--condition: var(--umb-block-grid--dragging-mode) 1;
--umb-block-grid--show-area-ui: var(--umb-block-grid__area--show-area-ui--condition, 0);
}
.umb-block-grid__area:focus,
.umb-block-grid__area:focus-within,
Expand All @@ -654,10 +672,9 @@ ng-form.ng-invalid > .umb-block-grid__block:not(.--active) > .umb-block-grid__bl
/* Moved slightly in to align with the inline-create button, which is moved slightly in to avoid collision with other create buttons. */
top:2px;
bottom: 2px;
/** Avoid displaying highlight when in dragging-mode */
opacity: calc(1 - var(--umb-block-grid--dragging-mode, 0));
border-color: @blueDark;
box-shadow: 0 0 0 1px rgba(255, 255, 255, .7), inset 0 0 0 1px rgba(255, 255, 255, .7);

}
.umb-block-grid__area:has( .umb-block-grid__layout-item-placeholder )::after {
opacity: 1;
Expand All @@ -674,6 +691,9 @@ ng-form.ng-invalid > .umb-block-grid__block:not(.--active) > .umb-block-grid__bl
100% { border-color: rgba(@blueDark, 0.66); }
}
}
.umb-block-grid__area > ng-form {
display: contents;
}

.umb-block-grid__scalebox-backdrop {
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,39 @@

<umb-load-indicator ng-if="vm.loading"></umb-load-indicator>

<div ng-show="vm.loading !== true" class="umb-block-grid-area-editor__grid-wrapper" style="--umb-block-grid--block-grid-columns: {{vm.block.areaGridColumns || vm.rootLayoutColumns}}">
<div ng-if="vm.loading !== true"
nielslyngsoe marked this conversation as resolved.
Show resolved Hide resolved
class="umb-block-grid-area-editor__grid-wrapper"
style="--umb-block-grid--block-grid-columns: {{vm.block.areaGridColumns || vm.rootLayoutColumns}}"
umb-block-grid-sorter="::vm.sorterOptions">

<umb-block-grid-configuration-area-entry ng-repeat="area in vm.model track by area.key"
class="umb-block-grid-area-editor__area"
ng-class="{'--isOpen':vm.openArea === area}"
area="area"
data-area-key="{{area.key}}"
data-col-span="{{area.columnSpan}}"
data-row-span="{{area.rowSpan}}"
style="
--umb-block-grid--grid-column: {{area.columnSpan}};
--umb-block-grid--area-column-span: {{area.columnSpan}};
--umb-block-grid--area-row-span: {{area.rowSpan}};
"
area="area"
ng-click="vm.editArea(area)"
on-edit="vm.editArea(area)"
on-delete="vm.requestDeleteArea(area)"
>
</umb-block-grid-configuration-area-entry>

<button
type="button"
ng-disabled="vm.disabled"
class="btn-reset umb-block-grid-area-editor__create-button umb-outline"
ng-click="vm.onNewAreaClick()">
<localize key="general_add">Add</localize>
</button>

</div>

<button
type="button"
ng-disabled="vm.disabled"
class="btn-reset umb-block-grid-area-editor__create-button umb-outline"
ng-click="vm.onNewAreaClick()">
<localize key="general_add">Add</localize>
</button>

</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ Grid part:
display: flex;
align-items: center;
justify-content: center;

height:50px;
width:100%;

color: @ui-action-discreet-type;
font-weight: bold;
Expand Down
Loading