@schukai/monster 3.100.15 → 3.100.17

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.100.17] - 2025-01-20
6
+
7
+ ### Bug Fixes
8
+
9
+ - **restapi:** send correct header for requests
10
+
11
+
12
+
13
+ ## [3.100.16] - 2025-01-20
14
+
15
+ ### Bug Fixes
16
+
17
+ - update resizeobserver
18
+
19
+
20
+
5
21
  ## [3.100.15] - 2025-01-20
6
22
 
7
23
  ### Bug Fixes
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.13","@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.100.15"}
1
+ {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.13","@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.100.17"}
@@ -267,7 +267,20 @@ function attachResizeObserver() {
267
267
  });
268
268
  });
269
269
 
270
- this[resizeObserverSymbol].observe(this.parentElement);
270
+ requestAnimationFrame(() => {
271
+
272
+ let parent = this.parentNode;
273
+ while(!(parent instanceof HTMLElement) && parent !== null) {
274
+ parent = parent.parentNode;
275
+ }
276
+
277
+ if (parent instanceof HTMLElement) {
278
+ this[resizeObserverSymbol].observe(parent);
279
+ }
280
+
281
+
282
+ });
283
+
271
284
  }
272
285
 
273
286
  /**
@@ -12,10 +12,8 @@
12
12
  * SPDX-License-Identifier: AGPL-3.0
13
13
  */
14
14
 
15
- import { diff } from "../../../data/diff.mjs";
16
15
  import { addAttributeToken } from "../../../dom/attributes.mjs";
17
16
  import { ATTRIBUTE_ERRORMESSAGE } from "../../../dom/constants.mjs";
18
- import { isArray } from "../../../types/is.mjs";
19
17
  import { Datasource, dataSourceSymbol } from "../datasource.mjs";
20
18
  import { DatasourceStyleSheet } from "../stylesheet/datasource.mjs";
21
19
  import { instanceSymbol } from "../../../constants.mjs";
@@ -689,7 +689,18 @@ function attachResizeObserver() {
689
689
  });
690
690
  });
691
691
 
692
- this[resizeObserverSymbol].observe(this.parentElement);
692
+ requestAnimationFrame(() => {
693
+
694
+ let parent = this.parentNode;
695
+ while(!(parent instanceof HTMLElement) && parent !== null) {
696
+ parent = parent.parentNode;
697
+ }
698
+
699
+ if (parent instanceof HTMLElement) {
700
+ this[resizeObserverSymbol].observe(parent);
701
+ }
702
+ });
703
+
693
704
  }
694
705
 
695
706
  function disconnectResizeObserver() {
@@ -567,8 +567,21 @@ function updateResizeObserverObservation() {
567
567
  this[resizeObserverSymbol].observe(node);
568
568
  });
569
569
 
570
- if (this.parentElement === null) return;
571
- this[resizeObserverSymbol].observe(this.parentElement);
570
+ requestAnimationFrame(() => {
571
+
572
+ let parent = this.parentNode;
573
+ while(!(parent instanceof HTMLElement) && parent !== null) {
574
+ parent = parent.parentNode;
575
+ }
576
+
577
+ if (parent instanceof HTMLElement) {
578
+ this[resizeObserverSymbol].observe(parent);
579
+ }
580
+
581
+
582
+ });
583
+
584
+
572
585
  }
573
586
 
574
587
  /**
@@ -345,7 +345,20 @@ function attachResizeObserver() {
345
345
  });
346
346
  });
347
347
 
348
- this[resizeObserverSymbol].observe(this.parentElement);
348
+ requestAnimationFrame(() => {
349
+
350
+ let parent = this.parentNode;
351
+ while(!(parent instanceof HTMLElement) && parent !== null) {
352
+ parent = parent.parentNode;
353
+ }
354
+
355
+ if (parent instanceof HTMLElement) {
356
+ this[resizeObserverSymbol].observe(parent);
357
+ }
358
+
359
+
360
+ });
361
+
349
362
  }
350
363
 
351
364
  function disconnectResizeObserver() {
@@ -1097,7 +1097,20 @@ function attachResizeObserver() {
1097
1097
  });
1098
1098
  });
1099
1099
 
1100
- this[resizeObserverSymbol].observe(this.parentElement);
1100
+ requestAnimationFrame(() => {
1101
+
1102
+ let parent = this.parentNode;
1103
+ while(!(parent instanceof HTMLElement) && parent !== null) {
1104
+ parent = parent.parentNode;
1105
+ }
1106
+
1107
+ if (parent instanceof HTMLElement) {
1108
+ this[resizeObserverSymbol].observe(parent);
1109
+ }
1110
+
1111
+
1112
+ });
1113
+
1101
1114
  }
1102
1115
 
1103
1116
  /**
@@ -357,7 +357,20 @@ function attachResizeObserver() {
357
357
  });
358
358
  });
359
359
 
360
- this[resizeObserverSymbol].observe(this.parentElement);
360
+ requestAnimationFrame(() => {
361
+
362
+ let parent = this.parentNode;
363
+ while(!(parent instanceof HTMLElement) && parent !== null) {
364
+ parent = parent.parentNode;
365
+ }
366
+
367
+ if (parent instanceof HTMLElement) {
368
+ this[resizeObserverSymbol].observe(parent);
369
+ }
370
+
371
+
372
+ });
373
+
361
374
  }
362
375
 
363
376
  function disconnectResizeObserver() {
@@ -94,6 +94,7 @@ class RestAPI extends Server {
94
94
  write: {
95
95
  init: {
96
96
  method: "POST",
97
+ headers: null,
97
98
  },
98
99
  responseCallback: null,
99
100
  acceptedStatus: [200, 201],
@@ -117,6 +118,7 @@ class RestAPI extends Server {
117
118
  read: {
118
119
  init: {
119
120
  method: "GET",
121
+ headers: null,
120
122
  },
121
123
  path: null,
122
124
  responseCallback: null,
@@ -140,6 +142,11 @@ class RestAPI extends Server {
140
142
  let init = this.getOption("read.init");
141
143
  if (!isObject(init)) init = {};
142
144
  if (!init["method"]) init["method"] = "GET";
145
+ if (typeof init["headers"] !== "object") {
146
+ init["headers"] = {
147
+ "Accept": "application/json",
148
+ };
149
+ }
143
150
 
144
151
  let callback = this.getOption("read.responseCallback");
145
152
  if (!callback) {
@@ -161,6 +168,7 @@ class RestAPI extends Server {
161
168
  if (typeof init["headers"] !== "object") {
162
169
  init["headers"] = {
163
170
  "Content-Type": "application/json",
171
+ "Accept": "application/json",
164
172
  };
165
173
  }
166
174
  if (!init["method"]) init["method"] = "POST";