@arbidocs/blocks 0.4.79 → 0.4.81
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/dist/agents/index.cjs +278 -278
- package/dist/agents/index.js +3 -3
- package/dist/agents/workflows/StepBarFrame.d.ts +8 -2
- package/dist/agents/workflows/WorkflowRunner.d.ts +35 -3
- package/dist/agents/workflows/run.d.ts +10 -0
- package/dist/agents/workflows/stepWindow.d.ts +7 -0
- package/dist/agents/workflows/types.d.ts +4 -2
- package/dist/{chunk-5XVWGJ2H.cjs → chunk-B3WCKBJ7.cjs} +3 -3
- package/dist/{chunk-5XVWGJ2H.cjs.map → chunk-B3WCKBJ7.cjs.map} +1 -1
- package/dist/{chunk-YGUKTFKW.cjs → chunk-BX7JWZWE.cjs} +122 -14
- package/dist/chunk-BX7JWZWE.cjs.map +1 -0
- package/dist/{chunk-3YET6D5E.cjs → chunk-F5WIETZY.cjs} +58 -43
- package/dist/chunk-F5WIETZY.cjs.map +1 -0
- package/dist/{chunk-O35LRB3P.js → chunk-GJV2G4FC.js} +3 -3
- package/dist/{chunk-O35LRB3P.js.map → chunk-GJV2G4FC.js.map} +1 -1
- package/dist/{chunk-BMOL5DN6.js → chunk-I56ORHPY.js} +27 -12
- package/dist/chunk-I56ORHPY.js.map +1 -0
- package/dist/{chunk-CWAZNXC5.js → chunk-SWSVPQNB.js} +30 -8
- package/dist/chunk-SWSVPQNB.js.map +1 -0
- package/dist/{chunk-6GXF62XN.js → chunk-THCFZKTM.js} +118 -15
- package/dist/chunk-THCFZKTM.js.map +1 -0
- package/dist/{chunk-MLAHDAN5.cjs → chunk-UA2AMDR6.cjs} +30 -8
- package/dist/chunk-UA2AMDR6.cjs.map +1 -0
- package/dist/connect/index.cjs +145 -62
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -1
- package/dist/connect/index.js +106 -23
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectedWorkflowRunner.d.ts +30 -4
- package/dist/files/index.cjs +2 -2
- package/dist/files/index.js +2 -2
- package/dist/index.cjs +467 -467
- package/dist/index.js +7 -7
- package/dist/settings/index.cjs +35 -35
- package/dist/settings/index.js +3 -3
- package/dist/workflow-canvas/index.cjs +46 -46
- package/dist/workflow-canvas/index.js +3 -3
- package/dist/workspaces/index.cjs +1 -1
- package/dist/workspaces/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-3YET6D5E.cjs.map +0 -1
- package/dist/chunk-6GXF62XN.js.map +0 -1
- package/dist/chunk-BMOL5DN6.js.map +0 -1
- package/dist/chunk-CWAZNXC5.js.map +0 -1
- package/dist/chunk-MLAHDAN5.cjs.map +0 -1
- package/dist/chunk-YGUKTFKW.cjs.map +0 -1
package/dist/connect/index.cjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkB3WCKBJ7_cjs = require('../chunk-B3WCKBJ7.cjs');
|
|
5
5
|
var chunkXMBYDLZQ_cjs = require('../chunk-XMBYDLZQ.cjs');
|
|
6
6
|
var chunkTZR36PPP_cjs = require('../chunk-TZR36PPP.cjs');
|
|
7
7
|
var chunkMUMH3Z6K_cjs = require('../chunk-MUMH3Z6K.cjs');
|
|
8
8
|
var chunkZVBPRMHJ_cjs = require('../chunk-ZVBPRMHJ.cjs');
|
|
9
9
|
require('../chunk-7YUFMNFW.cjs');
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var chunkUA2AMDR6_cjs = require('../chunk-UA2AMDR6.cjs');
|
|
11
|
+
var chunkQVBZESYQ_cjs = require('../chunk-QVBZESYQ.cjs');
|
|
12
|
+
var chunkBX7JWZWE_cjs = require('../chunk-BX7JWZWE.cjs');
|
|
12
13
|
require('../chunk-DETZZBG2.cjs');
|
|
13
14
|
require('../chunk-7D737FLE.cjs');
|
|
14
|
-
var chunkQVBZESYQ_cjs = require('../chunk-QVBZESYQ.cjs');
|
|
15
15
|
require('../chunk-ADOKTJHV.cjs');
|
|
16
|
-
var chunkULWRNGGE_cjs = require('../chunk-ULWRNGGE.cjs');
|
|
17
16
|
var chunkMP6FK43E_cjs = require('../chunk-MP6FK43E.cjs');
|
|
18
17
|
require('../chunk-VGOFFCMT.cjs');
|
|
19
18
|
require('../chunk-B4SRYJLM.cjs');
|
|
20
19
|
require('../chunk-7UTB4PHM.cjs');
|
|
21
20
|
require('../chunk-PPCATBOY.cjs');
|
|
22
21
|
var chunkKDG6FER6_cjs = require('../chunk-KDG6FER6.cjs');
|
|
22
|
+
var chunkULWRNGGE_cjs = require('../chunk-ULWRNGGE.cjs');
|
|
23
23
|
require('../chunk-MHVNT4J3.cjs');
|
|
24
24
|
require('../chunk-DES3K4SD.cjs');
|
|
25
25
|
var react = require('react');
|
|
@@ -190,7 +190,7 @@ function StreamedArtifact({
|
|
|
190
190
|
}
|
|
191
191
|
var STARTING = /* @__PURE__ */ new Set(["pending", "running"]);
|
|
192
192
|
function formValues(step, inputs) {
|
|
193
|
-
const fields =
|
|
193
|
+
const fields = chunkBX7JWZWE_cjs.stepFields(step);
|
|
194
194
|
if (!fields.length) return void 0;
|
|
195
195
|
if (step.kind === "form")
|
|
196
196
|
return Object.fromEntries(fields.map((f) => [f.name, inputs[f.name] ?? ""]));
|
|
@@ -228,7 +228,7 @@ function useWorkflowThread(workflow, options = {}) {
|
|
|
228
228
|
const { wsId } = chunkXMBYDLZQ_cjs.useWorkspaceDocs();
|
|
229
229
|
const [threadId, setThreadId] = react.useState(options.conversationId);
|
|
230
230
|
const [localInputs, setLocalInputs] = react.useState(
|
|
231
|
-
() =>
|
|
231
|
+
() => chunkBX7JWZWE_cjs.initialRunInputs(workflow, options.initialInputs)
|
|
232
232
|
);
|
|
233
233
|
const [edits, setEdits] = react.useState({});
|
|
234
234
|
const [localStates, setLocalStates] = react.useState({});
|
|
@@ -248,12 +248,12 @@ function useWorkflowThread(workflow, options = {}) {
|
|
|
248
248
|
);
|
|
249
249
|
const conversation = conversations.data?.find((c) => c.external_id === threadId);
|
|
250
250
|
const steps = react.useMemo(
|
|
251
|
-
() =>
|
|
251
|
+
() => chunkBX7JWZWE_cjs.workflowSteps(workflow).length > 0 ? chunkBX7JWZWE_cjs.workflowSteps(workflow) : chunkBX7JWZWE_cjs.fromPlanSteps(conversation?.plan?.steps ?? []),
|
|
252
252
|
[workflow, conversation?.plan?.steps]
|
|
253
253
|
);
|
|
254
254
|
const activity = react$1.useConversationActivity(threadId, { live: !!threadId });
|
|
255
255
|
const serverStates = react.useMemo(
|
|
256
|
-
() =>
|
|
256
|
+
() => chunkBX7JWZWE_cjs.stepStatesFromActivity(activity.data ?? []),
|
|
257
257
|
[activity.data]
|
|
258
258
|
);
|
|
259
259
|
const working = steps.some(
|
|
@@ -305,7 +305,7 @@ function useWorkflowThread(workflow, options = {}) {
|
|
|
305
305
|
if (!id) {
|
|
306
306
|
await ensureWorkspaceOpen();
|
|
307
307
|
const created = await createWork.mutateAsync({
|
|
308
|
-
title:
|
|
308
|
+
title: chunkBX7JWZWE_cjs.runThreadTitle(workflow, values).slice(0, 60),
|
|
309
309
|
description: workflow.description || null,
|
|
310
310
|
prompt: null,
|
|
311
311
|
skill_ref: null,
|
|
@@ -317,7 +317,7 @@ function useWorkflowThread(workflow, options = {}) {
|
|
|
317
317
|
criteria: [],
|
|
318
318
|
max_passes: 3,
|
|
319
319
|
documents: [],
|
|
320
|
-
steps:
|
|
320
|
+
steps: chunkBX7JWZWE_cjs.toPlanSteps(workflow, {
|
|
321
321
|
inputs: values,
|
|
322
322
|
resolveWorkflow: options.resolveWorkflow,
|
|
323
323
|
compose: options.compose
|
|
@@ -372,7 +372,7 @@ function useWorkflowThread(workflow, options = {}) {
|
|
|
372
372
|
[threadId, act]
|
|
373
373
|
);
|
|
374
374
|
const loaded = !options.conversationId || activity.isSuccess || activity.isError;
|
|
375
|
-
const view =
|
|
375
|
+
const view = chunkBX7JWZWE_cjs.useWorkflowView({
|
|
376
376
|
steps,
|
|
377
377
|
states,
|
|
378
378
|
inputs,
|
|
@@ -444,7 +444,7 @@ function WorkflowSignDialog({
|
|
|
444
444
|
const arbi = react$1.useArbi();
|
|
445
445
|
const { user, ensureWorkspaceOpen } = chunkMUMH3Z6K_cjs.useConnection();
|
|
446
446
|
const tools = documentTools.useOptionalDocumentTools();
|
|
447
|
-
const { id, version } =
|
|
447
|
+
const { id, version } = chunkBX7JWZWE_cjs.splitDocRef(docRef);
|
|
448
448
|
const [pdf, setPdf] = react.useState(null);
|
|
449
449
|
const [failed, setFailed] = react.useState(false);
|
|
450
450
|
react.useEffect(() => {
|
|
@@ -496,7 +496,7 @@ function WorkflowWordDialog({
|
|
|
496
496
|
onClose,
|
|
497
497
|
labels
|
|
498
498
|
}) {
|
|
499
|
-
const { id } =
|
|
499
|
+
const { id } = chunkBX7JWZWE_cjs.splitDocRef(docRef);
|
|
500
500
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
501
501
|
chunkULWRNGGE_cjs.ModalScaffold,
|
|
502
502
|
{
|
|
@@ -593,11 +593,13 @@ function ConnectedWorkflowRunner({
|
|
|
593
593
|
emptyHint,
|
|
594
594
|
connectedLabels,
|
|
595
595
|
onOpenDocument,
|
|
596
|
+
onOpenCitation,
|
|
596
597
|
onOpenDraft,
|
|
597
598
|
onOpenMessage,
|
|
598
599
|
actions: hostActions,
|
|
599
600
|
dialogLabels,
|
|
600
601
|
layout = "thread",
|
|
602
|
+
fileFilter,
|
|
601
603
|
testIdPrefix = "workflow-run",
|
|
602
604
|
...runnerProps
|
|
603
605
|
}) {
|
|
@@ -607,8 +609,9 @@ function ConnectedWorkflowRunner({
|
|
|
607
609
|
const { ensureWorkspaceOpen, user } = chunkMUMH3Z6K_cjs.useConnection();
|
|
608
610
|
const { wsId } = chunkXMBYDLZQ_cjs.useWorkspaceDocs();
|
|
609
611
|
const { data: docs = [], refetch } = react$1.useDocuments(wsId);
|
|
610
|
-
const [
|
|
612
|
+
const [sending, setSending] = react.useState([]);
|
|
611
613
|
const [added, setAdded] = react.useState({});
|
|
614
|
+
const [addedNames, setAddedNames] = react.useState({});
|
|
612
615
|
const addedRef = react.useRef(added);
|
|
613
616
|
addedRef.current = added;
|
|
614
617
|
const { view, conversationId, people } = useWorkflowThread(workflow, {
|
|
@@ -627,7 +630,7 @@ function ConnectedWorkflowRunner({
|
|
|
627
630
|
() => ({
|
|
628
631
|
me: user?.externalId,
|
|
629
632
|
openDocument: onOpenDocument && ((ref) => {
|
|
630
|
-
const { id, version } =
|
|
633
|
+
const { id, version } = chunkBX7JWZWE_cjs.splitDocRef(ref);
|
|
631
634
|
onOpenDocument(id, version);
|
|
632
635
|
}),
|
|
633
636
|
openDraft: onOpenDraft && ((draftId) => onOpenDraft(draftId)),
|
|
@@ -637,34 +640,91 @@ function ConnectedWorkflowRunner({
|
|
|
637
640
|
const w = state.waiting;
|
|
638
641
|
if (w?.doc_ext_id) setDialog({ kind: "sign", docRef: w.doc_ext_id });
|
|
639
642
|
}),
|
|
640
|
-
openRedline: hostActions?.openRedline ?? ((ref) => setDialog({ kind: "word", docRef: ref, title: nameOfDoc(
|
|
643
|
+
openRedline: hostActions?.openRedline ?? ((ref) => setDialog({ kind: "word", docRef: ref, title: nameOfDoc(chunkBX7JWZWE_cjs.splitDocRef(ref).id) ?? "" })),
|
|
641
644
|
openReview: hostActions?.openReview ?? ((tags, documents) => setDialog({ kind: "review", tags, documents }))
|
|
642
645
|
}),
|
|
643
646
|
[user?.externalId, onOpenDocument, onOpenDraft, onOpenMessage, hostActions, nameOfDoc, inThread]
|
|
644
647
|
);
|
|
645
|
-
const
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
648
|
+
const openCitation = react.useMemo(
|
|
649
|
+
() => onOpenCitation ?? (onOpenDocument && ((t) => {
|
|
650
|
+
const docId = t.documentId ?? t.passage?.documentId;
|
|
651
|
+
if (docId) onOpenDocument(docId, void 0, t.page ?? t.passage?.page ?? void 0);
|
|
652
|
+
})),
|
|
653
|
+
[onOpenCitation, onOpenDocument]
|
|
654
|
+
);
|
|
655
|
+
const uploadSeq = react.useRef(0);
|
|
656
|
+
const sendingRef = react.useRef(sending);
|
|
657
|
+
sendingRef.current = sending;
|
|
658
|
+
const send = react.useCallback(
|
|
659
|
+
async (batch) => {
|
|
660
|
+
if (!batch.length) return;
|
|
661
|
+
const keys = new Set(batch.map((p) => p.key));
|
|
662
|
+
const mark = (key, patch) => setSending(
|
|
663
|
+
(all) => patch === null ? all.filter((p) => p.key !== key) : all.map((p) => p.key === key ? { ...p, ...patch } : p)
|
|
664
|
+
);
|
|
665
|
+
setSending((all) => [
|
|
666
|
+
...all.filter((p) => !keys.has(p.key)),
|
|
667
|
+
...batch.map((p) => ({ ...p, status: "uploading", error: void 0 }))
|
|
668
|
+
]);
|
|
649
669
|
try {
|
|
650
670
|
await ensureWorkspaceOpen();
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
671
|
+
} catch (e) {
|
|
672
|
+
for (const p of batch) mark(p.key, { status: "failed", error: uploadError(e) });
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
for (const p of batch) {
|
|
676
|
+
try {
|
|
677
|
+
const { doc_ext_ids = [] } = await arbi.documents.uploadFile(p.file, p.file.name) ?? {};
|
|
678
|
+
if (!doc_ext_ids.length) throw new Error("No document came back");
|
|
679
|
+
setAdded((a) => ({
|
|
680
|
+
...a,
|
|
681
|
+
...Object.fromEntries(doc_ext_ids.map((id) => [id, p.stepId]))
|
|
682
|
+
}));
|
|
683
|
+
setAddedNames((n) => ({
|
|
684
|
+
...n,
|
|
685
|
+
...Object.fromEntries(doc_ext_ids.map((id) => [id, p.file.name]))
|
|
686
|
+
}));
|
|
687
|
+
mark(p.key, null);
|
|
688
|
+
} catch (e) {
|
|
689
|
+
mark(p.key, { status: "failed", error: uploadError(e) });
|
|
654
690
|
}
|
|
655
|
-
await refetch();
|
|
656
|
-
} finally {
|
|
657
|
-
setUploading(false);
|
|
658
691
|
}
|
|
692
|
+
await refetch();
|
|
659
693
|
},
|
|
660
694
|
[arbi, ensureWorkspaceOpen, refetch]
|
|
661
695
|
);
|
|
662
|
-
const
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
696
|
+
const onUpload = react.useCallback(
|
|
697
|
+
(files2, step) => send(
|
|
698
|
+
files2.map((file) => ({
|
|
699
|
+
key: `upload-${++uploadSeq.current}`,
|
|
700
|
+
file,
|
|
701
|
+
stepId: step.id,
|
|
702
|
+
status: "uploading"
|
|
703
|
+
}))
|
|
704
|
+
),
|
|
705
|
+
[send]
|
|
706
|
+
);
|
|
707
|
+
const onRetryUpload = react.useCallback(
|
|
708
|
+
(file) => {
|
|
709
|
+
const p = sendingRef.current.find((x) => x.key === file.id);
|
|
710
|
+
if (p) void send([p]);
|
|
711
|
+
},
|
|
712
|
+
[send]
|
|
713
|
+
);
|
|
714
|
+
const onRemoveUpload = react.useCallback(
|
|
715
|
+
(file) => setSending((all) => all.filter((p) => p.key !== file.id)),
|
|
716
|
+
[]
|
|
717
|
+
);
|
|
718
|
+
const files = [
|
|
719
|
+
...sending.map((p) => ({
|
|
720
|
+
id: p.key,
|
|
721
|
+
name: p.file.name,
|
|
722
|
+
status: p.status === "failed" ? "upload-failed" : "uploading",
|
|
723
|
+
error: p.error,
|
|
724
|
+
addedFor: p.stepId
|
|
725
|
+
})),
|
|
726
|
+
...runnerFiles(docs, added, fileFilter, addedNames)
|
|
727
|
+
];
|
|
668
728
|
const reading = files.some((f) => f.addedFor && f.status === "processing");
|
|
669
729
|
react.useEffect(() => {
|
|
670
730
|
if (!reading) return;
|
|
@@ -716,7 +776,7 @@ function ConnectedWorkflowRunner({
|
|
|
716
776
|
);
|
|
717
777
|
};
|
|
718
778
|
const runner = (compact) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
719
|
-
|
|
779
|
+
chunkBX7JWZWE_cjs.WorkflowRunner,
|
|
720
780
|
{
|
|
721
781
|
people,
|
|
722
782
|
...runnerProps,
|
|
@@ -733,8 +793,10 @@ function ConnectedWorkflowRunner({
|
|
|
733
793
|
}
|
|
734
794
|
) : null,
|
|
735
795
|
onUpload,
|
|
736
|
-
uploading,
|
|
796
|
+
uploading: sending.some((p) => p.status === "uploading"),
|
|
737
797
|
files,
|
|
798
|
+
onRetryUpload,
|
|
799
|
+
onRemoveUpload,
|
|
738
800
|
actions,
|
|
739
801
|
nameOfDoc,
|
|
740
802
|
testIdPrefix,
|
|
@@ -760,10 +822,10 @@ function ConnectedWorkflowRunner({
|
|
|
760
822
|
) }),
|
|
761
823
|
inThread && conversationId ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
762
824
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
763
|
-
|
|
825
|
+
chunkBX7JWZWE_cjs.WorkflowStepBar,
|
|
764
826
|
{
|
|
765
827
|
run: view,
|
|
766
|
-
levels:
|
|
828
|
+
levels: chunkBX7JWZWE_cjs.stepLevels(view.steps),
|
|
767
829
|
doneTitle: (workflow.run.kind === "steps" ? workflow.run.completion?.title : void 0) ?? runnerProps.labels?.complete ?? "Done",
|
|
768
830
|
icon: (key) => key && runnerProps.renderIcon ? runnerProps.renderIcon(key) : void 0,
|
|
769
831
|
tid: (suffix) => `${testIdPrefix}-${suffix}`
|
|
@@ -776,6 +838,7 @@ function ConnectedWorkflowRunner({
|
|
|
776
838
|
workspaceId: wsId,
|
|
777
839
|
stepTitle: (id) => view.steps.find((s) => s.id === id)?.title,
|
|
778
840
|
targetMessageId: target,
|
|
841
|
+
onOpenCitation: openCitation,
|
|
779
842
|
labels: { workflows: l.currentStep },
|
|
780
843
|
aside: runner(true)
|
|
781
844
|
}
|
|
@@ -804,6 +867,26 @@ function ConnectedWorkflowRunner({
|
|
|
804
867
|
] });
|
|
805
868
|
}
|
|
806
869
|
var READ_POLL_MS = 3e3;
|
|
870
|
+
function uploadError(e) {
|
|
871
|
+
return e instanceof Error && e.message ? e.message : String(e || "Upload failed");
|
|
872
|
+
}
|
|
873
|
+
function runnerFiles(docs, added, fileFilter, names = {}) {
|
|
874
|
+
const listed = new Set(docs.map((d) => d.external_id));
|
|
875
|
+
return [
|
|
876
|
+
...docs.filter((d) => !fileFilter || added[d.external_id] || fileFilter(d)).map((d) => ({
|
|
877
|
+
id: d.external_id,
|
|
878
|
+
name: d.file_name ?? d.external_id,
|
|
879
|
+
status: fileStatus(d.status),
|
|
880
|
+
addedFor: added[d.external_id]
|
|
881
|
+
})),
|
|
882
|
+
...Object.entries(added).filter(([id]) => !listed.has(id)).map(([id, stepId]) => ({
|
|
883
|
+
id,
|
|
884
|
+
name: names[id] ?? id,
|
|
885
|
+
status: "processing",
|
|
886
|
+
addedFor: stepId
|
|
887
|
+
}))
|
|
888
|
+
];
|
|
889
|
+
}
|
|
807
890
|
function fileStatus(status) {
|
|
808
891
|
const s = status?.toLowerCase();
|
|
809
892
|
if (!s) return void 0;
|
|
@@ -900,7 +983,7 @@ function ConnectedTagMatrix({
|
|
|
900
983
|
const fail = (e) => setError(e instanceof Error ? e.message : String(e));
|
|
901
984
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
902
985
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
903
|
-
|
|
986
|
+
chunkUA2AMDR6_cjs.TagMatrix,
|
|
904
987
|
{
|
|
905
988
|
...props,
|
|
906
989
|
matrix: matrix.data,
|
|
@@ -926,7 +1009,7 @@ function ConnectedTagMatrix({
|
|
|
926
1009
|
const data = matrix.data;
|
|
927
1010
|
if (!data) return;
|
|
928
1011
|
const title = exportTitle ?? data.parent?.name ?? "Matrix";
|
|
929
|
-
const markdown =
|
|
1012
|
+
const markdown = chunkUA2AMDR6_cjs.tagMatrixMarkdown(data, {
|
|
930
1013
|
title,
|
|
931
1014
|
nameOf: (id2) => people.find((p) => p.value === id2)?.label
|
|
932
1015
|
});
|
|
@@ -1020,12 +1103,12 @@ function ConnectedProfileCard({ notify: notify3, title = "Profile" }) {
|
|
|
1020
1103
|
}
|
|
1021
1104
|
});
|
|
1022
1105
|
const display = profile?.fullName || user?.name || "Unnamed";
|
|
1023
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1024
|
-
|
|
1106
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkB3WCKBJ7_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserCircle, {}), title, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1107
|
+
chunkB3WCKBJ7_cjs.ProfileCard,
|
|
1025
1108
|
{
|
|
1026
1109
|
avatar: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1027
1110
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1028
|
-
|
|
1111
|
+
chunkB3WCKBJ7_cjs.AvatarPicker,
|
|
1029
1112
|
{
|
|
1030
1113
|
pictureUrl: profile?.picture ?? user?.picture,
|
|
1031
1114
|
initials: chunkKDG6FER6_cjs.initials(display),
|
|
@@ -1067,9 +1150,9 @@ function ConnectedIdentityVerification({
|
|
|
1067
1150
|
onNameAccepted: () => notify3?.("Name updated to match your ID", "success")
|
|
1068
1151
|
});
|
|
1069
1152
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1070
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1153
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkB3WCKBJ7_cjs.IdentityVerificationCard, { flow, labels }),
|
|
1071
1154
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1072
|
-
|
|
1155
|
+
chunkB3WCKBJ7_cjs.IdentityVerificationDialog,
|
|
1073
1156
|
{
|
|
1074
1157
|
flow,
|
|
1075
1158
|
accountName: profile?.fullName ?? "",
|
|
@@ -1081,7 +1164,7 @@ function ConnectedIdentityVerification({
|
|
|
1081
1164
|
function ConnectedRequireVerified({ children, labels }) {
|
|
1082
1165
|
const { data: profile } = react$1.useProfile();
|
|
1083
1166
|
const flow = react$1.useIdentityVerification();
|
|
1084
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1167
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkB3WCKBJ7_cjs.RequireVerified, { flow, accountName: profile?.fullName ?? "", labels, children });
|
|
1085
1168
|
}
|
|
1086
1169
|
function defaultUnmetPasswordRequirement(password) {
|
|
1087
1170
|
if (password.length < 8) return "Minimum 8 characters";
|
|
@@ -1110,10 +1193,10 @@ function ConnectedSecuritySection({
|
|
|
1110
1193
|
},
|
|
1111
1194
|
onClose: () => setOpen(false)
|
|
1112
1195
|
});
|
|
1113
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1114
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1196
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(chunkB3WCKBJ7_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.KeyRound, {}), title: "Security", children: [
|
|
1197
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkB3WCKBJ7_cjs.SettingsCard, { padding: "sm", children: [
|
|
1115
1198
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1116
|
-
|
|
1199
|
+
chunkB3WCKBJ7_cjs.SettingsActionRow,
|
|
1117
1200
|
{
|
|
1118
1201
|
title: "Change password",
|
|
1119
1202
|
description: "Used to sign in and to encrypt your data. Changing it re-encrypts everything in your account.",
|
|
@@ -1124,7 +1207,7 @@ function ConnectedSecuritySection({
|
|
|
1124
1207
|
children
|
|
1125
1208
|
] }),
|
|
1126
1209
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1127
|
-
|
|
1210
|
+
chunkB3WCKBJ7_cjs.PasswordChangeDialog,
|
|
1128
1211
|
{
|
|
1129
1212
|
open,
|
|
1130
1213
|
onClose: form.onCancel,
|
|
@@ -1148,23 +1231,23 @@ function ConnectedSecuritySection({
|
|
|
1148
1231
|
] });
|
|
1149
1232
|
}
|
|
1150
1233
|
function ConnectedNotificationPreferences({
|
|
1151
|
-
categories =
|
|
1234
|
+
categories = chunkB3WCKBJ7_cjs.EMAIL_NOTIFICATION_CATEGORIES,
|
|
1152
1235
|
title = "Notifications"
|
|
1153
1236
|
}) {
|
|
1154
1237
|
const keys = react.useMemo(
|
|
1155
|
-
() => categories ===
|
|
1238
|
+
() => categories === chunkB3WCKBJ7_cjs.EMAIL_NOTIFICATION_CATEGORIES ? chunkB3WCKBJ7_cjs.EMAIL_NOTIFICATION_KEYS : categories.map((c) => c.key),
|
|
1156
1239
|
[categories]
|
|
1157
1240
|
);
|
|
1158
1241
|
const prefs = react$1.useNotificationPreferences(keys);
|
|
1159
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1160
|
-
|
|
1242
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkB3WCKBJ7_cjs.SettingsSection, { title, children: /* @__PURE__ */ jsxRuntime.jsx(chunkB3WCKBJ7_cjs.SettingsCard, { className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1243
|
+
chunkB3WCKBJ7_cjs.NotificationCategoryList,
|
|
1161
1244
|
{
|
|
1162
1245
|
masterId: "emailNotifications",
|
|
1163
1246
|
masterTitle: "Email Notifications",
|
|
1164
1247
|
masterDescription: "Email me about activity when I\u2019m away",
|
|
1165
1248
|
masterChecked: prefs.masterChecked,
|
|
1166
1249
|
onMasterChange: prefs.setAll,
|
|
1167
|
-
categories:
|
|
1250
|
+
categories: chunkB3WCKBJ7_cjs.toNotificationCategories(prefs.checked, categories),
|
|
1168
1251
|
onCategoryChange: prefs.setCategory
|
|
1169
1252
|
}
|
|
1170
1253
|
) }) });
|
|
@@ -1178,14 +1261,14 @@ function ConnectedSessionsRow({
|
|
|
1178
1261
|
const sessions = react$1.useSessions({ enabled: open });
|
|
1179
1262
|
const currentSessionId = react$1.useCurrentSessionId();
|
|
1180
1263
|
const terminate = react$1.useTerminateSession();
|
|
1181
|
-
const views =
|
|
1264
|
+
const views = chunkB3WCKBJ7_cjs.toActiveSessionViews(sessions.data ?? [], {
|
|
1182
1265
|
currentSessionId,
|
|
1183
1266
|
terminatingId: terminate.isPending ? terminate.variables : null,
|
|
1184
1267
|
renderIcon: renderSessionIcon
|
|
1185
1268
|
});
|
|
1186
1269
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1187
1270
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1188
|
-
|
|
1271
|
+
chunkB3WCKBJ7_cjs.SettingsRow,
|
|
1189
1272
|
{
|
|
1190
1273
|
label: "Active sessions",
|
|
1191
1274
|
description: "Devices and agents currently signed in to your account.",
|
|
@@ -1207,7 +1290,7 @@ function ConnectedSessionsRow({
|
|
|
1207
1290
|
}
|
|
1208
1291
|
),
|
|
1209
1292
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1210
|
-
|
|
1293
|
+
chunkB3WCKBJ7_cjs.ActiveSessionsDialog,
|
|
1211
1294
|
{
|
|
1212
1295
|
open,
|
|
1213
1296
|
onOpenChange: setOpen,
|
|
@@ -1242,7 +1325,7 @@ function ConnectedLogoutDialog({
|
|
|
1242
1325
|
const sessions = react$1.useSessions({ enabled: open });
|
|
1243
1326
|
const logoutAll = react$1.useLogoutAllSessions();
|
|
1244
1327
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1245
|
-
|
|
1328
|
+
chunkB3WCKBJ7_cjs.LogoutDialog,
|
|
1246
1329
|
{
|
|
1247
1330
|
open,
|
|
1248
1331
|
onClose,
|
|
@@ -1256,7 +1339,7 @@ function ConnectedLogoutDialog({
|
|
|
1256
1339
|
},
|
|
1257
1340
|
canLogoutAll: true,
|
|
1258
1341
|
isOnline,
|
|
1259
|
-
sessions:
|
|
1342
|
+
sessions: chunkB3WCKBJ7_cjs.toLogoutSessionViews(sessions.data ?? []),
|
|
1260
1343
|
renderSessionIcon
|
|
1261
1344
|
}
|
|
1262
1345
|
);
|
|
@@ -1275,7 +1358,7 @@ function ConnectedDangerZone({ notify: notify3, renderSubscriptionLink }) {
|
|
|
1275
1358
|
});
|
|
1276
1359
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1277
1360
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1278
|
-
|
|
1361
|
+
chunkB3WCKBJ7_cjs.SettingsDangerZone,
|
|
1279
1362
|
{
|
|
1280
1363
|
isOpen: zoneOpen,
|
|
1281
1364
|
onToggle: () => setZoneOpen((o) => !o),
|
|
@@ -1295,12 +1378,12 @@ function ConnectedDangerZone({ notify: notify3, renderSubscriptionLink }) {
|
|
|
1295
1378
|
}
|
|
1296
1379
|
),
|
|
1297
1380
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1298
|
-
|
|
1381
|
+
chunkB3WCKBJ7_cjs.DeleteAccountDialog,
|
|
1299
1382
|
{
|
|
1300
1383
|
open: dialogOpen,
|
|
1301
1384
|
onClose: flow.onClose,
|
|
1302
1385
|
step: flow.step,
|
|
1303
|
-
blockers:
|
|
1386
|
+
blockers: chunkB3WCKBJ7_cjs.toDeleteBlockerViews(flow.blockers, renderSubscriptionLink),
|
|
1304
1387
|
onContinue: flow.onContinue,
|
|
1305
1388
|
onBack: flow.onBack,
|
|
1306
1389
|
userEmail: user?.email ?? "",
|