@declarion/react 0.163.0 → 0.168.0

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.
@@ -35,7 +35,7 @@ function p() {
35
35
  function m(e, n = !0) {
36
36
  let i = l(), a = t(i), s = e ? JSON.stringify(e) : "";
37
37
  o(() => {
38
- n && e && r.getState().registerQueryKey(a, e);
38
+ n && s && r.getState().registerQueryKey(a, JSON.parse(s));
39
39
  }, [
40
40
  a,
41
41
  s,
@@ -1,27 +1,29 @@
1
1
  import { useTabStore as e } from "../stores/tabs.js";
2
2
  import { useEmbed as t } from "../embed/EmbedContext.js";
3
3
  import { useText as n } from "./useText.js";
4
- import { useEffect as r } from "react";
4
+ import { useEffect as r, useRef as i } from "react";
5
5
  // src/hooks/useRegisterScreenTab.ts
6
- function i(n, i, a, o) {
7
- let s = t();
6
+ function a(n, a, o, s) {
7
+ let c = t(), l = i(s);
8
8
  r(() => {
9
- n && !s.enabled && e.getState().openTab({
9
+ l.current = s;
10
+ }, [s]), r(() => {
11
+ n && !c.enabled && e.getState().openTab({
10
12
  pathname: n,
11
- search: o,
12
- title: i,
13
- icon: a,
13
+ search: l.current,
14
+ title: a,
15
+ icon: o,
14
16
  closable: !0
15
17
  });
16
18
  }, [
17
19
  n,
18
- i,
19
20
  a,
20
- s.enabled
21
+ o,
22
+ c.enabled
21
23
  ]);
22
24
  }
23
- function a(e, t, r) {
24
- let a = n(), o = e?.route, s = t ? a(e?.display?.name) || a(t.display.name_plural) : "", c = e?.display?.icon || t?.display.icon;
25
- i(t ? o : void 0, s, c, r);
25
+ function o(e, t, r) {
26
+ let i = n(), o = e?.route, s = t ? i(e?.display?.name) || i(t.display.name_plural) : "", c = e?.display?.icon || t?.display.icon;
27
+ a(t ? o : void 0, s, c, r);
26
28
  }
27
- export { a as useRegisterScreenTab, i as useScreenTabRegistration };
29
+ export { o as useRegisterScreenTab, a as useScreenTabRegistration };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@declarion/react",
3
- "version": "0.163.0",
3
+ "version": "0.168.0",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "description": "React SDK for Declarion, the schema-driven business apps platform.",