@ai-matrx/records-ui 0.3.1 → 0.4.3
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 +89 -0
- package/dist/index.cjs +28 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -12
- package/dist/index.d.ts +46 -12
- package/dist/index.js +28 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,94 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/records-ui
|
|
2
2
|
|
|
3
|
+
## 0.4.3
|
|
4
|
+
|
|
5
|
+
Resets the harness-owned demo table through the store's real read and delete
|
|
6
|
+
doors before a certification run. Repeated releases can no longer push the
|
|
7
|
+
three canonical Grid rows beyond the first page. The demo port is also
|
|
8
|
+
configurable for isolated local proof while remaining `3005` by default.
|
|
9
|
+
|
|
10
|
+
### Consumer action
|
|
11
|
+
|
|
12
|
+
None. The public package API is unchanged.
|
|
13
|
+
|
|
14
|
+
## 0.4.2
|
|
15
|
+
|
|
16
|
+
Uses the same bounded live-store wait as `@ai-matrx/records`, so a legitimate
|
|
17
|
+
overlapping rollback-only verification cannot make the demo proof fail after
|
|
18
|
+
twenty seconds.
|
|
19
|
+
|
|
20
|
+
### Consumer action
|
|
21
|
+
|
|
22
|
+
None beyond taking `latest`; the public API is unchanged.
|
|
23
|
+
|
|
24
|
+
## 0.4.1
|
|
25
|
+
|
|
26
|
+
Restores monotonic versioning after a concurrent release plan overwrote the
|
|
27
|
+
already-staged 0.4.0 version, and shares the serialized record-store release
|
|
28
|
+
lane with `@ai-matrx/records`.
|
|
29
|
+
|
|
30
|
+
### Consumer action
|
|
31
|
+
|
|
32
|
+
None beyond taking `latest`; the 0.4.0 API remains intact.
|
|
33
|
+
|
|
34
|
+
## 0.3.2
|
|
35
|
+
|
|
36
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
37
|
+
`git diff npm/records-ui/v0.3.1..npm/records-ui/v0.3.2 -- apps/shared/records-ui`).
|
|
38
|
+
No source changes intended and no consumer action required.
|
|
39
|
+
|
|
40
|
+
## 0.4.0
|
|
41
|
+
|
|
42
|
+
**`recordsDataSource` honours the schema the CALLER named, and the two page
|
|
43
|
+
assemblies get their first headless proof.**
|
|
44
|
+
|
|
45
|
+
0.3.1's adapter routes every `rpc` to one fixed schema (`custom` by default).
|
|
46
|
+
That is right for the store's own doors and wrong for the trust doors:
|
|
47
|
+
`@ai-matrx/records`' `trustDoor` says `iam` out loud — the external principal and
|
|
48
|
+
the publish binding live there — and a fixed-schema adapter sends them to
|
|
49
|
+
`custom`, where PostgREST answers PGRST202 naming a schema the caller never
|
|
50
|
+
asked for. The adapter now reads `options.schema` per call and falls back to the
|
|
51
|
+
second argument (still `custom`) only when a call says nothing, which no caller
|
|
52
|
+
in `@ai-matrx/records` does. The port already specified this: "A host binding
|
|
53
|
+
supabase-js routes this to `client.schema(options.schema).rpc(fn, args)`".
|
|
54
|
+
|
|
55
|
+
`TablesHome` and `TablePage` shipped in 0.3.1 with no assertion of their own.
|
|
56
|
+
Three now run against the live store in `demo/smoke.test.tsx`: the four lanes
|
|
57
|
+
drawn by name with a real table in one of them and `New table` offered; the
|
|
58
|
+
table page's records plus its five admin rails, with the settings rail really
|
|
59
|
+
opening the panel; and the same page giving a plain member the records and NONE
|
|
60
|
+
of the administering controls — absent, not disabled.
|
|
61
|
+
|
|
62
|
+
**THE WALK, and the three defects walking it found.** `demo/walk.test.tsx` runs
|
|
63
|
+
the whole product against the live store in one file — declare a table with three
|
|
64
|
+
field types, write a record through the generated form, open the table page and
|
|
65
|
+
peek the record, save a view, file an agent's field proposal and accept it,
|
|
66
|
+
export the CSV, then walk the same table as a plain member and be offered nothing
|
|
67
|
+
to administer. Seven cases, green, and the table it makes is soft-deleted after.
|
|
68
|
+
It found:
|
|
69
|
+
|
|
70
|
+
· **A table nobody had saved a view for showed NO RECORDS.** A view is a record,
|
|
71
|
+
so a brand-new table has none, and `TablePage` then rendered its own honest
|
|
72
|
+
"Waiting for this table's views" and nothing else — a dead end on the first
|
|
73
|
+
table anybody makes. The page now seeds `DEFAULT_VIEW_NAME` ("All records",
|
|
74
|
+
grid), an ordinary saved-view record a person can rename or delete, never a
|
|
75
|
+
hidden built-in mode. A host with its own idea passes `seedViews`.
|
|
76
|
+
|
|
77
|
+
· **`ProposedChange.table` was required for all three acts and unfillable for
|
|
78
|
+
two.** `update` and `remove` name a record and ignore `table`, so a proposer
|
|
79
|
+
wanting to change an existing record had to supply the id of the kernel Table
|
|
80
|
+
that record lives in — a fact the client has no door to ask for. It is optional
|
|
81
|
+
now, and an `add` without it is refused by name instead of writing nowhere.
|
|
82
|
+
|
|
83
|
+
· **The demo harness's pages were dead in a browser while `pnpm test` was
|
|
84
|
+
green.** Two copies of React in one vite graph (the demo's own dependency tree
|
|
85
|
+
plus the workspace's, through design-system and alchemy): React reported
|
|
86
|
+
"Invalid hook call … more than one copy of React" and the page rendered
|
|
87
|
+
nothing. `demo/vite.config.ts` now dedupes react and react-dom.
|
|
88
|
+
|
|
89
|
+
**Consumer action:** none. `recordsDataSource(client)` is unchanged at the call
|
|
90
|
+
site; a host that deliberately wants a different fallback passes it second.
|
|
91
|
+
|
|
3
92
|
## 0.3.1
|
|
4
93
|
|
|
5
94
|
Ships the canonical `TablesHome`, `TablePage`, `RecordsMount`, and table-creation helpers
|
package/dist/index.cjs
CHANGED
|
@@ -2190,6 +2190,12 @@ function ProposalRow({
|
|
|
2190
2190
|
const [confirming, setConfirming] = (0, import_react32.useState)(false);
|
|
2191
2191
|
async function applyThroughTheStore() {
|
|
2192
2192
|
if (change.act === "add") {
|
|
2193
|
+
if (!change.table) {
|
|
2194
|
+
return {
|
|
2195
|
+
settled: "refused",
|
|
2196
|
+
sentence: "This proposal asks to add a record but does not name the table it goes in, so nothing was written."
|
|
2197
|
+
};
|
|
2198
|
+
}
|
|
2193
2199
|
const written = await client.recordWrite({ table_id: change.table, data: change.data ?? {} });
|
|
2194
2200
|
return written.ok ? { settled: "accepted", sentence: "Written." } : { settled: "refused", sentence: written.error.message };
|
|
2195
2201
|
}
|
|
@@ -5677,11 +5683,16 @@ function RecordsMount({
|
|
|
5677
5683
|
function personActor(userId) {
|
|
5678
5684
|
return userId ? { actor: "user", user_id: userId } : { actor: "user" };
|
|
5679
5685
|
}
|
|
5680
|
-
function recordsDataSource(client,
|
|
5686
|
+
function recordsDataSource(client, fallbackSchema = "custom") {
|
|
5681
5687
|
const supabase = client;
|
|
5682
5688
|
return {
|
|
5683
|
-
rpc
|
|
5684
|
-
|
|
5689
|
+
rpc(fn, args, options) {
|
|
5690
|
+
const on = supabase.schema(options?.schema ?? fallbackSchema);
|
|
5691
|
+
return on.rpc(fn, args);
|
|
5692
|
+
},
|
|
5693
|
+
schema(name) {
|
|
5694
|
+
return supabase.schema(name);
|
|
5695
|
+
}
|
|
5685
5696
|
};
|
|
5686
5697
|
}
|
|
5687
5698
|
|
|
@@ -5890,7 +5901,11 @@ var import_react77 = require("react");
|
|
|
5890
5901
|
var import_react78 = require("@ai-matrx/records/react");
|
|
5891
5902
|
var import_design_system36 = require("@ai-matrx/design-system");
|
|
5892
5903
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5893
|
-
|
|
5904
|
+
var DEFAULT_VIEW_NAME = "All records";
|
|
5905
|
+
function defaultView(tableId) {
|
|
5906
|
+
return { name: DEFAULT_VIEW_NAME, subject: tableId, layout: "grid", isDefault: true };
|
|
5907
|
+
}
|
|
5908
|
+
function TablePage({ tableId, pageSize = 100, seedViews, className }) {
|
|
5894
5909
|
const table = (0, import_react78.useTable)(tableId);
|
|
5895
5910
|
const rights = useTableRights(table.data);
|
|
5896
5911
|
const [view, setView] = (0, import_react77.useState)(null);
|
|
@@ -5902,7 +5917,15 @@ function TablePage({ tableId, pageSize = 100, className }) {
|
|
|
5902
5917
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: (0, import_design_system36.cn)("flex min-h-0 gap-4", className), children: [
|
|
5903
5918
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
5904
5919
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
5905
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5920
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5921
|
+
ViewBar,
|
|
5922
|
+
{
|
|
5923
|
+
tableId,
|
|
5924
|
+
onActiveView: setView,
|
|
5925
|
+
seed: seedViews ?? [defaultView(tableId)],
|
|
5926
|
+
className: "min-w-0 flex-1"
|
|
5927
|
+
}
|
|
5928
|
+
),
|
|
5906
5929
|
rights.write ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system36.Button, { size: "sm", onClick: () => show("new-record"), children: "New record" }) : null,
|
|
5907
5930
|
rights.admin ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
5908
5931
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system36.Button, { size: "sm", variant: "outline", onClick: () => show("field"), children: "Add field" }),
|