@plumile/backoffice-react 0.1.69 → 0.1.72
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/lib/esm/i18n/locales/en/shared.js +0 -6
- package/lib/esm/i18n/locales/en/shared.js.map +1 -1
- package/lib/esm/i18n/locales/fr/shared.js +0 -6
- package/lib/esm/i18n/locales/fr/shared.js.map +1 -1
- package/lib/esm/index.js +9 -15
- package/lib/esm/provider/BackofficeProvider.js +3 -1
- package/lib/esm/provider/BackofficeProvider.js.map +1 -1
- package/lib/esm/router/createBackofficeRoutes.js +67 -67
- package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
- package/lib/esm/style.css +1 -1
- package/lib/types/i18n/resources.d.ts +0 -12
- package/lib/types/i18n/resources.d.ts.map +1 -1
- package/lib/types/index.d.ts +0 -6
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/provider/BackofficeProvider.d.ts.map +1 -1
- package/lib/types/provider/types.d.ts +2 -1
- package/lib/types/provider/types.d.ts.map +1 -1
- package/lib/types/router/createBackofficeRoutes.d.ts +1 -1
- package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
- package/package.json +5 -5
- package/lib/esm/components/backoffice/tools/BackofficeToolsDocPanel.js +0 -40
- package/lib/esm/components/backoffice/tools/BackofficeToolsDocPanel.js.map +0 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsErrorFallback.js +0 -48
- package/lib/esm/components/backoffice/tools/BackofficeToolsErrorFallback.js.map +0 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsJsonForm.js +0 -58
- package/lib/esm/components/backoffice/tools/BackofficeToolsJsonForm.js.map +0 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsPageLayout.js +0 -81
- package/lib/esm/components/backoffice/tools/BackofficeToolsPageLayout.js.map +0 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsParamsContext.js +0 -16
- package/lib/esm/components/backoffice/tools/BackofficeToolsParamsContext.js.map +0 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsProjectPicker.js +0 -56
- package/lib/esm/components/backoffice/tools/BackofficeToolsProjectPicker.js.map +0 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsQueryBoundary.js +0 -20
- package/lib/esm/components/backoffice/tools/BackofficeToolsQueryBoundary.js.map +0 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsScopePicker.js +0 -56
- package/lib/esm/components/backoffice/tools/BackofficeToolsScopePicker.js.map +0 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsDocPanel.css.js +0 -8
- package/lib/esm/components/backoffice/tools/backofficeToolsDocPanel.css.js.map +0 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsForm.css.js +0 -8
- package/lib/esm/components/backoffice/tools/backofficeToolsForm.css.js.map +0 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsJsonForm.css.js +0 -8
- package/lib/esm/components/backoffice/tools/backofficeToolsJsonForm.css.js.map +0 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsPageLayout.css.js +0 -8
- package/lib/esm/components/backoffice/tools/backofficeToolsPageLayout.css.js.map +0 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsProjectPicker.css.js +0 -8
- package/lib/esm/components/backoffice/tools/backofficeToolsProjectPicker.css.js.map +0 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsScopePicker.css.js +0 -8
- package/lib/esm/components/backoffice/tools/backofficeToolsScopePicker.css.js.map +0 -1
- package/lib/esm/hooks/useBackofficeToolsUrlParams.js +0 -15
- package/lib/esm/hooks/useBackofficeToolsUrlParams.js.map +0 -1
- package/lib/esm/i18n/useSharedEnumLabels.js +0 -22
- package/lib/esm/i18n/useSharedEnumLabels.js.map +0 -1
- package/lib/esm/modules/access/viewerPermissionsPolicy.js +0 -17
- package/lib/esm/modules/access/viewerPermissionsPolicy.js.map +0 -1
- package/lib/esm/modules/billing/usageChartMappers.js +0 -49
- package/lib/esm/modules/billing/usageChartMappers.js.map +0 -1
- package/lib/esm/modules/merge/taskMergeRun.js +0 -67
- package/lib/esm/modules/merge/taskMergeRun.js.map +0 -1
- package/lib/esm/modules/projectIngestionStatus.js +0 -25
- package/lib/esm/modules/projectIngestionStatus.js.map +0 -1
- package/lib/esm/pages/BackofficeToolsOperationPage.js +0 -464
- package/lib/esm/pages/BackofficeToolsOperationPage.js.map +0 -1
- package/lib/esm/subscriptions/conversationStream.js +0 -38
- package/lib/esm/subscriptions/conversationStream.js.map +0 -1
- package/lib/types/components/backoffice/tools/BackofficeToolsDocPanel.d.ts +0 -11
- package/lib/types/components/backoffice/tools/BackofficeToolsDocPanel.d.ts.map +0 -1
- package/lib/types/components/backoffice/tools/BackofficeToolsErrorFallback.d.ts +0 -8
- package/lib/types/components/backoffice/tools/BackofficeToolsErrorFallback.d.ts.map +0 -1
- package/lib/types/components/backoffice/tools/BackofficeToolsJsonForm.d.ts +0 -15
- package/lib/types/components/backoffice/tools/BackofficeToolsJsonForm.d.ts.map +0 -1
- package/lib/types/components/backoffice/tools/BackofficeToolsPageLayout.d.ts +0 -13
- package/lib/types/components/backoffice/tools/BackofficeToolsPageLayout.d.ts.map +0 -1
- package/lib/types/components/backoffice/tools/BackofficeToolsParamsContext.d.ts +0 -14
- package/lib/types/components/backoffice/tools/BackofficeToolsParamsContext.d.ts.map +0 -1
- package/lib/types/components/backoffice/tools/BackofficeToolsProjectPicker.d.ts +0 -8
- package/lib/types/components/backoffice/tools/BackofficeToolsProjectPicker.d.ts.map +0 -1
- package/lib/types/components/backoffice/tools/BackofficeToolsQueryBoundary.d.ts +0 -7
- package/lib/types/components/backoffice/tools/BackofficeToolsQueryBoundary.d.ts.map +0 -1
- package/lib/types/components/backoffice/tools/BackofficeToolsScopePicker.d.ts +0 -8
- package/lib/types/components/backoffice/tools/BackofficeToolsScopePicker.d.ts.map +0 -1
- package/lib/types/components/backoffice/tools/backofficeToolsDocPanel.css.d.ts +0 -8
- package/lib/types/components/backoffice/tools/backofficeToolsDocPanel.css.d.ts.map +0 -1
- package/lib/types/components/backoffice/tools/backofficeToolsForm.css.d.ts +0 -6
- package/lib/types/components/backoffice/tools/backofficeToolsForm.css.d.ts.map +0 -1
- package/lib/types/components/backoffice/tools/backofficeToolsJsonForm.css.d.ts +0 -4
- package/lib/types/components/backoffice/tools/backofficeToolsJsonForm.css.d.ts.map +0 -1
- package/lib/types/components/backoffice/tools/backofficeToolsPageLayout.css.d.ts +0 -13
- package/lib/types/components/backoffice/tools/backofficeToolsPageLayout.css.d.ts.map +0 -1
- package/lib/types/components/backoffice/tools/backofficeToolsProjectPicker.css.d.ts +0 -4
- package/lib/types/components/backoffice/tools/backofficeToolsProjectPicker.css.d.ts.map +0 -1
- package/lib/types/components/backoffice/tools/backofficeToolsScopePicker.css.d.ts +0 -4
- package/lib/types/components/backoffice/tools/backofficeToolsScopePicker.css.d.ts.map +0 -1
- package/lib/types/hooks/useBackofficeToolsUrlParams.d.ts +0 -8
- package/lib/types/hooks/useBackofficeToolsUrlParams.d.ts.map +0 -1
- package/lib/types/i18n/useSharedEnumLabels.d.ts +0 -6
- package/lib/types/i18n/useSharedEnumLabels.d.ts.map +0 -1
- package/lib/types/modules/access/viewerPermissionsPolicy.d.ts +0 -38
- package/lib/types/modules/access/viewerPermissionsPolicy.d.ts.map +0 -1
- package/lib/types/modules/billing/usageChartMappers.d.ts +0 -26
- package/lib/types/modules/billing/usageChartMappers.d.ts.map +0 -1
- package/lib/types/modules/merge/taskMergeRun.d.ts +0 -48
- package/lib/types/modules/merge/taskMergeRun.d.ts.map +0 -1
- package/lib/types/modules/projectIngestionStatus.d.ts +0 -9
- package/lib/types/modules/projectIngestionStatus.d.ts.map +0 -1
- package/lib/types/pages/BackofficeToolsOperationPage.d.ts +0 -9
- package/lib/types/pages/BackofficeToolsOperationPage.d.ts.map +0 -1
- package/lib/types/subscriptions/conversationStream.d.ts +0 -12
- package/lib/types/subscriptions/conversationStream.d.ts.map +0 -1
|
@@ -1,464 +0,0 @@
|
|
|
1
|
-
import { useBackofficeReactTranslation as e } from "../i18n/useBackofficeReactTranslation.js";
|
|
2
|
-
import { useBackofficeConfig as t } from "../provider/BackofficeConfigContext.js";
|
|
3
|
-
import { EntityIdFilterField as n } from "../components/backoffice/filters/EntityIdFilterField.js";
|
|
4
|
-
import { BackofficeErrorBoundary as r } from "../components/backoffice/errors/BackofficeErrorBoundary.js";
|
|
5
|
-
import { EntityIdPickerDialog as i } from "../components/backoffice/pickers/EntityIdPickerDialog.js";
|
|
6
|
-
import { buildDataTableColumns as a } from "../components/backoffice/columns/buildDataTableColumns.js";
|
|
7
|
-
import { BackofficeDetailField as o } from "../components/backoffice/detail/BackofficeDetailField.js";
|
|
8
|
-
import { BackofficeDetailSection as s } from "../components/backoffice/detail/BackofficeDetailSection.js";
|
|
9
|
-
import { BackofficeDetailPayload as c } from "../components/backoffice/detail/BackofficeDetailPayload.js";
|
|
10
|
-
import { EntityFilterValueText as l } from "../components/backoffice/filters/EntityFilterValue.js";
|
|
11
|
-
import { BackofficeRightPageLayout as u } from "../components/backoffice/layout/breadcrumb/BackofficeRightPageLayout.js";
|
|
12
|
-
import { buildToolBreadcrumb as d } from "../components/backoffice/layout/breadcrumb/buildBreadcrumbs.js";
|
|
13
|
-
import { panelGroup as f } from "../components/backoffice/tools/backofficeToolsDocPanel.css.js";
|
|
14
|
-
import { BackofficeToolsDocPanel as p } from "../components/backoffice/tools/BackofficeToolsDocPanel.js";
|
|
15
|
-
import { BackofficeToolsErrorFallback as m } from "../components/backoffice/tools/BackofficeToolsErrorFallback.js";
|
|
16
|
-
import { useBackofficeToolsParams as h } from "../components/backoffice/tools/BackofficeToolsParamsContext.js";
|
|
17
|
-
import { BackofficeToolsPageLayout as g } from "../components/backoffice/tools/BackofficeToolsPageLayout.js";
|
|
18
|
-
import { BackofficeToolsQueryBoundary as _ } from "../components/backoffice/tools/BackofficeToolsQueryBoundary.js";
|
|
19
|
-
import { actions as v, form as y, inputHeader as b, keyValueGrid as x, outputStack as S } from "../components/backoffice/tools/backofficeToolsForm.css.js";
|
|
20
|
-
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
21
|
-
import { useTranslation as E } from "react-i18next";
|
|
22
|
-
import { Button as D, DataTable as O, LazyBackofficeJsonViewer as k, SimpleSelect as ee } from "@plumile/ui";
|
|
23
|
-
import { useCallback as te, useEffect as A, useMemo as j, useRef as M, useState as N } from "react";
|
|
24
|
-
import * as P from "react-relay";
|
|
25
|
-
import { Label as F } from "@plumile/ui/atomic/atoms/label/Label.js";
|
|
26
|
-
import { Textarea as I } from "@plumile/ui/atomic/atoms/textarea/Textarea.js";
|
|
27
|
-
import { CheckboxField as L } from "@plumile/ui/atomic/molecules/checkbox_field/CheckboxField.js";
|
|
28
|
-
import { Form as R } from "@plumile/ui/atomic/molecules/form/Form.js";
|
|
29
|
-
import { FormErrorBanner as z } from "@plumile/ui/atomic/molecules/form/FormErrorBanner.js";
|
|
30
|
-
import { FormGroup as B } from "@plumile/ui/atomic/molecules/form/FormGroup.js";
|
|
31
|
-
import { HighlightCode as V } from "@plumile/ui/atomic/molecules/highlight/HighlightCode.js";
|
|
32
|
-
import { BackofficeToolValidationError as H } from "@plumile/backoffice-core/types.js";
|
|
33
|
-
//#region src/pages/BackofficeToolsOperationPage.tsx
|
|
34
|
-
var { useLazyLoadQuery: U } = P, W = (e, t) => e(t), G = (e, t) => typeof e == "function" ? e(t) : e ?? null, K = (e) => {
|
|
35
|
-
let t = {};
|
|
36
|
-
return e?.forEach((e) => {
|
|
37
|
-
e.kind === "boolean" ? t[e.id] = e.defaultValue ?? !1 : t[e.id] = e.defaultValue ?? "";
|
|
38
|
-
}), t;
|
|
39
|
-
}, q = (e) => {
|
|
40
|
-
let t = {};
|
|
41
|
-
return Object.entries(e).forEach(([e, n]) => {
|
|
42
|
-
if (n != null) {
|
|
43
|
-
if (typeof n == "string") {
|
|
44
|
-
let r = n.trim();
|
|
45
|
-
if (r === "") return;
|
|
46
|
-
t[e] = r;
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
t[e] = n;
|
|
50
|
-
}
|
|
51
|
-
}), t;
|
|
52
|
-
}, ne = ({ operation: e, inputValues: t, initiativeId: n, projectId: r, run: i }) => {
|
|
53
|
-
let a = q(t), o = Object.prototype.hasOwnProperty.call(t, "projectId"), s = e.inputs?.some((e) => e.kind === "entityId" && e.entity === "projects") ?? !1;
|
|
54
|
-
if ((o || s) && r != null && r.trim() !== "") {
|
|
55
|
-
let e = a.projectId;
|
|
56
|
-
(e == null || String(e).trim() === "") && (a.projectId = r);
|
|
57
|
-
}
|
|
58
|
-
let c = {
|
|
59
|
-
scope: { initiativeId: n ?? "" },
|
|
60
|
-
input: a,
|
|
61
|
-
run: i
|
|
62
|
-
};
|
|
63
|
-
if (e.buildVariables == null) return c;
|
|
64
|
-
let l = e.buildVariables(a, {
|
|
65
|
-
scope: {
|
|
66
|
-
initiativeId: n,
|
|
67
|
-
projectId: r
|
|
68
|
-
},
|
|
69
|
-
run: i
|
|
70
|
-
});
|
|
71
|
-
return {
|
|
72
|
-
...c,
|
|
73
|
-
...l
|
|
74
|
-
};
|
|
75
|
-
}, J = (e) => {
|
|
76
|
-
if (e.showProjectPicker != null) return e.showProjectPicker;
|
|
77
|
-
let { inputs: t } = e;
|
|
78
|
-
return t == null ? !1 : t.some((e) => e.kind === "entityId" && e.entity === "projects" ? !0 : e.id === "projectId");
|
|
79
|
-
}, Y = (e) => {
|
|
80
|
-
try {
|
|
81
|
-
let t = JSON.parse(e);
|
|
82
|
-
return typeof t != "object" || !t || Array.isArray(t) ? null : t;
|
|
83
|
-
} catch {
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
}, re = (e, t) => {
|
|
87
|
-
let n = Y(e);
|
|
88
|
-
if (n == null) return null;
|
|
89
|
-
let r = n;
|
|
90
|
-
Object.entries(t).forEach(([e, t]) => {
|
|
91
|
-
Object.prototype.hasOwnProperty.call(n, e) && n[e] !== t && (r === n && (r = { ...n }), r[e] = t);
|
|
92
|
-
});
|
|
93
|
-
let i = JSON.stringify(r, null, 2);
|
|
94
|
-
return i === e ? null : i;
|
|
95
|
-
}, X = (e, t) => {
|
|
96
|
-
if (typeof e == "object" && e) {
|
|
97
|
-
let t = e, n = t.id;
|
|
98
|
-
if (typeof n == "string" && n.trim() !== "") return n;
|
|
99
|
-
let r = t.key;
|
|
100
|
-
if (typeof r == "string" && r.trim() !== "") return r;
|
|
101
|
-
}
|
|
102
|
-
return String(t);
|
|
103
|
-
}, Z = ({ outputs: n, data: r, wrapDefault: i = !1 }) => {
|
|
104
|
-
let { t: l } = E(), { t: u } = e(), { entities: d } = t(), f = u("tools.output");
|
|
105
|
-
return /* @__PURE__ */ w("div", {
|
|
106
|
-
className: S,
|
|
107
|
-
children: n.map((e, t) => {
|
|
108
|
-
if (e.kind === "table") {
|
|
109
|
-
let n = e.label == null ? f : W(e.label, l), o = e.description == null ? void 0 : W(e.description, l), c = a(e.columns, {
|
|
110
|
-
tApp: l,
|
|
111
|
-
t: u,
|
|
112
|
-
resolveEntityHref: (e, t) => {
|
|
113
|
-
let n = d[e];
|
|
114
|
-
return n == null ? null : n.routes.detail(t);
|
|
115
|
-
}
|
|
116
|
-
}), p = e.rows(r), m = /* @__PURE__ */ w(O, {
|
|
117
|
-
columns: c,
|
|
118
|
-
rows: Array.isArray(p) ? p : [],
|
|
119
|
-
getRowId: X
|
|
120
|
-
}, `table-${t}`);
|
|
121
|
-
return i ? m : /* @__PURE__ */ w(s, {
|
|
122
|
-
title: n,
|
|
123
|
-
description: o,
|
|
124
|
-
children: m
|
|
125
|
-
}, `table-${t}`);
|
|
126
|
-
}
|
|
127
|
-
if (e.kind === "code") {
|
|
128
|
-
let n = e.label == null ? f : W(e.label, l), a = e.description == null ? void 0 : W(e.description, l), o = e.value(r), c = /* @__PURE__ */ w(V, {
|
|
129
|
-
badgeLabel: n,
|
|
130
|
-
copyCode: o,
|
|
131
|
-
fallbackCodeText: o
|
|
132
|
-
}, `code-${t}`);
|
|
133
|
-
return i ? c : /* @__PURE__ */ w(s, {
|
|
134
|
-
title: n,
|
|
135
|
-
description: a,
|
|
136
|
-
children: c
|
|
137
|
-
}, `code-${t}`);
|
|
138
|
-
}
|
|
139
|
-
if (e.kind === "json") {
|
|
140
|
-
let n = e.label == null ? f : W(e.label, l), a = e.description == null ? void 0 : W(e.description, l), o = /* @__PURE__ */ w(k, {
|
|
141
|
-
value: e.value(r),
|
|
142
|
-
title: n
|
|
143
|
-
}, `json-${t}`);
|
|
144
|
-
return i || a == null ? o : /* @__PURE__ */ w(s, {
|
|
145
|
-
title: n,
|
|
146
|
-
description: a,
|
|
147
|
-
children: o
|
|
148
|
-
}, `json-${t}`);
|
|
149
|
-
}
|
|
150
|
-
if (e.kind === "keyValue") {
|
|
151
|
-
let n = e.label == null ? f : W(e.label, l), a = e.description == null ? void 0 : W(e.description, l), c = /* @__PURE__ */ w("div", {
|
|
152
|
-
className: x,
|
|
153
|
-
children: e.items.map((e) => {
|
|
154
|
-
let t = W(e.label, l);
|
|
155
|
-
return {
|
|
156
|
-
id: t,
|
|
157
|
-
label: t,
|
|
158
|
-
size: "m",
|
|
159
|
-
value: G(e.value(r), l)
|
|
160
|
-
};
|
|
161
|
-
}).map((e) => /* @__PURE__ */ w(o, {
|
|
162
|
-
id: e.id,
|
|
163
|
-
label: e.label,
|
|
164
|
-
size: e.size,
|
|
165
|
-
value: e.value
|
|
166
|
-
}, e.id))
|
|
167
|
-
}, `kv-${t}`);
|
|
168
|
-
return i ? c : /* @__PURE__ */ w(s, {
|
|
169
|
-
title: n,
|
|
170
|
-
description: a,
|
|
171
|
-
children: c
|
|
172
|
-
}, `kv-${t}`);
|
|
173
|
-
}
|
|
174
|
-
if (e.kind === "payload") return /* @__PURE__ */ w(c, {
|
|
175
|
-
title: W(e.label, l),
|
|
176
|
-
description: e.description == null ? void 0 : W(e.description, l),
|
|
177
|
-
content: e.value(r),
|
|
178
|
-
format: e.format
|
|
179
|
-
}, `payload-${t}`);
|
|
180
|
-
let n = e.render(r);
|
|
181
|
-
return i || e.label == null ? /* @__PURE__ */ w("div", { children: n }, `custom-${t}`) : /* @__PURE__ */ w(s, {
|
|
182
|
-
title: W(e.label, l),
|
|
183
|
-
children: n
|
|
184
|
-
}, `custom-${t}`);
|
|
185
|
-
})
|
|
186
|
-
});
|
|
187
|
-
}, ie = ({ operation: t, variables: n, fetchKey: r }) => {
|
|
188
|
-
let { t: i } = e(), a = U(t.query, n, {
|
|
189
|
-
fetchKey: r,
|
|
190
|
-
fetchPolicy: "store-or-network"
|
|
191
|
-
});
|
|
192
|
-
return t.render == null ? t.outputs != null && t.outputs.length > 0 ? t.outputs.every((e) => {
|
|
193
|
-
if (e.kind === "payload") return !1;
|
|
194
|
-
let t = "description" in e && e.description != null;
|
|
195
|
-
return e.label == null && !t;
|
|
196
|
-
}) ? /* @__PURE__ */ w(s, {
|
|
197
|
-
title: i("tools.output"),
|
|
198
|
-
children: /* @__PURE__ */ w(Z, {
|
|
199
|
-
outputs: t.outputs,
|
|
200
|
-
data: a,
|
|
201
|
-
wrapDefault: !0
|
|
202
|
-
})
|
|
203
|
-
}) : /* @__PURE__ */ w(Z, {
|
|
204
|
-
outputs: t.outputs,
|
|
205
|
-
data: a
|
|
206
|
-
}) : null : /* @__PURE__ */ w(C, { children: t.render(a) });
|
|
207
|
-
}, Q = ({ operation: t }) => {
|
|
208
|
-
let { t: r } = E(), { t: a } = e(), { initiativeId: o, projectId: c } = h(), [u, d] = N(j(() => K(t.inputs), [t.inputs])), [f, p] = N(null), [m, g] = N(0), [x, S] = N(null), [O, k] = N(!1), [P, V] = N(null), U = M({
|
|
209
|
-
initiativeId: o,
|
|
210
|
-
projectId: c
|
|
211
|
-
}), G = j(() => ({
|
|
212
|
-
initiativeId: o,
|
|
213
|
-
projectId: c
|
|
214
|
-
}), [o, c]);
|
|
215
|
-
A(() => {
|
|
216
|
-
if (t.inputs == null) return;
|
|
217
|
-
let e = t.inputs.some((e) => e.id === "initiativeId"), n = t.inputs.some((e) => e.id === "projectId");
|
|
218
|
-
!e && !n || d((t) => {
|
|
219
|
-
let r = t;
|
|
220
|
-
if (e && o != null && o.trim() !== "") {
|
|
221
|
-
let e = t.initiativeId;
|
|
222
|
-
(typeof e != "string" || e.trim() === "") && (r = {
|
|
223
|
-
...r,
|
|
224
|
-
initiativeId: o
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
if (n && c != null && c.trim() !== "") {
|
|
228
|
-
let e = t.projectId;
|
|
229
|
-
(typeof e != "string" || e.trim() === "") && (r = {
|
|
230
|
-
...r,
|
|
231
|
-
projectId: c
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
return r;
|
|
235
|
-
});
|
|
236
|
-
}, [
|
|
237
|
-
o,
|
|
238
|
-
t.inputs,
|
|
239
|
-
c
|
|
240
|
-
]), A(() => {
|
|
241
|
-
let e = U.current, t = {};
|
|
242
|
-
e.initiativeId !== o && (t.initiativeId = o ?? ""), e.projectId !== c && (t.projectId = c ?? ""), U.current = {
|
|
243
|
-
initiativeId: o,
|
|
244
|
-
projectId: c
|
|
245
|
-
}, Object.keys(t).length !== 0 && d((e) => {
|
|
246
|
-
let n = e.inputJson;
|
|
247
|
-
if (typeof n != "string" || n.trim() === "") return e;
|
|
248
|
-
let r = re(n, t);
|
|
249
|
-
return r == null ? e : {
|
|
250
|
-
...e,
|
|
251
|
-
inputJson: r
|
|
252
|
-
};
|
|
253
|
-
});
|
|
254
|
-
}, [o, c]);
|
|
255
|
-
let q = te(() => {
|
|
256
|
-
if (p(null), o == null || o.trim() === "") {
|
|
257
|
-
p(a("tools.errors.missingScope"));
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
let e;
|
|
261
|
-
try {
|
|
262
|
-
e = ne({
|
|
263
|
-
operation: t,
|
|
264
|
-
inputValues: u,
|
|
265
|
-
initiativeId: o,
|
|
266
|
-
projectId: c,
|
|
267
|
-
run: !0
|
|
268
|
-
});
|
|
269
|
-
} catch (e) {
|
|
270
|
-
if (e instanceof H) {
|
|
271
|
-
p(W(e.label, r));
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
e instanceof Error ? p(e.message) : p(a("tools.errors.unknown"));
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
S(e), k(!0), g((e) => e + 1);
|
|
278
|
-
}, [
|
|
279
|
-
o,
|
|
280
|
-
u,
|
|
281
|
-
t,
|
|
282
|
-
c,
|
|
283
|
-
a,
|
|
284
|
-
r
|
|
285
|
-
]), J = j(() => P == null || t.inputs == null ? null : t.inputs.find((e) => e.id === P && e.kind === "entityId") ?? null, [P, t.inputs]), Y = (e) => {
|
|
286
|
-
let t = W(e.label, r), i = u[e.id];
|
|
287
|
-
if (e.kind === "text") {
|
|
288
|
-
let n = typeof i == "string" ? i : "", a = e.placeholder == null ? void 0 : W(e.placeholder, r);
|
|
289
|
-
return /* @__PURE__ */ T(B, { children: [/* @__PURE__ */ w(F, { children: t }), /* @__PURE__ */ w(I, {
|
|
290
|
-
value: n,
|
|
291
|
-
placeholder: a,
|
|
292
|
-
onChange: (t) => {
|
|
293
|
-
p(null), d((n) => ({
|
|
294
|
-
...n,
|
|
295
|
-
[e.id]: t.target.value
|
|
296
|
-
}));
|
|
297
|
-
},
|
|
298
|
-
rows: 4,
|
|
299
|
-
fullWidth: !0
|
|
300
|
-
})] }, e.id);
|
|
301
|
-
}
|
|
302
|
-
if (e.kind === "json") {
|
|
303
|
-
let n = typeof i == "string" ? i : "", o = e.placeholder == null ? void 0 : W(e.placeholder, r), s = typeof e.defaultValue == "string" ? e.defaultValue : "", c = s.trim() !== "", l = a("tools.forms.actions.insertExample");
|
|
304
|
-
return /* @__PURE__ */ T(B, { children: [/* @__PURE__ */ T("div", {
|
|
305
|
-
className: b,
|
|
306
|
-
children: [/* @__PURE__ */ w(F, { children: t }), c && /* @__PURE__ */ w(D, {
|
|
307
|
-
type: "button",
|
|
308
|
-
variant: "text",
|
|
309
|
-
size: "small",
|
|
310
|
-
onClick: () => {
|
|
311
|
-
p(null), d((t) => ({
|
|
312
|
-
...t,
|
|
313
|
-
[e.id]: s
|
|
314
|
-
}));
|
|
315
|
-
},
|
|
316
|
-
children: l
|
|
317
|
-
})]
|
|
318
|
-
}), /* @__PURE__ */ w(I, {
|
|
319
|
-
value: n,
|
|
320
|
-
placeholder: o,
|
|
321
|
-
onChange: (t) => {
|
|
322
|
-
p(null), d((n) => ({
|
|
323
|
-
...n,
|
|
324
|
-
[e.id]: t.target.value
|
|
325
|
-
}));
|
|
326
|
-
},
|
|
327
|
-
rows: 6,
|
|
328
|
-
fullWidth: !0
|
|
329
|
-
})] }, e.id);
|
|
330
|
-
}
|
|
331
|
-
if (e.kind === "enum") {
|
|
332
|
-
let n = typeof i == "string" ? i : "", a = e.options.map((e) => ({
|
|
333
|
-
id: e.value,
|
|
334
|
-
value: e.value,
|
|
335
|
-
label: W(e.label, r)
|
|
336
|
-
}));
|
|
337
|
-
return /* @__PURE__ */ T(B, { children: [/* @__PURE__ */ w(F, { children: t }), /* @__PURE__ */ w(ee, {
|
|
338
|
-
options: a,
|
|
339
|
-
value: n,
|
|
340
|
-
onChange: (t) => {
|
|
341
|
-
p(null), d((n) => ({
|
|
342
|
-
...n,
|
|
343
|
-
[e.id]: t
|
|
344
|
-
}));
|
|
345
|
-
},
|
|
346
|
-
placeholder: t
|
|
347
|
-
})] }, e.id);
|
|
348
|
-
}
|
|
349
|
-
if (e.kind === "boolean") return /* @__PURE__ */ w(B, { children: /* @__PURE__ */ w(L, {
|
|
350
|
-
label: t,
|
|
351
|
-
checked: typeof i == "boolean" ? i : !1,
|
|
352
|
-
onChange: (t) => {
|
|
353
|
-
p(null), d((n) => ({
|
|
354
|
-
...n,
|
|
355
|
-
[e.id]: t.target.checked
|
|
356
|
-
}));
|
|
357
|
-
}
|
|
358
|
-
}) }, e.id);
|
|
359
|
-
if (e.kind === "entityId") {
|
|
360
|
-
let r = typeof i == "string" ? i : "", a = (i = null) => /* @__PURE__ */ w(n, {
|
|
361
|
-
label: t,
|
|
362
|
-
value: r,
|
|
363
|
-
displayValue: i?.trim() ?? "",
|
|
364
|
-
onPick: () => {
|
|
365
|
-
V(e.id);
|
|
366
|
-
},
|
|
367
|
-
onClear: () => {
|
|
368
|
-
p(null), d((t) => ({
|
|
369
|
-
...t,
|
|
370
|
-
[e.id]: ""
|
|
371
|
-
}));
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
return /* @__PURE__ */ T(B, { children: [/* @__PURE__ */ w(F, { children: t }), r.trim() === "" ? a() : /* @__PURE__ */ w(l, {
|
|
375
|
-
entityId: e.entity,
|
|
376
|
-
id: r,
|
|
377
|
-
children: (e) => a(e)
|
|
378
|
-
})] }, e.id);
|
|
379
|
-
}
|
|
380
|
-
return /* @__PURE__ */ w(C, {});
|
|
381
|
-
}, X = (e) => {
|
|
382
|
-
e.preventDefault(), q();
|
|
383
|
-
}, Z = t.inputs?.map((e) => Y(e)), Q = o == null || o.trim() === "", $ = null;
|
|
384
|
-
return O && x != null && ($ = /* @__PURE__ */ w(_, { children: /* @__PURE__ */ w(ie, {
|
|
385
|
-
operation: t,
|
|
386
|
-
variables: x,
|
|
387
|
-
fetchKey: m
|
|
388
|
-
}) })), /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ T(s, {
|
|
389
|
-
title: W(t.title, r),
|
|
390
|
-
description: t.subtitle == null ? void 0 : W(t.subtitle, r),
|
|
391
|
-
children: [/* @__PURE__ */ T(R, {
|
|
392
|
-
onSubmit: X,
|
|
393
|
-
className: y,
|
|
394
|
-
children: [
|
|
395
|
-
/* @__PURE__ */ w(z, { message: f }),
|
|
396
|
-
Z,
|
|
397
|
-
/* @__PURE__ */ w("div", {
|
|
398
|
-
className: v,
|
|
399
|
-
children: /* @__PURE__ */ w(D, {
|
|
400
|
-
type: "submit",
|
|
401
|
-
variant: "primary",
|
|
402
|
-
size: "small",
|
|
403
|
-
disabled: Q,
|
|
404
|
-
children: a("tools.forms.actions.run")
|
|
405
|
-
})
|
|
406
|
-
})
|
|
407
|
-
]
|
|
408
|
-
}), J != null && /* @__PURE__ */ w(i, {
|
|
409
|
-
isOpen: !0,
|
|
410
|
-
entity: J.entity,
|
|
411
|
-
title: W(J.label, r),
|
|
412
|
-
scope: G,
|
|
413
|
-
onClose: () => {
|
|
414
|
-
V(null);
|
|
415
|
-
},
|
|
416
|
-
onSelectId: (e) => {
|
|
417
|
-
p(null), d((t) => ({
|
|
418
|
-
...t,
|
|
419
|
-
[J.id]: e
|
|
420
|
-
})), V(null);
|
|
421
|
-
}
|
|
422
|
-
})]
|
|
423
|
-
}), $] });
|
|
424
|
-
}, $ = ({ operation: t, toolId: n }) => {
|
|
425
|
-
let { t: i } = E(), { t: a } = e(), o = W(t.title, i), s = t.subtitle == null ? void 0 : W(t.subtitle, i), c = d({ title: o }), l = J(t), h = a("tools.meta.idLabel"), _ = a("tools.docs.inputTypeTitle"), v = a("tools.docs.inputExampleTitle"), y = typeof t.inputTypeSDL == "string" ? t.inputTypeSDL.trim() : "", b = (() => {
|
|
426
|
-
if (t.inputs == null) return null;
|
|
427
|
-
let e = t.inputs.find((e) => e.kind === "json");
|
|
428
|
-
return e == null || typeof e.defaultValue != "string" || e.defaultValue.trim() === "" ? null : e.defaultValue;
|
|
429
|
-
})(), x = [];
|
|
430
|
-
return y !== "" && x.push(/* @__PURE__ */ w(p, {
|
|
431
|
-
title: _,
|
|
432
|
-
content: y,
|
|
433
|
-
language: "graphql",
|
|
434
|
-
defaultOpen: !0
|
|
435
|
-
}, "input-type")), b != null && x.push(/* @__PURE__ */ w(p, {
|
|
436
|
-
title: v,
|
|
437
|
-
content: b,
|
|
438
|
-
language: "json"
|
|
439
|
-
}, "input-example")), /* @__PURE__ */ w(u, {
|
|
440
|
-
breadcrumb: c,
|
|
441
|
-
children: /* @__PURE__ */ w(g, {
|
|
442
|
-
title: o,
|
|
443
|
-
subtitle: s,
|
|
444
|
-
toolId: n,
|
|
445
|
-
toolIdLabel: h,
|
|
446
|
-
showProjectPicker: l,
|
|
447
|
-
docPanel: x.length > 0 ? /* @__PURE__ */ w("div", {
|
|
448
|
-
className: f,
|
|
449
|
-
children: x
|
|
450
|
-
}) : void 0,
|
|
451
|
-
children: /* @__PURE__ */ w(r, {
|
|
452
|
-
fallback: ({ error: e, reset: t }) => /* @__PURE__ */ w(m, {
|
|
453
|
-
error: e,
|
|
454
|
-
onRetry: t
|
|
455
|
-
}),
|
|
456
|
-
children: /* @__PURE__ */ w(Q, { operation: t })
|
|
457
|
-
})
|
|
458
|
-
})
|
|
459
|
-
});
|
|
460
|
-
};
|
|
461
|
-
//#endregion
|
|
462
|
-
export { $ as BackofficeToolsOperationPage, $ as default };
|
|
463
|
-
|
|
464
|
-
//# sourceMappingURL=BackofficeToolsOperationPage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeToolsOperationPage.js","names":[],"sources":["../../../src/pages/BackofficeToolsOperationPage.tsx"],"sourcesContent":["/* eslint-disable no-ternary */\n/* eslint-disable @typescript-eslint/no-base-to-string */\nimport {\n type JSX,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { TFunction } from 'i18next';\nimport { useTranslation } from 'react-i18next';\nimport * as ReactRelay from 'react-relay';\nimport type { OperationType } from 'relay-runtime';\nimport {\n type BackofficeToolInputSpec,\n type BackofficeToolOperation,\n type BackofficeToolOutputSpec,\n type BackofficeValueLabel,\n type I18nLabel,\n BackofficeToolValidationError,\n} from '@plumile/backoffice-core/types.js';\nimport { Textarea } from '@plumile/ui/atomic/atoms/textarea/Textarea.js';\nimport { Label } from '@plumile/ui/atomic/atoms/label/Label.js';\nimport { CheckboxField } from '@plumile/ui/atomic/molecules/checkbox_field/CheckboxField.js';\nimport { Form } from '@plumile/ui/atomic/molecules/form/Form.js';\nimport { FormGroup } from '@plumile/ui/atomic/molecules/form/FormGroup.js';\nimport { FormErrorBanner } from '@plumile/ui/atomic/molecules/form/FormErrorBanner.js';\nimport {\n Button,\n DataTable,\n LazyBackofficeJsonViewer,\n SimpleSelect,\n} from '@plumile/ui';\nimport { HighlightCode } from '@plumile/ui/atomic/molecules/highlight/HighlightCode.js';\n\nimport { BackofficeDetailField } from '../components/backoffice/detail/BackofficeDetailField.js';\nimport { BackofficeDetailPayload } from '../components/backoffice/detail/BackofficeDetailPayload.js';\nimport { BackofficeDetailSection } from '../components/backoffice/detail/BackofficeDetailSection.js';\nimport { buildDataTableColumns } from '../components/backoffice/columns/buildDataTableColumns.js';\nimport { BackofficeErrorBoundary } from '../components/backoffice/errors/BackofficeErrorBoundary.js';\nimport { EntityFilterValueText } from '../components/backoffice/filters/EntityFilterValue.js';\nimport { EntityIdFilterField } from '../components/backoffice/filters/EntityIdFilterField.js';\nimport { EntityIdPickerDialog } from '../components/backoffice/pickers/EntityIdPickerDialog.js';\nimport { BackofficeToolsErrorFallback } from '../components/backoffice/tools/BackofficeToolsErrorFallback.js';\nimport { BackofficeToolsDocPanel } from '../components/backoffice/tools/BackofficeToolsDocPanel.js';\nimport { BackofficeToolsQueryBoundary } from '../components/backoffice/tools/BackofficeToolsQueryBoundary.js';\nimport { BackofficeToolsPageLayout } from '../components/backoffice/tools/BackofficeToolsPageLayout.js';\nimport { useBackofficeToolsParams } from '../components/backoffice/tools/BackofficeToolsParamsContext.js';\nimport { useBackofficeReactTranslation } from '../i18n/useBackofficeReactTranslation.js';\nimport { useBackofficeConfig } from '../provider/BackofficeConfigContext.js';\nimport { BackofficeRightPageLayout } from '../components/backoffice/layout/breadcrumb/BackofficeRightPageLayout.js';\nimport { buildToolBreadcrumb } from '../components/backoffice/layout/breadcrumb/buildBreadcrumbs.js';\n\nimport * as styles from '../components/backoffice/tools/backofficeToolsForm.css.js';\nimport * as docPanelStyles from '../components/backoffice/tools/backofficeToolsDocPanel.css.js';\n\nconst { useLazyLoadQuery } = ReactRelay;\n\nconst resolveLabel = (label: I18nLabel, tApp: TFunction): string => {\n return label(tApp);\n};\n\nconst resolveValueLabel = (\n value: BackofficeValueLabel | null | undefined,\n tApp: TFunction,\n): string | number | null => {\n if (typeof value === 'function') {\n return value(tApp);\n }\n if (value == null) {\n return null;\n }\n return value;\n};\n\ntype ToolInputValues = Record<string, unknown>;\ntype EntityIdInputSpec = Extract<BackofficeToolInputSpec, { kind: 'entityId' }>;\n\ntype BuildToolVariablesInput = {\n operation: BackofficeToolOperation;\n inputValues: ToolInputValues;\n initiativeId: string | null;\n projectId: string | null;\n run: boolean;\n};\n\nconst buildInitialInputValues = (\n inputs?: readonly BackofficeToolInputSpec[],\n): ToolInputValues => {\n const output: ToolInputValues = {};\n inputs?.forEach((input) => {\n if (input.kind === 'boolean') {\n output[input.id] = input.defaultValue ?? false;\n } else {\n output[input.id] = input.defaultValue ?? '';\n }\n });\n return output;\n};\n\nconst cleanInputValues = (values: ToolInputValues): ToolInputValues => {\n const output: ToolInputValues = {};\n Object.entries(values).forEach(([key, value]) => {\n if (value == null) {\n return;\n }\n if (typeof value === 'string') {\n const trimmed = value.trim();\n if (trimmed === '') {\n return;\n }\n output[key] = trimmed;\n return;\n }\n output[key] = value;\n });\n return output;\n};\n\nconst buildToolVariables = ({\n operation,\n inputValues,\n initiativeId,\n projectId,\n run,\n}: BuildToolVariablesInput): Record<string, unknown> => {\n const cleanedInput = cleanInputValues(inputValues);\n\n const hasProjectField = Object.prototype.hasOwnProperty.call(\n inputValues,\n 'projectId',\n );\n const hasProjectEntity =\n operation.inputs?.some((input) => {\n return input.kind === 'entityId' && input.entity === 'projects';\n }) ?? false;\n if (\n (hasProjectField || hasProjectEntity) &&\n projectId != null &&\n projectId.trim() !== ''\n ) {\n const existing = cleanedInput.projectId;\n if (existing == null || String(existing).trim() === '') {\n cleanedInput.projectId = projectId;\n }\n }\n\n const defaultVariables = {\n scope: {\n initiativeId: initiativeId ?? '',\n },\n input: cleanedInput,\n run,\n };\n\n if (operation.buildVariables == null) {\n return defaultVariables;\n }\n\n const custom = operation.buildVariables(cleanedInput, {\n scope: {\n initiativeId,\n projectId,\n },\n run,\n });\n return {\n ...defaultVariables,\n ...custom,\n };\n};\n\nconst shouldShowProjectPicker = (\n operation: BackofficeToolOperation,\n): boolean => {\n if (operation.showProjectPicker != null) {\n return operation.showProjectPicker;\n }\n const { inputs } = operation;\n if (inputs == null) {\n return false;\n }\n return inputs.some((input) => {\n if (input.kind === 'entityId' && input.entity === 'projects') {\n return true;\n }\n return input.id === 'projectId';\n });\n};\n\nconst parseInputJson = (value: string): Record<string, unknown> | null => {\n try {\n const parsed: unknown = JSON.parse(value);\n if (parsed == null || typeof parsed !== 'object' || Array.isArray(parsed)) {\n return null;\n }\n return parsed as Record<string, unknown>;\n } catch {\n return null;\n }\n};\n\nconst applyPickerUpdatesToJson = (\n currentValue: string,\n updates: Record<string, string>,\n): string | null => {\n const parsed = parseInputJson(currentValue);\n if (parsed == null) {\n return null;\n }\n\n let next = parsed;\n\n Object.entries(updates).forEach(([key, nextValue]) => {\n if (!Object.prototype.hasOwnProperty.call(parsed, key)) {\n return;\n }\n if (parsed[key] === nextValue) {\n return;\n }\n if (next === parsed) {\n next = { ...parsed };\n }\n next[key] = nextValue;\n });\n\n const nextJson = JSON.stringify(next, null, 2);\n if (nextJson === currentValue) {\n return null;\n }\n\n return nextJson;\n};\n\ntype OutputRendererProps = {\n outputs: readonly BackofficeToolOutputSpec[];\n data: unknown;\n wrapDefault?: boolean;\n};\n\nconst resolveRowId = (row: unknown, index: number): string => {\n if (row != null && typeof row === 'object') {\n const record = row as Record<string, unknown>;\n const maybeId = record.id;\n if (typeof maybeId === 'string' && maybeId.trim() !== '') {\n return maybeId;\n }\n const maybeKey = record.key;\n if (typeof maybeKey === 'string' && maybeKey.trim() !== '') {\n return maybeKey;\n }\n }\n return String(index);\n};\n\nconst OutputRenderer = ({\n outputs,\n data,\n wrapDefault = false,\n}: OutputRendererProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const { entities } = useBackofficeConfig();\n const defaultTitle = t('tools.output');\n\n const nodes = outputs.map((output, index) => {\n if (output.kind === 'table') {\n const title =\n output.label != null ? resolveLabel(output.label, tApp) : defaultTitle;\n const description =\n output.description != null\n ? resolveLabel(output.description, tApp)\n : undefined;\n const columns = buildDataTableColumns(output.columns, {\n tApp,\n t,\n resolveEntityHref: (entityId, refId) => {\n const entity = entities[entityId];\n if (entity == null) {\n return null;\n }\n return entity.routes.detail(refId);\n },\n });\n const resolvedRows = output.rows(data);\n const rows = Array.isArray(resolvedRows) ? resolvedRows : [];\n const tableNode = (\n <DataTable\n key={`table-${index}`}\n columns={columns}\n rows={rows}\n getRowId={resolveRowId}\n />\n );\n if (wrapDefault) {\n return tableNode;\n }\n return (\n <BackofficeDetailSection\n key={`table-${index}`}\n title={title}\n description={description}\n >\n {tableNode}\n </BackofficeDetailSection>\n );\n }\n\n if (output.kind === 'code') {\n const title =\n output.label != null ? resolveLabel(output.label, tApp) : defaultTitle;\n const description =\n output.description != null\n ? resolveLabel(output.description, tApp)\n : undefined;\n const value = output.value(data);\n const codeNode = (\n <HighlightCode\n key={`code-${index}`}\n badgeLabel={title}\n copyCode={value}\n fallbackCodeText={value}\n />\n );\n if (wrapDefault) {\n return codeNode;\n }\n return (\n <BackofficeDetailSection\n key={`code-${index}`}\n title={title}\n description={description}\n >\n {codeNode}\n </BackofficeDetailSection>\n );\n }\n\n if (output.kind === 'json') {\n const title =\n output.label != null ? resolveLabel(output.label, tApp) : defaultTitle;\n const description =\n output.description != null\n ? resolveLabel(output.description, tApp)\n : undefined;\n const value = output.value(data);\n const jsonNode = (\n <LazyBackofficeJsonViewer\n key={`json-${index}`}\n value={value}\n title={title}\n />\n );\n if (wrapDefault || description == null) {\n return jsonNode;\n }\n return (\n <BackofficeDetailSection\n key={`json-${index}`}\n title={title}\n description={description}\n >\n {jsonNode}\n </BackofficeDetailSection>\n );\n }\n\n if (output.kind === 'keyValue') {\n const title =\n output.label != null ? resolveLabel(output.label, tApp) : defaultTitle;\n const description =\n output.description != null\n ? resolveLabel(output.description, tApp)\n : undefined;\n const items = output.items.map((item) => {\n const label = resolveLabel(item.label, tApp);\n const value = resolveValueLabel(item.value(data), tApp);\n return {\n id: label,\n label,\n size: 'm' as const,\n value,\n };\n });\n const gridNode = (\n <div key={`kv-${index}`} className={styles.keyValueGrid}>\n {items.map((item) => {\n return (\n <BackofficeDetailField\n key={item.id}\n id={item.id}\n label={item.label}\n size={item.size}\n value={item.value}\n />\n );\n })}\n </div>\n );\n if (wrapDefault) {\n return gridNode;\n }\n return (\n <BackofficeDetailSection\n key={`kv-${index}`}\n title={title}\n description={description}\n >\n {gridNode}\n </BackofficeDetailSection>\n );\n }\n\n if (output.kind === 'payload') {\n const title = resolveLabel(output.label, tApp);\n const description =\n output.description != null\n ? resolveLabel(output.description, tApp)\n : undefined;\n return (\n <BackofficeDetailPayload\n key={`payload-${index}`}\n title={title}\n description={description}\n content={output.value(data)}\n format={output.format}\n />\n );\n }\n\n const customNode = output.render(data) as ReactNode;\n if (wrapDefault) {\n return <div key={`custom-${index}`}>{customNode}</div>;\n }\n if (output.label != null) {\n const title = resolveLabel(output.label, tApp);\n return (\n <BackofficeDetailSection key={`custom-${index}`} title={title}>\n {customNode}\n </BackofficeDetailSection>\n );\n }\n return <div key={`custom-${index}`}>{customNode}</div>;\n });\n\n return <div className={styles.outputStack}>{nodes}</div>;\n};\n\ntype OperationOutputProps = {\n operation: BackofficeToolOperation;\n variables: Record<string, unknown>;\n fetchKey: number;\n};\n\nconst OperationOutput = ({\n operation,\n variables,\n fetchKey,\n}: OperationOutputProps): JSX.Element | null => {\n const { t } = useBackofficeReactTranslation();\n\n const data = useLazyLoadQuery<OperationType>(\n operation.query,\n variables as never,\n {\n fetchKey,\n fetchPolicy: 'store-or-network',\n },\n );\n\n if (operation.render != null) {\n const content = operation.render(data) as ReactNode;\n return <>{content}</>;\n }\n\n if (operation.outputs != null && operation.outputs.length > 0) {\n const shouldWrapDefault = operation.outputs.every((output) => {\n if (output.kind === 'payload') {\n return false;\n }\n const hasDescription =\n 'description' in output && output.description != null;\n return output.label == null && !hasDescription;\n });\n\n if (shouldWrapDefault) {\n return (\n <BackofficeDetailSection title={t('tools.output')}>\n <OutputRenderer outputs={operation.outputs} data={data} wrapDefault />\n </BackofficeDetailSection>\n );\n }\n\n return <OutputRenderer outputs={operation.outputs} data={data} />;\n }\n\n return null;\n};\n\ntype OperationContentProps = {\n operation: BackofficeToolOperation;\n};\n\nconst OperationContent = ({\n operation,\n}: OperationContentProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const { initiativeId, projectId } = useBackofficeToolsParams();\n\n const initialInputs = useMemo(() => {\n return buildInitialInputValues(operation.inputs);\n }, [operation.inputs]);\n\n const [inputValues, setInputValues] =\n useState<ToolInputValues>(initialInputs);\n const [formError, setFormError] = useState<string | null>(null);\n const [fetchKey, setFetchKey] = useState(0);\n const [submittedVariables, setSubmittedVariables] = useState<Record<\n string,\n unknown\n > | null>(null);\n const [hasRun, setHasRun] = useState(false);\n const [activePickerId, setActivePickerId] = useState<string | null>(null);\n const previousPickerValuesRef = useRef({\n initiativeId,\n projectId,\n });\n\n const pickerScope = useMemo(() => {\n return {\n initiativeId,\n projectId,\n };\n }, [initiativeId, projectId]);\n\n useEffect(() => {\n if (operation.inputs == null) {\n return;\n }\n const hasInitiativeInput = operation.inputs.some((input) => {\n return input.id === 'initiativeId';\n });\n const hasProjectInput = operation.inputs.some((input) => {\n return input.id === 'projectId';\n });\n if (!hasInitiativeInput && !hasProjectInput) {\n return;\n }\n\n setInputValues((current) => {\n let updated = current;\n if (\n hasInitiativeInput &&\n initiativeId != null &&\n initiativeId.trim() !== ''\n ) {\n const existing = current.initiativeId;\n if (typeof existing !== 'string' || existing.trim() === '') {\n updated = { ...updated, initiativeId };\n }\n }\n\n if (hasProjectInput && projectId != null && projectId.trim() !== '') {\n const existing = current.projectId;\n if (typeof existing !== 'string' || existing.trim() === '') {\n updated = { ...updated, projectId };\n }\n }\n\n return updated;\n });\n }, [initiativeId, operation.inputs, projectId]);\n\n useEffect(() => {\n const previous = previousPickerValuesRef.current;\n const updates: Record<string, string> = {};\n\n if (previous.initiativeId !== initiativeId) {\n updates.initiativeId = initiativeId ?? '';\n }\n if (previous.projectId !== projectId) {\n updates.projectId = projectId ?? '';\n }\n\n previousPickerValuesRef.current = { initiativeId, projectId };\n\n if (Object.keys(updates).length === 0) {\n return;\n }\n\n setInputValues((current) => {\n const raw = current.inputJson;\n if (typeof raw !== 'string' || raw.trim() === '') {\n return current;\n }\n const nextJson = applyPickerUpdatesToJson(raw, updates);\n if (nextJson == null) {\n return current;\n }\n return { ...current, inputJson: nextJson };\n });\n }, [initiativeId, projectId]);\n\n const handleSubmit = useCallback(() => {\n setFormError(null);\n\n if (initiativeId == null || initiativeId.trim() === '') {\n setFormError(t('tools.errors.missingScope'));\n return;\n }\n\n let nextVariables: Record<string, unknown>;\n try {\n nextVariables = buildToolVariables({\n operation,\n inputValues,\n initiativeId,\n projectId,\n run: true,\n });\n } catch (error) {\n if (error instanceof BackofficeToolValidationError) {\n setFormError(resolveLabel(error.label, tApp));\n return;\n }\n if (error instanceof Error) {\n setFormError(error.message);\n } else {\n setFormError(t('tools.errors.unknown'));\n }\n return;\n }\n\n setSubmittedVariables(nextVariables);\n setHasRun(true);\n setFetchKey((value) => {\n return value + 1;\n });\n }, [initiativeId, inputValues, operation, projectId, t, tApp]);\n\n const activePicker = useMemo(() => {\n if (activePickerId == null || operation.inputs == null) {\n return null;\n }\n const input = operation.inputs.find((item): item is EntityIdInputSpec => {\n return item.id === activePickerId && item.kind === 'entityId';\n });\n return input ?? null;\n }, [activePickerId, operation.inputs]);\n\n const renderInputField = (input: BackofficeToolInputSpec): JSX.Element => {\n const label = resolveLabel(input.label, tApp);\n const value = inputValues[input.id];\n\n if (input.kind === 'text') {\n const resolvedValue = typeof value === 'string' ? value : '';\n const placeholder =\n input.placeholder != null\n ? resolveLabel(input.placeholder, tApp)\n : undefined;\n return (\n <FormGroup key={input.id}>\n <Label>{label}</Label>\n <Textarea\n value={resolvedValue}\n placeholder={placeholder}\n onChange={(event) => {\n setFormError(null);\n setInputValues((current) => {\n return { ...current, [input.id]: event.target.value };\n });\n }}\n rows={4}\n fullWidth\n />\n </FormGroup>\n );\n }\n\n if (input.kind === 'json') {\n const resolvedValue = typeof value === 'string' ? value : '';\n const placeholder =\n input.placeholder != null\n ? resolveLabel(input.placeholder, tApp)\n : undefined;\n const exampleValue =\n typeof input.defaultValue === 'string' ? input.defaultValue : '';\n const canInsertExample = exampleValue.trim() !== '';\n const insertLabel = t('tools.forms.actions.insertExample');\n\n return (\n <FormGroup key={input.id}>\n <div className={styles.inputHeader}>\n <Label>{label}</Label>\n {canInsertExample && (\n <Button\n type=\"button\"\n variant=\"text\"\n size=\"small\"\n onClick={() => {\n setFormError(null);\n setInputValues((current) => {\n return { ...current, [input.id]: exampleValue };\n });\n }}\n >\n {insertLabel}\n </Button>\n )}\n </div>\n <Textarea\n value={resolvedValue}\n placeholder={placeholder}\n onChange={(event) => {\n setFormError(null);\n setInputValues((current) => {\n return { ...current, [input.id]: event.target.value };\n });\n }}\n rows={6}\n fullWidth\n />\n </FormGroup>\n );\n }\n\n if (input.kind === 'enum') {\n const resolvedValue = typeof value === 'string' ? value : '';\n const options = input.options.map((option) => {\n return {\n id: option.value,\n value: option.value,\n label: resolveLabel(option.label, tApp),\n };\n });\n return (\n <FormGroup key={input.id}>\n <Label>{label}</Label>\n <SimpleSelect\n options={options}\n value={resolvedValue}\n onChange={(nextValue) => {\n setFormError(null);\n setInputValues((current) => {\n return { ...current, [input.id]: nextValue };\n });\n }}\n placeholder={label}\n />\n </FormGroup>\n );\n }\n\n if (input.kind === 'boolean') {\n const resolvedValue = typeof value === 'boolean' ? value : false;\n return (\n <FormGroup key={input.id}>\n <CheckboxField\n label={label}\n checked={resolvedValue}\n onChange={(event) => {\n setFormError(null);\n setInputValues((current) => {\n return { ...current, [input.id]: event.target.checked };\n });\n }}\n />\n </FormGroup>\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (input.kind === 'entityId') {\n const resolvedValue = typeof value === 'string' ? value : '';\n const renderField = (displayValue: string | null = null) => {\n const normalizedDisplayValue = displayValue?.trim() ?? '';\n return (\n <EntityIdFilterField\n label={label}\n value={resolvedValue}\n displayValue={normalizedDisplayValue}\n onPick={() => {\n setActivePickerId(input.id);\n }}\n onClear={() => {\n setFormError(null);\n setInputValues((current) => {\n return { ...current, [input.id]: '' };\n });\n }}\n />\n );\n };\n\n return (\n <FormGroup key={input.id}>\n <Label>{label}</Label>\n {resolvedValue.trim() === '' ? (\n renderField()\n ) : (\n <EntityFilterValueText entityId={input.entity} id={resolvedValue}>\n {(resolvedLabel) => {\n return renderField(resolvedLabel);\n }}\n </EntityFilterValueText>\n )}\n </FormGroup>\n );\n }\n\n return <></>;\n };\n\n const handleSubmitEvent = (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n handleSubmit();\n };\n\n const formInputs = operation.inputs?.map((input) => {\n return renderInputField(input);\n });\n const isRunDisabled = initiativeId == null || initiativeId.trim() === '';\n let outputNode: ReactNode = null;\n if (hasRun && submittedVariables != null) {\n outputNode = (\n <BackofficeToolsQueryBoundary>\n <OperationOutput\n operation={operation}\n variables={submittedVariables}\n fetchKey={fetchKey}\n />\n </BackofficeToolsQueryBoundary>\n );\n }\n\n return (\n <>\n <BackofficeDetailSection\n title={resolveLabel(operation.title, tApp)}\n description={\n operation.subtitle != null\n ? resolveLabel(operation.subtitle, tApp)\n : undefined\n }\n >\n <Form onSubmit={handleSubmitEvent} className={styles.form}>\n <FormErrorBanner message={formError} />\n {formInputs}\n <div className={styles.actions}>\n <Button\n type=\"submit\"\n variant=\"primary\"\n size=\"small\"\n disabled={isRunDisabled}\n >\n {t('tools.forms.actions.run')}\n </Button>\n </div>\n </Form>\n {activePicker != null && (\n <EntityIdPickerDialog\n isOpen\n entity={activePicker.entity}\n title={resolveLabel(activePicker.label, tApp)}\n scope={pickerScope}\n onClose={() => {\n setActivePickerId(null);\n }}\n onSelectId={(id) => {\n setFormError(null);\n setInputValues((current) => {\n return { ...current, [activePicker.id]: id };\n });\n setActivePickerId(null);\n }}\n />\n )}\n </BackofficeDetailSection>\n {outputNode}\n </>\n );\n};\n\nexport type BackofficeToolsOperationPageProps = {\n operation: BackofficeToolOperation;\n toolId?: string;\n};\n\nexport const BackofficeToolsOperationPage = ({\n operation,\n toolId,\n}: BackofficeToolsOperationPageProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n\n const title = resolveLabel(operation.title, tApp);\n const subtitle =\n operation.subtitle != null\n ? resolveLabel(operation.subtitle, tApp)\n : undefined;\n const breadcrumb = buildToolBreadcrumb({ title });\n const showProjectPicker = shouldShowProjectPicker(operation);\n const toolIdLabel = t('tools.meta.idLabel');\n const inputTypeTitle = t('tools.docs.inputTypeTitle');\n const inputExampleTitle = t('tools.docs.inputExampleTitle');\n\n const inputTypeSDL =\n typeof operation.inputTypeSDL === 'string'\n ? operation.inputTypeSDL.trim()\n : '';\n const jsonExample = (() => {\n if (operation.inputs == null) {\n return null;\n }\n const jsonInput = operation.inputs.find((input) => {\n return input.kind === 'json';\n });\n if (jsonInput == null || typeof jsonInput.defaultValue !== 'string') {\n return null;\n }\n const trimmed = jsonInput.defaultValue.trim();\n if (trimmed === '') {\n return null;\n }\n return jsonInput.defaultValue;\n })();\n\n const docPanels: ReactNode[] = [];\n if (inputTypeSDL !== '') {\n docPanels.push(\n <BackofficeToolsDocPanel\n key=\"input-type\"\n title={inputTypeTitle}\n content={inputTypeSDL}\n language=\"graphql\"\n defaultOpen\n />,\n );\n }\n if (jsonExample != null) {\n docPanels.push(\n <BackofficeToolsDocPanel\n key=\"input-example\"\n title={inputExampleTitle}\n content={jsonExample}\n language=\"json\"\n />,\n );\n }\n\n const docPanel =\n docPanels.length > 0 ? (\n <div className={docPanelStyles.panelGroup}>{docPanels}</div>\n ) : undefined;\n\n return (\n <BackofficeRightPageLayout breadcrumb={breadcrumb}>\n <BackofficeToolsPageLayout\n title={title}\n subtitle={subtitle}\n toolId={toolId}\n toolIdLabel={toolIdLabel}\n showProjectPicker={showProjectPicker}\n docPanel={docPanel}\n >\n <BackofficeErrorBoundary\n fallback={({ error, reset }) => {\n return (\n <BackofficeToolsErrorFallback error={error} onRetry={reset} />\n );\n }}\n >\n <OperationContent operation={operation} />\n </BackofficeErrorBoundary>\n </BackofficeToolsPageLayout>\n </BackofficeRightPageLayout>\n );\n};\n\nexport default BackofficeToolsOperationPage;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,IAAM,EAAE,wBAAqB,GAEvB,KAAgB,GAAkB,MAC/B,EAAM,EAAK,EAGd,KACJ,GACA,MAEI,OAAO,KAAU,aACZ,EAAM,EAAK,GAEhB,KACK,MAgBL,KACJ,MACoB;CACpB,IAAM,IAA0B,EAAE;AAQlC,QAPA,GAAQ,SAAS,MAAU;AACzB,EAAI,EAAM,SAAS,YACjB,EAAO,EAAM,MAAM,EAAM,gBAAgB,KAEzC,EAAO,EAAM,MAAM,EAAM,gBAAgB;GAE3C,EACK;GAGH,KAAoB,MAA6C;CACrE,IAAM,IAA0B,EAAE;AAelC,QAdA,OAAO,QAAQ,EAAO,CAAC,SAAS,CAAC,GAAK,OAAW;AAC3C,WAAS,MAGb;OAAI,OAAO,KAAU,UAAU;IAC7B,IAAM,IAAU,EAAM,MAAM;AAC5B,QAAI,MAAY,GACd;AAEF,MAAO,KAAO;AACd;;AAEF,KAAO,KAAO;;GACd,EACK;GAGH,MAAsB,EAC1B,cACA,gBACA,iBACA,cACA,aACsD;CACtD,IAAM,IAAe,EAAiB,EAAY,EAE5C,IAAkB,OAAO,UAAU,eAAe,KACtD,GACA,YACD,EACK,IACJ,EAAU,QAAQ,MAAM,MACf,EAAM,SAAS,cAAc,EAAM,WAAW,WACrD,IAAI;AACR,MACG,KAAmB,MACpB,KAAa,QACb,E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MAAiB,MACnB,EAAU,KACR,kBAAC,GAAD;EAEE,OAAO;EACP,SAAS;EACT,UAAS;EACT,aAAA;EACA,EALI,aAKJ,CACH,EAEC,KAAe,QACjB,EAAU,KACR,kBAAC,GAAD;EAEE,OAAO;EACP,SAAS;EACT,UAAS;EACT,EAJI,gBAIJ,CACH,EASD,kBAAC,GAAD;EAAuC;YACrC,kBAAC,GAAD;GACS;GACG;GACF;GACK;GACM;GACT,UAZd,EAAU,SAAS,IACjB,kBAAC,OAAD;IAAK,WAAW;cAA4B;IAAgB,CAAA,GAC1D,KAAA;aAYA,kBAAC,GAAD;IACE,WAAW,EAAE,UAAO,eAEhB,kBAAC,GAAD;KAAqC;KAAO,SAAS;KAAS,CAAA;cAIlE,kBAAC,GAAD,EAA6B,cAAa,CAAA;IAClB,CAAA;GACA,CAAA;EACF,CAAA"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
//#region src/subscriptions/conversationStream.ts
|
|
2
|
-
function e(e, t) {
|
|
3
|
-
let n = e.getLinkedRecord("chunk");
|
|
4
|
-
if (n == null) return;
|
|
5
|
-
let r = n.getValue("partId");
|
|
6
|
-
if (r == null) return;
|
|
7
|
-
let i = t.get(r);
|
|
8
|
-
if (i == null) return;
|
|
9
|
-
let a = n.getValue("chunkIndex"), o = n.getValue("delta"), s = n.getValue("done");
|
|
10
|
-
if (o == null) return;
|
|
11
|
-
let c = i.getValue("__lastChunkIndex") ?? -1;
|
|
12
|
-
if (a != null && a <= c) return;
|
|
13
|
-
let l = i.getLinkedRecord("body");
|
|
14
|
-
if (l == null) return;
|
|
15
|
-
let u = l.getType();
|
|
16
|
-
if (u !== "AgentMessagePart" && u !== "ModelMessagePart" && u !== "UserMessagePart") return;
|
|
17
|
-
let d = l.getLinkedRecord("content");
|
|
18
|
-
if (d == null) return;
|
|
19
|
-
let f = d.getValue("markdown") ?? "";
|
|
20
|
-
d.setValue(`${f}${o}`, "markdown"), a != null && i.setValue(a, "__lastChunkIndex"), s != null && i.setValue(s, "__streamingDone");
|
|
21
|
-
}
|
|
22
|
-
function t(t, n, r) {
|
|
23
|
-
return (i) => {
|
|
24
|
-
let a = i.getRootField("conversationChunkEvent");
|
|
25
|
-
if (a == null) return;
|
|
26
|
-
let o = a.getType(), s = a.getValue("cursor");
|
|
27
|
-
if (typeof s == "string" && n?.(s), o === "RefetchNeeded") {
|
|
28
|
-
let e = a.getValue("reason") ?? null;
|
|
29
|
-
r?.(e);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
i.get(t) != null && (a.getValue("conversationId") ?? null) === t && o === "PartChunkAppended" && e(a, i);
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { t as createConversationStreamUpdater, e as handlePartChunkAppended };
|
|
37
|
-
|
|
38
|
-
//# sourceMappingURL=conversationStream.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversationStream.js","names":[],"sources":["../../../src/subscriptions/conversationStream.ts"],"sourcesContent":["import type {\n RecordProxy,\n RecordSourceSelectorProxy,\n SelectorStoreUpdater,\n} from 'relay-runtime';\n\nexport type ConversationRequestUsageSnapshot = {\n cachedInputTokens?: number | null;\n costUsd?: number | null;\n inputTokens?: number | null;\n outputTokens?: number | null;\n reasoningTokens?: number | null;\n totalTokens?: number | null;\n};\n\n/** Apply a streamed message chunk delta to the matching conversation part. */\nexport function handlePartChunkAppended(\n payload: RecordProxy,\n store: RecordSourceSelectorProxy<unknown>,\n): void {\n const chunk = payload.getLinkedRecord('chunk');\n if (chunk == null) {\n return;\n }\n\n const partId = chunk.getValue('partId') as string | null;\n if (partId == null) {\n return;\n }\n const partRecord = store.get(partId);\n if (partRecord == null) {\n return;\n }\n\n const chunkIndex = chunk.getValue('chunkIndex') as number | null;\n const delta = chunk.getValue('delta') as string | null;\n const done = chunk.getValue('done') as boolean | null;\n if (delta == null) {\n return;\n }\n\n const lastChunkIndex =\n (partRecord.getValue('__lastChunkIndex') as number | null) ?? -1;\n if (chunkIndex != null && chunkIndex <= lastChunkIndex) {\n return;\n }\n\n const bodyRecord = partRecord.getLinkedRecord('body');\n if (bodyRecord == null) {\n return;\n }\n const bodyType = bodyRecord.getType();\n if (\n bodyType !== 'AgentMessagePart' &&\n bodyType !== 'ModelMessagePart' &&\n bodyType !== 'UserMessagePart'\n ) {\n return;\n }\n const contentRecord = bodyRecord.getLinkedRecord('content');\n if (contentRecord == null) {\n return;\n }\n const previousText =\n (contentRecord.getValue('markdown') as string | null) ?? '';\n contentRecord.setValue(`${previousText}${delta}`, 'markdown');\n\n if (chunkIndex != null) {\n partRecord.setValue(chunkIndex, '__lastChunkIndex');\n }\n if (done != null) {\n partRecord.setValue(done, '__streamingDone');\n }\n}\n\n/** Create a Relay store updater for conversation chunk events. */\nexport function createConversationStreamUpdater<T>(\n conversationId: string,\n onCursor?: (cursor: string | null) => void,\n onRefetchNeeded?: (reason: string | null) => void,\n): SelectorStoreUpdater<T> {\n return (store) => {\n const eventRecord = store.getRootField('conversationChunkEvent');\n if (eventRecord == null) {\n return;\n }\n\n const eventType = eventRecord.getType();\n const cursorValue = eventRecord.getValue('cursor');\n if (typeof cursorValue === 'string') {\n onCursor?.(cursorValue);\n }\n\n if (eventType === 'RefetchNeeded') {\n const reason =\n (eventRecord.getValue('reason') as string | null | undefined) ?? null;\n onRefetchNeeded?.(reason);\n return;\n }\n\n const conversationRecord = store.get(conversationId);\n if (conversationRecord == null) {\n return;\n }\n\n const targetConversationId =\n (eventRecord.getValue('conversationId') as string | null) ?? null;\n if (targetConversationId !== conversationId) {\n return;\n }\n\n if (eventType === 'PartChunkAppended') {\n handlePartChunkAppended(eventRecord, store);\n }\n };\n}\n"],"mappings":";AAgBA,SAAgB,EACd,GACA,GACM;CACN,IAAM,IAAQ,EAAQ,gBAAgB,QAAQ;AAC9C,KAAI,KAAS,KACX;CAGF,IAAM,IAAS,EAAM,SAAS,SAAS;AACvC,KAAI,KAAU,KACZ;CAEF,IAAM,IAAa,EAAM,IAAI,EAAO;AACpC,KAAI,KAAc,KAChB;CAGF,IAAM,IAAa,EAAM,SAAS,aAAa,EACzC,IAAQ,EAAM,SAAS,QAAQ,EAC/B,IAAO,EAAM,SAAS,OAAO;AACnC,KAAI,KAAS,KACX;CAGF,IAAM,IACH,EAAW,SAAS,mBAAmB,IAAsB;AAChE,KAAI,KAAc,QAAQ,KAAc,EACtC;CAGF,IAAM,IAAa,EAAW,gBAAgB,OAAO;AACrD,KAAI,KAAc,KAChB;CAEF,IAAM,IAAW,EAAW,SAAS;AACrC,KACE,MAAa,sBACb,MAAa,sBACb,MAAa,kBAEb;CAEF,IAAM,IAAgB,EAAW,gBAAgB,UAAU;AAC3D,KAAI,KAAiB,KACnB;CAEF,IAAM,IACH,EAAc,SAAS,WAAW,IAAsB;AAM3D,CALA,EAAc,SAAS,GAAG,IAAe,KAAS,WAAW,EAEzD,KAAc,QAChB,EAAW,SAAS,GAAY,mBAAmB,EAEjD,KAAQ,QACV,EAAW,SAAS,GAAM,kBAAkB;;AAKhD,SAAgB,EACd,GACA,GACA,GACyB;AACzB,SAAQ,MAAU;EAChB,IAAM,IAAc,EAAM,aAAa,yBAAyB;AAChE,MAAI,KAAe,KACjB;EAGF,IAAM,IAAY,EAAY,SAAS,EACjC,IAAc,EAAY,SAAS,SAAS;AAKlD,MAJI,OAAO,KAAgB,YACzB,IAAW,EAAY,EAGrB,MAAc,iBAAiB;GACjC,IAAM,IACH,EAAY,SAAS,SAAS,IAAkC;AACnE,OAAkB,EAAO;AACzB;;AAGyB,IAAM,IAAI,EAAe,IAC1B,SAKvB,EAAY,SAAS,iBAAiB,IAAsB,UAClC,KAIzB,MAAc,uBAChB,EAAwB,GAAa,EAAM"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'react';
|
|
2
|
-
export type BackofficeToolsDocPanelProps = {
|
|
3
|
-
title: string;
|
|
4
|
-
content: string;
|
|
5
|
-
language?: string | null;
|
|
6
|
-
badgeLabel?: string | null;
|
|
7
|
-
defaultOpen?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export declare const BackofficeToolsDocPanel: ({ title, content, language, badgeLabel, defaultOpen, }: BackofficeToolsDocPanelProps) => JSX.Element | null;
|
|
10
|
-
export default BackofficeToolsDocPanel;
|
|
11
|
-
//# sourceMappingURL=BackofficeToolsDocPanel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeToolsDocPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/backoffice/tools/BackofficeToolsDocPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAQ3C,MAAM,MAAM,4BAA4B,GAAG;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,wDAMrC,4BAA4B,KAAG,GAAG,CAAC,OAAO,GAAG,IAwC/C,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'react';
|
|
2
|
-
export type BackofficeToolsErrorFallbackProps = {
|
|
3
|
-
error: unknown;
|
|
4
|
-
onRetry: () => void;
|
|
5
|
-
};
|
|
6
|
-
export declare const BackofficeToolsErrorFallback: ({ error, onRetry, }: BackofficeToolsErrorFallbackProps) => JSX.Element;
|
|
7
|
-
export default BackofficeToolsErrorFallback;
|
|
8
|
-
//# sourceMappingURL=BackofficeToolsErrorFallback.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeToolsErrorFallback.d.ts","sourceRoot":"","sources":["../../../../../src/components/backoffice/tools/BackofficeToolsErrorFallback.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAQjC,MAAM,MAAM,iCAAiC,GAAG;IAC9C,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AA2BF,eAAO,MAAM,4BAA4B,GAAI,qBAG1C,iCAAiC,KAAG,GAAG,CAAC,OA+C1C,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'react';
|
|
2
|
-
export type BackofficeToolsJsonFormProps = {
|
|
3
|
-
value: string;
|
|
4
|
-
onChange: (next: string) => void;
|
|
5
|
-
onSubmit: () => void;
|
|
6
|
-
error?: string | null;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
label?: string;
|
|
9
|
-
submitLabel?: string;
|
|
10
|
-
exampleValue?: string;
|
|
11
|
-
exampleLabel?: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const BackofficeToolsJsonForm: ({ value, onChange, onSubmit, error, disabled, label, submitLabel, exampleValue, exampleLabel, }: BackofficeToolsJsonFormProps) => JSX.Element;
|
|
14
|
-
export default BackofficeToolsJsonForm;
|
|
15
|
-
//# sourceMappingURL=BackofficeToolsJsonForm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeToolsJsonForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/backoffice/tools/BackofficeToolsJsonForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAajD,MAAM,MAAM,4BAA4B,GAAG;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,iGAUrC,4BAA4B,KAAG,GAAG,CAAC,OA8DrC,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|