Skip to content

Commit e362a0d

Browse files
committed
1 parent 57afe3e commit e362a0d

File tree

4 files changed

+23
-77
lines changed

4 files changed

+23
-77
lines changed

elements/grid-plate/grid-plate.js

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -186,31 +186,6 @@ class GridPlate extends LitElement {
186186
0.5s margin ease-in-out
187187
);
188188
}
189-
:host([data-hax-ray]) [data-layout-slotname].not-shown {
190-
display: block;
191-
opacity: 0.4;
192-
width: 0;
193-
}
194-
:host([data-hax-ray]) [data-layout-slotname].not-shown.has-nodes {
195-
width: 100%;
196-
transition: none;
197-
}
198-
:host([data-hax-ray]) .not-shown:hover {
199-
opacity: 1;
200-
}
201-
:host([data-hax-ray]) .not-shown:hover::before {
202-
content: "Hidden bylayout";
203-
position: sticky;
204-
display: inline-flex;
205-
background-color: black;
206-
color: white;
207-
padding: 0px 8px;
208-
font-size: 12px;
209-
line-height: 16px;
210-
margin: 12px 13px;
211-
float: right;
212-
width: 124px;
213-
}
214189
/** this implies hax editing state is available **/
215190
:host([data-hax-ray]) div ::slotted(*) {
216191
border: var(
@@ -327,7 +302,7 @@ class GridPlate extends LitElement {
327302
this.breakpointMd = 1200;
328303
this.breakpointLg = 1500;
329304
this.breakpointXl = 1800;
330-
this.columns = 6;
305+
this.columns = 4;
331306
this.disableResponsive = false;
332307
this.layout = "1-1";
333308
this.layouts = new GridPlateLayoutOptions().layouts;

elements/grid-plate/src/grid-plate.js

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -186,31 +186,6 @@ class GridPlate extends LitElement {
186186
0.5s margin ease-in-out
187187
);
188188
}
189-
:host([data-hax-ray]) [data-layout-slotname].not-shown {
190-
display: block;
191-
opacity: 0.4;
192-
width: 0;
193-
}
194-
:host([data-hax-ray]) [data-layout-slotname].not-shown.has-nodes {
195-
width: 100%;
196-
transition: none;
197-
}
198-
:host([data-hax-ray]) .not-shown:hover {
199-
opacity: 1;
200-
}
201-
:host([data-hax-ray]) .not-shown:hover::before {
202-
content: "Hidden bylayout";
203-
position: sticky;
204-
display: inline-flex;
205-
background-color: black;
206-
color: white;
207-
padding: 0px 8px;
208-
font-size: 12px;
209-
line-height: 16px;
210-
margin: 12px 13px;
211-
float: right;
212-
width: 124px;
213-
}
214189
/** this implies hax editing state is available **/
215190
:host([data-hax-ray]) div ::slotted(*) {
216191
border: var(
@@ -327,7 +302,7 @@ class GridPlate extends LitElement {
327302
this.breakpointMd = 1200;
328303
this.breakpointLg = 1500;
329304
this.breakpointXl = 1800;
330-
this.columns = 6;
305+
this.columns = 4;
331306
this.disableResponsive = false;
332307
this.layout = "1-1";
333308
this.layouts = new GridPlateLayoutOptions().layouts;

elements/hax-body-behaviors/lib/HAXLayouts.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,6 @@ export const HaxLayoutBehaviors = function (SuperClass) {
2323
0.5s margin ease-in-out
2424
);
2525
}
26-
:host([data-hax-ray]) [data-layout-slotname].not-shown {
27-
display: block;
28-
opacity: 0.4;
29-
width: 0;
30-
}
31-
:host([data-hax-ray]) [data-layout-slotname].not-shown.has-nodes {
32-
width: 100%;
33-
transition: none;
34-
}
35-
:host([data-hax-ray]) .not-shown:hover {
36-
opacity: 1;
37-
}
38-
:host([data-hax-ray]) .not-shown:hover::before {
39-
content: "Hidden by layout";
40-
position: sticky;
41-
display: inline-flex;
42-
background-color: black;
43-
color: white;
44-
padding: 0px 8px;
45-
font-size: 12px;
46-
line-height: 16px;
47-
margin: 12px 13px;
48-
float: right;
49-
width: 124px;
50-
}
5126
/** this implies hax editing state is available **/
5227
:host([data-hax-ray]) ::slotted(*) {
5328
outline: var(--hax-layout-slotted-outline-width, 0px)

elements/hax-body/lib/hax-store.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,6 +1276,27 @@ class HaxStore extends I18NMixin(winEventsElement(HAXElement(LitElement))) {
12761276
if (e.detail.command && e.detail.command === "removeFormat") {
12771277
this.activeNode.innerHTML = stripMSWord(this.activeNode.innerHTML);
12781278
}
1279+
// @todo this will help with keeping styling and slot in some situation
1280+
// there's still something odd w/ ul/ol in grids that will need explored.
1281+
if (e.detail.command && e.detail.command === "formatBlock") {
1282+
let dataset = {...this.activeNode.dataset};
1283+
let slot = this.activeNode.slot;
1284+
// the delay allows HAX to switch the element and insert where it used to be
1285+
// after which point we can quickly set these prims that get lost otherwise
1286+
// as this is handled by the browser to do the text editing transform
1287+
// as opposed to HAX directly like web components get :)
1288+
setTimeout(() => {
1289+
for (var i in dataset) {
1290+
if (!i.startsWith('hax')) {
1291+
this.activeNode.dataset[i] = dataset[i];
1292+
}
1293+
}
1294+
// if it had a slot, ensure we maintain that
1295+
if (slot) {
1296+
this.activeNode.setAttribute('slot', slot);
1297+
}
1298+
}, 0);
1299+
}
12791300
}
12801301
/**
12811302
* Intercept paste event and clean it up before inserting the contents

0 commit comments

Comments
 (0)