@nivaro/react 0.3.35 → 0.3.36

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.
@@ -1,6 +1,6 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { useMemo as p } from "react";
3
- import { ItemEditForm as x } from "../ItemEditForm.js";
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useMemo as x } from "react";
3
+ import { ItemEditForm as p } from "../ItemEditForm.js";
4
4
  import { PlacementTextContext as h } from "../item-edit/placement-behaviour.js";
5
5
  import { RecordReadView as C } from "../RecordReadView.js";
6
6
  import { PdfCanvas as P } from "./canvases/PdfCanvas.js";
@@ -21,34 +21,42 @@ function T(e) {
21
21
  }
22
22
  }
23
23
  function F(e) {
24
- const { data: t = [] } = s(e.collection);
25
- return /* @__PURE__ */ r(w, { ...e, fields: t });
24
+ const { data: r = [] } = s(e.collection);
25
+ return /* @__PURE__ */ t(w, { ...e, fields: r });
26
26
  }
27
27
  function b(e) {
28
- const { data: t = [] } = s(e.collection);
29
- return /* @__PURE__ */ r(P, { ...e, fields: t });
28
+ const { data: r = [] } = s(e.collection);
29
+ return /* @__PURE__ */ t(P, { ...e, fields: r });
30
30
  }
31
31
  function N({
32
32
  collection: e,
33
- bundle: t,
33
+ bundle: r,
34
34
  layout: l,
35
- record: d,
35
+ record: m,
36
36
  stateKey: n = null,
37
- roleId: m = null,
38
- design: o,
37
+ roleId: d = null,
38
+ design: a,
39
39
  apply: c,
40
40
  whenIdle: u
41
41
  }) {
42
- const a = T(String(t.layout.layout_type ?? "grouped")), v = p(() => ({ stateKey: n, roleId: m }), [n, m]);
43
- let i;
44
- return a === "item-edit-form" ? i = /* @__PURE__ */ r(
45
- x,
42
+ const i = T(String(r.layout.layout_type ?? "grouped")), v = x(() => ({ stateKey: n, roleId: d }), [n, d]);
43
+ let o;
44
+ return i === "item-edit-form" ? o = /* @__PURE__ */ t(
45
+ p,
46
46
  {
47
47
  collection: e,
48
48
  documentTitle: !1,
49
- design: { layout: l, record: d, context: o, stateKey: n }
49
+ design: { layout: l, record: m, context: a, stateKey: n }
50
50
  }
51
- ) : a === "read-view" ? i = /* @__PURE__ */ r(C, { collection: e, design: { layout: l, record: d, context: o } }) : a === "pdf" ? i = /* @__PURE__ */ r(f.Provider, { value: o, children: /* @__PURE__ */ r(b, { bundle: t, collection: e, whenIdle: u }) }) : i = /* @__PURE__ */ r(f.Provider, { value: o, children: /* @__PURE__ */ r(F, { bundle: t, apply: c, collection: e }) }), /* @__PURE__ */ r("div", { "data-editor-canvas": "", "data-renderer": a, className: "flex min-h-full flex-col", children: /* @__PURE__ */ r(h.Provider, { value: v, children: i }) });
51
+ ) : i === "read-view" ? o = /* @__PURE__ */ t(C, { collection: e, design: { layout: l, record: m, context: a } }) : i === "pdf" ? o = /* @__PURE__ */ t(f.Provider, { value: a, children: /* @__PURE__ */ t(b, { bundle: r, collection: e, whenIdle: u }) }) : o = /* @__PURE__ */ t(f.Provider, { value: a, children: /* @__PURE__ */ t(F, { bundle: r, apply: c, collection: e }) }), /* @__PURE__ */ t(
52
+ "div",
53
+ {
54
+ "data-editor-canvas": "",
55
+ "data-renderer": i,
56
+ className: i === "item-edit-form" ? "flex min-h-0 flex-1 flex-col" : "flex flex-1 flex-col",
57
+ children: /* @__PURE__ */ t(h.Provider, { value: v, children: o })
58
+ }
59
+ );
52
60
  }
53
61
  export {
54
62
  N as EditorCanvas,