@schukai/monster 4.38.7 → 4.38.9

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.
@@ -110,9 +110,11 @@ export * from "./components/accessibility/locale-picker.mjs";
110
110
  export * from "./components/state/log/entry.mjs";
111
111
  export * from "./components/state/state.mjs";
112
112
  export * from "./components/state/log.mjs";
113
+ export * from "./components/navigation/wizard-navigation.mjs";
113
114
  export * from "./components/navigation/table-of-content.mjs";
114
115
  export * from "./components/data/metric-graph.mjs";
115
116
  export * from "./components/data/metric.mjs";
117
+ export * from "./components/data/kpi-tile.mjs";
116
118
  export * from "./components/constants.mjs";
117
119
  export * from "./components/constants.mjs";
118
120
  export * from "./text/formatter.mjs";
@@ -44,115 +44,115 @@ export { Observer };
44
44
  * @since 1.0.0
45
45
  */
46
46
  class Observer extends Base {
47
- /**
48
- * Stores promises for updates that are scheduled but not yet executed.
49
- * This prevents multiple executions for the same subject within one microtask cycle.
50
- * @type {Map<object, Promise<*>>}
51
- */
52
- #pendingUpdates = new Map();
53
- #callback;
54
- #arguments;
55
- #tags = new TokenList();
56
-
57
- /**
58
- * @param {function} callback The function to execute on update.
59
- * @param {...*} args Additional arguments to pass to the callback.
60
- */
61
- constructor(callback, ...args) {
62
- super();
63
-
64
- if (typeof callback !== "function") {
65
- throw new Error("Observer callback must be a function.");
66
- }
67
-
68
- this.#callback = callback;
69
- this.#arguments = args;
70
- }
71
-
72
- /**
73
- * This method is called by the `instanceof` operator.
74
- * @returns {symbol}
75
- * @since 2.1.0
76
- */
77
- static get [instanceSymbol]() {
78
- return Symbol.for("@schukai/monster/types/observer");
79
- }
80
-
81
- // Getter for properties for cleaner access if needed
82
- get callback() {
83
- return this.#callback;
84
- }
85
-
86
- get arguments() {
87
- return this.#arguments;
88
- }
89
-
90
- /**
91
- * Schedules the callback for execution with the given subject.
92
- * If multiple updates for the same subject are requested in the same event loop tick,
93
- * the callback is only executed once. All callers will receive the same promise.
94
- *
95
- * @param {object} subject The subject object that triggered the update.
96
- * @returns {Promise<*>} A promise that resolves with the return value of the callback,
97
- * or rejects if the callback throws an error.
98
- */
99
- update(subject) {
100
- if (!isObject(subject)) {
101
- return Promise.reject(new Error("Subject must be an object."));
102
- }
103
-
104
- if (this.#pendingUpdates.has(subject)) {
105
- return this.#pendingUpdates.get(subject);
106
- }
107
-
108
- const promise = new Promise((resolve, reject) => {
109
- queueMicrotask(async () => {
110
- try {
111
- const result = await this.#callback.apply(subject, this.#arguments);
112
- resolve(result);
113
- } catch (e) {
114
- reject(e);
115
- } finally {
116
- this.#pendingUpdates.delete(subject);
117
- }
118
- });
119
- });
120
-
121
- this.#pendingUpdates.set(subject, promise);
122
-
123
- return promise;
124
- }
125
-
126
- /**
127
- * @param {string} tag
128
- * @returns {Observer}
129
- */
130
- addTag(tag) {
131
- this.#tags.add(tag);
132
- return this;
133
- }
134
-
135
- /**
136
- * @param {string} tag
137
- * @returns {Observer}
138
- */
139
- removeTag(tag) {
140
- this.#tags.remove(tag);
141
- return this;
142
- }
143
-
144
- /**
145
- * @returns {string[]}
146
- */
147
- getTags() {
148
- return this.#tags.entries();
149
- }
150
-
151
- /**
152
- * @param {string} tag
153
- * @returns {boolean}
154
- */
155
- hasTag(tag) {
156
- return this.#tags.contains(tag);
157
- }
47
+ /**
48
+ * Stores promises for updates that are scheduled but not yet executed.
49
+ * This prevents multiple executions for the same subject within one microtask cycle.
50
+ * @type {Map<object, Promise<*>>}
51
+ */
52
+ #pendingUpdates = new Map();
53
+ #callback;
54
+ #arguments;
55
+ #tags = new TokenList();
56
+
57
+ /**
58
+ * @param {function} callback The function to execute on update.
59
+ * @param {...*} args Additional arguments to pass to the callback.
60
+ */
61
+ constructor(callback, ...args) {
62
+ super();
63
+
64
+ if (typeof callback !== "function") {
65
+ throw new Error("Observer callback must be a function.");
66
+ }
67
+
68
+ this.#callback = callback;
69
+ this.#arguments = args;
70
+ }
71
+
72
+ /**
73
+ * This method is called by the `instanceof` operator.
74
+ * @returns {symbol}
75
+ * @since 2.1.0
76
+ */
77
+ static get [instanceSymbol]() {
78
+ return Symbol.for("@schukai/monster/types/observer");
79
+ }
80
+
81
+ // Getter for properties for cleaner access if needed
82
+ get callback() {
83
+ return this.#callback;
84
+ }
85
+
86
+ get arguments() {
87
+ return this.#arguments;
88
+ }
89
+
90
+ /**
91
+ * Schedules the callback for execution with the given subject.
92
+ * If multiple updates for the same subject are requested in the same event loop tick,
93
+ * the callback is only executed once. All callers will receive the same promise.
94
+ *
95
+ * @param {object} subject The subject object that triggered the update.
96
+ * @returns {Promise<*>} A promise that resolves with the return value of the callback,
97
+ * or rejects if the callback throws an error.
98
+ */
99
+ update(subject) {
100
+ if (!isObject(subject)) {
101
+ return Promise.reject(new Error("Subject must be an object."));
102
+ }
103
+
104
+ if (this.#pendingUpdates.has(subject)) {
105
+ return this.#pendingUpdates.get(subject);
106
+ }
107
+
108
+ const promise = new Promise((resolve, reject) => {
109
+ queueMicrotask(async () => {
110
+ try {
111
+ const result = await this.#callback.apply(subject, this.#arguments);
112
+ resolve(result);
113
+ } catch (e) {
114
+ reject(e);
115
+ } finally {
116
+ this.#pendingUpdates.delete(subject);
117
+ }
118
+ });
119
+ });
120
+
121
+ this.#pendingUpdates.set(subject, promise);
122
+
123
+ return promise;
124
+ }
125
+
126
+ /**
127
+ * @param {string} tag
128
+ * @returns {Observer}
129
+ */
130
+ addTag(tag) {
131
+ this.#tags.add(tag);
132
+ return this;
133
+ }
134
+
135
+ /**
136
+ * @param {string} tag
137
+ * @returns {Observer}
138
+ */
139
+ removeTag(tag) {
140
+ this.#tags.remove(tag);
141
+ return this;
142
+ }
143
+
144
+ /**
145
+ * @returns {string[]}
146
+ */
147
+ getTags() {
148
+ return this.#tags.entries();
149
+ }
150
+
151
+ /**
152
+ * @param {string} tag
153
+ * @returns {boolean}
154
+ */
155
+ hasTag(tag) {
156
+ return this.#tags.contains(tag);
157
+ }
158
158
  }
@@ -156,7 +156,7 @@ function getMonsterVersion() {
156
156
  }
157
157
 
158
158
  /** don't touch, replaced by make with package.json version */
159
- monsterVersion = new Version("4.38.4");
159
+ monsterVersion = new Version("4.38.8");
160
160
 
161
161
  return monsterVersion;
162
162
  }
@@ -7,7 +7,7 @@ describe('Monster', function () {
7
7
  let monsterVersion
8
8
 
9
9
  /** don´t touch, replaced by make with package.json version */
10
- monsterVersion = new Version("4.38.4")
10
+ monsterVersion = new Version("4.38.8")
11
11
 
12
12
  let m = getMonsterVersion();
13
13
 
@@ -9,8 +9,8 @@
9
9
  </head>
10
10
  <body>
11
11
  <div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;">
12
- <h1 style='margin-bottom: 0.1em;'>Monster 4.38.4</h1>
13
- <div id="lastupdate" style='font-size:0.7em'>last update So 3. Aug 18:12:39 CEST 2025</div>
12
+ <h1 style='margin-bottom: 0.1em;'>Monster 4.38.8</h1>
13
+ <div id="lastupdate" style='font-size:0.7em'>last update Mi 27. Aug 12:13:30 CEST 2025</div>
14
14
  </div>
15
15
  <div id="mocha-errors"
16
16
  style="color: red;font-weight: bold;display: flex;align-items: center;justify-content: center;flex-direction: column;margin:20px;"></div>