@mittwald/flow-react-components 0.1.0-alpha.273 → 0.1.0-alpha.274

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
@@ -39,7 +39,7 @@ import { useReactTable as yt, getCoreRowModel as Et, getSortedRowModel as Ft, ge
39
39
  import ye from "invariant";
40
40
  import { getAsyncResource as he } from "@mittwald/react-use-promise";
41
41
  import { u as ge } from "./useSelector-DpU7_HMO.js";
42
- import { u as Lt } from "./SettingsProvider-54X6WkBH.js";
42
+ import { u as Lt } from "./SettingsProvider-D9oDS5r9.js";
43
43
  import * as _ from "react-aria-components";
44
44
  import { S as B } from "./SkeletonText-B5ZghZhO.js";
45
45
  import { I as Pt } from "./IllustratedMessage-B3MHD01M.js";
@@ -1,20 +1,20 @@
1
1
  "use client"
2
2
  /* */
3
- var w = Object.defineProperty;
4
- var J = (s, t, e) => t in s ? w(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var y = Object.defineProperty;
4
+ var J = (s, t, e) => t in s ? y(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
5
5
  var c = (s, t, e) => J(s, typeof t != "symbol" ? t + "" : t, e);
6
- import O, { createContext as b, useContext as j, useRef as v, useMemo as x, useEffect as E } from "react";
7
- import { toJS as l, makeAutoObservable as p, ObservableMap as a, autorun as K } from "mobx";
8
- import { getAsyncResource as A } from "@mittwald/react-use-promise";
6
+ import O, { createContext as b, useContext as v, useRef as x, useMemo as K, useEffect as j } from "react";
7
+ import { makeAutoObservable as l, ObservableMap as a, toJS as E, autorun as P } from "mobx";
8
+ import { getAsyncResource as R } from "@mittwald/react-use-promise";
9
9
  import { mapValues as g } from "remeda";
10
- const P = (s) => Object.fromEntries(l(s).entries());
10
+ const h = (s) => Object.fromEntries(s.entries());
11
11
  class i {
12
12
  constructor(t = new a()) {
13
13
  c(this, "settings");
14
- this.settings = t, p(this);
14
+ this.settings = t, l(this);
15
15
  }
16
16
  set(t, e, n) {
17
- this.settings.set(t, e.parse(l(n)));
17
+ this.settings.set(t, e.parse(E(n)));
18
18
  }
19
19
  get(t, e) {
20
20
  return e.parse(this.settings.get(t));
@@ -23,7 +23,7 @@ class i {
23
23
  this.settings.delete(t);
24
24
  }
25
25
  get asJson() {
26
- return g(P(this.settings), (t) => JSON.stringify(t));
26
+ return g(h(this.settings), (t) => JSON.stringify(t));
27
27
  }
28
28
  static fromJson(t) {
29
29
  return new i(
@@ -36,7 +36,7 @@ class i {
36
36
  class u {
37
37
  constructor(t = new a()) {
38
38
  c(this, "componentSettings");
39
- this.componentSettings = t, p(this);
39
+ this.componentSettings = t, l(this);
40
40
  }
41
41
  set(t, e, n, o) {
42
42
  const r = this.componentSettings.get(t) ?? new i();
@@ -50,19 +50,14 @@ class u {
50
50
  (n = this.componentSettings.get(t)) == null || n.clear(e);
51
51
  }
52
52
  get asJson() {
53
- return Object.fromEntries(
54
- Array.from(this.componentSettings.entries()).map(([t, e]) => [
55
- t,
56
- e.asJson
57
- ])
58
- );
53
+ return g(h(this.componentSettings), (t) => t.asJson);
59
54
  }
60
55
  static fromJson(t) {
61
56
  const e = g(t, (n) => i.fromJson(n));
62
57
  return new u(new a(e));
63
58
  }
64
59
  }
65
- class R {
60
+ class A {
66
61
  constructor(t) {
67
62
  c(this, "storageKey");
68
63
  this.storageKey = t;
@@ -80,22 +75,22 @@ const I = (s) => {
80
75
  case "custom":
81
76
  return s.store;
82
77
  case "localStorage":
83
- return new R(s.storageKey);
78
+ return new A(s.storageKey);
84
79
  }
85
80
  throw new Error(`Unsupported setting backend: ${s}`);
86
- }, h = b(void 0), F = () => j(h), L = (s) => {
87
- const { children: t, id: e, ...n } = s, o = I(n), r = A(() => o.load(), [], {
81
+ }, p = b(void 0), F = () => v(p), L = (s) => {
82
+ const { children: t, id: e, ...n } = s, o = I(n), r = R(() => o.load(), [], {
88
83
  loaderId: e
89
- }), f = r.use(), m = v(Promise.resolve()), S = x(
84
+ }), f = r.use(), m = x(Promise.resolve()), S = K(
90
85
  () => u.fromJson(f),
91
86
  [e]
92
87
  ), d = () => {
93
- const y = S.asJson;
88
+ const w = S.asJson;
94
89
  m.current = m.current.then(async () => {
95
- await o.store(y), r.refresh();
90
+ await o.store(w), r.refresh();
96
91
  });
97
92
  };
98
- return E(() => K(d), [e]), /* @__PURE__ */ O.createElement(h.Provider, { value: S }, t);
93
+ return j(() => P(d), [e]), /* @__PURE__ */ O.createElement(p.Provider, { value: S }, t);
99
94
  };
100
95
  export {
101
96
  L as S,
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
  /* */
3
- import { S as t } from "./SettingsProvider-54X6WkBH.js";
3
+ import { S as t } from "./SettingsProvider-D9oDS5r9.js";
4
4
  export {
5
5
  t as SettingsProvider,
6
6
  t as default
@@ -9,7 +9,7 @@ export declare class SettingsStore {
9
9
  get<T extends ZodSchema>(componentName: FlowComponentName, settingKey: string, schema: T): z.infer<T>;
10
10
  clear(componentName: FlowComponentName, settingKey: string): void;
11
11
  get asJson(): {
12
- [k: string]: import('./ComponentSettings').ComponentSettingsJson;
12
+ [x: string]: import('./ComponentSettings').ComponentSettingsJson;
13
13
  };
14
14
  static fromJson(json: SettingsJson): SettingsStore;
15
15
  }
@@ -1,2 +1,2 @@
1
1
  import { ObservableMap } from 'mobx';
2
- export declare const mobxMapToObject: (map: ObservableMap) => any;
2
+ export declare const mobxMapToObject: <T>(map: ObservableMap<string, T>) => Record<string, T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.1.0-alpha.273",
3
+ "version": "0.1.0-alpha.274",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -313,7 +313,7 @@
313
313
  "@chakra-ui/live-region": "^2.1.0",
314
314
  "@internationalized/date": "^3.5.5",
315
315
  "@internationalized/string-compiler": "^3.2.4",
316
- "@mittwald/react-tunnel": "^0.1.0-alpha.273",
316
+ "@mittwald/react-tunnel": "^0.1.0-alpha.274",
317
317
  "@mittwald/react-use-promise": "^2.5.0",
318
318
  "@react-aria/utils": "^3.25.2",
319
319
  "@react-types/shared": "^3.24.1",
@@ -340,7 +340,7 @@
340
340
  },
341
341
  "devDependencies": {
342
342
  "@faker-js/faker": "^9.0.1",
343
- "@mittwald/flow-design-tokens": "^0.1.0-alpha.273",
343
+ "@mittwald/flow-design-tokens": "^0.1.0-alpha.274",
344
344
  "@mittwald/react-use-promise": "^2.5.0",
345
345
  "@nx/storybook": "^19.7.4",
346
346
  "@storybook/addon-a11y": "^8.3.2",
@@ -418,5 +418,5 @@
418
418
  "optional": true
419
419
  }
420
420
  },
421
- "gitHead": "fc26f49e7a750c4603590d2fae6562745d5d9b92"
421
+ "gitHead": "dcbe0e6b6dbd1ba4a4fddb6aabf4883c3070a3f4"
422
422
  }