@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/helpers.js
CHANGED
|
@@ -106,11 +106,11 @@ function personWallNow(at = /* @__PURE__ */ new Date()) {
|
|
|
106
106
|
return new Date(n("year"), n("month") - 1, n("day"), n("hour"), n("minute"), n("second"));
|
|
107
107
|
}
|
|
108
108
|
var LEVEL_WORD = {
|
|
109
|
-
viewer: "
|
|
110
|
-
commenter: "
|
|
111
|
-
edit_content: "
|
|
112
|
-
editor: "
|
|
113
|
-
admin: "
|
|
109
|
+
viewer: "View access",
|
|
110
|
+
commenter: "Comment access",
|
|
111
|
+
edit_content: "Edit access",
|
|
112
|
+
editor: "Edit access",
|
|
113
|
+
admin: "Full access"
|
|
114
114
|
};
|
|
115
115
|
var NEEDS = {
|
|
116
116
|
read: "viewer",
|
|
@@ -135,7 +135,7 @@ function levelNeededFor(what) {
|
|
|
135
135
|
return NEEDS[what];
|
|
136
136
|
}
|
|
137
137
|
var NOT_YET = "Checking what you may do here. Nothing is offered until then.";
|
|
138
|
-
var NOTHING_AT_ALL = "You have not been given this. Ask somebody
|
|
138
|
+
var NOTHING_AT_ALL = "You have not been given this. Ask somebody with Full access on it to share it with you.";
|
|
139
139
|
function sentenceFor(what, level) {
|
|
140
140
|
if (level === null) return NOTHING_AT_ALL;
|
|
141
141
|
const need = LEVEL_WORD[NEEDS[what]];
|
|
@@ -149,7 +149,7 @@ function sentenceFor(what, level) {
|
|
|
149
149
|
share: "pass this on to somebody else",
|
|
150
150
|
structure: "change the columns of this table"
|
|
151
151
|
};
|
|
152
|
-
return `You
|
|
152
|
+
return `You have ${have} here, and it takes ${need} to ${doing[what]}. Ask somebody with Full access on it to move you up.`;
|
|
153
153
|
}
|
|
154
154
|
function whatYouMayDo(level, known = true) {
|
|
155
155
|
const may = (what) => known && atLeast(level, NEEDS[what]);
|
|
@@ -1049,23 +1049,25 @@ function exampleOf(error) {
|
|
|
1049
1049
|
const example = detail.example;
|
|
1050
1050
|
return typeof example === "string" && example.trim() !== "" ? example.trim() : null;
|
|
1051
1051
|
}
|
|
1052
|
+
var TIMED_OUT_SAID = "That took too long. Nothing was lost; try again.";
|
|
1052
1053
|
function refusalForAPerson(error) {
|
|
1053
1054
|
const code = error.code ?? "internal";
|
|
1055
|
+
const timedOut = code === "timed_out" || error.sqlstate === "57014" || /canceling statement due to statement timeout/i.test(String(error.message ?? ""));
|
|
1054
1056
|
const ours = error.ours === true;
|
|
1055
1057
|
const hint = plainSentence(String(error.hint ?? ""));
|
|
1056
1058
|
const message = ours ? plainSentence(String(error.message ?? "")) : peopleSentence(String(error.message ?? ""));
|
|
1057
|
-
const title = TITLE[code] ?? "That was refused";
|
|
1059
|
+
const title = timedOut ? TITLE["timed_out"] : TITLE[code] ?? "That was refused";
|
|
1058
1060
|
const hintIsForEngineers = isDeveloperHint(String(error.hint ?? ""));
|
|
1059
1061
|
const example = exampleOf(error);
|
|
1060
|
-
const remedy = (example ? `Enter it like ${example}.` : null) ?? (hintIsForEngineers ? null : hint.kept) ?? REMEDY[code] ?? REMEDY["internal"];
|
|
1062
|
+
const remedy = (example ? `Enter it like ${example}.` : null) ?? (hintIsForEngineers ? null : hint.kept) ?? (timedOut ? REMEDY["timed_out"] : REMEDY[code]) ?? REMEDY["internal"];
|
|
1061
1063
|
const messageIsForEngineers = isEngineerText(String(error.message ?? ""));
|
|
1062
|
-
const said = (messageIsForEngineers ? "" : message.kept ?? "").trim();
|
|
1064
|
+
const said = timedOut ? TIMED_OUT_SAID : (messageIsForEngineers ? "" : message.kept ?? "").trim();
|
|
1063
1065
|
const forEngineers = [
|
|
1064
1066
|
error.sqlstate ? `SQLSTATE ${error.sqlstate}.` : null,
|
|
1065
1067
|
// The client's own note about a class it did not recognize, or a call that
|
|
1066
1068
|
// never reached the store. It is rendered out of sight, never as a sentence.
|
|
1067
1069
|
error.diagnostic ? error.diagnostic : null,
|
|
1068
|
-
messageIsForEngineers ? `Message: ${error.message}` : null,
|
|
1070
|
+
messageIsForEngineers || timedOut ? `Message: ${error.message}` : null,
|
|
1069
1071
|
error.hint && (hintIsForEngineers || hint.kept !== error.hint) ? `Hint: ${error.hint}` : null,
|
|
1070
1072
|
message.dropped.length > 0 || hint.dropped.length > 0 ? `Dropped from the person's view: ${[...message.dropped, ...hint.dropped].join(" | ")}` : null
|
|
1071
1073
|
].filter(Boolean).join(" ");
|
|
@@ -1209,7 +1211,7 @@ function rightsReason(rights, what, table) {
|
|
|
1209
1211
|
if (!rights.known) return ACTION_CHECKING_ACCESS_REASON;
|
|
1210
1212
|
if (rights[what]) return null;
|
|
1211
1213
|
if (rights.level === null) return ACTION_NO_ACCESS_REASON;
|
|
1212
|
-
return `Needs ${LEVEL_WORD[levelNeededFor(what)]}
|
|
1214
|
+
return `Needs ${LEVEL_WORD[levelNeededFor(what)]}`;
|
|
1213
1215
|
}
|
|
1214
1216
|
var TABLE_ACTION_CHORDS = {
|
|
1215
1217
|
"copy-link": { code: "KeyL", chord: "alt+shift+l" },
|