@kbach/react 0.6.24 → 0.6.25

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.
@@ -24,7 +24,7 @@ import {
24
24
  transformToWebProps,
25
25
  useConditionalGlobalDarkMode,
26
26
  useConditionalWidth
27
- } from "./chunk-GJSZUC6Q.mjs";
27
+ } from "./chunk-XISB5W3A.mjs";
28
28
 
29
29
  // src/jsx-runtime.tsx
30
30
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -2686,7 +2686,7 @@ var RESPONSIVE_KEY = "__kbach_responsive__";
2686
2686
  function getStore() {
2687
2687
  const g = globalThis;
2688
2688
  if (!g[RESPONSIVE_KEY]) {
2689
- g[RESPONSIVE_KEY] = { width: 0, screens: {}, listeners: /* @__PURE__ */ new Set() };
2689
+ g[RESPONSIVE_KEY] = { width: 0, notifiedWidth: 0, screens: {}, listeners: /* @__PURE__ */ new Set() };
2690
2690
  }
2691
2691
  return g[RESPONSIVE_KEY];
2692
2692
  }
@@ -2701,8 +2701,9 @@ function getGlobalScreens() {
2701
2701
  }
2702
2702
  function setGlobalWidth(width) {
2703
2703
  const store = getStore();
2704
- if (store.width === width) return;
2705
2704
  store.width = width;
2705
+ if (store.notifiedWidth === width) return;
2706
+ store.notifiedWidth = width;
2706
2707
  for (const l of store.listeners) l();
2707
2708
  }
2708
2709
  function getGlobalWidth() {
@@ -3273,7 +3274,7 @@ var KEY = "__kbach_dark_store__";
3273
3274
  function getStore2() {
3274
3275
  const g = globalThis;
3275
3276
  if (!g[KEY]) {
3276
- g[KEY] = { isDark: false, subscribers: /* @__PURE__ */ new Set() };
3277
+ g[KEY] = { isDark: false, notifiedIsDark: false, subscribers: /* @__PURE__ */ new Set() };
3277
3278
  }
3278
3279
  return g[KEY];
3279
3280
  }
@@ -3282,8 +3283,9 @@ function syncGlobalDarkMode(isDark) {
3282
3283
  }
3283
3284
  function setGlobalDarkMode(isDark) {
3284
3285
  const store = getStore2();
3285
- if (store.isDark === isDark) return;
3286
3286
  store.isDark = isDark;
3287
+ if (store.notifiedIsDark === isDark) return;
3288
+ store.notifiedIsDark = isDark;
3287
3289
  for (const sub of store.subscribers) sub();
3288
3290
  }
3289
3291
  function getGlobalDarkMode() {
package/dist/index.js CHANGED
@@ -2765,7 +2765,7 @@ var RESPONSIVE_KEY = "__kbach_responsive__";
2765
2765
  function getStore() {
2766
2766
  const g = globalThis;
2767
2767
  if (!g[RESPONSIVE_KEY]) {
2768
- g[RESPONSIVE_KEY] = { width: 0, screens: {}, listeners: /* @__PURE__ */ new Set() };
2768
+ g[RESPONSIVE_KEY] = { width: 0, notifiedWidth: 0, screens: {}, listeners: /* @__PURE__ */ new Set() };
2769
2769
  }
2770
2770
  return g[RESPONSIVE_KEY];
2771
2771
  }
@@ -2780,8 +2780,9 @@ function getGlobalScreens() {
2780
2780
  }
2781
2781
  function setGlobalWidth(width) {
2782
2782
  const store = getStore();
2783
- if (store.width === width) return;
2784
2783
  store.width = width;
2784
+ if (store.notifiedWidth === width) return;
2785
+ store.notifiedWidth = width;
2785
2786
  for (const l of store.listeners) l();
2786
2787
  }
2787
2788
  function getGlobalWidth() {
@@ -3352,7 +3353,7 @@ var KEY = "__kbach_dark_store__";
3352
3353
  function getStore2() {
3353
3354
  const g = globalThis;
3354
3355
  if (!g[KEY]) {
3355
- g[KEY] = { isDark: false, subscribers: /* @__PURE__ */ new Set() };
3356
+ g[KEY] = { isDark: false, notifiedIsDark: false, subscribers: /* @__PURE__ */ new Set() };
3356
3357
  }
3357
3358
  return g[KEY];
3358
3359
  }
@@ -3361,8 +3362,9 @@ function syncGlobalDarkMode(isDark) {
3361
3362
  }
3362
3363
  function setGlobalDarkMode(isDark) {
3363
3364
  const store = getStore2();
3364
- if (store.isDark === isDark) return;
3365
3365
  store.isDark = isDark;
3366
+ if (store.notifiedIsDark === isDark) return;
3367
+ store.notifiedIsDark = isDark;
3366
3368
  for (const sub of store.subscribers) sub();
3367
3369
  }
3368
3370
  function getGlobalDarkMode() {
package/dist/index.mjs CHANGED
@@ -42,7 +42,7 @@ import {
42
42
  useGlobalDarkMode,
43
43
  useGlobalWidth,
44
44
  useSyncExternalStore
45
- } from "./chunk-GJSZUC6Q.mjs";
45
+ } from "./chunk-XISB5W3A.mjs";
46
46
 
47
47
  // src/context.tsx
48
48
  import { createContext, useContext } from "react";
@@ -2723,7 +2723,7 @@ var RESPONSIVE_KEY = "__kbach_responsive__";
2723
2723
  function getStore() {
2724
2724
  const g = globalThis;
2725
2725
  if (!g[RESPONSIVE_KEY]) {
2726
- g[RESPONSIVE_KEY] = { width: 0, screens: {}, listeners: /* @__PURE__ */ new Set() };
2726
+ g[RESPONSIVE_KEY] = { width: 0, notifiedWidth: 0, screens: {}, listeners: /* @__PURE__ */ new Set() };
2727
2727
  }
2728
2728
  return g[RESPONSIVE_KEY];
2729
2729
  }
@@ -3270,7 +3270,7 @@ var KEY = "__kbach_dark_store__";
3270
3270
  function getStore2() {
3271
3271
  const g = globalThis;
3272
3272
  if (!g[KEY]) {
3273
- g[KEY] = { isDark: false, subscribers: /* @__PURE__ */ new Set() };
3273
+ g[KEY] = { isDark: false, notifiedIsDark: false, subscribers: /* @__PURE__ */ new Set() };
3274
3274
  }
3275
3275
  return g[KEY];
3276
3276
  }
@@ -3,8 +3,8 @@ import {
3
3
  Fragment,
4
4
  jsx,
5
5
  jsxs
6
- } from "./chunk-YUX2JPTM.mjs";
7
- import "./chunk-GJSZUC6Q.mjs";
6
+ } from "./chunk-RUI5EQDF.mjs";
7
+ import "./chunk-XISB5W3A.mjs";
8
8
 
9
9
  // src/jsx-dev-runtime.tsx
10
10
  function jsxDEV(type, props, key, isStaticChildren, source, self) {
@@ -2724,7 +2724,7 @@ var RESPONSIVE_KEY = "__kbach_responsive__";
2724
2724
  function getStore() {
2725
2725
  const g = globalThis;
2726
2726
  if (!g[RESPONSIVE_KEY]) {
2727
- g[RESPONSIVE_KEY] = { width: 0, screens: {}, listeners: /* @__PURE__ */ new Set() };
2727
+ g[RESPONSIVE_KEY] = { width: 0, notifiedWidth: 0, screens: {}, listeners: /* @__PURE__ */ new Set() };
2728
2728
  }
2729
2729
  return g[RESPONSIVE_KEY];
2730
2730
  }
@@ -3271,7 +3271,7 @@ var KEY = "__kbach_dark_store__";
3271
3271
  function getStore2() {
3272
3272
  const g = globalThis;
3273
3273
  if (!g[KEY]) {
3274
- g[KEY] = { isDark: false, subscribers: /* @__PURE__ */ new Set() };
3274
+ g[KEY] = { isDark: false, notifiedIsDark: false, subscribers: /* @__PURE__ */ new Set() };
3275
3275
  }
3276
3276
  return g[KEY];
3277
3277
  }
@@ -4,10 +4,10 @@ import {
4
4
  _invalidateDefaultFontCache,
5
5
  jsx,
6
6
  jsxs
7
- } from "./chunk-YUX2JPTM.mjs";
7
+ } from "./chunk-RUI5EQDF.mjs";
8
8
  import {
9
9
  registerWebElement
10
- } from "./chunk-GJSZUC6Q.mjs";
10
+ } from "./chunk-XISB5W3A.mjs";
11
11
  export {
12
12
  Fragment,
13
13
  _invalidateDefaultFontCache,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kbach/react",
3
- "version": "0.6.24",
3
+ "version": "0.6.25",
4
4
  "description": "React / React Native components and hooks for the Kbach framework",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./dist/index.js",