treege 3.0.0-beta.80 → 3.0.0-beta.81

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/editor.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as e } from "./editor-Dw_ODEe1.js";
2
- import { n as t, t as n } from "./ThemeContext-DeWmeqHK.js";
1
+ import { t as e } from "./editor-h20-TVM8.js";
2
+ import { n as t, t as n } from "./ThemeContext-BgTIhoK6.js";
3
3
  export { n as ThemeProvider, e as TreegeEditor, t as useTheme };
package/dist/main.js CHANGED
@@ -1,6 +1,6 @@
1
- import { t as e } from "./editor-Dw_ODEe1.js";
2
- import { B as t, H as n, M as r, N as i, U as a, V as o, a as s, c, g as l, h as u, i as d, l as f, m as p, n as m, o as h, r as g, s as _, t as v, z as y } from "./ThemeContext-DeWmeqHK.js";
3
- import { C as b, L as x, S, _ as C, a as w, b as T, c as E, d as D, g as O, h as k, i as A, m as j, n as M, o as N, r as P, u as F, v as I, x as L, y as R } from "./DefaultSubmitButton-Bk5U_6Qm.js";
4
- import { a as z, c as B, i as V, l as H, n as U, o as W, r as G, s as K } from "./useRenderNode-BZ7fZJxT.js";
5
- import { i as q, n as J, r as Y, t as X } from "./renderer-CN83AtIp.js";
6
- export { b as DefaultAddressInput, S as DefaultAutocompleteInput, L as DefaultCheckboxInput, T as DefaultDateInput, R as DefaultDateRangeInput, I as DefaultFileInput, C as DefaultHiddenInput, O as DefaultHttpInput, x as DefaultInputLabel, k as DefaultNumberInput, j as DefaultPasswordInput, D as DefaultRadioInput, F as DefaultSelectInput, E as DefaultSwitchInput, N as DefaultTextAreaInput, w as DefaultTextInput, A as DefaultTimeInput, P as DefaultTimeRangeInput, J as Divider, v as ThemeProvider, Y as Title, e as TreegeEditor, X as TreegeRenderer, B as TreegeRendererProvider, g as applyReferenceTransformation, d as buildInitialFormValues, s as calculateReferenceFieldUpdates, h as checkFormFieldHasValue, _ as convertFormValuesToNamedFormat, M as defaultInputRenderers, q as defaultUI, W as evaluateCondition, K as evaluateConditions, p as fileToSerializable, u as filesToSerializable, G as findStartNode, V as getFlowRenderState, y as getStaticTranslations, t as getTranslatedText, c as isFieldEmpty, o as isGroupNode, n as isInputNode, z as isStartNode, a as isUINode, f as resolveNodeDefaultValue, r as sanitize, i as sanitizeHttpResponse, l as serializableToFile, m as useTheme, U as useTreegeRenderer, H as useTreegeRendererConfig };
1
+ import { t as e } from "./editor-h20-TVM8.js";
2
+ import { F as t, G as n, H as r, P as i, U as a, V as o, W as s, _ as c, a as l, c as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, r as v, s as y, t as b, v as x } from "./ThemeContext-BgTIhoK6.js";
3
+ import { C as S, L as C, S as w, _ as T, a as E, b as D, c as O, d as k, g as A, h as j, i as M, m as N, n as P, o as F, r as I, u as L, v as R, x as z, y as B } from "./DefaultSubmitButton-Dg9GPvh-.js";
4
+ import { a as V, c as H, i as U, l as W, n as G, o as K, r as q, s as J } from "./useRenderNode-B1sfwbia.js";
5
+ import { i as Y, n as X, r as Z, t as Q } from "./renderer-DI6nF4St.js";
6
+ export { S as DefaultAddressInput, w as DefaultAutocompleteInput, z as DefaultCheckboxInput, D as DefaultDateInput, B as DefaultDateRangeInput, R as DefaultFileInput, T as DefaultHiddenInput, A as DefaultHttpInput, C as DefaultInputLabel, j as DefaultNumberInput, N as DefaultPasswordInput, k as DefaultRadioInput, L as DefaultSelectInput, O as DefaultSwitchInput, F as DefaultTextAreaInput, E as DefaultTextInput, M as DefaultTimeInput, I as DefaultTimeRangeInput, X as Divider, b as ThemeProvider, Z as Title, e as TreegeEditor, Q as TreegeRenderer, H as TreegeRendererProvider, v as applyReferenceTransformation, p as buildInitialFormValues, l as calculateReferenceFieldUpdates, _ as checkFormFieldHasValue, y as convertFormValuesToNamedFormat, P as defaultInputRenderers, Y as defaultUI, K as evaluateCondition, J as evaluateConditions, h as fileToSerializable, f as filesToSerializable, q as findStartNode, d as formatFileSize, U as getFlowRenderState, o as getStaticTranslations, r as getTranslatedText, u as isFieldEmpty, a as isGroupNode, s as isInputNode, V as isStartNode, n as isUINode, c as normalizeSerializableFiles, m as resolveNodeDefaultValue, i as sanitize, t as sanitizeHttpResponse, x as serializableToFile, g as useTheme, G as useTreegeRenderer, W as useTreegeRendererConfig };
@@ -1,13 +1,5 @@
1
- /**
2
- * Represents a serializable file object with base64 data
3
- */
4
- export interface SerializableFile {
5
- name: string;
6
- size: number;
7
- type: string;
8
- lastModified: number;
9
- data: string;
10
- }
1
+ import { SerializableFile } from '../../shared/types/file';
2
+ export type { SerializableFile };
11
3
  /**
12
4
  * Converts a File object to a serializable format with base64 data
13
5
  */
@@ -20,3 +12,12 @@ export declare const serializableToFile: (serializable: SerializableFile) => Fil
20
12
  * Converts multiple File objects to serializable format
21
13
  */
22
14
  export declare const filesToSerializable: (files: File[]) => Promise<SerializableFile[]>;
15
+ /**
16
+ * Normalizes a file field value into an array of `SerializableFile`.
17
+ * Handles single file, array of files, and empty (`null`/`undefined`) values.
18
+ */
19
+ export declare const normalizeSerializableFiles: (value: SerializableFile | SerializableFile[] | null | undefined) => SerializableFile[];
20
+ /**
21
+ * Formats a byte size into a human-readable string (B / KB / MB)
22
+ */
23
+ export declare const formatFileSize: (size: number) => string;
@@ -1,6 +1,6 @@
1
- import { F as e, H as t, P as n, j as r, t as i } from "./ThemeContext-DeWmeqHK.js";
2
- import { B as a, H as o, L as s, R as c, V as l, ct as u, et as d, n as f, t as p, z as m } from "./DefaultSubmitButton-Bk5U_6Qm.js";
3
- import { a as h, l as g, n as _, t as v } from "./useRenderNode-BZ7fZJxT.js";
1
+ import { I as e, L as t, N as n, W as r, t as i } from "./ThemeContext-BgTIhoK6.js";
2
+ import { B as a, H as o, L as s, R as c, V as l, ct as u, et as d, n as f, t as p, z as m } from "./DefaultSubmitButton-Dg9GPvh-.js";
3
+ import { a as h, l as g, n as _, t as v } from "./useRenderNode-B1sfwbia.js";
4
4
  import { useCallback as y, useMemo as b, useState as x } from "react";
5
5
  import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
6
6
  //#region src/renderer/features/TreegeRenderer/web/components/DefaultFormWrapper.tsx
@@ -10,8 +10,8 @@ var ee = ({ children: e, id: t, onSubmit: n }) => /* @__PURE__ */ C("form", {
10
10
  className: "tg:mx-auto tg:max-w-2xl tg:gap-y-3",
11
11
  children: e
12
12
  }), T = ({ children: e, missingFields: t = [] }) => {
13
- let n = t.length > 0, i = r();
14
- return n ? /* @__PURE__ */ C(l, { children: /* @__PURE__ */ w(m, { children: [/* @__PURE__ */ C(o, {
13
+ let r = t.length > 0, i = n();
14
+ return r ? /* @__PURE__ */ C(l, { children: /* @__PURE__ */ w(m, { children: [/* @__PURE__ */ C(o, {
15
15
  asChild: !0,
16
16
  children: /* @__PURE__ */ C("span", {
17
17
  className: "tg:inline-flex",
@@ -27,8 +27,8 @@ var ee = ({ children: e, id: t, onSubmit: n }) => /* @__PURE__ */ C("form", {
27
27
  children: t.map((e, t) => /* @__PURE__ */ C("li", { children: e }, t))
28
28
  })]
29
29
  }) })] }) }) : e;
30
- }, te = ({ step: e, label: n, children: i, canGoBack: a, isLastStep: o, canContinue: s, isSubmitting: c, onBack: l, onContinue: u, missingFields: d }) => {
31
- let f = r(), m = g(), h = m?.components?.submitButton || p, _ = m?.components?.submitButtonWrapper || T, v = !s || c, y = e.nodes.find((e) => t(e) && e.data.type === "submit"), b = y && t(y) ? f(y.data.label) : void 0, x = /* @__PURE__ */ C(h, {
30
+ }, te = ({ step: e, label: t, children: i, canGoBack: a, isLastStep: o, canContinue: s, isSubmitting: c, onBack: l, onContinue: u, missingFields: d }) => {
31
+ let f = n(), m = g(), h = m?.components?.submitButton || p, _ = m?.components?.submitButtonWrapper || T, v = !s || c, y = e.nodes.find((e) => r(e) && e.data.type === "submit"), b = y && r(y) ? f(y.data.label) : void 0, x = /* @__PURE__ */ C(h, {
32
32
  type: "button",
33
33
  onClick: u,
34
34
  disabled: v,
@@ -38,9 +38,9 @@ var ee = ({ children: e, id: t, onSubmit: n }) => /* @__PURE__ */ C("form", {
38
38
  return /* @__PURE__ */ w("section", {
39
39
  className: "tg:rounded-lg tg:border tg:p-4",
40
40
  children: [
41
- n && /* @__PURE__ */ C("h3", {
41
+ t && /* @__PURE__ */ C("h3", {
42
42
  className: "tg:mb-4 tg:font-semibold tg:text-lg",
43
- children: n
43
+ children: t
44
44
  }),
45
45
  i,
46
46
  /* @__PURE__ */ w("div", {
@@ -59,7 +59,7 @@ var ee = ({ children: e, id: t, onSubmit: n }) => /* @__PURE__ */ C("form", {
59
59
  ]
60
60
  });
61
61
  }, E = ({ node: e }) => {
62
- let t = r()(e.data?.label);
62
+ let t = n()(e.data?.label);
63
63
  return t ? /* @__PURE__ */ w("div", {
64
64
  className: "tg:flex tg:items-center tg:gap-x-3",
65
65
  children: [
@@ -71,11 +71,11 @@ var ee = ({ children: e, id: t, onSubmit: n }) => /* @__PURE__ */ C("form", {
71
71
  /* @__PURE__ */ C(c, { className: "tg:my-8 tg:flex-1" })
72
72
  ]
73
73
  }) : /* @__PURE__ */ C(c, { className: "tg:my-8" });
74
- }, D = ({ node: t }) => {
75
- let { edges: n } = e(), i = r();
74
+ }, D = ({ node: e }) => {
75
+ let { edges: r } = t(), i = n();
76
76
  return /* @__PURE__ */ C("h2", {
77
- className: u("tg:mb-5 tg:font-bold tg:text-2xl", !h(t.id, n) && "tg:mt-10"),
78
- children: i(t.data?.label)
77
+ className: u("tg:mb-5 tg:font-bold tg:text-2xl", !h(e.id, r) && "tg:mt-10"),
78
+ children: i(e.data?.label)
79
79
  });
80
80
  }, O = {
81
81
  divider: E,
@@ -125,10 +125,10 @@ var re = () => /* @__PURE__ */ w("section", {
125
125
  href: "treege-renderer",
126
126
  precedence: "default",
127
127
  children: A
128
- }), j = ({ baseUrl: e, components: t, className: r, flow: a, formId: o, googleApiKey: c, headers: l, language: m, onBack: h, onChange: g, onSubmit: S, showPoweredBy: E, theme: D, validate: k, validationMode: A, initialValues: j = {}, isLoading: M = !1, isSubmitting: N = !1 }) => {
128
+ }), j = ({ baseUrl: t, components: n, className: r, flow: a, formId: o, googleApiKey: c, headers: l, language: m, onBack: h, onChange: g, onSubmit: S, showPoweredBy: E, theme: D, validate: k, validationMode: A, initialValues: j = {}, isLoading: M = !1, isSubmitting: N = !1 }) => {
129
129
  let { canContinueStep: P, canSubmit: ae, clearSubmitMessage: oe, config: F, currentStep: I, currentStepGroupNode: L, currentStepIndex: se, firstErrorFieldId: R, formErrors: z, formValues: B, goToNextStep: V, goToPreviousStep: H, handleSubmit: U, hasSubmitInput: W, inputNodes: G, isFirstStep: K, isLastStep: q, isSubmitting: ce, missingRequiredFields: J, setFieldValue: Y, steps: le, submitMessage: X, t: Z } = _({
130
- baseUrl: e,
131
- components: t,
130
+ baseUrl: t,
131
+ components: n,
132
132
  flow: a,
133
133
  googleApiKey: c,
134
134
  headers: l,
@@ -196,7 +196,7 @@ var re = () => /* @__PURE__ */ w("section", {
196
196
  children: [/* @__PURE__ */ C(ie, {}), /* @__PURE__ */ C(i, {
197
197
  theme: F.theme,
198
198
  storageKey: "treege-renderer-theme",
199
- children: M ? /* @__PURE__ */ C(me, {}) : /* @__PURE__ */ w(n, {
199
+ children: M ? /* @__PURE__ */ C(me, {}) : /* @__PURE__ */ w(e, {
200
200
  value: {
201
201
  baseUrl: F.baseUrl,
202
202
  flow: a,