@mittwald/flow-react-components 0.1.0-alpha.232 → 0.1.0-alpha.233

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/dist/List.js CHANGED
@@ -40,7 +40,7 @@ import { useReactTable as Se, getCoreRowModel as ve, getSortedRowModel as ye, ge
40
40
  import vt from "invariant";
41
41
  import { getAsyncResource as mt } from "@mittwald/react-use-promise";
42
42
  import { u as ht } from "./useSelector-DpU7_HMO.js";
43
- import { u as Te } from "./SettingsProvider-CiU-3ZFI.js";
43
+ import { u as Te } from "./SettingsProvider-D2-kWC3S.js";
44
44
  import * as W from "react-aria-components";
45
45
  import { S as A } from "./SkeletonText-B5ZghZhO.js";
46
46
  import { I as Ce } from "./IllustratedMessage-B3MHD01M.js";
@@ -1,16 +1,16 @@
1
1
  "use client"
2
2
  /* */
3
- var p = Object.defineProperty;
4
- var f = (s, t, e) => t in s ? p(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
5
- var c = (s, t, e) => f(s, typeof t != "symbol" ? t + "" : t, e);
6
- import d, { createContext as w, useRef as y, useMemo as J, useEffect as v, useContext as O } from "react";
7
- import { makeAutoObservable as m, ObservableMap as a, autorun as K } from "mobx";
8
- import { usePromise as P } from "@mittwald/react-use-promise";
9
- import { mapValues as b } from "remeda";
3
+ var d = Object.defineProperty;
4
+ var w = (s, t, e) => t in s ? d(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
5
+ var c = (s, t, e) => w(s, typeof t != "symbol" ? t + "" : t, e);
6
+ import y, { createContext as J, useRef as v, useMemo as O, useEffect as K, useContext as b } from "react";
7
+ import { makeAutoObservable as l, ObservableMap as a, autorun as x } from "mobx";
8
+ import { getAsyncResource as A } from "@mittwald/react-use-promise";
9
+ import { mapValues as E } from "remeda";
10
10
  class i {
11
11
  constructor(t = new a()) {
12
12
  c(this, "settings");
13
- this.settings = t, m(this);
13
+ this.settings = t, l(this);
14
14
  }
15
15
  set(t, e, n) {
16
16
  this.settings.set(t, e.parse(n));
@@ -31,7 +31,7 @@ class i {
31
31
  class g {
32
32
  constructor(t = new a()) {
33
33
  c(this, "componentSettings");
34
- this.componentSettings = t, m(this);
34
+ this.componentSettings = t, l(this);
35
35
  }
36
36
  set(t, e, n, o) {
37
37
  const r = this.componentSettings.get(t) ?? new i();
@@ -53,11 +53,11 @@ class g {
53
53
  );
54
54
  }
55
55
  static fromJson(t) {
56
- const e = b(t, (n) => i.fromJson(n));
56
+ const e = E(t, (n) => i.fromJson(n));
57
57
  return new g(new a(e));
58
58
  }
59
59
  }
60
- class x {
60
+ class P {
61
61
  constructor(t) {
62
62
  c(this, "storageKey");
63
63
  this.storageKey = t;
@@ -70,32 +70,29 @@ class x {
70
70
  localStorage.setItem(this.storageKey, JSON.stringify(t));
71
71
  }
72
72
  }
73
- const E = (s) => {
73
+ const R = (s) => {
74
74
  switch (s.type) {
75
75
  case "custom":
76
76
  return s.store;
77
77
  case "localStorage":
78
- return new x(s.storageKey);
78
+ return new P(s.storageKey);
79
79
  }
80
80
  throw new Error(`Unsupported setting backend: ${s}`);
81
- }, l = w(void 0), C = () => O(l), M = (s) => {
82
- const { children: t, id: e, ...n } = s, o = E(n), r = y(Promise.resolve()), S = P(() => o.load(), [], {
81
+ }, S = J(void 0), M = () => b(S), N = (s) => {
82
+ const { children: t, id: e, ...n } = s, o = R(n), r = A(() => o.load(), [], {
83
83
  loaderId: e
84
- }), u = J(
85
- () => g.fromJson(S),
84
+ }), h = r.use(), u = v(Promise.resolve()), m = O(
85
+ () => g.fromJson(h),
86
86
  [e]
87
- );
88
- return v(
89
- () => K(() => {
90
- const h = u.asJson;
91
- r.current = r.current.then(
92
- () => o.store(h)
93
- );
94
- }),
95
- [e]
96
- ), /* @__PURE__ */ d.createElement(l.Provider, { value: u }, t);
87
+ ), p = () => {
88
+ const f = m.asJson;
89
+ u.current = u.current.then(async () => {
90
+ await o.store(f), r.refresh();
91
+ });
92
+ };
93
+ return K(() => x(p), [e]), /* @__PURE__ */ y.createElement(S.Provider, { value: m }, t);
97
94
  };
98
95
  export {
99
- M as S,
100
- C as u
96
+ N as S,
97
+ M as u
101
98
  };
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
  /* */
3
- import { S as t } from "./SettingsProvider-CiU-3ZFI.js";
3
+ import { S as t } from "./SettingsProvider-D2-kWC3S.js";
4
4
  export {
5
5
  t as SettingsProvider,
6
6
  t as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.1.0-alpha.232",
3
+ "version": "0.1.0-alpha.233",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -305,7 +305,7 @@
305
305
  "@chakra-ui/live-region": "^2.1.0",
306
306
  "@internationalized/date": "^3.5.5",
307
307
  "@internationalized/string-compiler": "^3.2.4",
308
- "@mittwald/react-tunnel": "^0.1.0-alpha.232",
308
+ "@mittwald/react-tunnel": "^0.1.0-alpha.233",
309
309
  "@mittwald/react-use-promise": "^2.4.0",
310
310
  "@react-aria/utils": "^3.25.2",
311
311
  "@react-types/shared": "^3.24.1",
@@ -332,7 +332,7 @@
332
332
  },
333
333
  "devDependencies": {
334
334
  "@faker-js/faker": "^8.4.1",
335
- "@mittwald/flow-design-tokens": "^0.1.0-alpha.232",
335
+ "@mittwald/flow-design-tokens": "^0.1.0-alpha.233",
336
336
  "@mittwald/react-use-promise": "^2.4.0",
337
337
  "@nx/storybook": "^19.6.4",
338
338
  "@storybook/addon-a11y": "^8.2.9",
@@ -410,5 +410,5 @@
410
410
  "optional": true
411
411
  }
412
412
  },
413
- "gitHead": "ea6692d9c22caa6c48744707d04b820749b67e1d"
413
+ "gitHead": "8b5b184871cfc32f165e6835279da09d76d57576"
414
414
  }