@ai-matrx/records-ui 0.116.110 → 0.116.112
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 +30 -1
- package/dist/{SaveToTable-WZ4BELUI.js → SaveToTable-GRDFTAC4.js} +4 -4
- package/dist/{chunk-TABDUUEC.js → chunk-DZ4KNUSS.js} +16 -3
- package/dist/chunk-DZ4KNUSS.js.map +1 -0
- package/dist/{chunk-NS2VEKMS.js → chunk-FZVW6XVB.js} +2 -2
- package/dist/{chunk-K7OX6RG6.js → chunk-JTEIYLII.js} +3 -1
- package/dist/chunk-JTEIYLII.js.map +1 -0
- package/dist/{chunk-TZ2KUSHH.js → chunk-LGQLATW5.js} +30 -9
- package/dist/chunk-LGQLATW5.js.map +1 -0
- package/dist/{chunk-T7SXM6ZL.js → chunk-N76I4VXM.js} +5 -4
- package/dist/{chunk-T7SXM6ZL.js.map → chunk-N76I4VXM.js.map} +1 -1
- package/dist/{chunk-D7LNXDKV.js → chunk-Z3EUU2NM.js} +2 -2
- package/dist/helpers.cjs +21 -6
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.d.cts +11 -3
- package/dist/helpers.d.ts +11 -3
- package/dist/helpers.js +21 -6
- package/dist/helpers.js.map +1 -1
- package/dist/index.cjs +447 -403
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -4
- package/dist/index.d.ts +13 -4
- package/dist/index.js +247 -240
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +195 -160
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +4 -4
- package/dist/skeleton.js +3 -3
- package/package.json +2 -2
- package/dist/chunk-K7OX6RG6.js.map +0 -1
- package/dist/chunk-TABDUUEC.js.map +0 -1
- package/dist/chunk-TZ2KUSHH.js.map +0 -1
- /package/dist/{SaveToTable-WZ4BELUI.js.map → SaveToTable-GRDFTAC4.js.map} +0 -0
- /package/dist/{chunk-NS2VEKMS.js.map → chunk-FZVW6XVB.js.map} +0 -0
- /package/dist/{chunk-D7LNXDKV.js.map → chunk-Z3EUU2NM.js.map} +0 -0
package/dist/helpers.d.cts
CHANGED
|
@@ -400,6 +400,10 @@ declare function gridContextSnapshot(args: {
|
|
|
400
400
|
search: string;
|
|
401
401
|
}): GridContextSnapshot;
|
|
402
402
|
|
|
403
|
+
/** A notice card's optional line under its title (design-system NOTICE_TEXT_BUDGET). */
|
|
404
|
+
interface NoticeLine {
|
|
405
|
+
description?: string;
|
|
406
|
+
}
|
|
403
407
|
/** What a host's map painter is given. Pins arrive unclustered; the painter clusters them for its zoom. */
|
|
404
408
|
interface MapCanvasProps {
|
|
405
409
|
pins: readonly MapPin[];
|
|
@@ -742,12 +746,16 @@ interface RecordsUiHost {
|
|
|
742
746
|
}) => ReactNode;
|
|
743
747
|
/** Toasts. Absent means the screen shows the sentence inline instead — never silence. */
|
|
744
748
|
notify?: {
|
|
745
|
-
/**
|
|
749
|
+
/**
|
|
750
|
+
* A card: a short title and an optional line (`description`, design-system NOTICE_TEXT_BUDGET:
|
|
751
|
+
* the names and causes ride the line, never the title). `action`: one button on the card (an
|
|
752
|
+
* Undo). A host without actions draws the words alone.
|
|
753
|
+
*/
|
|
746
754
|
success: (message: string, action?: {
|
|
747
755
|
label: string;
|
|
748
756
|
run: () => void;
|
|
749
|
-
}) => void;
|
|
750
|
-
error: (message: string) => void;
|
|
757
|
+
}, options?: NoticeLine) => void;
|
|
758
|
+
error: (message: string, options?: NoticeLine) => void;
|
|
751
759
|
/**
|
|
752
760
|
* OPTIONAL. THE REVERSIBLE ACTION (`@ai-matrx/kit/reversible`): something this package did
|
|
753
761
|
* that can be undone — a table archived — handed to the host's one announcer, which acts it
|
package/dist/helpers.d.ts
CHANGED
|
@@ -400,6 +400,10 @@ declare function gridContextSnapshot(args: {
|
|
|
400
400
|
search: string;
|
|
401
401
|
}): GridContextSnapshot;
|
|
402
402
|
|
|
403
|
+
/** A notice card's optional line under its title (design-system NOTICE_TEXT_BUDGET). */
|
|
404
|
+
interface NoticeLine {
|
|
405
|
+
description?: string;
|
|
406
|
+
}
|
|
403
407
|
/** What a host's map painter is given. Pins arrive unclustered; the painter clusters them for its zoom. */
|
|
404
408
|
interface MapCanvasProps {
|
|
405
409
|
pins: readonly MapPin[];
|
|
@@ -742,12 +746,16 @@ interface RecordsUiHost {
|
|
|
742
746
|
}) => ReactNode;
|
|
743
747
|
/** Toasts. Absent means the screen shows the sentence inline instead — never silence. */
|
|
744
748
|
notify?: {
|
|
745
|
-
/**
|
|
749
|
+
/**
|
|
750
|
+
* A card: a short title and an optional line (`description`, design-system NOTICE_TEXT_BUDGET:
|
|
751
|
+
* the names and causes ride the line, never the title). `action`: one button on the card (an
|
|
752
|
+
* Undo). A host without actions draws the words alone.
|
|
753
|
+
*/
|
|
746
754
|
success: (message: string, action?: {
|
|
747
755
|
label: string;
|
|
748
756
|
run: () => void;
|
|
749
|
-
}) => void;
|
|
750
|
-
error: (message: string) => void;
|
|
757
|
+
}, options?: NoticeLine) => void;
|
|
758
|
+
error: (message: string, options?: NoticeLine) => void;
|
|
751
759
|
/**
|
|
752
760
|
* OPTIONAL. THE REVERSIBLE ACTION (`@ai-matrx/kit/reversible`): something this package did
|
|
753
761
|
* that can be undone — a table archived — handed to the host's one announcer, which acts it
|
package/dist/helpers.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { globalSlot } from '@ai-matrx/kit/global-slot';
|
|
2
2
|
import { tableStyleIsEmpty, parseTableStyle, setColorRuleTimeZone, setDisplayTimeZone } from '@ai-matrx/design-system/data-table/table-style';
|
|
3
|
+
import { setReadersTimeZone } from '@ai-matrx/records';
|
|
3
4
|
import { DECLARABLE_FIELD_KINDS, NEWER_FIELD_KINDS, PARITY_FIELD_TYPES, KERNEL_TABLES, atLeast, fieldKindFor, isButtonField, newerKindOf } from '@ai-matrx/records/field-kinds';
|
|
4
5
|
export { DEFAULT_FIELDS, addFields, declareTable, fieldDeclarationFor, tokenFor } from '@ai-matrx/records/field-kinds';
|
|
5
6
|
import { isUuidShape } from '@ai-matrx/kit/uuid';
|
|
@@ -89,6 +90,7 @@ function setPersonTimeZone(next) {
|
|
|
89
90
|
state.zone = clean;
|
|
90
91
|
setColorRuleTimeZone(clean);
|
|
91
92
|
setDisplayTimeZone(clean);
|
|
93
|
+
setReadersTimeZone(clean);
|
|
92
94
|
state.listeners.forEach((l) => l());
|
|
93
95
|
}
|
|
94
96
|
function getPersonTimeZone() {
|
|
@@ -1045,11 +1047,21 @@ function peopleSentence(message) {
|
|
|
1045
1047
|
function refusalSentence(error) {
|
|
1046
1048
|
return refusalForAPerson(error).sentence;
|
|
1047
1049
|
}
|
|
1050
|
+
var BUILD_LABEL = String.raw`(?:Test \d+ \([^)]{1,40}\)|[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+|[A-Z]{1,5}\d+[a-z]?)`;
|
|
1051
|
+
var LEADING_BUILD_LABEL = new RegExp(String.raw`^${BUILD_LABEL}(?:\s*\/\s*${BUILD_LABEL})*:\s+`);
|
|
1052
|
+
function withoutBuildLabel(sentence) {
|
|
1053
|
+
const hit = LEADING_BUILD_LABEL.exec(sentence);
|
|
1054
|
+
if (!hit) return { label: null, rest: sentence };
|
|
1055
|
+
const rest = sentence.slice(hit[0].length).trim();
|
|
1056
|
+
return { label: hit[0].trim(), rest: rest.charAt(0).toUpperCase() + rest.slice(1) };
|
|
1057
|
+
}
|
|
1048
1058
|
function plainSentence(message) {
|
|
1049
1059
|
const dropped = [];
|
|
1050
1060
|
const kept = [];
|
|
1051
1061
|
for (const raw of message.split(/(?<=[.!?])\s+/)) {
|
|
1052
|
-
const
|
|
1062
|
+
const labelled = withoutBuildLabel(raw.trim());
|
|
1063
|
+
if (labelled.label) dropped.push(labelled.label);
|
|
1064
|
+
const sentence = labelled.rest;
|
|
1053
1065
|
if (sentence === "") continue;
|
|
1054
1066
|
const cleaned = withoutMachineClauses(sentence);
|
|
1055
1067
|
dropped.push(...cleaned.dropped);
|
|
@@ -1057,6 +1069,9 @@ function plainSentence(message) {
|
|
|
1057
1069
|
}
|
|
1058
1070
|
return { kept: kept.length === 0 ? null : kept.join(" "), dropped };
|
|
1059
1071
|
}
|
|
1072
|
+
function readsAsASentence(text) {
|
|
1073
|
+
return (text ?? "").trim().split(/\s+/).filter(Boolean).length >= 2;
|
|
1074
|
+
}
|
|
1060
1075
|
function exampleOf(error) {
|
|
1061
1076
|
const detail = error.detail;
|
|
1062
1077
|
if (!detail || typeof detail !== "object") return null;
|
|
@@ -1073,7 +1088,7 @@ function refusalForAPerson(error) {
|
|
|
1073
1088
|
const title = timedOut ? TITLE["timed_out"] : TITLE[code] ?? "That was refused";
|
|
1074
1089
|
const hintIsForEngineers = isDeveloperHint(String(error.hint ?? ""));
|
|
1075
1090
|
const example = exampleOf(error);
|
|
1076
|
-
const remedy = (example ? `Enter it like ${example}.` : null) ?? (hintIsForEngineers ? null : hint.kept) ?? (timedOut ? REMEDY["timed_out"] : REMEDY[code]) ?? REMEDY["internal"];
|
|
1091
|
+
const remedy = (example ? `Enter it like ${example}.` : null) ?? (hintIsForEngineers || !readsAsASentence(hint.kept) ? null : hint.kept) ?? (timedOut ? REMEDY["timed_out"] : REMEDY[code]) ?? REMEDY["internal"];
|
|
1077
1092
|
const messageIsForEngineers = isEngineerText(String(error.message ?? ""));
|
|
1078
1093
|
const said = timedOut ? TIMED_OUT_SAID : (messageIsForEngineers ? "" : message.kept ?? "").trim();
|
|
1079
1094
|
const forEngineers = [
|
|
@@ -1129,16 +1144,16 @@ function announceTableArchived({ notify, client, tableId, name, onRestored }) {
|
|
|
1129
1144
|
notify.reversible({ verb: "archive", noun: "table", subject: name, undo });
|
|
1130
1145
|
return;
|
|
1131
1146
|
}
|
|
1132
|
-
notify?.success(
|
|
1147
|
+
notify?.success("Table archived", {
|
|
1133
1148
|
label: "Undo",
|
|
1134
1149
|
run: () => {
|
|
1135
1150
|
void undo().then(
|
|
1136
|
-
() => notify?.success(
|
|
1151
|
+
() => notify?.success("Restored", void 0, { description: `\u201C${name}\u201D` }),
|
|
1137
1152
|
// The store's refusal is already a person's sentence; anything else never prints raw.
|
|
1138
|
-
(thrown) => notify?.error(thrown instanceof TableRestoreRefused ? thrown.sentence :
|
|
1153
|
+
(thrown) => notify?.error("Not restored", { description: thrown instanceof TableRestoreRefused ? thrown.sentence : `\u201C${name}\u201D` })
|
|
1139
1154
|
);
|
|
1140
1155
|
}
|
|
1141
|
-
});
|
|
1156
|
+
}, { description: `\u201C${name}\u201D` });
|
|
1142
1157
|
}
|
|
1143
1158
|
|
|
1144
1159
|
// src/skeletonLayout.ts
|