@nivaro/react 0.3.139 → 0.3.140
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/components/InlineGridField.js +95 -92
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +36 -2
- package/dist/shared/components/AudienceConfirmPanel.js +19 -19
- package/dist/shared/components/BroadcastView.js +213 -211
- package/dist/shared/components/CollectionBrowserView.js +2677 -2658
- package/dist/shared/components/ConfigHistory.js +45 -45
- package/dist/shared/components/ConformanceView.js +110 -110
- package/dist/shared/components/DataTable.js +51 -51
- package/dist/shared/components/FilePreviewLightbox.js +26 -25
- package/dist/shared/components/ItemEditForm.js +3038 -3027
- package/dist/shared/components/LiveCount.js +27 -23
- package/dist/shared/components/LiveTraceView.js +62 -61
- package/dist/shared/components/PageRenderer.js +422 -410
- package/dist/shared/components/ProfileView.js +199 -199
- package/dist/shared/components/QualityRulesView.js +70 -70
- package/dist/shared/components/QueryTable.js +131 -130
- package/dist/shared/components/RecordGraph.js +98 -98
- package/dist/shared/components/RecordReadView.js +287 -288
- package/dist/shared/components/ReportView.js +1279 -1259
- package/dist/shared/components/SlaRulesView.js +73 -74
- package/dist/shared/components/WidgetSlot.js +73 -73
- package/dist/shared/components/ai/AiChart.js +36 -32
- package/dist/shared/components/ai/AiMarkdown.js +136 -129
- package/dist/shared/components/ai/TaskDo.js +87 -87
- package/dist/shared/components/ai/answer-formats.js +37 -30
- package/dist/shared/components/ai/call-log/format.js +17 -16
- package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
- package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
- package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
- package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
- package/dist/shared/components/bulk/bulk-field-options.js +10 -10
- package/dist/shared/components/cbv/column-totals.js +53 -51
- package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
- package/dist/shared/components/command-center/announce.js +7 -6
- package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
- package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
- package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
- package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
- package/dist/shared/components/imports/RunDetailSheet.js +1 -1
- package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
- package/dist/shared/components/integrations/console/EventsView.js +35 -35
- package/dist/shared/components/integrations/console/FirefightView.js +15 -14
- package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
- package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
- package/dist/shared/components/integrations/console/SignalCard.js +67 -67
- package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
- package/dist/shared/components/item-edit/ChangesTray.js +88 -74
- package/dist/shared/components/item-edit/FilePickerField.js +123 -123
- package/dist/shared/components/item-edit/GroupSection.js +301 -292
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
- package/dist/shared/components/item-edit/InlineGridField.js +45 -36
- package/dist/shared/components/item-edit/InlineTableField.js +1167 -1153
- package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
- package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
- package/dist/shared/components/ops-report/format.js +37 -36
- package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
- package/dist/shared/components/panels/RevisionsPanel.js +306 -305
- package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
- package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
- package/dist/shared/components/pipeline/TeamsView.js +189 -130
- package/dist/shared/components/profile/AgentsPanel.js +6 -6
- package/dist/shared/components/profile/DelegationCard.js +13 -12
- package/dist/shared/components/profile/PersonActivity.js +48 -48
- package/dist/shared/components/profile/PersonExtras.js +107 -107
- package/dist/shared/components/profile/PersonWeek.js +9 -9
- package/dist/shared/components/queue/QueueBulkBar.js +19 -18
- package/dist/shared/components/queue/QueueBulkMove.js +21 -20
- package/dist/shared/components/queue/QueueItemSheet.js +136 -131
- package/dist/shared/components/queue/QueueWorklist.js +671 -670
- package/dist/shared/components/queue/worklist-helpers.js +36 -21
- package/dist/shared/components/support/RequestList.js +121 -121
- package/dist/shared/components/support/SupportAnalytics.js +29 -29
- package/dist/shared/lib/activity-sentence.js +251 -229
- package/dist/shared/lib/format-value.js +5 -4
- package/dist/shared/lib/number-format.js +87 -0
- package/dist/shared/lib/number-kind.js +133 -0
- package/dist/shared/lib/utils.js +24 -20
- package/dist/shared/lib/watch-list.js +1 -1
- package/dist/shared/lib/widget-value-format.js +26 -12
- package/package.json +1 -1
|
@@ -86,11 +86,11 @@ const te = {
|
|
|
86
86
|
MoreHorizontal: mt,
|
|
87
87
|
MoreVertical: pt
|
|
88
88
|
};
|
|
89
|
-
function qe({ awaiting: n, dark:
|
|
89
|
+
function qe({ awaiting: n, dark: a }) {
|
|
90
90
|
return /* @__PURE__ */ x(
|
|
91
91
|
"span",
|
|
92
92
|
{
|
|
93
|
-
className: `text-[12px] font-normal italic ${
|
|
93
|
+
className: `text-[12px] font-normal italic ${a ? "text-slate-400" : "text-slate-400 dark:text-slate-500"}`,
|
|
94
94
|
"data-widget-awaiting": n,
|
|
95
95
|
"data-tip": `Waiting for ${n} — this figure is scoped to it and shows once it is set`,
|
|
96
96
|
children: [
|
|
@@ -102,12 +102,12 @@ function qe({ awaiting: n, dark: i }) {
|
|
|
102
102
|
}
|
|
103
103
|
function Re({
|
|
104
104
|
label: n,
|
|
105
|
-
value:
|
|
106
|
-
display:
|
|
105
|
+
value: a,
|
|
106
|
+
display: i,
|
|
107
107
|
loading: l,
|
|
108
108
|
awaiting: u
|
|
109
109
|
}) {
|
|
110
|
-
const { prefix: g, suffix: v } = fe(
|
|
110
|
+
const { prefix: g, suffix: v } = fe(a, i), b = l ? null : pe(a, i.format ?? "", i);
|
|
111
111
|
return (
|
|
112
112
|
// Same label / value vocabulary as a field tile in the record sub-header
|
|
113
113
|
// (lib/header-strip.ts) — the two kinds of cell read as one row.
|
|
@@ -122,10 +122,10 @@ function Re({
|
|
|
122
122
|
{
|
|
123
123
|
"data-header-value": !0,
|
|
124
124
|
className: `${Lr} max-w-[232px] items-baseline truncate leading-tight`,
|
|
125
|
-
children: l ? /* @__PURE__ */ t("span", { className: "animate-pulse inline-block h-3.5 w-16 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : u &&
|
|
125
|
+
children: l ? /* @__PURE__ */ t("span", { className: "animate-pulse inline-block h-3.5 w-16 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : u && a == null ? /* @__PURE__ */ t(qe, { awaiting: u }) : /* @__PURE__ */ x(
|
|
126
126
|
"span",
|
|
127
127
|
{
|
|
128
|
-
className: String(
|
|
128
|
+
className: String(i.format ?? "").startsWith("currency") || /^[$€£¥]/.test(g) ? Cr : $r,
|
|
129
129
|
children: [
|
|
130
130
|
g,
|
|
131
131
|
b,
|
|
@@ -142,8 +142,8 @@ function Re({
|
|
|
142
142
|
}
|
|
143
143
|
function Mr({
|
|
144
144
|
data: n,
|
|
145
|
-
label:
|
|
146
|
-
loading:
|
|
145
|
+
label: a,
|
|
146
|
+
loading: i,
|
|
147
147
|
widgetConfig: l,
|
|
148
148
|
awaiting: u
|
|
149
149
|
}) {
|
|
@@ -162,12 +162,12 @@ function Mr({
|
|
|
162
162
|
R
|
|
163
163
|
)) });
|
|
164
164
|
}
|
|
165
|
-
if (
|
|
166
|
-
const b = (l == null ? void 0 : l.value_fields) ?? [], _ = b.length > 0 ? b : [{ label:
|
|
165
|
+
if (i) {
|
|
166
|
+
const b = (l == null ? void 0 : l.value_fields) ?? [], _ = b.length > 0 ? b : [{ label: a }];
|
|
167
167
|
return /* @__PURE__ */ t("div", { className: g, children: _.map((R, C) => /* @__PURE__ */ t(
|
|
168
168
|
Re,
|
|
169
169
|
{
|
|
170
|
-
label: R.label ??
|
|
170
|
+
label: R.label ?? a,
|
|
171
171
|
display: { prefix: R.prefix ?? "", suffix: R.suffix ?? "", format: R.format ?? "" },
|
|
172
172
|
loading: !0
|
|
173
173
|
},
|
|
@@ -179,7 +179,7 @@ function Mr({
|
|
|
179
179
|
return /* @__PURE__ */ t("div", { className: g, children: /* @__PURE__ */ t(
|
|
180
180
|
Re,
|
|
181
181
|
{
|
|
182
|
-
label:
|
|
182
|
+
label: a,
|
|
183
183
|
value: n.value,
|
|
184
184
|
display: v,
|
|
185
185
|
loading: !1,
|
|
@@ -187,35 +187,35 @@ function Mr({
|
|
|
187
187
|
}
|
|
188
188
|
) });
|
|
189
189
|
}
|
|
190
|
-
function Hr(n,
|
|
191
|
-
if (Object.hasOwn(n,
|
|
192
|
-
const
|
|
190
|
+
function Hr(n, a) {
|
|
191
|
+
if (Object.hasOwn(n, a)) return n[a] ?? null;
|
|
192
|
+
const i = a.split(".");
|
|
193
193
|
let l = n;
|
|
194
|
-
for (const u of
|
|
194
|
+
for (const u of i) {
|
|
195
195
|
if (l == null || typeof l != "object") return l ?? null;
|
|
196
196
|
l = l[u];
|
|
197
197
|
}
|
|
198
198
|
return l ?? null;
|
|
199
199
|
}
|
|
200
|
-
function Br(n,
|
|
201
|
-
const
|
|
200
|
+
function Br(n, a) {
|
|
201
|
+
const i = {};
|
|
202
202
|
for (const l of n)
|
|
203
203
|
if (l.binding_type === "item_field")
|
|
204
|
-
|
|
204
|
+
i[l.key] = Hr(a, l.binding_value);
|
|
205
205
|
else if (l.binding_type === "static")
|
|
206
|
-
|
|
206
|
+
i[l.key] = l.binding_value;
|
|
207
207
|
else if (l.binding_type === "url_param" && typeof window < "u") {
|
|
208
208
|
const u = new URLSearchParams(window.location.search);
|
|
209
|
-
|
|
209
|
+
i[l.key] = u.get(l.binding_value) ?? null;
|
|
210
210
|
}
|
|
211
|
-
return
|
|
211
|
+
return i;
|
|
212
212
|
}
|
|
213
213
|
function Le({
|
|
214
214
|
data: n,
|
|
215
|
-
awaiting:
|
|
215
|
+
awaiting: a
|
|
216
216
|
}) {
|
|
217
|
-
if (
|
|
218
|
-
const
|
|
217
|
+
if (a && n.value == null) return /* @__PURE__ */ t(qe, { awaiting: a });
|
|
218
|
+
const i = n.display ?? {}, { prefix: l, suffix: u } = fe(n.value, i), g = pe(n.value, i.format ?? "", i);
|
|
219
219
|
return /* @__PURE__ */ x("div", { className: "flex items-baseline gap-1", children: [
|
|
220
220
|
l && /* @__PURE__ */ t("span", { className: "text-[13px] text-slate-500", children: l }),
|
|
221
221
|
/* @__PURE__ */ t("span", { className: "text-2xl font-semibold text-slate-900 dark:text-slate-100", children: g }),
|
|
@@ -224,13 +224,13 @@ function Le({
|
|
|
224
224
|
}
|
|
225
225
|
function Ce({
|
|
226
226
|
label: n,
|
|
227
|
-
value:
|
|
228
|
-
display:
|
|
227
|
+
value: a,
|
|
228
|
+
display: i,
|
|
229
229
|
dark: l,
|
|
230
230
|
loading: u,
|
|
231
231
|
awaiting: g
|
|
232
232
|
}) {
|
|
233
|
-
const { prefix: v, suffix: b } = fe(
|
|
233
|
+
const { prefix: v, suffix: b } = fe(a, i), _ = u ? null : pe(a, i.format ?? "", i);
|
|
234
234
|
return /* @__PURE__ */ x("div", { className: "flex flex-col justify-center px-2.5 py-1 min-w-0 gap-0.5", children: [
|
|
235
235
|
/* @__PURE__ */ t(
|
|
236
236
|
"span",
|
|
@@ -248,7 +248,7 @@ function Ce({
|
|
|
248
248
|
{
|
|
249
249
|
className: `animate-pulse inline-block h-3 w-14 rounded ${l ? "bg-slate-600" : "bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]"}`
|
|
250
250
|
}
|
|
251
|
-
) : g &&
|
|
251
|
+
) : g && a == null ? /* @__PURE__ */ t(qe, { awaiting: g, dark: l }) : /* @__PURE__ */ x(Ee, { children: [
|
|
252
252
|
v && /* @__PURE__ */ t("span", { className: `text-[10px] ${l ? "text-slate-400" : "text-slate-500"}`, children: v }),
|
|
253
253
|
_,
|
|
254
254
|
b && /* @__PURE__ */ t("span", { className: `text-[10px] ${l ? "text-slate-400" : "text-slate-500"}`, children: b })
|
|
@@ -259,13 +259,13 @@ function Ce({
|
|
|
259
259
|
}
|
|
260
260
|
function Vr({
|
|
261
261
|
data: n,
|
|
262
|
-
label:
|
|
263
|
-
style:
|
|
262
|
+
label: a,
|
|
263
|
+
style: i,
|
|
264
264
|
loading: l,
|
|
265
265
|
widgetConfig: u,
|
|
266
266
|
awaiting: g
|
|
267
267
|
}) {
|
|
268
|
-
const v =
|
|
268
|
+
const v = i === "pill-dark", b = v ? "flex items-stretch divide-x divide-slate-700 rounded-md bg-slate-800/90 border border-slate-700 overflow-hidden" : "flex items-stretch divide-x divide-slate-200 rounded-md bg-white border border-slate-200 overflow-hidden dark:bg-card dark:border-border dark:divide-border";
|
|
269
269
|
if (n && "values" in n) {
|
|
270
270
|
const R = n.values ?? [];
|
|
271
271
|
return R.length === 0 ? null : /* @__PURE__ */ t("div", { className: b, children: R.map((C, S) => /* @__PURE__ */ t(
|
|
@@ -282,11 +282,11 @@ function Vr({
|
|
|
282
282
|
)) });
|
|
283
283
|
}
|
|
284
284
|
if (l) {
|
|
285
|
-
const R = (u == null ? void 0 : u.value_fields) ?? [], C = R.length > 0 ? R : [{ label:
|
|
285
|
+
const R = (u == null ? void 0 : u.value_fields) ?? [], C = R.length > 0 ? R : [{ label: a }];
|
|
286
286
|
return /* @__PURE__ */ t("div", { className: b, children: C.map((S, U) => /* @__PURE__ */ t(
|
|
287
287
|
Ce,
|
|
288
288
|
{
|
|
289
|
-
label: S.label ??
|
|
289
|
+
label: S.label ?? a,
|
|
290
290
|
display: { prefix: S.prefix ?? "", suffix: S.suffix ?? "", format: S.format ?? "" },
|
|
291
291
|
dark: v,
|
|
292
292
|
loading: !0
|
|
@@ -299,7 +299,7 @@ function Vr({
|
|
|
299
299
|
return /* @__PURE__ */ t("div", { className: b, children: /* @__PURE__ */ t(
|
|
300
300
|
Ce,
|
|
301
301
|
{
|
|
302
|
-
label:
|
|
302
|
+
label: a,
|
|
303
303
|
value: n.value,
|
|
304
304
|
display: _,
|
|
305
305
|
dark: v,
|
|
@@ -309,20 +309,20 @@ function Vr({
|
|
|
309
309
|
) });
|
|
310
310
|
}
|
|
311
311
|
function rt({ data: n }) {
|
|
312
|
-
const
|
|
313
|
-
return
|
|
312
|
+
const a = n.values ?? [];
|
|
313
|
+
return a.length === 0 ? /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-400", children: "No values" }) : /* @__PURE__ */ t(
|
|
314
314
|
"div",
|
|
315
315
|
{
|
|
316
316
|
className: "grid gap-3",
|
|
317
|
-
style: { gridTemplateColumns: `repeat(${Math.min(
|
|
318
|
-
children:
|
|
317
|
+
style: { gridTemplateColumns: `repeat(${Math.min(a.length, 3)}, minmax(0, 1fr))` },
|
|
318
|
+
children: a.map((i, l) => {
|
|
319
319
|
var b;
|
|
320
|
-
const { prefix: u, suffix: g } = fe(
|
|
320
|
+
const { prefix: u, suffix: g } = fe(i.value, i.display), v = ((b = i.display) == null ? void 0 : b.format) ?? "";
|
|
321
321
|
return /* @__PURE__ */ x("div", { className: "flex flex-col gap-0.5", children: [
|
|
322
|
-
|
|
322
|
+
i.label && /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400 dark:text-slate-500", children: i.label }),
|
|
323
323
|
/* @__PURE__ */ x("div", { className: "flex items-baseline gap-0.5", children: [
|
|
324
324
|
u && /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-500", children: u }),
|
|
325
|
-
/* @__PURE__ */ t("span", { className: "text-xl font-semibold text-slate-900 dark:text-slate-100", children: pe(
|
|
325
|
+
/* @__PURE__ */ t("span", { className: "text-xl font-semibold text-slate-900 dark:text-slate-100", children: pe(i.value, v, i.display) }),
|
|
326
326
|
g && /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-500", children: g })
|
|
327
327
|
] })
|
|
328
328
|
] }, l);
|
|
@@ -331,23 +331,23 @@ function rt({ data: n }) {
|
|
|
331
331
|
);
|
|
332
332
|
}
|
|
333
333
|
function Fr({ data: n }) {
|
|
334
|
-
const
|
|
335
|
-
return
|
|
336
|
-
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { className: "border-b border-slate-100", children:
|
|
337
|
-
/* @__PURE__ */ t("tbody", { children:
|
|
334
|
+
const a = n.rows ?? [], i = n.fields ?? [];
|
|
335
|
+
return a.length === 0 ? /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-400", children: "No items" }) : /* @__PURE__ */ t("div", { className: "overflow-x-auto", children: /* @__PURE__ */ x("table", { className: "w-full text-[12px]", children: [
|
|
336
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { className: "border-b border-slate-100", children: i.map((l) => /* @__PURE__ */ t("th", { className: "py-1 pr-3 text-left font-medium text-slate-500", children: l }, l)) }) }),
|
|
337
|
+
/* @__PURE__ */ t("tbody", { children: a.map((l, u) => /* @__PURE__ */ t("tr", { className: "border-b border-slate-50", children: i.map((g) => /* @__PURE__ */ t("td", { className: "py-1 pr-3 text-slate-700", children: String(l[g] ?? "") }, g)) }, u)) })
|
|
338
338
|
] }) });
|
|
339
339
|
}
|
|
340
340
|
function nt({
|
|
341
341
|
data: n,
|
|
342
|
-
widgetId:
|
|
343
|
-
inputs:
|
|
342
|
+
widgetId: a,
|
|
343
|
+
inputs: i,
|
|
344
344
|
apiBase: l,
|
|
345
345
|
onAction: u
|
|
346
346
|
}) {
|
|
347
347
|
const g = n.buttons ?? [], [v, b] = B(null), _ = Te(), R = async (C) => {
|
|
348
348
|
b(C);
|
|
349
349
|
try {
|
|
350
|
-
const S = typeof window < "u" ? localStorage.getItem("nivaro_workspace") ?? "" : "", E = (await (await fetch(`${l}/widgets-internal/${
|
|
350
|
+
const S = typeof window < "u" ? localStorage.getItem("nivaro_workspace") ?? "" : "", E = (await (await fetch(`${l}/widgets-internal/${a}/action`, {
|
|
351
351
|
method: "POST",
|
|
352
352
|
headers: {
|
|
353
353
|
"Content-Type": "application/json",
|
|
@@ -355,7 +355,7 @@ function nt({
|
|
|
355
355
|
...S ? { "x-workspace": S } : {}
|
|
356
356
|
},
|
|
357
357
|
credentials: _.credentials,
|
|
358
|
-
body: JSON.stringify({ button_index: C, inputs:
|
|
358
|
+
body: JSON.stringify({ button_index: C, inputs: i })
|
|
359
359
|
})).json()).data;
|
|
360
360
|
if (E != null && E.redirect_url)
|
|
361
361
|
try {
|
|
@@ -386,8 +386,8 @@ function nt({
|
|
|
386
386
|
const Kr = /* @__PURE__ */ new Set(["navigate", "field-update", "flow", "toggle"]);
|
|
387
387
|
function $e({
|
|
388
388
|
buttons: n,
|
|
389
|
-
layout:
|
|
390
|
-
widgetId:
|
|
389
|
+
layout: a,
|
|
390
|
+
widgetId: i,
|
|
391
391
|
inputs: l,
|
|
392
392
|
apiBase: u,
|
|
393
393
|
onClientAction: g
|
|
@@ -418,7 +418,7 @@ function $e({
|
|
|
418
418
|
const d = e.id ?? String(f);
|
|
419
419
|
R(d);
|
|
420
420
|
try {
|
|
421
|
-
const p = typeof window < "u" ? localStorage.getItem("nivaro_workspace") ?? "" : "", w = (await (await fetch(`${u}/widgets-internal/${
|
|
421
|
+
const p = typeof window < "u" ? localStorage.getItem("nivaro_workspace") ?? "" : "", w = (await (await fetch(`${u}/widgets-internal/${i}/action`, {
|
|
422
422
|
method: "POST",
|
|
423
423
|
headers: {
|
|
424
424
|
"Content-Type": "application/json",
|
|
@@ -504,7 +504,7 @@ function $e({
|
|
|
504
504
|
);
|
|
505
505
|
}
|
|
506
506
|
if (n.length === 0) return null;
|
|
507
|
-
if (
|
|
507
|
+
if (a === "split" && n.length > 1) {
|
|
508
508
|
const [e, ...f] = n, d = e.id ?? "0", p = _ === d, q = e.action === "none" || !e.action;
|
|
509
509
|
let P = e.label ?? "Button", w = e.variant ?? "default";
|
|
510
510
|
const k = e.action_config, M = e.toggle_input || (k == null ? void 0 : k.toggle_input) || (k == null ? void 0 : k.field) || "";
|
|
@@ -618,11 +618,11 @@ function $e({
|
|
|
618
618
|
}
|
|
619
619
|
return /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-1.5", children: n.map((e, f) => le(e, f)) });
|
|
620
620
|
}
|
|
621
|
-
function st(n,
|
|
621
|
+
function st(n, a) {
|
|
622
622
|
var l;
|
|
623
|
-
if (
|
|
624
|
-
const
|
|
625
|
-
return { next:
|
|
623
|
+
if (a == null) return { next: n, moved: !1 };
|
|
624
|
+
const i = ((l = a == null ? void 0 : a.instance) == null ? void 0 : l.current_state) ?? null;
|
|
625
|
+
return { next: i, moved: n !== void 0 && n !== i };
|
|
626
626
|
}
|
|
627
627
|
const Gr = 5e3, Jr = /* @__PURE__ */ new Set([
|
|
628
628
|
se.comments,
|
|
@@ -632,15 +632,15 @@ const Gr = 5e3, Jr = /* @__PURE__ */ new Set([
|
|
|
632
632
|
// A move refreshes widgets through the host's pipeline read (hostStepChange below).
|
|
633
633
|
se.state
|
|
634
634
|
]);
|
|
635
|
-
function Qr(n,
|
|
635
|
+
function Qr(n, a) {
|
|
636
636
|
return n.deleted ? !1 : n.changedFields === null ? !0 : n.changedFields.some(
|
|
637
|
-
(
|
|
637
|
+
(i) => i.startsWith("$") ? !Jr.has(i) : !a.has(i)
|
|
638
638
|
);
|
|
639
639
|
}
|
|
640
640
|
function _n({
|
|
641
641
|
widgetId: n,
|
|
642
|
-
inputBindings:
|
|
643
|
-
itemDraft:
|
|
642
|
+
inputBindings: a = [],
|
|
643
|
+
itemDraft: i = {},
|
|
644
644
|
itemCollection: l,
|
|
645
645
|
ready: u = !0,
|
|
646
646
|
label: g,
|
|
@@ -696,9 +696,9 @@ function _n({
|
|
|
696
696
|
c && clearTimeout(c), O();
|
|
697
697
|
};
|
|
698
698
|
}, [ae, r == null ? void 0 : r.widget_type]);
|
|
699
|
-
const ge =
|
|
700
|
-
je.current = new Set(Object.keys(
|
|
701
|
-
const at = !!r && (r.widget_type === "rollup" || r.widget_type === "review_list" || r.widget_type === "custom-query" ||
|
|
699
|
+
const ge = i.id, je = F(/* @__PURE__ */ new Set());
|
|
700
|
+
je.current = new Set(Object.keys(i));
|
|
701
|
+
const at = !!r && (r.widget_type === "rollup" || r.widget_type === "review_list" || r.widget_type === "custom-query" || a.length > 0), ye = F(!1), re = F(null), Oe = F(0), Ie = F(K);
|
|
702
702
|
Ie.current = K;
|
|
703
703
|
const we = Ne(() => {
|
|
704
704
|
if (!Ie.current) {
|
|
@@ -727,9 +727,9 @@ function _n({
|
|
|
727
727
|
[]
|
|
728
728
|
);
|
|
729
729
|
const De = {};
|
|
730
|
-
for (const [s, c] of Object.entries(
|
|
730
|
+
for (const [s, c] of Object.entries(i))
|
|
731
731
|
s.includes(".") || (c == null || typeof c != "object") && (De[s] = c);
|
|
732
|
-
const D = { ...De, ...Br(
|
|
732
|
+
const D = { ...De, ...Br(a, i) }, xe = Ir(), z = Je(() => {
|
|
733
733
|
if ((r == null ? void 0 : r.widget_type) !== "rollup" || !xe) return null;
|
|
734
734
|
const s = r.config, c = s == null ? void 0 : s.collection;
|
|
735
735
|
if (!c) return null;
|
|
@@ -780,10 +780,10 @@ function _n({
|
|
|
780
780
|
}));
|
|
781
781
|
};
|
|
782
782
|
if (D.record_id == null || D.record_id === "") {
|
|
783
|
-
const s =
|
|
783
|
+
const s = i.id;
|
|
784
784
|
s != null && s !== "" && (D.record_id = s);
|
|
785
785
|
}
|
|
786
|
-
Q.current =
|
|
786
|
+
Q.current = i.id ?? null;
|
|
787
787
|
const ct = JSON.stringify(D) + (l ?? "") + ot, ut = vr(ct, 400);
|
|
788
788
|
function We() {
|
|
789
789
|
const s = typeof window < "u" ? localStorage.getItem("nivaro_workspace") ?? "" : "";
|
|
@@ -825,8 +825,8 @@ function _n({
|
|
|
825
825
|
try {
|
|
826
826
|
const m = {
|
|
827
827
|
inputs: z ? { ...D, staged: z } : D,
|
|
828
|
-
draft:
|
|
829
|
-
bindings:
|
|
828
|
+
draft: i,
|
|
829
|
+
bindings: a,
|
|
830
830
|
item_collection: l
|
|
831
831
|
};
|
|
832
832
|
$.current && (m.refresh = !0, $.current = !1), L(m);
|
|
@@ -881,7 +881,7 @@ function _n({
|
|
|
881
881
|
const s = o == null ? void 0 : o.awaiting;
|
|
882
882
|
if (!Array.isArray(s) || s.length === 0) return null;
|
|
883
883
|
const c = s.map((m) => {
|
|
884
|
-
const O =
|
|
884
|
+
const O = a.find((h) => h.key === m && h.binding_type === "item_field");
|
|
885
885
|
return String((O == null ? void 0 : O.binding_value) ?? m).split(".")[0].replace(/_id$/, "").replace(/_/g, " ").replace(/^\w/, (h) => h.toUpperCase());
|
|
886
886
|
});
|
|
887
887
|
return [...new Set(c)].join(", ");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as v, useCallback as
|
|
3
|
-
import { PieChart as
|
|
4
|
-
import { cn as
|
|
1
|
+
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as v, useCallback as S } from "react";
|
|
3
|
+
import { PieChart as w, Pie as x, Cell as p, Tooltip as h, LineChart as K, CartesianGrid as u, XAxis as b, YAxis as s, Line as L, BarChart as N, Bar as R } from "recharts";
|
|
4
|
+
import { cn as $ } from "../../lib/utils.js";
|
|
5
5
|
const g = [
|
|
6
6
|
"#0ea5e9",
|
|
7
7
|
"#6366f1",
|
|
@@ -11,12 +11,16 @@ const g = [
|
|
|
11
11
|
"#8b5cf6",
|
|
12
12
|
"#14b8a6",
|
|
13
13
|
"#f97316"
|
|
14
|
-
];
|
|
15
|
-
function
|
|
16
|
-
const
|
|
14
|
+
], z = new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 });
|
|
15
|
+
function O({ spec: e, onPoint: n }) {
|
|
16
|
+
const i = n ? (t) => t != null && n(String(t), e) : void 0, [y, f] = v(0), k = S((t) => {
|
|
17
17
|
if (!t) return;
|
|
18
|
-
|
|
19
|
-
}, []), d = e.type === "pie" ? 220 : 200,
|
|
18
|
+
f(t.getBoundingClientRect().width), new ResizeObserver(() => f(t.getBoundingClientRect().width)).observe(t);
|
|
19
|
+
}, []), d = e.type === "pie" ? 220 : 200, c = Math.max(240, Math.min(720, y || 400)), o = (t) => {
|
|
20
|
+
if (!Number.isFinite(t)) return String(t);
|
|
21
|
+
const r = Math.abs(t), C = r >= 1e3 ? z.format(r).replace(/K$/, "k") : r.toLocaleString();
|
|
22
|
+
return `${t < 0 ? "-" : ""}${e.unit === "currency" ? "$" : ""}${C}`;
|
|
23
|
+
}, m = {
|
|
20
24
|
contentStyle: {
|
|
21
25
|
background: "#0f172a",
|
|
22
26
|
border: "1px solid #334155",
|
|
@@ -27,18 +31,18 @@ function F({ spec: e, onPoint: o }) {
|
|
|
27
31
|
itemStyle: { color: "#f8fafc" },
|
|
28
32
|
labelStyle: { color: "#cbd5e1" }
|
|
29
33
|
};
|
|
30
|
-
return /* @__PURE__ */
|
|
34
|
+
return /* @__PURE__ */ l(
|
|
31
35
|
"div",
|
|
32
36
|
{
|
|
33
37
|
ref: k,
|
|
34
38
|
"data-ai-chart": e.type,
|
|
35
|
-
"data-ai-chart-drill":
|
|
36
|
-
className:
|
|
39
|
+
"data-ai-chart-drill": n ? "" : void 0,
|
|
40
|
+
className: $("my-2 w-full", n && "[&_.recharts-wrapper]:cursor-pointer"),
|
|
37
41
|
children: [
|
|
38
42
|
e.title && /* @__PURE__ */ a("div", { className: "mb-1 text-[0.9em] font-medium text-muted-foreground", children: e.title }),
|
|
39
|
-
e.type === "pie" ? /* @__PURE__ */
|
|
43
|
+
e.type === "pie" ? /* @__PURE__ */ l(w, { width: c, height: d, children: [
|
|
40
44
|
/* @__PURE__ */ a(
|
|
41
|
-
|
|
45
|
+
x,
|
|
42
46
|
{
|
|
43
47
|
data: e.data,
|
|
44
48
|
dataKey: "value",
|
|
@@ -46,26 +50,26 @@ function F({ spec: e, onPoint: o }) {
|
|
|
46
50
|
cx: "50%",
|
|
47
51
|
cy: "50%",
|
|
48
52
|
outerRadius: 80,
|
|
49
|
-
label: ({ name: t, percent:
|
|
53
|
+
label: ({ name: t, percent: r }) => `${t} ${Math.round((r ?? 0) * 100)}%`,
|
|
50
54
|
labelLine: !1,
|
|
51
|
-
onClick:
|
|
52
|
-
children: e.data.map((t,
|
|
55
|
+
onClick: i ? (t) => i((t == null ? void 0 : t.label) ?? (t == null ? void 0 : t.name)) : void 0,
|
|
56
|
+
children: e.data.map((t, r) => /* @__PURE__ */ a(p, { fill: g[r % g.length] }, t.label))
|
|
53
57
|
}
|
|
54
58
|
),
|
|
55
|
-
/* @__PURE__ */ a(
|
|
56
|
-
] }) : e.type === "line" ? /* @__PURE__ */
|
|
57
|
-
|
|
59
|
+
/* @__PURE__ */ a(h, { ...m, formatter: (t) => o(Number(t)) })
|
|
60
|
+
] }) : e.type === "line" ? /* @__PURE__ */ l(
|
|
61
|
+
K,
|
|
58
62
|
{
|
|
59
|
-
width:
|
|
63
|
+
width: c,
|
|
60
64
|
height: d,
|
|
61
65
|
data: e.data,
|
|
62
66
|
margin: { left: 4, right: 12 },
|
|
63
|
-
onClick:
|
|
67
|
+
onClick: i ? (t) => i(t == null ? void 0 : t.activeLabel) : void 0,
|
|
64
68
|
children: [
|
|
65
69
|
/* @__PURE__ */ a(u, { strokeDasharray: "3 3", stroke: "currentColor", opacity: 0.12 }),
|
|
66
70
|
/* @__PURE__ */ a(b, { dataKey: "label", tick: { fontSize: 11 }, interval: "preserveStartEnd" }),
|
|
67
|
-
/* @__PURE__ */ a(s, { tick: { fontSize: 11 }, tickFormatter:
|
|
68
|
-
/* @__PURE__ */ a(
|
|
71
|
+
/* @__PURE__ */ a(s, { tick: { fontSize: 11 }, tickFormatter: o, width: 44 }),
|
|
72
|
+
/* @__PURE__ */ a(h, { ...m, formatter: (t) => o(Number(t)) }),
|
|
69
73
|
/* @__PURE__ */ a(
|
|
70
74
|
L,
|
|
71
75
|
{
|
|
@@ -78,14 +82,14 @@ function F({ spec: e, onPoint: o }) {
|
|
|
78
82
|
)
|
|
79
83
|
]
|
|
80
84
|
}
|
|
81
|
-
) : /* @__PURE__ */
|
|
82
|
-
|
|
85
|
+
) : /* @__PURE__ */ l(
|
|
86
|
+
N,
|
|
83
87
|
{
|
|
84
|
-
width:
|
|
88
|
+
width: c,
|
|
85
89
|
height: d,
|
|
86
90
|
data: e.data,
|
|
87
91
|
margin: { left: 4, right: 12 },
|
|
88
|
-
onClick:
|
|
92
|
+
onClick: i ? (t) => i(t == null ? void 0 : t.activeLabel) : void 0,
|
|
89
93
|
children: [
|
|
90
94
|
/* @__PURE__ */ a(u, { strokeDasharray: "3 3", stroke: "currentColor", opacity: 0.12 }),
|
|
91
95
|
/* @__PURE__ */ a(
|
|
@@ -99,9 +103,9 @@ function F({ spec: e, onPoint: o }) {
|
|
|
99
103
|
height: e.data.length > 8 ? 56 : 30
|
|
100
104
|
}
|
|
101
105
|
),
|
|
102
|
-
/* @__PURE__ */ a(s, { tick: { fontSize: 11 }, tickFormatter:
|
|
103
|
-
/* @__PURE__ */ a(
|
|
104
|
-
/* @__PURE__ */ a(
|
|
106
|
+
/* @__PURE__ */ a(s, { tick: { fontSize: 11 }, tickFormatter: o, width: 44 }),
|
|
107
|
+
/* @__PURE__ */ a(h, { ...m, formatter: (t) => o(Number(t)) }),
|
|
108
|
+
/* @__PURE__ */ a(R, { dataKey: "value", fill: "#0ea5e9", radius: [3, 3, 0, 0] })
|
|
105
109
|
]
|
|
106
110
|
}
|
|
107
111
|
)
|
|
@@ -110,5 +114,5 @@ function F({ spec: e, onPoint: o }) {
|
|
|
110
114
|
);
|
|
111
115
|
}
|
|
112
116
|
export {
|
|
113
|
-
|
|
117
|
+
O as AiChart
|
|
114
118
|
};
|