@ai-matrx/detail 0.1.0 → 0.1.2
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/CHANGELOG.md +13 -0
- package/dist/react.cjs +37 -20
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +39 -22
- package/dist/react.js.map +1 -1
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/detail
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
+
`git diff npm/detail/v0.1.1..npm/detail/v0.1.2 -- apps/shared/detail`).
|
|
7
|
+
No source changes intended and no consumer action required.
|
|
8
|
+
|
|
9
|
+
## 0.1.1
|
|
10
|
+
|
|
11
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
12
|
+
`git diff npm/detail/v0.1.0..npm/detail/v0.1.1 -- apps/shared/detail`).
|
|
13
|
+
No source changes intended and no consumer action required.
|
|
14
|
+
|
|
3
15
|
## Unreleased
|
|
4
16
|
|
|
5
17
|
Not published: 0.1.0 is still not on npm, so matrx-frontend's `lib/detail/**` remains the LIVE
|
|
@@ -109,3 +121,4 @@ What changed on the way in, and why:
|
|
|
109
121
|
remedy names the item registry.
|
|
110
122
|
6. Any health producer that decides a reconnect would not help must answer
|
|
111
123
|
`onReconnect: null` (not omit the key) — omitting it now means "defer to the host".
|
|
124
|
+
|
package/dist/react.cjs
CHANGED
|
@@ -925,6 +925,7 @@ var import_react9 = require("react");
|
|
|
925
925
|
var import_design_system3 = require("@ai-matrx/design-system");
|
|
926
926
|
var import_associations = require("@ai-matrx/associations");
|
|
927
927
|
var import_react10 = require("@ai-matrx/associations/react");
|
|
928
|
+
var import_format = require("@ai-matrx/kit/format");
|
|
928
929
|
|
|
929
930
|
// src/format.ts
|
|
930
931
|
function formatWhen(iso) {
|
|
@@ -1013,20 +1014,26 @@ function DetailPresentationPane({ core }) {
|
|
|
1013
1014
|
}, [open, save, registerSave]);
|
|
1014
1015
|
if (!save) return null;
|
|
1015
1016
|
if (!open) {
|
|
1016
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
1017
|
-
"
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
"
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "w-full", children: [
|
|
1018
|
+
setting.error ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: "px-1 pt-1 text-[11px] text-muted-foreground", children: [
|
|
1019
|
+
`Your "open details as" setting could not be read (${setting.error}) \u2014 details are opening as ${WORD[core.presentation]}.`,
|
|
1020
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system2.ErrorActions, { origin: "detail/DetailPresentationPane", operation: "Read the open-details-as setting", error: setting.error })
|
|
1021
|
+
] }) : null,
|
|
1022
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
1023
|
+
"button",
|
|
1024
|
+
{
|
|
1025
|
+
type: "button",
|
|
1026
|
+
onClick: () => setOpen(true),
|
|
1027
|
+
className: "flex w-full items-center gap-1.5 rounded-md px-1 py-1 text-left text-[11px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1028
|
+
"data-detail-presentation-pane": "collapsed",
|
|
1029
|
+
children: [
|
|
1030
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Settings2Icon, { className: "h-3 w-3 shrink-0" }),
|
|
1031
|
+
setting.error ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: `Details open as ${WORD[effective]}.` }),
|
|
1032
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "underline underline-offset-2", children: "Change" })
|
|
1033
|
+
]
|
|
1034
|
+
}
|
|
1035
|
+
)
|
|
1036
|
+
] });
|
|
1030
1037
|
}
|
|
1031
1038
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
1032
1039
|
"section",
|
|
@@ -1108,11 +1115,15 @@ function DetailPresentationPane({ core }) {
|
|
|
1108
1115
|
}
|
|
1109
1116
|
)
|
|
1110
1117
|
] }),
|
|
1111
|
-
state.status === "refused" ? /* @__PURE__ */ (0, import_jsx_runtime4.
|
|
1118
|
+
state.status === "refused" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: "text-xs text-destructive", "data-detail-presentation-refusal": true, children: [
|
|
1119
|
+
state.reason,
|
|
1120
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system2.ErrorActions, { origin: "detail/DetailPresentationPane", operation: "Change how details open", message: state.reason })
|
|
1121
|
+
] }) : null,
|
|
1112
1122
|
setting.error ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
1113
1123
|
"The saved setting could not be read here (",
|
|
1114
1124
|
setting.error,
|
|
1115
|
-
"), so this shows what this detail is actually doing."
|
|
1125
|
+
"), so this shows what this detail is actually doing.",
|
|
1126
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system2.ErrorActions, { origin: "detail/DetailPresentationPane", operation: "Read the open-details-as setting", error: setting.error })
|
|
1116
1127
|
] }) : null
|
|
1117
1128
|
]
|
|
1118
1129
|
}
|
|
@@ -1275,7 +1286,10 @@ function FieldsSection({ core }) {
|
|
|
1275
1286
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Notice, { tone: "warn", children: `This ${label} couldn't be found \u2014 it may have been moved, deleted, or isn't shared with you.` });
|
|
1276
1287
|
}
|
|
1277
1288
|
if (core.status === "error") {
|
|
1278
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.
|
|
1289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Notice, { tone: "error", children: [
|
|
1290
|
+
`Couldn't load the details for this ${label}. ${core.errorMessage ?? ""}`.trim(),
|
|
1291
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system3.ErrorActions, { origin: "detail/DetailBody", operation: `Load this ${label}`, error: core.errorMessage })
|
|
1292
|
+
] });
|
|
1279
1293
|
}
|
|
1280
1294
|
if (core.status === "none") {
|
|
1281
1295
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Notice, { tone: "muted", children: `Nothing more about this ${label} is stored here, so there is nothing else to show. ` + whatTheControlsDo(core) });
|
|
@@ -1326,8 +1340,8 @@ function LoadingFields({ core, label }) {
|
|
|
1326
1340
|
label,
|
|
1327
1341
|
" \u2014 the read has been running for more than",
|
|
1328
1342
|
" ",
|
|
1329
|
-
|
|
1330
|
-
"
|
|
1343
|
+
(0, import_format.formatDurationMs)(SLOW_LOAD_NOTICE_MS, { style: "long" }),
|
|
1344
|
+
". If nothing appears, the record may be unreachable from here; closing and reopening it starts a fresh read."
|
|
1331
1345
|
] }) : null,
|
|
1332
1346
|
Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "space-y-1.5", children: [
|
|
1333
1347
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system3.Skeleton, { className: "h-2.5 w-20" }),
|
|
@@ -1390,7 +1404,10 @@ function HistorySection({ core }) {
|
|
|
1390
1404
|
state.status === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "space-y-1.5", "aria-busy": "true", "aria-label": "Loading history", children: [
|
|
1391
1405
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system3.Skeleton, { className: "h-3.5 w-2/3" }),
|
|
1392
1406
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system3.Skeleton, { className: "h-3.5 w-1/2" })
|
|
1393
|
-
] }) : state.status === "error" ? /* @__PURE__ */ (0, import_jsx_runtime5.
|
|
1407
|
+
] }) : state.status === "error" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
1408
|
+
state.message.toLowerCase().includes("access denied") ? "History is only shown to people who can view this record." : `History could not be read: ${state.message}`,
|
|
1409
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system3.ErrorActions, { origin: "detail/DetailBody", operation: "Read the history", error: state.message })
|
|
1410
|
+
] }) : state.entries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-xs text-muted-foreground", children: "No recorded changes yet." }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ol", { className: "space-y-1", children: state.entries.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1394
1411
|
"li",
|
|
1395
1412
|
{
|
|
1396
1413
|
className: "flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs",
|