@ai-matrx/records-ui 0.85.7 → 0.85.8

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/index.js CHANGED
@@ -21137,12 +21137,15 @@ function WhereItLives({ tableId, knownOrganizationName, onMoved, variant = "head
21137
21137
  expected_version: home.table.version
21138
21138
  });
21139
21139
  setMoving(false);
21140
- setChoosing(null);
21141
21140
  if (!moved.ok) {
21142
- setSaid({ tone: "refused", text: `Nothing moved. ${moved.error.message}` });
21143
- setAttempt((n) => n + 1);
21141
+ const hint = moved.error.hint?.trim();
21142
+ setSaid({
21143
+ tone: "refused",
21144
+ text: `Nothing moved. ${moved.error.message}${hint && !moved.error.message.includes(hint) ? ` ${hint}` : ""}`
21145
+ });
21144
21146
  return;
21145
21147
  }
21148
+ setChoosing(null);
21146
21149
  setSaid({ tone: "done", text: `${moved.data.tableName} now lives in ${moved.data.to.name}.` });
21147
21150
  setAttempt((n) => n + 1);
21148
21151
  onMoved?.(moved.data.to);
@@ -21178,65 +21181,90 @@ function WhereItLives({ tableId, knownOrganizationName, onMoved, variant = "head
21178
21181
  ]
21179
21182
  }
21180
21183
  ) }),
21181
- /* @__PURE__ */ jsx73(PopoverContent3, { align: "start", className: "w-80 p-3 text-xs", onClick: (e) => e.stopPropagation(), children: answer === null ? /* @__PURE__ */ jsx73("p", { className: "text-muted-foreground", children: "Asking the record store where this table lives\u2026" }) : answer.state === "not-given" ? /* @__PURE__ */ jsx73("p", { className: "text-muted-foreground", children: "This table has not been shared with you, so where it lives is not yours to see." }) : answer.state === "door-absent" || answer.state === "unavailable" ? /* @__PURE__ */ jsxs67("div", { className: "space-y-2", children: [
21182
- knownOrganizationName ? /* @__PURE__ */ jsxs67("p", { children: [
21183
- "Lives in ",
21184
- /* @__PURE__ */ jsx73("span", { className: "font-medium text-foreground", children: knownOrganizationName }),
21185
- "."
21186
- ] }) : null,
21187
- /* @__PURE__ */ jsx73("p", { className: "text-muted-foreground", children: answer.state === "door-absent" ? "Moving it to another organization is not available on this database yet." : `The record store could not be asked where this lives, so nothing here is an answer about your access. ${answer.why}` }),
21188
- answer.state === "unavailable" ? /* @__PURE__ */ jsx73(Button60, { size: "sm", variant: "outline", className: "h-7 text-xs", onClick: () => setAttempt((n) => n + 1), children: "Ask again" }) : null
21189
- ] }) : /* @__PURE__ */ jsxs67("div", { className: "space-y-2", "data-where-it-lives-panel": answer.home.table.id, children: [
21190
- /* @__PURE__ */ jsxs67("p", { children: [
21191
- /* @__PURE__ */ jsxs67("span", { className: "text-muted-foreground", children: [
21192
- answer.home.table.name,
21193
- " lives in "
21194
- ] }),
21195
- /* @__PURE__ */ jsx73("span", { className: "font-medium text-foreground", children: answer.home.organization.name }),
21196
- "."
21197
- ] }),
21198
- said ? /* @__PURE__ */ jsx73("p", { "data-where-it-lives-said": said.tone, className: said.tone === "refused" ? "text-destructive" : "text-foreground", children: said.text }) : null,
21199
- choosing ? (
21200
- // THE CONSEQUENCE, SAID BEFORE THE MOVE, in the same panel — no second dialog.
21201
- /* @__PURE__ */ jsxs67("div", { className: "space-y-2", "data-where-it-lives-confirm": choosing.id, children: [
21202
- /* @__PURE__ */ jsxs67("p", { className: "font-medium text-foreground", children: [
21203
- "Move ",
21204
- answer.home.table.name,
21205
- " to ",
21206
- choosing.name,
21207
- "?"
21184
+ /* @__PURE__ */ jsx73(
21185
+ PopoverContent3,
21186
+ {
21187
+ align: "start",
21188
+ className: "w-80 p-3 text-xs",
21189
+ onClick: (e) => e.stopPropagation(),
21190
+ onFocusOutside: (e) => e.preventDefault(),
21191
+ children: answer === null ? /* @__PURE__ */ jsx73("p", { className: "text-muted-foreground", children: "Asking the record store where this table lives\u2026" }) : answer.state === "not-given" ? /* @__PURE__ */ jsx73("p", { className: "text-muted-foreground", children: "This table has not been shared with you, so where it lives is not yours to see." }) : answer.state === "door-absent" || answer.state === "unavailable" ? /* @__PURE__ */ jsxs67("div", { className: "space-y-2", children: [
21192
+ knownOrganizationName ? /* @__PURE__ */ jsxs67("p", { children: [
21193
+ "Lives in ",
21194
+ /* @__PURE__ */ jsx73("span", { className: "font-medium text-foreground", children: knownOrganizationName }),
21195
+ "."
21196
+ ] }) : null,
21197
+ /* @__PURE__ */ jsx73("p", { className: "text-muted-foreground", children: answer.state === "door-absent" ? "Moving it to another organization is not available on this database yet." : `The record store could not be asked where this lives, so nothing here is an answer about your access. ${answer.why}` }),
21198
+ answer.state === "unavailable" ? /* @__PURE__ */ jsx73(Button60, { size: "sm", variant: "outline", className: "h-7 text-xs", onClick: () => setAttempt((n) => n + 1), children: "Ask again" }) : null
21199
+ ] }) : /* @__PURE__ */ jsxs67("div", { className: "space-y-2", "data-where-it-lives-panel": answer.home.table.id, children: [
21200
+ /* @__PURE__ */ jsxs67("p", { children: [
21201
+ /* @__PURE__ */ jsxs67("span", { className: "text-muted-foreground", children: [
21202
+ answer.home.table.name,
21203
+ " lives in "
21204
+ ] }),
21205
+ /* @__PURE__ */ jsx73("span", { className: "font-medium text-foreground", children: answer.home.organization.name }),
21206
+ "."
21208
21207
  ] }),
21209
- /* @__PURE__ */ jsx73("p", { className: "text-muted-foreground", children: moveConsequence(answer.home, choosing) }),
21210
- /* @__PURE__ */ jsxs67("div", { className: "flex gap-2", children: [
21211
- /* @__PURE__ */ jsx73(Button60, { size: "sm", className: "h-7 text-xs", disabled: moving, onClick: () => void move(choosing), children: moving ? `Moving to ${choosing.name}\u2026` : "Move it" }),
21212
- /* @__PURE__ */ jsx73(Button60, { size: "sm", variant: "ghost", className: "h-7 text-xs", disabled: moving, onClick: () => setChoosing(null), children: "Cancel" })
21208
+ said && !(said.tone === "refused" && choosing) ? /* @__PURE__ */ jsx73("p", { "data-where-it-lives-said": said.tone, className: said.tone === "refused" ? "text-destructive" : "text-foreground", children: said.text }) : null,
21209
+ choosing ? (
21210
+ // THE CONSEQUENCE, SAID BEFORE THE MOVE, in the same panel — no second dialog.
21211
+ /* @__PURE__ */ jsxs67("div", { className: "space-y-2", "data-where-it-lives-confirm": choosing.id, children: [
21212
+ /* @__PURE__ */ jsxs67("p", { className: "font-medium text-foreground", children: [
21213
+ "Move ",
21214
+ answer.home.table.name,
21215
+ " to ",
21216
+ choosing.name,
21217
+ "?"
21218
+ ] }),
21219
+ /* @__PURE__ */ jsx73("p", { className: "text-muted-foreground", children: moveConsequence(answer.home, choosing) }),
21220
+ said?.tone === "refused" ? /* @__PURE__ */ jsx73("p", { "data-where-it-lives-said": "refused", role: "alert", className: "text-destructive", children: said.text }) : null,
21221
+ /* @__PURE__ */ jsxs67("div", { className: "flex gap-2", children: [
21222
+ /* @__PURE__ */ jsx73(Button60, { size: "sm", className: "h-7 text-xs", disabled: moving, onClick: () => void move(choosing), children: moving ? `Moving to ${choosing.name}\u2026` : said?.tone === "refused" ? "Try again" : "Move it" }),
21223
+ /* @__PURE__ */ jsx73(
21224
+ Button60,
21225
+ {
21226
+ size: "sm",
21227
+ variant: "ghost",
21228
+ className: "h-7 text-xs",
21229
+ disabled: moving,
21230
+ onClick: () => {
21231
+ const wasRefused = said?.tone === "refused";
21232
+ setChoosing(null);
21233
+ setSaid(null);
21234
+ if (wasRefused) setAttempt((n) => n + 1);
21235
+ },
21236
+ children: "Cancel"
21237
+ }
21238
+ )
21239
+ ] })
21240
+ ] })
21241
+ ) : !answer.home.mayMove ? /* @__PURE__ */ jsx73("p", { className: "text-muted-foreground", children: answer.home.whyNot }) : answer.home.heldBy.length > 0 ? /* @__PURE__ */ jsxs67("div", { className: "space-y-1", children: [
21242
+ /* @__PURE__ */ jsx73("p", { className: "font-medium text-foreground", children: "It cannot move yet:" }),
21243
+ /* @__PURE__ */ jsx73("ul", { className: "list-disc space-y-1 pl-4 text-muted-foreground", children: answer.home.heldBy.map((line) => /* @__PURE__ */ jsx73("li", { children: line }, line)) })
21244
+ ] }) : answer.home.destinations.length === 0 ? /* @__PURE__ */ jsx73("p", { className: "text-muted-foreground", children: "You are not a member of any other organization, so there is nowhere else to move it." }) : /* @__PURE__ */ jsxs67("div", { className: "space-y-1", children: [
21245
+ /* @__PURE__ */ jsx73("p", { className: "font-medium text-foreground", children: "Move it to" }),
21246
+ /* @__PURE__ */ jsx73("ul", { className: "max-h-64 space-y-1 overflow-y-auto pr-1", children: answer.home.destinations.map((to) => /* @__PURE__ */ jsx73("li", { children: to.ok ? /* @__PURE__ */ jsx73(
21247
+ Button60,
21248
+ {
21249
+ size: "sm",
21250
+ variant: "outline",
21251
+ className: "h-7 w-full justify-start text-xs",
21252
+ "data-where-it-lives-move": to.id,
21253
+ onClick: () => {
21254
+ setSaid(null);
21255
+ setChoosing(to);
21256
+ },
21257
+ children: to.name
21258
+ }
21259
+ ) : /* @__PURE__ */ jsxs67("p", { className: "text-muted-foreground", children: [
21260
+ /* @__PURE__ */ jsx73("span", { className: "text-foreground", children: to.name }),
21261
+ " \u2014 ",
21262
+ to.why
21263
+ ] }) }, to.id)) })
21213
21264
  ] })
21214
21265
  ] })
21215
- ) : !answer.home.mayMove ? /* @__PURE__ */ jsx73("p", { className: "text-muted-foreground", children: answer.home.whyNot }) : answer.home.heldBy.length > 0 ? /* @__PURE__ */ jsxs67("div", { className: "space-y-1", children: [
21216
- /* @__PURE__ */ jsx73("p", { className: "font-medium text-foreground", children: "It cannot move yet:" }),
21217
- /* @__PURE__ */ jsx73("ul", { className: "list-disc space-y-1 pl-4 text-muted-foreground", children: answer.home.heldBy.map((line) => /* @__PURE__ */ jsx73("li", { children: line }, line)) })
21218
- ] }) : answer.home.destinations.length === 0 ? /* @__PURE__ */ jsx73("p", { className: "text-muted-foreground", children: "You are not a member of any other organization, so there is nowhere else to move it." }) : /* @__PURE__ */ jsxs67("div", { className: "space-y-1", children: [
21219
- /* @__PURE__ */ jsx73("p", { className: "font-medium text-foreground", children: "Move it to" }),
21220
- /* @__PURE__ */ jsx73("ul", { className: "max-h-64 space-y-1 overflow-y-auto pr-1", children: answer.home.destinations.map((to) => /* @__PURE__ */ jsx73("li", { children: to.ok ? /* @__PURE__ */ jsx73(
21221
- Button60,
21222
- {
21223
- size: "sm",
21224
- variant: "outline",
21225
- className: "h-7 w-full justify-start text-xs",
21226
- "data-where-it-lives-move": to.id,
21227
- onClick: () => {
21228
- setSaid(null);
21229
- setChoosing(to);
21230
- },
21231
- children: to.name
21232
- }
21233
- ) : /* @__PURE__ */ jsxs67("p", { className: "text-muted-foreground", children: [
21234
- /* @__PURE__ */ jsx73("span", { className: "text-foreground", children: to.name }),
21235
- " \u2014 ",
21236
- to.why
21237
- ] }) }, to.id)) })
21238
- ] })
21239
- ] }) })
21266
+ }
21267
+ )
21240
21268
  ]
21241
21269
  }
21242
21270
  );