zois-core 2.0.3 → 2.0.4

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.
@@ -108,6 +108,8 @@ class ButtonShard extends Shard {
108
108
  textElement = document.createElement("span");
109
109
  textElement.textContent = text;
110
110
  textElement.style.height = "100%";
111
+ textElement.style.display = "grid";
112
+ textElement.style.placeContent = "center";
111
113
  textElement.style.overflow = "scroll";
112
114
  btn.append(textElement);
113
115
  }
@@ -15,6 +15,7 @@ class CheckboxShard extends Shard {
15
15
  display: "flex",
16
16
  alignItems: "center",
17
17
  justifyContent: "center",
18
+ flexShrink: "0",
18
19
  transition: "background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
19
20
  appearance: "none"
20
21
  },
@@ -33,10 +33,12 @@ class Shard {
33
33
  for (const key of Object.keys(modules)) {
34
34
  for (const module of modules[key] ?? []) {
35
35
  if (module instanceof ShardModule) {
36
- try {
37
- this.context = module.overrideContext(this.context, this.body[key]);
38
- } catch (e) {
39
- logger.error("OverrideContext call failed in", module, e);
36
+ if (this.body?.[key]) {
37
+ try {
38
+ this.context = module.overrideContext(this.context, this.body[key]);
39
+ } catch (e) {
40
+ logger.error("OverrideContext call failed in", module, e);
41
+ }
40
42
  }
41
43
  }
42
44
  }
@@ -46,10 +48,12 @@ class Shard {
46
48
  for (const key of Object.keys(modules)) {
47
49
  for (const module of modules[key] ?? []) {
48
50
  if (module instanceof ShardModule) {
49
- try {
50
- module.layoutEffect(this.context, this.body[key]);
51
- } catch (e) {
52
- logger.error("LayoutEffect call failed in", module, e);
51
+ if (this.body?.[key]) {
52
+ try {
53
+ module.layoutEffect(this.context, this.body[key]);
54
+ } catch (e) {
55
+ logger.error("LayoutEffect call failed in", module, e);
56
+ }
53
57
  }
54
58
  }
55
59
  }
@@ -59,10 +63,12 @@ class Shard {
59
63
  for (const key of Object.keys(modules)) {
60
64
  for (const module of modules[key] ?? []) {
61
65
  if (module instanceof ShardModule) {
62
- try {
63
- module.effect(this.context, this.body[key]);
64
- } catch (e) {
65
- logger.error("Effect call failed in", module, e);
66
+ if (this.body?.[key]) {
67
+ try {
68
+ module.effect(this.context, this.body[key]);
69
+ } catch (e) {
70
+ logger.error("Effect call failed in", module, e);
71
+ }
66
72
  }
67
73
  }
68
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zois-core",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "The core for the my mods, which contains a shared code reused in all my mods",
5
5
  "bin": {
6
6
  "zois-core": "scripts/zois-core.mjs"