@ai-matrx/records-ui 0.66.0 → 0.67.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/index.d.cts CHANGED
@@ -2134,9 +2134,15 @@ interface PortalCardViewProps {
2134
2134
  onPreview: (person: PortalPrincipal, tableId: Uuid) => Promise<PortalAnswer<PortalPreviewRow[]>>;
2135
2135
  /** The invite control, which needs a client of its own. Absent means none is offered. */
2136
2136
  invite?: ReactNode;
2137
+ /**
2138
+ * Where this app is served from, so a person's own invitation link can be copied whole.
2139
+ * Omit it and the view falls back to the browser's origin, which keeps this component
2140
+ * mountable BARE against a recorded answer with no host and no network.
2141
+ */
2142
+ origin?: string | undefined;
2137
2143
  className?: string | undefined;
2138
2144
  }
2139
- declare function PortalCardView({ card, tableId, onRevoke, onPreview, invite, className, }: PortalCardViewProps): react.JSX.Element;
2145
+ declare function PortalCardView({ card, tableId, onRevoke, onPreview, invite, origin, className, }: PortalCardViewProps): react.JSX.Element;
2140
2146
 
2141
2147
  interface DigestSchedulerProps {
2142
2148
  /** The Table the digest is about. A saved view is a view OF something. */
package/dist/index.d.ts CHANGED
@@ -2134,9 +2134,15 @@ interface PortalCardViewProps {
2134
2134
  onPreview: (person: PortalPrincipal, tableId: Uuid) => Promise<PortalAnswer<PortalPreviewRow[]>>;
2135
2135
  /** The invite control, which needs a client of its own. Absent means none is offered. */
2136
2136
  invite?: ReactNode;
2137
+ /**
2138
+ * Where this app is served from, so a person's own invitation link can be copied whole.
2139
+ * Omit it and the view falls back to the browser's origin, which keeps this component
2140
+ * mountable BARE against a recorded answer with no host and no network.
2141
+ */
2142
+ origin?: string | undefined;
2137
2143
  className?: string | undefined;
2138
2144
  }
2139
- declare function PortalCardView({ card, tableId, onRevoke, onPreview, invite, className, }: PortalCardViewProps): react.JSX.Element;
2145
+ declare function PortalCardView({ card, tableId, onRevoke, onPreview, invite, origin, className, }: PortalCardViewProps): react.JSX.Element;
2140
2146
 
2141
2147
  interface DigestSchedulerProps {
2142
2148
  /** The Table the digest is about. A saved view is a view OF something. */
package/dist/index.js CHANGED
@@ -608,6 +608,9 @@ function isRelationFieldType(id) {
608
608
  function parityTypesWithNoExplanation() {
609
609
  return PARITY_FIELD_TYPES.map((row) => row.parity_type).filter((type) => !BY_ID.has(type));
610
610
  }
611
+ var ADD_FIELD_OPEN_LABEL = "Add field";
612
+ var ADD_FIELD_SAVE_LABEL = "Create field";
613
+ var EDIT_FIELD_SAVE_LABEL = "Save field";
611
614
 
612
615
  // src/parity.ts
613
616
  var kernelId = (name) => KERNEL_TABLES.find((t) => t.name === name)?.id ?? "";
@@ -4818,7 +4821,7 @@ function FieldEditor({ tableId, field, onSaved, onCancel, onRemoved, className }
4818
4821
  size: "sm",
4819
4822
  disabled: mutation.saving || missing !== null,
4820
4823
  onClick: () => void save(),
4821
- children: mutation.saving ? "Saving\u2026" : field ? "Save field" : "Add field"
4824
+ children: mutation.saving ? "Saving\u2026" : field ? EDIT_FIELD_SAVE_LABEL : ADD_FIELD_SAVE_LABEL
4822
4825
  }
4823
4826
  ),
4824
4827
  onCancel ? /* @__PURE__ */ jsx17(Button12, { size: "sm", variant: "ghost", onClick: onCancel, children: "Cancel" }) : null,
@@ -9797,6 +9800,7 @@ function PortalsPanel({ tableId, className }) {
9797
9800
  {
9798
9801
  portalId: portal.portal_id,
9799
9802
  ...tableId ? { tableId } : {},
9803
+ origin,
9800
9804
  onChanged: () => void load()
9801
9805
  }
9802
9806
  ) : null
@@ -9804,7 +9808,7 @@ function PortalsPanel({ tableId, className }) {
9804
9808
  }) })
9805
9809
  ] });
9806
9810
  }
9807
- function CopyLink({ url }) {
9811
+ function CopyLink({ url, what }) {
9808
9812
  const [copied, setCopied] = useState33(false);
9809
9813
  const [shown, setShown] = useState33(false);
9810
9814
  return /* @__PURE__ */ jsxs32(Fragment16, { children: [
@@ -9825,7 +9829,7 @@ function CopyLink({ url }) {
9825
9829
  }
9826
9830
  })();
9827
9831
  },
9828
- children: copied ? "Copied" : "Copy link"
9832
+ children: copied ? "Copied" : what ? `Copy ${what}` : "Copy link"
9829
9833
  }
9830
9834
  ),
9831
9835
  shown ? /* @__PURE__ */ jsxs32("p", { className: "mt-1.5 w-full break-all rounded border border-dashed border-border px-2 py-1 text-xs", children: [
@@ -9837,6 +9841,7 @@ function CopyLink({ url }) {
9837
9841
  function PortalDetail({
9838
9842
  portalId,
9839
9843
  tableId,
9844
+ origin,
9840
9845
  onChanged
9841
9846
  }) {
9842
9847
  const client = useRecordsClient25();
@@ -9886,6 +9891,7 @@ function PortalDetail({
9886
9891
  PortalCardView,
9887
9892
  {
9888
9893
  card,
9894
+ origin,
9889
9895
  ...tableId ? { tableId } : {},
9890
9896
  onRevoke: revoke,
9891
9897
  onPreview: preview,
@@ -9908,6 +9914,7 @@ function PortalCardView({
9908
9914
  onRevoke,
9909
9915
  onPreview,
9910
9916
  invite,
9917
+ origin,
9911
9918
  className
9912
9919
  }) {
9913
9920
  return /* @__PURE__ */ jsxs32("div", { className: cn30("mt-2.5 flex flex-col gap-2.5 border-t border-border pt-2.5", className), children: [
@@ -9938,7 +9945,7 @@ function PortalCardView({
9938
9945
  ] }, exposed.table_id))
9939
9946
  ] }),
9940
9947
  /* @__PURE__ */ jsx36(Separator10, {}),
9941
- /* @__PURE__ */ jsx36(People, { card, onRevoke, onPreview }),
9948
+ /* @__PURE__ */ jsx36(People, { card, onRevoke, onPreview, origin }),
9942
9949
  invite ? /* @__PURE__ */ jsxs32(Fragment16, { children: [
9943
9950
  /* @__PURE__ */ jsx36(Separator10, {}),
9944
9951
  invite
@@ -9948,8 +9955,10 @@ function PortalCardView({
9948
9955
  function People({
9949
9956
  card,
9950
9957
  onRevoke,
9951
- onPreview
9958
+ onPreview,
9959
+ origin
9952
9960
  }) {
9961
+ const here = origin ?? (typeof window === "undefined" ? "" : window.location.origin);
9953
9962
  const [askingToRevoke, setAskingToRevoke] = useState33(null);
9954
9963
  const [busy, setBusy] = useState33(false);
9955
9964
  const [said, setSaid] = useState33(null);
@@ -9991,6 +10000,7 @@ function People({
9991
10000
  /* @__PURE__ */ jsx36("p", { className: "mt-0.5 break-all text-muted-foreground", children: person.email }),
9992
10001
  /* @__PURE__ */ jsx36("p", { className: "mt-0.5 text-muted-foreground", children: state.why }),
9993
10002
  person.is_active ? /* @__PURE__ */ jsxs32("div", { className: "mt-1.5 flex flex-wrap gap-1.5", children: [
10003
+ person.accept_path ? /* @__PURE__ */ jsx36(CopyLink, { url: `${here}${person.accept_path}`, what: "their link" }) : null,
9994
10004
  /* @__PURE__ */ jsx36(
9995
10005
  Button30,
9996
10006
  {
@@ -10002,6 +10012,11 @@ function People({
10002
10012
  ),
10003
10013
  /* @__PURE__ */ jsx36(Button30, { size: "sm", variant: "ghost", onClick: () => setAskingToRevoke(person), children: "Remove their access" })
10004
10014
  ] }) : null,
10015
+ person.is_active && !person.signed_in && !person.accept_path ? /* @__PURE__ */ jsxs32("p", { className: "mt-1.5 text-muted-foreground", children: [
10016
+ "There is no link to copy for ",
10017
+ person.client || person.email,
10018
+ ": they were asked some other way, or the link they were sent has expired. Invite them again and a fresh one is made."
10019
+ ] }) : null,
10005
10020
  asking ? /* @__PURE__ */ jsxs32("div", { className: "mt-1.5 flex flex-col gap-1.5 rounded border border-destructive/40 px-2 py-1.5", children: [
10006
10021
  /* @__PURE__ */ jsx36("span", { className: "text-destructive", children: revokeConsequence(person, card.title) }),
10007
10022
  /* @__PURE__ */ jsxs32("div", { className: "flex flex-wrap gap-1.5", children: [
@@ -14857,7 +14872,7 @@ function TablePage({
14857
14872
  variant: surfaceChosen(surface, { rail: "field" }) ? "secondary" : "outline",
14858
14873
  "aria-pressed": surfaceChosen(surface, { rail: "field" }),
14859
14874
  onClick: () => press({ rail: "field" }),
14860
- children: "Add field"
14875
+ children: ADD_FIELD_OPEN_LABEL
14861
14876
  }
14862
14877
  ),
14863
14878
  /* @__PURE__ */ jsx58(