@ai-matrx/records-ui 0.116.65 → 0.116.67
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 +11 -1
- package/dist/{chunk-GLSY7IZC.js → chunk-57CGHFPO.js} +12 -2
- package/dist/{chunk-GLSY7IZC.js.map → chunk-57CGHFPO.js.map} +1 -1
- package/dist/data-source.cjs +11 -1
- package/dist/data-source.cjs.map +1 -1
- package/dist/data-source.js +11 -1
- package/dist/data-source.js.map +1 -1
- package/dist/helpers.cjs +11 -1
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.js +11 -1
- package/dist/helpers.js.map +1 -1
- package/dist/index.cjs +17 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -24372,7 +24372,8 @@ function makeRecordsDataSource(client, fallbackSchema) {
|
|
|
24372
24372
|
opensInOneCall: true,
|
|
24373
24373
|
async rpc(fn, args, options) {
|
|
24374
24374
|
const schema = options?.schema ?? fallbackSchema;
|
|
24375
|
-
|
|
24375
|
+
const getSession = schema === "custom" ? sessionReader(supabase) : void 0;
|
|
24376
|
+
if (getSession && !await hasSession(getSession)) {
|
|
24376
24377
|
return { data: null, error: SIGNED_OUT };
|
|
24377
24378
|
}
|
|
24378
24379
|
const on = supabase.schema(schema);
|
|
@@ -24383,6 +24384,15 @@ function makeRecordsDataSource(client, fallbackSchema) {
|
|
|
24383
24384
|
}
|
|
24384
24385
|
};
|
|
24385
24386
|
}
|
|
24387
|
+
function sessionReader(supabase) {
|
|
24388
|
+
try {
|
|
24389
|
+
const auth = supabase.auth;
|
|
24390
|
+
const getSession = auth?.getSession;
|
|
24391
|
+
return typeof getSession === "function" ? () => getSession.call(auth) : void 0;
|
|
24392
|
+
} catch {
|
|
24393
|
+
return void 0;
|
|
24394
|
+
}
|
|
24395
|
+
}
|
|
24386
24396
|
var SIGNED_OUT = {
|
|
24387
24397
|
code: "42501",
|
|
24388
24398
|
message: "Nobody is signed in, so there is nothing to read.",
|
|
@@ -64270,7 +64280,7 @@ function EntitySectionBody(props) {
|
|
|
64270
64280
|
"Add"
|
|
64271
64281
|
] }) : null
|
|
64272
64282
|
] }),
|
|
64273
|
-
entity.error ? /* @__PURE__ */ (0, import_jsx_runtime208.jsx)("p", { className: "px-5 pb-5 text-sm text-muted-foreground sm:px-6", children: entity.error }) : entity.loading && entity.rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime208.jsx)("div", { className: "flex flex-col gap-1.5 px-5 pb-5 sm:px-6", "aria-busy": "true", children: [0, 1, 2].map((i) => /* @__PURE__ */ (0, import_jsx_runtime208.jsx)("div", { className: "h-9 rounded-md bg-muted" }, i)) }) : entity.rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
64283
|
+
entity.error ? /* @__PURE__ */ (0, import_jsx_runtime208.jsx)("p", { className: "px-5 pb-5 text-sm text-muted-foreground sm:px-6", children: entity.error }) : entity.loading && entity.rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime208.jsx)("div", { className: "flex flex-col gap-1.5 px-5 pb-5 sm:px-6", "aria-busy": "true", children: [0, 1, 2].map((i) => /* @__PURE__ */ (0, import_jsx_runtime208.jsx)("div", { className: "h-9 rounded-md bg-muted" }, i)) }) : entity.rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(SectionEmpty, { empty: props.empty }) : /* @__PURE__ */ (0, import_jsx_runtime208.jsx)("div", { className: "-mb-px overflow-x-auto", children: groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)("div", { "data-records-section-group": group.key, children: [
|
|
64274
64284
|
cols.group ? /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)("div", { className: "flex items-center justify-between border-y border-border px-5 py-1 sm:px-6", children: [
|
|
64275
64285
|
/* @__PURE__ */ (0, import_jsx_runtime208.jsx)("span", { className: "text-xs font-semibold text-foreground", children: group.key || "No group" }),
|
|
64276
64286
|
mayAdd ? /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(import_design_system183.Button, { type: "button", variant: "ghost", size: "sm", "aria-label": `Add to ${group.key || "no group"}`, onClick: () => setAdding(group.key), children: /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(import_icons2.PlusIcon, { className: "h-4 w-4" }) }) : null
|
|
@@ -64319,6 +64329,10 @@ function EntitySectionBody(props) {
|
|
|
64319
64329
|
)
|
|
64320
64330
|
] });
|
|
64321
64331
|
}
|
|
64332
|
+
function SectionEmpty({ empty }) {
|
|
64333
|
+
if (empty === "quiet") return /* @__PURE__ */ (0, import_jsx_runtime208.jsx)("div", { "data-records-section-empty": "quiet", className: "pb-2" });
|
|
64334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime208.jsx)("p", { "data-records-section-empty": "line", className: "px-5 pb-5 text-sm text-muted-foreground sm:px-6", children: "Nothing here yet." });
|
|
64335
|
+
}
|
|
64322
64336
|
|
|
64323
64337
|
// src/SectionCard.tsx
|
|
64324
64338
|
var import_jsx_runtime209 = require("react/jsx-runtime");
|
|
@@ -64793,7 +64807,7 @@ function TableSectionCard(props) {
|
|
|
64793
64807
|
] }),
|
|
64794
64808
|
mayWrite && nameField ? /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(import_controls14.Button, { type: "button", variant: "outline", icon: /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(import_icons3.PlusIcon, {}), onClick: () => setAdding(groups[groups.length - 1]?.key ?? UNGROUPED2), children: "Add" }) : null
|
|
64795
64809
|
] }),
|
|
64796
|
-
refused ? /* @__PURE__ */ (0, import_jsx_runtime209.jsx)("p", { className: "px-5 pb-5 text-sm text-muted-foreground sm:px-6", children: refusalSentence(refused) }) : !fieldsRead.data || page.loading && rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime209.jsx)("div", { className: "flex flex-col gap-1.5 px-5 pb-5 sm:px-6", "aria-busy": "true", children: [0, 1, 2].map((i) => /* @__PURE__ */ (0, import_jsx_runtime209.jsx)("div", { className: "h-9 rounded-md bg-muted" }, i)) }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
|
|
64810
|
+
refused ? /* @__PURE__ */ (0, import_jsx_runtime209.jsx)("p", { className: "px-5 pb-5 text-sm text-muted-foreground sm:px-6", children: refusalSentence(refused) }) : !fieldsRead.data || page.loading && rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime209.jsx)("div", { className: "flex flex-col gap-1.5 px-5 pb-5 sm:px-6", "aria-busy": "true", children: [0, 1, 2].map((i) => /* @__PURE__ */ (0, import_jsx_runtime209.jsx)("div", { className: "h-9 rounded-md bg-muted" }, i)) }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(SectionEmpty, { empty: props.empty }) : /* @__PURE__ */ (0, import_jsx_runtime209.jsx)("div", { className: (0, import_design_system184.cn)("-mb-px", !narrow && "overflow-x-auto"), children: groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { "data-records-section-group": group.key, className: "", children: [
|
|
64797
64811
|
cols.group ? /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { className: "flex items-center justify-between border-y border-border px-5 py-1 sm:px-6", children: [
|
|
64798
64812
|
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)("span", { className: "text-xs font-semibold text-foreground", children: group.key || "No group" }),
|
|
64799
64813
|
mayWrite ? /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(import_controls14.Button, { type: "button", variant: "quiet", icon: /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(import_icons3.PlusIcon, {}), "aria-label": `Add to ${group.key || "no group"}`, onClick: () => setAdding(group.key) }) : null
|