@declarion/react 0.374.0 → 0.376.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/components/detail-layout/EvidenceBlock.js +19 -18
- package/dist-lib/components/fields/cells/factories/message.js +11 -0
- package/dist-lib/components/fields/cells/registry.js +8 -6
- package/dist-lib/index.d.ts +1 -1
- package/dist-lib/lib/message.js +17 -0
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/{useResponsiveMode-CBSHZBY5.d.ts → useResponsiveMode-DW7OD59J.d.ts} +5 -1
- package/package.json +1 -1
|
@@ -3,20 +3,21 @@ import { evidenceVerdictPill as t } from "../../lib/evidence-verdict.js";
|
|
|
3
3
|
import { useSchema as n } from "../../hooks/useSchema.js";
|
|
4
4
|
import { useText as r } from "../../hooks/useText.js";
|
|
5
5
|
import { formatOffsetTimestamp as i } from "../../lib/timestamp.js";
|
|
6
|
-
import {
|
|
6
|
+
import { messageText as a } from "../../lib/message.js";
|
|
7
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
8
|
// src/components/detail-layout/EvidenceBlock.tsx
|
|
8
|
-
function
|
|
9
|
+
function c(e, t) {
|
|
9
10
|
if (e && !Number.isNaN(new Date(e).getTime())) return i(e, { zone: t });
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
return i?.seq &&
|
|
12
|
+
function l({ evidence: i }) {
|
|
13
|
+
let l = r(), { data: u } = n(), d = t(l, u?.enums, i?.verdict ?? "unverified"), f = c(i?.verified_at, l.timeZone), p = a(l, i?.reason), m = [];
|
|
14
|
+
return i?.seq && m.push(l("record.evidence.chain", "chain #{seq}", { seq: i.seq })), i?.generation && m.push(l("record.evidence.generation", "generation {number}", { number: i.generation })), /* @__PURE__ */ s("div", {
|
|
14
15
|
style: {
|
|
15
16
|
display: "flex",
|
|
16
17
|
flexDirection: "column",
|
|
17
18
|
gap: 6
|
|
18
19
|
},
|
|
19
|
-
children: [/* @__PURE__ */
|
|
20
|
+
children: [/* @__PURE__ */ s("div", {
|
|
20
21
|
style: {
|
|
21
22
|
display: "flex",
|
|
22
23
|
alignItems: "center",
|
|
@@ -24,42 +25,42 @@ function c({ evidence: i }) {
|
|
|
24
25
|
flexWrap: "wrap"
|
|
25
26
|
},
|
|
26
27
|
children: [
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ o("span", {
|
|
28
29
|
style: {
|
|
29
30
|
fontSize: 12,
|
|
30
31
|
fontWeight: 600,
|
|
31
32
|
color: "var(--muted-foreground)"
|
|
32
33
|
},
|
|
33
|
-
children:
|
|
34
|
+
children: l("record.evidence.title", "Evidence")
|
|
34
35
|
}),
|
|
35
|
-
|
|
36
|
+
m.length > 0 && /* @__PURE__ */ o("span", {
|
|
36
37
|
style: {
|
|
37
38
|
fontSize: 12,
|
|
38
39
|
color: "var(--muted-foreground)"
|
|
39
40
|
},
|
|
40
|
-
children:
|
|
41
|
+
children: m.join(" · ")
|
|
41
42
|
}),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
tone:
|
|
43
|
+
/* @__PURE__ */ o(e, {
|
|
44
|
+
tone: d.tone,
|
|
44
45
|
size: "sm",
|
|
45
46
|
dot: !0,
|
|
46
|
-
children:
|
|
47
|
+
children: d.label
|
|
47
48
|
}),
|
|
48
|
-
|
|
49
|
+
f && /* @__PURE__ */ o("span", {
|
|
49
50
|
style: {
|
|
50
51
|
fontSize: 12,
|
|
51
52
|
color: "var(--muted-foreground)"
|
|
52
53
|
},
|
|
53
|
-
children:
|
|
54
|
+
children: l("record.evidence.verified", "Checked {when}", { when: f })
|
|
54
55
|
})
|
|
55
56
|
]
|
|
56
|
-
}),
|
|
57
|
+
}), p && /* @__PURE__ */ o("span", {
|
|
57
58
|
style: {
|
|
58
59
|
fontSize: 12,
|
|
59
60
|
color: "var(--destructive)"
|
|
60
61
|
},
|
|
61
|
-
children:
|
|
62
|
+
children: p
|
|
62
63
|
})]
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
|
-
export {
|
|
66
|
+
export { l as EvidenceBlock };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useText as e } from "../../../../hooks/useText.js";
|
|
2
|
+
import { messageText as t } from "../../../../lib/message.js";
|
|
3
|
+
import { EMPTY_CELL as n } from "./emptyCell.js";
|
|
4
|
+
import { Fragment as r, jsx as i } from "react/jsx-runtime";
|
|
5
|
+
// src/components/fields/cells/factories/message.tsx
|
|
6
|
+
function a({ value: n }) {
|
|
7
|
+
let a = e();
|
|
8
|
+
return /* @__PURE__ */ i(r, { children: t(a, n) });
|
|
9
|
+
}
|
|
10
|
+
var o = () => (e) => e == null || e === "" ? n : /* @__PURE__ */ i(a, { value: e });
|
|
11
|
+
export { o as messageFactory };
|
|
@@ -22,8 +22,9 @@ import { richTextPreviewFactory as S } from "./factories/richTextPreview.js";
|
|
|
22
22
|
import { multilangInlineFactory as C } from "./factories/multilangInline.js";
|
|
23
23
|
import { fileReferenceFactory as w } from "./factories/fileReference.js";
|
|
24
24
|
import { errorFactory as T } from "./factories/errorTitle.js";
|
|
25
|
+
import { messageFactory as E } from "./factories/message.js";
|
|
25
26
|
// src/components/fields/cells/registry.ts
|
|
26
|
-
var
|
|
27
|
+
var D = {
|
|
27
28
|
text: e,
|
|
28
29
|
bool_pill: t,
|
|
29
30
|
badge: n,
|
|
@@ -50,12 +51,13 @@ var E = {
|
|
|
50
51
|
password_mask: x,
|
|
51
52
|
rich_text_preview: S,
|
|
52
53
|
multilang_inline: C,
|
|
53
|
-
error: T
|
|
54
|
+
error: T,
|
|
55
|
+
message: E
|
|
54
56
|
};
|
|
55
|
-
Object.keys(
|
|
56
|
-
function
|
|
57
|
-
let t = e.field.display?.widget ?? "text", n =
|
|
57
|
+
Object.keys(D).sort();
|
|
58
|
+
function O(e) {
|
|
59
|
+
let t = e.field.display?.widget ?? "text", n = D[t];
|
|
58
60
|
if (!n) throw Error(`resolveCellRenderer: no factory registered for widget "${t}" (field "${e.fieldName}"). The engine must stamp a smart default at YAML-load time; an unknown widget here indicates an out-of-sync allow-list.`);
|
|
59
61
|
return n(e);
|
|
60
62
|
}
|
|
61
|
-
export {
|
|
63
|
+
export { O as resolveCellRenderer };
|
package/dist-lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as Action, $t as FileFieldValue, A as EnrichedRow, At as resolveDetailRoute, B as Refs, Bt as FilterURLState, C as ApiErrorBody, Ct as extractPkValues, D as CURSOR_SEMANTICS_MISMATCH, Dt as pkValuesFromId, E as CURSOR_LANGUAGE_CHANGED, Et as pkValuePartsToId, F as LoginResponse, Ft as pickLocalized, G as V2ListParams, Gt as hasOrGroups, H as StatusInfo, Ht as NO_VALUE_OPS, I as ParamLookup, It as pluralText, J as V2ParamInstance, Jt as setFiltersInURL, K as V2ListResponse, Kt as parseFilterURLState, L as PropertyValue, Lt as textWithNodes, M as ListMeta, Mt as TextFn, N as ListParams, Nt as TextVars, O as CheckSetupResponse, Ot as pkValuesToDetailId, P as ListResponse, Pt as makeTextFn, Q as isCursorStaleError, Qt as FileFieldMode, R as PublicParam, Rt as FilterNode, S as ApiError, St as buildRowDetailHref, T as BrandingIdentity, Tt as getPrimaryKeyFields, U as Tenant, Ut as OP_LABELS, V as SignupResponse, Vt as FilterValueResolver, W as TenantEnv, Wt as countActiveFilters, X as V2StatusInstance, Xt as FileFieldDef, Y as V2PropertyInstance, Yt as FileAddress, Z as errorCodeOf, Zt as FileFieldDisplay, _ as executeAction, _t as StatusDef, a as ResponsiveMode, at as EnumDef, b as AggregateParams, bt as buildDetailHrefFromId, c as resolveViewportCategory, ct as LocalizedString, d as ActionExecuteResponse, dt as PkValues, en as HydratedFile, et as AreaDef, f as ActionItemError, ft as PropertyDef, g as deleteObject, gt as SpecialValue, h as buildActionBody, ht as Screen, i as ResponsiveBreakpoints, it as EntityField, j as ImpersonationInfo, jt as MANDATORY_LANGUAGE, k as DataResponse, kt as pkValuesToId, l as ActionBatchError, lt as NavNode, m as GetEntityOptions, mt as Schema, n as useResponsiveMode, nn as UploadedFile, nt as ClassificationTierDef, o as ResponsiveViewport, ot as FieldAccessInfo, p as ActionItemSkip, pt as RefConfig, q as V2Meta, qt as parseFiltersFromURL, r as DEFAULT_RESPONSIVE_BREAKPOINTS, rn as OrderedMap, rt as Entity, s as ViewportCategory, st as LanguageDef, t as ResponsiveModeProvider, tn as UploadProgress, tt as ChildRelation, u as ActionExecuteRequest, ut as ParameterDef, v as restoreObject, vt as StatusGroupDef, w as AuthUser, wt as fieldDisplayName, x as AggregateResponse, xt as buildEntityDetailHref, y as AggregateGroup, yt as StructureDef, z as PublicParamsResponse, zt as FilterOp } from "./useResponsiveMode-
|
|
1
|
+
import { $ as Action, $t as FileFieldValue, A as EnrichedRow, At as resolveDetailRoute, B as Refs, Bt as FilterURLState, C as ApiErrorBody, Ct as extractPkValues, D as CURSOR_SEMANTICS_MISMATCH, Dt as pkValuesFromId, E as CURSOR_LANGUAGE_CHANGED, Et as pkValuePartsToId, F as LoginResponse, Ft as pickLocalized, G as V2ListParams, Gt as hasOrGroups, H as StatusInfo, Ht as NO_VALUE_OPS, I as ParamLookup, It as pluralText, J as V2ParamInstance, Jt as setFiltersInURL, K as V2ListResponse, Kt as parseFilterURLState, L as PropertyValue, Lt as textWithNodes, M as ListMeta, Mt as TextFn, N as ListParams, Nt as TextVars, O as CheckSetupResponse, Ot as pkValuesToDetailId, P as ListResponse, Pt as makeTextFn, Q as isCursorStaleError, Qt as FileFieldMode, R as PublicParam, Rt as FilterNode, S as ApiError, St as buildRowDetailHref, T as BrandingIdentity, Tt as getPrimaryKeyFields, U as Tenant, Ut as OP_LABELS, V as SignupResponse, Vt as FilterValueResolver, W as TenantEnv, Wt as countActiveFilters, X as V2StatusInstance, Xt as FileFieldDef, Y as V2PropertyInstance, Yt as FileAddress, Z as errorCodeOf, Zt as FileFieldDisplay, _ as executeAction, _t as StatusDef, a as ResponsiveMode, at as EnumDef, b as AggregateParams, bt as buildDetailHrefFromId, c as resolveViewportCategory, ct as LocalizedString, d as ActionExecuteResponse, dt as PkValues, en as HydratedFile, et as AreaDef, f as ActionItemError, ft as PropertyDef, g as deleteObject, gt as SpecialValue, h as buildActionBody, ht as Screen, i as ResponsiveBreakpoints, it as EntityField, j as ImpersonationInfo, jt as MANDATORY_LANGUAGE, k as DataResponse, kt as pkValuesToId, l as ActionBatchError, lt as NavNode, m as GetEntityOptions, mt as Schema, n as useResponsiveMode, nn as UploadedFile, nt as ClassificationTierDef, o as ResponsiveViewport, ot as FieldAccessInfo, p as ActionItemSkip, pt as RefConfig, q as V2Meta, qt as parseFiltersFromURL, r as DEFAULT_RESPONSIVE_BREAKPOINTS, rn as OrderedMap, rt as Entity, s as ViewportCategory, st as LanguageDef, t as ResponsiveModeProvider, tn as UploadProgress, tt as ChildRelation, u as ActionExecuteRequest, ut as ParameterDef, v as restoreObject, vt as StatusGroupDef, w as AuthUser, wt as fieldDisplayName, x as AggregateResponse, xt as buildEntityDetailHref, y as AggregateGroup, yt as StructureDef, z as PublicParamsResponse, zt as FilterOp } from "./useResponsiveMode-DW7OD59J.js";
|
|
2
2
|
import { i as setIconRegistry, n as getIcon, t as IconDef } from "./icon-registry-BY2tt-GF.js";
|
|
3
3
|
import { i as DynamicIcon, n as IconName, r as IconProps, t as Icon } from "./Icons-BdXCxyw3.js";
|
|
4
4
|
import { ButtonHTMLAttributes, CSSProperties, ComponentType, InputHTMLAttributes, MouseEvent, ReactNode, RefObject } from "react";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/lib/message.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return typeof e == "object" && !!e && typeof e.code == "string";
|
|
4
|
+
}
|
|
5
|
+
function t(t) {
|
|
6
|
+
let n = t;
|
|
7
|
+
if (typeof t == "string") try {
|
|
8
|
+
n = JSON.parse(t);
|
|
9
|
+
} catch {
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
12
|
+
return Array.isArray(n) ? n.filter(e) : e(n) ? [n] : [];
|
|
13
|
+
}
|
|
14
|
+
function n(e, n) {
|
|
15
|
+
return t(n).map((t) => e(t.code, t.code, t.values)).join(" ");
|
|
16
|
+
}
|
|
17
|
+
export { t as messageParts, n as messageText };
|
package/dist-lib/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as Refs, M as ListMeta, Mt as TextFn, P as ListResponse, ct as LocalizedString, d as ActionExecuteResponse, k as DataResponse, mt as Schema, o as ResponsiveViewport, u as ActionExecuteRequest } from "./useResponsiveMode-
|
|
1
|
+
import { B as Refs, M as ListMeta, Mt as TextFn, P as ListResponse, ct as LocalizedString, d as ActionExecuteResponse, k as DataResponse, mt as Schema, o as ResponsiveViewport, u as ActionExecuteRequest } from "./useResponsiveMode-DW7OD59J.js";
|
|
2
2
|
import { ReactElement, ReactNode } from "react";
|
|
3
3
|
import { QueryClient } from "@tanstack/react-query";
|
|
4
4
|
import { RenderResult } from "@testing-library/react";
|
|
@@ -1262,6 +1262,10 @@ interface ClassificationTierDef {
|
|
|
1262
1262
|
*/
|
|
1263
1263
|
sod_protected?: boolean;
|
|
1264
1264
|
}
|
|
1265
|
+
interface MessagePart {
|
|
1266
|
+
code: string;
|
|
1267
|
+
values?: Record<string, string>;
|
|
1268
|
+
}
|
|
1265
1269
|
interface ListMeta {
|
|
1266
1270
|
/**
|
|
1267
1271
|
* Total matching rows. Present only when the request asked for a count
|
|
@@ -1580,7 +1584,7 @@ interface V2PropertyInstance {
|
|
|
1580
1584
|
interface EvidenceVerdict {
|
|
1581
1585
|
verdict: string;
|
|
1582
1586
|
verified_at?: string;
|
|
1583
|
-
reason?:
|
|
1587
|
+
reason?: MessagePart[];
|
|
1584
1588
|
seq?: number;
|
|
1585
1589
|
generation?: number;
|
|
1586
1590
|
covered: boolean;
|