@ai-matrx/records-ui 0.70.0 → 0.71.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/CHANGELOG.md +28 -0
- package/dist/index.cjs +35 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +132 -106
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -530,7 +530,7 @@ function ReferenceBuilder({
|
|
|
530
530
|
|
|
531
531
|
// src/PersonPicker.tsx
|
|
532
532
|
import { useCallback, useEffect as useEffect3, useMemo as useMemo4, useState as useState4 } from "react";
|
|
533
|
-
import {
|
|
533
|
+
import { useOptionalRecordsClient as useOptionalRecordsClient3 } from "@ai-matrx/records/react";
|
|
534
534
|
import {
|
|
535
535
|
BasicInput as BasicInput4,
|
|
536
536
|
Button as Button4,
|
|
@@ -544,7 +544,7 @@ import {
|
|
|
544
544
|
// src/editors.tsx
|
|
545
545
|
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
546
546
|
import { choiceValuesOf, isTheChosen, optionKey } from "@ai-matrx/records";
|
|
547
|
-
import {
|
|
547
|
+
import { useOptionalRecordsClient as useOptionalRecordsClient2 } from "@ai-matrx/records/react";
|
|
548
548
|
import {
|
|
549
549
|
BasicInput as BasicInput3,
|
|
550
550
|
BasicTextarea,
|
|
@@ -656,7 +656,7 @@ function fieldTypeLabel(field) {
|
|
|
656
656
|
|
|
657
657
|
// src/RelationPicker.tsx
|
|
658
658
|
import { useEffect, useMemo as useMemo3, useState as useState2 } from "react";
|
|
659
|
-
import {
|
|
659
|
+
import { useOptionalRecordsClient } from "@ai-matrx/records/react";
|
|
660
660
|
import {
|
|
661
661
|
BasicInput as BasicInput2,
|
|
662
662
|
Button as Button2,
|
|
@@ -667,8 +667,9 @@ import {
|
|
|
667
667
|
cn as cn2
|
|
668
668
|
} from "@ai-matrx/design-system";
|
|
669
669
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
670
|
+
var NO_STORE_ON_THIS_SCREEN_REASON = "cannot be answered on this page: it points at a record in somebody's own data, and a page answered without an account is never allowed to search that. Leave it blank and whoever receives this will fill it in.";
|
|
670
671
|
function RelationPicker({ field, value, onChange, disabled, id, className, allowCreate = true }) {
|
|
671
|
-
const client =
|
|
672
|
+
const client = useOptionalRecordsClient();
|
|
672
673
|
const [rows, setRows] = useState2(null);
|
|
673
674
|
const [words, setWords] = useState2({});
|
|
674
675
|
const [refusal, setRefusal] = useState2(null);
|
|
@@ -686,7 +687,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
|
|
|
686
687
|
);
|
|
687
688
|
useEffect(() => {
|
|
688
689
|
const target2 = field.relation_target;
|
|
689
|
-
if (!target2) return;
|
|
690
|
+
if (!target2 || !client) return;
|
|
690
691
|
let cancelled = false;
|
|
691
692
|
void client.list({ table_id: target2, limit: 200 }).then((result) => {
|
|
692
693
|
if (cancelled) return;
|
|
@@ -698,7 +699,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
|
|
|
698
699
|
};
|
|
699
700
|
}, [client, field.relation_target]);
|
|
700
701
|
useEffect(() => {
|
|
701
|
-
if (!rows) return;
|
|
702
|
+
if (!rows || !client) return;
|
|
702
703
|
const wanted = [.../* @__PURE__ */ new Set([...rows.map((row) => row.id), ...picked])].filter(
|
|
703
704
|
(id2) => words[id2] === void 0
|
|
704
705
|
);
|
|
@@ -718,7 +719,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
|
|
|
718
719
|
};
|
|
719
720
|
}, [client, field.id, rows, picked, words]);
|
|
720
721
|
useEffect(() => {
|
|
721
|
-
if (!open || !allowCreate || target || targetRefusal) return;
|
|
722
|
+
if (!open || !allowCreate || target || targetRefusal || !client) return;
|
|
722
723
|
const id2 = field.relation_target;
|
|
723
724
|
if (!id2) return;
|
|
724
725
|
let cancelled = false;
|
|
@@ -739,6 +740,13 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
|
|
|
739
740
|
cancelled = true;
|
|
740
741
|
};
|
|
741
742
|
}, [client, open, allowCreate, target, targetRefusal, field.relation_target]);
|
|
743
|
+
if (!client) {
|
|
744
|
+
return /* @__PURE__ */ jsxs2("p", { id, className: cn2("text-xs text-muted-foreground", className), children: [
|
|
745
|
+
fieldName(field),
|
|
746
|
+
" ",
|
|
747
|
+
NO_STORE_ON_THIS_SCREEN_REASON
|
|
748
|
+
] });
|
|
749
|
+
}
|
|
742
750
|
if (!field.relation_target) {
|
|
743
751
|
return /* @__PURE__ */ jsxs2("p", { className: "text-xs text-muted-foreground", children: [
|
|
744
752
|
fieldName(field),
|
|
@@ -1069,10 +1077,11 @@ function JsonControl({ field, value, onChange, disabled, id }) {
|
|
|
1069
1077
|
] });
|
|
1070
1078
|
}
|
|
1071
1079
|
function OptionControl({ field, value, onChange, disabled, id }) {
|
|
1072
|
-
const client =
|
|
1080
|
+
const client = useOptionalRecordsClient2();
|
|
1073
1081
|
const [options, setOptions] = useState3(null);
|
|
1074
1082
|
const [refusal, setRefusal] = useState3(null);
|
|
1075
1083
|
useEffect2(() => {
|
|
1084
|
+
if (!client) return;
|
|
1076
1085
|
let cancelled = false;
|
|
1077
1086
|
void client.fieldOptions({ field_id: field.id }).then((result) => {
|
|
1078
1087
|
if (cancelled) return;
|
|
@@ -1083,6 +1092,23 @@ function OptionControl({ field, value, onChange, disabled, id }) {
|
|
|
1083
1092
|
cancelled = true;
|
|
1084
1093
|
};
|
|
1085
1094
|
}, [client, field.id]);
|
|
1095
|
+
if (!client) {
|
|
1096
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-1", children: [
|
|
1097
|
+
/* @__PURE__ */ jsx4(
|
|
1098
|
+
BasicInput3,
|
|
1099
|
+
{
|
|
1100
|
+
id,
|
|
1101
|
+
value: value === null || value === void 0 ? "" : String(value),
|
|
1102
|
+
disabled,
|
|
1103
|
+
onChange: (e) => onChange(e.target.value === "" ? null : e.target.value)
|
|
1104
|
+
}
|
|
1105
|
+
),
|
|
1106
|
+
/* @__PURE__ */ jsxs3("p", { className: "text-xs text-muted-foreground", children: [
|
|
1107
|
+
fieldName(field),
|
|
1108
|
+
" is normally picked from a list. This page is answered without an account, so the list cannot be read here \u2014 type your answer and whoever receives it will match it up."
|
|
1109
|
+
] })
|
|
1110
|
+
] });
|
|
1111
|
+
}
|
|
1086
1112
|
if (refusal) return /* @__PURE__ */ jsx4("p", { id, className: "text-xs text-destructive", children: refusal });
|
|
1087
1113
|
if (!options) return /* @__PURE__ */ jsx4("p", { id, className: "text-xs text-muted-foreground", children: "Reading this field's choices\u2026" });
|
|
1088
1114
|
if (options.length === 0) {
|
|
@@ -1167,7 +1193,7 @@ async function personRecordForMember(client, personTableId, people, member) {
|
|
|
1167
1193
|
return written;
|
|
1168
1194
|
}
|
|
1169
1195
|
function PersonPicker({ field, value, onChange, disabled, id, className }) {
|
|
1170
|
-
const client =
|
|
1196
|
+
const client = useOptionalRecordsClient3();
|
|
1171
1197
|
const host = useRecordsUi();
|
|
1172
1198
|
const [members, setMembers] = useState4(null);
|
|
1173
1199
|
const [people, setPeople] = useState4([]);
|
|
@@ -1182,7 +1208,7 @@ function PersonPicker({ field, value, onChange, disabled, id, className }) {
|
|
|
1182
1208
|
[value]
|
|
1183
1209
|
);
|
|
1184
1210
|
const load = useCallback(async () => {
|
|
1185
|
-
if (!membersPort) return;
|
|
1211
|
+
if (!membersPort || !client) return;
|
|
1186
1212
|
const [roster, records] = await Promise.all([
|
|
1187
1213
|
membersPort(),
|
|
1188
1214
|
personTable ? client.list({ table_id: personTable, limit: 500 }) : Promise.resolve(null)
|
|
@@ -1199,7 +1225,7 @@ function PersonPicker({ field, value, onChange, disabled, id, className }) {
|
|
|
1199
1225
|
void load();
|
|
1200
1226
|
}, [open, load]);
|
|
1201
1227
|
useEffect3(() => {
|
|
1202
|
-
if (picked.length === 0 || !personTable || people.length > 0) return;
|
|
1228
|
+
if (picked.length === 0 || !personTable || people.length > 0 || !client) return;
|
|
1203
1229
|
let cancelled = false;
|
|
1204
1230
|
void client.list({ table_id: personTable, limit: 500 }).then((result) => {
|
|
1205
1231
|
if (cancelled || !result.ok) return;
|
|
@@ -1209,7 +1235,7 @@ function PersonPicker({ field, value, onChange, disabled, id, className }) {
|
|
|
1209
1235
|
cancelled = true;
|
|
1210
1236
|
};
|
|
1211
1237
|
}, [client, personTable, picked.length, people.length]);
|
|
1212
|
-
if (!membersPort) {
|
|
1238
|
+
if (!membersPort || !client) {
|
|
1213
1239
|
return /* @__PURE__ */ jsx5("p", { className: cn4("text-xs text-muted-foreground", className), children: NO_MEMBERS_REASON });
|
|
1214
1240
|
}
|
|
1215
1241
|
if (!personTable) {
|
|
@@ -1320,7 +1346,7 @@ function PersonPicker({ field, value, onChange, disabled, id, className }) {
|
|
|
1320
1346
|
// src/gridEditing.tsx
|
|
1321
1347
|
import { useCallback as useCallback4, useEffect as useEffect6, useMemo as useMemo7, useRef as useRef3, useState as useState7 } from "react";
|
|
1322
1348
|
import { asWriteConflict } from "@ai-matrx/records/core";
|
|
1323
|
-
import { useRecordsClient as
|
|
1349
|
+
import { useRecordsClient as useRecordsClient3 } from "@ai-matrx/records/react";
|
|
1324
1350
|
import { Button as Button5, Checkbox as Checkbox3, cn as cn7 } from "@ai-matrx/design-system";
|
|
1325
1351
|
|
|
1326
1352
|
// src/Refusal.tsx
|
|
@@ -1374,7 +1400,7 @@ function RefusalLine({ error, className }) {
|
|
|
1374
1400
|
|
|
1375
1401
|
// src/whoChangedSource.tsx
|
|
1376
1402
|
import { createContext as createContext2, useCallback as useCallback2, useContext as useContext2, useEffect as useEffect4, useMemo as useMemo5, useRef, useState as useState5 } from "react";
|
|
1377
|
-
import { useRecordsClient
|
|
1403
|
+
import { useRecordsClient } from "@ai-matrx/records/react";
|
|
1378
1404
|
|
|
1379
1405
|
// src/whoChanged.ts
|
|
1380
1406
|
var SOMEBODY = "somebody in this organization";
|
|
@@ -1426,7 +1452,7 @@ function WhoChangedSource({
|
|
|
1426
1452
|
labelOf,
|
|
1427
1453
|
children
|
|
1428
1454
|
}) {
|
|
1429
|
-
const client =
|
|
1455
|
+
const client = useRecordsClient();
|
|
1430
1456
|
const host = useRecordsUi();
|
|
1431
1457
|
const membersPort = host.members;
|
|
1432
1458
|
const [answers, setAnswers] = useState5({});
|
|
@@ -1495,7 +1521,7 @@ import { Badge as Badge2, cn as cn6 } from "@ai-matrx/design-system";
|
|
|
1495
1521
|
|
|
1496
1522
|
// src/labels.tsx
|
|
1497
1523
|
import { createContext as createContext3, useCallback as useCallback3, useContext as useContext3, useEffect as useEffect5, useMemo as useMemo6, useRef as useRef2, useState as useState6 } from "react";
|
|
1498
|
-
import { useRecordsClient as
|
|
1524
|
+
import { useRecordsClient as useRecordsClient2 } from "@ai-matrx/records/react";
|
|
1499
1525
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1500
1526
|
var LabelContext = createContext3({
|
|
1501
1527
|
// With no provider the resolver is ABSENT, not silently empty: a caller gets
|
|
@@ -1523,7 +1549,7 @@ function pointsAtRecords(field) {
|
|
|
1523
1549
|
return field.type === "list" || field.type === "relation";
|
|
1524
1550
|
}
|
|
1525
1551
|
function RecordLabelProvider({ children }) {
|
|
1526
|
-
const client =
|
|
1552
|
+
const client = useRecordsClient2();
|
|
1527
1553
|
const [names, setNames] = useState6({});
|
|
1528
1554
|
const [settled, setSettled] = useState6({});
|
|
1529
1555
|
const [waitingLines, setWaitingLines] = useState6({});
|
|
@@ -1901,7 +1927,7 @@ function rememberVersion(cache, recordId, version) {
|
|
|
1901
1927
|
if (held === void 0 || version > held) cache.set(recordId, version);
|
|
1902
1928
|
}
|
|
1903
1929
|
function useGridEditing({ tableId, fields, rows, reload, canWrite, mayWriteRow }) {
|
|
1904
|
-
const client =
|
|
1930
|
+
const client = useRecordsClient3();
|
|
1905
1931
|
const [editing, setEditing] = useState7(null);
|
|
1906
1932
|
const [draft, setDraft] = useState7(null);
|
|
1907
1933
|
const typed = useRef3(null);
|
|
@@ -2448,7 +2474,7 @@ import { useCallback as useCallback6, useMemo as useMemo9, useRef as useRef4, us
|
|
|
2448
2474
|
import {
|
|
2449
2475
|
useFields as useFields3,
|
|
2450
2476
|
useRecords as useRecords2,
|
|
2451
|
-
useRecordsClient as
|
|
2477
|
+
useRecordsClient as useRecordsClient5,
|
|
2452
2478
|
useTable as useTable2
|
|
2453
2479
|
} from "@ai-matrx/records/react";
|
|
2454
2480
|
import { MatrxDataTable } from "@ai-matrx/design-system/data-table";
|
|
@@ -2626,7 +2652,7 @@ import { Button as Button8, Skeleton as Skeleton2, cn as cn9 } from "@ai-matrx/d
|
|
|
2626
2652
|
import { useCallback as useCallback5, useEffect as useEffect7, useMemo as useMemo8, useState as useState8 } from "react";
|
|
2627
2653
|
import {
|
|
2628
2654
|
useFields as useFields2,
|
|
2629
|
-
useRecordsClient as
|
|
2655
|
+
useRecordsClient as useRecordsClient4,
|
|
2630
2656
|
useTable
|
|
2631
2657
|
} from "@ai-matrx/records/react";
|
|
2632
2658
|
import {
|
|
@@ -2723,7 +2749,7 @@ function EnrichBadge({ cell, onPin, className }) {
|
|
|
2723
2749
|
] });
|
|
2724
2750
|
}
|
|
2725
2751
|
function useEnrichCells(tableId, recordIds) {
|
|
2726
|
-
const client =
|
|
2752
|
+
const client = useRecordsClient4();
|
|
2727
2753
|
const [cells, setCells] = useState8(/* @__PURE__ */ new Map());
|
|
2728
2754
|
const [error, setError] = useState8(null);
|
|
2729
2755
|
const key = (recordIds ?? []).join(",");
|
|
@@ -2749,7 +2775,7 @@ function useEnrichCells(tableId, recordIds) {
|
|
|
2749
2775
|
}
|
|
2750
2776
|
var NEVER = "Fill it in once and leave it alone";
|
|
2751
2777
|
function EnrichPanel({ tableId, fieldId, className }) {
|
|
2752
|
-
const client =
|
|
2778
|
+
const client = useRecordsClient4();
|
|
2753
2779
|
const host = useRecordsUi();
|
|
2754
2780
|
const table = useTable(tableId);
|
|
2755
2781
|
const fields = useFields2(tableId);
|
|
@@ -3344,7 +3370,7 @@ function Grid({
|
|
|
3344
3370
|
onAskWhoChanged
|
|
3345
3371
|
}) {
|
|
3346
3372
|
const host = useRecordsUi();
|
|
3347
|
-
const client =
|
|
3373
|
+
const client = useRecordsClient5();
|
|
3348
3374
|
const table = useTable2(tableId);
|
|
3349
3375
|
const fields = useFields3(tableId);
|
|
3350
3376
|
const [page, setPage] = useState10(0);
|
|
@@ -4084,7 +4110,7 @@ function ExportMenu({ tableId, rows, label, className }) {
|
|
|
4084
4110
|
|
|
4085
4111
|
// src/ImportWizard.tsx
|
|
4086
4112
|
import { useCallback as useCallback7, useMemo as useMemo10, useState as useState12 } from "react";
|
|
4087
|
-
import { useFields as useFields5, useRecordsClient as
|
|
4113
|
+
import { useFields as useFields5, useRecordsClient as useRecordsClient6, useTable as useTable3 } from "@ai-matrx/records/react";
|
|
4088
4114
|
import {
|
|
4089
4115
|
importCsv,
|
|
4090
4116
|
importXlsx
|
|
@@ -4103,7 +4129,7 @@ function typeWord(t) {
|
|
|
4103
4129
|
return fieldTypeChoice(t)?.label ?? (t === "relation" ? "Points at another table" : t);
|
|
4104
4130
|
}
|
|
4105
4131
|
function ImportWizard({ tableId, onDone, className }) {
|
|
4106
|
-
const client =
|
|
4132
|
+
const client = useRecordsClient6();
|
|
4107
4133
|
const table = useTable3(tableId);
|
|
4108
4134
|
const fields = useFields5(tableId);
|
|
4109
4135
|
const rights = useTableRights(table.data);
|
|
@@ -4601,7 +4627,7 @@ function CustomFieldsSection({
|
|
|
4601
4627
|
|
|
4602
4628
|
// src/FieldEditor.tsx
|
|
4603
4629
|
import { useMemo as useMemo12, useState as useState14 } from "react";
|
|
4604
|
-
import { useFieldMutation, useFields as useFields6, useRecords as useRecords4, useRecordsClient as
|
|
4630
|
+
import { useFieldMutation, useFields as useFields6, useRecords as useRecords4, useRecordsClient as useRecordsClient7, useTable as useTable4 } from "@ai-matrx/records/react";
|
|
4605
4631
|
import {
|
|
4606
4632
|
BasicInput as BasicInput5,
|
|
4607
4633
|
BasicTextarea as BasicTextarea2,
|
|
@@ -4643,7 +4669,7 @@ function FieldEditor({ tableId, field, onSaved, onCancel, onRemoved, className }
|
|
|
4643
4669
|
const fields = useFields6(tableId);
|
|
4644
4670
|
const rights = useTableRights(table.data);
|
|
4645
4671
|
const mutation = useFieldMutation();
|
|
4646
|
-
const client =
|
|
4672
|
+
const client = useRecordsClient7();
|
|
4647
4673
|
const [label, setLabel] = useState14(field?.label ?? "");
|
|
4648
4674
|
const [type, setType] = useState14(() => startingType(field));
|
|
4649
4675
|
const [required, setRequired] = useState14(field?.required ?? false);
|
|
@@ -5182,7 +5208,7 @@ function ValueOnTheOtherSide({
|
|
|
5182
5208
|
|
|
5183
5209
|
// src/StageRules.tsx
|
|
5184
5210
|
import { useCallback as useCallback8, useEffect as useEffect8, useMemo as useMemo13, useState as useState16 } from "react";
|
|
5185
|
-
import { useFields as useFields7, useRecordsClient as
|
|
5211
|
+
import { useFields as useFields7, useRecordsClient as useRecordsClient8, useTable as useTable5 } from "@ai-matrx/records/react";
|
|
5186
5212
|
import { BasicInput as BasicInput7, BasicTextarea as BasicTextarea3, Button as Button14, Separator as Separator5, Skeleton as Skeleton3, cn as cn14 } from "@ai-matrx/design-system";
|
|
5187
5213
|
|
|
5188
5214
|
// src/Condition.tsx
|
|
@@ -5520,7 +5546,7 @@ function draftOf(rule) {
|
|
|
5520
5546
|
};
|
|
5521
5547
|
}
|
|
5522
5548
|
function StageRulesSection({ tableId, stage, className }) {
|
|
5523
|
-
const client =
|
|
5549
|
+
const client = useRecordsClient8();
|
|
5524
5550
|
const table = useTable5(tableId);
|
|
5525
5551
|
const rights = useTableRights(table.data);
|
|
5526
5552
|
const fields = useFields7(tableId);
|
|
@@ -5970,17 +5996,17 @@ function TableSettings({
|
|
|
5970
5996
|
|
|
5971
5997
|
// src/Peek.tsx
|
|
5972
5998
|
import { useState as useState22 } from "react";
|
|
5973
|
-
import { useFields as useFields10, useRecord as useRecord2, useRecordsClient as
|
|
5999
|
+
import { useFields as useFields10, useRecord as useRecord2, useRecordsClient as useRecordsClient11, useTable as useTable7 } from "@ai-matrx/records/react";
|
|
5974
6000
|
import { AlchemyMenu as AlchemyMenu2 } from "@ai-matrx/alchemy/react";
|
|
5975
6001
|
|
|
5976
6002
|
// src/RecordChat.tsx
|
|
5977
6003
|
import { useEffect as useEffect9, useMemo as useMemo14, useState as useState18 } from "react";
|
|
5978
|
-
import { useRecordsClient as
|
|
6004
|
+
import { useRecordsClient as useRecordsClient9 } from "@ai-matrx/records/react";
|
|
5979
6005
|
import { Skeleton as Skeleton4, cn as cn16 } from "@ai-matrx/design-system";
|
|
5980
6006
|
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5981
6007
|
var NO_CHAT_REASON = "Chatting about this record is not switched on here yet, so this panel is empty rather than showing a box that goes nowhere. It is on our list, not yours.";
|
|
5982
6008
|
function RecordChat({ tableId, recordId, className }) {
|
|
5983
|
-
const client =
|
|
6009
|
+
const client = useRecordsClient9();
|
|
5984
6010
|
const host = useRecordsUi();
|
|
5985
6011
|
const [scope, setScope] = useState18(null);
|
|
5986
6012
|
const [error, setError] = useState18(null);
|
|
@@ -6112,7 +6138,7 @@ import { Button as Button16, Separator as Separator7, cn as cn17 } from "@ai-mat
|
|
|
6112
6138
|
|
|
6113
6139
|
// src/systemTable.ts
|
|
6114
6140
|
import { useEffect as useEffect10, useMemo as useMemo15, useState as useState19 } from "react";
|
|
6115
|
-
import { useRecordsClient as
|
|
6141
|
+
import { useRecordsClient as useRecordsClient10 } from "@ai-matrx/records/react";
|
|
6116
6142
|
var inFlight = /* @__PURE__ */ new Map();
|
|
6117
6143
|
async function ensureSystemTable(client, spec) {
|
|
6118
6144
|
const cacheKey = `${client.config.organizationId}:${spec.slug}`;
|
|
@@ -6240,7 +6266,7 @@ async function declare(client, spec) {
|
|
|
6240
6266
|
return { ok: true, data: table.data };
|
|
6241
6267
|
}
|
|
6242
6268
|
function useSystemTable(spec) {
|
|
6243
|
-
const client =
|
|
6269
|
+
const client = useRecordsClient10();
|
|
6244
6270
|
const [state, setState] = useState19({ tableId: null, loading: true, error: null });
|
|
6245
6271
|
const slug = spec.slug;
|
|
6246
6272
|
const stable = useMemo15(() => spec, [slug]);
|
|
@@ -6260,7 +6286,7 @@ function useSystemTable(spec) {
|
|
|
6260
6286
|
return state;
|
|
6261
6287
|
}
|
|
6262
6288
|
function useRecordVersion(recordId) {
|
|
6263
|
-
const client =
|
|
6289
|
+
const client = useRecordsClient10();
|
|
6264
6290
|
const [version, setVersion] = useState19(null);
|
|
6265
6291
|
useEffect10(() => {
|
|
6266
6292
|
let cancelled = false;
|
|
@@ -6483,7 +6509,7 @@ function Peek({ tableId, recordId, onClose, className }) {
|
|
|
6483
6509
|
const record = useRecord2(recordId, true);
|
|
6484
6510
|
const may = useRecordRights(recordId);
|
|
6485
6511
|
const host = useRecordsUi();
|
|
6486
|
-
const organizationId =
|
|
6512
|
+
const organizationId = useRecordsClient11().config.organizationId;
|
|
6487
6513
|
const [editing, setEditing] = useState22(false);
|
|
6488
6514
|
const [talking, setTalking] = useState22(false);
|
|
6489
6515
|
if (record.error) return /* @__PURE__ */ jsx24(RefusalNotice, { error: record.error, className });
|
|
@@ -6720,7 +6746,7 @@ function parseSorts(raw) {
|
|
|
6720
6746
|
|
|
6721
6747
|
// src/ViewSwitcher.tsx
|
|
6722
6748
|
import { useEffect as useEffect13, useMemo as useMemo18, useState as useState24 } from "react";
|
|
6723
|
-
import { useFields as useFields12, useRecords as useRecords5, useRecordsClient as
|
|
6749
|
+
import { useFields as useFields12, useRecords as useRecords5, useRecordsClient as useRecordsClient13 } from "@ai-matrx/records/react";
|
|
6724
6750
|
import { Button as Button20, Skeleton as Skeleton7, cn as cn20 } from "@ai-matrx/design-system";
|
|
6725
6751
|
|
|
6726
6752
|
// src/Pipeline.tsx
|
|
@@ -6728,7 +6754,7 @@ import { useCallback as useCallback9, useEffect as useEffect12, useMemo as useMe
|
|
|
6728
6754
|
import {
|
|
6729
6755
|
mayDrag,
|
|
6730
6756
|
useFields as useFields11,
|
|
6731
|
-
useRecordsClient as
|
|
6757
|
+
useRecordsClient as useRecordsClient12
|
|
6732
6758
|
} from "@ai-matrx/records/react";
|
|
6733
6759
|
import { Button as Button19, Skeleton as Skeleton6, cn as cn19 } from "@ai-matrx/design-system";
|
|
6734
6760
|
import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
@@ -6762,7 +6788,7 @@ function PipelineBoard({
|
|
|
6762
6788
|
onMoved,
|
|
6763
6789
|
className
|
|
6764
6790
|
}) {
|
|
6765
|
-
const client =
|
|
6791
|
+
const client = useRecordsClient12();
|
|
6766
6792
|
const fields = useFields11(tableId);
|
|
6767
6793
|
const [definition, setDefinition] = useState23(null);
|
|
6768
6794
|
const [columns, setColumns] = useState23([]);
|
|
@@ -7133,7 +7159,7 @@ function unplacedName(record, field, labels) {
|
|
|
7133
7159
|
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
7134
7160
|
var NO_FIELDS = [];
|
|
7135
7161
|
function useViewRecords(view, pageSize = 200, filter) {
|
|
7136
|
-
const client =
|
|
7162
|
+
const client = useRecordsClient13();
|
|
7137
7163
|
const table = useRecords5(view.ruleId ? null : view.subject, {
|
|
7138
7164
|
pageSize,
|
|
7139
7165
|
...filter ? { filter } : {}
|
|
@@ -7259,7 +7285,7 @@ function offerableFields(all, want) {
|
|
|
7259
7285
|
});
|
|
7260
7286
|
}
|
|
7261
7287
|
function useStageField(tableId) {
|
|
7262
|
-
const client =
|
|
7288
|
+
const client = useRecordsClient13();
|
|
7263
7289
|
const [stage, setStage] = useState24({
|
|
7264
7290
|
asked: false,
|
|
7265
7291
|
key: null
|
|
@@ -7537,7 +7563,7 @@ function Card2({
|
|
|
7537
7563
|
|
|
7538
7564
|
// src/ViewBar.tsx
|
|
7539
7565
|
import { useCallback as useCallback11, useEffect as useEffect14, useState as useState25 } from "react";
|
|
7540
|
-
import { useRecordsClient as
|
|
7566
|
+
import { useRecordsClient as useRecordsClient14 } from "@ai-matrx/records/react";
|
|
7541
7567
|
import { Button as Button21, Input as Input2, Skeleton as Skeleton8, cn as cn21 } from "@ai-matrx/design-system";
|
|
7542
7568
|
|
|
7543
7569
|
// src/seedOnce.ts
|
|
@@ -7556,7 +7582,7 @@ import { useTable as useTable8 } from "@ai-matrx/records/react";
|
|
|
7556
7582
|
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
7557
7583
|
var SAVED_VIEWS_UNAVAILABLE = "Saved views are not available in this organization right now, so the layout you pick here is not being kept. Everything else on this table works as usual.";
|
|
7558
7584
|
function ViewBar({ tableId, activeViewId, onActiveView, seed, className }) {
|
|
7559
|
-
const client =
|
|
7585
|
+
const client = useRecordsClient14();
|
|
7560
7586
|
const claimSeed = useSeedGuard();
|
|
7561
7587
|
const table = useTable8(tableId);
|
|
7562
7588
|
const rights = useTableRights(table.data);
|
|
@@ -7677,7 +7703,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, className }) {
|
|
|
7677
7703
|
|
|
7678
7704
|
// src/ProposalRow.tsx
|
|
7679
7705
|
import { useState as useState26 } from "react";
|
|
7680
|
-
import { useRecordsClient as
|
|
7706
|
+
import { useRecordsClient as useRecordsClient15 } from "@ai-matrx/records/react";
|
|
7681
7707
|
import { Badge as Badge7, Button as Button22, cn as cn22 } from "@ai-matrx/design-system";
|
|
7682
7708
|
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
7683
7709
|
var ACT_WORD = PROPOSED_CHANGE_ACT_LABEL;
|
|
@@ -7690,7 +7716,7 @@ function ProposalRow({
|
|
|
7690
7716
|
onSettled,
|
|
7691
7717
|
className
|
|
7692
7718
|
}) {
|
|
7693
|
-
const client =
|
|
7719
|
+
const client = useRecordsClient15();
|
|
7694
7720
|
const [settled, setSettled] = useState26(outcome ?? null);
|
|
7695
7721
|
const [busy, setBusy] = useState26(false);
|
|
7696
7722
|
const [confirming, setConfirming] = useState26(false);
|
|
@@ -7779,12 +7805,12 @@ function ProposalRow({
|
|
|
7779
7805
|
|
|
7780
7806
|
// src/ActionInbox.tsx
|
|
7781
7807
|
import { useCallback as useCallback13, useEffect as useEffect16, useMemo as useMemo20, useRef as useRef7, useState as useState28 } from "react";
|
|
7782
|
-
import { useRecordsClient as
|
|
7808
|
+
import { useRecordsClient as useRecordsClient17 } from "@ai-matrx/records/react";
|
|
7783
7809
|
import { Badge as Badge9, Button as Button24, Skeleton as Skeleton10, cn as cn24 } from "@ai-matrx/design-system";
|
|
7784
7810
|
|
|
7785
7811
|
// src/ChecklistRunner.tsx
|
|
7786
7812
|
import { useCallback as useCallback12, useEffect as useEffect15, useMemo as useMemo19, useState as useState27 } from "react";
|
|
7787
|
-
import { useRecordsClient as
|
|
7813
|
+
import { useRecordsClient as useRecordsClient16, useTable as useTable9 } from "@ai-matrx/records/react";
|
|
7788
7814
|
import { Badge as Badge8, BasicInput as BasicInput8, BasicTextarea as BasicTextarea4, Button as Button23, Skeleton as Skeleton9, cn as cn23 } from "@ai-matrx/design-system";
|
|
7789
7815
|
import { Fragment as Fragment13, jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
7790
7816
|
var DUE_WORD = DUE_STATE_LABEL;
|
|
@@ -7798,7 +7824,7 @@ function ChecklistRunner({
|
|
|
7798
7824
|
offerToStart,
|
|
7799
7825
|
className
|
|
7800
7826
|
}) {
|
|
7801
|
-
const client =
|
|
7827
|
+
const client = useRecordsClient16();
|
|
7802
7828
|
const table = useTable9(tableId ?? null);
|
|
7803
7829
|
const rights = useTableRights(table.data);
|
|
7804
7830
|
const [runs, setRuns] = useState27(null);
|
|
@@ -8047,7 +8073,7 @@ function StepRow({
|
|
|
8047
8073
|
);
|
|
8048
8074
|
}
|
|
8049
8075
|
function useMyChecklistSteps(limit = 25) {
|
|
8050
|
-
const client =
|
|
8076
|
+
const client = useRecordsClient16();
|
|
8051
8077
|
const me = client.config.actor.user_id ?? null;
|
|
8052
8078
|
const [steps, setSteps] = useState27([]);
|
|
8053
8079
|
const [loading, setLoading] = useState27(true);
|
|
@@ -8086,7 +8112,7 @@ function useMyChecklistSteps(limit = 25) {
|
|
|
8086
8112
|
return { steps, loading, error, refresh };
|
|
8087
8113
|
}
|
|
8088
8114
|
function MyChecklistSteps({ className }) {
|
|
8089
|
-
const client =
|
|
8115
|
+
const client = useRecordsClient16();
|
|
8090
8116
|
const { steps, loading, error, refresh } = useMyChecklistSteps();
|
|
8091
8117
|
const [busy, setBusy] = useState27(null);
|
|
8092
8118
|
const [refusal, setRefusal] = useState27(null);
|
|
@@ -8125,7 +8151,7 @@ function MyChecklistSteps({ className }) {
|
|
|
8125
8151
|
] });
|
|
8126
8152
|
}
|
|
8127
8153
|
function ChecklistsPanel({ tableId, onOpenRecord, className }) {
|
|
8128
|
-
const client =
|
|
8154
|
+
const client = useRecordsClient16();
|
|
8129
8155
|
const table = useTable9(tableId);
|
|
8130
8156
|
const rights = useTableRights(table.data);
|
|
8131
8157
|
const [templates, setTemplates] = useState27(null);
|
|
@@ -8286,7 +8312,7 @@ function ChecklistTemplateEditor({
|
|
|
8286
8312
|
onDone,
|
|
8287
8313
|
className
|
|
8288
8314
|
}) {
|
|
8289
|
-
const client =
|
|
8315
|
+
const client = useRecordsClient16();
|
|
8290
8316
|
const [name, setName] = useState27("");
|
|
8291
8317
|
const [rows, setRows] = useState27([{ ...EMPTY_ROW }]);
|
|
8292
8318
|
const [refusal, setRefusal] = useState27(null);
|
|
@@ -8499,7 +8525,7 @@ var ACTION_KINDS = ["approval", "assignment", "proposal"];
|
|
|
8499
8525
|
var KIND_WORD = WORK_INBOX_KIND_LABEL;
|
|
8500
8526
|
var DUE_WORD2 = DUE_STATE_LABEL;
|
|
8501
8527
|
function ActionInbox({ tableId, includeSettled = false, onOpenRecord, className }) {
|
|
8502
|
-
const client =
|
|
8528
|
+
const client = useRecordsClient17();
|
|
8503
8529
|
const [items, setItems] = useState28(null);
|
|
8504
8530
|
const [error, setError] = useState28(null);
|
|
8505
8531
|
const [outcome, setOutcome] = useState28({});
|
|
@@ -8656,13 +8682,13 @@ function ActionInbox({ tableId, includeSettled = false, onOpenRecord, className
|
|
|
8656
8682
|
import { useCallback as useCallback14, useEffect as useEffect17, useRef as useRef8, useState as useState29 } from "react";
|
|
8657
8683
|
import {
|
|
8658
8684
|
useFields as useFields13,
|
|
8659
|
-
useRecordsClient as
|
|
8685
|
+
useRecordsClient as useRecordsClient18,
|
|
8660
8686
|
useTable as useTable10
|
|
8661
8687
|
} from "@ai-matrx/records/react";
|
|
8662
8688
|
import { Badge as Badge10, Button as Button25, Skeleton as Skeleton11, cn as cn25 } from "@ai-matrx/design-system";
|
|
8663
8689
|
import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
8664
8690
|
function HistoryPanel({ tableId, recordId, onAskAboutField, className }) {
|
|
8665
|
-
const client =
|
|
8691
|
+
const client = useRecordsClient18();
|
|
8666
8692
|
const table = useTable10(tableId);
|
|
8667
8693
|
const fields = useFields13(tableId);
|
|
8668
8694
|
const rights = useTableRights(table.data);
|
|
@@ -8965,13 +8991,13 @@ function say(value, field) {
|
|
|
8965
8991
|
import { useCallback as useCallback15, useEffect as useEffect18, useMemo as useMemo21, useRef as useRef9, useState as useState30 } from "react";
|
|
8966
8992
|
import {
|
|
8967
8993
|
useFields as useFields14,
|
|
8968
|
-
useRecordsClient as
|
|
8994
|
+
useRecordsClient as useRecordsClient19,
|
|
8969
8995
|
useTable as useTable11
|
|
8970
8996
|
} from "@ai-matrx/records/react";
|
|
8971
8997
|
import { Badge as Badge11, Button as Button26, Skeleton as Skeleton12, Textarea, cn as cn26 } from "@ai-matrx/design-system";
|
|
8972
8998
|
import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
8973
8999
|
function CommentThread({ tableId, recordId, fieldKey, className }) {
|
|
8974
|
-
const client =
|
|
9000
|
+
const client = useRecordsClient19();
|
|
8975
9001
|
const table = useTable11(tableId);
|
|
8976
9002
|
const fields = useFields14(tableId);
|
|
8977
9003
|
const host = useRecordsUi();
|
|
@@ -9208,7 +9234,7 @@ function Line({
|
|
|
9208
9234
|
import { useCallback as useCallback16, useEffect as useEffect19, useState as useState31 } from "react";
|
|
9209
9235
|
import {
|
|
9210
9236
|
useFields as useFields15,
|
|
9211
|
-
useRecordsClient as
|
|
9237
|
+
useRecordsClient as useRecordsClient20,
|
|
9212
9238
|
useTable as useTable12
|
|
9213
9239
|
} from "@ai-matrx/records/react";
|
|
9214
9240
|
import { Badge as Badge12, Button as Button27, Skeleton as Skeleton13, cn as cn27 } from "@ai-matrx/design-system";
|
|
@@ -9221,7 +9247,7 @@ function FieldHistoryPanel({
|
|
|
9221
9247
|
onOpenRecord,
|
|
9222
9248
|
className
|
|
9223
9249
|
}) {
|
|
9224
|
-
const client =
|
|
9250
|
+
const client = useRecordsClient20();
|
|
9225
9251
|
const table = useTable12(tableId);
|
|
9226
9252
|
const fields = useFields15(tableId);
|
|
9227
9253
|
const rights = useTableRights(table.data);
|
|
@@ -9434,12 +9460,12 @@ function submissionStamp(args) {
|
|
|
9434
9460
|
|
|
9435
9461
|
// src/PortalBuilder.tsx
|
|
9436
9462
|
import { useCallback as useCallback17, useEffect as useEffect20, useMemo as useMemo22, useState as useState32 } from "react";
|
|
9437
|
-
import { useRecordsClient as
|
|
9463
|
+
import { useRecordsClient as useRecordsClient21, useTables as useTables3 } from "@ai-matrx/records/react";
|
|
9438
9464
|
import { BasicInput as BasicInput9, Button as Button28, Checkbox as Checkbox5, Label as Label5, Separator as Separator9, Skeleton as Skeleton14, cn as cn28 } from "@ai-matrx/design-system";
|
|
9439
9465
|
import { Fragment as Fragment15, jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
9440
9466
|
var RESTATING_REPLACES = "Saving replaces what this portal shows: a table you untick stops being visible to every client the moment you save. Who is invited is not touched.";
|
|
9441
9467
|
function PortalBuilder({ tableId, portalId, onSaved, onClose, className }) {
|
|
9442
|
-
const client =
|
|
9468
|
+
const client = useRecordsClient21();
|
|
9443
9469
|
const tables = useTables3();
|
|
9444
9470
|
const [title, setTitle] = useState32("");
|
|
9445
9471
|
const [clientTableId, setClientTableId] = useState32(null);
|
|
@@ -9729,7 +9755,7 @@ function PortalBuilder({ tableId, portalId, onSaved, onClose, className }) {
|
|
|
9729
9755
|
|
|
9730
9756
|
// src/PortalsPanel.tsx
|
|
9731
9757
|
import { useCallback as useCallback18, useEffect as useEffect21, useMemo as useMemo23, useState as useState33 } from "react";
|
|
9732
|
-
import { useRecordsClient as
|
|
9758
|
+
import { useRecordsClient as useRecordsClient22 } from "@ai-matrx/records/react";
|
|
9733
9759
|
import {
|
|
9734
9760
|
portalPath
|
|
9735
9761
|
} from "@ai-matrx/records";
|
|
@@ -9796,7 +9822,7 @@ function stateWords(person) {
|
|
|
9796
9822
|
}
|
|
9797
9823
|
var PORTAL_SUGGESTION = "Let each of my customers sign in and see their own jobs and invoices, and nothing else.";
|
|
9798
9824
|
function PortalsPanel({ tableId, className }) {
|
|
9799
|
-
const client =
|
|
9825
|
+
const client = useRecordsClient22();
|
|
9800
9826
|
const host = useRecordsUi();
|
|
9801
9827
|
const [portals, setPortals] = useState33(null);
|
|
9802
9828
|
const [exposures, setExposures] = useState33([]);
|
|
@@ -9979,7 +10005,7 @@ function PortalDetail({
|
|
|
9979
10005
|
origin,
|
|
9980
10006
|
onChanged
|
|
9981
10007
|
}) {
|
|
9982
|
-
const client =
|
|
10008
|
+
const client = useRecordsClient22();
|
|
9983
10009
|
const [card, setCard] = useState33(null);
|
|
9984
10010
|
const [error, setError] = useState33(null);
|
|
9985
10011
|
const load = useCallback18(async () => {
|
|
@@ -10222,7 +10248,7 @@ function Preview({
|
|
|
10222
10248
|
] });
|
|
10223
10249
|
}
|
|
10224
10250
|
function Invite({ card, onInvited }) {
|
|
10225
|
-
const client =
|
|
10251
|
+
const client = useRecordsClient22();
|
|
10226
10252
|
const [rows, setRows] = useState33(null);
|
|
10227
10253
|
const [clientTable, setClientTable] = useState33(null);
|
|
10228
10254
|
const [search, setSearch] = useState33("");
|
|
@@ -10334,7 +10360,7 @@ function Invite({ card, onInvited }) {
|
|
|
10334
10360
|
|
|
10335
10361
|
// src/DigestScheduler.tsx
|
|
10336
10362
|
import { useCallback as useCallback19, useEffect as useEffect22, useMemo as useMemo24, useState as useState34 } from "react";
|
|
10337
|
-
import { useRecordsClient as
|
|
10363
|
+
import { useRecordsClient as useRecordsClient23 } from "@ai-matrx/records/react";
|
|
10338
10364
|
import { BasicInput as BasicInput11, Button as Button31, Checkbox as Checkbox6, Label as Label6, Separator as Separator11, Skeleton as Skeleton16, cn as cn31 } from "@ai-matrx/design-system";
|
|
10339
10365
|
import { Fragment as Fragment17, jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
10340
10366
|
var WEEKDAYS = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"];
|
|
@@ -10358,7 +10384,7 @@ function DigestScheduler({
|
|
|
10358
10384
|
onClose,
|
|
10359
10385
|
className
|
|
10360
10386
|
}) {
|
|
10361
|
-
const client =
|
|
10387
|
+
const client = useRecordsClient23();
|
|
10362
10388
|
const host = useRecordsUi();
|
|
10363
10389
|
const [views, setViews] = useState34(null);
|
|
10364
10390
|
const [cadences, setCadences] = useState34([]);
|
|
@@ -10628,7 +10654,7 @@ function DigestScheduler({
|
|
|
10628
10654
|
|
|
10629
10655
|
// src/SubscriptionsPanel.tsx
|
|
10630
10656
|
import { useCallback as useCallback20, useEffect as useEffect23, useState as useState35 } from "react";
|
|
10631
|
-
import { useRecordsClient as
|
|
10657
|
+
import { useRecordsClient as useRecordsClient24 } from "@ai-matrx/records/react";
|
|
10632
10658
|
import { Badge as Badge14, Button as Button32, Skeleton as Skeleton17, Switch as Switch2, cn as cn32 } from "@ai-matrx/design-system";
|
|
10633
10659
|
import { jsx as jsx38, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
10634
10660
|
function whenItFires(subscription) {
|
|
@@ -10639,7 +10665,7 @@ function whenItFires(subscription) {
|
|
|
10639
10665
|
var CHANNEL_WORDS2 = SUBSCRIPTION_CHANNEL_LABEL;
|
|
10640
10666
|
var DIGEST_SUGGESTION = "Email me a summary of this every Monday at 8 in the morning.";
|
|
10641
10667
|
function SubscriptionsPanel({ tableId, className }) {
|
|
10642
|
-
const client =
|
|
10668
|
+
const client = useRecordsClient24();
|
|
10643
10669
|
const [rows, setRows] = useState35(null);
|
|
10644
10670
|
const [error, setError] = useState35(null);
|
|
10645
10671
|
const [busy, setBusy] = useState35(null);
|
|
@@ -10809,7 +10835,7 @@ function SubscriptionsPanel({ tableId, className }) {
|
|
|
10809
10835
|
|
|
10810
10836
|
// src/FormBuilder.tsx
|
|
10811
10837
|
import { useCallback as useCallback22, useEffect as useEffect25, useMemo as useMemo26, useState as useState37 } from "react";
|
|
10812
|
-
import { useFields as useFields17, useRecordsClient as
|
|
10838
|
+
import { useFields as useFields17, useRecordsClient as useRecordsClient25, useTable as useTable13 } from "@ai-matrx/records/react";
|
|
10813
10839
|
import { publicFormPath } from "@ai-matrx/records";
|
|
10814
10840
|
import {
|
|
10815
10841
|
BasicInput as BasicInput12,
|
|
@@ -10823,7 +10849,7 @@ import {
|
|
|
10823
10849
|
|
|
10824
10850
|
// src/FormRunner.tsx
|
|
10825
10851
|
import { useCallback as useCallback21, useEffect as useEffect24, useMemo as useMemo25, useRef as useRef10, useState as useState36 } from "react";
|
|
10826
|
-
import { useFields as useFields16, useOptionalRecordsClient } from "@ai-matrx/records/react";
|
|
10852
|
+
import { useFields as useFields16, useOptionalRecordsClient as useOptionalRecordsClient4 } from "@ai-matrx/records/react";
|
|
10827
10853
|
import { Button as Button33, Progress, Skeleton as Skeleton18, cn as cn33 } from "@ai-matrx/design-system";
|
|
10828
10854
|
import { Fragment as Fragment18, jsx as jsx39, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
10829
10855
|
function FormRunner(props) {
|
|
@@ -10833,7 +10859,7 @@ function FormRunner(props) {
|
|
|
10833
10859
|
return /* @__PURE__ */ jsx39(ConnectedFormRunner, { ...props });
|
|
10834
10860
|
}
|
|
10835
10861
|
function ConnectedFormRunner(props) {
|
|
10836
|
-
const client =
|
|
10862
|
+
const client = useOptionalRecordsClient4();
|
|
10837
10863
|
const fields = useFields16(props.form.subject);
|
|
10838
10864
|
const { form, className } = props;
|
|
10839
10865
|
const submit = useCallback21(
|
|
@@ -11138,7 +11164,7 @@ function whyNotAskable(fields, hidden = []) {
|
|
|
11138
11164
|
// src/FormBuilder.tsx
|
|
11139
11165
|
import { Fragment as Fragment19, jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
11140
11166
|
function FormBuilder({ tableId, seed, activeFormId, onActiveForm, className }) {
|
|
11141
|
-
const client =
|
|
11167
|
+
const client = useRecordsClient25();
|
|
11142
11168
|
const host = useRecordsUi();
|
|
11143
11169
|
const claimSeed = useSeedGuard();
|
|
11144
11170
|
const table = useTable13(tableId);
|
|
@@ -11723,11 +11749,11 @@ function isSignatureField(field) {
|
|
|
11723
11749
|
|
|
11724
11750
|
// src/DocTemplate.tsx
|
|
11725
11751
|
import { useCallback as useCallback23, useEffect as useEffect27, useState as useState39 } from "react";
|
|
11726
|
-
import { useFields as useFields18, useRecordsClient as
|
|
11752
|
+
import { useFields as useFields18, useRecordsClient as useRecordsClient26, useTable as useTable14 } from "@ai-matrx/records/react";
|
|
11727
11753
|
import { BasicInput as BasicInput13, BasicTextarea as BasicTextarea6, Button as Button35, Label as Label8, Skeleton as Skeleton20, cn as cn36 } from "@ai-matrx/design-system";
|
|
11728
11754
|
import { jsx as jsx42, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
11729
11755
|
function DocTemplate({ tableId, seed, activeTemplateId, onActiveTemplate, className }) {
|
|
11730
|
-
const client =
|
|
11756
|
+
const client = useRecordsClient26();
|
|
11731
11757
|
const claimSeed = useSeedGuard();
|
|
11732
11758
|
const table = useTable14(tableId);
|
|
11733
11759
|
const rights = useTableRights(table.data);
|
|
@@ -11902,11 +11928,11 @@ function DocTemplate({ tableId, seed, activeTemplateId, onActiveTemplate, classN
|
|
|
11902
11928
|
|
|
11903
11929
|
// src/DocRender.tsx
|
|
11904
11930
|
import { useCallback as useCallback24, useEffect as useEffect28, useRef as useRef12, useState as useState40 } from "react";
|
|
11905
|
-
import { useRecordsClient as
|
|
11931
|
+
import { useRecordsClient as useRecordsClient27 } from "@ai-matrx/records/react";
|
|
11906
11932
|
import { Button as Button36, Skeleton as Skeleton21, cn as cn37 } from "@ai-matrx/design-system";
|
|
11907
11933
|
import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
11908
11934
|
function DocRender({ templateId, recordId, filename, onRendered, className }) {
|
|
11909
|
-
const client =
|
|
11935
|
+
const client = useRecordsClient27();
|
|
11910
11936
|
const [preview, setPreview] = useState40(null);
|
|
11911
11937
|
const [renders, setRenders] = useState40(null);
|
|
11912
11938
|
const [showing, setShowing] = useState40(null);
|
|
@@ -12015,12 +12041,12 @@ function DocRender({ templateId, recordId, filename, onRendered, className }) {
|
|
|
12015
12041
|
|
|
12016
12042
|
// src/SignBlock.tsx
|
|
12017
12043
|
import { useCallback as useCallback25, useEffect as useEffect29, useState as useState41 } from "react";
|
|
12018
|
-
import { useFields as useFields19, useRecordsClient as
|
|
12044
|
+
import { useFields as useFields19, useRecordsClient as useRecordsClient28 } from "@ai-matrx/records/react";
|
|
12019
12045
|
import { BasicInput as BasicInput14, Button as Button37, Skeleton as Skeleton22, cn as cn38 } from "@ai-matrx/design-system";
|
|
12020
12046
|
import { useTable as useTable15 } from "@ai-matrx/records/react";
|
|
12021
12047
|
import { jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
12022
12048
|
function SignBlock({ tableId, recordId, render, className }) {
|
|
12023
|
-
const client =
|
|
12049
|
+
const client = useRecordsClient28();
|
|
12024
12050
|
const table = useTable15(tableId);
|
|
12025
12051
|
const rights = useTableRights(table.data);
|
|
12026
12052
|
const fields = useFields19(tableId);
|
|
@@ -12152,13 +12178,13 @@ function SignBlock({ tableId, recordId, render, className }) {
|
|
|
12152
12178
|
|
|
12153
12179
|
// src/NotifyRuleEditor.tsx
|
|
12154
12180
|
import { useCallback as useCallback26, useEffect as useEffect30, useState as useState42 } from "react";
|
|
12155
|
-
import { useRecordsClient as
|
|
12181
|
+
import { useRecordsClient as useRecordsClient29, useTable as useTable16 } from "@ai-matrx/records/react";
|
|
12156
12182
|
import { Button as Button38, Skeleton as Skeleton23, cn as cn39 } from "@ai-matrx/design-system";
|
|
12157
12183
|
import { jsx as jsx45, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
12158
12184
|
var CADENCE_WORDS2 = SUBSCRIPTION_CADENCE_LABEL;
|
|
12159
12185
|
var CHANNEL_WORDS3 = SUBSCRIPTION_CHANNEL_LABEL;
|
|
12160
12186
|
function NotifyRuleEditor({ tableId, seed, className }) {
|
|
12161
|
-
const client =
|
|
12187
|
+
const client = useRecordsClient29();
|
|
12162
12188
|
const host = useRecordsUi();
|
|
12163
12189
|
const table = useTable16(tableId);
|
|
12164
12190
|
const rights = useTableRights(table.data);
|
|
@@ -12672,11 +12698,11 @@ function Drawing({
|
|
|
12672
12698
|
|
|
12673
12699
|
// src/DashboardCanvas.tsx
|
|
12674
12700
|
import { useCallback as useCallback27, useEffect as useEffect31, useMemo as useMemo28, useState as useState43 } from "react";
|
|
12675
|
-
import { useFields as useFields20, useRecordsClient as
|
|
12701
|
+
import { useFields as useFields20, useRecordsClient as useRecordsClient30, useTable as useTable17 } from "@ai-matrx/records/react";
|
|
12676
12702
|
import { BasicInput as BasicInput15, Button as Button39, Skeleton as Skeleton24, cn as cn41 } from "@ai-matrx/design-system";
|
|
12677
12703
|
import { Fragment as Fragment21, jsx as jsx47, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
12678
12704
|
function DashboardCanvas({ tableId, activeDashboardId, filter, className }) {
|
|
12679
|
-
const client =
|
|
12705
|
+
const client = useRecordsClient30();
|
|
12680
12706
|
const host = useRecordsUi();
|
|
12681
12707
|
const table = useTable17(tableId);
|
|
12682
12708
|
const rights = useTableRights(table.data);
|
|
@@ -12935,7 +12961,7 @@ function DashboardCanvas({ tableId, activeDashboardId, filter, className }) {
|
|
|
12935
12961
|
|
|
12936
12962
|
// src/FormsPanel.tsx
|
|
12937
12963
|
import { useCallback as useCallback28, useEffect as useEffect32, useState as useState44 } from "react";
|
|
12938
|
-
import { useRecordsClient as
|
|
12964
|
+
import { useRecordsClient as useRecordsClient31, useTable as useTable18 } from "@ai-matrx/records/react";
|
|
12939
12965
|
import { publicFormPath as publicFormPath2 } from "@ai-matrx/records";
|
|
12940
12966
|
import { Badge as Badge15, Button as Button40, Skeleton as Skeleton25, cn as cn42 } from "@ai-matrx/design-system";
|
|
12941
12967
|
import { Fragment as Fragment22, jsx as jsx48, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
@@ -12946,7 +12972,7 @@ function formSuggestion(tableName2) {
|
|
|
12946
12972
|
return `Make me a form that collects new ${subject} entries and tells me when somebody answers.`;
|
|
12947
12973
|
}
|
|
12948
12974
|
function FormsPanel({ tableId, className }) {
|
|
12949
|
-
const client =
|
|
12975
|
+
const client = useRecordsClient31();
|
|
12950
12976
|
const host = useRecordsUi();
|
|
12951
12977
|
const table = useTable18(tableId);
|
|
12952
12978
|
const rights = useTableRights(table.data);
|
|
@@ -13082,7 +13108,7 @@ function FormsPanel({ tableId, className }) {
|
|
|
13082
13108
|
|
|
13083
13109
|
// src/BookingBuilder.tsx
|
|
13084
13110
|
import { useCallback as useCallback29, useEffect as useEffect33, useMemo as useMemo29, useState as useState45 } from "react";
|
|
13085
|
-
import { useFields as useFields21, useRecordsClient as
|
|
13111
|
+
import { useFields as useFields21, useRecordsClient as useRecordsClient32, useTable as useTable19 } from "@ai-matrx/records/react";
|
|
13086
13112
|
import {
|
|
13087
13113
|
bookingPath
|
|
13088
13114
|
} from "@ai-matrx/records";
|
|
@@ -13112,7 +13138,7 @@ function draftWindows(availability) {
|
|
|
13112
13138
|
});
|
|
13113
13139
|
}
|
|
13114
13140
|
function BookingBuilder({ tableId, bookingId, onSaved, onClose, className }) {
|
|
13115
|
-
const client =
|
|
13141
|
+
const client = useRecordsClient32();
|
|
13116
13142
|
const host = useRecordsUi();
|
|
13117
13143
|
const table = useTable19(tableId);
|
|
13118
13144
|
const rights = useTableRights(table.data);
|
|
@@ -13429,7 +13455,7 @@ function BookingBuilder({ tableId, bookingId, onSaved, onClose, className }) {
|
|
|
13429
13455
|
|
|
13430
13456
|
// src/BookingSlots.tsx
|
|
13431
13457
|
import { useCallback as useCallback30, useEffect as useEffect34, useMemo as useMemo30, useState as useState46 } from "react";
|
|
13432
|
-
import { useRecordsClient as
|
|
13458
|
+
import { useRecordsClient as useRecordsClient33, useMyLevels as useMyLevels2 } from "@ai-matrx/records/react";
|
|
13433
13459
|
import { bookingPath as bookingPath2 } from "@ai-matrx/records";
|
|
13434
13460
|
import { Badge as Badge16, Button as Button42, Skeleton as Skeleton27, cn as cn44 } from "@ai-matrx/design-system";
|
|
13435
13461
|
import { Fragment as Fragment24, jsx as jsx50, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
@@ -13441,7 +13467,7 @@ function bookingSuggestion(tableName2) {
|
|
|
13441
13467
|
var NO_ADMIN2 = "Opening a booking page lets people with no account take time in your calendar, so it needs the admin level on the table the appointments land in.";
|
|
13442
13468
|
var STATE_WORDS = BOOKING_PAGE_STATE_LABEL;
|
|
13443
13469
|
function BookingSlots({ tableId, className }) {
|
|
13444
|
-
const client =
|
|
13470
|
+
const client = useRecordsClient33();
|
|
13445
13471
|
const host = useRecordsUi();
|
|
13446
13472
|
const [pages, setPages] = useState46(null);
|
|
13447
13473
|
const [error, setError] = useState46(null);
|
|
@@ -13629,7 +13655,7 @@ function nextInWords(page) {
|
|
|
13629
13655
|
|
|
13630
13656
|
// src/CaptureSheet.tsx
|
|
13631
13657
|
import { useCallback as useCallback32, useEffect as useEffect36, useRef as useRef14, useState as useState48 } from "react";
|
|
13632
|
-
import { useFields as useFields22, useRecordsClient as
|
|
13658
|
+
import { useFields as useFields22, useRecordsClient as useRecordsClient35, useTable as useTable20 } from "@ai-matrx/records/react";
|
|
13633
13659
|
import { Button as Button44, Input as Input4, Skeleton as Skeleton29, Textarea as Textarea3, cn as cn46 } from "@ai-matrx/design-system";
|
|
13634
13660
|
|
|
13635
13661
|
// src/CaptureRun.tsx
|
|
@@ -13639,7 +13665,7 @@ import {
|
|
|
13639
13665
|
coercionLabel,
|
|
13640
13666
|
openCaptureQueue
|
|
13641
13667
|
} from "@ai-matrx/records";
|
|
13642
|
-
import { useRecordsClient as
|
|
13668
|
+
import { useRecordsClient as useRecordsClient34 } from "@ai-matrx/records/react";
|
|
13643
13669
|
import { Button as Button43, Input as Input3, Skeleton as Skeleton28, Textarea as Textarea2, cn as cn45 } from "@ai-matrx/design-system";
|
|
13644
13670
|
import { jsx as jsx51, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
13645
13671
|
function controlFor(field) {
|
|
@@ -13678,7 +13704,7 @@ function whereWeAre(timeoutMs = 4e3) {
|
|
|
13678
13704
|
});
|
|
13679
13705
|
}
|
|
13680
13706
|
function CaptureRun({ sheetId, face: given, className }) {
|
|
13681
|
-
const client =
|
|
13707
|
+
const client = useRecordsClient34();
|
|
13682
13708
|
const host = useRecordsUi();
|
|
13683
13709
|
const [face, setFace] = useState47(given);
|
|
13684
13710
|
const [loadFailed, setLoadFailed] = useState47(null);
|
|
@@ -14040,7 +14066,7 @@ function AdHocCaptureSheet({
|
|
|
14040
14066
|
attachmentField,
|
|
14041
14067
|
className
|
|
14042
14068
|
}) {
|
|
14043
|
-
const client =
|
|
14069
|
+
const client = useRecordsClient35();
|
|
14044
14070
|
const host = useRecordsUi();
|
|
14045
14071
|
const table = useTable20(tableId);
|
|
14046
14072
|
const fields = useFields22(tableId);
|
|
@@ -14242,11 +14268,11 @@ function AdHocCaptureSheet({
|
|
|
14242
14268
|
|
|
14243
14269
|
// src/PortalShell.tsx
|
|
14244
14270
|
import { useCallback as useCallback33, useEffect as useEffect37, useState as useState49 } from "react";
|
|
14245
|
-
import { useRecordsClient as
|
|
14271
|
+
import { useRecordsClient as useRecordsClient36 } from "@ai-matrx/records/react";
|
|
14246
14272
|
import { Button as Button45, Skeleton as Skeleton30, cn as cn47 } from "@ai-matrx/design-system";
|
|
14247
14273
|
import { jsx as jsx53, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
14248
14274
|
function PortalShell({ tableId, form, resourceType = "record", className }) {
|
|
14249
|
-
const client =
|
|
14275
|
+
const client = useRecordsClient36();
|
|
14250
14276
|
const [card, setCard] = useState49(null);
|
|
14251
14277
|
const [reach, setReach] = useState49(null);
|
|
14252
14278
|
const [error, setError] = useState49(null);
|
|
@@ -14325,7 +14351,7 @@ function PortalShell({ tableId, form, resourceType = "record", className }) {
|
|
|
14325
14351
|
] });
|
|
14326
14352
|
}
|
|
14327
14353
|
function PortalRow({ tableId, recordId }) {
|
|
14328
|
-
const client =
|
|
14354
|
+
const client = useRecordsClient36();
|
|
14329
14355
|
const [title, setTitle] = useState49(null);
|
|
14330
14356
|
useEffect37(() => {
|
|
14331
14357
|
let cancelled = false;
|
|
@@ -14348,11 +14374,11 @@ function PortalRow({ tableId, recordId }) {
|
|
|
14348
14374
|
|
|
14349
14375
|
// src/PublicViewPage.tsx
|
|
14350
14376
|
import { useCallback as useCallback34, useEffect as useEffect38, useState as useState50 } from "react";
|
|
14351
|
-
import { useRecordsClient as
|
|
14377
|
+
import { useRecordsClient as useRecordsClient37 } from "@ai-matrx/records/react";
|
|
14352
14378
|
import { Skeleton as Skeleton31, cn as cn48 } from "@ai-matrx/design-system";
|
|
14353
14379
|
import { jsx as jsx54, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
14354
14380
|
function PublicViewPage({ slug, className }) {
|
|
14355
|
-
const client =
|
|
14381
|
+
const client = useRecordsClient37();
|
|
14356
14382
|
const [binding, setBinding] = useState50(null);
|
|
14357
14383
|
const [rows, setRows] = useState50(null);
|
|
14358
14384
|
const [fields, setFields] = useState50(null);
|
|
@@ -14429,7 +14455,7 @@ function PublicRow({ row, fields }) {
|
|
|
14429
14455
|
|
|
14430
14456
|
// src/EmbedFrame.tsx
|
|
14431
14457
|
import { useCallback as useCallback35, useEffect as useEffect39, useState as useState51 } from "react";
|
|
14432
|
-
import { useRecordsClient as
|
|
14458
|
+
import { useRecordsClient as useRecordsClient38 } from "@ai-matrx/records/react";
|
|
14433
14459
|
import { Button as Button46, Input as Input5, Skeleton as Skeleton32, Textarea as Textarea4, cn as cn49 } from "@ai-matrx/design-system";
|
|
14434
14460
|
import { useTable as useTable21 } from "@ai-matrx/records/react";
|
|
14435
14461
|
import { Fragment as Fragment26, jsx as jsx55, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
@@ -14441,7 +14467,7 @@ function EmbedFrame({
|
|
|
14441
14467
|
embedUrl,
|
|
14442
14468
|
className
|
|
14443
14469
|
}) {
|
|
14444
|
-
const client =
|
|
14470
|
+
const client = useRecordsClient38();
|
|
14445
14471
|
const host = useRecordsUi();
|
|
14446
14472
|
const table = useTable21(tableId);
|
|
14447
14473
|
const rights = useTableRights(table.data);
|
|
@@ -14535,7 +14561,7 @@ function EmbedFrame({
|
|
|
14535
14561
|
] });
|
|
14536
14562
|
}
|
|
14537
14563
|
function useEmbedHandshake(args) {
|
|
14538
|
-
const client =
|
|
14564
|
+
const client = useRecordsClient38();
|
|
14539
14565
|
const [binding, setBinding] = useState51(null);
|
|
14540
14566
|
const [error, setError] = useState51(null);
|
|
14541
14567
|
const [loading, setLoading] = useState51(true);
|
|
@@ -14597,7 +14623,7 @@ function recordsDataSource(client, fallbackSchema = "custom") {
|
|
|
14597
14623
|
|
|
14598
14624
|
// src/TablesHome.tsx
|
|
14599
14625
|
import { useCallback as useCallback36, useEffect as useEffect40, useState as useState52 } from "react";
|
|
14600
|
-
import { useRecordsClient as
|
|
14626
|
+
import { useRecordsClient as useRecordsClient39, useTables as useTables4 } from "@ai-matrx/records/react";
|
|
14601
14627
|
import { BasicInput as BasicInput17, Button as Button47, Skeleton as Skeleton33, cn as cn50 } from "@ai-matrx/design-system";
|
|
14602
14628
|
|
|
14603
14629
|
// src/createTable.ts
|
|
@@ -14733,7 +14759,7 @@ function laneFor(table) {
|
|
|
14733
14759
|
return "organization";
|
|
14734
14760
|
}
|
|
14735
14761
|
function TablesHome({ onOpenTable, className }) {
|
|
14736
|
-
const client =
|
|
14762
|
+
const client = useRecordsClient39();
|
|
14737
14763
|
const tables = useTables4();
|
|
14738
14764
|
const [creating, setCreating] = useState52(false);
|
|
14739
14765
|
const [name, setName] = useState52("");
|
|
@@ -14876,7 +14902,7 @@ function TablesHome({ onOpenTable, className }) {
|
|
|
14876
14902
|
|
|
14877
14903
|
// src/TablePage.tsx
|
|
14878
14904
|
import { useCallback as useCallback37, useEffect as useEffect41, useState as useState53 } from "react";
|
|
14879
|
-
import { useFields as useFields23, useRecordsClient as
|
|
14905
|
+
import { useFields as useFields23, useRecordsClient as useRecordsClient40, useTable as useTable22 } from "@ai-matrx/records/react";
|
|
14880
14906
|
import { Button as Button48, Separator as Separator12, Skeleton as Skeleton34, cn as cn51 } from "@ai-matrx/design-system";
|
|
14881
14907
|
import { Fragment as Fragment28, jsx as jsx58, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
14882
14908
|
function filterInWords(filter, fields) {
|
|
@@ -14957,12 +14983,12 @@ function TablePage({
|
|
|
14957
14983
|
filter,
|
|
14958
14984
|
className
|
|
14959
14985
|
}) {
|
|
14960
|
-
const client =
|
|
14986
|
+
const client = useRecordsClient40();
|
|
14961
14987
|
const table = useTable22(tableId);
|
|
14962
14988
|
const rights = useTableRights(table.data);
|
|
14963
14989
|
const pageFields = useFields23(filter ? tableId : null);
|
|
14964
14990
|
const askedInWords = filter ? filterInWords(filter, pageFields.data ?? []) : null;
|
|
14965
|
-
const organizationId =
|
|
14991
|
+
const organizationId = useRecordsClient40().config.organizationId;
|
|
14966
14992
|
const [view, setView] = useState53(null);
|
|
14967
14993
|
const opening = openingRail(activeRecordId);
|
|
14968
14994
|
const opened = openingView(activeView, activeDashboardId);
|