@ai-matrx/records-ui 0.116.45 → 0.116.47
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 +29 -1
- package/dist/{SaveToTable-SL5DUNI4.js → SaveToTable-HG3HQMAQ.js} +5 -5
- package/dist/{chunk-KQR2RA4V.js → chunk-ABIUJCNS.js} +3 -3
- package/dist/chunk-ABIUJCNS.js.map +1 -0
- package/dist/{chunk-F4SAKQKQ.js → chunk-K3B5IRXY.js} +79 -76
- package/dist/chunk-K3B5IRXY.js.map +1 -0
- package/dist/{chunk-OV6QBL5R.js → chunk-LBZZDHV6.js} +8 -8
- package/dist/chunk-LBZZDHV6.js.map +1 -0
- package/dist/{chunk-NKZBAIU4.js → chunk-MDXDJVDB.js} +8 -6
- package/dist/chunk-MDXDJVDB.js.map +1 -0
- package/dist/{chunk-XKI6S5KF.js → chunk-VJDJQDDI.js} +7 -7
- package/dist/{chunk-XKI6S5KF.js.map → chunk-VJDJQDDI.js.map} +1 -1
- package/dist/helpers.cjs +14 -12
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.js +14 -12
- package/dist/helpers.js.map +1 -1
- package/dist/index.cjs +137 -116
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +46 -30
- package/dist/index.js.map +1 -1
- package/dist/object-actions.cjs +8 -8
- package/dist/object-actions.cjs.map +1 -1
- package/dist/object-actions.d.cts +1 -1
- package/dist/object-actions.d.ts +1 -1
- package/dist/object-actions.js +2 -2
- package/dist/{objectActions-Be9sBGvW.d.cts → objectActions-DK-qa5zC.d.cts} +1 -1
- package/dist/{objectActions-Be9sBGvW.d.ts → objectActions-DK-qa5zC.d.ts} +1 -1
- package/dist/pickers.cjs +90 -86
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +3 -3
- package/package.json +5 -5
- package/dist/chunk-F4SAKQKQ.js.map +0 -1
- package/dist/chunk-KQR2RA4V.js.map +0 -1
- package/dist/chunk-NKZBAIU4.js.map +0 -1
- package/dist/chunk-OV6QBL5R.js.map +0 -1
- /package/dist/{SaveToTable-SL5DUNI4.js.map → SaveToTable-HG3HQMAQ.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -54,7 +54,7 @@ function sentenceFor(what, level) {
|
|
|
54
54
|
share: "pass this on to somebody else",
|
|
55
55
|
structure: "change the columns of this table"
|
|
56
56
|
};
|
|
57
|
-
return `You
|
|
57
|
+
return `You have ${have} here, and it takes ${need} to ${doing[what]}. Ask somebody with Full access on it to move you up.`;
|
|
58
58
|
}
|
|
59
59
|
function whatYouMayDo(level, known = true) {
|
|
60
60
|
const may = (what) => known && (0, import_field_kinds.atLeast)(level, NEEDS[what]);
|
|
@@ -92,11 +92,11 @@ var init_rights = __esm({
|
|
|
92
92
|
"use strict";
|
|
93
93
|
import_field_kinds = require("@ai-matrx/records/field-kinds");
|
|
94
94
|
LEVEL_WORD = {
|
|
95
|
-
viewer: "
|
|
96
|
-
commenter: "
|
|
97
|
-
edit_content: "
|
|
98
|
-
editor: "
|
|
99
|
-
admin: "
|
|
95
|
+
viewer: "View access",
|
|
96
|
+
commenter: "Comment access",
|
|
97
|
+
edit_content: "Edit access",
|
|
98
|
+
editor: "Edit access",
|
|
99
|
+
admin: "Full access"
|
|
100
100
|
};
|
|
101
101
|
NEEDS = {
|
|
102
102
|
read: "viewer",
|
|
@@ -118,7 +118,7 @@ var init_rights = __esm({
|
|
|
118
118
|
structure: "admin"
|
|
119
119
|
};
|
|
120
120
|
NOT_YET = "Checking what you may do here. Nothing is offered until then.";
|
|
121
|
-
NOTHING_AT_ALL = "You have not been given this. Ask somebody
|
|
121
|
+
NOTHING_AT_ALL = "You have not been given this. Ask somebody with Full access on it to share it with you.";
|
|
122
122
|
NOT_ANSWERED_YET = whatYouMayDo(null, false);
|
|
123
123
|
KERNEL_REASON = "This is one of the tables the platform ships, so its columns are not changed from a screen. Make your own table to change columns.";
|
|
124
124
|
DATABASE_LOCKED_REASON = "This database is locked, so its columns and settings are read-only. Unlock it to change them.";
|
|
@@ -391,21 +391,22 @@ function exampleOf(error) {
|
|
|
391
391
|
}
|
|
392
392
|
function refusalForAPerson(error) {
|
|
393
393
|
const code = error.code ?? "internal";
|
|
394
|
+
const timedOut = code === "timed_out" || error.sqlstate === "57014" || /canceling statement due to statement timeout/i.test(String(error.message ?? ""));
|
|
394
395
|
const ours = error.ours === true;
|
|
395
396
|
const hint = plainSentence(String(error.hint ?? ""));
|
|
396
397
|
const message = ours ? plainSentence(String(error.message ?? "")) : peopleSentence(String(error.message ?? ""));
|
|
397
|
-
const title = TITLE[code] ?? "That was refused";
|
|
398
|
+
const title = timedOut ? TITLE["timed_out"] : TITLE[code] ?? "That was refused";
|
|
398
399
|
const hintIsForEngineers = isDeveloperHint(String(error.hint ?? ""));
|
|
399
400
|
const example = exampleOf(error);
|
|
400
|
-
const remedy = (example ? `Enter it like ${example}.` : null) ?? (hintIsForEngineers ? null : hint.kept) ?? REMEDY[code] ?? REMEDY["internal"];
|
|
401
|
+
const remedy = (example ? `Enter it like ${example}.` : null) ?? (hintIsForEngineers ? null : hint.kept) ?? (timedOut ? REMEDY["timed_out"] : REMEDY[code]) ?? REMEDY["internal"];
|
|
401
402
|
const messageIsForEngineers = isEngineerText(String(error.message ?? ""));
|
|
402
|
-
const said2 = (messageIsForEngineers ? "" : message.kept ?? "").trim();
|
|
403
|
+
const said2 = timedOut ? TIMED_OUT_SAID : (messageIsForEngineers ? "" : message.kept ?? "").trim();
|
|
403
404
|
const forEngineers = [
|
|
404
405
|
error.sqlstate ? `SQLSTATE ${error.sqlstate}.` : null,
|
|
405
406
|
// The client's own note about a class it did not recognize, or a call that
|
|
406
407
|
// never reached the store. It is rendered out of sight, never as a sentence.
|
|
407
408
|
error.diagnostic ? error.diagnostic : null,
|
|
408
|
-
messageIsForEngineers ? `Message: ${error.message}` : null,
|
|
409
|
+
messageIsForEngineers || timedOut ? `Message: ${error.message}` : null,
|
|
409
410
|
error.hint && (hintIsForEngineers || hint.kept !== error.hint) ? `Hint: ${error.hint}` : null,
|
|
410
411
|
message.dropped.length > 0 || hint.dropped.length > 0 ? `Dropped from the person's view: ${[...message.dropped, ...hint.dropped].join(" | ")}` : null
|
|
411
412
|
].filter(Boolean).join(" ");
|
|
@@ -432,7 +433,7 @@ function refusalIsMissingInput(error) {
|
|
|
432
433
|
function withoutInternalCodes(text) {
|
|
433
434
|
return text.replace(/\s*\((?:[A-Z]{2,}-\d+[A-Za-z]?|T\d+)(?:\s*\/\s*(?:[A-Z]{2,}-\d+[A-Za-z]?|T\d+))*\)/g, "").replace(/\s+([.,;])/g, "$1").trim();
|
|
434
435
|
}
|
|
435
|
-
var MACHINE_IDENTITY, TITLE, REMEDY, ENGINEER_TEXT;
|
|
436
|
+
var MACHINE_IDENTITY, TITLE, REMEDY, ENGINEER_TEXT, TIMED_OUT_SAID;
|
|
436
437
|
var init_plainWords = __esm({
|
|
437
438
|
"src/plainWords.ts"() {
|
|
438
439
|
"use strict";
|
|
@@ -515,6 +516,7 @@ var init_plainWords = __esm({
|
|
|
515
516
|
// the app, arriving on the screen of somebody who cannot act on it.
|
|
516
517
|
/\bbind\s+[`'"A-Za-z]/i
|
|
517
518
|
];
|
|
519
|
+
TIMED_OUT_SAID = "That took too long. Nothing was lost; try again.";
|
|
518
520
|
}
|
|
519
521
|
});
|
|
520
522
|
|
|
@@ -5740,7 +5742,7 @@ function BookingBuilder({ tableId, bookingId, onSaved, onClose, startNew, classN
|
|
|
5740
5742
|
}
|
|
5741
5743
|
if (!loaded || fields.loading && !fields.data) return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system36.Skeleton, { className: (0, import_design_system36.cn)("h-64 w-full", className) });
|
|
5742
5744
|
if (!rights.structure) {
|
|
5743
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: (0, import_design_system36.cn)("text-xs text-muted-foreground", className), children: rights.why("structure") ?? "Making a booking page needs
|
|
5745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: (0, import_design_system36.cn)("text-xs text-muted-foreground", className), children: rights.why("structure") ?? "Making a booking page needs Full access on this table, because it lets people with no account take time in your calendar." });
|
|
5744
5746
|
}
|
|
5745
5747
|
const url = formId ? `${publicOrigin}${(0, import_records21.bookingPath)(formId)}` : null;
|
|
5746
5748
|
const shown5 = offer ?? null;
|
|
@@ -6154,7 +6156,7 @@ function rightsReason(rights, what, table) {
|
|
|
6154
6156
|
if (what === "structure" && table?.is_kernel) return ACTION_PLATFORM_TABLE_REASON;
|
|
6155
6157
|
if (rights[what]) return null;
|
|
6156
6158
|
if (rights.level === null) return ACTION_NO_ACCESS_REASON;
|
|
6157
|
-
return `Needs ${LEVEL_WORD[levelNeededFor(what)]}
|
|
6159
|
+
return `Needs ${LEVEL_WORD[levelNeededFor(what)]}`;
|
|
6158
6160
|
}
|
|
6159
6161
|
function typingIn(target) {
|
|
6160
6162
|
const el = target;
|
|
@@ -6538,7 +6540,7 @@ function archivedThings(forms, checklists) {
|
|
|
6538
6540
|
id: f.form_id,
|
|
6539
6541
|
title: f.title?.trim() || f.slug,
|
|
6540
6542
|
archivedAt: f.archived_at,
|
|
6541
|
-
whyNot: f.can_restore ? null : f.table_archived ? "Its table is archived" : "Needs
|
|
6543
|
+
whyNot: f.can_restore ? null : f.table_archived ? "Its table is archived" : "Needs Full access on this table"
|
|
6542
6544
|
}));
|
|
6543
6545
|
const fromChecklists = checklists.map((c) => ({
|
|
6544
6546
|
kind: "checklist",
|
|
@@ -6638,7 +6640,7 @@ var init_BuiltOnArchive = __esm({
|
|
|
6638
6640
|
init_ObjectActionMenuItems();
|
|
6639
6641
|
init_Refusal();
|
|
6640
6642
|
import_jsx_runtime46 = require("react/jsx-runtime");
|
|
6641
|
-
ARCHIVE_NEEDS_ADMIN = "Needs
|
|
6643
|
+
ARCHIVE_NEEDS_ADMIN = "Needs Full access on this table";
|
|
6642
6644
|
}
|
|
6643
6645
|
});
|
|
6644
6646
|
|
|
@@ -6902,7 +6904,7 @@ var init_BookingSlots = __esm({
|
|
|
6902
6904
|
import_jsx_runtime47 = require("react/jsx-runtime");
|
|
6903
6905
|
BOOKING_NOT_HERE_LINE = "The link named a booking page this table does not have \u2014 it may have been closed for good, or it writes into another table. The booking pages this table does have are listed here.";
|
|
6904
6906
|
WHAT_A_BOOKING_PAGE_IS = "A booking page offers times you are free and writes each appointment into this table as an ordinary record.";
|
|
6905
|
-
NO_ADMIN = "Opening a booking page lets people with no account take time in your calendar, so it needs
|
|
6907
|
+
NO_ADMIN = "Opening a booking page lets people with no account take time in your calendar, so it needs Full access on the table the appointments land in.";
|
|
6906
6908
|
STATE_WORDS = BOOKING_PAGE_STATE_LABEL;
|
|
6907
6909
|
}
|
|
6908
6910
|
});
|
|
@@ -11810,6 +11812,7 @@ var READS = /* @__PURE__ */ new Set([
|
|
|
11810
11812
|
"cell-history",
|
|
11811
11813
|
"cell-filter",
|
|
11812
11814
|
"row-open",
|
|
11815
|
+
"row-print-layout",
|
|
11813
11816
|
"row-history",
|
|
11814
11817
|
"row-copy",
|
|
11815
11818
|
"col-sort-asc",
|
|
@@ -14778,12 +14781,63 @@ init_choiceLooks();
|
|
|
14778
14781
|
var import_field_formats8 = require("@ai-matrx/design-system/field-formats");
|
|
14779
14782
|
|
|
14780
14783
|
// src/formattedValue.tsx
|
|
14781
|
-
var
|
|
14784
|
+
var import_react48 = require("react");
|
|
14782
14785
|
var import_data_table3 = require("@ai-matrx/design-system/data-table");
|
|
14783
14786
|
var import_field_formats6 = require("@ai-matrx/design-system/field-formats");
|
|
14784
|
-
var
|
|
14787
|
+
var import_design_system26 = require("@ai-matrx/design-system");
|
|
14785
14788
|
var import_outbound_react3 = require("@ai-matrx/kit/outbound-react");
|
|
14789
|
+
|
|
14790
|
+
// src/LinkPreviewCard.tsx
|
|
14791
|
+
var import_react47 = require("react");
|
|
14792
|
+
var import_design_system25 = require("@ai-matrx/design-system");
|
|
14793
|
+
init_host();
|
|
14786
14794
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
14795
|
+
var answers = /* @__PURE__ */ new Map();
|
|
14796
|
+
function LinkPreviewCard({ url, children }) {
|
|
14797
|
+
const port = useRecordsUi().linkPreview;
|
|
14798
|
+
const [preview, setPreview] = (0, import_react47.useState)(void 0);
|
|
14799
|
+
const [open, setOpen] = (0, import_react47.useState)(false);
|
|
14800
|
+
const timer = (0, import_react47.useRef)(null);
|
|
14801
|
+
(0, import_react47.useEffect)(() => () => void (timer.current && clearTimeout(timer.current)), []);
|
|
14802
|
+
if (!port) return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, { children });
|
|
14803
|
+
const ask2 = () => {
|
|
14804
|
+
if (preview !== void 0) return;
|
|
14805
|
+
let pending = answers.get(url);
|
|
14806
|
+
if (!pending) {
|
|
14807
|
+
pending = port.read(url).catch(() => null);
|
|
14808
|
+
answers.set(url, pending);
|
|
14809
|
+
}
|
|
14810
|
+
void pending.then((found) => setPreview(found));
|
|
14811
|
+
};
|
|
14812
|
+
const enter = () => {
|
|
14813
|
+
ask2();
|
|
14814
|
+
if (timer.current) clearTimeout(timer.current);
|
|
14815
|
+
timer.current = setTimeout(() => setOpen(true), 350);
|
|
14816
|
+
};
|
|
14817
|
+
const leave = () => {
|
|
14818
|
+
if (timer.current) clearTimeout(timer.current);
|
|
14819
|
+
setOpen(false);
|
|
14820
|
+
};
|
|
14821
|
+
const shown5 = preview && (preview.title || preview.description || preview.imageUrl) ? preview : null;
|
|
14822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_design_system25.HoverCard, { open: open && shown5 !== null, onOpenChange: (next) => next ? void 0 : setOpen(false), children: [
|
|
14823
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system25.HoverCardTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "inline-flex min-w-0 max-w-full", onMouseEnter: enter, onMouseLeave: leave, onFocus: enter, onBlur: leave, children }) }),
|
|
14824
|
+
shown5 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_design_system25.HoverCardContent, { align: "start", className: "w-72 space-y-1.5 p-2 text-xs", "data-records-link-preview": "", children: [
|
|
14825
|
+
shown5.imageUrl ? (
|
|
14826
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
14827
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("img", { src: shown5.imageUrl, alt: "", className: "h-28 w-full rounded object-cover", referrerPolicy: "no-referrer" })
|
|
14828
|
+
) : null,
|
|
14829
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
14830
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system25.SiteIcon, { site: url, iconUrl: shown5.faviconUrl, className: "h-3.5 w-3.5" }),
|
|
14831
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "truncate text-muted-foreground", children: shown5.siteName ?? "" })
|
|
14832
|
+
] }),
|
|
14833
|
+
shown5.title ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "line-clamp-2 font-medium", children: shown5.title }) : null,
|
|
14834
|
+
shown5.description ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "line-clamp-3 text-muted-foreground", children: shown5.description }) : null
|
|
14835
|
+
] }) : null
|
|
14836
|
+
] });
|
|
14837
|
+
}
|
|
14838
|
+
|
|
14839
|
+
// src/formattedValue.tsx
|
|
14840
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
14787
14841
|
var LINK = "inline-flex min-w-0 items-center gap-1 text-primary hover:underline";
|
|
14788
14842
|
var own2 = (event) => event.stopPropagation();
|
|
14789
14843
|
function numberOf3(value) {
|
|
@@ -14801,11 +14855,11 @@ function RatingStars({
|
|
|
14801
14855
|
label,
|
|
14802
14856
|
selectFirst
|
|
14803
14857
|
}) {
|
|
14804
|
-
const armed = (0,
|
|
14858
|
+
const armed = (0, import_react48.useRef)(true);
|
|
14805
14859
|
const score = numberOf3(value) ?? 0;
|
|
14806
14860
|
const shown5 = Math.round(score);
|
|
14807
14861
|
const said2 = `${shown5} out of ${max}`;
|
|
14808
|
-
return /* @__PURE__ */ (0,
|
|
14862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
14809
14863
|
"span",
|
|
14810
14864
|
{
|
|
14811
14865
|
"data-records-rating": "",
|
|
@@ -14817,8 +14871,8 @@ function RatingStars({
|
|
|
14817
14871
|
children: Array.from({ length: max }, (_, i) => {
|
|
14818
14872
|
const n = i + 1;
|
|
14819
14873
|
const lit = n <= shown5;
|
|
14820
|
-
const star = /* @__PURE__ */ (0,
|
|
14821
|
-
return onRate ? /* @__PURE__ */ (0,
|
|
14874
|
+
const star = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { "aria-hidden": true, className: (0, import_design_system26.cn)("text-sm leading-none", lit ? "text-amber-400" : "text-muted-foreground/40"), children: "\u2605" });
|
|
14875
|
+
return onRate ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
14822
14876
|
"button",
|
|
14823
14877
|
{
|
|
14824
14878
|
type: "button",
|
|
@@ -14843,7 +14897,7 @@ function RatingStars({
|
|
|
14843
14897
|
children: star
|
|
14844
14898
|
},
|
|
14845
14899
|
n
|
|
14846
|
-
) : /* @__PURE__ */ (0,
|
|
14900
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: star }, n);
|
|
14847
14901
|
})
|
|
14848
14902
|
}
|
|
14849
14903
|
);
|
|
@@ -14851,20 +14905,20 @@ function RatingStars({
|
|
|
14851
14905
|
function rich(id, text, raw, format) {
|
|
14852
14906
|
switch (id) {
|
|
14853
14907
|
case "email":
|
|
14854
|
-
return /* @__PURE__ */ (0,
|
|
14908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("a", { href: `mailto:${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "truncate", children: readableLink(text) }) });
|
|
14855
14909
|
case "url":
|
|
14856
|
-
return /* @__PURE__ */ (0,
|
|
14910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LinkPreviewCard, { url: text.includes("://") ? text : `https://${text}`, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_outbound_react3.OutboundLink, { href: text.includes("://") ? text : `https://${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "truncate", children: text }) }) });
|
|
14857
14911
|
case "phone":
|
|
14858
|
-
return /* @__PURE__ */ (0,
|
|
14912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("a", { href: `tel:${text.replace(/[^\d+]/g, "")}`, className: LINK, onClick: own2, title: text, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "truncate tabular-nums", children: (0, import_field_formats6.formatPhone)(text) }) });
|
|
14859
14913
|
case "address":
|
|
14860
|
-
return /* @__PURE__ */ (0,
|
|
14914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
14861
14915
|
import_outbound_react3.OutboundLink,
|
|
14862
14916
|
{
|
|
14863
14917
|
href: `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(text)}`,
|
|
14864
14918
|
className: LINK,
|
|
14865
14919
|
title: "Open in maps",
|
|
14866
14920
|
onClick: own2,
|
|
14867
|
-
children: /* @__PURE__ */ (0,
|
|
14921
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "truncate", children: text })
|
|
14868
14922
|
}
|
|
14869
14923
|
);
|
|
14870
14924
|
case "progress": {
|
|
@@ -14872,8 +14926,8 @@ function rich(id, text, raw, format) {
|
|
|
14872
14926
|
if (n === null) return void 0;
|
|
14873
14927
|
const pct = format.options?.percentScale === "fraction" ? n * 100 : n;
|
|
14874
14928
|
const clamped = Math.max(0, Math.min(100, pct));
|
|
14875
|
-
return /* @__PURE__ */ (0,
|
|
14876
|
-
/* @__PURE__ */ (0,
|
|
14929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "inline-flex w-full min-w-0 items-center gap-2", title: text, children: [
|
|
14930
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
14877
14931
|
"span",
|
|
14878
14932
|
{
|
|
14879
14933
|
role: "progressbar",
|
|
@@ -14881,24 +14935,24 @@ function rich(id, text, raw, format) {
|
|
|
14881
14935
|
"aria-valuemax": 100,
|
|
14882
14936
|
"aria-valuenow": Math.round(clamped),
|
|
14883
14937
|
className: "h-1.5 min-w-8 flex-1 overflow-hidden rounded-full bg-muted",
|
|
14884
|
-
children: /* @__PURE__ */ (0,
|
|
14938
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: (0, import_design_system26.cn)("block h-full rounded-full", pct >= 100 ? "bg-emerald-500" : "bg-primary"), style: { width: `${clamped}%` } })
|
|
14885
14939
|
}
|
|
14886
14940
|
),
|
|
14887
|
-
/* @__PURE__ */ (0,
|
|
14941
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: text })
|
|
14888
14942
|
] });
|
|
14889
14943
|
}
|
|
14890
14944
|
case "color":
|
|
14891
|
-
return /* @__PURE__ */ (0,
|
|
14892
|
-
/* @__PURE__ */ (0,
|
|
14893
|
-
/* @__PURE__ */ (0,
|
|
14945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
14946
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "h-4 w-4 shrink-0 rounded border border-border", style: { backgroundColor: text } }),
|
|
14947
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { className: "font-mono text-xs", children: text })
|
|
14894
14948
|
] });
|
|
14895
14949
|
case "tags": {
|
|
14896
14950
|
const items = Array.isArray(raw) ? raw.map(String) : text.split(",").map((s) => s.trim()).filter(Boolean);
|
|
14897
14951
|
if (items.length === 0) return void 0;
|
|
14898
|
-
return /* @__PURE__ */ (0,
|
|
14952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "flex flex-wrap items-center gap-1", children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "inline-flex items-center rounded-md border border-border bg-muted px-1.5 py-0.5 text-xs", children: item }, `${item}-${i}`)) });
|
|
14899
14953
|
}
|
|
14900
14954
|
case "rating":
|
|
14901
|
-
return numberOf3(raw) === null ? void 0 : /* @__PURE__ */ (0,
|
|
14955
|
+
return numberOf3(raw) === null ? void 0 : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RatingStars, { value: raw, max: format.options?.ratingMax ?? 5 });
|
|
14902
14956
|
default:
|
|
14903
14957
|
return void 0;
|
|
14904
14958
|
}
|
|
@@ -14913,16 +14967,16 @@ function FormattedValue({
|
|
|
14913
14967
|
const score = numberOf3(value);
|
|
14914
14968
|
const max = format.options?.ratingMax ?? 5;
|
|
14915
14969
|
if (def?.id === "rating" && onRate && (value === null || value === void 0 || value === "" || score !== null && score >= 0 && score <= max)) {
|
|
14916
|
-
return /* @__PURE__ */ (0,
|
|
14970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RatingStars, { value, max: format.options?.ratingMax ?? 5, onRate, selectFirst });
|
|
14917
14971
|
}
|
|
14918
14972
|
const result = (0, import_field_formats6.formatFieldValue)(value, format);
|
|
14919
|
-
if (!result.ok || result.empty || !def?.rich) return /* @__PURE__ */ (0,
|
|
14973
|
+
if (!result.ok || result.empty || !def?.rich) return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_data_table3.FormattedCell, { result });
|
|
14920
14974
|
const look = fieldLookFor(def.id);
|
|
14921
14975
|
if (look) {
|
|
14922
14976
|
const View = look.View;
|
|
14923
|
-
return /* @__PURE__ */ (0,
|
|
14977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(View, { value, format });
|
|
14924
14978
|
}
|
|
14925
|
-
return rich(def.id, result.text, value, format) ?? /* @__PURE__ */ (0,
|
|
14979
|
+
return rich(def.id, result.text, value, format) ?? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_data_table3.FormattedCell, { result });
|
|
14926
14980
|
}
|
|
14927
14981
|
function linkChipText(raw) {
|
|
14928
14982
|
try {
|
|
@@ -14938,55 +14992,6 @@ function linkChipText(raw) {
|
|
|
14938
14992
|
// src/values.tsx
|
|
14939
14993
|
init_host();
|
|
14940
14994
|
|
|
14941
|
-
// src/LinkPreviewCard.tsx
|
|
14942
|
-
var import_react48 = require("react");
|
|
14943
|
-
var import_design_system26 = require("@ai-matrx/design-system");
|
|
14944
|
-
init_host();
|
|
14945
|
-
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
14946
|
-
var answers = /* @__PURE__ */ new Map();
|
|
14947
|
-
function LinkPreviewCard({ url, children }) {
|
|
14948
|
-
const port = useRecordsUi().linkPreview;
|
|
14949
|
-
const [preview, setPreview] = (0, import_react48.useState)(void 0);
|
|
14950
|
-
const [open, setOpen] = (0, import_react48.useState)(false);
|
|
14951
|
-
const timer = (0, import_react48.useRef)(null);
|
|
14952
|
-
(0, import_react48.useEffect)(() => () => void (timer.current && clearTimeout(timer.current)), []);
|
|
14953
|
-
if (!port) return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children });
|
|
14954
|
-
const ask2 = () => {
|
|
14955
|
-
if (preview !== void 0) return;
|
|
14956
|
-
let pending = answers.get(url);
|
|
14957
|
-
if (!pending) {
|
|
14958
|
-
pending = port.read(url).catch(() => null);
|
|
14959
|
-
answers.set(url, pending);
|
|
14960
|
-
}
|
|
14961
|
-
void pending.then((found) => setPreview(found));
|
|
14962
|
-
};
|
|
14963
|
-
const enter = () => {
|
|
14964
|
-
ask2();
|
|
14965
|
-
if (timer.current) clearTimeout(timer.current);
|
|
14966
|
-
timer.current = setTimeout(() => setOpen(true), 350);
|
|
14967
|
-
};
|
|
14968
|
-
const leave = () => {
|
|
14969
|
-
if (timer.current) clearTimeout(timer.current);
|
|
14970
|
-
setOpen(false);
|
|
14971
|
-
};
|
|
14972
|
-
const shown5 = preview && (preview.title || preview.description || preview.imageUrl) ? preview : null;
|
|
14973
|
-
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_design_system26.HoverCard, { open: open && shown5 !== null, onOpenChange: (next) => next ? void 0 : setOpen(false), children: [
|
|
14974
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system26.HoverCardTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "inline-flex min-w-0 max-w-full", onMouseEnter: enter, onMouseLeave: leave, onFocus: enter, onBlur: leave, children }) }),
|
|
14975
|
-
shown5 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_design_system26.HoverCardContent, { align: "start", className: "w-72 space-y-1.5 p-2 text-xs", "data-records-link-preview": "", children: [
|
|
14976
|
-
shown5.imageUrl ? (
|
|
14977
|
-
// eslint-disable-next-line @next/next/no-img-element
|
|
14978
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("img", { src: shown5.imageUrl, alt: "", className: "h-28 w-full rounded object-cover", referrerPolicy: "no-referrer" })
|
|
14979
|
-
) : null,
|
|
14980
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
14981
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system26.SiteIcon, { site: url, iconUrl: shown5.faviconUrl, className: "h-3.5 w-3.5" }),
|
|
14982
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "truncate text-muted-foreground", children: shown5.siteName ?? "" })
|
|
14983
|
-
] }),
|
|
14984
|
-
shown5.title ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "line-clamp-2 font-medium", children: shown5.title }) : null,
|
|
14985
|
-
shown5.description ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "line-clamp-3 text-muted-foreground", children: shown5.description }) : null
|
|
14986
|
-
] }) : null
|
|
14987
|
-
] });
|
|
14988
|
-
}
|
|
14989
|
-
|
|
14990
14995
|
// src/gridAttachments.tsx
|
|
14991
14996
|
var import_react50 = require("react");
|
|
14992
14997
|
var import_react51 = require("@ai-matrx/records/react");
|
|
@@ -29541,7 +29546,7 @@ function EnrichPanel({ tableId, fieldId, className }) {
|
|
|
29541
29546
|
target?.name ?? "this column",
|
|
29542
29547
|
" in automatically."
|
|
29543
29548
|
] }),
|
|
29544
|
-
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("p", { className: "text-muted-foreground", children: "
|
|
29549
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("p", { className: "text-muted-foreground", children: "Someone with Full access on this table sets that up." })
|
|
29545
29550
|
] });
|
|
29546
29551
|
}
|
|
29547
29552
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: (0, import_design_system81.cn)("space-y-3 p-4 text-sm", className), children: [
|
|
@@ -29622,7 +29627,7 @@ function EnrichPanel({ tableId, fieldId, className }) {
|
|
|
29622
29627
|
if (shown5.length === 0) {
|
|
29623
29628
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: (0, import_design_system81.cn)("space-y-2 p-4 text-sm", className), children: [
|
|
29624
29629
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("p", { className: "font-medium", children: "No column here is filled in by a model." }),
|
|
29625
|
-
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("p", { className: "text-muted-foreground", children: rights.admin ? "Open a column's menu and choose \u201CLet AI fill\u201D to set one up \u2014 or just ask for it in plain words and the agent will." : "
|
|
29630
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("p", { className: "text-muted-foreground", children: rights.admin ? "Open a column's menu and choose \u201CLet AI fill\u201D to set one up \u2014 or just ask for it in plain words and the agent will." : "Someone with Full access on this table sets that up." })
|
|
29626
29631
|
] });
|
|
29627
29632
|
}
|
|
29628
29633
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: (0, import_design_system81.cn)("space-y-6 p-4", className), children: shown5.map((row) => {
|
|
@@ -32397,6 +32402,7 @@ function BulkActions({
|
|
|
32397
32402
|
noun,
|
|
32398
32403
|
nounPlural,
|
|
32399
32404
|
titleKey = null,
|
|
32405
|
+
mayWrite = true,
|
|
32400
32406
|
onDone
|
|
32401
32407
|
}) {
|
|
32402
32408
|
const typeable = (0, import_react175.useMemo)(() => fields.filter(fieldIsEditable), [fields]);
|
|
@@ -32420,12 +32426,12 @@ function BulkActions({
|
|
|
32420
32426
|
if (ok) onDone();
|
|
32421
32427
|
};
|
|
32422
32428
|
return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_jsx_runtime107.Fragment, { children: [
|
|
32423
|
-
typeable.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_jsx_runtime107.Fragment, { children: [
|
|
32429
|
+
mayWrite && typeable.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_jsx_runtime107.Fragment, { children: [
|
|
32424
32430
|
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_design_system90.Button, { size: "sm", variant: "outline", className: "h-7 px-2", "data-records-bulk": "set", disabled: bulk.busy, onClick: () => open("set"), children: "Set a column" }),
|
|
32425
32431
|
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_design_system90.Button, { size: "sm", variant: "outline", className: "h-7 px-2", "data-records-bulk": "clear", disabled: bulk.busy, onClick: () => open("clear"), children: "Clear a column" }),
|
|
32426
32432
|
ids.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_design_system90.Button, { size: "sm", variant: "outline", className: "h-7 px-2", "data-records-bulk": "fill", disabled: bulk.busy, onClick: () => open("fill"), children: "Fill down" }) : null
|
|
32427
32433
|
] }) : null,
|
|
32428
|
-
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
32434
|
+
mayWrite ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
32429
32435
|
import_design_system90.Button,
|
|
32430
32436
|
{
|
|
32431
32437
|
size: "sm",
|
|
@@ -32436,9 +32442,9 @@ function BulkActions({
|
|
|
32436
32442
|
onClick: () => void bulk.duplicate(ids).then((ok) => ok ? onDone() : void 0),
|
|
32437
32443
|
children: "Duplicate"
|
|
32438
32444
|
}
|
|
32439
|
-
),
|
|
32445
|
+
) : null,
|
|
32440
32446
|
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_design_system90.Button, { size: "sm", variant: "outline", className: "h-7 px-2", "data-records-bulk": "print", disabled: bulk.busy, onClick: () => setPrinting(true), children: "Print with layout\u2026" }),
|
|
32441
|
-
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_design_system90.Button, { size: "sm", variant: "outline", className: "h-7 px-2", "data-records-bulk": "delete", disabled: bulk.busy, onClick: () => setConfirmDelete(true), children: "Delete" }),
|
|
32447
|
+
mayWrite ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_design_system90.Button, { size: "sm", variant: "outline", className: "h-7 px-2", "data-records-bulk": "delete", disabled: bulk.busy, onClick: () => setConfirmDelete(true), children: "Delete" }) : null,
|
|
32442
32448
|
printing ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(PrintWithLayoutDialog, { tableId, recordIds: ids, names: printNames(ids, rows, titleKey), open: true, onOpenChange: setPrinting }) : null,
|
|
32443
32449
|
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_design_system90.Dialog, { open: asking !== null, onOpenChange: (next) => !next ? setAsking(null) : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_design_system90.DialogContent, { className: "sm:max-w-md", children: [
|
|
32444
32450
|
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_design_system90.DialogHeader, { children: [
|
|
@@ -33393,7 +33399,7 @@ function GridBody({
|
|
|
33393
33399
|
versions
|
|
33394
33400
|
});
|
|
33395
33401
|
const [selectedIds, setSelectedIds] = (0, import_react182.useState)([]);
|
|
33396
|
-
const offerSelection = !embedded && !readOnly &&
|
|
33402
|
+
const offerSelection = !embedded && !readOnly && (merged || canWrite && tableActions2.runnable.length > 0);
|
|
33397
33403
|
const [reordering, setReordering] = (0, import_react182.useState)(false);
|
|
33398
33404
|
const chosenSummaries = localSummaries ?? presentation.summaries ?? NO_SUMMARIES;
|
|
33399
33405
|
const summaryVersion = (0, import_react182.useMemo)(
|
|
@@ -35009,10 +35015,11 @@ function GridBody({
|
|
|
35009
35015
|
noun,
|
|
35010
35016
|
nounPlural,
|
|
35011
35017
|
titleKey,
|
|
35018
|
+
mayWrite: canWrite,
|
|
35012
35019
|
onDone: () => setSelectedIds([])
|
|
35013
35020
|
}
|
|
35014
35021
|
) : null,
|
|
35015
|
-
tableActions2.runnable.map((action3) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
35022
|
+
canWrite ? tableActions2.runnable.map((action3) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
35016
35023
|
ActionButton,
|
|
35017
35024
|
{
|
|
35018
35025
|
action: action3,
|
|
@@ -35021,7 +35028,7 @@ function GridBody({
|
|
|
35021
35028
|
onPress: () => runner.press(action3, ids)
|
|
35022
35029
|
},
|
|
35023
35030
|
action3.id
|
|
35024
|
-
))
|
|
35031
|
+
)) : null
|
|
35025
35032
|
] })
|
|
35026
35033
|
}
|
|
35027
35034
|
} : embedded ? { selection: false } : {},
|
|
@@ -38263,7 +38270,7 @@ function CommentThread({ tableId, recordId, fieldKey, className }) {
|
|
|
38263
38270
|
}
|
|
38264
38271
|
) : (
|
|
38265
38272
|
// No dead composer. The store's own rung, in a person's words.
|
|
38266
|
-
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)("p", { className: "text-xs text-muted-foreground", children: "You can read this conversation and not join it. Commenting needs
|
|
38273
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)("p", { className: "text-xs text-muted-foreground", children: "You can read this conversation and not join it. Commenting needs Comment access on this record \u2014 ask whoever shared it with you to raise it." })
|
|
38267
38274
|
)
|
|
38268
38275
|
] });
|
|
38269
38276
|
}
|
|
@@ -58586,7 +58593,7 @@ init_host();
|
|
|
58586
58593
|
var import_jsx_runtime184 = require("react/jsx-runtime");
|
|
58587
58594
|
var FORM_NOT_HERE_LINE = "The link named a form this table does not have \u2014 it may have been removed, or it belongs to another table. The forms this table does have are listed here.";
|
|
58588
58595
|
var WHAT_A_FORM_IS = "A form uses this table's own fields, and its answers land here as ordinary records stamped with the form they came through.";
|
|
58589
|
-
var NO_ADMIN2 = "This table has no forms. Making one needs
|
|
58596
|
+
var NO_ADMIN2 = "This table has no forms. Making one needs Full access on it, because a form decides what people with no account may add here.";
|
|
58590
58597
|
function formSuggestion(tableName2) {
|
|
58591
58598
|
const subject = tableName2?.trim() ? tableName2.trim() : "this table";
|
|
58592
58599
|
return `Make me a form that collects new ${subject} entries and tells me when somebody answers.`;
|
|
@@ -59679,7 +59686,7 @@ function EmbedFrame({
|
|
|
59679
59686
|
if (!rights.admin) {
|
|
59680
59687
|
return /* @__PURE__ */ (0, import_jsx_runtime189.jsxs)("p", { className: (0, import_design_system167.cn)("rounded border border-dashed px-2 py-1 text-xs text-muted-foreground", className), children: [
|
|
59681
59688
|
rights.why("structure"),
|
|
59682
|
-
" Issuing an embed opens a way in from somebody else's website, so it needs
|
|
59689
|
+
" Issuing an embed opens a way in from somebody else's website, so it needs Full access on this table."
|
|
59683
59690
|
] });
|
|
59684
59691
|
}
|
|
59685
59692
|
const snippet = secret ? `<iframe src="${embedUrl}#t=${secret}" style="width:100%;height:640px;border:0" loading="lazy"></iframe>` : null;
|
|
@@ -61098,7 +61105,7 @@ function railFromParam(raw) {
|
|
|
61098
61105
|
function unknownRailLine(raw) {
|
|
61099
61106
|
return `The link asked to open \u201C${raw}\u201D on this table, which is not something a table has, so you are looking at its records. A table opens Forms, Bookings, Checklists, Notifications, Portals, Settings, Import, Inbox and Share \u2014 each is in the table's menu.`;
|
|
61100
61107
|
}
|
|
61101
|
-
var SHARE_NOT_YOURS_LINE = "The link asked to open this table's sharing, and only someone with
|
|
61108
|
+
var SHARE_NOT_YOURS_LINE = "The link asked to open this table's sharing, and only someone with Full access on this table can share it, so it did not open. Ask someone with Full access on this table to share it or to give you Full access.";
|
|
61102
61109
|
function openingView(activeView, activeDashboardId) {
|
|
61103
61110
|
const named = (0, import_views2.pageViewFromParam)(activeView);
|
|
61104
61111
|
if (named === null) {
|
|
@@ -61298,6 +61305,20 @@ function TablePage({
|
|
|
61298
61305
|
const [duplicateOpen, setDuplicateOpen] = (0, import_react346.useState)(false);
|
|
61299
61306
|
const [referenceOpen, setReferenceOpen] = (0, import_react346.useState)(false);
|
|
61300
61307
|
const [subscribeOpen, setSubscribeOpen] = (0, import_react346.useState)(false);
|
|
61308
|
+
const subscribeDateKey = shown5?.dateField ?? (shown5?.layout === "calendar" && allFields.data ? eligibleFieldFor("date", allFields.data, null).field?.key ?? null : null);
|
|
61309
|
+
const subscribeInCalendar = async () => {
|
|
61310
|
+
const current = view;
|
|
61311
|
+
if (!current || !subscribeDateKey) return;
|
|
61312
|
+
if (current.dateField !== subscribeDateKey) {
|
|
61313
|
+
const written = await saveViewPatch(client, tableId, current.id, { dateField: subscribeDateKey });
|
|
61314
|
+
if (!written.ok) {
|
|
61315
|
+
recordsUi.notify?.error(refusalSentence(written.error));
|
|
61316
|
+
return;
|
|
61317
|
+
}
|
|
61318
|
+
setView({ ...current, dateField: subscribeDateKey });
|
|
61319
|
+
}
|
|
61320
|
+
setSubscribeOpen(true);
|
|
61321
|
+
};
|
|
61301
61322
|
const [breakDownOpen, setBreakDownOpen] = (0, import_react346.useState)(false);
|
|
61302
61323
|
const canGetReference = useCanGetReference();
|
|
61303
61324
|
const [toolbarSlot, setToolbarSlot] = (0, import_react346.useState)(null);
|
|
@@ -61649,7 +61670,7 @@ function TablePage({
|
|
|
61649
61670
|
label: "Questions",
|
|
61650
61671
|
icon: "layout-dashboard",
|
|
61651
61672
|
group: "built-on",
|
|
61652
|
-
...mayDo.known && !mayDo.read ? { disabledReason: "Needs
|
|
61673
|
+
...mayDo.known && !mayDo.read ? { disabledReason: "Needs View access" } : {},
|
|
61653
61674
|
run: () => go({ main: "questions" })
|
|
61654
61675
|
},
|
|
61655
61676
|
...canGetReference ? [
|
|
@@ -61658,7 +61679,7 @@ function TablePage({
|
|
|
61658
61679
|
label: "Get reference\u2026",
|
|
61659
61680
|
icon: "link-2",
|
|
61660
61681
|
group: "share",
|
|
61661
|
-
...mayDo.known && !mayDo.read ? { disabledReason: "Needs
|
|
61682
|
+
...mayDo.known && !mayDo.read ? { disabledReason: "Needs View access" } : {},
|
|
61662
61683
|
run: () => void window.setTimeout(() => setReferenceOpen(true), 0)
|
|
61663
61684
|
}
|
|
61664
61685
|
] : [],
|
|
@@ -61669,7 +61690,7 @@ function TablePage({
|
|
|
61669
61690
|
label: subItemsOn ? "Turn off sub-items" : "Turn on sub-items",
|
|
61670
61691
|
icon: "list-checks",
|
|
61671
61692
|
group: "manage",
|
|
61672
|
-
...mayDo.known && !mayDo.structure ? { disabledReason: "Needs
|
|
61693
|
+
...mayDo.known && !mayDo.structure ? { disabledReason: "Needs Full access" } : {},
|
|
61673
61694
|
run: () => void toggleSubItems()
|
|
61674
61695
|
},
|
|
61675
61696
|
// CLEAN THE WHOLE TABLE (the Sheet's toolbar cleanup): the grid's one review, from the ⋯ too.
|
|
@@ -61679,13 +61700,13 @@ function TablePage({
|
|
|
61679
61700
|
label: CLEAN_TABLE_LABEL,
|
|
61680
61701
|
icon: "eraser",
|
|
61681
61702
|
group: "manage",
|
|
61682
|
-
...mayDo.known && !mayDo.write ? { disabledReason: "Needs
|
|
61703
|
+
...mayDo.known && !mayDo.write ? { disabledReason: "Needs Edit access" } : {},
|
|
61683
61704
|
run: () => void window.setTimeout(() => askToCleanTable(tableId), 0)
|
|
61684
61705
|
}
|
|
61685
61706
|
] : [],
|
|
61686
61707
|
// BREAK DOWN: the grid grouped by one column, through the drill's own question.
|
|
61687
61708
|
breakDownAction({
|
|
61688
|
-
...mayDo.known && !mayDo.read ? { disabledReason: "Needs
|
|
61709
|
+
...mayDo.known && !mayDo.read ? { disabledReason: "Needs View access" } : !view ? { disabledReason: NO_VIEW_REASON } : allFields.data && allFields.data.length === 0 ? { disabledReason: NO_DIMENSION_REASON } : {},
|
|
61689
61710
|
run: () => void window.setTimeout(() => setBreakDownOpen(true), 0)
|
|
61690
61711
|
}),
|
|
61691
61712
|
// THE VIEW'S TWO ONE-PRESS WAYS OUT (TABLE-EXPERIENCE item 4).
|
|
@@ -61700,10 +61721,10 @@ function TablePage({
|
|
|
61700
61721
|
recordsUi.notify?.error("Couldn\u2019t copy the link");
|
|
61701
61722
|
}
|
|
61702
61723
|
},
|
|
61703
|
-
...mayDo.known && !mayDo.read ? { disabledReason: "Needs
|
|
61724
|
+
...mayDo.known && !mayDo.read ? { disabledReason: "Needs View access" } : {}
|
|
61704
61725
|
}),
|
|
61705
61726
|
downloadCsvAction({
|
|
61706
|
-
...mayDo.known && !mayDo.read ? { disabledReason: "Needs
|
|
61727
|
+
...mayDo.known && !mayDo.read ? { disabledReason: "Needs View access" } : !allFields.data ? { disabledReason: "Reading this table\u2026" } : {},
|
|
61707
61728
|
run: () => downloadViewCsv({
|
|
61708
61729
|
client,
|
|
61709
61730
|
host: recordsUi,
|
|
@@ -61715,7 +61736,7 @@ function TablePage({
|
|
|
61715
61736
|
})
|
|
61716
61737
|
}),
|
|
61717
61738
|
downloadMarkdownAction({
|
|
61718
|
-
...mayDo.known && !mayDo.read ? { disabledReason: "Needs
|
|
61739
|
+
...mayDo.known && !mayDo.read ? { disabledReason: "Needs View access" } : !allFields.data ? { disabledReason: "Reading this table\u2026" } : {},
|
|
61719
61740
|
run: () => downloadViewMarkdown({
|
|
61720
61741
|
client,
|
|
61721
61742
|
host: recordsUi,
|
|
@@ -61727,7 +61748,7 @@ function TablePage({
|
|
|
61727
61748
|
})
|
|
61728
61749
|
}),
|
|
61729
61750
|
copyMarkdownAction({
|
|
61730
|
-
...mayDo.known && !mayDo.read ? { disabledReason: "Needs
|
|
61751
|
+
...mayDo.known && !mayDo.read ? { disabledReason: "Needs View access" } : !allFields.data ? { disabledReason: "Reading this table\u2026" } : {},
|
|
61731
61752
|
run: () => copyViewMarkdown({
|
|
61732
61753
|
client,
|
|
61733
61754
|
host: recordsUi,
|
|
@@ -61741,7 +61762,7 @@ function TablePage({
|
|
|
61741
61762
|
// PRINT, FULL PRINT, HTML PREVIEW, COPY THE HTML PAGE, SAVE AS FILE (TABLE-PARITY item 3): the platform print system's.
|
|
61742
61763
|
...["print", "full-print", "html-preview", "copy-html-page", "save-as-file"].map(
|
|
61743
61764
|
(kind2) => tablePageAction(kind2, {
|
|
61744
|
-
...mayDo.known && !mayDo.read ? { disabledReason: "Needs
|
|
61765
|
+
...mayDo.known && !mayDo.read ? { disabledReason: "Needs View access" } : !allFields.data ? { disabledReason: "Reading this table\u2026" } : {},
|
|
61745
61766
|
run: () => runTablePageAction(kind2, {
|
|
61746
61767
|
client,
|
|
61747
61768
|
host: recordsUi,
|
|
@@ -61756,8 +61777,8 @@ function TablePage({
|
|
|
61756
61777
|
// THE PRIVATE CALENDAR LINK (CAL-FEED-UI): only where the host bound the doors.
|
|
61757
61778
|
...recordsUi.calendarFeed && organizationId ? [
|
|
61758
61779
|
subscribeCalendarAction({
|
|
61759
|
-
...mayDo.known && !mayDo.read ? { disabledReason: "Needs
|
|
61760
|
-
run: () => void window.setTimeout(() =>
|
|
61780
|
+
...mayDo.known && !mayDo.read ? { disabledReason: "Needs View access" } : !view ? { disabledReason: NO_VIEW_REASON } : !subscribeDateKey ? { disabledReason: shown5?.layout === "calendar" ? "This table has no date column" : "Switch this view to Calendar to subscribe" } : {},
|
|
61781
|
+
run: () => void window.setTimeout(() => void subscribeInCalendar(), 0)
|
|
61761
61782
|
})
|
|
61762
61783
|
] : [],
|
|
61763
61784
|
...actionHost?.extend ? actionHost.extend(subject, mayDo) : []
|