@schukai/monster 4.143.9 → 4.143.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.6"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.143.
|
|
1
|
+
{"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.6"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.143.10"}
|
|
@@ -275,15 +275,12 @@ class ControlBar extends CustomElement {
|
|
|
275
275
|
needsMeasure: true,
|
|
276
276
|
needsLayout: true,
|
|
277
277
|
needsObserve: true,
|
|
278
|
-
initialLayoutPending: true,
|
|
279
|
-
initialLayoutOpacity: undefined,
|
|
280
278
|
suppressSlotChange: false,
|
|
281
279
|
suppressMutation: false,
|
|
282
280
|
suppressResize: false,
|
|
283
281
|
};
|
|
284
282
|
|
|
285
283
|
initControlReferences.call(this);
|
|
286
|
-
hideControlBarUntilInitialLayout.call(this);
|
|
287
284
|
initEventHandler.call(this);
|
|
288
285
|
|
|
289
286
|
// setup structure
|
|
@@ -482,44 +479,6 @@ function isElementSelfHidden(element) {
|
|
|
482
479
|
);
|
|
483
480
|
}
|
|
484
481
|
|
|
485
|
-
/**
|
|
486
|
-
* @private
|
|
487
|
-
* @return {void}
|
|
488
|
-
*/
|
|
489
|
-
function hideControlBarUntilInitialLayout() {
|
|
490
|
-
const state = this[layoutStateSymbol];
|
|
491
|
-
if (!state || !(this[controlBarElementSymbol] instanceof HTMLElement)) {
|
|
492
|
-
return;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
state.initialLayoutOpacity = this[controlBarElementSymbol].style.opacity;
|
|
496
|
-
this[controlBarElementSymbol].style.opacity = "0";
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* @private
|
|
501
|
-
* @return {void}
|
|
502
|
-
*/
|
|
503
|
-
function revealControlBarAfterInitialLayout() {
|
|
504
|
-
const state = this[layoutStateSymbol];
|
|
505
|
-
if (
|
|
506
|
-
!state ||
|
|
507
|
-
state.initialLayoutPending !== true ||
|
|
508
|
-
!(this[controlBarElementSymbol] instanceof HTMLElement)
|
|
509
|
-
) {
|
|
510
|
-
return;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
state.initialLayoutPending = false;
|
|
514
|
-
const initialOpacity = state.initialLayoutOpacity;
|
|
515
|
-
if (typeof initialOpacity === "string" && initialOpacity !== "") {
|
|
516
|
-
this[controlBarElementSymbol].style.opacity = initialOpacity;
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
this[controlBarElementSymbol].style.removeProperty("opacity");
|
|
521
|
-
}
|
|
522
|
-
|
|
523
482
|
/**
|
|
524
483
|
* @private
|
|
525
484
|
*/
|
|
@@ -734,7 +693,6 @@ function runLayout() {
|
|
|
734
693
|
})
|
|
735
694
|
.finally(() => {
|
|
736
695
|
state.running = false;
|
|
737
|
-
revealControlBarAfterInitialLayout.call(this);
|
|
738
696
|
if (state.needsObserve || state.needsMeasure || state.needsLayout) {
|
|
739
697
|
scheduleLayoutFrame.call(this);
|
|
740
698
|
}
|
|
@@ -88,6 +88,15 @@ describe("ControlBar", function () {
|
|
|
88
88
|
);
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
+
it("should keep the control bar visible while the initial layout is pending", function () {
|
|
92
|
+
const bar = document.getElementById("bar");
|
|
93
|
+
const controlBar = bar.shadowRoot.querySelector(
|
|
94
|
+
'[data-monster-role="control-bar"]',
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
expect(controlBar.style.opacity).to.not.equal("0");
|
|
98
|
+
});
|
|
99
|
+
|
|
91
100
|
it("should allow configuring the control bar layout alignment to right", function (done) {
|
|
92
101
|
const bar = document.getElementById("bar-right");
|
|
93
102
|
|
|
@@ -968,7 +977,7 @@ describe("ControlBar", function () {
|
|
|
968
977
|
value: 20,
|
|
969
978
|
});
|
|
970
979
|
|
|
971
|
-
expect(controlBar.style.opacity).to.equal("0");
|
|
980
|
+
expect(controlBar.style.opacity).to.not.equal("0");
|
|
972
981
|
|
|
973
982
|
await flushFrames();
|
|
974
983
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
@@ -1070,7 +1079,7 @@ describe("ControlBar", function () {
|
|
|
1070
1079
|
}
|
|
1071
1080
|
});
|
|
1072
1081
|
|
|
1073
|
-
it("should
|
|
1082
|
+
it("should keep the control bar visible after reconnecting before initial layout", async function () {
|
|
1074
1083
|
const originalRequestAnimationFrame = window.requestAnimationFrame;
|
|
1075
1084
|
const originalGlobalRequestAnimationFrame = globalThis.requestAnimationFrame;
|
|
1076
1085
|
|
|
@@ -1145,7 +1154,7 @@ describe("ControlBar", function () {
|
|
|
1145
1154
|
});
|
|
1146
1155
|
}
|
|
1147
1156
|
|
|
1148
|
-
expect(controlBar.style.opacity).to.equal("0");
|
|
1157
|
+
expect(controlBar.style.opacity).to.not.equal("0");
|
|
1149
1158
|
|
|
1150
1159
|
bar.remove();
|
|
1151
1160
|
wrapper.append(bar);
|