@schukai/monster 3.94.1 → 3.95.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
 
4
4
 
5
+ ## [3.95.1] - 2024-12-23
6
+
7
+ ### Bug Fixes
8
+
9
+ - check rendering [#271](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/271)
10
+
11
+
12
+
13
+ ## [3.95.0] - 2024-12-23
14
+
15
+ ### Add Features
16
+
17
+ - **log:** set direction
18
+
19
+
20
+
5
21
  ## [3.94.1] - 2024-12-22
6
22
 
7
23
  ### Bug Fixes
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.12","@popperjs/core":"^2.11.8"},"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":"3.94.1"}
1
+ {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.12","@popperjs/core":"^2.11.8"},"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":"3.95.1"}
@@ -36,7 +36,7 @@ import {
36
36
  findTargetElementFromEvent,
37
37
  fireCustomEvent,
38
38
  } from "../../dom/events.mjs";
39
- import {getDocument} from "../../dom/util.mjs";
39
+ import {getDocument, getWindow} from "../../dom/util.mjs";
40
40
  import {random} from "../../math/random.mjs";
41
41
  import {getGlobal} from "../../types/global.mjs";
42
42
  import {ID} from "../../types/id.mjs";
@@ -150,6 +150,7 @@ const resizeObserverSymbol = Symbol("resizeObserver");
150
150
  * @example /examples/components/layout/tabs-removable
151
151
  *
152
152
  * @issue https://localhost.alvine.dev:8443/development/issues/closed/268.html
153
+ * @issue https://localhost.alvine.dev:8443/development/issues/closed/271.html
153
154
  *
154
155
  * @since 3.74.0
155
156
  * @copyright schukai GmbH
@@ -1027,35 +1028,43 @@ function calcBoxWidth(node) {
1027
1028
  * @return {Object}
1028
1029
  */
1029
1030
  function rearrangeButtons() {
1030
- const standardButtons = [];
1031
- const popperButtons = [];
1032
1031
 
1033
- let sum = 0;
1034
- const space = this[dimensionsSymbol].getVia("data.space");
1032
+ getWindow().requestAnimationFrame(() => {
1035
1033
 
1036
- const buttons = this.getOption("buttons.standard");
1037
- for (const [, button] of buttons.entries()) {
1038
- const ref = button?.reference;
1034
+ const standardButtons = [];
1035
+ const popperButtons = [];
1036
+ let sum = 0;
1037
+ const space = this[dimensionsSymbol].getVia("data.space");
1038
+
1039
+ if (space <= 0) {
1040
+ return;
1041
+ }
1039
1042
 
1040
- sum += this[dimensionsSymbol].getVia(`data.button.${ref}`);
1043
+ const buttons = this.getOption("buttons.standard");
1044
+ for (const [, button] of buttons.entries()) {
1045
+ const ref = button?.reference;
1041
1046
 
1042
- if (sum > space) {
1043
- popperButtons.push(clone(button));
1044
- } else {
1045
- standardButtons.push(clone(button));
1047
+ sum += this[dimensionsSymbol].getVia(`data.button.${ref}`);
1048
+
1049
+ if (sum > space) {
1050
+ popperButtons.push(clone(button));
1051
+ } else {
1052
+ standardButtons.push(clone(button));
1053
+ }
1046
1054
  }
1047
- }
1048
1055
 
1049
- this.setOption("buttons.standard", standardButtons);
1050
- this.setOption("buttons.popper", popperButtons);
1056
+ this.setOption("buttons.standard", standardButtons);
1057
+ this.setOption("buttons.popper", popperButtons);
1051
1058
 
1052
- if (this[switchElementSymbol]) {
1053
- if (popperButtons.length > 0) {
1054
- this[switchElementSymbol].classList.remove("hidden");
1055
- } else {
1056
- this[switchElementSymbol].classList.add("hidden");
1059
+ if (this[switchElementSymbol]) {
1060
+ if (popperButtons.length > 0) {
1061
+ this[switchElementSymbol].classList.remove("hidden");
1062
+ } else {
1063
+ this[switchElementSymbol].classList.add("hidden");
1064
+ }
1057
1065
  }
1058
- }
1066
+
1067
+ });
1059
1068
  }
1060
1069
 
1061
1070
  /**
@@ -1105,8 +1114,11 @@ function calculateNavigationButtonsDimensions() {
1105
1114
  slot.classList.remove("invisible");
1106
1115
  }
1107
1116
 
1108
- this[dimensionsSymbol].setVia("data.calculated", true);
1109
1117
  this.setOption("buttons.standard", clone(buttons));
1118
+
1119
+ getWindow().requestAnimationFrame(() => {
1120
+ this[dimensionsSymbol].setVia("data.calculated", true);
1121
+ });
1110
1122
  }
1111
1123
 
1112
1124
  /**
@@ -81,6 +81,8 @@ class Log extends CustomElement {
81
81
  * @property {string} templates.main Main template
82
82
  * @property {Object} labels Labels
83
83
  * @property {string} labels.nothingToReport Label for empty state
84
+ * @property {Object} classes Classes
85
+ * @property {string} classes.direction Direction of the log: ascending or descending
84
86
  * @property {number} updateFrequency Update frequency in milliseconds for the timestamp
85
87
  */
86
88
  get defaults() {
@@ -93,8 +95,8 @@ class Log extends CustomElement {
93
95
  nothingToReport: "There is nothing to report yet.",
94
96
  },
95
97
 
96
- classes: {
97
- direction: "vertical",
98
+ features: {
99
+ direction: "ascending",
98
100
  },
99
101
 
100
102
  updateFrequency: 10000,
@@ -123,8 +125,7 @@ class Log extends CustomElement {
123
125
  * @return {Log}
124
126
  */
125
127
  clear() {
126
- this[logElementSymbol].innerHTML = "";
127
- this[emptyStateElementSymbol].style.display = "block";
128
+ this[logElementSymbol].setOption("entries", []);
128
129
  return this;
129
130
  }
130
131
 
@@ -141,7 +142,11 @@ class Log extends CustomElement {
141
142
  }
142
143
 
143
144
  const entries = this.getOption("entries");
144
- entries.push(entry);
145
+ if (this.getOption("features.direction") === "ascending") {
146
+ entries.unshift(entry);
147
+ } else {
148
+ entries.push(entry);
149
+ }
145
150
 
146
151
  /** this field is not used, but triggers a change event */
147
152
  this.setOption("length", entries.length - 1);
@@ -25,7 +25,7 @@ export { State };
25
25
  /**
26
26
  * A state component
27
27
  *
28
- * @fragments /fragments/components/state/state/
28
+ * @fragments /fragments/components/state/state
29
29
  *
30
30
  * @example /examples/components/state/state-simple
31
31
  *